Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
e93fba4bb6

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

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

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

278
             res.map(item => {
278
             res.map(item => {
279
               this.modesData.series.push(parseInt(item.Count));
279
               this.modesData.series.push(parseInt(item.Count));
280
             })
280
             })
281
-
281
+             console.log("this=====",this.tableData)
282
             for (const key in this.tableData) {
282
             for (const key in this.tableData) {
283
               this.modesData.xAxis.push(this.tableData[key].project_name);
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
             this.chart.series[0].data = this.modesData.series
289
             this.chart.series[0].data = this.modesData.series
287
             this.chart.xAxis.data = this.modesData.xAxis
290
             this.chart.xAxis.data = this.modesData.xAxis
288
           }
291
           }

+ 30 - 30
src/xt_permission.js View File

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
 NProgress.configure({
6
 NProgress.configure({
7
   showSpinner: false
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
 router.beforeEach((to, from, next) => {
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
   // console.log(store.getters.current_role_urls.indexOf(to.path))
31
   // console.log(store.getters.current_role_urls.indexOf(to.path))
32
   // alert('path:' + to.path)
32
   // alert('path:' + to.path)
33
   // 如果 url 带有 lt (login_token)参数,则跳转到验证 token 时等待的页面
33
   // 如果 url 带有 lt (login_token)参数,则跳转到验证 token 时等待的页面
34
   if (to.query.lt != null && to.query.lt.length > 0) {
34
   if (to.query.lt != null && to.query.lt.length > 0) {
35
     // alert('will go to verify token: ' + to.query.lt)
35
     // alert('will go to verify token: ' + to.query.lt)
36
     next({
36
     next({
37
-      path: "/token/verify",
37
+      path: '/token/verify',
38
       query: {
38
       query: {
39
         token: to.query.lt
39
         token: to.query.lt
40
       }
40
       }
41
-    });
41
+    })
42
 
42
 
43
     // 否则 如果没有 user 信息,则前往 sso 登录
43
     // 否则 如果没有 user 信息,则前往 sso 登录
44
   } else if (store.getters.xt_user.user.id === 0) {
44
   } else if (store.getters.xt_user.user.id === 0) {
45
     if (loginWhiteList.indexOf(to.path) !== -1) {
45
     if (loginWhiteList.indexOf(to.path) !== -1) {
46
       // alert('登录白名单内,跳过登录')
46
       // alert('登录白名单内,跳过登录')
47
-      next();
47
+      next()
48
     } else {
48
     } else {
49
       // alert('前往登录')
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
     // 否则 如果当前 url 不需要验证访问权限,则通过
53
     // 否则 如果当前 url 不需要验证访问权限,则通过
54
   } else if (permissionWhiteList.indexOf(to.path) !== -1) {
54
   } else if (permissionWhiteList.indexOf(to.path) !== -1) {
55
     // alert('权限验证白名单内,直接进入')
55
     // alert('权限验证白名单内,直接进入')
56
-    next();
56
+    next()
57
 
57
 
58
     // 否则 如果拥有当前 url 的权限,则通过
58
     // 否则 如果拥有当前 url 的权限,则通过
59
     // } else if (store.getters.current_role_urls.indexOf(to.path) !== -1) {
59
     // } else if (store.getters.current_role_urls.indexOf(to.path) !== -1) {
65
     // console.log(store.getters.current_role_urls)
65
     // console.log(store.getters.current_role_urls)
66
     // console.log(store.getters.current_role_urls.indexOf(to.path))
66
     // console.log(store.getters.current_role_urls.indexOf(to.path))
67
     // alert('401')
67
     // alert('401')
68
-    next();
68
+    next()
69
     // next({ path: '/404' })
69
     // next({ path: '/404' })
70
   }
70
   }
71
-});
71
+})
72
 
72
 
73
 router.afterEach(() => {
73
 router.afterEach(() => {
74
-  NProgress.done();
75
-});
74
+  NProgress.done()
75
+})