Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
e93fba4bb6

+ 1 - 0
src/xt_pages/qcd/basicInformationAnalysis.vue View File

@@ -559,6 +559,7 @@ export default {
559 559
       getTotalAgeCount(timeStar,timeEnd).then(response=>{
560 560
          if(response.data.state == 1){
561 561
           var ageCount =  response.data.data.ageCount
562
+          console.log("ageCount",ageCount)
562 563
           var arr = []
563 564
           arr =  ageCount.sort(this.compare('age'))
564 565
           this.ageCount = arr

+ 5 - 2
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue View File

@@ -278,11 +278,14 @@ export default {
278 278
             res.map(item => {
279 279
               this.modesData.series.push(parseInt(item.Count));
280 280
             })
281
-
281
+             console.log("this=====",this.tableData)
282 282
             for (const key in this.tableData) {
283 283
               this.modesData.xAxis.push(this.tableData[key].project_name);
284
+               let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
285
+               let day = parseInt(time / (1000 * 60 * 60 * 24))
286
+              this.obj.push(Math.round(day / this.tableData[key].inspection_frequency))
284 287
             }
285
- 
288
+            
286 289
             this.chart.series[0].data = this.modesData.series
287 290
             this.chart.xAxis.data = this.modesData.xAxis
288 291
           }

+ 30 - 30
src/xt_permission.js View File

@@ -1,59 +1,59 @@
1
-import router from "./router";
2
-import store from "./store";
3
-import NProgress from "nprogress"; // progress bar
4
-import "nprogress/nprogress.css"; // progress bar style
1
+import router from './router'
2
+import store from './store'
3
+import NProgress from 'nprogress' // progress bar
4
+import 'nprogress/nprogress.css' // progress bar style
5 5
 
6 6
 NProgress.configure({
7 7
   showSpinner: false
8
-}); // NProgress Configuration
8
+}) // NProgress Configuration
9 9
 
10
-const loginWhiteList = ["/token/verify", "/401", "/404"]; // 登录验证白名单
11
-const permissionWhiteList = loginWhiteList.concat(["/"]); // 权限验证白名单
10
+const loginWhiteList = ['/token/verify', '/401', '/404'] // 登录验证白名单
11
+const permissionWhiteList = loginWhiteList.concat(['/']) // 权限验证白名单
12 12
 
13 13
 router.beforeEach((to, from, next) => {
14 14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //  store.dispatch('VerifyConfigList', []).then(() => {
17
-  //    next()
18
-  // })
19
-  // }
20
-  // if (store.getters.permission_routers === undefined) {
21
-  //  store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //    next()
23
-  //  })
24
-  // } else {
25
-  //   next()
26
-  // }
27
-  // return
15
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+    store.dispatch('VerifyConfigList', []).then(() => {
17
+      next()
18
+    })
19
+  }
20
+  if (store.getters.permission_routers === undefined) {
21
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+      next()
23
+    })
24
+  } else {
25
+    next()
26
+  }
27
+  return
28 28
   // 线上注释
29 29
 
30
-  NProgress.start();
30
+  NProgress.start()
31 31
   // console.log(store.getters.current_role_urls.indexOf(to.path))
32 32
   // alert('path:' + to.path)
33 33
   // 如果 url 带有 lt (login_token)参数,则跳转到验证 token 时等待的页面
34 34
   if (to.query.lt != null && to.query.lt.length > 0) {
35 35
     // alert('will go to verify token: ' + to.query.lt)
36 36
     next({
37
-      path: "/token/verify",
37
+      path: '/token/verify',
38 38
       query: {
39 39
         token: to.query.lt
40 40
       }
41
-    });
41
+    })
42 42
 
43 43
     // 否则 如果没有 user 信息,则前往 sso 登录
44 44
   } else if (store.getters.xt_user.user.id === 0) {
45 45
     if (loginWhiteList.indexOf(to.path) !== -1) {
46 46
       // alert('登录白名单内,跳过登录')
47
-      next();
47
+      next()
48 48
     } else {
49 49
       // alert('前往登录')
50
-      window.location.href = process.env.BASE_API + "/login"; // sso 地址
50
+      window.location.href = process.env.BASE_API + '/login' // sso 地址
51 51
     }
52 52
 
53 53
     // 否则 如果当前 url 不需要验证访问权限,则通过
54 54
   } else if (permissionWhiteList.indexOf(to.path) !== -1) {
55 55
     // alert('权限验证白名单内,直接进入')
56
-    next();
56
+    next()
57 57
 
58 58
     // 否则 如果拥有当前 url 的权限,则通过
59 59
     // } else if (store.getters.current_role_urls.indexOf(to.path) !== -1) {
@@ -65,11 +65,11 @@ router.beforeEach((to, from, next) => {
65 65
     // console.log(store.getters.current_role_urls)
66 66
     // console.log(store.getters.current_role_urls.indexOf(to.path))
67 67
     // alert('401')
68
-    next();
68
+    next()
69 69
     // next({ path: '/404' })
70 70
   }
71
-});
71
+})
72 72
 
73 73
 router.afterEach(() => {
74
-  NProgress.done();
75
-});
74
+  NProgress.done()
75
+})