Browse Source

Merge branch 'msg-sever' into zonesp

haojianlong 5 years ago
parent
commit
2b6b84791b

+ 15 - 1
src/api/scan/request.js

@@ -1379,17 +1379,31 @@ export function linkSySh(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-sh/link-sy-sh`;
     http.postJson(url, param, success)
 }
+//创建系统所在业务空间关系
+export function linkSysSp(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-sp-base/link-list`;
+    http.postJson(url, param, success)
+}
 //系统所在竖井,系统一对多,此方法会覆盖以前的记录
 export function linkSh(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-sh/link-sh`;
     http.postJson(url, param, success)
 }
+//系统所在竖井,系统一对多,此方法不会覆盖以前的记录
+export function linkSysSh(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-sh/link-sy-shs`;
+    http.postJson(url, param, success)
+}
 //根据对象删除系统和设备的关系,只针对一个对象
 export function eqInSysUnlink(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-eq/unlink`;
     http.postJson(url, param, success)
 }
-
+//根据对象删除系统所在业务空间关系
+export function spaceInSysUnlink(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-sp-base/unlink-list?type=${param.type}`;
+    http.postJson(url, param.data, success)
+}
 //关系-----设备所在业务空间--删除关系
 export function eqInSpaceDelete(param, success) {
     let url = `${baseUrl}/datacenter/eq-in-sp-base/unlink-list?type=${param.type}`;

+ 2 - 2
src/components/data_admin/buildTask/taskStatistics.vue

@@ -3,10 +3,10 @@
 		<div class="statistics-all flex-row">
       <div class="statistics-progress">
         <div class="statistics-progress-num">
-          <p>{{taskProgress + '%'}}</p>
+          <p>{{taskProgress?taskProgress:0 + '%'}}</p>
           <p>完成情况</p>
         </div>
-        <el-progress :width="90" type="circle" :percentage="taskProgress" :show-text="false"></el-progress>
+        <el-progress :width="90" type="circle" :percentage="taskProgress?taskProgress:0" :show-text="false"></el-progress>
       </div>
       <div class="statistics-all-box flex-col">
         <span>总任务:<b>{{allCount}}</b></span>

+ 15 - 15
src/components/ledger/handsontables/device.vue

@@ -149,7 +149,7 @@ export default {
     lookPic,
     myCascader
   },
-  created() { 
+  created() {
     buildFloor.getData(this.buildFloorData)
   },
   computed: {
@@ -241,7 +241,7 @@ export default {
         getDataDictionary(params, res => {
           this.tableHeader = res.Content;
           this.tableHeader.forEach(item => {
-            if(item.Path && item.InputMode){
+            if (item.Path && item.InputMode) {
               this.inputMap[item.Path] = item.InputMode
             }
           })
@@ -341,7 +341,7 @@ export default {
                       tools.setDataForKey(
                         item,
                         head.Path,
-                        child.error ? child.value? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+                        child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
                       );
                     }
                   });
@@ -441,14 +441,14 @@ export default {
           readOnly: true,
           renderer: tools.LinkEquipLocalName
         }, {
-          data: "LinkSystem",
-          renderer: text.systemList,
-          readOnly: true
-        }, {
-          data: "Count",
-          readOnly: true,
-          renderer: tools.lookDetails
-        }
+        data: "LinkSystem",
+        renderer: text.systemList,
+        readOnly: true
+      }, {
+        data: "Count",
+        readOnly: true,
+        renderer: tools.lookDetails
+      }
       );
       if (this.showType == "all") {
         data.splice(6, 0, {
@@ -601,8 +601,8 @@ export default {
       change.map(item => {
         let key = item[1].split(".")[0]
         if (key == "flowBuild" && keyList.indexOf(key) == -1) {
-          keyList.push("BuildingId","FloorId")
-          param.Projection.push("BuildingId","FloorId")
+          keyList.push("BuildingId", "FloorId")
+          param.Projection.push("BuildingId", "FloorId")
         }
         if (item[1] && keyList.indexOf(key) == -1 && item[1] != 'PropertyId') {
           keyList.push(key);
@@ -688,7 +688,7 @@ export default {
           return false
         //关联资产
         case 'LinkEquipLocalName':
-          if (this.linkNameFalg) {
+          if (!this.onlyRead) {
             this.myDialog.changeRea = true;
           }
           return false
@@ -795,7 +795,7 @@ export default {
       this.updateInput = ''
     },
     //更新临时维护信息点
-    handleClickUpdate(){
+    handleClickUpdate() {
       tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
       this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
       this.updateInputShow = false

+ 3 - 2
src/components/ledger/handsontables/system.vue

@@ -541,8 +541,9 @@ export default {
       if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
         // this.updateInfoPoint = val
         // this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-        let floor = tools.dataForKey(this.tableData[row.row], val);
-        this.$refs.editFloor.showDialog();
+        // console.log("this is ",this.tableData[row.row])
+        // let floor = tools.dataForKey(this.tableData[row.row], val);
+        this.$refs.editFloor.showDialog(this.tableData[row.row]);
       }
     },
     //更新临时维护信息点

+ 6 - 3
src/components/ledger/lib/editSysFloor.vue

@@ -1,7 +1,7 @@
 <template>
-  <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="50%" id="messageDialog">
+  <el-dialog title="所属建筑楼层" :visible.sync="connectDialogVis" width="50%" id="messageDialog">
     <el-row>
-      <div style="line-height:32px;">添加与{{floor.FloorLocalName}}层有贯通关系的楼层 : </div>
+      <div style="line-height:32px;">添加{{floor.SysLocalName}}所属建筑楼层 : </div>
       <div style="width:70%">
         <bfCascader ref="bfCascader" :FloorID="floor.FloorID"></bfCascader>
       </div>
@@ -27,7 +27,10 @@ export default {
     bfCascader
   },
   methods: {
-    showDialog() {
+    showDialog(floor=null) {
+      if(floor){
+        this.floor = floor
+      }
       this.connectDialogVis = true
       this.$nextTick(() => {
         this.$refs.bfCascader.getCascader()

+ 6 - 5
src/components/ledger/lib/floorCascader.vue

@@ -1,6 +1,6 @@
 <template>
     <div id="buildFloor">
-        <span class="buildFloor" style="margin-right: 12px;">建筑楼层</span>
+        <span class="buildFloor">建筑楼层</span>
         <el-cascader placeholder="请选择建筑楼层" :options="options" v-model="value" filterable size="small" :style="isWidth ? '' : 'width:160px;'" @change="changeCascader"></el-cascader>
     </div>
 </template>
@@ -149,9 +149,10 @@
     #buildFloor {
         margin-left: 10px;
         float: left;
-        .buildFloor {
-            color: #999999;
-            font-size: 14px;
-        }
+    }
+    .buildFloor {
+        color: #999999;
+        font-size: 14px;
+        margin-right: 12px;
     }
 </style>

+ 2 - 1
src/components/ledger/lib/spaceSelect.vue

@@ -2,7 +2,7 @@
   <div id="spaceSelect">
     <span class="buildFloor" style="padding-right:12px">业务空间</span>
     <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
-      <el-option v-for="item in options" :key="item.Code" :label="item.Name" :value="item.Code"></el-option>
+      <el-option v-for="(item, key) in options" :key="key" :label="item.Name" :value="item.Code"></el-option>
     </el-select>
   </div>
 </template>
@@ -39,6 +39,7 @@ export default {
           }
           return t;
         }).filter(item => item);
+        this.options.unshift({Code:null, CreateTime:null, LastUpdate:null, Name:'全部', ObjectType: null, ParentId: null, Statistics: {}});
       })
     },
     //改变空间

+ 6 - 6
src/components/ledger/system/dialog/addCenoteDialog.vue

@@ -1,12 +1,12 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
-    <el-row class="filters" :gutter="20">
-      <el-col :span="8">
+    <el-row class="filters">
+      <el-col :span="7" style="width:268px">
         <el-input placeholder="输入竖井名称或竖井本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
-      <el-col :span="9">
+      <el-col :span="7.5">
         <cenote-type @change="changeCenote"></cenote-type>
       </el-col>
     </el-row>
@@ -42,7 +42,7 @@
 </template>
 
 <script>
-import { unSysShaft, queryShaftType, linkSh } from "@/api/scan/request";
+import { unSysShaft, queryShaftType, linkSysSh } from "@/api/scan/request";
 import cenoteType from "@/components/ledger/lib/cenoteType";
 import { mapGetters } from "vuex";
 export default {
@@ -109,7 +109,7 @@ export default {
           PageSize: this.page.pageSize,
         },
         shaftId: this.params.ShaftID,
-        sysId:this.$route.query.SysID
+        sysId: this.$route.query.SysID
       }
       if (this.keycode != '') {
         params.data.Filters += `;ShaftName contain '${this.keycode}' or ShaftLocalName contain '${this.keycode}' or ShaftLocalID contain '${this.keycode}'`
@@ -136,7 +136,7 @@ export default {
             return item.ShaftID
           })
         }
-        linkSh(params, res => {
+        linkSysSh(params, res => {
           this.dialogVisible = false
           this.$message.success('关联成功!')
           this.$emit('refresh')

+ 61 - 51
src/components/ledger/system/dialog/addEquipDialog.vue

@@ -10,7 +10,7 @@
         <floor-cascader @change="changeFloor" style="margin-left:5px;"></floor-cascader>
       </el-col>
       <el-col :span="8.5" style="padding-right:0;">
-        <myCascader @change="changeDevice" :params="params"></myCascader>
+        <myCascader @change="changeDevice" :all="true" :params="childParams"></myCascader>
       </el-col>
     </el-row>
 
@@ -20,9 +20,7 @@
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
-            <div>
-              {{scope.row.EquipLocalName||scope.row.EquipName||''}}
-            </div>
+            <div>{{scope.row.EquipLocalName||scope.row.EquipName||''}}</div>
           </template>
         </el-table-column>
         <el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
@@ -46,7 +44,7 @@
 </template>
 
 <script>
-import { sysLinkEquip, unSysEq} from "@/api/scan/request";
+import { sysLinkEquip, unSysEq } from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import myCascader from "@/components/ledger/system/lib/equipType";
 import { mapGetters } from "vuex";
@@ -61,10 +59,10 @@ export default {
   data() {
     return {
       title: "添加系统内设备",
-      keycode: '', //输入查询条件
-      Buildfloor: ['all'], // 选中的建筑楼层
-      Equipcategory: null,// 选中的设备类型
-      inSpaceType: '设备',
+      keycode: "", //输入查询条件
+      Buildfloor: ["all"], // 选中的建筑楼层
+      Equipcategory: null, // 选中的设备类型
+      inSpaceType: "设备",
       dialogVisible: false,
       tableData: [],
       loading: false,
@@ -76,12 +74,19 @@ export default {
         total: 0
       },
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
-      } // 列表样式
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px"
+      } // 列表样式,
     };
   },
+  computed: {
+    childParams() {
+      let temp = JSON.parse(JSON.stringify(this.params));
+      temp.SysType = null;
+      return temp;
+    }
+  },
   props: {
     type: String, //选中的tab页
     params: Object //查看的竖井关系信息
@@ -90,61 +95,58 @@ export default {
   methods: {
     //修改建筑楼层
     changeFloor(value) {
-      this.Buildfloor = value
-      this.getTableData()
-    },
-    //修改设备类别
-    changeDevice(value) {
-      this.Equipcategory = value.code
-      this.getTableData()
+      this.Buildfloor = value;
+      this.getTableData();
     },
     // 显示弹窗
     showDialog() {
-      this.dialogVisible = true
-      this.page.pageNumber = 1
-      this.tableData = []
-      this.getTableData()
+      this.dialogVisible = true;
+      this.page.pageNumber = 1;
+      this.tableData = [];
+      this.getTableData();
     },
     getTableData() {
-      
       let params = {
         data: {
           Filters: `not EquipID isNull`,
+          Cascade: [{ Name: "equipCategory" }],
           Orders: "createTime desc, EquipID desc",
           PageNumber: this.page.pageNumber,
-          PageSize: this.page.pageSize,
+          PageSize: this.page.pageSize
         },
         shaftId: this.params.ShaftID,
-        sysId:this.$route.query.SysID
-      }
+        sysId: this.$route.query.SysID
+      };
       if (this.Buildfloor[0] == "noKnow") {
-        params.data.Filters += `;buildingId isNull`
+        params.data.Filters += `;buildingId isNull`;
       } else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
-        params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`
+        params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`;
       }
       if (this.Buildfloor[1] == "noKnow") {
-        params.data.Filters += `;floorId isNull`
+        params.data.Filters += `;floorId isNull`;
       } else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
-        params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
+        params.data.Filters += `;floorId='${this.Buildfloor[1]}'`;
       }
-      if (this.keycode != '') {
-        params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`
+      if (this.keycode != "") {
+        params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`;
       }
       if (this.Equipcategory) {
-        params.data.Filters += `;category='${this.Equipcategory}'`
+        params.data.Filters += `;category='${this.Equipcategory}'`;
       }
       unSysEq(params, res => {
         res.Content.forEach(item => {
-          item.ShaftListName = ""
+          item.ShaftListName = "";
           if (item.ShaftList && item.ShaftList.length) {
             item.ShaftListName = item.ShaftList.map(shaft => {
-              return shaft.ShaftLocalName ? shaft.ShaftLocalName : shaft.ShaftName
-            }).join("、")
+              return shaft.ShaftLocalName
+                ? shaft.ShaftLocalName
+                : shaft.ShaftName;
+            }).join("、");
           }
-        })
-        this.tableData = res.Content
-        this.page.total = res.Total
-      })
+        });
+        this.tableData = res.Content;
+        this.page.total = res.Total;
+      });
     },
     //选中项修改
     handleSelectionChange(val) {
@@ -155,18 +157,23 @@ export default {
         let params = {
           SysId: this.$route.query.SysID,
           EquipIdList: this.selections.map(item => {
-            return item.EquipID
+            return item.EquipID;
           })
-        }
+        };
         sysLinkEquip(params, res => {
-          this.dialogVisible = false
-          this.$message.success('关联成功!')
-          this.$emit('refresh')
-        })
+          this.dialogVisible = false;
+          this.$message.success("关联成功!");
+          this.$emit("refresh");
+        });
       } else {
-        this.$message('请选择要关联的设备')
+        this.$message("请选择要关联的设备");
       }
     },
+    //修改设备类别
+    changeDevice(value) {
+      this.Equipcategory = value.code;
+      this.getTableData();
+    },
     //改变pagesize
     handleSizeChange(pageSize) {
       this.page.pageSize = pageSize;
@@ -179,9 +186,9 @@ export default {
     },
     // 查看详情
     toDetail() {
-      this.$message('开发中')
+      this.$message("开发中");
     }
-  },
+  }
 };
 </script>
 <style lang="less" scoped>
@@ -196,4 +203,7 @@ export default {
     }
   }
 }
+/deep/ #buildFloor .buildFloor {
+  margin: 0 5px 0 5px;
+}
 </style>

+ 66 - 67
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -1,45 +1,39 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" :before-close="handleClose" width="900px" id="addEqDialog">
-    <el-row class="filters" :gutter="20">
+  <el-dialog :title="title" :visible.sync="dialog" :before-close="handleClose" width="900px" id="addEqDialog">
+    <el-row class="filters">
       <el-col :span="7" style="width:268px;padding:0px;">
-        <el-input style="" placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+        <el-input style placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
-      <el-col :span="8.5" style="padding:0 0;margin-left:5px">
+      <el-col :span="8.5" style="padding:0 0;margin-left:-2px">
         <floor-cascader ref="floorcas" @change="changeFloor"></floor-cascader>
       </el-col>
       <el-col :span="7.5" style="padding:0 0;">
         <space-select ref="spacesel" @change="changeSpace"></space-select>
       </el-col>
     </el-row>
-    <el-row class="filters" :gutter="20">
-
-    </el-row>
+    <el-row class="filters" :gutter="20"></el-row>
     <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
         @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column :label="`${inSpaceType}本地名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
-            <div>
-              {{scope.row.RoomLocalName||scope.row.RoomName||''}}
-            </div>
+            <div>{{scope.row.RoomLocalName||scope.row.RoomName||''}}</div>
           </template>
         </el-table-column>
         <el-table-column prop="RoomLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="" :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
-           <template slot-scope="scope">
+        <el-table-column prop :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
+          <template slot-scope="scope">
             <div>
-              {{(floorType[scope.row.BuildingId] || '') + (floorType[scope.row.FloorID] || '') || ''}}
+              {{ scope.row.BuildingId && floorType[scope.row.BuildingId]? ((floorType[scope.row.BuildingId] || '') + (scope.row.FloorId && floorType[scope.row.FloorId] ? (' - ' + floorType[scope.row.FloorId] || '') : '')) : ''}}
             </div>
           </template>
         </el-table-column>
         <el-table-column prop="ObjectType" :label="`空间类型`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
-            <div>
-              {{spaceType[scope.row.ObjectType] || ''}}
-            </div>
+            <div>{{spaceType[scope.row.ObjectType] || ''}}</div>
           </template>
         </el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
@@ -61,10 +55,14 @@
 </template>
 
 <script>
-import { unSysZoneSpace, linkSySh, queryDictionaryHead } from "@/api/scan/request";
+import {
+  unSysZoneSpace,
+  linkSysSp,
+  queryDictionaryHead
+} from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
-import dictionaryCas from '@/components/config_point/dictionaryCascader'
-import spaceSelect from '@/components/ledger/lib/spaceSelect'
+import dictionaryCas from "@/components/config_point/dictionaryCascader";
+import spaceSelect from "@/components/ledger/lib/spaceSelect";
 import { mapGetters } from "vuex";
 export default {
   components: {
@@ -73,18 +71,21 @@ export default {
     spaceSelect
   },
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
+    dialog() {
+      return this.dialogVisible;
+    }
   },
   data() {
     return {
       title: "添加系统所在业务空间",
-      keycode: '', //输入查询条件
-      inSpaceType: '业务空间',
-      Buildfloor: ['all'], // 选中的建筑楼层
-      Spacecategory: null,// 选中的业务空间类型
+      keycode: "", //输入查询条件
+      inSpaceType: "业务空间",
+      Buildfloor: ["all"], // 选中的建筑楼层
+      Spacecategory: null, // 选中的业务空间类型
       tableData: [],
-      floorData: {},//楼层
-      spaceData: {},//业务空间分区
+      floorData: {}, //楼层
+      spaceData: {}, //业务空间分区
       loading: false,
       selections: [], // 选中项
       page: {
@@ -94,9 +95,9 @@ export default {
         total: 0
       },
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px"
       } // 列表样式
     };
   },
@@ -107,24 +108,21 @@ export default {
     dialogVisible: Boolean,
     floorType: Object
   },
-  mounted() {
-
-  },
+  mounted() { },
   methods: {
     // 显示弹窗
     showDialog() {
-      this.dialogVisible = true
-
+      this.dialogVisible = true;
     },
     //修改建筑楼层
     changeFloor(value) {
-      this.Buildfloor = value
-      this.getTableData()
+      this.Buildfloor = value;
+      this.getTableData();
     },
     //修改空间类型
     changeSpace(value) {
-      this.Spacecategory = value
-      this.getTableData()
+      this.Spacecategory = value;
+      this.getTableData();
     },
     getTableData() {
       let params = {
@@ -132,36 +130,35 @@ export default {
           Filters: "not RoomID isNull",
           Orders: "RoomLocalName desc",
           PageNumber: this.page.pageNumber,
-          PageSize: this.page.pageSize,
+          PageSize: this.page.pageSize
         },
         shaftId: this.params.ShaftID,
         sysId: this.$route.query.SysID
-      }
+      };
       if (this.Buildfloor[0] == "noKnow") {
-        params.data.Filters += `;buildingId isNull`
+        params.data.Filters += `;buildingId isNull`;
       } else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
-        params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`
+        params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`;
       }
       if (this.Buildfloor[1] == "noKnow") {
-        params.data.Filters += `;floorId isNull`
+        params.data.Filters += `;floorId isNull`;
       } else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
-        params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
+        params.data.Filters += `;floorId='${this.Buildfloor[1]}'`;
       }
       if (this.Spacecategory) {
-        params.data.Filters += `;ObjectType='${this.Spacecategory}'`
+        params.data.Filters += `;ObjectType='${this.Spacecategory}'`;
       }
-      if (this.keycode != '') {
-        params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`
+      if (this.keycode != "") {
+        params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`;
       }
 
       unSysZoneSpace(params, res => {
-        console.log("hh ",this.floorType)
-        this.tableData = res.Content
-        this.page.total = res.Total
-      })
+        this.tableData = res.Content;
+        this.page.total = res.Total;
+      });
     },
     handleClose() {
-      this.$emit('update:dialogVisible', false)
+      this.$emit("update:dialogVisible", false);
     },
     //选中项修改
     handleSelectionChange(val) {
@@ -170,18 +167,20 @@ export default {
     savaRelation() {
       if (this.selections.length) {
         let params = {
-          ShaftId: this.params.ShaftID,
-          SysIdList: this.selections.map(item => {
-            return item.SysID
+          Content: this.selections.map(item => {
+            return {
+              SpaceID: item.RoomID,
+              SysID: this.$route.query.SysID,
+              ObjectType: item.ObjectType
+            };
           })
-        }
-        linkSySh(params, res => {
-          this.dialogVisible = false
-          this.$message.success('关联成功!')
-          this.$emit('refresh')
-        })
+        };
+        linkSysSp(params, res => {
+          this.$message.success("关联成功!");
+          this.$emit("refresh");
+        });
       } else {
-        this.$message('请选择要关联的设备')
+        this.$message("请选择要关联的设备");
       }
     },
     //改变pagesize
@@ -196,16 +195,16 @@ export default {
     },
     // 查看详情
     toDetail() {
-      this.$message('开发中')
+      this.$message("开发中");
     }
   },
   watch: {
     dialogVisible: {
       handler() {
         if (this.dialogVisible) {
-          this.page.pageNumber = 1
-          this.tableData = []
-          this.getTableData()
+          this.page.pageNumber = 1;
+          this.tableData = [];
+          this.getTableData();
         }
       },
       immediate: true
@@ -216,7 +215,7 @@ export default {
 <style lang="less" scoped>
 #addEqDialog {
   .filters {
-    margin-bottom: 10px;
+    margin: 0 0 10px 0;
   }
   .table-box {
     height: 370px;

+ 7 - 4
src/components/ledger/system/lib/equipType.vue

@@ -79,10 +79,13 @@ export default {
         })
       })
       let promise1 = new Promise((resolve, reject) => {
-        queryPhysicsAllType(param1, res => {    
-          let tempArr = res.Content.filter(t => {
-            return t.ParentId == `${this.params.SysType}`
-          })
+        queryPhysicsAllType(param1, res => {
+          let tempArr = res.Content;
+          if (this.params.SysType) {
+            tempArr = res.Content.filter(t => {
+              return t.ParentId == `${this.params.SysType}`
+            })
+          }
           resolve(tempArr)
         })
       })

+ 44 - 35
src/components/ledger/system/table/spaceTable.vue

@@ -10,17 +10,13 @@
       <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
-            <div>
-              {{scope.row.SysLocalName||scope.row.SysName||''}}
-            </div>
+            <div>{{ scope.row.RoomLocalName || scope.row.RoomName||''}}</div>
           </template>
         </el-table-column>
-        <el-table-column prop="SysLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="RoomLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column :label="`${inSpaceType}类型`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
-            <div>
-              {{scope.row.CategoryNames.CategoryName}}
-            </div>
+            <div>{{ spaceType[scope.row.ObjectType]}}</div>
           </template>
         </el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
@@ -39,14 +35,15 @@
       </el-table>
     </div>
     <!-- 添加空间弹窗 -->
-    <addSpaceDialog :dialogVisible.sync="dialogVisible" ref="addSpaceDialog" @refresh="getTableData" :type="type" :params="params" :spaceType="spaceType" :floorType="floorType"></addSpaceDialog>
+    <addSpaceDialog :dialogVisible.sync="dialogVisible" ref="addSpaceDialog" @refresh="refresh" :type="type" :params="params" :spaceType="spaceType"
+      :floorType="floorType"></addSpaceDialog>
   </div>
 </template>
 
 <script>
-import { queryLinkSys, syinshUnlink } from "@/api/scan/request";
+import { queryLinkSys, spaceInSysUnlink } from "@/api/scan/request";
 import { mapGetters } from "vuex";
-import addSpaceDialog from "@/components/ledger/system/dialog/addSpaceDialog"
+import addSpaceDialog from "@/components/ledger/system/dialog/addSpaceDialog";
 export default {
   components: {
     addSpaceDialog
@@ -56,12 +53,12 @@ export default {
   },
   data() {
     return {
-      inSpaceType: '业务空间',
+      inSpaceType: "业务空间",
       dialogVisible: false,
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px"
       }, // 列表样式
       loading: false, // loading
       tableData: [] //列表数据
@@ -74,7 +71,7 @@ export default {
     floorType: {}
   },
   created() {
-    this.getTableData()
+    this.getTableData();
   },
   methods: {
     // 获取列表数据
@@ -83,36 +80,43 @@ export default {
         Filters: `SysID='${this.params.SysID}'`,
         Cascade: [
           {
-            Name: 'zoneSpaceBaseTableList'
+            Name: "zoneSpaceBaseTableList"
           }
         ]
-      }
+      };
       queryLinkSys(params, res => {
-        this.tableData = res.Content[0].SystemList || []
-      })
+        this.tableData = res.Content[0].ZoneSpaceBaseTable || [];
+      });
     },
     // 删除关系
     handleDelete(index, row) {
       this.$confirm("确认删除该关系?", "提示", {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        let params = {
-          SysId: row.SysID,
-          ShaftId: this.params.ShaftID
-        }
-        this.deleteSyInSh(params);
-      }).catch(() => {
-        this.$message("取消删除")
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
       })
+        .then(() => {
+          let params = {
+            data: [
+              {
+                SysId: this.params.SysID,
+                SpaceId: row.RoomID
+              }
+            ],
+            type: row.ObjectType
+          };
+          this.deleteSyInSh(params);
+        })
+        .catch(() => {
+          this.$message("取消删除");
+        });
     },
     // 删除系统所在竖井关系
     deleteSyInSh(params) {
-      syinshUnlink(params, res => {
-        this.$message.success('删除成功')
-        this.getTableData()
-      })
+      spaceInSysUnlink(params, res => {
+        this.$message.success("删除成功");
+        this.getTableData();
+      });
     },
     // 改变pagesize
     handleSizeChange(pageSize) {
@@ -126,7 +130,12 @@ export default {
     },
     // 添加设备
     add() {
-      this.dialogVisible = true
+      this.dialogVisible = true;
+    },
+    //刷新
+    refresh() {
+      this.dialogVisible = false;
+      this.getTableData()
     }
   },
   watch: {