浏览代码

Merge branch '20200710_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20200710_pc_vue_new_branch

See999 4 年前
父节点
当前提交
40fb279c71

+ 79 - 11
src/xt_pages/qcd/patientComplianceDetails.vue 查看文件

263
                   color: (params) => {
263
                   color: (params) => {
264
                     //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
264
                     //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
265
                     var colorList = [
265
                     var colorList = [
266
-                      ['#409EFF','#409EFF'],
267
-                      ['#f56c6c','#f56c6c']
268
-                      ];
269
-                    if(params.seriesName == this.otherData[params.dataIndex]){
270
-                      var index = 0 
271
-                    }else {
272
-                      var index = 1
273
-                    }
266
+                ['#409EFF','#409EFF'],
267
+                ['#f56c6c','#f56c6c']
268
+                ];
269
+              if(params.seriesName == this.otherData[params.dataIndex]){
270
+                var index = 0 
271
+                  }else {
272
+                  var index = 1
273
+                 }
274
                    
274
                    
275
 
275
 
276
                     // var index = params.dataIndex;
276
                     // var index = params.dataIndex;
299
                 }
299
                 }
300
               }
300
               }
301
             }
301
             }
302
-          ]
302
+          ],
303
+           dataZoom: [
304
+            {
305
+              //Y轴固定,让内容滚动
306
+              type: "slider",
307
+              show: false,
308
+              xAxisIndex: [0],
309
+              start: 1,
310
+              end: 20, //设置X轴刻度之间的间隔(根据数据量来调整)
311
+              zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
312
+            },
313
+            {
314
+              type: "inside",
315
+              xAxisIndex: [0],
316
+              start: 1,
317
+              end: 20,
318
+              zoomLock: true //锁定区域禁止缩放
319
+            }
320
+          ],
303
         },
321
         },
304
       chart: {
322
       chart: {
305
         title: {
323
         title: {
378
               }
396
               }
379
             }
397
             }
380
           }
398
           }
381
-        ]
399
+        ],
400
+         dataZoom: [
401
+            {
402
+              //Y轴固定,让内容滚动
403
+              type: "slider",
404
+              show: false,
405
+              xAxisIndex: [0],
406
+              start: 1,
407
+              end: 20, //设置X轴刻度之间的间隔(根据数据量来调整)
408
+              zoomLock: true //锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
409
+            },
410
+            {
411
+              type: "inside",
412
+              xAxisIndex: [0],
413
+              start: 1,
414
+              end: 20,
415
+              zoomLock: true //锁定区域禁止缩放
416
+            }
417
+          ],
382
       },
418
       },
383
       inspect_date:0,
419
       inspect_date:0,
384
       monthActive:0,
420
       monthActive:0,
592
             }
628
             }
593
             this.chart.series[0].data = this.modesData.series
629
             this.chart.series[0].data = this.modesData.series
594
             this.chart.xAxis.data = this.modesData.xAxis
630
             this.chart.xAxis.data = this.modesData.xAxis
631
+            if(this.rangetype == 1){
632
+                this.getArrLength(this.chart.xAxis.data,1)
633
+              }else{
634
+                this.getArrLength(this.char2.xAxis.data,2)
635
+              }
595
        
636
        
596
           }
637
           }
597
 
638
 
649
                   this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
690
                   this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
650
                   this.char2.series[0].name = list[i].range_value
691
                   this.char2.series[0].name = list[i].range_value
651
                 }
692
                 }
652
-              
693
+                
694
+
653
             
695
             
654
             }
696
             }
655
               this.chart.series[0].data = this.modesData.series
697
               this.chart.series[0].data = this.modesData.series
656
               this.chart.xAxis.data = this.modesData.xAxis
698
               this.chart.xAxis.data = this.modesData.xAxis
699
+
700
+              if(this.rangetype == 1){
701
+                this.getArrLength(this.chart.xAxis.data,1)
702
+              }else{
703
+                this.getArrLength(this.char2.xAxis.data,2)
704
+              }
657
             }
705
             }
658
        })
706
        })
659
     },
707
     },
684
          }
732
          }
685
         this.getlistDetail()
733
         this.getlistDetail()
686
       },
734
       },
735
+      getArrLength(result,type){
736
+        if(type == 1){
737
+          if(result.length > 10){
738
+            var dataZoom_end = (10/result.length)*100;
739
+            this.chart.dataZoom[0].end = dataZoom_end
740
+          }else{
741
+            var dataZoom_end = 100;
742
+            this.chart.dataZoom[0].end = dataZoom_end
743
+          }
744
+        }else{
745
+          if(result.length > 10){
746
+            var dataZoom_end = (10/result.length)*100;
747
+            this.char2.dataZoom[0].end = dataZoom_end
748
+          }else{
749
+            var dataZoom_end = 100;
750
+            this.char2.dataZoom[0].end = dataZoom_end
751
+          }
752
+        }
753
+
754
+      }
687
   },
755
   },
688
 
756
 
689
    created(){
757
    created(){

+ 35 - 6
src/xt_pages/qcd/patientControlAnalysis.vue 查看文件

346
       getNormData().then(response=>{
346
       getNormData().then(response=>{
347
          if(response.data.state == 1){
347
          if(response.data.state == 1){
348
            var normdata = response.data.data.normdata
348
            var normdata = response.data.data.normdata
349
-        //  console.log("normdata",normdata)
349
+         console.log("normdata",normdata)
350
           this.normData = normdata
350
           this.normData = normdata
351
            var a=[];
351
            var a=[];
352
            for(let i=0;i<normdata.length;i++){
352
            for(let i=0;i<normdata.length;i++){
495
            var patients = response.data.data.patients
495
            var patients = response.data.data.patients
496
             console.log("patients",patients)
496
             console.log("patients",patients)
497
             this.tablePatients = patients
497
             this.tablePatients = patients
498
+            
499
+            //  let dataInfothree = {}
500
+            //   patients.forEach((item, index) => {
501
+            //     let { inspect_date } = item
502
+            //     if (!dataInfothree[inspect_date]) {
503
+            //       dataInfothree[inspect_date] = {
504
+            //         inspect_date,
505
+            //         name: item.name,
506
+            //         child: [],
507
+            //         patient_id: item.patient_id,
508
+            //       }
509
+            //     }
510
+            //   })
511
+            // let patientlist = Object.values(dataInfothree)
512
+            // console.log("patientlist",patientlist)
513
+
514
+ 
498
             var total = response.data.data.total
515
             var total = response.data.data.total
499
             this.total = total
516
             this.total = total
500
             var control = response.data.data.control
517
             var control = response.data.data.control
518
+            console.log("control",control)
501
            var infectiousControl =  response.data.data.infectiousControl
519
            var infectiousControl =  response.data.data.infectiousControl
502
-        
520
+          // console.log("infectiouscontrol",infectiousControl)
503
            infectiousControl.map(item=>{
521
            infectiousControl.map(item=>{
504
              control.push(item)
522
              control.push(item)
505
            })
523
            })
506
-       
524
+          console.log("infectiouscontrol",infectiousControl)
525
+          
526
+        //  var newPatinteArr = [] 
527
+        //  patientlist.map(item=>{
528
+        //    for(let i=0;i<control.length;i++){
529
+        //       if(item.inspect_date == control[i].inspect_date && item.patient_id == control[i].patient_id){
530
+        //            item.child.push(control[i])
531
+        //       }
532
+        //    }
533
+        //  })
534
+        //  console.log("patientlist",patientlist)
535
+         
507
             var newArr = []
536
             var newArr = []
508
             // 分页
537
             // 分页
509
             for (let i = 0; i < control.length; i++) {
538
             for (let i = 0; i < control.length; i++) {
513
                 }
542
                 }
514
               }
543
               }
515
             }
544
             }
516
-       
545
+        
517
           let dataInfo = {}
546
           let dataInfo = {}
518
           newArr.forEach((item, index) => {
547
           newArr.forEach((item, index) => {
519
             let { inspect_date } = item
548
             let { inspect_date } = item
554
               }
583
               }
555
             }
584
             }
556
           }
585
           }
557
-
586
+           console.log("arrthree",arrthree)
558
           var arrfour = this.arrayDate(arrthree, newarrtwo)
587
           var arrfour = this.arrayDate(arrthree, newarrtwo)
559
           arrfour.map(item => {
588
           arrfour.map(item => {
560
             item.item_name = ''
589
             item.item_name = ''
600
             }
629
             }
601
             this.tableData.push({ name: key, data: dd[key]})
630
             this.tableData.push({ name: key, data: dd[key]})
602
           }
631
           }
603
-
632
+           
604
           listtwo.map(item=>{
633
           listtwo.map(item=>{
605
             this.tableData.map(it=>{
634
             this.tableData.map(it=>{
606
               if(item.inspect_date == parseInt(it.name)){
635
               if(item.inspect_date == parseInt(it.name)){

+ 1 - 1
src/xt_pages/qcd/statisticalConfiguration.vue 查看文件

297
       getInspectionMajor().then(response=>{
297
       getInspectionMajor().then(response=>{
298
         if(response.data.state == 1){
298
         if(response.data.state == 1){
299
           var inspection =  response.data.data.inspection
299
           var inspection =  response.data.data.inspection
300
-          // console.log("大项是什么",inspection)
300
+           console.log("大项是什么",inspection)
301
           this.InspectionMajor = inspection
301
           this.InspectionMajor = inspection
302
          
302
          
303
         }
303
         }