isv-robot 2 роки тому
батько
коміт
4571e03029

+ 6 - 4
src/api/dashboard-json.js

@@ -1,4 +1,6 @@
 import request from '@/utils/request'
+import dayjs from "dayjs";
+import store from "@/store";
 
 // 电力变配电所
 export function chartDlbpds(params) {
@@ -82,11 +84,11 @@ export function chartMap(params) {
 }
 
 // 牵变、电力设备巡检兑现(本月)
-export function chartQbdlsbxjdx(params) {
+export function chartQbdlsbxjdx(params = {}) {
   return request({
     url: '/chart/qbdlsbxjdx',
     method: 'get',
-    params
+    params: Object.assign({}, params, {date: dayjs(store.state.dashboardTime.time).format('YYYY-MM-DD')})
   })
 }
 
@@ -135,8 +137,8 @@ export function dlycList(params) {
 export function chartTodoList(url, parameter) {
   return request({
     url: '/chart/todoList',
-    params: parameter,
-    method: 'get'
+    method: 'get',
+    params: Object.assign({}, parameter, {date: dayjs(store.state.dashboardTime.time).format('YYYY-MM-DD')})
   })
 }
 

+ 22 - 0
src/store/modules/dashboardTime.js

@@ -0,0 +1,22 @@
+const state = {
+  time: new Date()
+}
+
+const mutations = {
+  SET_TIME: (state, time) => {
+    state.time = time
+  }
+}
+
+const actions = {
+  setTime({commit}, time) {
+    commit('SET_TIME', time)
+  }
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 4 - 3
src/utils/request.js

@@ -5,6 +5,7 @@ import {getToken} from '@/utils/auth'
 import {aesEncrypt_HmacSha256} from './encryption/utils.js'
 import * as queryString from 'query-string'
 import moment from 'moment'
+import dayjs from "dayjs";
 
 // create an axios instance
 const service = axios.create({
@@ -35,6 +36,8 @@ const key = 's#e@5f98H*^his%t'
 // request interceptor
 service.interceptors.request.use(
   config => {
+    window['store'] = store;
+
     if (store.getters.token) {
       config.headers['Authorization'] = getToken()
     }
@@ -62,14 +65,12 @@ service.interceptors.request.use(
       })
     }
 
-    console.log('paramsObject===', paramsObject)
     const queryString1 = queryString.stringify(paramsObject)
-    console.log('queryString1===', queryString1)
     const queryString2 = encodeURIComponent(queryString1).replace('+', '%20').replace('*', '%2A').replace('%7E', '~')
-    console.log('queryString2===', queryString2)
     config.headers['signature'] = aesEncrypt_HmacSha256(queryString2, key)
     config.headers['timestamp'] = moment().format('YYYY-MM-DD HH:mm:ss') // 格式化输出
 
+
     return config
   },
   error => {

+ 4 - 2
src/views/dashboard-screen/chart-map/chartMap.vue

@@ -5,7 +5,7 @@
 
 </template>
 <script>
-import { chartMap } from '@/api/dashboard-json'
+import {chartMap} from '@/api/dashboard-json'
 
 export default {
   name: 'ChartMap',
@@ -62,6 +62,8 @@ export default {
             this.loadImage(findConfig['文件路径'])
           } else if (findConfig && renderType === 0) {
             this.loadDXF(findConfig['名称'], findConfig['文件路径'], findConfig['所亭路径'])
+          } else if (name === '变配电修试队' || name === '电力维修队') {
+            this.loadDXF(name, null, null)
           }
         })
         console.log('data', data)
@@ -86,7 +88,7 @@ export default {
     loadDXF(name, path, stPath) {
       console.log('loadDXF', name, path, stPath)
       const url = `/static${path}`
-      this.openDrawer('变电-电力异常信息', { name, path, stPath })
+      this.openDrawer('变电-电力异常信息', {name, path, stPath})
     }
   }
 }

+ 32 - 12
src/views/dashboard-screen/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="dashboard-container" >
+  <div class="dashboard-container">
     <div class="header">
       <div class="title clickScoop" @click="openDrawer('数据管理')">
         变电配电大数据可视化系统
@@ -7,15 +7,15 @@
       <div class="r-title">
         <span @click="$refs.datePicker.open = true" style="cursor: pointer"> {{ dateTitle }}</span>
         <a-date-picker
-                    :show-today="true"
-                    :locale="localeZH"
-                       @click="$refs.datePicker.open = false"
-                       style="position: absolute;right:20px;top:10px;z-index: -1"
-                       ref="datePicker"
-                       value-format="YYYY-MM-DD"
-                       :value="date"
-                       @change="timeChange"
-                       placeholder="时间"
+          :show-today="true"
+          :locale="localeZH"
+          @click="$refs.datePicker.open = false"
+          style="position: absolute;right:20px;top:10px;z-index: -1"
+          ref="datePicker"
+          value-format="YYYY-MM-DD"
+          :value="date"
+          @change="timeChange"
+          placeholder="时间"
         />
       </div>
     </div>
@@ -113,7 +113,7 @@
       size="100%"
       :direction="drawer.direction"
     >
-      <component :is="drawer.comp" :params="drawer.params"/>
+      <component :is="drawer.comp" :params="drawer.params" @freshRender="freshRender"/>
     </el-drawer>
   </div>
 </template>
@@ -144,7 +144,19 @@ import * as _ from 'lodash'
 require('dayjs/locale/zh-cn')
 export default {
   name: 'Dashboard',
-  components: {ChartMap, Jryl, QbDlsbxjdx, Jxdxqk, Zydbsx, Dlbpds, Dlsdxl, CardWrap, SyjhdxqkChart, Dlydtssx},
+  components: {
+    ChartMap,
+    Jryl,
+    QbDlsbxjdx,
+    Jxdxqk,
+    Zydbsx,
+    Dlbpds,
+    Dlsdxl,
+    CardWrap,
+    SyjhdxqkChart,
+    Dlydtssx,
+    ScreenSjdr
+  },
   data() {
     return {
       render: true,
@@ -168,6 +180,11 @@ export default {
     }
   },
   created() {
+    this.$store.dispatch('setTime', dayjs(new Date()).format('YYYY-MM-DD'))
+    this.$on('freshRender', () => {
+      console.log('freshRender')
+      this.freshRender()
+    })
     const doResize = _.debounce(() => {
       console.log('doResize')
       // this.freshRender()
@@ -182,9 +199,11 @@ export default {
   methods: {
     timeChange(evt) {
       console.log('evt', evt)
+      this.$store.commit('dashboardTime/SET_TIME', dayjs(evt).format('YYYY-MM-DD'))
       this.date = dayjs(evt).locale('zh-cn')
       this.dateTitle = dayjs(evt).locale('zh-cn').format('YYYY年MM月DD日  星期dd')
       this.$refs.datePicker.open = false
+      this.freshRender()
     },
     openDrawer(title, params = {}) {
       const map = {
@@ -206,6 +225,7 @@ export default {
       this.drawer = Object.assign({}, this.drawer)
     },
     freshRender() {
+      console.log('on freshRender')
       this.render = false
       setTimeout(() => {
         this.render = true

+ 26 - 0
src/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/ScreenBdDlYcxx.vue

@@ -97,6 +97,32 @@ export default {
         this.activeKey = 'GqImg'
       }
       this.selectList = selectList
+
+      if (this.params?.name === '变配电修试队' || this.params?.name === '电力维修队') {
+        this.selectedGQ = {
+          dictValue: this.params?.name
+        }
+        if (this.params?.name === '变配电修试队') {
+          this.tabs = [{
+            title: '(推送)变电异常信息',
+            name: 'Bd'
+          }, {
+            title: '(推送)电力异常信息',
+            name: 'Dl'
+          }]
+          this.activeKey = 'Bd'
+        } else {
+          this.tabs = [{
+            title: '(自主发现)变电异常信息',
+            name: 'ZzBd'
+          },
+            {
+              title: '(自主发现)电力异常信息',
+              name: 'ZzDl'
+            }]
+          this.activeKey = 'ZzBd'
+        }
+      }
     }
   }
 }

+ 8 - 0
src/views/dashboard-screen/screen/sjdr/dlydts/index.vue

@@ -75,10 +75,18 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
+
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }

+ 17 - 16
src/views/dashboard-screen/screen/sjdr/index.vue

@@ -11,6 +11,7 @@
           <component
             :is="item.name"
             v-if="activeKey === item.name"
+            @freshRender="$emit('freshRender',{})"
           />
         </a-tab-pane>
       </a-tabs>
@@ -45,22 +46,22 @@ export default {
         name: 'Ycxx'
       },
 
-      {
-        title: '变配电所检修兑现情况',
-        name: 'Tab3'
-      },
-      {
-        title: '牵变检修兑现情况',
-        name: 'Syjhdxqk'
-      },
-      {
-        title: '电力远动调试',
-        name: 'Dlyd'
-      },
-      {
-        title: '牵变、电力设备巡检兑现',
-        name: 'QbDl'
-      }
+        {
+          title: '变配电所检修兑现情况',
+          name: 'Tab3'
+        },
+        {
+          title: '牵变检修兑现情况',
+          name: 'Syjhdxqk'
+        },
+        {
+          title: '电力远动调试',
+          name: 'Dlyd'
+        },
+        {
+          title: '牵变、电力设备巡检兑现',
+          name: 'QbDl'
+        }
 
       ]
     }

+ 8 - 0
src/views/dashboard-screen/screen/sjdr/qb-dl/index.vue

@@ -66,11 +66,19 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
+
     }
   }
 }

+ 8 - 0
src/views/dashboard-screen/screen/sjdr/qb-dl/tab1.vue

@@ -102,10 +102,18 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
+
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }

+ 13 - 5
src/views/dashboard-screen/screen/sjdr/syjhdxqk/index.vue

@@ -30,7 +30,7 @@
 
 import Tab1 from './tab1.vue'
 import Tab2 from './tab2.vue'
-import { ChartImport } from '@/api/dashboard-json'
+import {ChartImport} from '@/api/dashboard-json'
 
 export default {
   name: 'Syjhdxqk',
@@ -46,10 +46,10 @@ export default {
         title: '开关分合',
         name: 'Tab1'
       },
-      {
-        title: '单体',
-        name: 'Tab2'
-      }
+        {
+          title: '单体',
+          name: 'Tab2'
+        }
       ]
     }
   },
@@ -66,10 +66,18 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
+
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }

+ 9 - 1
src/views/dashboard-screen/screen/sjdr/tab3.vue

@@ -136,10 +136,18 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
-          }, 200)
+            this.loadData()
+
+          }, 1000)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }

+ 8 - 0
src/views/dashboard-screen/screen/sjdr/tab6.vue

@@ -110,10 +110,18 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
+
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }

+ 8 - 3
src/views/dashboard-screen/screen/sjdr/ycxn/index.vue

@@ -66,9 +66,7 @@ export default {
       ]
     }
   },
-  computed: {
-
-  },
+  computed: {},
   methods: {
     handleImport(evt) {
       window.console.log('evt', evt)
@@ -81,10 +79,17 @@ export default {
           this.readyRender = false
           setTimeout(() => {
             this.readyRender = true
+            this.loadData()
           }, 200)
         } else {
           this.$message.success('导入失败')
         }
+        console.log("emit freshRender")
+        this.$emit('freshRender', {})
+      }, () => {
+        console.log("emit freshRender")
+
+        this.$emit('freshRender', {})
       })
     }
   }