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

Merge branch 'zonesp'

haojianlong 5 éve
szülő
commit
ab176ebd6c

+ 5 - 0
src/api/scan/request.js

@@ -1427,6 +1427,11 @@ export function groupCreRelaZoneAndISp(param, success) {
     let url = `${baseUrl}/datacenter/si-in-sp-base/link-list?type=${param.type}`;
     http.postJson(url, param.data, success)
 }
+//关系-----业务空间所属建筑楼层修改
+export function updateRelateInSpAndBuild(param, success) {
+    let url = `${baseUrl}/datacenter/update-relationship/update-sp`;
+    http.postJson(url, param, success)
+}
 
 /**系统集成成果管理 */
 //系统集成统计条形图

+ 85 - 10
src/components/business_space/business/handsontable.vue

@@ -38,10 +38,11 @@ import addBusiness from "@/components/business_space/dialogs/addDialog/businessD
 import showTools from "@/utils/handsontable/notShow"
 import handsonUtils from "@/utils/hasontableUtils"
 import Handsontable from "handsontable-pro"
+import buildFloor from '@/utils/handsontable/buildFloorData'
 import 'handsontable-pro/dist/handsontable.full.css'
 import zhCN from 'handsontable-pro/languages/zh-CN';
 import qrcode from "@/components/ledger/lib/qrcode";
-import { queryZone, updateZone, deleteZone, createZone, BeatchQueryParam } from "@/api/scan/request";
+import { queryZone, updateZone, deleteZone, createZone, BeatchQueryParam, updateRelateInSpAndBuild } from "@/api/scan/request";
 import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
@@ -95,10 +96,12 @@ export default {
       buildMess: null,
       filtersArr: [], //表格数据被过滤后的下标
       copyMain: [], //深拷贝数组
+      buildFloorData: [], //楼层数据
     };
   },
   created() {
     this.setData()
+    buildFloor.getData(this.buildFloorData)
   },
   mounted() { },
   methods: {
@@ -107,7 +110,7 @@ export default {
       this.param.UserId = this.userId
       this.param.secret = this.secret
     },
-    //获取表
+    //获取表格数据
     getHeader(headers, buildFloorSelectd) {
       this.headers = headers
       this.buildFloorSelectd = buildFloorSelectd
@@ -124,9 +127,24 @@ export default {
           PageSize: this.page.pageSize
         }
       }
-      if (this.buildFloorSelectd.length && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
-        params.data.Filters = `BuildingId='${this.buildFloorSelectd[0]}';FloorId='${this.buildFloorSelectd[1]}'`
+      if (this.buildFloorSelectd[0] == "noKnow") {
+        params.data.Filters += `buildingId isNull`
+      } else if (this.buildFloorSelectd[0] && this.buildFloorSelectd[0] != "all") {
+        params.data.Filters += `buildingId='${this.buildFloorSelectd[0]}'`
       }
+      if (this.buildFloorSelectd.length > 1) {
+        if (this.buildFloorSelectd[1] == "noKnow") {
+          params.data.Filters += `;floorId isNull`
+        } else if (this.buildFloorSelectd[1] && this.buildFloorSelectd[1] != "all") {
+          params.data.Filters += `;floorId='${this.buildFloorSelectd[1]}'`
+        }
+      }
+      if (!params.data.Filters) {
+        delete params.data.Filters
+      }
+      // if (this.buildFloorSelectd.length && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
+      //   params.data.Filters = `BuildingId='${this.buildFloorSelectd[0]}';FloorId='${this.buildFloorSelectd[1]}'`
+      // }
       // else if (buildFloorSelectd.length && buildFloorSelectd[0] && !buildFloorSelectd[1]) {
       //   params.data.Filters = `BuildingId='${buildFloorSelectd[0]}'`
       // } else {
@@ -134,7 +152,14 @@ export default {
       // }
       queryZone(params, res => {
         this.page.total = res.Total
-        this.main = res.Content
+        this.main = res.Content.map((item) => {
+          if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
+            item.flowBuild = item.BuildingId + "-" + item.FloorId
+          } else if (item.hasOwnProperty("BuildingId") && !item.hasOwnProperty("FloorId")) {
+            item.flowBuild = item.BuildingId
+          }
+          return item
+        });
         if (this.main && this.main.length && this.main[0].RoomID) {
           this.copyMain = tools.deepCopy(this.main);
         }
@@ -168,6 +193,7 @@ export default {
         sortIndicator: true, //添加排序
         renderAllRows: true,
         autoColumnSize: true,
+        observeChanges: false,
         language: "zh-CN",
         manualColumnResize: true,
         manualColumnMove: true,
@@ -339,6 +365,10 @@ export default {
       //生成要修改字段列表
       change.map((item) => {
         let key = item[1].split(".")[0]
+        if (key == "flowBuild" && keyList.indexOf(key) == -1) {
+          keyList.push("BuildingId", "FloorId")
+          param.data.Projection.push("BuildingId", "FloorId")
+        }
         if (item[1] && keyList.indexOf(key) == -1) {
           keyList.push(key)
         }
@@ -349,13 +379,44 @@ export default {
       //生成对应修改数据
       data.map((item, index) => {
         keyList.map(value => {
-          let itemData = tools.dataForKey(item, value)
-          tools.setDataForKey(item, value, itemData == "" ? null : itemData)
+          if (value == "BuildingId") {
+            let itemData = tools.dataForKey(item, "flowBuild")
+            if (itemData == "") {
+              tools.setDataForKey(item, "BuildingId", null)
+              tools.setDataForKey(item, "FloorId", null)
+            } else {
+              let BuildingId = itemData.split("-")[0]
+              let FloorId = itemData.split("-")[1]
+              if (BuildingId && FloorId) {
+                tools.setDataForKey(item, "BuildingId", BuildingId)
+                tools.setDataForKey(item, "FloorId", FloorId)
+              } else if (BuildingId && !FloorId) {
+                tools.setDataForKey(item, "BuildingId", BuildingId)
+                tools.setDataForKey(item, "FloorId", null)
+              }
+            }
+          } else {
+            let itemData = tools.dataForKey(item, value)
+            tools.setDataForKey(item, value, itemData == "" ? null : itemData)
+          }
         })
         param.data.Content.push(item);
       })
-      param.Projection = []
-      updateZone(param, (res) => { })
+      if (param.data.Projection.indexOf('BuildingId') > -1) {
+        let pa = param.data.Content.map(t => {
+          return {
+            type: this.zoneCode,
+            spaceId: t.RoomID,
+            id: t.FloorId || t.BuildingId || null,
+          }
+        })
+        updateRelateInSpAndBuild(pa, res => {
+          this.$message.success('修改成功')
+        })
+      } else {
+        param.data.Projection = []
+        updateZone(param, (res) => { })
+      }
     },
     //获取被筛选掉的行号
     trimmedRows() {
@@ -436,7 +497,7 @@ export default {
                         item,
                         head.Path,
                         // child.error ? "表号功能号格式错误" : "表号功能号不存在"
-                        child.error ? child.value? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+                        child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
                       );
                     }
                   });
@@ -459,6 +520,9 @@ export default {
       let arr = tools.copyArr(list)
       let data = showTools.headerTextFilter(arr, "space", this.onlyRead, this.showType)
       data.unshift("是否关联平面图", "与空间相关联的设备");
+      if (this.showType == "all") {
+        data.splice(4, 0, "所属建筑楼层")
+      }
       return data;
     },
     /**
@@ -479,6 +543,17 @@ export default {
         renderer: this.facilityRender,
         readOnly: true
       });
+      if (this.showType == "all") {
+        data.splice(4, 0, {
+          data: "flowBuild",
+          renderer: tools.customDropdownRenderer,
+          editor: "chosen",
+          chosenOptions: {
+            data: this.buildFloorData
+          },
+          readOnly: this.onlyRead
+        })
+      }
       return data;
     },
     myRenderer(instance, td, row, col, prop, value, cellProperties) {

+ 6 - 6
src/components/business_space/newGraphy/canvasFun.vue

@@ -1,8 +1,8 @@
 <template>
   <el-row id="canvas-actions-box" :class="{'isEdit':isEdit}">
-    <div :class="{'active':active=='move'}">
+    <!-- <div :class="{'active':active=='move'}">
       <i class="iconfont icon-move" @click="moveCanvas"></i>
-    </div>
+    </div> -->
     <div>
       <i class="iconfont icon-maximize" @click="fitToWindow"></i>
     </div>
@@ -58,10 +58,10 @@ export default {
   },
   methods: {
     // 移动画布
-    moveCanvas() {
-      this.active = this.active != "move" ? "move" : '';
-      this.$emit('move', this.active == 'move');
-    },
+    // moveCanvas() {
+    //   this.active = this.active != "move" ? "move" : '';
+    //   this.$emit('move', this.active == 'move');
+    // },
     // 适配大小
     fitToWindow() {
       this.$emit('fit');

+ 5 - 2
src/components/business_space/newGraphy/graphy.vue

@@ -145,6 +145,9 @@ export default {
         this.scene.clearSpaceSelection();
         this.scene.clearZoneSelection();
       }
+      if (this.buildFloor.indexOf('all') > -1 || this.buildFloor.indexOf('noKnow') > -1) {
+        return;
+      }
       if (initType == 1) {
         // 底图
         this.getGraphy();
@@ -582,11 +585,11 @@ export default {
     },
     // 切割划分
     divide() {
-      this.drawMainScene.isMarking = true;
+      this.scene.isMarking = true;
     },
     // 清除切割划分
     clearDivide() {
-      this.drawMainScene.clearSceneMark()
+      this.scene.clearSceneMark()
     },
     // 撤销
     undo() {

+ 2 - 2
src/router/system.js

@@ -102,8 +102,8 @@ export default [
         name: 'LayoutMain',
         component: LayoutMain,
         children: [
-            // { path: 'buildfloor', name: 'buildFloor', component: buildFloor, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
-            { path: 'buildfloor', name: 'buildFloor', component: Dasboard, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
+            { path: 'buildfloor', name: 'buildFloor', component: buildFloor, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
+            // { path: 'buildfloor', name: 'buildFloor', component: Dasboard, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
             { path: 'collectsetting', name: 'collectsetting', component: collectsetting, meta: { keepAlive: false, breadcrumbs: [{ label: '需采集的信息点' }] } },
             { path: 'appuser', name: 'buildUser', component: buildUser, meta: { keepAlive: false, breadcrumbs: [{ label: '扫楼App用户管理' }] } },
             { path: 'repetitionGraphy', name: 'repetitionGraphy', component: repetitionGraphy, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理', path: '/ready/buildfloor' }, { label:'平面图维护' }] }}

+ 19 - 14
src/views/ledger/spacelist/index.vue

@@ -12,8 +12,9 @@
     <!--------- 页面头部   -------------->
     <div class="saga-title">
       <div class="saga-build-mess">
-        <span style="padding-right:12px;color:#999999;">建筑楼层</span>
-        <el-cascader :options="options" v-model="buildFloorSelectd" :props="props" @change="changeCascader"></el-cascader>
+        <!-- <span style="padding-right:12px;color:#999999;">建筑楼层</span> -->
+        <floorCascader @change="changeCascader"></floorCascader>
+        <!-- <el-cascader :options="options" v-model="buildFloorSelectd" :props="props" @change="changeCascader"></el-cascader> -->
       </div>
       <div class="saga-build-tab">
         <el-radio-group v-model="isMyTab" @change="changeRadio" style="width: 136px;">
@@ -61,6 +62,7 @@ import {
   queryDictionaryHead, //数据中心-字典头部信息查询接口
 } from "@/api/scan/request";
 import tools from '@/utils/scan/tools'
+import floorCascader from "@/components/ledger/lib/floorCascader";
 import { mapGetters, mapActions } from "vuex";
 export default {
   components: {
@@ -70,7 +72,8 @@ export default {
     notRelated,
     graphy,
     handsontableMain,
-    facilityDialog
+    facilityDialog,
+    floorCascader,
   },
   computed: {
     ...mapGetters('layout', ['projectId', 'userId', 'secret'])
@@ -113,7 +116,7 @@ export default {
       },
       floorToMap: {}, //楼层及其对应的模型图
       FloorMap: "", //当前选中的楼层对象
-      buildFloorSelectd: [], //当前所选的建筑楼层
+      buildFloorSelectd: ['all'], //当前所选的建筑楼层
       childBackParam: {}
     };
   },
@@ -171,7 +174,7 @@ export default {
         }).filter(item => item);
         if (this.childBackParam.zone) {
           this.activeName = this.childBackParam.zone;
-          this.buildFloorSelectd = [this.childBackParam.BuildingId, this.childBackParam.FloorId];
+          // this.buildFloorSelectd = [this.childBackParam.BuildingId, this.childBackParam.FloorId];
           this.isMyTab = this.childBackParam.isMyTab;
         } else {
           this.activeName = 'GeneralZone';
@@ -195,19 +198,21 @@ export default {
     },
     //修改所选建筑楼层
     changeCascader(val) {
-      // val[0]->建筑 val[1]->楼层
-      if (!this.floorToMap[val[1]].StructureInfo || !this.floorToMap[val[1]].StructureInfo.FloorMap) {
+      this.buildFloorSelectd = val;
+      // 如果选择的是全部或者未明确
+      if (val.indexOf('noKnow') > -1 || val.indexOf('all') > -1) {
         this.isMyTab = 2;
+      } else {
+        // 选择的是具体某个楼层
+        if (!this.floorToMap[val[1]].StructureInfo || !this.floorToMap[val[1]].StructureInfo.FloorMap) {
+          this.isMyTab = 2;
+        }
+        this.FloorMap = this.floorToMap[val[1]];
       }
-      this.FloorMap = this.floorToMap[val[1]];
       this.changeGraphyOrTable(this.isMyTab)
     },
     // 判断切换至图还是表
     changeGraphyOrTable(num) {
-      if (!this.buildFloorSelectd.length) {
-        this.$message("请选择楼层")
-        return false
-      }
       this.activeTabType = this.getItemForType()
       if (num == 2) {
         this.initMessage();
@@ -306,8 +311,8 @@ export default {
     margin-bottom: 10px;
     border: 1px solid #dfe6ec;
     .saga-build-mess {
-      position: absolute;
-      left: 10px;
+      // position: absolute;
+      // left: 10px;
       width: 500px;
       margin-left: 10px;
       i {

+ 5 - 4
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -83,14 +83,15 @@ export default {
       }
       queryZone(pa, res => {
         this.spaceDetails = res.Content[0];
-        this.params.BuildingId = this.spaceDetails.BuildingId;
-        this.params.FloorId = this.spaceDetails.FloorId;
+        // this.params.BuildingId = this.spaceDetails.BuildingId;
+        // this.params.FloorId = this.spaceDetails.FloorId;
       })
     },
     // 设置iframe
     setFrame() {
-      this.iframeSrc =
-        `${process.env.BASE_URL}:8889/#/details?perjectId=${this.projectId}&secret=${this.secret}&FmId=${this.params.RoomID}&type=0&code=${this.params.zone}`;
+      this.iframeSrc = this.params.isMyTab == 2 ?
+        `${process.env.BASE_URL}:8889/#/details?perjectId=${this.projectId}&secret=${this.secret}&FmId=${this.params.RoomID}&type=0&code=${this.params.zone}`
+        : `${process.env.BASE_URL}:8889/#/changeMess?perjectId=${this.projectId}&secret=${this.secret}&id=${this.params.RoomID}&type=${this.params.zone}`;
     },
     // 删除业务空间
     deleteSpace() {