Procházet zdrojové kódy

新需求

Signed-off-by: liubaiyan <632697560@qq.com>
liubaiyan před 3 roky
rodič
revize
1b1ffde124
2 změnil soubory, kde provedl 79 přidání a 43 odebrání
  1. 1 1
      package-lock.json
  2. 78 42
      src/views/engineeringScreen/index.vue

+ 1 - 1
package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "golden-eagle-manage-web",
+  "name": "currency-data-visualization'",
   "version": "0.0.0",
   "lockfileVersion": 1,
   "requires": true,

+ 78 - 42
src/views/engineeringScreen/index.vue

@@ -652,21 +652,30 @@ export default {
           })
           myChart.on('click', (params) => {
             if (params.name == '维修中' || params.name == '故障中') {
-              this.tableOption.api = getDeviceStatusListOfEngineering
-              this.tableOption.filterForm = {
-                deviceState: params.name == '维修中' ? 2 : 6
-              }
-              this.tableOption.title = params.name == '维修中' ? '维修中设备' : '故障中设备'
-              this.tableOption.type = 'deviceStatus'
-              this.tableOption.pageIndex = 1
-              this.tableOption.data = []
-              this.tableOption.display = true
-              this.getTableList()
+              this.showDeviceStatusTable(params)
+            }
+          })
+          myChart.on('legendselectchanged', (params) => {
+            if (params.name == '维修中' || params.name == '故障中') {
+              this.showDeviceStatusTable(params)
             }
           })
         }
       })
     },
+    //  展示设备状态数据
+    showDeviceStatusTable (params) {
+      this.tableOption.api = getDeviceStatusListOfEngineering
+      this.tableOption.filterForm = {
+        deviceState: params.name == '维修中' ? 2 : 6
+      }
+      this.tableOption.title = params.name == '维修中' ? '维修中设备' : '故障中设备'
+      this.tableOption.type = 'deviceStatus'
+      this.tableOption.pageIndex = 1
+      this.tableOption.data = []
+      this.tableOption.display = true
+      this.getTableList()
+    },
     //  获取设备类型数据
     getDeviceTypeData () {
       getDeviceTypeDataOfEngineering(this.filterForm).then(res => {
@@ -867,22 +876,31 @@ export default {
           })
           myChart.on('click', (params) => {
             if (params.name == '已过期' || params.name == '审核关闭') {
-              this.tableOption.api = getTaskListOfEngineering
-              this.tableOption.filterForm = {
-                lpCategory: 1,
-                taskState: params.name == '已过期' ? 2 : 7
-              }
-              this.tableOption.title = params.name == '过期' ? '过期任务' : '审核关闭任务'
-              this.tableOption.type = 'patrolMaintenanceTask'
-              this.tableOption.pageIndex = 1
-              this.tableOption.data = []
-              this.tableOption.display = true
-              this.getTableList()
+              this.showPatrolTaskTable(params)
+            }
+          })
+          myChart.on('legendselectchanged', (params) => {
+            if (params.name == '已过期' || params.name == '审核关闭') {
+              this.showPatrolTaskTable(params)
             }
           })
         }
       })
     },
+    //  展示巡检任务数据
+    showPatrolTaskTable (params) {
+      this.tableOption.api = getTaskListOfEngineering
+      this.tableOption.filterForm = {
+        lpCategory: 1,
+        taskState: params.name == '已过期' ? 2 : 7
+      }
+      this.tableOption.title = params.name == '过期' ? '过期任务' : '审核关闭任务'
+      this.tableOption.type = 'patrolMaintenanceTask'
+      this.tableOption.pageIndex = 1
+      this.tableOption.data = []
+      this.tableOption.display = true
+      this.getTableList()
+    },
     //  获取预警信息数据
     getWarningInfoData () {
       getWarningInfoDataOfEngineering(this.filterForm).then(res => {
@@ -988,21 +1006,30 @@ export default {
           })
           myChart.on('click', (params) => {
             if (params.name == '待处理' || params.name == '已超期') {
-              this.tableOption.api = getDeviceTaskListOfEngineering
-              this.tableOption.filterForm = {
-                warningStatus: params.name == '待处理' ? 0 : 2
-              }
-              this.tableOption.title = params.name == '待处理' ? '待处理任务' : '已超期任务'
-              this.tableOption.type = 'deviceTask'
-              this.tableOption.pageIndex = 1
-              this.tableOption.data = []
-              this.tableOption.display = true
-              this.getTableList()
+              this.showDeviceTaskTable(params)
+            }
+          })
+          myChart.on('legendselectchanged', (params) => {
+            if (params.name == '待处理' || params.name == '已超期') {
+              this.showDeviceTaskTable(params)
             }
           })
         }
       })
     },
+    //  展示设备大检任务数据
+    showDeviceTaskTable (params) {
+      this.tableOption.api = getDeviceTaskListOfEngineering
+      this.tableOption.filterForm = {
+        warningStatus: params.name == '待处理' ? 0 : 2
+      }
+      this.tableOption.title = params.name == '待处理' ? '待处理任务' : '已超期任务'
+      this.tableOption.type = 'deviceTask'
+      this.tableOption.pageIndex = 1
+      this.tableOption.data = []
+      this.tableOption.display = true
+      this.getTableList()
+    },
     //  获取维保任务数据
     getMaintenanceTaskData () {
       const that = this
@@ -1098,22 +1125,31 @@ export default {
           })
           myChart.on('click', (params) => {
             if (params.name == '已过期' || params.name == '审核关闭') {
-              this.tableOption.api = getTaskListOfEngineering
-              this.tableOption.filterForm = {
-                lpCategory: 2,
-                taskState: params.name == '已过期' ? 2 : 7
-              }
-              this.tableOption.title = params.name == '过期' ? '过期任务' : '审核关闭任务'
-              this.tableOption.type = 'patrolMaintenanceTask'
-              this.tableOption.pageIndex = 1
-              this.tableOption.data = []
-              this.tableOption.display = true
-              this.getTableList()
+              this.showMaintenanceTaskTable(params)
+            }
+          })
+          myChart.on('legendselectchanged', (params) => {
+            if (params.name == '已过期' || params.name == '审核关闭') {
+              this.showMaintenanceTaskTable(params)
             }
           })
         }
       })
     },
+    //  展示维保任务数据
+    showMaintenanceTaskTable (params) {
+      this.tableOption.api = getTaskListOfEngineering
+      this.tableOption.filterForm = {
+        lpCategory: 2,
+        taskState: params.name == '已过期' ? 2 : 7
+      }
+      this.tableOption.title = params.name == '过期' ? '过期任务' : '审核关闭任务'
+      this.tableOption.type = 'patrolMaintenanceTask'
+      this.tableOption.pageIndex = 1
+      this.tableOption.data = []
+      this.tableOption.display = true
+      this.getTableList()
+    },
     //  切换页面
     handlePageChange (val) {
       this.tableOption.pageIndex = val