瀏覽代碼

平面图逻辑 接口修改

haojianlong 5 年之前
父節點
當前提交
8695b4c3a3

+ 88 - 79
src/components/business_space/business/handsontable.vue

@@ -1,8 +1,8 @@
 <template>
   <div id="handsontable" v-loading="isLoading">
     <el-row class="left">
-      <div style="display: inline-block" v-show="!onlyRead && zoneCode === 'OtherZone'">
-        <!--      <div v-show="!onlyRead && zoneCode === 'other'">-->
+      <div style="display: inline-block" v-show="zoneCode === 'OtherZone'">
+        <!--              <div style="display: inline-block" v-show="!onlyRead && zoneCode === 'OtherZone'">-->
         <el-button @click="addZoneBtn" type="primary">添加分区</el-button>
         <el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
           <el-option v-for="item in OtherList" :key="item.value" :label="item.label" :value="item.value">
@@ -44,43 +44,43 @@
   </div>
 </template>
 <script>
-  // 引用handsontable插件
-  import "@/assets/js/chosen.jquery.min";
-  import tools from "@/utils/scan/tools";
-  import "@/assets/js/handsontable-chosen-editor";
-  import lStorage from '@/utils/localStorage'
-  import myPagination from "@/components/common/myPagination";
-  import addBusiness from "@/components/business_space/dialogs/addDialog/businessDialog"
-  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 uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
-  import qrcode from "@/components/ledger/lib/qrcode";
-  import {
-    BeatchQueryParam,
-    zoneDelete,
-    zoneUpdate,
-    handleZoneUpdateBd,
-    queryAllZoneType,
-    zoneQuery,
-    zoneCreate
-  } from "@/api/scan/request";
-  import {mapGetters} from "vuex";
-  import dialogZone from "../../ledger/addDialog/dialogZone";
+// 引用handsontable插件
+import "@/assets/js/chosen.jquery.min";
+import tools from "@/utils/scan/tools";
+import "@/assets/js/handsontable-chosen-editor";
+import lStorage from '@/utils/localStorage'
+import myPagination from "@/components/common/myPagination";
+import addBusiness from "@/components/business_space/dialogs/addDialog/businessDialog"
+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 uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
+import qrcode from "@/components/ledger/lib/qrcode";
+import {
+  BeatchQueryParam,
+  handleZoneUpdateBd,
+  queryAllZoneType,
+  zoneCreate,
+  zoneDelete,
+  zoneQuery,
+  zoneUpdate
+} from "@/api/scan/request";
+import { mapGetters } from "vuex";
+import dialogZone from "../../ledger/addDialog/dialogZone";
 
-  export default {
-    props: {
-      id: {},
-      zoneCode: {}
-    },
-    components: {
-      qrcode, //二维码页面
-      myPagination,
-      addBusiness,
-      uploadImgDialog,
-      dialogZone,
+export default {
+  props: {
+    id: {},
+    zoneCode: {}
+  },
+  components: {
+    qrcode, //二维码页面
+    myPagination,
+    addBusiness,
+    uploadImgDialog,
+    dialogZone,
 
   },
   computed: {
@@ -88,7 +88,7 @@
     showTypes() {
       return this.onlyRead ?
         [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
+        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }]
     }
   },
   data() {
@@ -131,7 +131,7 @@
         uploadImgs: false, //上传图片弹窗
       },
       imgsArr: [], //空间图片
-     OtherList:[],//其他分区筛选框
+      OtherList: [],//其他分区筛选框
       OtherValue: '',
     };
   },
@@ -156,49 +156,53 @@
     },
 
     getData() {
-      if (this.zoneCode != 'OtherZone') {
-        this.isLoading = true
-        this.zoneParam = {
-          ZoneType: this.zoneCode,
-          PageNumber: 1,
-          PageSize: 50,
-          Orders: "createTime desc, RoomID asc"
+      this.zoneParam = {
+        ZoneType: this.zoneCode,
+        PageNumber: 1,
+        PageSize: 50,
+        Orders: "createTime desc, RoomID asc"
+      }
+      if (this.buildFloorSelectd.length === 1) {
+        switch (this.buildFloorSelectd[0]) {
+          case 'noKnow':
+            this.zoneParam.BuildingId = 'isnull';
+            break;
+          case 'all':
+            // params.BuildingId = '';
+            break
         }
+      } else if (this.buildFloorSelectd.length === 2) {
+        switch (this.buildFloorSelectd[1]) {
+          case 'noKnow':
+            this.zoneParam.BuildingId = this.buildFloorSelectd[0];
+            this.zoneParam.FloorId = 'isnull';
+            break;
+          case 'all':
+            this.zoneParam.BuildingId = this.buildFloorSelectd[0];
+            // params.FloorId = '';
+            break;
+          default:
+            this.zoneParam.BuildingId = this.buildFloorSelectd[0];
+            this.zoneParam.FloorId = this.buildFloorSelectd[1]
 
-        if (this.buildFloorSelectd.length === 1) {
-          switch (this.buildFloorSelectd[0]) {
-            case 'noKnow':
-              this.zoneParam.BuildingId = 'isnull';
-              break;
-            case 'all':
-              // params.BuildingId = '';
-              break
-          }
-        } else if (this.buildFloorSelectd.length === 2) {
-          switch (this.buildFloorSelectd[1]) {
-            case 'noKnow':
-              this.zoneParam.BuildingId = this.buildFloorSelectd[0];
-              this.zoneParam.FloorId = 'isnull';
-              break;
-            case 'all' :
-              this.zoneParam.BuildingId = this.buildFloorSelectd[0];
-              // params.FloorId = '';
-              break;
-            default:
-              this.zoneParam.BuildingId = this.buildFloorSelectd[0];
-              this.zoneParam.FloorId = this.buildFloorSelectd[1]
-
-          }
         }
+      }
+      if (this.zoneItemID) {
+        this.zoneParam.Filters = `RoomID="${this.zoneItemID}"`
+      }
+      if (this.zoneCode != 'OtherZone') {
+        this.isLoading = true
         this.getZoneMessage(this.zoneParam)
       } else {
         // 其他分区类型查询表数据接口
+        if (localStorage.getItem('otherZone')) {
+          this.OtherValue = (localStorage.getItem('otherZone'))
+        }
         if (this.OtherValue) {
           this.zoneParam.ZoneType = this.OtherValue;
           this.getZoneMessage(this.zoneParam)
         } else {
           this.main = []
-
         }
         this.isLoading = false
         this.getOtherType();
@@ -310,7 +314,7 @@
         columns: this.getType(this.headers), //数据显示格式
         filters: true,
         fixedColumnsLeft: 4,
-        maxRows: this.main ? this.main.length:'',
+        maxRows: this.main ? this.main.length : '',
         height: winHeight - 100 - 50 - 176,
         columnSorting: true, //添加排序
         sortIndicator: true, //添加排序
@@ -436,7 +440,7 @@
       let param = []
       params.map(item => {
         if (item.RoomID)
-        param.push({ RoomID: item.RoomID })
+          param.push({ RoomID: item.RoomID })
       })
       params.map(i => i.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : i.ObjectType);
       this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
@@ -800,15 +804,15 @@
     addZoneBtn() {
       this.$refs.zone.dialogFormVisible = true
     },
-  //  其他分区类型查询
+    //  其他分区类型查询
     getOtherType() {
       let param = {
         Cascade: [{ Name: 'zoneType' }],
         Filters: `Code="OtherZone"`
       }
-      queryAllZoneType(param,res=> {
-        if(res.Content[0].ZoneType && res.Content[0].ZoneType.length) {
-          this.OtherList = res.Content[0].ZoneType.map(t=> {
+      queryAllZoneType(param, res => {
+        if (res.Content[0].ZoneType && res.Content[0].ZoneType.length) {
+          this.OtherList = res.Content[0].ZoneType.map(t => {
             t.value = t.Code
             t.label = t.Name
             return t
@@ -822,6 +826,11 @@
     changeOtherZone(val) {
       this.zoneParam.ZoneType = val;
       this.getZoneMessage(this.zoneParam);
+      if (localStorage.getItem('otherZone')) {
+        localStorage.setItem('otherZone', val)
+      } else {
+        localStorage.setItem('otherZone', val)
+      }
       console.log(val)
     },
   },
@@ -851,7 +860,7 @@
 #handsontable {
   padding: 0 10px;
   .left {
-    padding:0;
+    padding: 0;
     margin-bottom: 10px;
   }
 

+ 19 - 15
src/components/business_space/newGraphy/graphy.vue

@@ -1,6 +1,14 @@
 <template>
   <div id="graphy" ref="graphy" v-loading="canvasLoading">
     <div v-show="!FloorMap">
+      <div style="margin-right:10px;width: 100%;margin-bottom: 10px" v-if="showOtherFlag">
+        <!-- 平面图其他分区 -->
+        <el-button type="primary" @click="addZoneBtn">添加分区</el-button>
+        <el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
+          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+          </el-option>
+        </el-select>
+      </div>
       <div class="center" style="height: 400px;padding-top:182px;box-sizing:border-box;">
         <i class="icon-wushuju iconfont"></i>
         暂无数据
@@ -108,24 +116,23 @@
 </template>
 <script>
 import canvasFun from "./canvasFun"
-import { mapGetters, mapActions } from "vuex";
-import { SColor, SPoint } from "@saga-web/draw/lib";
-import { DivideFloorScene, SpaceItem, ZoneItem, FloorView } from "@saga-web/cad-engine/lib";
+import { mapGetters } from "vuex";
+import { SPoint } from "@saga-web/draw/lib";
+import { DivideFloorScene, FloorView, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
 import { colorArr } from "@/utils/spaceColor"
 import unRelateBSP from "./unRelateBSP";
 import createBSP from "./createBSP";
 import dialogZone from "../../ledger/addDialog/dialogZone";
 import {
-  buildingQuery,
-  queryZone,
-  getIspNotInSpace,
   createRelateInZoneAndISp,
+  getIspNotInSpace,
   groupCreRelaZoneAndISp,
-  queryAllZoneType, // 定制分区类型
+  queryAllZoneType,
+  queryZone,
+  zoneCount,
   zoneCreate,
   zoneQuery,
-  zoneUpdate,
-  zoneCount
+  zoneUpdate
 } from "@/api/scan/request"
 
 export default {
@@ -285,15 +292,11 @@ export default {
         // 其他分区
         this.showOtherFlag = true
         this.getOtherType();
-        if (this.scene) {
-          this.scene.removeAllZone();
-          this.zoneList = this.scene.zoneList;
-          this.view._needDraw = true;
-        }
+        this.OtherValue = (localStorage.getItem('otherZone')) || ''
       } else {
         this.showOtherFlag = false;
-        this.init(initType);
       }
+      this.init(initType);
     },
     // 其他分区类型查询
     getOtherType() {
@@ -316,6 +319,7 @@ export default {
     // 其他类型下拉change
     changeOtherZone(val) {
       this.init(2);
+      localStorage.setItem('otherZone', val)
     },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {

+ 1 - 1
src/components/ledger/cenote/elevationMap.vue

@@ -267,7 +267,7 @@
       box-sizing: border-box;
       flex-direction: column;
       justify-content: flex-end;
-      padding: 0 10px 60px 0;
+      padding: 60px 10px 20px 0;
       .saga-rf {
         display: flex;
         flex-direction: row;

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

@@ -288,7 +288,6 @@
         this.$message.warning('请选择建筑楼层')
         return
       }
-
       if (num == 2) {
         this.initMessage();
       } else {