shaun-sheep 5 年之前
父節點
當前提交
4e90f373b5

+ 17 - 7
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">
@@ -10,7 +10,8 @@
         </el-select>
         &nbsp;&nbsp; | &nbsp;&nbsp;
       </div>
-      <el-select v-model="onlyRead" @change="getData(false)" style="width:100px;margin-right:20px;vertical-align:bottom;">
+      <el-select v-model="onlyRead" @change="getData(false)"
+                 style="width:100px;margin-right:20px;vertical-align:bottom;">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-select v-model="showType" @change="initHot" style="width:100px;margin-right:10px;vertical-align:bottom;">
@@ -19,7 +20,8 @@
       <el-button v-show="!onlyRead" @click="addSp">添加</el-button>
       <el-button @click="reset">刷新</el-button>
       <el-button v-show="!onlyRead" @click="undo">撤销</el-button>
-      <el-input v-model="zoneItemID" placeholder="请输入业务空间id" @keyup.enter.native="getData" style="display:inline-block;width:500px;margin-left:20px;">
+      <el-input v-model="zoneItemID" placeholder="请输入业务空间id" @keyup.enter.native="getData"
+                style="display:inline-block;width:500px;margin-left:20px;">
         <i slot="suffix" class="el-input__icon el-icon-search" @click="getData"></i>
       </el-input>
     </el-row>
@@ -60,12 +62,12 @@
   import qrcode from "@/components/ledger/lib/qrcode";
   import {
     BeatchQueryParam,
-    zoneDelete,
-    zoneUpdate,
     handleZoneUpdateBd,
     queryAllZoneType,
+    zoneCreate,
+    zoneDelete,
     zoneQuery,
-    zoneCreate
+    zoneUpdate
   } from "@/api/scan/request";
   import {mapGetters} from "vuex";
   import dialogZone from "../../ledger/addDialog/dialogZone";
@@ -193,6 +195,9 @@
         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)
@@ -822,6 +827,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)
     },
   },

+ 57 - 33
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>
         暂无数据
@@ -107,38 +115,37 @@
   </div>
 </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 { colorArr } from "@/utils/spaceColor"
-import unRelateBSP from "./unRelateBSP";
-import createBSP from "./createBSP";
-import dialogZone from "../../ledger/addDialog/dialogZone";
-import {
-  buildingQuery,
-  queryZone,
-  getIspNotInSpace,
-  createRelateInZoneAndISp,
-  groupCreRelaZoneAndISp,
-  queryAllZoneType, // 定制分区类型
-  zoneCreate,
-  zoneQuery,
-  zoneUpdate,
-  zoneCount
-} from "@/api/scan/request"
+  import canvasFun from "./canvasFun"
+  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 {
+    createRelateInZoneAndISp,
+    getIspNotInSpace,
+    groupCreRelaZoneAndISp,
+    queryAllZoneType,
+    queryZone,
+    zoneCount,
+    zoneCreate,
+    zoneQuery,
+    zoneUpdate
+  } from "@/api/scan/request"
 
-export default {
-  components: {
-    canvasFun,
-    unRelateBSP,
-    createBSP,
-    dialogZone
-  },
-  data() {
-    return {
-      zoneValue: '',
-      addZone: [],
+  export default {
+    components: {
+      canvasFun,
+      unRelateBSP,
+      createBSP,
+      dialogZone
+    },
+    data() {
+      return {
+        zoneValue: '',
+        addZone: [],
       canvasWidth: 800,
       canvasHeight: 600,
       type: 1, // 默认操作模式
@@ -285,7 +292,18 @@ export default {
       console.log(arguments);
       if (tab.code == "OtherZone") {
         // 其他分区
+
         this.showOtherFlag = true
+        // 其他分区类型查询表数据接口
+        if (localStorage.getItem('otherZone')) {
+          this.OtherValue = (localStorage.getItem('otherZone'))
+        }
+        if (this.OtherValue) {
+          let val = (localStorage.getItem('otherZone'))
+          this.getBusinessSpace(val)
+        } else {
+          this.FloorMap = ''
+        }
         this.getOhterType();
       } else {
         this.showOtherFlag = false;
@@ -313,6 +331,12 @@ export default {
     // 其他类型下拉change
     changeOtherZone(val) {
       console.log(val)
+      this.getBusinessSpace(val)
+      if (localStorage.getItem('otherZone')) {
+        localStorage.setItem('otherZone', val)
+      } else {
+        localStorage.setItem('otherZone', val)
+      }
     },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {
@@ -360,10 +384,10 @@ export default {
       })
     },
     // 获取当前分区下的业务空间
-    getBusinessSpace() {
+    getBusinessSpace(other) {
       this.canvasLoading = true
       let pa = {
-        ZoneType: this.tab.code,
+        ZoneType: other ? other : this.tab.code,
         Filters: `not RoomID isNull`,
         Orders: "createTime desc, RoomID asc",
         PageSize: 1000