Browse Source

Merge branch 'msg-sever' of http://39.106.8.246:3003/web/ibms into msg-sever

yangjunjing 5 years ago
parent
commit
c082dc2389

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
         "@saga-web/base": "2.1.9",
         "@saga-web/draw": "2.1.58",
         "@saga-web/graphy": "2.1.30",
-        "@saga-web/cad-engine": "2.0.345"
+        "@saga-web/cad-engine": "2.0.358"
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 1 - 1
src/api/scan/httpUtil.js

@@ -45,7 +45,7 @@ export default {
         let ProjectId = storage.get("global_project_selected")
         let userName = storage.get("user_name")
         let vm = this;
-        fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName} }).then((response) => {
+        fetch({ url: url, method: 'post', params: data.paramsQuery || null, data: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName} }).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);

+ 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}`;

+ 21 - 8
src/components/business_space/newGraphy/canvasFun.vue

@@ -1,12 +1,15 @@
 <template>
-  <el-row id="canvas-actions-box" :class="{'isEdit':isEdit}">
+  <el-row id="canvas-actions-box" :class="{'isEdit':config.isEdit}">
     <!-- <div :class="{'active':active=='move'}">
       <i class="iconfont icon-move" @click="moveCanvas"></i>
     </div> -->
+    <div v-if="config.isEdit&&config.groupSelect" :class="{'active':active=='groupSelect'}">
+      <i class="iconfont icon-shuxingxuanze" @click="groupSelect"></i>
+    </div>
     <div>
       <i class="iconfont icon-maximize" @click="fitToWindow"></i>
     </div>
-    <div>
+    <div v-if="!config.isEdit">
       <el-dropdown size="mini" placement="top-start" @command="handleCommand">
         <i class="el-icon-download" style="font-size:20px;color:#fff;"></i>
         <el-dropdown-menu slot='dropdown'>
@@ -15,7 +18,7 @@
         </el-dropdown-menu>
       </el-dropdown>
     </div>
-    <div v-if="isEdit" :class="{'active':active=='divide'}">
+    <div v-if="config.isEdit&&config.divide" :class="{'active':active=='divide'}">
       <el-dropdown size="mini" placement="top-start" @command="handleDivideCommand" :hide-on-click="false">
         <i class="iconfont icon-edit1" @click="divide"></i>
         <el-dropdown-menu slot='dropdown'>
@@ -25,13 +28,13 @@
         </el-dropdown-menu>
       </el-dropdown>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit&&config.divide">
       <i class="iconfont icon-Erase" @click="clearDivide"></i>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit">
       <i class="iconfont icon-Cancel" @click="undo"></i>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit">
       <i class="iconfont icon-Anti-cancel" @click="redo"></i>
     </div>
     <div>
@@ -57,8 +60,13 @@ export default {
     }
   },
   props: {
-    isEdit: {
-      default: false
+    config: {
+      type: Object,
+      default: {
+        isEdit: false,
+        divide: true,
+        groupSelect: false
+      }
     }
   },
   computed: {
@@ -70,6 +78,11 @@ export default {
     //   this.active = this.active != "move" ? "move" : '';
     //   this.$emit('move', this.active == 'move');
     // },
+    //
+    groupSelect() {
+      this.active = 'groupSelect';
+      this.$emit('groupSelect');
+    },
     // 适配大小
     fitToWindow() {
       this.$emit('fit');

+ 135 - 94
src/components/business_space/newGraphy/graphy.vue

@@ -49,6 +49,11 @@
             <el-button plain @click="cancelGraphy">取 消</el-button>
             <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
           </div>
+          <!-- 批量创建所选业务空间 -->
+          <div v-show="type==5">
+            <el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
+            <el-button plain @click="cancelGraphy">取 消</el-button>
+          </div>
         </div>
         <div style="position: absolute;right: 0;">
           <el-button type="text" @click="lookUnrelatBSpace(false)">未关联平面图的业务空间 {{num}} 条</el-button>
@@ -56,13 +61,13 @@
       </el-row>
       <!-- 底部操作按钮 -->
       <el-row class="canvas-actions-box">
-        <canvasFun @move="moveCanvas" @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo"
-          @redo="redo" @scale="scale" :isEdit="isEdit" ref="canvasFun"></canvasFun>
+        <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo"
+          @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect" :config="config" ref="canvasFun"></canvasFun>
       </el-row>
     </div>
     <!--  -->
     <!-- 未关联元空间的业务空间 -->
-    <unRelateBSP ref="unRelateBSP" :tableData="BSPUnrelaISPList" :isAction="isAction" @createFromUnrelated="createFromUnrelated"></unRelateBSP>
+    <unRelateBSP ref="unRelateBSP" :isAction="isAction" @createFromUnrelated="createFromUnrelated" :code="tab.code"></unRelateBSP>
     <!-- 创建新的业务空间 -->
     <createBSP ref="createBSP" @createRoom="createRoom"></createBSP>
     <!-- 批量创建选择弹窗 -->
@@ -92,10 +97,11 @@ import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
 import unRelateBSP from "./unRelateBSP";
 import createBSP from "./createBSP";
 import {
-  countZone,
+  buildingQuery,
   queryZone,
   updateZone,
   createZone,
+  countZone,
   getIspNotInSpace,
   createRelateInZoneAndISp,
   groupCreRelaZoneAndISp
@@ -125,18 +131,21 @@ export default {
       canvasHeight: 600,
       type: 1, // 默认操作模式
       search: '',//搜索
-      num: 0, // 未关联空间的业务空间条数
       buildFloor: ['', ''],
       FloorObj: {}, //楼层对象
       FloorMap: '', //楼层底图
       tab: {},
-      isEdit: false,
+      config: {
+        isEdit: false,
+        divide: true,
+        groupSelect: true
+      },
       canvasLoading: false,
       view: null,
       scene: null,
       Outline: [], // 当前选中的多个空间组成的轮廓线->三维数组
       businessSpaceList: [], // 所有业务空间
-      BSPUnrelaISPList: [], // 未关联元空间的业务空间
+      num: 0, // 未关联元空间的业务空间统计
       BSPRelaISPList: [], // 已关联元空间的业务空间
       // 未关联元空间的业务空间弹窗
       isAction: false,
@@ -178,12 +187,17 @@ export default {
         // 业务空间
         this.getBusinessSpace();
       }
-      // 获取未关联平面图的业务空间统计
-      this.getUnrelateCount();
+      this.config = {
+        isEdit: false,
+        divide: true,
+        groupSelect: true
+      }
       // 获取当前楼层的元空间
       this.getFloorISpace();
       // 查询未关联业务空间的元空间
-      this.getISPSPUnrelaBSP()
+      this.getISPSPUnrelaBSP();
+      // 查询未关联平面图的业务空间
+      this.getBSPunrelaISP();
     },
     // 获取当前楼层的元空间
     getFloorISpace() {
@@ -223,6 +237,7 @@ export default {
       this.scene.clearZoneSelection();
       // 选中当前
       zone.selected = true;
+      this.curZoneItem = zone;
       this.type = 2;
       this.view.fitSelectedToView();
     },
@@ -239,18 +254,6 @@ export default {
       console.log(arguments)
       this.init(initType);
     },
-    // 获取未关联平面图的业务空间统计
-    getUnrelateCount() {
-      let pa = {
-        data: {
-          Filters: `BuildingId='${this.buildFloor[0]}';FloorId='${this.buildFloor[1]}';Outline isNull`
-        },
-        zone: this.tab.code
-      }
-      countZone(pa, res => {
-        this.num = res.Count
-      })
-    },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {
       let pa = {
@@ -320,15 +323,11 @@ export default {
       queryZone(pa, res => {
         // 所有业务空间
         this.businessSpaceList = res.Content;
-        // 未关联元空间的业务空间
-        this.BSPUnrelaISPList = [];
         // 已关联元空间的业务空间
         this.BSPRelaISPList = [];
         res.Content.map(t => {
           if (t.Outline && t.Outline.length) {
             this.BSPRelaISPList.push(t)
-          } else {
-            this.BSPUnrelaISPList.push(t)
           }
         })
         // 绘制业务空间
@@ -349,18 +348,24 @@ export default {
     },
     // canvas点击事件
     canvasClick(item, event) {
+      console.log(item)
+      console.log(event)
       if (this.type == 4) {
 
       } else {
         if (item instanceof SpaceItem && item.selectable) {
+          if (this.type == 2) {
+            this.scene.clearZoneSelection();
+          }
           this.type = 3;
           this.curZoneItem = {};
-          this.scene.isZoneSelectable = false;
         }
         if (item instanceof ZoneItem && item.selectable) {
+          if (this.type == 3) {
+            this.scene.clearSpaceSelection();
+          }
           this.type = 2;
           this.curZoneItem = item;
-          this.scene.isSpaceSelectable = false;
           this.scene.clearZoneSelection();
           item.selected = true;
         }
@@ -369,6 +374,11 @@ export default {
     // 编辑平面图
     editGraphy() {
       this.type = 3;
+      this.config.isEdit = true;
+      this.config.groupSelect = false;
+      this.config.divide = true;
+      // 设置业务空间不可选
+      this.scene.isZoneSelectable = false
     },
     // 查看未关联的业务空间--flag--查看-or-选择
     lookUnrelatBSpace(flag) {
@@ -393,7 +403,17 @@ export default {
       if (this.groupCreateType == 1) {
         this.groupCreateBSpace()
       } else if (this.groupCreateType == 2) {
-        
+        this.type = 5;
+        this.config.isEdit = true;
+        this.config.groupSelect = true;
+        this.config.divide = false;
+        this.groupCreateDialogVis = false;
+        // 清空选中空间
+        this.scene.clearSpaceSelection();
+        // 设置空间可选
+        this.scene.isSpaceSelectable = true;
+        // 设置业务空间不可选
+        this.scene.isZoneSelectable = false;
       }
     },
     // 批量创建业务空间
@@ -428,34 +448,9 @@ export default {
           type: "warning"
         }
         ).then(() => {
-          let pa = {
-            zone: this.tab.code,
-            data: {
-              Content: Spaces
-            }
-          }
+          this.groupCreateDialogVis = false;
           this.canvasLoading = true;
-          createZone(pa, res => {
-            res.EntityList.map(t => {
-              Spaces = Spaces.map(item => {
-                if (t.RoomLocalName == item.RoomLocalName) {
-                  item.SpaceId = t.RoomID
-                }
-                return item;
-              })
-            })
-            let param = {
-              data: {
-                Content: Spaces
-              },
-              type: this.tab.code
-            }
-            groupCreRelaZoneAndISp(param, res => {
-              this.$message.success('创建成功')
-              this.canvasLoading = false;
-              this.init(2)
-            })
-          })
+          this.groupCreateBSP(Spaces)
         }).catch(() => {
           this.$message({
             type: "info",
@@ -494,38 +489,21 @@ export default {
       zoneObj.RoomLocalName = val;
       zoneObj.BuildingId = this.buildFloor[0];
       zoneObj.FloorId = this.buildFloor[1];
-      let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: [zoneObj]
-        }
-      }
-      createZone(pa, res => {
-        this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
-      })
+      this.createSingleBSP(zoneObj, IspaceIdList)
     },
     // 从未关联平面图的业务空间中选择--按钮返回关联信号
     createFromUnrelated(BSP) {
       BSP.Outline = [];
       BSP.Height = 0;
-      let arr = this.scene.getSelectedSpaces();
+      let arr = this.scene.getSelectedSpaces(), IspaceIdList = [];
       arr.map(t => {
         BSP.Outline.push(t.data.OutLine);
+        IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
         if (t.Height && (BSP.Height == 0 || t.Height < BSP.Height)) {
           BSP.Height = t.Height;
         }
       })
-      let pa = {
-        zone: BSP.ObjectType,
-        data: {
-          Content: [BSP],
-          Projection: ['Outline']
-        }
-      }
-      updateZone(pa, res => {
-        this.$message.success('更新成功');
-        this.init(2);
-      })
+      this.updateBSPOutline(BSP, IspaceIdList)
     },
     // 编辑空间详情
     editeSpaceDetail() {
@@ -543,7 +521,8 @@ export default {
       // 设置空间可选
       this.scene.isSpaceSelectable = true;
       // 将已关联的设置不可选,并将当前选的隐藏
-      this.scene.changeSelectZone(this.curZoneItem);
+      this.scene.isZoneSelectable = false;
+      this.curZoneItem.visible = false;
     },
     // 重新划分--保存
     saveRefactorBSP() {
@@ -561,6 +540,69 @@ export default {
       if (!zoneObj.Outline.length) {
         zoneObj.Outline = null;
       }
+      this.updateBSPOutline(zoneObj, IspaceIdList)
+    },
+    // 批量创建所选业务空间
+    groupCreateZone() { },
+    // 更新业务空间和元空间的关系
+    relationInBSPandISP(SpaceId, IspaceIdList) {
+      let pa = {
+        data: { SpaceId: SpaceId, IspaceIdList: IspaceIdList },
+        type: this.tab.code
+      }
+      createRelateInZoneAndISp(pa, res => {
+        this.$message.success('创建成功');
+        this.init(2);
+      })
+    },
+    // 批量更新业务空间和元空间的关系
+    groupCreRelaZoneAndISp(Spaces) {
+      let param = {
+        data: {
+          Content: Spaces
+        },
+        type: this.tab.code
+      }
+      groupCreRelaZoneAndISp(param, res => {
+        this.$message.success('创建成功')
+        this.canvasLoading = false;
+        this.init(2)
+      })
+    },
+    // 批量创建
+    groupCreateBSP(spaces) {
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: spaces
+        }
+      }
+      createZone(pa, res => {
+        res.EntityList.map(t => {
+          spaces = spaces.map(item => {
+            if (t.RoomLocalName == item.RoomLocalName) {
+              item.SpaceId = t.RoomID
+            }
+            return item;
+          })
+        })
+        this.groupCreRelaZoneAndISp(spaces)
+      })
+    },
+    // 单个创建
+    createSingleBSP(space, IspaceIdList) {
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: [space]
+        }
+      }
+      createZone(pa, res => {
+        this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
+      })
+    },
+    // 更新业务空间区域
+    updateBSPOutline(zoneObj, IspaceIdList) {
       let pa = {
         zone: this.tab.code,
         data: {
@@ -572,15 +614,16 @@ export default {
         this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
       })
     },
-    // 更新业务空间和元空间的关系
-    relationInBSPandISP(SpaceId, IspaceIdList) {
+    // 查询未关联平面图的业务空间(项目下+当前分区)
+    getBSPunrelaISP() {
       let pa = {
-        data: { SpaceId: SpaceId, IspaceIdList: IspaceIdList },
-        type: this.tab.code
+        zone: this.tab.code,
+        data: {
+          Filters: `Outline isNull`
+        }
       }
-      createRelateInZoneAndISp(pa, res => {
-        this.$message.success('创建成功');
-        this.init(2);
+      countZone(pa, res => {
+        this.num = res.Count;
       })
     },
     // canvas 获取焦点
@@ -596,15 +639,13 @@ export default {
       this.view = new FloorView('floorCanvas')
     },
     // 工具栏操作
-    // 移动底图
-    moveCanvas(move) {
-      // todo
-      let canvas = document.getElementById(`floorCanvas`);
-      if (move) {
-        canvas.style.cursor = 'move';
-      } else {
-        canvas.style.cursor = 'default';
-      }
+    // 吸附
+    changeAbsorb(isAbsorbing) {
+      this.scene.isAbsorbing = isAbsorbing;
+    },
+    // 框选
+    groupSelect() {
+      this.scene.isRectSelection = true;
     },
     // 适配底图到窗口
     fit() {

+ 137 - 27
src/components/business_space/newGraphy/unRelateBSP.vue

@@ -1,27 +1,52 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="600px" id="lookUnrelatBSpace">
-    <el-input :placeholder="`请输入业务空间名称`" v-model="queryString" @keyup.enter.native="queryTableData">
-      <i slot="suffix" class="el-input__icon el-icon-search" @click="queryTableData"></i>
-    </el-input>
-    <div style="margin-top:10px;height:300px;">
-      <el-table :data="data" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
-        <el-table-column prop="RoomLocalName" label="业务空间名称" show-overflow-tooltip min-width="200"></el-table-column>
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="unRelateBSP">
+    <el-row class="filters">
+      <el-col :span="9">
+        <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="15">
+        <span style="margin-left:10px;">所属楼层</span>
+        <el-cascader @change="getTableData" v-model="floor" :options="options" :props="props"></el-cascader>
+      </el-col>
+    </el-row>
+    <div class="table-box">
+      <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.RoomLocalName||scope.row.RoomName||''}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="BNAME" label="所属建筑" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="FNAME" label="所属楼层" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column prop="action" label="操作" min-width="100" v-if="isAction">
           <template slot-scope="scope">
-            <el-button @click="createRelation(scope.row)">关联平面图</el-button>
+            <el-button size="mini" @click="createRelation(scope.row)" type="primary" plain>关联平面图</el-button>
           </template>
         </el-table-column>
       </el-table>
+      <!-- 分页 -->
+      <el-pagination class="fr" v-show="tableData && tableData.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
+        :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="page.total"></el-pagination>
     </div>
   </el-dialog>
 </template>
 
 <script>
+import {
+  buildingQuery,
+  queryZone
+} from "@/api/scan/request"
 export default {
   name: "unRelateBSP",
   data() {
     return {
       title: '未关联平面图的业务空间',
+      inSpaceType: '业务空间',
       dialogVisible: false,
       loading: false,
       headerStyle: {
@@ -29,39 +54,124 @@ export default {
         color: '#2b2b2b',
         lineHeight: '30px'
       },
-      queryString: '',
-      data: []
+      keycode: '',
+      tableData: [],
+      page: {
+        pageSize: 50,
+        pageSizes: [10, 20, 50, 100],
+        pageNumber: 1,
+        total: 0
+      },
+      floor: ['all'], // 级联建筑楼层
+      props: { //自定义字段
+        value: "BuildID",
+        label: "BuildLocalName",
+        children: "Floor"
+      },
+      bfData: {}, //建筑楼层id =>名称
+      options: [], //级联
     };
   },
   props: {
-    tableData: {
-      default: []
-    }, //列表数据
     isAction: false, //是否显示操作按钮
+    code: String
+  },
+  created() {
+    this.getBuilding()
   },
   methods: {
     // 显示弹窗
     showDialog() {
-      this.data = this.tableData;
       this.dialogVisible = true;
-    },
-    // 搜索
-    queryTableData() {
-      var restaurants = this.tableData;
-      this.data = this.queryString ?
-        restaurants.filter(this.createFilter(this.queryString)) :
-        restaurants;
-    },
-    createFilter(queryString) {
-      return restaurant => {
-        return restaurant.RoomLocalName.indexOf(queryString) > -1;
-      };
+      this.getTableData();
     },
     // 关联平面图
     createRelation(row) {
       this.$emit('createFromUnrelated', row);
       this.dialogVisible = false;
+    },
+    // 分页条数
+    handleSizeChange(val) {
+      this.page.pageSize = val;
+      this.page.pageNumber = 1;
+      this.getTableData();
+    },
+    // 页码
+    handleCurrentChange(val) { 
+      this.page.pageNumber = val;
+      this.getTableData();
+    },
+    // 获取项目下建筑
+    getBuilding() {
+      let pa = {
+        Cascade: [{ name: 'floor', Orders: 'SequenceId desc' }],
+        Orders: "BuildLocalName asc",
+      }
+      buildingQuery(pa, res => {
+        this.options = res.Content.map(t => {
+          this.bfData[t.BuildID] = t.BuildLocalName;
+          if (t.Floor) {
+            t.Floor = t.Floor.map(item => {
+              this.bfData[item.FloorID] = item.FloorLocalName;
+              item.BuildID = item.FloorID;
+              item.BuildLocalName = item.FloorLocalName;
+              return item;
+            })
+          } else {
+            t.Floor = []
+          }
+          t.Floor.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
+          return t;
+        })
+        this.options.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
+      })
+    },
+    // 查询未关联平面图的业务空间(项目下+当前分区)
+    getTableData() {
+      let pa = {
+        zone: this.code,
+        data: {
+          Filters: `Outline isNull`,
+          Orders: "createTime desc, RoomID asc",
+          PageSize: this.page.pageSize,
+          pageNumber: this.page.pageNumber
+        }
+      }
+      if (this.floor[0] == 'isNull') {
+        pa.data.Filters += `;BuildingId isNull`
+      } else if (this.floor[0] && this.floor[0] != 'all') {
+        pa.data.Filters += `;BuildingId='${this.floor[0]}'`
+      }
+      if (this.floor[1] == 'isNull') {
+        pa.data.Filters += `;FloorId isNull`
+      } else if (this.floor[1] && this.floor[1] != 'all') {
+        pa.data.Filters += `;FloorId='${this.floor[1]}'`
+      }
+      if (this.keycode != '') {
+        pa.data.Filters += `;RoomLocalName contain "${this.keycode}" or RoomName contain "${this.keycode}"`
+      }
+      queryZone(pa, res => {
+        this.page.total = res.Total;
+        this.tableData = res.Content.map(t => {
+          t.BNAME = this.bfData[t.BuildingId];
+          t.FNAME = this.bfData[t.FloorId];
+          return t;
+        })
+      })
     }
   },
 };
-</script>
+</script>
+<style lang="less" scoped>
+#unRelateBSP {
+  .filters {
+    margin-bottom: 10px;
+    /deep/ .el-input__inner {
+      vertical-align: baseline;
+    }
+  }
+  .table-box {
+    height: 350px;
+  }
+}
+</style>

+ 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

+ 10 - 9
src/components/ledger/handsontables/system.vue

@@ -255,7 +255,7 @@ export default {
     formatHeaderData(list) {
       let arr = tools.copyArr(list)
       let data = showTools.headerTextFilter(arr, 'system', this.onlyRead, this.showType)
-      data.unshift("操作", "关联设备数量");
+      data.unshift("操作");
       if (this.showType == "all") {
         data.splice(3, 0, "所属建筑楼层")
       }
@@ -271,11 +271,11 @@ export default {
           renderer: tools.lookDetails,
           readOnly: true
         },
-        {
-          data: "Count",
-          renderer: tools.num,
-          readOnly: true
-        }
+        // {
+        //   data: "Count",
+        //   renderer: tools.num,
+        //   readOnly: true
+        // }
       );
       if (this.onlyRead) {
         data.map(item => {
@@ -364,7 +364,7 @@ export default {
       }
       this.hot = new Handsontable(container, {
         data: this.tableData,
-        fixedColumnsLeft: 4,
+        fixedColumnsLeft: 3,
         colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
         columns: this.formatHeaderType(this.tableHeader), //数据显示格式
         filters: true,
@@ -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')

+ 64 - 54
src/components/ledger/system/dialog/addEquipDialog.vue

@@ -1,16 +1,16 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
-      <el-col :span="7" style="width:276px">
+      <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="8.5" style="padding:0 0;">
-        <floor-cascader @change="changeFloor"></floor-cascader>
+        <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) {
@@ -154,19 +156,24 @@ export default {
       if (this.selections.length) {
         let params = {
           SysId: this.$route.query.SysID,
-          ListEquipId: this.selections.map(item => {
-            return item.EquipID
+          EquipIdList: this.selections.map(item => {
+            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>

+ 101 - 72
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -1,36 +1,39 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
-    <el-row class="filters" :gutter="20">
-      <el-col :span="8">
-        <el-input placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+  <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">
           <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;">
-        <floor-cascader @change="changeFloor"></floor-cascader>
+      <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="8.5" style="padding:0 0;">
-         <space-select @change="changeSpace"></space-select>
+      <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 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>
+            {{scope.row.RoomLocalName||scope.row.RoomName||''}}
           </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"></el-table-column>
-        <el-table-column prop="" :label="`空间类型`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
+          <template slot-scope="scope">
+            {{ scope.row.BuildingId && floorType[scope.row.BuildingId]? ((floorType[scope.row.BuildingId] || '') + (scope.row.FloorId && floorType[scope.row.FloorId] ? (' - ' + floorType[scope.row.FloorId] || '') : '')) : ''}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="ObjectType" :label="`空间类型`" show-overflow-tooltip min-width="100">
+          <template slot-scope="scope">
+            {{spaceType[scope.row.ObjectType] || ''}}
+          </template>
+        </el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">
             <el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
@@ -43,17 +46,21 @@
         :total="page.total"></el-pagination>
     </div>
     <span slot="footer" class="dialog-footer">
-      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+      <el-button size="small" @click="handleClose">取 消</el-button>
       <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
-import { unSysZoneSpace, linkSySh } 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: {
@@ -62,17 +69,21 @@ export default {
     spaceSelect
   },
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
+    dialog() {
+      return this.dialogVisible;
+    }
   },
   data() {
     return {
       title: "添加系统所在业务空间",
-      keycode: '', //输入查询条件
-      inSpaceType: '业务空间',
-      dialogVisible: false,
-      Buildfloor: ['all'], // 选中的建筑楼层
-      Spacecategory: null,// 选中的业务空间类型
+      keycode: "", //输入查询条件
+      inSpaceType: "业务空间",
+      Buildfloor: ["all"], // 选中的建筑楼层
+      Spacecategory: null, // 选中的业务空间类型
       tableData: [],
+      floorData: {}, //楼层
+      spaceData: {}, //业务空间分区
       loading: false,
       selections: [], // 选中项
       page: {
@@ -82,86 +93,92 @@ export default {
         total: 0
       },
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px"
       } // 列表样式
     };
   },
   props: {
     type: String, //选中的tab页
-    params: Object //查看的竖井关系信息
+    params: Object, //查看的竖井关系信息
+    spaceType: Object,
+    dialogVisible: Boolean,
+    floorType: Object
   },
-  created() { },
+  mounted() { },
   methods: {
     // 显示弹窗
     showDialog() {
-      this.dialogVisible = true
-      this.page.pageNumber = 1
-      this.tableData = []
-      this.getTableData()
+      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 = {
         data: {
-          Filters:"not LocalId isNull",
-          Orders: "Name desc",
+          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
-      }
+        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}'`
+      if (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 => {
-        this.tableData = res.Content
-        this.page.total = res.Total
-      })
+        this.tableData = res.Content;
+        this.page.total = res.Total;
+      });
+    },
+    handleClose() {
+      this.$emit("update:dialogVisible", false);
     },
     //选中项修改
     handleSelectionChange(val) {
       this.selections = val;
     },
     savaRelation() {
-      if(this.selections.length){
+      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')
-        })
-      }else {
-        this.$message('请选择要关联的设备')
+        };
+        linkSysSp(params, res => {
+          this.$message.success("关联成功!");
+          this.$emit("refresh");
+        });
+      } else {
+        this.$message("请选择要关联的设备");
       }
     },
     //改变pagesize
@@ -176,19 +193,31 @@ export default {
     },
     // 查看详情
     toDetail() {
-      this.$message('开发中')
+      this.$message("开发中");
     }
   },
+  watch: {
+    dialogVisible: {
+      handler() {
+        if (this.dialogVisible) {
+          this.page.pageNumber = 1;
+          this.tableData = [];
+          this.getTableData();
+        }
+      },
+      immediate: true
+    }
+  }
 };
 </script>
 <style lang="less" scoped>
 #addEqDialog {
   .filters {
-    margin-bottom: 10px; 
+    margin: 0 0 10px 0;
   }
   .table-box {
     height: 370px;
-    .fr{
+    .fr {
       margin-top: 10px;
     }
   }

+ 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)
         })
       })

+ 48 - 36
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 ref="addSpaceDialog" @refresh="getTableData" :type="type" :params="params"></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,11 +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: [] //列表数据
@@ -68,10 +66,12 @@ export default {
   },
   props: {
     params: Object,
-    type: String
+    type: String,
+    spaceType: Object,
+    floorType: {}
   },
   created() {
-    this.getTableData()
+    this.getTableData();
   },
   methods: {
     // 获取列表数据
@@ -80,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) {
@@ -123,7 +130,12 @@ export default {
     },
     // 添加设备
     add() {
-      this.$refs.addSpaceDialog.showDialog()
+      this.dialogVisible = true;
+    },
+    //刷新
+    refresh() {
+      this.dialogVisible = false;
+      this.getTableData()
     }
   },
   watch: {

+ 2 - 1
src/views/ledger/spacelist/index.vue

@@ -374,7 +374,8 @@ export default {
   .spaceTypes {
     .types {
       float: left;
-      width: calc(100% - 200px);
+      width: 100%;
+      // width: calc(100% - 200px);
     }
     .groupAdd {
       float: left;

+ 36 - 3
src/views/ledger/system/systemDetail/index.vue

@@ -25,14 +25,14 @@
       <!-- 系统所在竖井 -->
       <cenoteTable v-else-if="activeTab=='cenote'" :params="params" :type="activeTab"></cenoteTable>
       <!-- 系统所在业务空间 -->
-      <spaceTable v-else-if="activeTab=='space'" :params="params" :type="activeTab"></spaceTable>
+      <spaceTable v-else-if="activeTab=='space'" :params="params" :type="activeTab" :spaceType="spaceType" :floorType="floorType"></spaceTable>
     </div>
   </div>
 </template>
 
 <script>
 import { mapGetters } from "vuex"
-import { queryLinkSys, deleteGeneralSys } from '@/api/scan/request'
+import { queryLinkSys, deleteGeneralSys, queryDictionaryHead, buildingQuery } from '@/api/scan/request'
 import cenoteTable from '@/components/ledger/system/table/cenoteTable'
 import deviceTable from '@/components/ledger/system/table/deviceTable'
 import spaceTable from '@/components/ledger/system/table/spaceTable'
@@ -47,7 +47,9 @@ export default {
         { Code: 'space', Name: '系统所在业务空间' },
       ], //tab页
       activeTab: 'detail', //当前选中的tab
-      systemDetails: {}, //系统信息
+      systemDetails: {}, //系统信息,
+      spaceType: {},//空间种类
+      floorType: {}
     }
   },
   computed: {
@@ -61,6 +63,37 @@ export default {
   created() {
     this.params = this.$route.query;
     this.getSystemDetails();
+
+    let pa = {
+      Filters: `parentId='Space'`
+    }
+    queryDictionaryHead(pa, res => {
+      res.Content.map(t => {
+        if (t.Name != "元空间") {
+          this.spaceType[t.Code] = t.Name;
+        }
+      })
+    });
+
+    let param = {
+      Cascade: [
+        { Name: "floor" }
+      ]
+    };
+    buildingQuery(param, res => {
+      res.Content.map(item => {
+        if (item.BuildID && item.BuildLocalName) {
+          this.floorType[item.BuildID] = item.BuildLocalName;
+          if (item.Floor instanceof Array) {
+            item.Floor.map(f => {
+              if (f.FloorID && f.FloorLocalName) {
+                this.floorType[f.FloorID] = f.FloorLocalName;
+              }
+            })
+          }
+        }
+      });
+    });
   },
   mounted() { },
   watch: {

+ 11 - 2
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -3,7 +3,7 @@
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <div class="operate" v-if="showTools">
       <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo" @scale="scale"
-        @changeAbsorb="changeAbsorb" :isEdit="isEdit" ref="canvasFun"></canvasFun>
+        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun"></canvasFun>
     </div>
   </div>
 </template>
@@ -29,7 +29,11 @@ export default {
       modelId: '',
       FloorID: '',
       Outline: [],
-      floorData: {}
+      floorData: {},
+      config: {
+        isEdit: false,
+        divide: true
+      }
     };
   },
   props: {
@@ -176,6 +180,11 @@ export default {
           this.$refs.canvasFun.sliderVal = n * 10 / this.view.minScale;
         }
       }
+    },
+    "isEdit": {
+      handler(n) {
+        this.config.isEdit = n;
+      }
     }
   }
 };