Jelajahi Sumber

modify space table add all types

haojianlong 5 tahun lalu
induk
melakukan
20e88adb77

+ 8 - 1
src/api/scan/config.js

@@ -9,5 +9,12 @@ export const zone = {
   PowerSupplyZone: 'zone-power-supply', //供电分区
   LightingZone: 'zone-lighting', //照明分区
   AirConditioningZone: 'metaspace', //空调分区
-  TenantZone: 'zone-tenant' //租赁分区
+  TenantZone: 'zone-tenant', //租赁分区
+  HeatingZone:'zone-heating', //采暖分区
+  CleanZone:'zone-clean', //洁净分区
+  DomesticWaterSupplyZone:'zone-domestic-water', //生活给水分区
+  NetworkZone:'zone-network', //网络分区
+  FunctionZone:'zone-function', //功能分区
+  FireZone:'zone-fire', //防火分区
+  SecurityZone:'zone-security', //安防分区
 }

+ 87 - 92
src/components/business_space/business/handsontable.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="handsontable" v-loading="isLoading">
-		<el-row class="left">
+    <el-row class="left">
       <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>
@@ -8,8 +8,8 @@
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <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-button @click="reset">刷新</el-button>
+      <el-button v-show="!onlyRead" @click="undo">撤销</el-button>
     </el-row>
     <div v-show="main &&main.length" :id="id"></div>
     <div class="center" v-show="!main || !main.length" style="height: 400px;padding-top:140px;box-sizing:border-box;">
@@ -17,9 +17,9 @@
       暂无数据
     </div>
     <!-- <add-business :buildMess="buildMess" :dialog="dialog"></add-business> -->
-    <el-pagination class="right" v-show="main && main.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 class="right" v-show="main && main.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 class="right" v-show="main && main.length">
       <my-pagination :page="page" @change="pageChange"></my-pagination>
@@ -45,12 +45,8 @@ import { queryZone, updateZone, deleteZone, createZone } from "@/api/scan/reques
 import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
-    id: {
-      type: String
-		},
-		zoneObj: {
-			type: Object
-		}
+    id: {},
+    zoneCode: {}
   },
   components: {
     qrcode, //二维码页面
@@ -58,11 +54,11 @@ export default {
     addBusiness
   },
   computed: {
-		...mapGetters("layout", ["projectId", "secret", "userId"]),
-		showTypes () {
-      return this.onlyRead?
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
-        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'} ]
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+    showTypes() {
+      return this.onlyRead ?
+        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
+        [{ value: "partInfo", label: '隐藏信息点' }, { value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }]
     }
   },
   data() {
@@ -76,15 +72,15 @@ export default {
       main: [],
       hot: null,
       isLoading: true,
-			options: [{
+      options: [{
         value: true,
         label: '只读模式'
       }, {
         value: false,
         label: '编辑模式'
       }],
-			onlyRead: true,
-			showType: "",
+      onlyRead: true,
+      showType: "",
       page: {
         pageSize: 50,
         pageSizes: [10, 20, 50, 100],
@@ -99,7 +95,6 @@ export default {
       buildMess: null,
       filtersArr: [], //表格数据被过滤后的下标
       copyMain: [], //深拷贝数组
-      activeType: {}
     };
   },
   created() {
@@ -113,40 +108,39 @@ export default {
       this.param.secret = this.secret
     },
     //获取表头
-    getHeader(headers, activeTabType) {
+    getHeader(headers, buildFloorSelectd) {
       this.headers = headers
-      this.activeType = activeTabType
+      this.buildFloorSelectd = buildFloorSelectd
+      this.getData()
     },
-    getData(buildMess) {
+    getData() {
       this.isLoading = true
-      if (buildMess) {
-        this.buildMess = buildMess
-			}
       let params = {
-				zone: this.zoneObj.code,
-				data: {
-					Filters: ``,
-					Orders: "createTime desc, RoomID asc",
-					PageNumber: this.page.pageNumber,
-					PageSize: this.page.pageSize
-				}
-			}
-			if (this.buildMess.selectd && this.buildMess.selectd[0] && this.buildMess.selectd[1]) {
-				params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}';FloorId='${this.buildMess.selectd[1]}'`
-			} else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
-				params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}'`
-			} else {
-				params.data.Filters = `BuildingId='';FloorId=''`
-			}
-			queryZone(params, res => {
-				this.page.total = res.Total
-				this.main = res.Content
-				if (this.main && this.main.length && this.main[0].RoomID) {
-					this.copyMain = tools.deepCopy(this.main);
+        zone: this.zoneCode,
+        data: {
+          Filters: ``,
+          Orders: "createTime desc, RoomID asc",
+          PageNumber: this.page.pageNumber,
+          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]}'`
+      }
+      // else if (buildFloorSelectd.length && buildFloorSelectd[0] && !buildFloorSelectd[1]) {
+      //   params.data.Filters = `BuildingId='${buildFloorSelectd[0]}'`
+      // } else {
+      //   params.data.Filters = `BuildingId='';FloorId=''`
+      // }
+      queryZone(params, res => {
+        this.page.total = res.Total
+        this.main = res.Content
+        if (this.main && this.main.length && this.main[0].RoomID) {
+          this.copyMain = tools.deepCopy(this.main);
         }
         this.isLoading = false
-				this.getMain()
-			})
+        this.getMain()
+      })
     },
     //获取表格主体内容
     getMain() {
@@ -160,7 +154,6 @@ export default {
     },
     //初始化handsontable组件
     initHot() {
-      let id = this.id
       var container = document.getElementById(this.id);
       let winHeight = document.documentElement.clientHeight;
       this.hot = new Handsontable(container, {
@@ -168,6 +161,7 @@ export default {
         colHeaders: this.delHeader(this.headers), //表头文案
         columns: this.getType(this.headers), //数据显示格式
         filters: true,
+        fixedColumnsLeft: 4,
         maxRows: this.main.length,
         height: winHeight - 100 - 50 - 176,
         columnSorting: true, //添加排序
@@ -243,7 +237,7 @@ export default {
     },
     //表格发生更改
     tdChange(changeData, source) {
-			if (!this.onlyRead) {
+      if (!this.onlyRead) {
         if (changeData) {
           let trimmedArr = this.trimmedRows();
           let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
@@ -269,17 +263,17 @@ export default {
     },
     //右键删除
     romoveFm() {
-			let params = tools.differenceArr(this.main, this.copyMain)
+      let params = tools.differenceArr(this.main, this.copyMain)
       if (params.length < 1 || this.main > this.copyMain) {
         return
       }
       let param = {
-				data: [],
-				zone: this.zoneObj.code
-			}
+        data: [],
+        zone: this.zoneCode
+      }
       params.map(item => {
-        if(item.RoomID)
-        param.data.push({RoomID: item.RoomID})
+        if (item.RoomID)
+          param.data.push({ RoomID: item.RoomID })
       })
       this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
         confirmButtonText: '确定',
@@ -287,9 +281,9 @@ export default {
         type: 'warning'
       }).then(() => {
         deleteZone(param, res => {
-					this.$message.success("删除成功!")
-        	this.getData()
-				})
+          this.$message.success("删除成功!")
+          this.getData()
+        })
       }).catch(() => {
         this.getData()
         this.$message("取消删除")
@@ -299,7 +293,7 @@ export default {
     handleCreateZone(param) {
       let keys = Object.keys(param)
       keys.map((key) => { //将值为空字符串的属性删除
-        if(param[key] == "") {
+        if (param[key] == "") {
           delete param[key]
         }
       })
@@ -311,35 +305,36 @@ export default {
         this.$message("新添加业务空间内容不能为空!")
         return
       }
-      if (this.buildMess.selectd && this.buildMess.selectd[0] && this.buildMess.selectd[1]) {
-        param.BuildingId = this.buildMess.selectd[0]
-        param.FloorId = this.buildMess.selectd[1]
-			} else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
-				param.BuildingId = this.buildMess.selectd[0]
-			}
+      if (this.buildFloorSelectd && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
+        param.BuildingId = this.buildFloorSelectd[0]
+        param.FloorId = this.buildFloorSelectd[1]
+      }
+      //  else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
+      //   param.BuildingId = this.buildMess.selectd[0]
+      // }
       let params = {
-        zone: this.zoneObj.code,
+        zone: this.zoneCode,
         data: {
           Content: [param]
         }
       }
-      createZone(params,(res) => {
+      createZone(params, res => {
         this.$message.success("添加成功!")
         this.getData()
       })
     },
     // 修改
     updateBusiness(data, change) {
-			let param = {
-				data: {
-					Content: [],
-        	Projection: []
-				},
-        zone: this.zoneObj.code
+      let param = {
+        data: {
+          Content: [],
+          Projection: []
+        },
+        zone: this.zoneCode
       };
       //生成要修改字段列表
       change.map((item) => {
-        if(item[1] && param.data.Projection.indexOf(item[1]) == -1) {
+        if (item[1] && param.data.Projection.indexOf(item[1]) == -1) {
           param.data.Projection.push(item[1])
         }
       })
@@ -350,9 +345,9 @@ export default {
           tools.setDataForKey(item, value, itemData == "" ? null : itemData)
         })
         param.data.Content.push(item);
-			})
+      })
       param.Projection = []
-			updateZone(param, (res) => {})
+      updateZone(param, (res) => { })
     },
     //获取被筛选掉的行号
     trimmedRows() {
@@ -407,17 +402,17 @@ export default {
      * @return 处理好的数据格式
      */
     getType(list) {
-			let arr = tools.copyArr(list)
-			let data = showTools.headerTypeFilter(arr, "space", this.onlyRead, this.showType)
+      let arr = tools.copyArr(list)
+      let data = showTools.headerTypeFilter(arr, "space", this.onlyRead, this.showType)
       data.unshift({
         data: "hasSi",
         renderer: this.myRenderer,
         readOnly: true
       }, {
-				data: "point",
-				renderer: this.facilityRender,
-				readOnly: true
-			});
+          data: "point",
+          renderer: this.facilityRender,
+          readOnly: true
+        });
       return data;
     },
     myRenderer(instance, td, row, col, prop, value, cellProperties) {
@@ -458,8 +453,8 @@ export default {
     undo() {
       this.hot.undo()
     },
-		/**  分页事件------------------------ */
-		//切换每页显示多少条数据
+    /**  分页事件------------------------ */
+    //切换每页显示多少条数据
     handleSizeChange(val) {
       this.page.pageSize = val
       this.getData()
@@ -474,8 +469,8 @@ export default {
     projectId() {
       this.setData()
       this.main = null
-		},
-		showTypes: {
+    },
+    showTypes: {
       handler(newName, oldName) {
         if (newName && newName[0] && newName[0].value) {
           this.showType = newName[0].value
@@ -491,10 +486,10 @@ export default {
 </script>
 <style lang="less" scoped>
 #handsontable {
-	.left{
-		padding-top: 0;
-		padding-bottom: 10px;
-	}
+  .left {
+    padding-top: 0;
+    padding-bottom: 10px;
+  }
   .no-data {
     height: 150px;
     line-height: 150px;

+ 1 - 1
src/components/business_space/table/businessTable.vue

@@ -72,7 +72,7 @@ export default {
     return {
       page: {
         size: 50,
-        sizes: [10, 30, 50, 100, 150, 200],
+        sizes: [50, 100, 150, 200],
         total: 1,
         currentPage: 1
       },

+ 137 - 267
src/views/ledger/spacelist/index.vue

@@ -4,80 +4,66 @@
 <template>
   <div id="businessSpace">
     <!------------------------    头部弹窗,选择楼层信息     -------------->
-    <!-- <no-model-dialog :param="param" title="选择要进行空间管理的楼层" :isShow="floor" @close="close"></no-model-dialog> -->
     <influence-dialog ref="influence" :param="param" :tabsList="tabsList" title="受元空间变化影响的业务空间" :isShow="floor"></influence-dialog>
-    <details-dialog ref="details" @del="delSuccess" :param="param" :tabsList="tabsList" title="业务空间详情" :isShow="floor" :activeTabType="activeTabType"></details-dialog>
+    <details-dialog ref="details" @del="delSuccess" :param="param" :tabsList="tabsList" title="业务空间详情" :isShow="floor" :activeTabType="activeTabType">
+    </details-dialog>
     <not-related ref="notRelated" @createSuccess="createSuccess" :isShow="floor"></not-related>
     <facility-dialog ref="facility" :activeTabType="activeTabType" :isShow="floor"></facility-dialog>
     <!--------- 页面头部   -------------->
     <div class="saga-title">
-      <!-- <div class="saga-build-mess">
-                <p>
-                    <i class="iconfont icon-jianzhu"></i> {{buildMess.buildName}} - {{buildMess.name}}
-                </p>
-                <el-button class="saga-btn" type="text" @click="changeShow">切换楼层</el-button>
-            </div> -->
       <div class="saga-build-mess">
         <span style="padding-right:12px;color:#999999;">建筑楼层</span>
-        <el-cascader :options="options" v-model="buildMess.selectd" :props="props" @change="close"></el-cascader>
+        <el-cascader :options="options" v-model="buildFloorSelectd" :props="props" @change="changeCascader"></el-cascader>
       </div>
       <div class="saga-build-tab">
-        <!-- <div class="tab-main" @click="tabList(1)" :class="isMyTab == 1 ? 'tab-active' : ''">
-                    <i class="iconfont icon-tupian"></i>
-                    <span>平面图</span>
-                </div>
-                <div class="tab-main" @click="tabList(2)" :class="isMyTab == 2 ? 'tab-active' : ''">
-                    <i class="iconfont icon-liebiao"></i>
-                    <span>列表</span>
-                </div> -->
         <el-radio-group v-model="isMyTab" @change="changeRadio" style="width: 136px;">
           <el-radio-button label="1">平面图</el-radio-button>
           <el-radio-button label="2" class="space-own-radio" style="width: 68px;">列表</el-radio-button>
         </el-radio-group>
       </div>
     </div>
-    <div v-show="isMyTab == 1" class="saga-business-sapce-main">
-      <el-tabs v-model="activeName" @tab-click="tab1Click">
-        <template v-for="(item,index) in tabsList">
-          <el-tab-pane :name="item.code" :key="index" :disabled="item.code > 3">
-            <span slot="label">{{item.name}}</span>
-            <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails"
-              :ref="'graphy' + item.code" :canvasId="item.code"></graphy>
-          </el-tab-pane>
-        </template>
-      </el-tabs>
-      <!-- <space-graphy @dimension="checkSpace" :tabsList="tabsList" ref="graphy" :param="param"></space-graphy> -->
-    </div>
-    <div v-show="isMyTab == 2" class="saga-business-sapce-main">
-      <el-tabs v-model="activeName" @tab-click="handleClick">
-        <template v-for="(item,index) in tabsList">
-          <el-tab-pane :name="item.code" :key="index" :disabled="item.code > 3">
-            <span slot="label">{{item.name}}</span>
-            <handsontable-main @lookEqu="lookEqu" :ref="'handsontable' + item.code" :zoneObj="item" :id="'handsontable' + item.code" :param="param"></handsontable-main>
-          </el-tab-pane>
-        </template>
-      </el-tabs>
-      <!-- <space-handsontable :tabsList="tabsList" ref="spaceTable" :param="param"></space-handsontable> -->
+    <div class="saga-business-sapce-main">
+      <el-row class="spaceTypes">
+        <div class="types">
+          <el-tabs v-model="activeName" type='card' @tab-click="tabClick">
+            <template v-for="(item,index) in tabsList">
+              <el-tab-pane :name="item.Code" :key="index" :label="item.Name"></el-tab-pane>
+            </template>
+          </el-tabs>
+        </div>
+        <div class="groupAdd">
+          <el-button size="small">批量创建业务空间</el-button>
+        </div>
+      </el-row>
+      <div v-show="isMyTab == 1">
+        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy"></graphy>
+      </div>
+      <div v-show="isMyTab == 2">
+        <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
+      </div>
     </div>
   </div>
 </template>
-
 <script>
 import noModelDialog from "@/components/business_space/dialogs/noModelDialog";
 import influenceDialog from "@/components/business_space/dialogs/influenceDialog";
 import detailsDialog from "@/components/business_space/dialogs/detailsDialog";
 import notRelated from "@/components/business_space/dialogs/notRelated";
 import facilityDialog from "@/components/business_space/dialogs/facilityDialog";
-// import spaceHandsontable from "@/components/business_space/business/spaceHandsontable";
 import graphy from "@/components/business_space/graphy/business";
 import handsontableMain from "@/components/business_space/business/handsontable";
-import { getDataDictionary, getAllbusiness, getBussTypes, getSpaceFloor } from "@/api/scan/request";
+import {
+  getDataDictionary,
+  getAllbusiness,
+  getSpaceFloor,
+  buildingQuery, //数据中心-建筑查询
+  queryDictionaryHead, //数据中心-字典头部信息查询接口
+} from "@/api/scan/request";
 import tools from '@/utils/scan/tools'
 import { mapGetters, mapActions } from "vuex";
 export default {
   components: {
     noModelDialog,
-    // spaceHandsontable,
     influenceDialog,
     detailsDialog,
     notRelated,
@@ -91,7 +77,6 @@ export default {
   data() {
     return {
       floor: {
-        // dialogVisible: true, //选择楼层弹窗
         influence: false, //受影响的业务空间弹窗
         details: false, //详情弹窗
         notRelated: false,
@@ -119,138 +104,116 @@ export default {
         "name": "默认分区",
         "rel_type": "99"
       },
-      options: [],
-      props: {
-        value: "code",
-        label: "name",
-        children: "children"
-      }
+      options: [], //建筑楼层级联下拉
+      props: { //自定义字段
+        value: "BuildID",
+        label: "BuildLocalName",
+        children: "Floor"
+      },
+      floorToMap: {}, //楼层及其对应的模型图
+      buildFloorSelectd: [], //当前所选的建筑楼层
     };
   },
   created() {
-    this.changeData()
+    this.init()
   },
   mounted() { },
   methods: {
-    changeData() {
-      this.param.ProjId = this.projectId
-      this.param.UserId = this.userId
-      this.param.secret = this.secret
-      this.getFloor()
+    // 初始化
+    init() {
       this.getTypes()
+      this.getBuilding()
     },
-    changeRadio() {
-      if (!this.buildMess.selectd.length) {
-        this.$message("请选择楼层")
-        return false
+    // 获取项目下建筑
+    getBuilding() {
+      let pa = {
+        Cascade: [{ name: 'floor', Orders: 'SequenceId desc' }],
+        Orders: "BuildLocalName asc",
       }
-      this.tabClick(this.isMyTab)
+      buildingQuery(pa, res => {
+        this.options = res.Content.map(t => {
+          if (t.Floor) {
+            t.Floor = t.Floor.map(item => {
+              item.BuildID = item.FloorID;
+              item.BuildLocalName = item.FloorLocalName;
+              this.floorToMap[item.FloorID] = item.StructureInfo ? item.StructureInfo.FloorMap : '';
+              return item;
+            })
+          } else {
+            t.Floor = []
+          }
+          return t;
+        })
+      })
     },
-    //获取楼层
-    getFloor() {
-      let param = {
-        ProjId: this.projectId,
-        UserId: this.UserId,
-        secret: this.secret
-      };
-      getSpaceFloor(param).then(res => {
-        console.log(res, 'res')
-        if (res.data.Result == 'success') {
-          let data = this.changeArr(res.data.Content).map(item => {
-            if (item.children && item.children.length) {
-              item.children = tools.sortArr(item.children, "shunxu", false)
-            }
-            return item
-          })
-          console.log(data, 'res.data')
-          this.options = data
-        } else {
-          this.$message.error(res.data.ResultMsg)
-        }
-      }).catch(() => {
-        this.$message.error("请求出错")
+    // 切换平面图和列表
+    changeRadio(val) {
+      this.changeGraphyOrTable(val)
+    },
+    // 获取tabs的列表
+    getTypes() {
+      let pa = {
+        Filters: `parentId = 'Space'`
+      }
+      queryDictionaryHead(pa, res => {
+        this.tabsList = res.Content;
       })
     },
-
-    //修改已有数组
-    changeArr(arr) {
-      return arr.map(item => {
-        console.log(item.floors)
-        if (item.floors && item.floors.length) {
-          return {
-            code: item.id,
-            name: item.infos.BuildLocalName,
-            children: item.floors.map(i => {
-              return {
-                code: i.id,
-                name: (i.infos.FloorLocalName || i.infos.FloorName || "未知") + this.myMess(i),
-                map: i.infos.FloorMap || null,
-                affected: i.affected,
-                isChilren: 2,
-                buildCode: item.id,
-                buildName: item.infos.BuildLocalName,
-                shunxu: i.infos.FloorSequenceID || 0
-              }
-            })
-          }
-        } else {
-          return {
-            code: item.id,
-            name: item.infos.BuildLocalName,
-            children: null,
-            isChilren: 1,
-          }
+    // 通过选中的tab-Code 获取选中的tab的所有数据
+    getItemForType() {
+      let data = {}
+      this.tabsList.map(item => {
+        if (item.Code == this.activeName) {
+          data.code = item.Code;
+          data.name = item.Name;
         }
       })
+      return data
+    },
+    // 点击tab
+    tabClick(val) {
+      this.changeGraphyOrTable(this.isMyTab)
+    },
+    //修改所选建筑楼层
+    changeCascader(val) {
+      // val[0]->建筑 val[1]->楼层
+      if (!this.floorToMap[val[1]]) {
+        this.isMyTab = 2;
+      }
+      this.changeGraphyOrTable(this.isMyTab)
     },
-    myMess(i) {
-      if (i.affected) {
-        return "(该业务空间受元空间变化影响)"
+    // 判断切换至图还是表
+    changeGraphyOrTable(num) {
+      if (!this.buildFloorSelectd.length) {
+        this.$message("请选择楼层")
+        return false
+      }
+      this.activeTabType = this.getItemForType()
+      if (num == 2) {
+        this.initMessage();
       } else {
-        if (i.infos.FloorMap) {
-          return ''
-        } else {
-          return "(请初始化平面图)"
-        }
+        let data = this.getItemForType()
+        this.$refs["graphy"].getData(this.buildMess.map, this.buildMess, this.activeTabType);
       }
     },
-    //获取tabs的列表
-    getTypes() {
-      getBussTypes(res => {
-        let arr = [{
-          "code": "GeneralZone",
-          "name": "默认分区",
-          "rel_type": "99"
-        },
-        {
-          "name": "供电分区",
-          "rel_type": "1",
-          "code": "PowerSupplyZone"
-        },
-        {
-          "name": "照明分区",
-          "rel_type": "2",
-          "code": "LightingZone"
+    // 触发获取表头-获取初始化信息点
+    initMessage() {
+      let params = {
+        data: {
+          Orders: "sort asc",
+          PageNumber: 1,
+          PageSize: 500
         },
-        {
-          "name": "空调分区",
-          "rel_type": "4",
-          "code": "AirConditioningZone"
-        }, {
-          "name": '租赁分区',
-          'rel_type': '10',
-          "code": 'TenantZone'
-        }
-        ]
-        this.tabsList = arr
-        // console.log(res)
-        // this.tabsList = res.Content
+        type: this.activeName
+      }
+      getDataDictionary(params, res => {
+        this.$refs.handsontable.getHeader(res.Content, this.buildFloorSelectd);
       })
     },
     checkSpace(list, build, graphyId) {
       this.floor.notRelated = true;
       this.$refs.notRelated.getIdList(list, build, graphyId, this.activeTabType);
-      this.$refs["graphy" + this.activeName][0].getHasSpace();
+      this.$refs["graphy"].getHasSpace();
     },
     changeShow() {
       this.floor.dialogVisible = true;
@@ -258,49 +221,15 @@ export default {
     },
     //成功关联平面图
     createSuccess() {
-      this.$refs["graphy" + this.activeName][0].getHasSpace();
-      this.$refs["graphy" + this.activeName][0].clearDimension();
+      this.$refs["graphy"].getHasSpace();
+      this.$refs["graphy"].clearDimension();
       this.floor.notRelated = false;
     },
     //成功删除业务空间
     delSuccess() {
       this.floor.details = false;
-      this.$refs["graphy" + this.activeName][0].getHasSpace();
-      this.$refs["graphy" + this.activeName][0].clearDimension();
-    },
-    close() {
-      this.buildMess = this.changeBuildMess(this.buildMess, this.options)
-      console.log(this.buildMess, 'this.buildMess')
-      if (this.buildMess.affected) {
-        this.floor.influence = true;
-        this.$nextTick(() => {
-          this.$refs.influence.getData(this.buildMess);
-        });
-      }
-      if (!this.buildMess.map) {
-        this.isMyTab = 2;
-      }
-      if (this.isMyTab == 2) {
-        this.initTabs(this.buildMess);
-      } else {
-        let data = this.getItemForType()
-        this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
-      }
-    },
-
-    //通过code查询options中的其他参数
-    changeBuildMess(mess, options) {
-      options.map(item => {
-        if (!!item.children && item.children.length) {
-          item.children.map(child => {
-            if (child.code == mess.selectd[1]) {
-              console.log(child, mess)
-              mess = Object.assign(mess, child)
-            }
-          })
-        }
-      })
-      return mess
+      this.$refs["graphy"].getHasSpace();
+      this.$refs["graphy"].clearDimension();
     },
     //查看业务空间详情
     getBuinessDetails(list) {
@@ -313,87 +242,18 @@ export default {
       this.floor.facility = true
       this.$refs.facility.getData(infos, this.buildMess)
     },
-    tabClick(num) {
-      console.log(this.$refs)
-      this.isMyTab = num;
-      if (num == 2) {
-        this.initTabs(this.buildMess);
-      } else {
-        let data = this.getItemForType()
-        this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
-      }
-    },
-    //获取初始化信息点
-    initMessage() {
-      let params = {
-        data: {
-          Orders: "sort asc",
-          PageNumber: 1,
-          PageSize: 500
-        },
-        type: this.activeTabType.code
-      }
-      getDataDictionary(params, res => {
-        let refFlag = "handsontable" + this.activeName;
-        this.$refs[refFlag][0].getHeader(res.Content, this.activeTabType);
-        this.getTableMain()
-      })
-    },
-    getItemForType() {
-      let data = {}
-      this.tabsList.map(item => {
-        if (item.code == this.activeName) {
-          data = item
-        }
-      })
-      return data
-    },
-    tab1Click() {
-      this.activeTabType = this.getItemForType()
-      this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
-    },
-    /**
-     * tab标签被点击触发后的函数
-     * @param tab   tab实例
-     * @param event tab的dom
-     *
-     */
-    handleClick(tab, event) {
-      this.activeTabType = this.getItemForType()
-      this.initMessage();
-    },
-    /**
-     * 选择楼层后初始化tabs
-     * 由父级页面调用
-     *
-     * @param  floorParam  父级传入的楼层信息
-     */
-    initTabs(floorParam) {
-      // this.floor = floorParam;
-      this.initMessage();
-    },
-    getTableMain() {
-      let refFlag = "handsontable" + this.activeName;
-      this.$nextTick(() => {
-        this.$refs[refFlag][0].getData(this.buildMess);
-      });
-      //   for (let i = 0; i < this.tabsList.length; i++) {
-      //     if (i == 0) {
-      //     }
-      //   }
-    }
   },
   watch: {
     floor: {
       deep: true,
       handler: function () {
         if (this.floor.notRelated) {
-          this.$refs["graphy" + this.activeName][0].clearDimension();
+          this.$refs["graphy"].clearDimension();
         }
       }
     },
     projectId() {
-      this.changeData()
+      this.init()
     }
   }
 };
@@ -484,14 +344,24 @@ export default {
     overflow-y: auto;
     background: #fff;
     padding: 10px;
-    .el-tabs__nav {
-      padding-left: 10px;
+    /deep/ .el-tabs__item.is-top {
+      border-top: 2px solid transparent;
+      &.is-active {
+        border-top: 2px solid #409eff;
+      }
     }
-    .el-tabs__header{
-      margin-bottom: 10px;
+  }
+  .spaceTypes {
+    .types {
+      float: left;
+      width: calc(100% - 200px);
     }
-    .el-tabs__active-bar {
-      padding-left: 24px;
+    .groupAdd {
+      float: left;
+      width: 200px;
+      text-align: right;
+      height: 40px;
+      border-bottom: 1px solid #e4e7ed;
     }
   }
 }