Explorar el Código

feat: 下载以及添加全部等

allen hace 2 años
padre
commit
44174f5bcf

+ 1 - 1
src/components/DataReportLeft/index.vue

@@ -32,7 +32,7 @@ export default {
   },
   watch: {
     treeData: { 
-      handler(res) { 
+      handler(res) {
         this.currentNodekey = res[0].id;
         this.$nextTick(() => {
           this.$refs.tree.setCurrentKey(this.currentNodekey);

+ 2 - 2
src/utils/request.js

@@ -165,10 +165,10 @@ export function download(url, params, filename, config) {
     .post(url, params, {
       transformRequest: [
         (params) => {
-          return tansParams(params);
+          return JSON.stringify(params);
         }
       ],
-      headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+      // headers: { 'Content-Type': 'multipart/form-data' },
       responseType: 'blob',
       ...config
     })

+ 13 - 0
src/views/dataReport/intakeWaterAnalysis.vue

@@ -142,6 +142,19 @@ export default {
           this.$store.dispatch('tree/setTree',res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
       }

+ 13 - 0
src/views/dataReport/saveWaterAnalysis.vue

@@ -126,6 +126,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
       }

+ 14 - 2
src/views/dataReport/waterConsumption.vue

@@ -123,8 +123,20 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id:'',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClickId = this.treeData[0]?.cusareaId
       }
       
       const [startTime, endTime] = this.dateValue ??= []

+ 13 - 0
src/views/home/index.vue

@@ -224,6 +224,19 @@ export default {
         this.$store.dispatch('tree/setTree', res)
       }
       this.treeData = res?.data
+      let tflag = true
+      this.treeData.forEach(t => {
+        if (t?.cusareaName == '全部') {
+          tflag = false
+        }
+      })
+      if (tflag) {
+        this.treeData.unshift({
+          id: '',
+          cusareaId: '',
+          cusareaName: '全部'
+        })
+      }
       this.cusareaName ||= this.treeData[0].cusareaName
       this.areaId = this.treeData[0].cusareaId
       this.getHomeListHandler()

+ 2 - 2
src/views/infrastructure/components/setPreferenc.vue

@@ -32,11 +32,11 @@
                     value="0"
                   ></el-option>
                   <el-option
-                    label="水"
+                    label="只计水"
                     value="1"
                   ></el-option>
                   <el-option
-                    label="电"
+                    label="只计电"
                     value="2"
                   ></el-option>
                 </el-select>

+ 13 - 0
src/views/infrastructure/deviceSetup.vue

@@ -202,6 +202,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
         this.areaId = this.currentClickId

+ 2 - 1
src/views/infrastructure/waterElectricityPriceSetting.vue

@@ -257,8 +257,9 @@ export default {
         const res = await getTree()
         this.treeData = res?.data
         this.treeData.unshift({
+          id: '',
           cusareaId: '',
-          cusareaName: '行政区域(全国)'
+          cusareaName: '全部'
         })
         this.areaId = this.treeData[0].cusareaId
       }

+ 13 - 0
src/views/infrastructure/waterEstablishment.vue

@@ -163,6 +163,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.cusareaName ||= this.treeData[0].cusareaName
         this.areaId = this.treeData[0].cusareaId
       }

+ 13 - 0
src/views/monitoringMamage/index.vue

@@ -339,6 +339,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.cusareaName ||= this.treeData[0].cusareaName
         this.areaId = this.treeData[0].cusareaId
       }

+ 13 - 0
src/views/peasantHouseholdManage/index.vue

@@ -282,6 +282,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
         this.currentData = this.currentClick

+ 13 - 0
src/views/waterCardManage/index.vue

@@ -320,6 +320,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
       }

+ 20 - 2
src/views/waterManage/index.vue

@@ -68,7 +68,7 @@
     </el-col>
   <association-manage
     :visible.sync="associationManageShow"
-    :treeData="treeData"
+    :treeData="treeData2"
     :userList="userList"
     @getList="handleSearch"
     :typeAssoc="typeAssoc"
@@ -86,6 +86,7 @@ import SelectTree from '@/components/SelectTree';
 import { getTree } from '@/api/tree.js'
 import { Message } from 'element-ui'
 import { assign, omit } from 'lodash-es';
+import { deepClone } from '@/utils/index.js'
 
 export default {
   name:"waterManage",
@@ -96,7 +97,8 @@ export default {
         productName: ''
       },
       userList: [],
-      treeData:[],
+      treeData: [],
+      treeData2: [],
       loading: false,
       cusareaName: '',
       associationManageShow: false,
@@ -177,6 +179,22 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        this.treeData2 = []
+        this.treeData2 = deepClone(res?.data)
+        this.treeData2 = this.treeData2.filter(t => t?.cusareaName != '全部')
+        let tflag = true
+        this.treeData.forEach(t => { 
+          if (t?.cusareaName == '全部') { 
+            tflag = false
+          }
+        })
+        if (tflag) { 
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.cusareaName ||= this.treeData[0].cusareaName
         this.areaId = this.treeData[0].cusareaId
       }

+ 13 - 0
src/views/waterSubsidy/index.vue

@@ -172,6 +172,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.cusareaName ||= this.treeData[0].cusareaName
         this.areaId = this.treeData[0].cusareaId
       }