Sfoglia il codice sorgente

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

See999 4 anni fa
parent
commit
40fb279c71

+ 79 - 11
src/xt_pages/qcd/patientComplianceDetails.vue Vedi File

@@ -263,14 +263,14 @@ export default {
263 263
                   color: (params) => {
264 264
                     //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
265 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 276
                     // var index = params.dataIndex;
@@ -299,7 +299,25 @@ export default {
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 322
       chart: {
305 323
         title: {
@@ -378,7 +396,25 @@ export default {
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 419
       inspect_date:0,
384 420
       monthActive:0,
@@ -592,6 +628,11 @@ export default {
592 628
             }
593 629
             this.chart.series[0].data = this.modesData.series
594 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,11 +690,18 @@ export default {
649 690
                   this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
650 691
                   this.char2.series[0].name = list[i].range_value
651 692
                 }
652
-              
693
+                
694
+
653 695
             
654 696
             }
655 697
               this.chart.series[0].data = this.modesData.series
656 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,6 +732,26 @@ export default {
684 732
          }
685 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 757
    created(){

+ 35 - 6
src/xt_pages/qcd/patientControlAnalysis.vue Vedi File

@@ -346,7 +346,7 @@ export default {
346 346
       getNormData().then(response=>{
347 347
          if(response.data.state == 1){
348 348
            var normdata = response.data.data.normdata
349
-        //  console.log("normdata",normdata)
349
+         console.log("normdata",normdata)
350 350
           this.normData = normdata
351 351
            var a=[];
352 352
            for(let i=0;i<normdata.length;i++){
@@ -495,15 +495,44 @@ export default {
495 495
            var patients = response.data.data.patients
496 496
             console.log("patients",patients)
497 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 515
             var total = response.data.data.total
499 516
             this.total = total
500 517
             var control = response.data.data.control
518
+            console.log("control",control)
501 519
            var infectiousControl =  response.data.data.infectiousControl
502
-        
520
+          // console.log("infectiouscontrol",infectiousControl)
503 521
            infectiousControl.map(item=>{
504 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 536
             var newArr = []
508 537
             // 分页
509 538
             for (let i = 0; i < control.length; i++) {
@@ -513,7 +542,7 @@ export default {
513 542
                 }
514 543
               }
515 544
             }
516
-       
545
+        
517 546
           let dataInfo = {}
518 547
           newArr.forEach((item, index) => {
519 548
             let { inspect_date } = item
@@ -554,7 +583,7 @@ export default {
554 583
               }
555 584
             }
556 585
           }
557
-
586
+           console.log("arrthree",arrthree)
558 587
           var arrfour = this.arrayDate(arrthree, newarrtwo)
559 588
           arrfour.map(item => {
560 589
             item.item_name = ''
@@ -600,7 +629,7 @@ export default {
600 629
             }
601 630
             this.tableData.push({ name: key, data: dd[key]})
602 631
           }
603
-
632
+           
604 633
           listtwo.map(item=>{
605 634
             this.tableData.map(it=>{
606 635
               if(item.inspect_date == parseInt(it.name)){

+ 1 - 1
src/xt_pages/qcd/statisticalConfiguration.vue Vedi File

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