Forráskód Böngészése

区域模型变更

lv.wenbin 9 hónapja
szülő
commit
bc91f25060

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

@@ -42,3 +42,18 @@ export function delArea(id) {
     method: 'delete'
   })
 }
+
+// 查询区域树结构
+export function areaTreeSelect(recursion,areaCode) {
+  return request({
+    url: '/ems/basecfg/area/areaTree?recursion=' + recursion + '&rootCode=' + areaCode,
+    method: 'get'
+  })
+}
+
+export function areaWithFacsCategoryAsTree(category, subCategory) {
+  return request({
+    url: '/ems/basecfg/area/listWithFacsCategoryAsTree?facsCategory=' + category + '&facsSubCategory=' + subCategory,
+    method: 'get'
+  })
+}

+ 0 - 12
ems-ui-cloud/src/api/basecfg/areaold.js

@@ -72,16 +72,4 @@ export function areaTreeSelectByTag(tier, tagCode) {
   })
 }
 
-export function areaWithFacsCategory(category, subCategory) {
-  return request({
-    url: '/ems/basecfg/areaold/listWithFacsCategory?facsCategory=' + category + '&facsSubCategory=' + subCategory,
-    method: 'get'
-  })
-}
 
-export function areaWithFacsCategoryAsTree(category, subCategory) {
-  return request({
-    url: '/ems/basecfg/areaold/listWithFacsCategoryAsTree?facsCategory=' + category + '&facsSubCategory=' + subCategory,
-    method: 'get'
-  })
-}

+ 6 - 5
ems-ui-cloud/src/views/adapter/pv/index.vue

@@ -583,7 +583,7 @@ export default {
   created() {
     this.queryParams.deviceCategory = 'E'; // 确保初始加载时就设置为 'E'
     this.getList()
-    this.getAreaTree('Building')
+    this.getAreaTree(false,'0')
     this.getFacsOptions()
     this.getSubsystem()
     this.getSubCategorygetByCode()
@@ -673,8 +673,8 @@ export default {
       })
     },
     /** 查询区域树结构 */
-    getAreaTree(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(category,areaCode) {
+      areaTreeSelect(category,areaCode).then(response => {
         this.treeAreaOptions =  [{
           id: '-1',
           label: '全部',
@@ -828,8 +828,9 @@ export default {
         this.open = true
         this.title = '修改能源设备'
       })
-      const tier = 'Zoning'
-      areaTreeSelect(tier).then(response => {
+      const recursion = false
+      const areaCode = '0'
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.totalAreaOptions = response.data
       })
     },

+ 3 - 3
ems-ui-cloud/src/views/alarm/alarm-info/index.vue

@@ -272,7 +272,7 @@ export default {
     }
   },
   created () {
-    this.getAreaTree("Area");
+    this.getAreaTree(false, '0');
     this.getList();
     this.getSubList();
   },
@@ -386,8 +386,8 @@ export default {
         ...this.queryParams,
       }, `alarm-info_${new Date().getTime()}.xlsx`);
     },
-    getAreaTree (tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions =[{
           id: '-1',
           label: '全部',

+ 11 - 11
ems-ui-cloud/src/views/alarm/index.vue

@@ -212,7 +212,7 @@ export default {
     }
   },
  async created () {
-    await this.getAreaTreeByTag('Area')
+    await this.getAreaTreeByTag(false,'0')
     this.getList();
   },
   methods: {
@@ -226,16 +226,16 @@ export default {
       });
     },
      /** 查询区域树结构 */
-     async getAreaTreeByTag (tier) {
-      await areaTreeSelect(tier).then(response => {
-        this.areaOptions = [{
-          id: '-1',
-          label: '全部',
-          children: []
-        }].concat(response.data)
-        this.queryParams.areaCode = '-1'
-      })
-    },
+     async getAreaTreeByTag(recursion, areaCode) {
+       await areaTreeSelect(recursion, areaCode).then(response => {
+         this.areaOptions = [{
+           id: '-1',
+           label: '全部',
+           children: []
+         }].concat(response.data)
+         this.queryParams.areaCode = '-1'
+       })
+     },
     // 筛选节点
     filterNode (value, data) {
       if (!value) return true

+ 3 - 3
ems-ui-cloud/src/views/analysis/device/warn.vue

@@ -134,13 +134,13 @@ export default {
     }
   },
   async mounted () {
-    await this.getAreaTreeByTag('Area')
+    await this.getAreaTreeByTag(false,'0')
     this.queryCharts()
   },
   methods: {
     /** 查询区域树结构 */
-    async getAreaTreeByTag (tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaTreeByTag(recursion, areaCode) {
+      await areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',

+ 9 - 36
ems-ui-cloud/src/views/basecfg/device/index.vue

@@ -475,7 +475,6 @@ export default {
         deviceCode: null,
         deviceSubCategory: '',
         deviceCategory: 'E',
-        locationType: null,
         locationRef: null,
         refFacs: null,
         customAttrs: null
@@ -540,7 +539,7 @@ export default {
   },
   created() {
     this.getList()
-    this.getAreaTree('Building')
+    this.getAreaTree(false,'0')
     this.getFacsOptions()
     this.getSubsystem()
     this.getSubCategorygetByCode()
@@ -552,9 +551,7 @@ export default {
     getList() {
       this.loading = true
       listDevRecursionByArea(this.queryParams).then(response => {
-        console.log('参数', JSON.stringify(this.queryParams))
         this.deviceList = response.rows
-        console.log('deviceList', this.deviceList)
         this.total = response.total
         this.loading = false
       })
@@ -565,7 +562,6 @@ export default {
       this.componentOpen = true
       this.title = '添加设备器件属性'
       this.componentForm.deviceCode = this.ComponentRow.deviceCode // 设置默认设备代码
-
     },
     handleComponentUpdate(row) {
       this.componentReset()
@@ -582,7 +578,6 @@ export default {
       this.$modal.confirm('是否确认删除能源对象属性编号为"' + ids + '"的数据项?').then(function() {
         return delComponent(ids)
       }).then(() => {
-        console.log('删除row', row.deviceCode)
         this.getComponentList(row.deviceCode)
         this.$modal.msgSuccess('删除成功')
       }).catch(() => {
@@ -615,14 +610,13 @@ export default {
     getComponentList(deviceCode) {
       listByDevice(deviceCode).then(response => {
         this.ComponentList = response.data
-        console.log('查询部件列表', this.ComponentList)
       })
     },
     /** 查询区域树结构 */
-    getAreaTree(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.treeAreaOptions =  [{
-          id: '-1',
+          id: null,
           label: '全部',
           children: response.data
         }]
@@ -635,7 +629,6 @@ export default {
     },
     // 节点单击事件
     handleNodeClick(data) {
-      this.queryParams.locationType = data.tier
       this.queryParams.locationRef = data.id
       this.handleQuery()
     },
@@ -659,7 +652,6 @@ export default {
         psCode: null,
         createTime: null,
         updateTime: null
-
       }
       this.resetForm('form')
     },
@@ -676,19 +668,16 @@ export default {
         compoSpec: null,
         ancestors: null,
         parentCompo: null
-
       }
       this.resetForm('componentForm')
     },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1
-      console.log('搜索按钮this.queryParams', JSON.stringify(this.queryParams))
       this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.queryParams.locationType = null
       this.queryParams.locationRef = null
       this.resetForm('queryForm')
       this.handleQuery()
@@ -709,11 +698,9 @@ export default {
     handleDevProcess(row) {
       this.showDevProcessDrawer = true
       this.ComponentRow = row
-      console.log('row', row)
       listByDevice(this.ComponentRow.deviceCode).then(response => {
         this.ComponentList = response.data
       })
-
     },
     shouldShowDevProcessButton(row) {
       const categoryIsW = this.queryParams.deviceCategory === 'W'
@@ -726,17 +713,14 @@ export default {
     handleDetail(row) {
       this.showDrawer = true
       this.curRow = row
-      console.log('data', this.curRow)
       this.subKey = this.$options.data().subKey
       getModelByCode(this.curRow.facsModel).then(response => {
         const code = response.data
-        console.log('code', code)
         this.eventData = response.data.eventList
         this.abilityData = response.data.abilityList
 
       })
       getObjAttr(2, this.curRow.deviceCode).then(response => {
-        console.log('response值', response.data)
         const attrs = response.data.attrs
         const attrValues = response.data.attrValues
 
@@ -761,8 +745,9 @@ export default {
         this.open = true
         this.title = '修改能源设备'
       })
-      const tier = 'Zoning'
-      areaTreeSelect(tier).then(response => {
+      const recursion = true
+      const areaCode = '0'
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.totalAreaOptions = response.data
       })
     },
@@ -792,7 +777,6 @@ export default {
             attrKey: attrKey,
             attrValue: attrValue,
             attrName: attrName
-
           })
         }
       })
@@ -909,7 +893,6 @@ export default {
     getAllDevProcess(subcategoryCode) {
       getDevProcess(subcategoryCode).then(response => {
         this.devOptions = response.data
-        console.log('设备工艺', this.devOptions)
       })
     },
     deviceCategoryChange() {
@@ -917,9 +900,9 @@ export default {
       //this.queryParams.psCode = null; // 重置设备工艺选择
       if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
         || this.queryParams.deviceCategory === 'T' || this.queryParams.deviceCategory === 'C') {
-        this.getAreaTree('Building')
+        this.getAreaTree(false,'0')
       } else if (this.queryParams.deviceCategory === 'Z') {
-        this.getAreaTree('Zoning')
+        this.getAreaTree(true,'0')
       }
       this.getSubCategorygetByCode()
       this.getFacsOptions()
@@ -955,16 +938,11 @@ export default {
     getFacsModel() {
       listAllModel(2).then(response => {
         this.modelList = response.data
-        console.log('this.modelList', this.modelList)
-        this.modelList.forEach(model => {
-          console.log(model.modelCode)
-        })
       })
     },
     handleModelChange(modelCode) {
       if (modelCode) {
         this.getModelByCode(modelCode)
-        console.log('设备代码', this.form.deviceCode)
         this.getObjAttr(2, this.form.deviceCode)
       }
     },
@@ -980,9 +958,7 @@ export default {
       getObjAttr(objType, deviceCode).then(response => {
         // const attrs = response.data.attrs;
         const attrs = response.data.attrs.filter(attr => attr.attrType === 0)
-        console.log('attrs', attrs)
         const attrValues = response.data.attrValues || [] // 确保是一个数组
-        console.log('attrValues', attrValues)
 
         // 创建一个映射对象,用于存储 attrKey 与对应的 attrValue
         const attrValuesMap = {}
@@ -1002,9 +978,6 @@ export default {
 
         // 更新 attrValuesMap 到组件的数据中
         this.attrValuesMap = attrValuesMap
-        // 打印更新后的 attrValuesMap,用于调试
-        console.log('Updated attrValuesMap', this.attrValuesMap)
-
       })
     }
   }

+ 3 - 3
ems-ui-cloud/src/views/basecfg/emsfacs/index.vue

@@ -420,7 +420,7 @@ export default {
   },
   created() {
     this.getList()
-    this.getAreaTree('Area')
+    this.getAreaTree(false,'0')
     this.getAllFacsCategory()
     this.getSubCategorygetByCode()
     this.getFacsModel()
@@ -647,8 +647,8 @@ export default {
       )
     },
     /** 查询区域树结构 */
-    getAreaTree(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',

+ 4 - 4
ems-ui-cloud/src/views/basecfg/meterdevc/index.vue

@@ -166,7 +166,7 @@
 <script>
 import { listDevice, getDevice, delDevice, addDevice, updateDevice } from '@/api/device/meterDevice'
 import { devTreeByFacs } from '@/api/device/device'
-import { areaTreeSelect, areaTreeSelectByCode } from '@/api/basecfg/area'
+import { areaTreeSelect } from '@/api/basecfg/area'
 import { listBuildingByArea } from '@/api/basecfg/building'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -290,7 +290,7 @@ export default {
     }
   },
   created() {
-    this.getAreaTree('Area')
+    this.getAreaTree(false,'0')
     this.getList()
   },
   methods: {
@@ -456,8 +456,8 @@ export default {
       return modeMap[colMode] || '未知'
     },
     /** 查询区域树结构 */
-    getAreaTree(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = response.data
       })
     },

+ 3 - 3
ems-ui-cloud/src/views/basecfg/price/index.vue

@@ -548,7 +548,7 @@ export default {
     }
   },
   created() {
-    this.getAreaList('Area')
+    this.getAreaList(false,'0')
     this.getAttrList()
     this.getGwPriceList()
     this.getPvPriceList()
@@ -834,8 +834,8 @@ export default {
       })
     },
     // 查询区域列表
-    getAreaList(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaList(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = response.data
       })
     },

+ 6 - 9
ems-ui-cloud/src/views/devmgr/attr/index.vue

@@ -243,7 +243,6 @@ export default {
         pageSize: 10,
         deviceSubCategory: '',
         deviceCategory: 'E',
-        locationType: null,
         locationRef: null,
         refFacs: null,
         subsystemCode: null
@@ -252,7 +251,7 @@ export default {
   },
   created () {
     this.getList()
-    this.getAreaTree('Building')
+    this.getAreaTree(false, '0')
     this.getFacsOptions()
     this.getSubsystem()
     this.getSubCategorygetByCode()
@@ -288,10 +287,10 @@ export default {
       })
     },
     /** 查询区域树结构 */
-    getAreaTree (tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.treeAreaOptions = [{
-          id: '-1',
+          id: null,
           label: '全部',
           children: []
         }].concat(response.data)
@@ -304,7 +303,6 @@ export default {
     },
     // 节点单击事件
     handleNodeClick (data) {
-      this.queryParams.locationType = data.tier
       this.queryParams.locationRef = data.id
       this.handleQuery()
     },
@@ -320,7 +318,6 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery () {
-      this.queryParams.locationType = null
       this.queryParams.locationRef = null
       this.resetForm('queryForm')
       this.handleQuery()
@@ -362,9 +359,9 @@ export default {
       this.reset()
       if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
         || this.queryParams.deviceCategory === 'T' || this.queryParams.deviceCategory === 'C') {
-        this.getAreaTree('Building')
+        this.getAreaTree(false,'0')
       } else if (this.queryParams.deviceCategory === 'Z') {
-        this.getAreaTree('Zoning')
+        this.getAreaTree(true,'0')
       }
       this.getSubCategorygetByCode()
       this.getFacsOptions()

+ 3 - 3
ems-ui-cloud/src/views/devmgr/el/index.vue

@@ -278,7 +278,7 @@ export default {
 
   },
   async created () {
-    await this.getAreaTreeByTag('Area')
+    await this.getAreaTreeByTag(false,'0')
     this.getList()
   },
   // 当对象类型有值时,显示对象代码输入框
@@ -303,8 +303,8 @@ export default {
       })
     },
     /** 查询区域树结构 */
-    async getAreaTreeByTag (tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaTreeByTag(recursion, areaCode) {
+      await areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',

+ 1 - 1
ems-ui-cloud/src/views/devmgr/meterRead/index.vue

@@ -134,7 +134,7 @@
 <script>
 import { listDevice } from '@/api/device/meterDevice'
 import { listMeterReadingByParam, getLastRecord, addMeterReading, updateMeterReading, delMeterReading } from '@/api/device/meterRead'
-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 { dateFormat } from '@/utils/index.js'

+ 1 - 3
ems-ui-cloud/src/views/mgr/poweruse.vue

@@ -611,7 +611,7 @@ export default {
       })
       getPowerMaxLoad(params).then(({code, data}) => {
         if (code === 200) {
-          this.equipPowerMaxLoad = parseFloat(data.s).toFixed(2)
+          this.equipPowerMaxLoad = parseFloat(data).toFixed(2)
         }
       })
     },
@@ -638,8 +638,6 @@ export default {
       };
       sumByFacsH(params).then(response => {
         this.sumByFacsList = response.data
-        console.log("能耗", this.sumByFacsList)
-
       })
     },
 

+ 3 - 3
ems-ui-cloud/src/views/mgr/strategy.vue

@@ -425,7 +425,7 @@ export default {
   },
   created() {
     this.queryParams.strategyType = 1;
-    this.getAreaTree('Area')
+    this.getAreaTree(false,'0')
     this.getList();
   },
   methods: {
@@ -718,8 +718,8 @@ export default {
       this.handleQuery()
     },
     /** 查询区域树结构 */
-    getAreaTree(tier) {
-      areaTreeSelect(tier).then(response => {
+    getAreaTree(recursion, areaCode) {
+      areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',

+ 3 - 3
ems-ui-cloud/src/views/task/index.vue

@@ -50,12 +50,12 @@ export default {
     }
   },
   async created () {
-    await this.getAreaTreeByTag('Area')
+    await this.getAreaTreeByTag(false,'0')
   },
   methods: {
     /** 查询区域树结构 */
-    async getAreaTreeByTag (tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaTreeByTag(recursion, areaCode) {
+      await areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',

+ 3 - 3
ems-ui-cloud/src/views/task/report/index.vue

@@ -202,7 +202,7 @@ export default {
     }
   },
  async created () {
-    await this.getAreaTreeByTag('Area')
+    await this.getAreaTreeByTag(false,'0')
     this.getList();
   },
   methods: {
@@ -216,8 +216,8 @@ export default {
       });
     },
     /** 查询区域树结构 */
-    async getAreaTreeByTag (tier) {
-      await areaTreeSelect(tier).then(response => {
+    async getAreaTreeByTag(recursion, areaCode) {
+      await areaTreeSelect(recursion, areaCode).then(response => {
         this.areaOptions = [{
           id: '-1',
           label: '全部',