Browse Source

区域筛选精细化

lv.wenbin 10 months ago
parent
commit
aed0ac9380

+ 7 - 0
ems-ui/src/api/basecfg/area.js

@@ -71,3 +71,10 @@ export function areaTreeSelectByTag(tier, tagCode) {
     method: 'get'
   })
 }
+
+export function areaWithFacsType(facsType, facsSubType) {
+  return request({
+    url: '/ems/basecfg/area/listWithFacsType?facsType=' + facsType + '&facsSubType=' + facsSubType,
+    method: 'get'
+  })
+}

+ 2 - 8
ems-ui/src/views/mgr/charging.vue

@@ -121,7 +121,7 @@
 </template>
 
 <script>
-import { areaTreeSelect, areaTreeSelectByTag } from '@/api/basecfg/area'
+import { areaTreeSelectByTag } from '@/api/basecfg/area'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { chargingList, overviewInfo } from '@/api/mgr/charging.js'
@@ -538,7 +538,7 @@ export default {
     async handleTabChange() {
       // 根据newTabName给someParam赋值
       if (this.activeTab === 'first') {
-        await this.getAreaTree('Area')
+        await this.getAreaTreeByTag('Area', 'Area_01')
         this.queryParams.areaCode = this.areaOptions[0].id
         this.$refs['tree'].setCurrentKey(this.queryParams.areaCode)
       } else if (this.activeTab === 'second') {
@@ -557,12 +557,6 @@ export default {
       }
     },
     /** 查询区域树结构 */
-    async getAreaTree(tier) {
-      await areaTreeSelect(tier).then(response => {
-        this.areaOptions = response.data
-      })
-    },
-    /** 查询区域树结构 */
     async getAreaTreeByTag(tier, tagCode) {
       await areaTreeSelectByTag(tier, tagCode).then(response => {
         this.areaOptions = response.data

+ 10 - 7
ems-ui/src/views/mgr/powergrid.vue

@@ -5,7 +5,7 @@
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
           <el-form-item label="服务区" prop="areaCode">
             <el-select v-model="queryParams.areaCode" placeholder="请选择服务区" @change="handleQuery">
-              <el-option v-for="item in areaOptions" :key="item.id" :label="item.label" :value="item.id" />
+              <el-option v-for="item in areaOptions" :key="item.areaCode" :label="item.areaName" :value="item.areaCode" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -36,7 +36,7 @@
         <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
           <el-form-item label="服务区" prop="areaCode">
             <el-select v-model="queryParams.areaCode" placeholder="请选择服务区" @change="handleQuery">
-              <el-option v-for="item in areaOptions" :key="item.id" :label="item.label" :value="item.id" />
+              <el-option v-for="item in areaOptions" :key="item.areaCode" :label="item.areaName" :value="item.areaCode" />
             </el-select>
           </el-form-item>
         </el-form>
@@ -67,7 +67,7 @@
 <script>
 import { listPgSupplyH, listPvSupplyH } from '@/api/mgr/pgSupplyH'
 import BaseChart from '@/components/BaseChart'
-import { areaTreeSelect } from '@/api/basecfg/area'
+import { areaWithFacsType } from '@/api/basecfg/area'
 export default {
   name: 'PgSupplyH',
   dicts: ['meter_type'],
@@ -81,6 +81,8 @@ export default {
       loading: true,
       // 总条数
       total: 0,
+      facsType: '',
+      facsSubType: '',
       pgSupplyHList: [],
       pvSupplyHList: [],
       // 查询参数
@@ -251,15 +253,16 @@ export default {
     }
   },
   async created() {
-    await this.getAreaList('Area')
+    this.facsType = 'W'
+    await this.getAreaList()
     this.getList()
   },
   methods: {
     // 查询区域列表
-    async getAreaList(tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaList() {
+      await areaWithFacsType(this.facsType, this.facsSubType).then(response => {
         this.areaOptions = response.data
-        this.queryParams.areaCode = this.areaOptions[0].id
+        this.queryParams.areaCode = this.areaOptions[0].areaCode
       })
     },
     getList() {

+ 9 - 6
ems-ui/src/views/mgr/powerstore.vue

@@ -3,7 +3,7 @@
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
       <el-form-item label="服务区" prop="areaCode">
         <el-select v-model="queryParams.areaCode" placeholder="请选择服务区" @change="handleQuery">
-          <el-option v-for="item in areaOptions" :key="item.id" :label="item.label" :value="item.id" />
+          <el-option v-for="item in areaOptions" :key="item.areaCode" :label="item.areaName" :value="item.areaCode" />
         </el-select>
       </el-form-item>
     </el-form>
@@ -22,7 +22,7 @@
 
 <script>
 import { listElecStoreH } from '@/api/mgr/elecStoreH'
-import { areaTreeSelect } from '@/api/basecfg/area'
+import { areaWithFacsType } from '@/api/basecfg/area'
 import BaseChart from '@/components/BaseChart'
 export default {
   name: 'ElecStoreH',
@@ -33,6 +33,8 @@ export default {
     return {
       // 遮罩层
       loading: true,
+      facsType: '',
+      facsSubType: '',
       // 储能计量-小时表格数据
       elecStoreHList: [],
       // 查询参数
@@ -103,15 +105,16 @@ export default {
     }
   },
   async created() {
-    await this.getAreaList('Area')
+    this.facsType = 'C'
+    await this.getAreaList()
     this.getList()
   },
   methods: {
     // 查询区域列表
-    async getAreaList(tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaList() {
+      await areaWithFacsType(this.facsType, this.facsSubType).then(response => {
         this.areaOptions = response.data
-        this.queryParams.areaCode = this.areaOptions[0].id
+        this.queryParams.areaCode = this.areaOptions[0].areaCode
       })
     },
     /** 查询储能计量-小时列表 */