Prechádzať zdrojové kódy

表格字段调整

Signed-off-by: hsshuxian <3049816743@qq.com>
hsshuxian 7 mesiacov pred
rodič
commit
aad65760cf

+ 10 - 20
ems-ui-cloud/src/views/basecfg/boundaryRel/index.vue

@@ -49,16 +49,13 @@
           </div>
         </div>
 
-
       </el-col>
-
       <el-tabs v-model="activeTab" @tab-click="handleTabClick">
         <el-tab-pane label="地理位置" name="area"></el-tab-pane>
         <el-tab-pane label="组织机构" name="organ"></el-tab-pane>
         <el-tab-pane label="设施" name="facs"></el-tab-pane>
         <el-tab-pane label="设备" name="device"></el-tab-pane>
       </el-tabs>
-
       <el-col :span="20" :xs="24">
 
     <!-- 地理位置  -->
@@ -243,7 +240,7 @@
         </div>
      <!--设备    -->
         <div v-if="activeTab === 'device'">
-          <el-tabs v-model="DeviceQueryParams.deviceCategory" @tab-click="deviceCategoryChange">
+          <el-tabs  v-model="DeviceQueryParams.deviceCategory" @tab-click="deviceCategoryChange">
             <el-tab-pane label="产能设备" name="E"></el-tab-pane>
             <el-tab-pane label="储能设备" name="C"></el-tab-pane>
             <el-tab-pane label="输能设备" name="W"></el-tab-pane>
@@ -287,7 +284,7 @@
             </el-form-item>
           </el-form>
 
-          <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
+          <el-table  :key="tableKey" 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="areaPath" width="220px"/>
@@ -577,7 +574,7 @@ export default {
     this.getDeviceList();
   },
   created() {
-    this.getDeviceSubCategorygetByCode(); 
+    this.getDeviceSubCategorygetByCode();
     this.getFacsSubCategorygetByCode();
     this.getAreaFacsTree('0', false)
     this.getAreaDeviceTree('0', false)
@@ -654,7 +651,6 @@ export default {
     },
     /**分页*/
     handleTabClick(tab) {
-      // 重置所有查询参数
       this.reset();
       if (tab.name === 'area') {
         this.showSearch = true;
@@ -701,7 +697,6 @@ export default {
 
     //组织机构
     handleDeptNodeClick(data) {
-      console.log("组织机构", data);
       if (data.deptId === 'all') {
         this.organOptions = this.deptList.slice(1).map(item => {
           const { children, ...rest } = item;
@@ -726,19 +721,16 @@ export default {
     },
     //设备
     handleDeviceNodeClick(data) {
-      this.DeviceQueryParams.refArea = data.id
+      this.DeviceQueryParams.locationRef = data.id
       this.handleDeviceQuery()
     },
 
-
     /** 查询区域对象列表 */
     getList() {
       this.loading = true;
       listDetailArea(this.queryParams).then(response => {
         this.areaList = this.handleTree(response.data, "areaCode", "parentCode");
-        console.log(" this.areaList1", this.areaList)
          this.areaList = this.extractTagNames(this.areaList);
-        console.log(" this.areaList2", this.areaList)
         this.tableKey += 1; // 改变 key 值以强制重新渲染
         // 将“全部”节点添加到区域列表的顶部
         this.areaList.unshift(this.allAreaNode);
@@ -774,14 +766,12 @@ export default {
       this.loading = true;
       listDept(this.DeptQueryParams).then(response => {
         this.deptList = this.handleTree(response.data, "deptId");
-        console.log(" this.deptList1 ",this.deptList)
         this.deptList = this.extractTagNames(this.deptList);
-        console.log(" this.deptList2 ",this.deptList)
-        this.treeKey += 1; // 改变 key 值以强制重新渲染
+        this.treeKey += 1;
         this.loading = false;
-        // 将“全部”节点添加到区域列表的顶部
         this.deptList.unshift(this.allDeptNode);
         this.deptNode();
+
       });
     },
     deptNode() {
@@ -797,7 +787,6 @@ export default {
       this.loading = true
       listFacs(this.FacsQueryParams).then(response => {
         this.facsList = response.rows
-        console.log(" this.facsList", this.facsList)
         this.total = response.total
         this.loading = false
         // 确保在数据更新后更新 key
@@ -807,10 +796,11 @@ export default {
     /** 查询能源设备列表 */
     getDeviceList() {
       this.loading = true
-      listDevRecursionByArea(this.DeptQueryParams).then(response => {
+      listDevRecursionByArea(this.DeviceQueryParams).then(response => {
         this.deviceList = response.rows
         this.total = response.total
         this.loading = false
+        this.tableKey += 1;
       })
     },
     // 取消按钮
@@ -1030,10 +1020,10 @@ export default {
         this.Unbound.splice(index, 1);
       }
       const boundRow = {
-        meterDeviceName: row.deviceName, // 表计名称
+        meterDeviceName: row.deviceName,
         meterDevice: row.deviceCode,
         boundaryObj: this.queryParams.areaCode,
-        objType: objType // 设置 objType
+        objType: objType 
       };
       this.Bound.push(boundRow);
     },