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

设备查询精细化

lv.wenbin 10 hónapja
szülő
commit
ec106bc870

+ 8 - 0
ems-ui/src/api/basecfg/emsfacs.js

@@ -17,6 +17,14 @@ export function listAllFacs(areaCode) {
   });
 }
 
+// 查询能源设施/系统列表
+export function listFacsByCategory(category, subCategory) {
+  return request({
+    url: '/ems/basecfg/emsfacs/listall?facsCategory=' + category + '&subCategory=' + subCategory,
+    method: 'get'
+  });
+}
+
 // 查询能源设施/系统详细
 export function getFacs(id) {
   return request({

+ 25 - 19
ems-ui/src/views/basecfg/device/index.vue

@@ -7,7 +7,7 @@
             style="margin-bottom: 20px" />
         </div>
         <div class="head-container" style="height: 100vh; overflow: hidden; position: relative;">
-          <el-tree :data="areaOptions" :props="defaultProps" :expand-on-click-node="false"
+          <el-tree :data="treeAreaOptions" :props="defaultProps" :expand-on-click-node="false"
             :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
             @node-click="handleNodeClick" style="height: calc(100vh - 50px); overflow-y: auto;" />
         </div>
@@ -72,11 +72,10 @@
         <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="设备名称" align="left" prop="deviceName" />
-          <el-table-column label="设备代码" align="left" prop="deviceCode" width="180px" />
-          <el-table-column label="归属区域" align="left" prop="areaPath" width="280px" />
+          <el-table-column label="安装位置" align="left" prop="areaPath" width="220px" />
           <el-table-column label="归属设施" align="center" prop="refFacsName" />
           <el-table-column label="设备分类" align="center" prop="deviceCategoryName" />
-          <el-table-column label="所属子系统" align="center" prop="subsystemName" />
+          <el-table-column label="子系统" align="center" prop="subsystemName" />
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button size="mini" type="text" icon="el-icon-info" @click="handleDetail(scope.row)" v-hasPermi="['basecfg:emsfacs:edit']">
@@ -104,8 +103,8 @@
                   :key="item.facsCode" />
               </el-select>
             </el-form-item>
-            <el-form-item label="归属区域" prop="refArea">
-              <treeselect v-model="form.refArea" :options="areaOptions" :show-count="true" placeholder="请选择所属建筑"
+            <el-form-item label="安装位置" prop="refArea">
+              <treeselect v-model="form.refArea" :options="totalAreaOptions" :show-count="true" placeholder="请选择所属建筑"
                 @select="handleAreaType" />
             </el-form-item>
             <el-form-item label="设备代码" prop="deviceCode">
@@ -204,13 +203,14 @@
 </template>
 
 <script>
-import {listDevRecursionByArea, getDevice, delDevice, addDevice, updateDevice} from '@/api/device/device'
-import {areaTreeSelect} from "@/api/basecfg/area"
-import {listAllFacs,getFacsCategorygetByCode} from "@/api/basecfg/emsfacs"
-import {listSubsystemAll} from '@/api/adapter/subsystem'
+import { listDevRecursionByArea, getDevice, delDevice, addDevice, updateDevice} from '@/api/device/device'
+import { areaTreeSelect } from "@/api/basecfg/area"
+import { listAllFacs, getFacsCategorygetByCode, listFacsByCategory } from "@/api/basecfg/emsfacs"
+import { listSubsystemAll } from '@/api/adapter/subsystem'
+import { getModelByCode } from "@/api/basecfg/objModel";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import {getModelByCode} from "@/api/basecfg/objModel";
+
 
 export default {
   name: 'Device',
@@ -239,7 +239,8 @@ export default {
       // 区域名称
       areaName: undefined,
       // 区域树选项
-      areaOptions: undefined,
+      treeAreaOptions: undefined,
+      totalAreaOptions: undefined,
       // 设施选项
       facsOptions: undefined,
       // 设备分类
@@ -254,7 +255,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         deviceCode: null,
-        deviceSubCategory: null,
+        deviceSubCategory: '',
         deviceCategory: 'E',
         areaType: null,
         refArea: null,
@@ -272,7 +273,7 @@ export default {
           {required: true, message: '归属设施', trigger: 'blur'}
         ],
         refArea: [
-          {required: true, message: '归属区域', trigger: 'blur'}
+          {required: true, message: '安装位置', trigger: 'blur'}
         ],
         deviceCode: [
           {required: true, message: '设备代码不能为空', trigger: 'blur'}
@@ -291,8 +292,8 @@ export default {
   },
   created () {
     this.getList();
-    this.getAreaTree('Area');
-    this.getFacsOptions("");
+    this.getAreaTree('Building');
+    this.getFacsOptions();
     this.getSubsystem();
     this.getSubCategorygetByCode();
   },
@@ -309,7 +310,7 @@ export default {
     /** 查询区域树结构 */
     getAreaTree (tier) {
       areaTreeSelect(tier).then(response => {
-        this.areaOptions = response.data;
+        this.treeAreaOptions = response.data;
       });
     },
     // 筛选节点
@@ -392,6 +393,10 @@ export default {
         this.open = true
         this.title = '修改能源设备'
       })
+      const tier = 'Zoning';
+      areaTreeSelect(tier).then(response => {
+        this.totalAreaOptions = response.data;
+      });
     },
     /** 提交按钮 */
     submitForm () {
@@ -434,7 +439,7 @@ export default {
       this.form.areaType = data.tier;
     },
     getFacsOptions (areaCode) {
-      listAllFacs(areaCode).then(response => {
+      listFacsByCategory(this.queryParams.deviceCategory, this.queryParams.deviceSubCategory).then(response => {
         this.facsOptions = response.data;
       })
     },
@@ -452,11 +457,12 @@ export default {
       this.queryParams.deviceSubCategory = ''
       if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
         || this.queryParams.deviceCategory === 'T'|| this.queryParams.deviceCategory === 'C') {
-        this.getAreaTree("Area")
+        this.getAreaTree("Building")
       } else if (this.queryParams.deviceCategory === 'Z') {
         this.getAreaTree("Zoning")
       }
       this.getSubCategorygetByCode()
+      this.getFacsOptions()
       this.handleQuery()
     }
   }

+ 15 - 16
ems-ui/src/views/devmgr/state/index.vue

@@ -14,7 +14,7 @@
         </div>
         <div class="head-container" style="height: 100vh; overflow: hidden; position: relative;">
           <el-tree
-            :data="areaOptions"
+            :data="treeAreaOptions"
             :props="defaultProps"
             :expand-on-click-node="false"
             :filter-node-method="filterNode"
@@ -62,8 +62,8 @@
         <el-table v-loading="loading" :data="deviceList" >
           <el-table-column label="设备名称" align="left" prop="deviceName"/>
           <el-table-column label="归属区域" align="left" prop="areaPath" width="280px"/>
+          <el-table-column label="设备分类" align="center" prop="deviceCategoryName"/>
           <el-table-column label="归属设施" align="center" prop="refFacsName"/>
-          <el-table-column label="设备类型" align="center" prop="deviceTypeName"/>
           <el-table-column label="子系统" align="center" prop="subsystemName"/>
 <!--          <el-table-column label="设备状态" align="center" prop="deviceStatus">-->
 <!--            <template slot-scope="scope">-->
@@ -210,16 +210,13 @@
 </template>
 
 <script>
-import { listDevRecursionByArea, getDevice, delDevice, addDevice, updateDevice } from '@/api/device/device'
+import { listDevRecursionByArea } from '@/api/device/device'
 import { areaTreeSelect } from "@/api/basecfg/area"
-import { getFacsCategorygetByCode, listAllFacs } from '@/api/basecfg/emsfacs'
-import { getDevcType} from '@/api/commonApi'
+import { getFacsCategorygetByCode, listFacsByCategory } from '@/api/basecfg/emsfacs'
 import { listSubsystemAll } from '@/api/adapter/subsystem'
+import { getModelByCode } from "@/api/basecfg/objModel";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { getBuilding } from '@/api/basecfg/building'
-import {getModelByCode} from "@/api/basecfg/objModel";
-
 
 export default {
   name: 'Device',
@@ -248,7 +245,7 @@ export default {
       // 区域名称
       areaName: undefined,
       // 区域树选项
-      areaOptions: undefined,
+      treeAreaOptions: undefined,
       // 设施选项
       facsOptions: undefined,
       // 设备分类
@@ -268,7 +265,7 @@ export default {
         pageSize: 10,
         deviceCode: null,
         deviceName: null,
-        deviceSubCategory: null,
+        deviceSubCategory: '',
         deviceCategory: 'E',
         deviceStatus: null,
         areaType: null,
@@ -282,9 +279,10 @@ export default {
   },
   created() {
     this.getList();
-    this.getAreaTree('Area');
-    this.getFacsOptions("");
+    this.getAreaTree('Building');
+    this.getFacsOptions();
     this.getSubsystem();
+    this.getSubCategorygetByCode();
   },
   methods: {
     getDeviceStatusText(status) {
@@ -319,7 +317,7 @@ export default {
     /** 查询区域树结构 */
     getAreaTree(tier) {
       areaTreeSelect(tier).then(response => {
-        this.areaOptions = response.data;
+        this.treeAreaOptions = response.data;
       });
     },
     // 筛选节点
@@ -380,8 +378,8 @@ export default {
         this.abilityData=response.data.abilityList
       })
     },
-    getFacsOptions(areaCode) {
-      listAllFacs(areaCode).then(response =>{
+    getFacsOptions() {
+      listFacsByCategory(this.queryParams.deviceCategory, this.queryParams.deviceSubCategory).then(response => {
         this.facsOptions = response.data;
       })
     },
@@ -399,11 +397,12 @@ export default {
       this.queryParams.deviceSubCategory = ''
       if (this.queryParams.deviceCategory === 'E' || this.queryParams.deviceCategory === 'W'
         || this.queryParams.deviceCategory === 'T'|| this.queryParams.deviceCategory === 'C') {
-        this.getAreaTree("Area")
+        this.getAreaTree("Building")
       } else if (this.queryParams.deviceCategory === 'Z') {
         this.getAreaTree("Zoning")
       }
       this.getSubCategorygetByCode()
+      this.getFacsOptions()
       this.handleQuery()
     }
   }