From 771e0da9c6082c78a28f5286f89f4f36b05689d3 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期二, 27 十二月 2022 14:31:45 +0800
Subject: [PATCH] 默认更改列表

---
 src/views/doubleIndex/saftyScreen/components/screen.vue |   83 +++++++++++++++++++++++++----------------
 1 files changed, 50 insertions(+), 33 deletions(-)

diff --git a/src/views/doubleIndex/saftyScreen/components/screen.vue b/src/views/doubleIndex/saftyScreen/components/screen.vue
index e7a11bb..1b881c6 100644
--- a/src/views/doubleIndex/saftyScreen/components/screen.vue
+++ b/src/views/doubleIndex/saftyScreen/components/screen.vue
@@ -278,7 +278,8 @@
                 blindPlatePluggingCount: [],
                 riskEventConfig: {},
                 riskStatusConfig: {},
-                deviceConfig: {}
+                deviceConfig: {},
+                myVar: null
             };
         },
         created(){
@@ -310,9 +311,11 @@
                 this.$router.push({
                     path:"/fullScreen"
                 })
+                this.$parent.clickFullscreen()
             },
             back(){
                 window.history.go(-1);
+                this.$parent.clickFullscreen()
             },
 
             // 获取部门列表
@@ -515,18 +518,19 @@
                 await this.initRiskLevel()
             },
             changeInspectionTask() {
-                this.updateMission(this.personListQuery)
+                this.updateMission(this.taskListQuery)
             },
             changeTimeTask(){
                 if(this.value3 !== null){
-                    this.taskListQuery.startTime = this.value1[0]
-                    this.taskListQuery.endTime = this.value1[1]
+                    this.taskListQuery.startTime = this.value3[0]
+                    this.taskListQuery.endTime = this.value3[1]
                 }
-                this.updateMission(this.personListQuery)
+                this.updateMission(this.taskListQuery)
             },
 
             // 各部门预约
             initAppoint(){
+                const t = this
                 const dom = document.getElementById(this.appointId);
                 let myChart = this.$echarts.init(dom, null, {
                     renderer: 'canvas',
@@ -570,21 +574,16 @@
                             type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
                         }
                     },
-                    dataZoom: {
-                        type: 'slider',
-                        show: true,
-                        showDetails: true,
-                        textStyle: {
-                          color: '#fff'
+                    dataZoom: [
+                        //滑动条
+                        {
+                            yAxisIndex: 0, //这里是从X轴的0刻度开始
+                            show: false, //是否显示滑动条,不影响使用
+                            type: "slider", // 这个 dataZoom 组件是 slider 型 dataZoom 组件
+                            startValue: 0, // 从头开始。
+                            endValue: 6, // 一次性展示几个。
                         },
-                        realtime: true,
-                        right: 10,
-                        height: 200,
-                        width: 15,
-                        start: 50,
-                        end: 100,
-                        orient: 'vertical'
-                    },
+                    ],
                         legend: {
                         textStyle: {
                             color: '#fff',
@@ -637,7 +636,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.hotCount
+                            data: t.hotCount
                         },
                         {
                             name: '受限空间作业',
@@ -649,7 +648,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.confinedSpaceCount
+                            data: t.confinedSpaceCount
                         },
                         {
                             name: '吊装作业',
@@ -661,7 +660,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.liftingCount
+                            data: t.liftingCount
                         },
                         {
                             name: '动土作业',
@@ -673,7 +672,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.groundBreakingCount
+                            data: t.groundBreakingCount
                         },
                         {
                             name: '断路作业',
@@ -685,7 +684,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.openCircuitCout
+                            data: t.openCircuitCout
                         },
                         {
                             name: '高处作业',
@@ -697,7 +696,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.heightCount
+                            data: t.heightCount
                         },
                         {
                             name: '临时用电作业',
@@ -709,7 +708,7 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.temporaryPowerCount
+                            data: t.temporaryPowerCount
                         },
                         {
                             name: '盲板抽堵作业',
@@ -721,15 +720,24 @@
                             emphasis: {
                                 focus: 'series'
                             },
-                            data: this.blindPlatePluggingCount
+                            data: t.blindPlatePluggingCount
                         }
                     ]
                 };
 
                 if (option && typeof option === 'object') {
                     myChart.setOption(option);
+                    t.myVar = window.setInterval(function(){
+                        if (option.dataZoom[0].endValue == t.depList.length ) {
+                            option.dataZoom[0].endValue = 6;
+                            option.dataZoom[0].startValue = 0;
+                        } else {
+                            option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1;
+                            option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1;
+                        }
+                        myChart.setOption(option);
+                    }, 6000)
                 }
-
                 window.addEventListener('resize', myChart.resize);
                 setTimeout(()=>{
                     myChart.resize
@@ -878,7 +886,7 @@
                     },
                     series: [
                         {
-                            name: '任务数量',
+                            name: '当日认领数量',
                             type: 'bar',
                             data: this.claimedData,
                             itemStyle:{
@@ -886,7 +894,7 @@
                             }
                         },
                         {
-                            name: '已完成',
+                            name: '当日完成数量',
                             type: 'bar',
                             data: this.completedData,
                             itemStyle:{
@@ -894,7 +902,7 @@
                             }
                         },
                         {
-                            name: '未完成',
+                            name: '累计领取未完成数量',
                             type: 'bar',
                             data: this.uncompletedData,
                             itemStyle:{
@@ -913,6 +921,15 @@
                     myChart.resize
                 },500)
             }
+        },
+        beforeDestroy(){
+            window.clearInterval(this.myVar)
+            this.myVar = null
+        },
+        destroyed(){
+            // 离开当前路由后的操作
+            window.clearInterval(this.myVar)
+            this.myVar = null
         }
     }
 </script>
@@ -1195,7 +1212,7 @@
         .main-cont {
             display: grid;
             grid-template-columns: repeat(3, minmax(100px, 1fr));
-            grid-template-rows: repeat(2, 1fr);
+            grid-template-rows: repeat(2, calc(50% - 20px));
             grid-auto-flow: row;
             padding: 10px;
             margin-bottom: 20px;
@@ -1237,7 +1254,7 @@
         .main-cont {
             display: grid;
             grid-template-columns: repeat(3, minmax(100px, 1fr));
-            grid-template-rows: repeat(2, 1fr);
+            grid-template-rows: repeat(2, calc((100% - 35px)/2));
             grid-auto-flow: row;
             padding: 10px;
             margin-bottom: 20px;

--
Gitblit v1.9.2