Browse Source

Merge branch 'master' into dev_duxiangyu

duxiangyu 2 years ago
parent
commit
19f3d2abc4
33 changed files with 6141 additions and 3227 deletions
  1. 5 0
      public/systemConf.js
  2. 583 0
      src/components/old-adm/businessSpaceLedger/index.vue
  3. 797 0
      src/components/old-adm/businessSpaceLedger/spaceDetail/index.vue
  4. 595 0
      src/components/old-adm/businessSpaceLedger/spaceadd/index.vue
  5. 1231 1050
      src/components/old-adm/business_space/business/handsontable.vue
  6. 191 119
      src/components/old-adm/business_space/newAddDialogs/addEquipDialog.vue
  7. 72 38
      src/components/old-adm/business_space/newAddDialogs/addSystemDialog.vue
  8. 83 42
      src/components/old-adm/business_space/newAddDialogs/roomInFloorDialog.vue
  9. 1633 1470
      src/components/old-adm/business_space/newGraphy/graphy.vue
  10. 129 72
      src/components/old-adm/business_space/newGraphy/unRelateBSP.vue
  11. 138 73
      src/components/old-adm/business_space/newTables/eqToSpaceTable.vue
  12. 106 55
      src/components/old-adm/business_space/newTables/syInSpaceTable.vue
  13. 0 2
      src/components/old-adm/common/handsontable.vue
  14. 38 28
      src/components/old-adm/ledger/components/addDialog/dialogZone.vue
  15. 44 34
      src/components/old-adm/ledger/components/details/detail/cruxDialog.vue
  16. 0 1
      src/components/old-adm/ledger/components/lib/cenoteGraphy.vue
  17. 1 4
      src/components/old-adm/ledger/components/lib/floorCascader.vue
  18. 2 2
      src/components/old-adm/ledger/components/lib/spaceSelect.vue
  19. 21 11
      src/components/systemGraph/addGraph.vue
  20. 63 7
      src/components/systemGraph/edit.vue
  21. 2 6
      src/components/systemGraph/graph.vue
  22. 68 7
      src/controller/old-adm/ScanController.ts
  23. 3 1
      src/controller/old-adm/buildController.ts
  24. 124 3
      src/controller/old-adm/businessSpaceController.ts
  25. 2 0
      src/controller/old-adm/dicController.ts
  26. 3 1
      src/controller/old-adm/floorController.ts
  27. 16 0
      src/controller/old-adm/preTypes.ts
  28. 62 57
      src/controller/systemGraph/sysGraphController.ts
  29. 23 0
      src/router/system.js
  30. 94 142
      src/utils/old-adm/handsontable/buildFloorData.js
  31. 1 2
      src/utils/old-adm/scan/tools.js
  32. 10 0
      src/utils/old-adm/spaceColor.js
  33. 1 0
      vue.config.js

+ 5 - 0
public/systemConf.js

@@ -51,6 +51,11 @@ var __systemConf = {
       "name": "设备台账",
       "orders": 3,
       "path": "/ledger/facility"
+    },{
+      "id": "businessspaceledger",
+      "name": "业务空间台账",
+      "orders": 3,
+      "path": "/ledger/spacelist"
     },
     {
       "id": "system",

+ 583 - 0
src/components/old-adm/businessSpaceLedger/index.vue

@@ -0,0 +1,583 @@
+<!--
+  revit业务空间
+ -->
+<template>
+  <div id="businessSpace">
+    <!-- 空间属于多个建筑楼层 -->
+    <roomInFloorDialog ref="roomInFloorDialog" @relaSuc="relaSuc"></roomInFloorDialog>
+    <!--------- 页面头部   -------------->
+    <div class="saga-title" v-show="!needCalculate">
+      <div class="saga-build-mess">
+        <div style="margin-left: 10px;float: left;">
+          <span style="color: #999999;font-size: 14px;margin-right: 12px;">建筑楼层</span>
+          <el-cascader :options="options" @change="changeCascader" placeholder="请选择建筑楼层" ref="cascaderAddr" v-model="buildFloorSelectd">
+            <template slot-scope="{ node, data }">
+              <span>{{ data.label }}</span>
+              <i class="el-icon-warning-outline" v-if="data.count" style="color:red;margin-right:10px;"></i>
+            </template>
+          </el-cascader>
+        </div>
+        <input type="hidden" v-model="zoneItemID">
+      </div>
+      <div class="saga-build-tab">
+        <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 class="saga-build-tips" v-if="mutiCount>0" @click="getTips">有{{ mutiCount }}个空间同时属于多个建筑楼层,点击处理</div>
+    </div>
+    <div class="saga-business-sapce-main" v-show="!needCalculate">
+      <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">
+                <span slot="label"><i class="el-icon-warning-outline" v-if="item.count>0"
+                    style="color:red;margin-right:10px;"></i>{{ item.name }}</span>
+              </el-tab-pane>
+            </template>
+          </el-tabs>
+        </div>
+      </el-row>
+      <div v-show="isMyTab == 1" style="width:100%;height:100%">
+        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"
+          @updateState="updateStateSuc"></graphy>
+      </div>
+      <div v-show="isMyTab == 2">
+        <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :otherType="otherType" :id="`handsontable${activeName}`">
+        </handsontable-main>
+      </div>
+      <div class="infectedTips" v-show="isMyTab==1">
+        <p v-if="repeatFloor.length" class="repeatTips">{{repeatTextTips}}</p>
+        <p v-if="infectedTotal>0">因底图变化而受影响的业务空间{{ infectedTotal.toString() }}个<span v-show="buildFloorSelectd.length>1">,本层受影响的业务空间{{ infectedCurfloor.toString() }}个</span>
+        </p>
+      </div>
+    </div>
+    <div v-show="needCalculate" style="display:flex;align-items:center;justify-content:center;height:100%;background-color:#fff;">
+      <div class="center" style="flex:1">
+        <i class="iconfont icon-jianzhu" style="font-size:50px;"></i>
+        <p style="margin:10px 0;">空间关系已发生变化,请更新关系后再使用业务空间台账</p>
+        <p style="margin:10px 0;">前往【全部关系总览】中重新计算“建筑下的空间”“楼层下的空间”关系</p>
+        <el-button @click="jumpToAllRelation">立即跳转</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import graphy from "@/components/old-adm/business_space/newGraphy/graphy";
+import roomInFloorDialog from "@/components/old-adm/business_space/newAddDialogs/roomInFloorDialog";
+import handsontableMain from "@/components/old-adm/business_space/business/handsontable";
+import {businessSpaceController} from '@/controller/old-adm/businessSpaceController';
+
+import floorCascader from "@/components/old-adm/ledger/components/lib/floorCascader";
+import { mapGetters } from "vuex";
+
+export default {
+  components: {
+    graphy,
+    handsontableMain,
+    roomInFloorDialog,
+    floorCascader,
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'userId', 'secret']),
+    repeatTextTips() {
+      let str = `当前楼层与${this.repeatFloor.join('、')}关联同一个平面图`
+      if (!this.handled) {
+        str += `,请通过「建筑楼层管理」页面处理`
+      }
+      return str
+    }
+  },
+  data() {
+    return {
+      floor: {
+        influence: false, //受影响的业务空间弹窗
+        details: false, //详情弹窗
+        notRelated: false,
+        facility: false
+      },
+      param: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId, //用户id
+        secret: this.secret
+      },
+      buildMess: {
+        name: "--",
+        code: "",
+        selectd: [],
+        map: "",
+        isChild: true,
+        buildName: "--",
+        buildCode: ""
+      },
+      isMyTab: 1,
+      activeName: "0",
+      tabsList: [],
+      activeTabType: {
+        "code": "GeneralZone",
+        "name": "默认分区",
+        "rel_type": "99"
+      },
+      options: [], //建筑楼层级联下拉
+      floorToMap: {}, //楼层及其对应的模型图
+      FloorMap: "", //当前选中的楼层对象
+      zoneItemID: '',
+      buildFloorSelectd: [''], //当前所选的建筑楼层
+      childBackParam: {},
+      needCalculate: false, // 关系是否需要计算
+      mutiCount: 0,
+      infectedTotal: 0,
+      infectedCurfloor: 0,
+      otherType: '',
+      tabsListLoadOver: false,
+      isGetType: true, // 防止请求图时 分区类型还没有请求回来
+      repeatFloor: [], // 与当前楼层重复的其他楼层
+      handled: false, // 是否已处理重复,需求未明确指出
+      modelIdToFloor: {}, // 楼层 modelid 到楼层对象的映射
+    };
+  },
+  created() {
+    this.getRelations()
+    this.childBackParam = this.$route.params;
+  },
+  mounted() {
+  },
+  methods: {
+    // 初始化
+    init() {
+      this.getTypes()
+      this.getBuilding()
+      this.getMutiCount()
+      this.getInfected();
+    },
+    // 获取项目下建筑
+    getBuilding() {
+      businessSpaceController.queryBFloorWithState({}, res => {
+        this.modelIdToFloor = {};
+        this.options = res.content.map(t => {
+          t.value = t.id;
+          t.label = t.localName || t.localId;
+          t.count = 0;
+          if (t.floor) {
+            t.children = t.floor.map(item => {
+              item.value = item.id;
+              item.label = item.localName || item.name;
+              item.buildName = t.localName || t.name;
+              this.floorToMap[item.id] = item;
+              if (item.count > 0) {
+                t.count++;
+              }
+              if (item.modelId) {
+                if (this.modelIdToFloor[item.modelId]) {
+                  this.modelIdToFloor[item.modelId].push(item);
+                } else {
+                  this.modelIdToFloor[item.modelId] = [item]
+                }
+              }
+              return item;
+            })
+            t.children.unshift({ value: "all", label: "全部" }, { value: 'noKnow', label: "未明确楼层" })
+          } else {
+            t.children = []
+          }
+          return t;
+        })
+        this.options.unshift({ value: "all", label: "全部" }, { value: "noKnow", label: "未明确建筑" })
+        if (this.childBackParam.buildFloorSelectd) {
+          this.buildFloorSelectd = this.childBackParam.buildFloorSelectd;
+        }
+        if (this.childBackParam.zone) {
+          this.changeCascader(this.buildFloorSelectd);
+        }
+      })
+    },
+    // 获取受影响统计
+    getInfected(floor) {
+      let pa = {
+        filters: `state=1`
+      }
+      if (floor) {
+        pa.filters += `;floorId="${floor}"`
+      }
+      businessSpaceController.zoneCount(pa, res => {
+        if (floor) {
+          this.infectedCurfloor = res.count
+        } else {
+          this.infectedTotal = res.count
+        }
+      })
+    },
+    // 切换平面图和列表
+    changeRadio(val) {
+      this.changeGraphyOrTable(val)
+    },
+    // 获取tabs的列表
+    getTypes(floorid) {
+      let pa = {
+        // Cascade: [{ Name: 'zoneType' }]
+      }
+      if (floorid) {
+        pa.floorId = floorid
+      }
+      businessSpaceController.queryAllZoneType(pa, res => {
+        this.tabsList = res.content.map(t => {
+          if (t.name == "元空间") {
+            return undefined;
+          }
+          return t;
+        }).filter(item => item);
+        this.tabsListLoadOver = true;
+        if (this.childBackParam.zone) {
+          this.activeName = this.childBackParam.zone;
+          this.buildFloorSelectd = this.childBackParam.buildFloorSelectd;
+          this.isMyTab = this.childBackParam.isMyTab;
+          this.otherType = this.childBackParam.otherType;
+        } else if (this.activeName == '0') {
+          this.activeName = 'GeneralZone';
+        }
+      })
+    },
+    // 获取多建筑楼层统计
+    getMutiCount() {
+      businessSpaceController.getSpaceBdFlCount({}, res => {
+        this.mutiCount = res.count;
+        if (this.mutiCount > 0) {
+          this.getTips();
+        }
+      })
+    },
+    // 获取关系是否需要计算
+    getRelations() {
+      let pa = {
+        filters: `relationType in ["bd2sp","fl2sp"];computationalState>1`
+      }
+      // 后台暂无接口提供 todo
+      businessSpaceController.getrelationTypeProject(pa, res => {
+        if (res.content.length) {
+          this.needCalculate = true;
+        } else {
+          this.needCalculate = false;
+          this.init()
+        }
+      })
+    },
+    // 通过选中的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) {
+      this.buildFloorSelectd = val;
+      this.$nextTick(() => {
+        let node = this.$refs['cascaderAddr'].getCheckedNodes()
+        let name = node[0].pathLabels
+        name = name.join(' ')
+        localStorage.setItem('buildingFloor', name)
+      })
+      // 如果选择的是全部或者未明确
+      if (val.indexOf('noKnow') > -1 || val.indexOf('all') > -1) {
+        this.getTypes()
+        this.isMyTab = 2;
+        this.FloorMap = {}
+      } else {
+        // 选择的是具体某个楼层
+        if (!this.floorToMap[val[1]].infos || !this.floorToMap[val[1]].infos.floorMap) {
+          this.isMyTab = 2;
+        }
+        this.getTypes(val[1]);
+        this.FloorMap = this.floorToMap[val[1]];
+      }
+      this.changeGraphyOrTable(this.isMyTab);
+      this.setRepeatText()
+    },
+
+    // 判断切换至图还是表
+    changeGraphyOrTable(num) {
+      this.activeTabType = this.getItemForType()
+      if (!this.buildFloorSelectd[0]) {
+        this.$message.warning('请选择建筑楼层')
+        return
+      }
+      if (!this.activeTabType.code) {
+        this.isGetType = false;
+        return
+      }
+      if (num == 2) {
+        this.initMessage();
+      } else {
+        this.getInfected(this.buildFloorSelectd[1]);
+        /// 
+        console.log(this.FloorMap, '========================');
+        this.isGetType = true;
+        this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, this.activeTabType);
+        this.childBackParam = {}
+      }
+    },
+
+    // 设置平面图重复显示文本
+    setRepeatText() {
+      if (this.buildFloorSelectd.indexOf('noKnow') > -1 || this.buildFloorSelectd.indexOf('all') > -1) {
+        this.repeatFloor = []
+      } else {
+        const fId = this.buildFloorSelectd[1]
+        const mId = this.floorToMap[fId].modelId;
+        if (mId) {
+          const fList = this.modelIdToFloor[mId];
+          if (fList.length < 2) {
+            this.repeatFloor = []
+          } else {
+            this.repeatFloor = fList.map(t => {
+              if (t.id != fId) {
+                return `${t.buildName}-${t.localName}`
+              }
+            }).filter(item => item);
+          }
+        }
+      }
+    },
+
+    // 触发获取表头-获取初始化信息点
+    initMessage() {
+        this.$refs.handsontable.getHeader(this.activeName, this.buildFloorSelectd);
+    },
+    checkSpace(list, build, graphyId) {
+      this.floor.notRelated = true;
+      this.$refs.notRelated.getIdList(list, build, graphyId, this.activeTabType);
+      this.$refs["graphy"].getHasSpace();
+    },
+    changeShow() {
+      this.floor.dialogVisible = true;
+      console.log(this.buildMess, 'buildMess')
+    },
+    //成功关联平面图
+    createSuccess() {
+      this.$refs["graphy"].getHasSpace();
+      this.$refs["graphy"].clearDimension();
+      this.floor.notRelated = false;
+    },
+    //成功删除业务空间
+    delSuccess() {
+      this.floor.details = false;
+      this.$refs["graphy"].getHasSpace();
+      this.$refs["graphy"].clearDimension();
+    },
+    //查看业务空间详情
+    getBuinessDetails(list) {
+      this.floor.details = true;
+      this.$refs.details.getData(list, this.buildMess);
+    },
+    lookEqu(infos) {
+      infos.id = infos.id
+      infos.name = infos.localName
+      this.floor.facility = true
+      this.$refs.facility.getData(infos, this.buildMess)
+    },
+    copyID(val) {
+      this.$refs.handsontable.keyWord = val;
+    },
+    // 空间属于多个建筑楼层
+    getTips() {
+      this.$refs.roomInFloorDialog.showDialog();
+    },
+    // 跳转至关系总览
+    jumpToAllRelation() {
+      this.$router.push({ name: 'overView' })
+    },
+    relaSuc() {
+      this.init();
+      if (this.buildFloorSelectd.length > 1) {
+        this.changeCascader(this.buildFloorSelectd)
+      }
+    },
+    // 受影响业务空间确认成功回调
+    updateStateSuc() {
+      this.getBuilding()
+      this.getTypes(this.buildFloorSelectd[1]);
+      this.infectedTotal--;
+      this.infectedCurfloor--;
+    }
+  },
+  watch: {
+    floor: {
+      deep: true,
+      handler: function () {
+        if (this.floor.notRelated) {
+          this.$refs["graphy"].clearDimension();
+        }
+      }
+    },
+    projectId() {
+      this.getRelations();
+    },
+    tabsListLoadOver: {
+      handler: function (n) {
+        if (n) {
+          if (!this.isGetType) {
+            console.log(n, '0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0');
+            this.changeGraphyOrTable(this.isMyTab)
+          }
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#businessSpace {
+  position: relative;
+  display: flex;
+  flex-direction: column;
+
+  .space-own-radio {
+    .el-radio-button__inner {
+      padding: 9px 21px;
+    }
+  }
+
+  .el-dialog__body {
+    max-height: 600px;
+    overflow-y: auto;
+  }
+
+  .saga-title {
+    height: 54px;
+    background-color: #fff;
+    font-size: 14px;
+    position: relative;
+    line-height: 54px;
+    margin-bottom: 10px;
+    border: 1px solid #dfe6ec;
+
+    .saga-build-mess {
+      // position: absolute;
+      // left: 10px;
+      width: 500px;
+      margin-left: 10px;
+
+      i {
+        padding-right: 5px;
+      }
+
+      p {
+        float: left;
+      }
+
+      .saga-btn {
+        float: left;
+        height: 40px;
+        line-height: 40px;
+        padding: 0 10px;
+      }
+    }
+
+    .saga-build-tab {
+      position: absolute;
+      left: 50%;
+      transform: translateX(-50%);
+
+      .tab-main {
+        float: left;
+        width: 120px;
+        padding: 0 5px;
+        margin: 5px 0;
+        border: 1px solid #ccc;
+        background-color: #fff;
+        height: 30px;
+        box-sizing: border-box;
+        text-align: center;
+        cursor: pointer;
+        overflow: hidden;
+
+        i {
+          font-size: 18px;
+          padding-right: 10px;
+          float: left;
+          line-height: 30px;
+          margin-left: 10px;
+        }
+
+        span {
+          line-height: 30px;
+          float: left;
+        }
+      }
+
+      .tab-active {
+        background-color: #409eff;
+        color: #fff;
+      }
+    }
+
+    .saga-build-tips {
+      float: right;
+      margin-right: 10px;
+      font-size: 12px;
+      color: #409eff;
+      cursor: pointer;
+    }
+  }
+
+  .saga-business-sapce-main {
+    overflow: hidden;
+    height: 100%;
+    background: #fff;
+    // padding: 10px;
+    /deep/ .el-tabs__item.is-top {
+      border-top: 2px solid transparent;
+
+      &.is-active {
+        border-top: 2px solid #409eff;
+      }
+    }
+
+    .infectedTips {
+      position: absolute;
+      bottom: 0px;
+      box-sizing: border-box;
+      width: 100%;
+      padding: 0 20px;
+      line-height: 40px;
+      background: #ec808d;
+      color: #fff;
+      z-index: 9;
+      .repeatTips{
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+    }
+  }
+
+  .spaceTypes {
+    padding: 10px 10px 0;
+
+    .types {
+      float: left;
+      width: 100%;
+      // width: calc(100% - 200px);
+    }
+
+    .groupAdd {
+      float: left;
+      width: 200px;
+      text-align: right;
+      height: 40px;
+      border-bottom: 1px solid #e4e7ed;
+    }
+  }
+}
+</style>

+ 797 - 0
src/components/old-adm/businessSpaceLedger/spaceDetail/index.vue

@@ -0,0 +1,797 @@
+<template>
+  <div class="box">
+    <div class="condition">
+      <div class="header">
+        <el-button
+          style="float: left"
+          size="small"
+          type="default"
+          icon="el-icon-back"
+          @click="goBack"
+        ></el-button>
+        <span>{{
+          exampleData ? exampleData.localName || exampleData.name : ""
+        }}</span>
+      </div>
+      <el-row class="spaceTypes">
+        <div class="types">
+          <el-tabs v-model="activeTab" type="card">
+            <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="deleBtn">
+          <el-button size="small" @click="deleteSpace">删除业务空间</el-button>
+        </div>
+      </el-row>
+      <div v-if="activeTab == 'detail'" class="content">
+        <!-- <iframe v-if="params.isMyTab == 1" height="100%" width="100%" :src="iframeSrc"></iframe> -->
+        <el-scrollbar style="height: 100%">
+          <div class="content-scrollbar">
+            <div class="content-left">
+              <div class="content-showType">
+                <selectRadio
+                  :selectRadio="selectRadio"
+                  @changeRadio="changeRadio"
+                />
+              </div>
+              <div class="content-point">
+                <div class="content-point-left">
+                  <exhibitionBaseInformation
+                    :exhibitionBaseInformation="exhibitionBaseInformation"
+                  />
+                </div>
+                <div class="content-point-right">
+                  <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy" />
+                </div>
+              </div>
+            </div>
+            <div class="content-right">
+              <div class="content-repair">
+                <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain" />
+              </div>
+              <div class="content-media">
+                <exhibitionImage
+                  :exhibitionImage="exhibitionImage"
+                  v-if="isShowImage"
+                />
+                <exhibitionVideo
+                  :exhibitionVideo="exhibitionVideo"
+                  v-if="isShowVideo"
+                />
+                <exhibitionFile
+                  :exhibitionFile="exhibitionFile"
+                  v-if="isShowFile"
+                />
+              </div>
+            </div>
+          </div>
+        </el-scrollbar>
+      </div>
+      <!-- 空间内设备列表--服务于空间的设备 -->
+      <eqToSpaceTable
+        v-else-if="activeTab == 'equipment' || activeTab == 'equipmentFor'"
+        :params="params"
+        :type="activeTab"
+      ></eqToSpaceTable>
+      <!-- 空间内系统 -->
+      <syInSpaceTable
+        v-else-if="activeTab == 'generalSystem'"
+        :params="params"
+        :type="activeTab"
+      ></syInSpaceTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import tools from "@/utils/old-adm/scan/tools";
+import ScanController from "@/controller/old-adm/ScanController";
+import dicController from "@/controller/old-adm/dicController";
+import logicConfig from "@/logicConfig";
+
+import eqToSpaceTable from "@/components/old-adm/business_space/newTables/eqToSpaceTable";
+import syInSpaceTable from "@/components/old-adm/business_space/newTables/syInSpaceTable";
+import exhibitionBaseInformation from "@/components/old-adm/ledger/components/details/detail/exhibitionBaseInformation";
+import exhibitionFile from "@/components/old-adm/ledger/components/details/detail/exhibitionFile";
+import exhibitionImage from "@/components/old-adm/ledger/components/details/detail/exhibitionImage";
+import exhibitionVideo from "@/components/old-adm/ledger/components/details/detail/exhibitionVideo";
+import exhibitionCrux from "@/components/old-adm/ledger/components/details/detail/exhibitionCrux";
+import exhibitionEnergy from "@/components/old-adm/ledger/components/details/detail/exhibitionEnergy";
+import exhibitionMaintain from "@/components/old-adm/ledger/components/details/detail/exhibitionMaintain";
+import selectRadio from "@/components/old-adm/ledger/components/details/detail/selectRadio";
+
+export default {
+  data() {
+    return {
+      params: {}, //参数-包含空间id 分区类型 进入方式(1-平面图 2-列表)
+      tabsList: [
+        { Code: "detail", Name: "空间详情" },
+        { Code: "equipment", Name: "空间内设备" },
+        { Code: "equipmentFor", Name: "服务于空间的设备" },
+        { Code: "generalSystem", Name: "空间内系统" },
+      ], //tab页
+      activeTab: "detail", //当前选中的tab
+      pointData: [], //信息点数据
+      exampleData: {}, //实例数据
+      currentRadio: "1", //当前选中的select
+      criterias: [], //动态参数
+      instance: {},
+      iframeSrc: "", //空间详情iframe
+      selectRadio: {
+        information: "设备信息点",
+        initRadio: "1",
+        radioList: [
+          {
+            value: "显示需采集信息点",
+            label: "1",
+          },
+          {
+            value: "显示有值信息点",
+            label: "2",
+          },
+          {
+            value: "显示全部信息点",
+            label: "3",
+          },
+        ],
+      },
+      exhibitionBaseInformation: {
+        information: {},
+      },
+      exhibitionEnergy: {
+        title: "能耗信息",
+        firstName: "",
+        dynamic: [],
+        list: {},
+      },
+      exhibitionMaintain: {
+        title: "维修/维保记录",
+      },
+      exhibitionFile: {
+        title: "文件",
+        list: {},
+      },
+      exhibitionCrux: {
+        title: "关键信息点:",
+        cruxArray: [],
+        allMessage: [], //全部信息点
+      },
+      exhibitionImage: {
+        title: "图片",
+        list: {},
+        arr: [],
+      },
+      exhibitionVideo: {
+        title: "视频",
+        list: {},
+      },
+      isShowImage: false,
+      isShowVideo: false,
+      isShowFile: false,
+    };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "userId", "secret", "group_code"]),
+  },
+  components: {
+    eqToSpaceTable,
+    syInSpaceTable,
+    exhibitionBaseInformation,
+    exhibitionFile,
+    exhibitionVideo,
+    exhibitionImage,
+    exhibitionMaintain,
+    selectRadio,
+    exhibitionCrux,
+    exhibitionEnergy,
+  },
+  created() {
+    this.params = this.$route.query;
+    this.getData();
+    this.setFrame();
+  },
+  mounted() {},
+  watch: {
+    projectId() {
+      this.$router.push({ path: "/ledger/spacelist" });
+    },
+  },
+  methods: {
+    deepCopy(obj) {
+      return JSON.parse(JSON.stringify(obj));
+    },
+    // 返回
+    goBack() {
+      this.$router.push({
+        path: "/ledger/spacelist",
+        params: this.params,
+      });
+    },
+    // 查询空间详情
+    getData() {
+      let params1 = {
+          orders: "sort asc",
+          pageNumber: 1,
+          pageSize: 1000,
+          type: this.params.zone,
+        },
+        params2 = {
+          filters: `id='${this.params.RoomID}'`,
+          zoneType: this.params.zone,
+        };
+      let promise1 = new Promise((resolve, reject) => {
+        dicController.getDataDictionary(params1, (res) => {
+          resolve(res);
+        });
+      });
+      let promise2 = new Promise((resolve, reject) => {
+        ScanController.zoneQuery(params2, (res) => {
+          resolve(res);
+        });
+      });
+      // 数据初始化
+      this.exhibitionEnergy.dynamic = [];
+      this.criterias = [];
+
+      Promise.all([promise1, promise2]).then((values) => {
+        this.pointData = values[0].content;
+        this.exampleData = values[1].content[0];
+        let obj = values[1].content[0]
+          ? this.deepCopy(values[1].content[0])
+          : values[1].content[0];
+
+        obj = tools.flattenKeys(obj);
+        for (let key in obj) {
+          if (Array.isArray(obj[key]) && !obj[key].length) {
+            delete obj[key];
+          }
+        }
+        this.instance = obj;
+        this.pointData.forEach((item) => {
+          if (item.category != "STATIC") {
+            let cur = tools.dataForKey(this.exampleData, item.path);
+            if (cur) {
+              this.criterias.push({
+                id: this.exampleData.id,
+                code: item.code,
+              });
+            }
+          }
+        });
+        let params = {
+          //获取动态参数
+          groupCode: this.group_code,
+          appId: "datacenter",
+          projectId: this.projectId,
+          data: [],
+        };
+        params.data = this.criterias;
+        if (this.criterias.length) {
+          ScanController.BeatchQueryParam(params, (res) => {
+            // this.criteriasArray = res.Content;
+            res.data.length &&
+              res.data.map((child) => {
+                this.pointData.map((head) => {
+                  if (head.code == child.infoCode) {
+                    if (head.dataSource) {
+                      head.dataSource.forEach((i) => {
+                        if (i.code == child.data) {
+                          this.$set(head, "data", i.name);
+                        }
+                      });
+                    } else {
+                      this.$set(head, "data", child.data);
+                    }
+                    this.$set(head, "svalue", child.infoValue);
+                    // this.$set(head, 'data', child.data)
+                    this.$set(head, "receivetime", child.time);
+                    this.$set(head, "error", child.error);
+                  }
+                  return head;
+                });
+              });
+            this.handleRadios(this.currentRadio);
+            this.handleEnclosure(); //处理图片视频文件信息
+          });
+        } else {
+          this.handleRadios(this.currentRadio);
+          this.handleEnclosure(); //处理图片视频文件信息
+        }
+      });
+    },
+    handleEnclosure() {
+      //图片文件处理,脱离radio控制
+      let isList = this.pointData;
+      let isArr = [];
+      isList.map((j) => {
+        if (this.instance && this.instance.hasOwnProperty(j.path)) {
+          j.value = this.instance[j.path];
+          return j;
+        }
+      });
+      isArr = isList.filter((k) => k.value);
+      this.handlePicList(isArr);
+      this.handleFileList(isArr);
+    },
+    handleRadios(val) {
+      //判断radio的值显示关键信息,基本信息,图片,文件
+      let arr = [];
+      //关键信息点
+      this.exhibitionCrux.cruxArray = this.pointData.filter((i) => i.keyWord);
+      this.exhibitionCrux.cruxArray.map((i) => {
+        if (this.instance && this.instance.hasOwnProperty(i.path)) {
+          return {
+            ...i,
+            value: this.instance[i.path],
+          };
+        }
+      });
+      if (val == 1) {
+        //需采集信息
+        arr = this.pointData.filter((i) => i.visible);
+        //  图片和的处理
+        // this.handlePicList(arr)
+        // //  文件处理
+        // this.handleFileList(arr)
+      } else if (val == 2) {
+        //有值信息点
+        let list = this.pointData;
+        list.map((j) => {
+          if (this.instance && this.instance.hasOwnProperty(j.path)) {
+            return {
+              ...j,
+              value: this.instance[j.path],
+            };
+          }
+          arr = list.filter((k) => k.value);
+          // this.handlePicList(arr)
+          // this.handleFileList(arr)
+        });
+      } else {
+        //全部信息点
+        arr = this.pointData;
+        // this.handlePicList(arr)
+        // this.handleFileList(arr)
+      }
+      this.displayData(arr);
+    },
+    handlePicList(arr) {
+      let picObject = {};
+      //处理数据格式
+      arr.map((i) => {
+        if (i.dataType == "ATTACHMENT") {
+          switch (i.Path) {
+            case "infos.drawing":
+            case "infos.installPic":
+            case "infos.installDrawing":
+            case "infos.nameplate":
+            case "infos.pic":
+            case "pic":
+              if (this.instance && this.instance.hasOwnProperty(i.path)) {
+                i.PicList = this.instance[i.path];
+              }
+              if (picObject[i.name]) {
+              } else {
+                picObject[i.name] = [];
+              }
+              picObject[i.name].push({
+                ...i,
+              });
+              break;
+          }
+        }
+      });
+      //展示图片
+      this.exhibitionImage.list = picObject;
+      let isArray = []; //获取图片数组
+      for (let i in picObject) {
+        if (Array.isArray(picObject[i])) {
+          let list = picObject[i];
+          list.forEach((i) => {
+            if (i.PicList) {
+              isArray.push(...i.PicList);
+            }
+          });
+        }
+      }
+      this.exhibitionImage.arr = isArray;
+      let video = isArray.filter((i) => i.Type != "image" && i.type != "image");
+      this.exhibitionVideo.list = video;
+
+      //判断是否显示图片组件
+      this.isShowImage = isArray.length ? true : false;
+
+      //判断是否显示video组件
+      this.isShowVideo = video.length ? true : false;
+    },
+    handleFileList(arr) {
+      let picObject = {};
+      //处理数据格式
+      arr.map((i) => {
+        if (i.dataType == "ATTACHMENT") {
+          switch (i.path) {
+            case "infos.insuranceFile":
+            case "infos.archive":
+            case "infos.checkReport":
+              if (this.instance && this.instance.hasOwnProperty(i.path)) {
+                i.fileList = this.instance[i.path];
+              }
+              if (picObject[i.name]) {
+              } else {
+                picObject[i.name] = [];
+              }
+
+              picObject[i.name].push({
+                ...i,
+              });
+              break;
+          }
+        }
+      });
+      //展示文件
+      this.exhibitionFile.list = picObject;
+      let isArray = []; //获取文件数组
+      for (let i in picObject) {
+        if (Array.isArray(picObject[i])) {
+          let list = picObject[i];
+          list.forEach((i) => {
+            if (i.fileList) {
+              isArray.push(...i.fileList);
+            }
+          });
+        }
+      }
+      //判断是否显示文件组件
+      this.isShowFile = isArray.length ? true : false;
+    },
+    changeRadio(val) {
+      //1,需采集,2,有值,3,全部
+      this.handleRadios(val);
+      this.currentRadio = val;
+    },
+    formatDate(str) {
+      if (str) {
+        if (str.includes("-")) {
+          return str;
+        } else {
+          if (str.length > 8) {
+            return (
+              str.substr(0, 4) +
+              "-" +
+              str.substr(4, 2) +
+              "-" +
+              str.substr(6, 2) +
+              " " +
+              str.substr(8, 2) +
+              ":" +
+              str.substr(10, 2) +
+              ":" +
+              str.substr(12, 2)
+            );
+          } else {
+            return (
+              str.substr(0, 4) +
+              "-" +
+              str.substr(4, 2) +
+              "-" +
+              str.substr(6, 2) +
+              " " +
+              str.substr(8, 2)
+            );
+          }
+        }
+      } else {
+        return "--";
+      }
+    },
+    displayData(arr) {
+      //对数据进行处理传给组件展示
+      const result = {};
+      const resultEnergy = {};
+      arr.forEach((i) => {
+        if (
+          this.instance &&
+          this.instance.hasOwnProperty(i.path) &&
+          this.currentRadio != 2
+        ) {
+          i.value = this.instance[i.path];
+        }
+        if (i.dataType == "DATETIME") {
+          if (this.instance && this.instance.hasOwnProperty(i.path)) {
+            let time = this.instance[i.path];
+            i.value = this.formatDate(time);
+          }
+        }
+        if (i.dataSource && i.dataSource.length) {
+          // let source = JSON.parse(i.DataSource)
+          let source = i.dataSource;
+          //判断输入类型
+          if (i.dataType == "ENUM") {
+            let d1l = tools.formatDataSource(i.dataSource);
+            d1l.forEach((k) => {
+              if (k.code == this.instance[i.path]) {
+                i.value = k.name;
+              }
+            });
+          } else if (i.dataType == "MENUM" || i.dataType == "DATETIME") {
+            if (this.instance.hasOwnProperty(i.path)) {
+              if (!Array.isArray(this.instance[i.path])) {
+                let transArray = this.instance[i.path].split(",");
+                i.value = source
+                  .filter((item) => transArray.includes(item.code))
+                  .map((item) => item.name)
+                  .join(",");
+              }
+            }
+          }
+          source.forEach((j) => {
+            if (this.instance && j.code == this.instance[i.path]) {
+              i.value = j.name;
+            }
+          });
+        }
+        switch (i.category) {
+          case "STATIC":
+            if (
+              result[`${i.firstName}${i.secondName ? "/" + i.secondName : ""}`]
+            ) {
+              result[
+                `${i.firstName}${i.secondName ? "/" + i.secondName : ""}`
+              ].paths.push({
+                Path: i.path,
+                InfoPointName: i.name,
+                InfoPointCode: i.code,
+                Value: i.value,
+                Visible: i.visible,
+                KeyWord: i.keyWord,
+                classCode: i.classCode,
+                id: i.id,
+                groupCode: i.groupCode,
+                type: i.type,
+                dataType: i.dataType,
+              });
+            } else {
+              result[
+                `${i.firstName}${i.secondName ? "/" + i.secondName : ""}`
+              ] = {
+                paths: [
+                  {
+                    Path: i.path,
+                    InfoPointName: i.name,
+                    InfoPointCode: i.code,
+                    Value: i.value,
+                    Visible: i.visible,
+                    KeyWord: i.keyWord,
+                    classCode: i.classCode,
+                    id: i.id,
+                    groupCode: i.groupCode,
+                    type: i.type,
+                    dataType: i.dataType,
+                  },
+                ],
+              };
+            }
+            break;
+          default:
+            if (
+              resultEnergy[
+                `${i.firstName}${i.secondName ? "/" + i.secondName : ""}`
+              ]
+            ) {
+              resultEnergy[
+                `${i.firstName}${i.secondName ? "/" + i.secondName : ""}`
+              ].paths.push({
+                Path: i.path,
+                InfoPointName: i.name,
+                InfoPointCode: i.code,
+                value: i.svalue,
+                Visible: i.visible,
+                KeyWord: i.keyWord,
+                data: i.data,
+                receivetime: i.receivetime,
+                error: i.error,
+                Unit: i.unit,
+                FirstName: i.firstName,
+                dataType: i.dataType,
+              });
+            } else {
+              resultEnergy[
+                `${i.firstName}${i.secondName ? "/" + i.secondName : ""}`
+              ] = {
+                paths: [
+                  {
+                    Path: i.path,
+                    InfoPointName: i.name,
+                    InfoPointCode: i.code,
+                    value: i.svalue,
+                    Visible: i.visible,
+                    KeyWord: i.keyWord,
+                    data: i.data,
+                    receivetime: i.receivetime,
+                    error: i.error,
+                    Unit: i.unit,
+                    FirstName: i.firstName,
+                    dataType: i.dataType,
+                  },
+                ],
+              };
+            }
+        }
+      });
+      this.exhibitionBaseInformation.information = result;
+      this.exhibitionCrux.allMessage = result;
+      this.exhibitionEnergy.list = resultEnergy;
+    },
+    // 设置iframe
+    setFrame() {
+      this.iframeSrc = `${window.__systemConf.BASE_URL}:8889/#/changeMess?perjectId=${this.projectId}&secret=${this.secret}&id=${this.params.RoomID}&type=${this.params.zone}`;
+      // `${process.env.BASE_URL}:8889/#/changeMess?perjectId=${this.projectId}&secret=${this.secret}&id=${this.params.RoomID}&type=${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() {
+      this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let pa = [{ id: this.exampleData.id }];
+          ScanController.zoneDelete(pa, (res) => {
+            switch (res.result) {
+              case logicConfig.resultObj.success:
+                this.$message.success("删除成功");
+                this.goBack();
+                break;
+              default:
+                this.$message.error("删除失败");
+                break;
+            }
+          });
+        })
+        .catch(() => {
+          this.getData();
+          this.$message("取消删除");
+        });
+    },
+  },
+};
+</script>
+
+<style scoped lang='less'>
+@bgc: #fff;
+.box {
+  .condition {
+    padding: 10px;
+    display: flex;
+    height: 100%;
+    flex-direction: column;
+    border: 1px solid #dfe6ec;
+    box-sizing: border-box;
+    background: #fff;
+
+    .header {
+      padding-bottom: 10px;
+
+      span {
+        line-height: 33px;
+        margin-left: 15px;
+      }
+    }
+
+    .spaceTypes {
+      .types {
+        float: left;
+        width: calc(100% - 200px);
+
+        /deep/ .el-tabs__item.is-top {
+          border-top: 2px solid transparent;
+
+          &.is-active {
+            border-top: 2px solid #409eff;
+          }
+        }
+      }
+
+      .deleBtn {
+        float: left;
+        width: 200px;
+        text-align: right;
+        height: 40px;
+        border-bottom: 1px solid #e4e7ed;
+      }
+    }
+
+    .content {
+      height: calc(100% - 99px);
+
+      .content-scrollbar {
+        display: flex;
+        height: 100%;
+        flex-direction: row;
+        box-sizing: border-box;
+        background-color: @bgc;
+
+        .content-left {
+          display: flex;
+          flex-direction: column;
+          flex: 1;
+
+          .content-showType {
+            height: 50px;
+            border: 1px solid #ccc;
+            border-bottom: none;
+            box-sizing: border-box;
+            background: @bgc;
+          }
+
+          .content-point {
+            display: flex;
+            flex-direction: row;
+            border: 1px solid #ccc;
+            box-sizing: border-box;
+            background: @bgc;
+
+            .content-point-left {
+              flex: 1;
+            }
+
+            .content-point-right {
+              width: 300px;
+              border-left: 1px solid #ccc;
+            }
+          }
+        }
+
+        .content-right {
+          width: 400px;
+          margin-left: 10px;
+          box-sizing: border-box;
+
+          .content-repair {
+            height: 50px;
+            line-height: 50px;
+            margin-bottom: 10px;
+            border: 1px solid #ccc;
+            background: @bgc;
+            box-sizing: border-box;
+          }
+
+          .content-media {
+            box-sizing: border-box;
+          }
+        }
+      }
+    }
+
+    .main {
+      margin-top: 10px;
+      height: calc(100% - 96px);
+    }
+
+    .footer {
+      margin-bottom: 10px;
+    }
+
+    /deep/ .el-scrollbar__wrap {
+      overflow-x: hidden;
+    }
+  }
+}
+</style>
+
+<style lang="less">
+.el-table th {
+  background-color: #d9d9d9;
+  color: #000;
+}
+</style>

+ 595 - 0
src/components/old-adm/businessSpaceLedger/spaceadd/index.vue

@@ -0,0 +1,595 @@
+<template>
+  <div id="deviceList">
+    <el-row class="right">
+      <span style="float: left">当前选择的分区类型:{{ space.spaceName }}</span>
+      <el-select
+        v-model="showType"
+        @change="initTable"
+        style="width: 125px; margin-right: 10px; vertical-align: bottom"
+      >
+        <el-option
+          v-for="item in showTypes"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        ></el-option>
+      </el-select>
+      <span>增加</span>
+      <el-input-number
+        v-model="addNum"
+        :controls="false"
+        style="width: 50px"
+        :min="1"
+        :max="50"
+      ></el-input-number>
+      <span>个{{ space.spaceName }}</span>
+      <el-button @click="handleAddTableRow">增加</el-button>
+    </el-row>
+    <div class="tableBox">
+      <div
+        class="center middle_sty"
+        style="flex: 2"
+        v-show="tableData && !tableData.length"
+      >
+        <p>
+          <i class="icon-wushuju iconfont"></i>
+          暂无数据
+        </p>
+      </div>
+      <div class="tableLeft" v-show="tableData && tableData.length">
+        <handson-table ref="table"></handson-table>
+      </div>
+    </div>
+    <el-row class="center">
+      <el-button
+        type="primary"
+        size="medium"
+        @click="handleCreateTableData"
+        :disabled="createDisable"
+        class="create_button"
+        >创建业务空间</el-button
+      >
+    </el-row>
+
+    <!--二维码弹窗 -->
+    <qrcode
+      :dialog="myDialog"
+      :qrcodeUrl="qrcodeUrl"
+      :addBody="true"
+      ref="qrcode"
+    ></qrcode>
+    <!--上传图片-->
+    <upload-img-dialog
+      :read="false"
+      @changeFile="imgChange"
+      :keysArr="imgsArr"
+      :dialog="myDialog"
+    />
+    <!-- 多选枚举类型维护 -->
+    <menum
+      :dialog="myDialog"
+      :updateInfoData="updateInfoData"
+      :updateInput="updateInput"
+      @change="handleChangeMenum"
+    ></menum>
+    <!-- 不支持的输入方式 -->
+    <el-dialog
+      title="临时维护信息点"
+      :visible.sync="myDialog.update"
+      @close="handleCloseUpdate"
+      width="670px"
+    >
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
+        <el-link
+          @click="updateInputShow = true"
+          type="primary"
+          :underline="false"
+          >继续维护</el-link
+        >
+        。
+      </el-row>
+      <el-row style="margin-top: 20px" v-show="updateInputShow">
+        <el-input
+          type="textarea"
+          :autosize="{ minRows: 4, maxRows: 8 }"
+          placeholder="请输入内容"
+          v-model="updateInput"
+        ></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import tools from "@/utils/old-adm/scan/tools";
+import showTools from "@/utils/old-adm/handsontable/notShow";
+import session from "@/utils/storageUtil";
+import buildFloor from "@/utils/old-adm/handsontable/buildFloorData";
+
+import handsonTable from "@/components/old-adm/common/handsontable";
+import menum from "@/components/old-adm/dialogs/list/menum";
+import logicConfig from "@/logicConfig";
+import ScanController from "@/controller/old-adm/ScanController";
+
+import Dic from "@/controller/old-adm/dicController";
+
+import { mapGetters } from "vuex";
+
+import qrcode from "@/components/old-adm/ledger/components/lib/qrcode";
+import uploadImgDialog from "@/components/old-adm/dialogs/list/uploadImgDialog";
+
+export default {
+  components: {
+    qrcode, //二维码页面
+    uploadImgDialog,
+    handsonTable,
+    menum,
+  },
+  data() {
+    return {
+      addNum: 1,
+      onlyRead: false,
+      showTypes: [
+        { value: "Visible", label: "只看采集信息" },
+        { value: "all", label: "全部" },
+      ],
+      tableHeader: [],
+      tableData: session.get("spaceAddData")
+        ? session.get("spaceAddData").length
+          ? session.get("spaceAddData")
+          : [{}]
+        : [{}],
+      copyTableData: [],
+      category: {}, //路由参数
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        uploadImgs: false, //上传单个图片
+        update: false, //临时维护信息点
+        menum: false, //临时多选枚举类型信息点
+      },
+      inputMap: {
+        flowBuild: {
+          editable: true,
+          code: "flowBuild",
+          name: "建筑楼层",
+          path: "flowBuild",
+          category: "STATIC",
+          dataType: "ENUM",
+        },
+      }, //信息点和输入方式映射表
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInfoData: {}, //当前信息点信息
+      updateInfoPoint: "", //临时维护信息点
+      updateInput: "", //临时维护信息点值
+      qrcodeUrl: "", //二维码图片地址
+      imgsArr: [], //临时保存的图片key数组
+      showType: this.$route.query.showType,
+      buildFloorData: [],
+      createDisable: false,
+    };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+    flowBuild() {
+      let buildFloorSelectd = this.space.buildFloorSelectd;
+      if (buildFloorSelectd && buildFloorSelectd.length == 0) {
+        return "";
+      } else if (buildFloorSelectd && buildFloorSelectd.length == 1) {
+        let build = buildFloorSelectd[0];
+        if (build == "all" || build == "noKnow") {
+          return "";
+        } else {
+          return build;
+        }
+      } else if (buildFloorSelectd && buildFloorSelectd.length == 2) {
+        let build = buildFloorSelectd[0],
+          floor = buildFloorSelectd[1];
+        if (build && (floor == "all" || floor == "noKnow")) {
+          return build;
+        } else {
+          return `${build}-${floor}`;
+        }
+      }
+    },
+  },
+  created() {
+    this.space = this.$route.query;
+    buildFloor.getData(this.buildFloorData);
+    this.getTableHeader();
+  },
+  methods: {
+    // 获取表头数据(初始化表格)
+    async getTableHeader() {
+      let params = {
+        orders: "sort asc, name desc",
+        pageNumber: 1,
+        pageSize: 1000,
+        type: this.space.spaceType,
+      };
+      Dic.getDataDictionary(params, (res) => {
+        this.tableHeader = res.content;
+        this.tableHeader.forEach((item) => {
+          if (item.path) {
+            this.inputMap[item.path] = item;
+          }
+        });
+        this.tableData[0].flowBuild = this.flowBuild;
+        this.initTable();
+      });
+    },
+    // 创建业务空间数据
+    async handleCreateTableData() {
+      let newData = this.tableData.filter((item) => {
+        let keys = Object.keys(item);
+        keys.map((key) => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        let newK = Object.keys(item);
+        if (newK.length) {
+          return item;
+        }
+      });
+      if (!newData.length) {
+        this.$message("创建信息为空,请录入信息后再创建!");
+        return;
+      }
+      let flag = false;
+      newData.map((item) => {
+        if (!item.localName) {
+          flag = true;
+        }
+        // 处理建筑-楼层
+        if (item.flowBuild) {
+          let bid = item.flowBuild.split("-");
+          if (bid[0] && bid[0] != "all" && bid[0] != "noKnow") {
+            item.buildingId = item.flowBuild.split("-")[0];
+            if (bid[1]) {
+              if (bid[1] != "noKnow" && bid[1] != "all") {
+                item.floorId = item.flowBuild.split("-")[1];
+              }
+            }
+          }
+        }
+        item.classCode = this.space.spaceType;
+      });
+      if (flag) {
+        this.$message.info("存在业务空间的本地名称为空,请检查");
+        return;
+      }
+      //待接口修改为关联创建即可修改
+      let param = {
+        content: newData,
+      };
+      this.createDisable = true;
+      ScanController.zoneCreate(param, (res) => {
+        this.createDisable = false;
+        switch (res.result) {
+          case logicConfig.resultObj.success:
+            this.$message.success("创建成功");
+            session.remove("spaceAddData");
+            this.$router.push({
+              name: "spacelist",
+              params: {
+                zone: this.space.otherType
+                  ? this.space.otherType
+                  : this.space.spaceType,
+                buildFloorSelectd: ["all"],
+                isMyTab: "2",
+                otherType: this.space.otherType ? this.space.spaceType : "",
+              },
+            });
+            break;
+          default:
+            this.$message.error("创建失败");
+            break;
+        }
+      });
+    },
+    // 删除表格行
+    handleDeleteTableRow(a, b, c, d) {
+      if (d && d === "ContextMenu.removeRow") {
+        this.$message.success("删除成功");
+        this.formaTableData();
+      }
+    },
+    // 添加行
+    handleAddTableRow() {
+      let addRowLength = this.addNum;
+      for (let i = 0; i < addRowLength; i++) {
+        this.tableData.push({ flowBuild: this.flowBuild });
+      }
+      this.initTable();
+      this.formaTableData();
+    },
+    //修改
+    handleUpdataTable(changeData, source) {
+      if (!this.onlyRead && source != "ObserveChanges.change") {
+        this.formaTableData();
+      }
+    },
+    //保存去掉空字段的新增数据
+    formaTableData() {
+      let newData = this.tableData.filter((item) => {
+        let keys = Object.keys(item);
+        keys.map((key) => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        if (keys.length && Object.keys(item).length) {
+          return item;
+        }
+      });
+      session.set("spaceAddData", newData);
+    },
+    //格式化表头显示的数据
+    formatHeaderData(list) {
+      let arr = tools.copyArr(list);
+      let data = showTools.headerTextFilter(
+        arr,
+        "space",
+        this.onlyRead,
+        this.showType,
+        true
+      );
+      data.unshift("所属建筑楼层");
+      return data;
+    },
+    formatHeaderType(list) {
+      //格式化表头头映射的数据
+      let arr = tools.copyArr(list);
+      let data = showTools.headerTypeFilter(
+        arr,
+        "space",
+        this.onlyRead,
+        this.showType,
+        true
+      );
+      data.unshift({
+        data: "flowBuild",
+        renderer: tools.customDropdownRenderer,
+        editor: "chosen",
+        chosenOptions: {
+          data: this.buildFloorData,
+        },
+      });
+      return data;
+    },
+    initTable() {
+      //实例化表格
+      let settings = {
+        data: this.tableData,
+        colHeaders: this.formatHeaderData(this.tableHeader),
+        columns: this.formatHeaderType(this.tableHeader),
+        rowHeights: 30,
+        fillHandle: "vertical", //允许纵向填充
+        maxRows: this.tableData.length,
+        contextMenu: this.onlyRead
+          ? false
+          : {
+              items: {
+                remove_row: {
+                  name: "删除业务空间",
+                },
+              },
+            },
+        // 事件
+        afterChange: this.handleUpdataTable, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        afterRemoveRow: this.handleDeleteTableRow, //右键删除
+        afterOnCellMouseDown: this.handleTdClick, //鼠标点击
+      };
+      this.$nextTick(() => {
+        this.tableExample = this.$refs.table.init(settings);
+      });
+    },
+    //去除数组中相同的元素
+    array_diff(a, b) {
+      for (var i = 0; i < b.length; i++) {
+        for (var j = 0; j < a.length; j++) {
+          if (a[j] == b[i]) {
+            a.splice(j, 1);
+            j = j - 1;
+          }
+        }
+      }
+      return a;
+    },
+    //表格点击事件
+    handleTdClick(el, rowArr) {
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.tableExample.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr =
+          this.myHotArr.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr =
+          this.tableExample.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.tableData[sortArr[rowArr.row]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (trimmedArr.length) {
+        let infos = this.tableData[trimmedArr[rowArr.row]];
+        this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
+      } else {
+        let infos = this.tableData[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+    //获取被筛选掉的行号
+    trimmedRows() {
+      var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.tableData.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+    },
+    getInfors(infos, row) {
+      let val = this.tableExample.colToProp(row.col);
+      this.row = row.row;
+      this.messKey = val;
+      let inputData = this.inputMap[val];
+      switch (val) {
+        //空间二维码图片
+        case "qRCodePicgg":
+          this.qrcodeUrl = this.tableData[row.row].qRCodePic;
+          if (!!this.qrcodeUrl) {
+            this.myDialog.qrcode = true;
+          } else {
+            this.$message("此空间没有二维码");
+          }
+          break;
+        case "pic":
+          let Pdata = tools.dataForKey(this.tableData[row.row], val);
+          this.imgsArr = Pdata ? Pdata : [];
+          this.myDialog.uploadImgs = true;
+          break;
+        default:
+          break;
+      }
+      // 维护多选枚举值
+      if (!this.onlyRead && inputData.dataType == "MENUM") {
+        this.updateInfoData = inputData;
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.menum = true;
+        return false;
+      }
+      if (!this.onlyRead && !inputData.editable) {
+        this.$confirm("该信息点的值为自动生成,不可人工维护!", "提示", {
+          confirmButtonText: "我知道了",
+          showCancelButton: false,
+          type: "warning",
+          center: true,
+        }).then(() => {
+          return false;
+        });
+      }
+      if (
+        !this.onlyRead &&
+        showTools.inputModeArr.indexOf(inputData.dataType) == "-1"
+      ) {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
+      }
+    },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+      this.updateInputShow = false;
+      this.updateInfoPoint = "";
+      this.updateInput = "";
+    },
+    //更新临时维护信息点
+    handleClickUpdate() {
+      tools.setDataForKey(
+        this.tableData[this.row],
+        this.updateInfoPoint,
+        this.updateInput
+      );
+      this.handleUpdataTable(
+        [[this.row, this.updateInfoPoint, null, this.updateInput]],
+        "edit"
+      );
+      this.updateInputShow = false;
+      this.myDialog.update = false;
+      this.updateInput = "";
+    },
+    //多选枚举类型值修改
+    handleChangeMenum(newValue) {
+      tools.setDataForKey(
+        this.tableData[this.row],
+        this.updateInfoPoint,
+        newValue
+      );
+      this.handleUpdataTable(
+        [[this.row, this.updateInfoPoint, null, newValue]],
+        "edit"
+      );
+      this.myDialog.menum = false;
+      this.updateInput = "";
+    },
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row);
+      }
+    },
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      this.setDataToMain(keys, "pic", this.row);
+    },
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != "--") {
+        if (!!this.tableData[row]) {
+          //铭牌照片特殊处理
+          tools.setDataForKey(this.tableData[row], key, data);
+          // this.tableData[row][key] = data;
+        } else {
+          this.tableData[row] = {};
+          tools.setDataForKey(this.tableData[row], key, data);
+        }
+      } else {
+        tools.setDataForKey(this.tableData[row], key, "");
+      }
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #fff;
+  padding: 10px;
+  position: relative;
+
+  .right {
+    background: #fff;
+  }
+
+  .search-header {
+    overflow: hidden;
+    padding: 0 10px 10px 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+
+  .tableBox {
+    display: flex;
+    height: calc(100% - 100px);
+    margin-top: 10px;
+
+    .tableLeft {
+      flex: 1;
+    }
+  }
+
+  .create_button {
+    margin-top: 10px;
+  }
+}
+</style>

File diff suppressed because it is too large
+ 1231 - 1050
src/components/old-adm/business_space/business/handsontable.vue


+ 191 - 119
src/components/old-adm/business_space/newAddDialogs/addEquipDialog.vue

@@ -1,96 +1,153 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogVisible"
+    width="900px"
+    id="addEqDialog"
+  >
     <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
+          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-checkbox style="margin-left:10px;" @change="getTableData" v-model="showType" label="只显示在当前业务空间中的设备"></el-checkbox>
+        <span style="margin-left: 10px">所属楼层</span>
+        <el-cascader
+          @change="getTableData"
+          v-model="floor"
+          :options="options"
+          :props="props"
+        ></el-cascader>
+        <el-checkbox
+          style="margin-left: 10px"
+          @change="getTableData"
+          v-model="showType"
+          label="只显示在当前业务空间中的设备"
+        ></el-checkbox>
       </el-col>
     </el-row>
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
-        @selection-change="handleSelectionChange">
+      <el-table
+        :data="tableData"
+        style="width: 100%"
+        height="100%"
+        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 :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
+        <el-table-column
+          :label="`${inSpaceType}名称`"
+          show-overflow-tooltip
+          min-width="100"
+        >
           <template slot-scope="scope">
             <div>
-              {{scope.row.localName||scope.row.name||''}}
+              {{ scope.row.localName || scope.row.name || "" }}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="equipCategory.name" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="linkOtherSpace" label="已关联其他业务空间" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column
+          prop="localId"
+          :label="`${inSpaceType}本地编码`"
+          show-overflow-tooltip
+          min-width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="equipCategory.name"
+          :label="`${inSpaceType}类`"
+          show-overflow-tooltip
+          min-width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="linkOtherSpace"
+          label="已关联其他业务空间"
+          show-overflow-tooltip
+          min-width="100"
+        ></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)" type="primary" plain>查看详情</el-button>
+            <el-button
+              size="mini"
+              @click="toDetail(scope.$index, 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>
+      <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>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible = false">取 消</el-button>
-      <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
+      <el-button size="small" type="primary" @click="savaRelation"
+        >确 定</el-button
+      >
     </span>
   </el-dialog>
 </template>
 
 <script>
-import {
-  getSpaceEquip,
-  // buildingQuery, //数据中心-建筑查询
-  notEqInSpaceQuery, //没有和当前空间绑定的设备
-  notEqForSpaceQuery, //未服务当前空间的设备
-  eqInSpaceCreate, //设备所在业务空间--创建关系
-  eqForSpaceCreate, //设备服务业务空间--创建关系
-  getEqNotInSpace, //空间内没有和空间关联的设备
-  getEqNotForSpace, //空间内没有服务空间的设备
-} from "@/api/scan/request";
+import logicConfig from "@/logicConfig";
+import { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
 import { mapGetters } from "vuex";
-import { buildingQuery } from '@/api/object/build';
+import ScanController from "@/controller/old-adm/ScanController";
 export default {
-  components: {
-
-  },
+  components: {},
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
   },
   data() {
     return {
       title: "添加设备",
-      keycode: '', //输入查询条件
+      keycode: "", //输入查询条件
       options: [], //建筑楼层级联
       floor: [], // 选中的建筑楼层
       showType: false, //是否只显示在当前业务空间中的设备
-      inSpaceType: '设备',
+      inSpaceType: "设备",
       dialogVisible: false,
       tableData: [],
       loading: false,
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
       selections: [], // 选中项
       page: {
         pageSize: 50,
         pageSizes: [10, 20, 50, 100],
         pageNumber: 1,
-        total: 0
+        total: 0,
       },
-      props: { //自定义字段
+      props: {
+        //自定义字段
         value: "id",
         label: "localName",
-        children: "floor"
+        children: "floor",
       },
     };
   },
@@ -105,24 +162,32 @@ export default {
   methods: {
     // 获取项目下建筑
     getBuilding() {
+      var _this = this;
       let pa = {
-        cascade: [{ name: 'floor', orders: 'floorSequenceID desc' }],
+        cascade: [{ name: "floor", orders: "floorSequenceID desc" }],
         orders: "localName asc",
-      }
-      buildingQuery(pa, res => {
-        this.options = res.content.map(t => {
+      };
+      (async function () {
+        let res = await ScanController.buildingQuery(pa);
+        _this.options = res.content.map((t) => {
           if (t.floor) {
-            t.floor = t.floor.map(item => {
+            t.floor = t.floor.map((item) => {
               return item;
-            })
+            });
           } else {
-            t.floor = []
+            t.floor = [];
           }
-          t.floor.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确楼层' })
+          t.floor.unshift(
+            { id: "all", localName: "全部" },
+            { id: "isNull", localName: "未明确楼层" }
+          );
           return t;
-        })
-        this.options.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确楼层' })
-      })
+        });
+        _this.options.unshift(
+          { id: "all", localName: "全部" },
+          { id: "isNull", localName: "未明确楼层" }
+        );
+      })();
     },
     // 显示弹窗
     showDialog() {
@@ -132,80 +197,82 @@ export default {
     },
     // 获取列表数据
     getTableData() {
-      this.loading = true
+      this.loading = true;
       let pa = {
         data: {
           cascade: [{ name: "equipCategory" }],
-          filters: '',
+          filters: "",
           pageNumber: this.page.pageNumber,
           pageSize: this.page.pageSize,
-          orders: 'id asc'
+          orders: "id asc",
         },
         type: this.zone,
-        spaceId: this.spaceId
-      }
-      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]}'`
+        spaceId: this.spaceId,
+      };
+      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.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 += `;name contain "${this.keycode}" or localName contain "${this.keycode}" or localId contain "${this.keycode}"`
+      if (this.keycode != "") {
+        pa.data.filters += `;name contain "${this.keycode}" or localName contain "${this.keycode}" or localId contain "${this.keycode}"`;
       }
       // 删除首尾分号
-      pa.data.filters = pa.data.filters.replace(/(^;)|(;$)/g, '');
-      if (pa.data.filters == '') {
-        delete pa.data.filters
+      pa.data.filters = pa.data.filters.replace(/(^;)|(;$)/g, "");
+      if (pa.data.filters == "") {
+        delete pa.data.filters;
       }
       if (this.showType) {
         if (this.type == "equipment") {
           // pa.data.Cascade.push({ Name: "zoneSpaceInBase" })
           pa.data.cascade = [{ name: "equipCategory" }];
-          getEqNotInSpace(pa, res => {
-            this.loading = false
-            this.getDataSuc(res, 'ZoneSpaceBaseIn')
-          })
+          businessSpaceController.getEqNotInSpace(pa, (res) => {
+            this.loading = false;
+            this.getDataSuc(res, "ZoneSpaceBaseIn");
+          });
         } else {
           // pa.data.Cascade.push({ Name: "zoneSpaceForBase" })
           pa.data.cascade = [{ name: "equipCategory" }];
-          getEqNotForSpace(pa, res => {
-            this.loading = false
-            this.getDataSuc(res, 'ZoneSpaceBaseFor')
-          })
+          businessSpaceController.getEqNotForSpace(pa, (res) => {
+            this.loading = false;
+            this.getDataSuc(res, "ZoneSpaceBaseFor");
+          });
         }
       } else {
         if (this.type == "equipment") {
-          pa.data.cascade.push({ name: "zoneSpaceInBase" })
-          notEqInSpaceQuery(pa, res => {
-            this.loading = false
-            this.getDataSuc(res, 'ZoneSpaceBaseIn')
-          })
+          pa.data.cascade.push({ name: "zoneSpaceInBase" });
+          businessSpaceController.notEqInSpaceQuery(pa, (res) => {
+            this.loading = false;
+            this.getDataSuc(res, "ZoneSpaceBaseIn");
+          });
         } else {
-          pa.data.cascade.push({ name: "zoneSpaceForBase" })
-          notEqForSpaceQuery(pa, res => {
-            this.loading = false
-            this.getDataSuc(res, 'ZoneSpaceBaseFor')
-          })
+          pa.data.cascade.push({ name: "zoneSpaceForBase" });
+          businessSpaceController.notEqForSpaceQuery(pa, (res) => {
+            this.loading = false;
+            this.getDataSuc(res, "ZoneSpaceBaseFor");
+          });
         }
       }
     },
     // 获取列表成功回调
     getDataSuc(res, zonespacebase) {
-      let response = res.content && res.content.map(t => {
-        let otherSpace = [];
-        if (t[zonespacebase] && t[zonespacebase].length) {
-          t[zonespacebase].map(item => {
-            otherSpace.push(item.localName || item.name)
-          })
-        }
-        t.linkOtherSpace = otherSpace.join(',');
-        return t;
-      })
+      let response =
+        res.content &&
+        res.content.map((t) => {
+          let otherSpace = [];
+          if (t[zonespacebase] && t[zonespacebase].length) {
+            t[zonespacebase].map((item) => {
+              otherSpace.push(item.localName || item.name);
+            });
+          }
+          t.linkOtherSpace = otherSpace.join(",");
+          return t;
+        });
       this.tableData = res.content;
       this.page.total = res.total;
     },
@@ -218,28 +285,35 @@ export default {
       let pa = {
         data: {
           spaceId: this.spaceId,
-          equipIdList: []
+          equipIdList: [],
         },
-        type: this.zone
-      }
-      this.selections.map(t => {
-        pa.data.equipIdList.push(t.id)
-      })
+        type: this.zone,
+      };
+      this.selections.map((t) => {
+        pa.data.equipIdList.push(t.id);
+      });
       if (this.type == "equipment") {
-        eqInSpaceCreate(pa, res => {
-          this.successCallback()
-        })
+        businessSpaceController.eqInSpaceCreate(pa, (res) => {
+          this.successCallback(res);
+        });
       } else {
-        eqForSpaceCreate(pa, res => {
-          this.successCallback()
-        })
+        businessSpaceController.eqForSpaceCreate(pa, (res) => {
+          this.successCallback(res);
+        });
       }
     },
     // 关联成功回调
-    successCallback() {
-      this.$message.success('关联成功');
-      this.$emit('refresh');
+    successCallback(res) {
       this.dialogVisible = false;
+      switch (res.result) {
+        case logicConfig.resultObj.success:
+          this.$message.success("关联成功");
+          this.$emit("refresh");
+          break;
+        default:
+          this.$message.error("关联失败");
+          break;
+      }
     },
     // 改变pagesize
     handleSizeChange(pageSize) {
@@ -253,14 +327,12 @@ export default {
     },
     // 查看详情
     toDetail() {
-      this.$message('开发中')
-    }
+      this.$message("开发中");
+    },
   },
   watch: {
-    showType(n) {
-
-    }
-  }
+    showType(n) {},
+  },
 };
 </script>
 <style lang="less" scoped>

+ 72 - 38
src/components/old-adm/business_space/newAddDialogs/addSystemDialog.vue

@@ -1,57 +1,84 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="800px" id="addSyDialog">
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogVisible"
+    width="800px"
+    id="addSyDialog"
+  >
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
-        @selection-change="handleSelectionChange">
+      <el-table
+        :data="tableData"
+        style="width: 100%"
+        height="100%"
+        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 :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
+        <el-table-column
+          :label="`${inSpaceType}名称`"
+          show-overflow-tooltip
+          min-width="100"
+        >
           <template slot-scope="scope">
             <div>
-              {{scope.row.localName||scope.row.name||''}}
+              {{ scope.row.localName || scope.row.name || "" }}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column
+          prop="localId"
+          :label="`${inSpaceType}本地编码`"
+          show-overflow-tooltip
+          min-width="100"
+        ></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)" type="primary" plain>查看详情</el-button>
+            <el-button
+              size="mini"
+              @click="toDetail(scope.$index, scope.row)"
+              type="primary"
+              plain
+              >查看详情</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible = false">取 消</el-button>
-      <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
+      <el-button size="small" type="primary" @click="savaRelation"
+        >确 定</el-button
+      >
     </span>
   </el-dialog>
 </template>
 
 
 <script>
-import {
-  notSyInSpaceQuery, //没有和当前空间绑定的系统
-  syInSpaceCreate, //系统所在业务空间--创建关系
-} from "@/api/scan/request";
+import { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
+import logicConfig from "@/logicConfig";
 export default {
   data() {
     return {
-      title: '添加空间内的系统',
-      inSpaceType: '系统',
+      title: "添加空间内的系统",
+      inSpaceType: "系统",
       dialogVisible: false,
       tableData: [],
       loading: false,
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
       selections: [], // 选中项
-    }
+    };
   },
   props: {
     type: {}, //equipment--equipmentFor
     spaceId: {},
-    zone: {}, //分区类型 
+    zone: {}, //分区类型
   },
   methods: {
     // 显示
@@ -69,39 +96,46 @@ export default {
       let pa = {
         data: {
           spaceId: this.spaceId,
-          sysIdList: []
+          sysIdList: [],
         },
-        type: this.zone
-      }
-      this.selections.map(t => {
-        pa.data.sysIdList.push(t.id)
-      })
-      syInSpaceCreate(pa, res => {
-        this.$message.success('关联成功');
-        this.$emit('refresh');
+        type: this.zone,
+      };
+      this.selections.map((t) => {
+        pa.data.sysIdList.push(t.id);
+      });
+      businessSpaceController.syInSpaceCreate(pa, (res) => {
         this.dialogVisible = false;
-      })
+        switch (res.result) {
+          case logicConfig.resultObj.success:
+            this.$message.success("关联成功");
+            this.$emit("refresh");
+            break;
+          default:
+            this.$message.error("关联失败");
+            break;
+        }
+      });
     },
     // 获取表格数据
     getTableData() {
       let pa = {
         data: {
           pageSize: 200,
-          orders: 'id asc'
+          orders: "id asc",
         },
         type: this.zone,
-        spaceId: this.spaceId
-      }
-      notSyInSpaceQuery(pa, res => {
+        spaceId: this.spaceId,
+      };
+      businessSpaceController.notSyInSpaceQuery(pa, (res) => {
         this.tableData = res.content;
-      })
+      });
     },
     // 查看详情
     toDetail() {
-      this.$message('开发中')
-    }
-  }
-}
+      this.$message("开发中");
+    },
+  },
+};
 </script>
 <style lang="less" scoped>
 #addSyDialog {

+ 83 - 42
src/components/old-adm/business_space/newAddDialogs/roomInFloorDialog.vue

@@ -1,37 +1,73 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="800px" id="addSyDialog">
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogVisible"
+    width="800px"
+    id="addSyDialog"
+  >
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable" border>
-        <el-table-column label="业务空间名称" show-overflow-tooltip min-width="100">
+      <el-table
+        :data="tableData"
+        style="width: 100%"
+        height="100%"
+        v-loading="loading"
+        :header-cell-style="headerStyle"
+        ref="multipleTable"
+        border
+      >
+        <el-table-column
+          label="业务空间名称"
+          show-overflow-tooltip
+          min-width="100"
+        >
           <template slot-scope="scope">
             <div>
-              {{scope.row.localName||scope.row.name||''}}
+              {{ scope.row.localName || scope.row.name || "" }}
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="所属建筑" show-overflow-tooltip min-width="100" class-name="mutiCol">
+        <el-table-column
+          label="所属建筑"
+          show-overflow-tooltip
+          min-width="100"
+          class-name="mutiCol"
+        >
           <template slot-scope="scope">
             <div>
-              <div v-for="(t,i) in scope.row.floorList" :key="i" class="muti">
-                {{t.building.localName||t.building.name}}
+              <div v-for="(t, i) in scope.row.floorList" :key="i" class="muti">
+                {{ t.building.localName || t.building.name }}
               </div>
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="SysLocalID" label="所属楼层" show-overflow-tooltip min-width="100" class-name="mutiCol">
+        <el-table-column
+          prop="SysLocalID"
+          label="所属楼层"
+          show-overflow-tooltip
+          min-width="100"
+          class-name="mutiCol"
+        >
           <template slot-scope="scope">
             <div>
               <div v-for="t in scope.row.floorList" :key="t.id" class="muti">
-                {{t.localName||t.name}}
+                {{ t.localName || t.name }}
               </div>
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="action" label="操作" min-width="50" align='center' class-name="mutiCol">
+        <el-table-column
+          prop="action"
+          label="操作"
+          min-width="50"
+          align="center"
+          class-name="mutiCol"
+        >
           <template slot-scope="scope">
             <div>
               <div v-for="t in scope.row.floorList" :key="t.id" class="muti">
-                <el-radio v-model="scope.row.selected" :label="t">{{''}}</el-radio>
+                <el-radio v-model="scope.row.selected" :label="t">{{
+                  ""
+                }}</el-radio>
               </div>
             </div>
           </template>
@@ -40,35 +76,35 @@
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible = false">取 消</el-button>
-      <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
+      <el-button size="small" type="primary" @click="savaRelation"
+        >确 定</el-button
+      >
     </span>
   </el-dialog>
 </template>
 <script>
-import {
-  getSpaceBdFlData, // 属于多建筑楼层的空间数据
-  updateRelateInSpAndBuild, //保存业务空间与建筑楼层关系
-} from "@/api/scan/request";
+import { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
+import logicConfig from "@/logicConfig";
 export default {
   data() {
     return {
-      title: '请选择业务空间所属建筑',
-      inSpaceType: '系统',
+      title: "请选择业务空间所属建筑",
+      inSpaceType: "系统",
       dialogVisible: false,
       tableData: [],
       loading: false,
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
       selections: [], // 选中项
-    }
+    };
   },
   props: {
     type: {}, //equipment--equipmentFor
     spaceId: {},
-    zone: {}, //分区类型 
+    zone: {}, //分区类型
   },
   methods: {
     // 显示
@@ -80,39 +116,44 @@ export default {
     // 确认
     savaRelation() {
       let arr = [];
-      this.tableData.forEach(t => {
+      this.tableData.forEach((t) => {
         if (t.selected) {
           arr.push({
             spaceId: t.id,
             id: t.selected.floorId,
-            type: t.classCode
-          })
+            type: t.classCode,
+          });
         }
-      })
+      });
       if (arr.length) {
-        updateRelateInSpAndBuild(arr, res => {
-          this.$emit('relaSuc');
-          this.$message.success('关联成功');
+        businessSpaceController.updateRelateInSpAndBuild(arr, (res) => {
           this.dialogVisible = false;
-        })
+          switch (res.result) {
+            case logicConfig.resultObj.success:
+              this.$emit("relaSuc");
+              this.$message.success("关联成功");
+              break;
+            default:
+              this.$message.error("关联失败");
+              break;
+          }
+        });
       } else {
-        this.$message.warning('请选择关联建筑楼层');
+        this.$message.warning("请选择关联建筑楼层");
       }
     },
     // 获取表格数据
     getTableData() {
       let pa = {
-        cascade: [
-          { Name: "floorList", cascade: [{ name: 'building' }] }
-        ],
-        pageSize: 1000
-      }
-      getSpaceBdFlData(pa, res => {
+        cascade: [{ Name: "floorList", cascade: [{ name: "building" }] }],
+        pageSize: 1000,
+      };
+      businessSpaceController.getSpaceBdFlData(pa, (res) => {
         this.tableData = res.content;
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 <style lang="less" scoped>
 #addSyDialog {

File diff suppressed because it is too large
+ 1633 - 1470
src/components/old-adm/business_space/newGraphy/graphy.vue


+ 129 - 72
src/components/old-adm/business_space/newGraphy/unRelateBSP.vue

@@ -1,77 +1,129 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="unRelateBSP">
+  <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
+          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>
+        <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">
+      <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.localName || scope.row.name || '' }}
+              {{ scope.row.localName || scope.row.name || "" }}
             </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">
+        <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 size="mini" @click="createRelation(scope.row)" type="primary" plain>关联平面图</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>
+      <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,
-  zoneQuery
-} from "@/api/scan/request"
-import { buildingQuery } from '@/api/object/build';
+import ScanController from "@/controller/old-adm/ScanController";
 
 export default {
   name: "unRelateBSP",
   data() {
     return {
-      title: '未关联平面图的业务空间',
-      inSpaceType: '业务空间',
+      title: "未关联平面图的业务空间",
+      inSpaceType: "业务空间",
       dialogVisible: false,
       loading: false,
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       },
-      keycode: '',
+      keycode: "",
       tableData: [],
       page: {
         pageSize: 50,
         pageSizes: [10, 20, 50, 100],
         pageNumber: 1,
-        total: 0
+        total: 0,
       },
-      floor: ['all'], // 级联建筑楼层
-      props: { //自定义字段
+      floor: ["all"], // 级联建筑楼层
+      props: {
+        //自定义字段
         value: "id",
         label: "localName",
-        children: "floor"
+        children: "floor",
       },
       bfData: {}, //建筑楼层id =>名称
       options: [], //级联
@@ -79,10 +131,10 @@ export default {
   },
   props: {
     isAction: false, //是否显示操作按钮
-    code: String
+    code: String,
   },
   created() {
-    this.getBuilding()
+    this.getBuilding();
   },
   methods: {
     // 显示弹窗
@@ -95,7 +147,7 @@ export default {
     },
     // 关联平面图
     createRelation(row) {
-      this.$emit('createFromUnrelated', row);
+      this.$emit("createFromUnrelated", row);
       this.dialogVisible = false;
     },
     // 分页条数
@@ -110,27 +162,32 @@ export default {
       this.getTableData();
     },
     // 获取项目下建筑
-    getBuilding() {
+    async getBuilding() {
       let pa = {
-        cascade: [{ name: 'floor', orders: 'floorSequenceID desc' }],
+        cascade: [{ name: "floor", orders: "floorSequenceID desc" }],
         orders: "localName asc",
-      }
-      buildingQuery(pa, res => {
-        this.options = res.content.map(t => {
-          this.bfData[t.id] = t.localName;
-          if (t.floor) {
-            t.floor = t.floor.map(item => {
-              this.bfData[item.id] = item.localName;
-              return item;
-            })
-          } else {
-            t.floor = []
-          }
-          t.floor.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确楼层' })
-          return t;
-        })
-        this.options.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确建筑' })
-      })
+      };
+      let res = await ScanController.buildingQuery(pa);
+      this.options = res.content.map((t) => {
+        this.bfData[t.id] = t.localName;
+        if (t.floor) {
+          t.floor = t.floor.map((item) => {
+            this.bfData[item.id] = item.localName;
+            return item;
+          });
+        } else {
+          t.floor = [];
+        }
+        t.floor.unshift(
+          { id: "all", localName: "全部" },
+          { id: "isNull", localName: "未明确楼层" }
+        );
+        return t;
+      });
+      this.options.unshift(
+        { id: "all", localName: "全部" },
+        { id: "isNull", localName: "未明确建筑" }
+      );
     },
     // 查询未关联平面图的业务空间(项目下+当前分区)
     getTableData() {
@@ -139,31 +196,31 @@ export default {
         filters: `outline isNull`,
         orders: "createTime desc, id asc",
         pageSize: this.page.pageSize,
-        pageNumber: this.page.pageNumber
-      }
+        pageNumber: this.page.pageNumber,
+      };
 
-      if (this.floor[0] == 'isNull') {
-        pa.buildingId = `isnull`
-      } else if (this.floor[0] && this.floor[0] != 'all') {
-        pa.buildingId = this.floor[0]
+      if (this.floor[0] == "isNull") {
+        pa.buildingId = `isnull`;
+      } else if (this.floor[0] && this.floor[0] != "all") {
+        pa.buildingId = this.floor[0];
       }
-      if (this.floor[1] == 'isNull') {
-        pa.floorId = `isnull`
-      } else if (this.floor[1] && this.floor[1] != 'all') {
-        pa.floorId = this.floor[1]
+      if (this.floor[1] == "isNull") {
+        pa.floorId = `isnull`;
+      } else if (this.floor[1] && this.floor[1] != "all") {
+        pa.floorId = this.floor[1];
       }
-      if (this.keycode != '') {
-        pa.filters += `;localName contain "${this.keycode}" or name contain "${this.keycode}"`
+      if (this.keycode != "") {
+        pa.filters += `;localName contain "${this.keycode}" or name contain "${this.keycode}"`;
       }
-      zoneQuery(pa, res => {
+      ScanController.zoneQuery(pa, (res) => {
         this.page.total = res.total;
-        this.tableData = res.content.map(t => {
+        this.tableData = res.content.map((t) => {
           t.BNAME = this.bfData[t.buildingId];
           t.FNAME = this.bfData[t.floorId];
           return t;
-        })
-      })
-    }
+        });
+      });
+    },
   },
 };
 </script>

+ 138 - 73
src/components/old-adm/business_space/newTables/eqToSpaceTable.vue

@@ -1,125 +1,188 @@
 <template>
   <div id="eqInSp">
     <el-row v-if="hidden">
-      <el-button type="primary" @click="add">添加{{inSpaceType}}</el-button>
-      <el-tooltip class="item" effect="dark" :content="`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`" placement="right">
-        <el-button v-show="type=='Equipment'">按空间计算</el-button>
+      <el-button type="primary" @click="add">添加{{ inSpaceType }}</el-button>
+      <el-tooltip
+        class="item"
+        effect="dark"
+        :content="`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`"
+        placement="right"
+      >
+        <el-button v-show="type == 'Equipment'">按空间计算</el-button>
       </el-tooltip>
     </el-row>
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" :header-cell-style="headerStyle" v-loading="loading">
-        <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
+      <el-table
+        :data="tableData"
+        style="width: 100%"
+        height="100%"
+        :header-cell-style="headerStyle"
+        v-loading="loading"
+      >
+        <el-table-column
+          :label="`${inSpaceType}名称`"
+          show-overflow-tooltip
+          min-width="100"
+        >
           <template slot-scope="scope">
             <div>
-              {{scope.row.localName||scope.row.name||''}}
+              {{ scope.row.localName || scope.row.name || "" }}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100">
+        <el-table-column
+          prop="localId"
+          :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.equipCategory?scope.row.equipCategory.name:''}}
+              {{ scope.row.equipCategory ? scope.row.equipCategory.name : "" }}
             </div>
           </template>
         </el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">
-            <el-tooltip class="item" effect="dark" content="删除关系" placement="left">
-              <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
+            <el-tooltip
+              class="item"
+              effect="dark"
+              content="删除关系"
+              placement="left"
+            >
+              <el-button
+                size="mini"
+                @click="handleDelete(scope.$index, scope.row)"
+                type="danger"
+                plain
+                icon="el-icon-delete"
+              ></el-button>
             </el-tooltip>
           </template>
         </el-table-column>
         <template slot="empty">
-          <div style="height: 60%;transform: translateY(50%);lineHeight:20px;">
+          <div
+            style="height: 60%; transform: translateY(50%); lineheight: 20px"
+          >
             <i class="icon-wushuju iconfont"></i>
-            {{type=='Equipment'?`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`:'无数据'}}
+            {{
+              type == "Equipment"
+                ? `可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`
+                : "无数据"
+            }}
           </div>
         </template>
       </el-table>
     </div>
     <!-- 添加设备弹窗 -->
-    <addEquipDialog ref="addEqDialog" :type="type" :spaceId="params.RoomID" :zone="params.zone" @refresh='getTableData'></addEquipDialog>
+    <addEquipDialog
+      ref="addEqDialog"
+      :type="type"
+      :spaceId="params.RoomID"
+      :zone="params.zone"
+      @refresh="getTableData"
+    ></addEquipDialog>
   </div>
 </template>
 
 <script>
-import {
-  zoneQuery,
-  eqInSpaceDelete, //设备所在业务空间--删除关系
-  eqForSpaceDelete, //设备服务业务空间--删除关系
-} from "@/api/scan/request";
+import ScanController from "@/controller/old-adm/ScanController";
+import { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
+import logicConfig from "@/logicConfig";
 import { mapGetters } from "vuex";
-import addEquipDialog from "@/components/old-adm/business_space/newAddDialogs/addEquipDialog"
+import addEquipDialog from "@/components/old-adm/business_space/newAddDialogs/addEquipDialog";
 export default {
   components: {
-    addEquipDialog
+    addEquipDialog,
   },
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
   },
   data() {
     return {
-      inSpaceType: '设备',
+      inSpaceType: "设备",
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
       loading: false, // loading
       tableData: [], //列表数据
       typeToTips: {
-        Equipment: '空间内的设备',
-        EquipmentFor: '服务于空间的设备',
+        Equipment: "空间内的设备",
+        EquipmentFor: "服务于空间的设备",
       },
       hidden: true,
     };
   },
   props: {
     params: {},
-    type: {}
+    type: {},
   },
   created() {
-    this.getTableData()
+    this.getTableData();
     this.changeContentStyle();
   },
   methods: {
     // 删除关系
     handleDelete(index, row) {
       this.$confirm("确认删除该关系?", "提示", {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        let pa = {
-          data: [{
-            equipId: row.id,
-            spaceId: row.spaceId
-          }],
-          type: this.params.zone
-        }
-        if (this.type == 'equipment') {
-          this.deleteEqInSpace(pa);
-        } else {
-          this.deleteEqForSpace(pa);
-        }
-      }).catch(() => {
-        this.$message("取消删除")
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
       })
+        .then(() => {
+          let pa = {
+            data: [
+              {
+                equipId: row.id,
+                spaceId: row.spaceId,
+              },
+            ],
+            type: this.params.zone,
+          };
+          if (this.type == "equipment") {
+            this.deleteEqInSpace(pa);
+          } else {
+            this.deleteEqForSpace(pa);
+          }
+        })
+        .catch(() => {
+          this.$message("取消删除");
+        });
     },
     // 删除设备所在空间关系
     deleteEqInSpace(pa) {
-      eqInSpaceDelete(pa, res => {
-        this.$message.success('删除成功')
-        this.getTableData()
-      })
+      businessSpaceController.eqInSpaceDelete(pa, (res) => {
+        switch (res.result) {
+          case logicConfig.resultObj.success:
+            this.$message.success("删除成功");
+            this.getTableData();
+            break;
+          default:
+            this.$message.error("删除失败");
+            break;
+        }
+      });
     },
     // 删除设备服务空间关系
     deleteEqForSpace(pa) {
-      eqForSpaceDelete(pa, res => {
-        this.$message.success('删除成功')
-        this.getTableData()
-      })
+      businessSpaceController.eqForSpaceDelete(pa, (res) => {
+        switch (res.result) {
+          case logicConfig.resultObj.success:
+            this.$message.success("删除成功");
+            this.getTableData();
+            break;
+          default:
+            this.$message.error("删除失败");
+            break;
+        }
+      });
     },
     // 改变pagesize
     handleSizeChange(pageSize) {
@@ -139,37 +202,39 @@ export default {
         cascade: [
           {
             name: this.type.replace(this.type[0], this.type[0].toLowerCase()),
-            cascade: [{ name: 'equipCategory' }]
-          }
+            cascade: [{ name: "equipCategory" }],
+          },
         ],
-        zoneType: this.params.zone
-      }
-      zoneQuery(pa, res => {
+        zoneType: this.params.zone,
+      };
+      ScanController.zoneQuery(pa, (res) => {
         this.loading = false;
-        this.tableData = res.content[0][this.type] || []
-        this.tableData.map(t => {
-          t.spaceId = res.content[0].id
+        this.tableData = res.content[0][this.type] || [];
+        this.tableData.map((t) => {
+          t.spaceId = res.content[0].id;
           return t;
-        })
-      })
+        });
+      });
     },
     // 添加设备
     add() {
       this.$refs.addEqDialog.floor = this.params.buildFloorSelectd;
-      this.$refs.addEqDialog.showDialog()
+      this.$refs.addEqDialog.showDialog();
     },
     changeContentStyle() {
-      this.$route.name == "spaceLedger" ? this.hidden = false : this.hidden = true;
-    }
+      this.$route.name == "spaceLedger"
+        ? (this.hidden = false)
+        : (this.hidden = true);
+    },
   },
   watch: {
     type() {
-      this.getTableData()
+      this.getTableData();
     },
     params() {
-      this.getTableData()
-    }
-  }
+      this.getTableData();
+    },
+  },
 };
 </script>
 <style lang="less" scoped>

+ 106 - 55
src/components/old-adm/business_space/newTables/syInSpaceTable.vue

@@ -1,74 +1,112 @@
 <template>
   <div id="eqInSp">
     <el-row v-show="hidden">
-      <el-button type="primary" @click="add">添加{{inSpaceType}}</el-button>
-      <el-tooltip class="item" effect="dark" :content="`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`" placement="right">
+      <el-button type="primary" @click="add">添加{{ inSpaceType }}</el-button>
+      <el-tooltip
+        class="item"
+        effect="dark"
+        :content="`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`"
+        placement="right"
+      >
         <el-button>按空间计算</el-button>
       </el-tooltip>
     </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">
+      <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.localName||scope.row.name}}
+              {{ scope.row.localName || scope.row.name }}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column
+          prop="localId"
+          :label="`${inSpaceType}本地编码`"
+          show-overflow-tooltip
+          min-width="100"
+        ></el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">
-            <el-tooltip class="item" effect="dark" content="删除关系" placement="left">
-              <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
+            <el-tooltip
+              class="item"
+              effect="dark"
+              content="删除关系"
+              placement="left"
+            >
+              <el-button
+                size="mini"
+                @click="handleDelete(scope.$index, scope.row)"
+                type="danger"
+                plain
+                icon="el-icon-delete"
+              ></el-button>
             </el-tooltip>
           </template>
         </el-table-column>
         <template slot="empty">
-          <div style="height: 60%;transform: translateY(50%);lineHeight:20px;">
+          <div
+            style="height: 60%; transform: translateY(50%); lineheight: 20px"
+          >
             <i class="icon-wushuju iconfont"></i>
-            可前往“全部关系总览”中,按坐标计算{{typeToTips[type]}}
+            可前往“全部关系总览”中,按坐标计算{{ typeToTips[type] }}
           </div>
         </template>
       </el-table>
     </div>
-    <addSystemDialog ref="addSyDialog" :type="type" :spaceId="params.RoomID" :zone="params.zone" @refresh='getTableData'></addSystemDialog>
+    <addSystemDialog
+      ref="addSyDialog"
+      :type="type"
+      :spaceId="params.RoomID"
+      :zone="params.zone"
+      @refresh="getTableData"
+    ></addSystemDialog>
   </div>
 </template>
 
 <script>
-import {
-  zoneQuery,
-  syInSpaceDelete
-} from "@/api/scan/request";
+import ScanController from "@/controller/old-adm/ScanController";
+import { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
+import logicConfig from "@/logicConfig";
 import { mapGetters } from "vuex";
 import addSystemDialog from "@/components/old-adm/business_space/newAddDialogs/addSystemDialog";
 export default {
   components: {
-    addSystemDialog
+    addSystemDialog,
   },
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
   },
   data() {
     return {
-      inSpaceType: '系统',
+      inSpaceType: "系统",
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
       loading: false, // loading
       tableData: [], //列表数据
       typeToTips: {
-        generalSystem: '空间内的系统',
+        generalSystem: "空间内的系统",
       },
       hidden: true,
-      loading: false
+      loading: false,
     };
   },
   props: {
     params: {},
-    type: {}
+    type: {},
   },
   created() {
     this.getTableData();
@@ -78,28 +116,39 @@ export default {
     // 删除关系
     handleDelete(index, row) {
       this.$confirm("确认删除该关系?", "提示", {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        let pa = {
-          data: [{
-            sysId: row.id,
-            spaceId: row.spaceId
-          }],
-          type: this.params.zone
-        }
-        this.deleteSyInSpace(pa)
-      }).catch(() => {
-        this.$message("取消删除")
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
       })
+        .then(() => {
+          let pa = {
+            data: [
+              {
+                sysId: row.id,
+                spaceId: row.spaceId,
+              },
+            ],
+            type: this.params.zone,
+          };
+          this.deleteSyInSpace(pa);
+        })
+        .catch(() => {
+          this.$message("取消删除");
+        });
     },
     // 删除关系
     deleteSyInSpace(pa) {
-      syInSpaceDelete(pa, res => {
-        this.$message.success('删除成功');
-        this.getTableData();
-      })
+      businessSpaceController.syInSpaceDelete(pa, (res) => {
+        switch (res.result) {
+          case logicConfig.resultObj.success:
+            this.$message.success("删除成功");
+            this.getTableData();
+            break;
+          default:
+            this.$message.error("删除失败");
+            break;
+        }
+      });
     },
     // 获取列表数据
     getTableData() {
@@ -107,34 +156,36 @@ export default {
       let pa = {
         Cascade: [{ Name: "generalSystem" }],
         Filters: `id="${this.params.RoomID}"`,
-        ZoneType: this.params.zone
-      }
-      zoneQuery(pa, res => {
+        ZoneType: this.params.zone,
+      };
+      ScanController.zoneQuery(pa, (res) => {
         this.loading = false;
         this.tableData = res.content[0].generalSystem || [];
-        this.tableData.map(t => {
+        this.tableData.map((t) => {
           t.spaceId = res.content[0].id;
           return t;
-        })
-      })
+        });
+      });
     },
     // 添加系统
     add() {
-      this.$refs.addSyDialog.showDialog()
+      this.$refs.addSyDialog.showDialog();
     },
     changeContentStyle() {
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.name == "spaceLedger" ? this.hidden = false : this.hidden = true;
-    }
+      this.$route.name == "spaceLedger"
+        ? (this.hidden = false)
+        : (this.hidden = true);
+    },
   },
   watch: {
     type() {
-      this.getTableData()
+      this.getTableData();
     },
     params() {
-      this.getTableData()
-    }
-  }
+      this.getTableData();
+    },
+  },
 };
 </script>
 <style lang="less" scoped>

+ 0 - 2
src/components/old-adm/common/handsontable.vue

@@ -11,7 +11,6 @@
 <script>
 import Handsontable from "handsontable-pro";
 import "handsontable-pro/dist/handsontable.full.css";
-import zhCN from "handsontable-pro/languages/zh-CN";
 import tools from "@/utils/old-adm/scan/tools";
 import "@/assets/js/chosen.jquery.min";
 import "@/assets/js/handsontable-chosen-editor";
@@ -226,7 +225,6 @@ export default {
       //是否启用了排序
       let isSort = this.hot.getPlugin("columnSorting").isSorted();
       let myHotMainArr = this.hot.getSourceData();
-      // debugger
       if (trimmedArr.length && isSort) {
         let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
         let infos = myHotMainArr[trimmedArr[sortArr[rowArr.row]]];

+ 38 - 28
src/components/old-adm/ledger/components/addDialog/dialogZone.vue

@@ -1,44 +1,49 @@
 <template>
   <!-- Form -->
   <el-dialog title="收货地址" :visible.sync="dialogFormVisible" width="30%">
-    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+    <el-form
+      :model="ruleForm"
+      :rules="rules"
+      ref="ruleForm"
+      label-width="100px"
+      class="demo-ruleForm"
+    >
       <el-form-item label="分区名称" prop="Name">
         <el-input v-model="ruleForm.Name"></el-input>
       </el-form-item>
       <el-form-item label="分区ID" prop="Id">
         <el-input v-model="ruleForm.Id"></el-input>
       </el-form-item>
-      <el-form-item style="float: right;margin-top: 20px">
+      <el-form-item style="float: right; margin-top: 20px">
         <el-button @click="dialogFormVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submitForm('ruleForm')">添 加</el-button>
+        <el-button type="primary" @click="submitForm('ruleForm')"
+          >添 加</el-button
+        >
       </el-form-item>
     </el-form>
   </el-dialog>
 </template>
 
 <script>
-import {
-  zoneCreateType
-} from "@/api/scan/request"
+import logicConfig from "@/logicConfig";
+import ScanController from "@/controller/old-adm/ScanController";
 export default {
   name: "dialogZone",
   data() {
     return {
       dialogFormVisible: false,
       ruleForm: {
-        Name: '',
-        Id: '',
-        ParentId: "OtherZone"
+        Name: "",
+        Id: "",
+        ParentId: "OtherZone",
       },
       rules: {
         Name: [
-          { required: true, message: '请输入分区名称', trigger: 'blur' },
+          { required: true, message: "请输入分区名称", trigger: "blur" },
           // {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
         ],
-        Id: [
-          { required: true, message: '请输入分区ID', trigger: 'blur' },
-        ],
-      }
+        Id: [{ required: true, message: "请输入分区ID", trigger: "blur" }],
+      },
     };
   },
   methods: {
@@ -46,26 +51,31 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           let pa = {
-            Content: [this.ruleForm]
-          }
-          zoneCreateType(pa, res=>{
-            this.$message.success('添加成功')
-            this.dialogFormVisible = false
-            this.ruleForm.Name = ''
-            this.ruleForm.Id = '';
-            this.$emit('createSuccess')
-          })
-
+            Content: [this.ruleForm],
+          };
+          ScanController.zoneCreateType(pa, (res) => {
+            this.dialogFormVisible = false;
+            switch (res.result) {
+              case logicConfig.resultObj.success:
+                this.$message.success("添加成功");
+                this.ruleForm.Name = "";
+                this.ruleForm.Id = "";
+                this.$emit("createSuccess");
+                break;
+              default:
+                this.$message.error("添加失败");
+                break;
+            }
+          });
         } else {
-          console.log('error submit!!');
+          console.log("error submit!!");
           return false;
         }
       });
     },
-  }
-}
+  },
+};
 </script>
 
 <style scoped>
-
 </style>

+ 44 - 34
src/components/old-adm/ledger/components/details/detail/cruxDialog.vue

@@ -1,10 +1,14 @@
 <template>
-  <el-dialog title="关键信息点" :visible.sync="dialogFormVisible" class="crux-dialog">
-    <section v-for="(val,key,i) in checkList" :key="i">
-      <h4 class="base">{{ key == 'undefined' ? '基本信息' : key }}</h4>
+  <el-dialog
+    title="关键信息点"
+    :visible.sync="dialogFormVisible"
+    class="crux-dialog"
+  >
+    <section v-for="(val, key, i) in checkList" :key="i">
+      <h4 class="base">{{ key == "undefined" ? "基本信息" : key }}</h4>
       <el-checkbox
-        v-for="(option,index) in val"
-        :key="option+index"
+        v-for="(option, index) in val"
+        :key="option + index"
         :label="option.InfoPointName"
         v-model="option.KeyWord"
       />
@@ -17,17 +21,18 @@
 </template>
 
 <script>
+import logicConfig from "@/logicConfig";
 import Dic from "@/controller/old-adm/dicController";
 
 export default {
   name: "cruxDialog",
-  props: ['crux', 'type'],
+  props: ["crux", "type"],
   data() {
     return {
       dialogFormVisible: false,
       checkList: {},
-      checkboxGroup: []
-    }
+      checkboxGroup: [],
+    };
   },
   computed: {
     allChecks() {
@@ -39,13 +44,13 @@ export default {
         }
       }
       return tmp;
-    }
+    },
   },
 
   watch: {
     crux() {
-      this.changeList()
-    }
+      this.changeList();
+    },
   },
   methods: {
     changeList() {
@@ -54,7 +59,7 @@ export default {
         if (this.crux.hasOwnProperty(key)) {
           const element = this.crux[key];
           tmp[key] = [
-            ...element.paths.map(i => ({
+            ...element.paths.map((i) => ({
               InfoPointCode: i.InfoPointCode,
               KeyWord: i.KeyWord || false,
               type: i.type,
@@ -62,28 +67,28 @@ export default {
               classCode: i.classCode,
               id: i.id,
               groupCode: i.groupCode,
-              InfoPointName: i.InfoPointName
-            }))
-          ]
+              InfoPointName: i.InfoPointName,
+            })),
+          ];
         }
       }
       this.checkList = tmp;
     },
     dialogOpen() {
-      this.dialogFormVisible = true
+      this.dialogFormVisible = true;
     },
     save() {
-      let arrLenght = this.allChecks.filter(i => i.KeyWord)
+      let arrLenght = this.allChecks.filter((i) => i.KeyWord);
       if (arrLenght.length > 6) {
-        this.$message.info('不可超过6个')
-        return false
+        this.$message.info("不可超过6个");
+        return false;
       } else {
         let param = {
-          content: []
-        }
-        param.content = this.allChecks.map(i => {
+          content: [],
+        };
+        param.content = this.allChecks.map((i) => {
           if (i.InfoPointName) {
-            delete i.InfoPointName
+            delete i.InfoPointName;
           }
           // return { ...i }
           return {
@@ -93,20 +98,25 @@ export default {
             code: i.InfoPointCode,
             classCode: i.classCode,
             id: i.id,
-            groupCode: i.groupCode
+            groupCode: i.groupCode,
+          };
+        });
+        Dic.setDataDictionary(param, (res) => {
+          this.dialogFormVisible = false;
+          switch (res.result) {
+            case logicConfig.resultObj.success:
+              this.$emit("cruxSuccess");
+              this.$message.success("保存成功");
+              break;
+            default:
+              this.$message.error("保存失败");
+              break;
           }
-        })
-        Dic.setDataDictionary(param, res => {
-          this.dialogFormVisible = false
-          this.$emit('cruxSuccess')
-          this.$message.success('保存成功')
-
         });
-
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>
 
 <style scoped lang="less">

+ 0 - 1
src/components/old-adm/ledger/components/lib/cenoteGraphy.vue

@@ -322,7 +322,6 @@ export default {
     },
     // 清除canvas
     clearGraphy() {
-      // debugger
       this.scene = null;
       if (this.view) {
         this.view.scene = null;

+ 1 - 4
src/components/old-adm/ledger/components/lib/floorCascader.vue

@@ -5,12 +5,9 @@
     </div>
 </template>
 <script>
-    import tools from "@/utils/old-adm/scan/tools";
-    // import { buildingQuery } from '@/api/object/build';
     import Builder from "@/controller/old-adm/buildController";
-    // import { floorQuery } from '@/api/object/floor';
     import Floor from "@/controller/old-adm/floorController";
-    import { mapGetters, mapActions } from "vuex";
+    import { mapGetters } from "vuex";
 
     export default {
         props: {

+ 2 - 2
src/components/old-adm/ledger/components/lib/spaceSelect.vue

@@ -14,7 +14,7 @@
 </template>
 
 <script>
-import { queryAllZoneType } from '@/api/scan/request';
+import {businessSpaceController} from '@/controller/old-adm/businessSpaceController'
 import { mapGetters } from 'vuex'
 export default {
   computed: {
@@ -48,7 +48,7 @@ export default {
     getOptionData() {
       let params1 = {}
       //Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]
-      queryAllZoneType(params1, res => {
+      businessSpaceController.queryAllZoneType(params1, res => {
         this.options = res.content;
         if (this.isAll) {
 					this.options.unshift({

+ 21 - 11
src/components/systemGraph/addGraph.vue

@@ -145,6 +145,16 @@ export default {
     },
     //新增按钮事件
     newOkEvent: async function () {
+      if (!this.createGraphName) return Message.warning("请填写系统图名称");
+      if (this.createGraphName.length < 3 || this.createGraphName.length > 15)
+        return Message.warning("系统图名称的长度在3~15个字符之间");
+      if (!this.selProject || !this.selProject.id)
+        return Message.warning("请选择项目");
+      if (!this.selSystemIns || !this.selSystemIns.value)
+        return Message.warning("请选择系统实例");
+      if (!this.selSystemTemplate || !this.selSystemTemplate.value)
+        return Message.warning("请选择系统图模版");
+
       this.fullscreenLoading = true;
       try {
         var _paramObj = {
@@ -168,17 +178,17 @@ export default {
             Message.error("操作失败,原因:" + createResult.message);
             break;
           case logicConfig.resultObj.success:
-            // this.$emit("created", createResult.data);
-            let dataObj = createResult.data;
-            sysGraphController.openGraphPage(
-              1,
-              dataObj.id,
-              this.selProject.groupCode,
-              this.selProject.id,
-              this.selProject.name,
-              window.__systemConf.baseRouteUrl,
-              false
-            );
+            this.$emit("graphCreated", createResult.data);
+            // let dataObj = createResult.data;
+            // sysGraphController.openGraphPage(
+            //   1,
+            //   dataObj.id,
+            //   this.selProject.groupCode,
+            //   this.selProject.id,
+            //   this.selProject.name,
+            //   window.__systemConf.baseRouteUrl,
+            //   false
+            // );
             break;
         }
       } catch (error) {

+ 63 - 7
src/components/systemGraph/edit.vue

@@ -201,7 +201,13 @@
           >
             <div
               class="title titleMargin"
-              v-text="_index == 0 ? '起点' :_index ==selLine.path.length-1?  '终点':'拐点'+_index"
+              v-text="
+                _index == 0
+                  ? '起点'
+                  : _index == selLine.path.length - 1
+                  ? '终点'
+                  : '拐点' + _index
+              "
             >
               起点
             </div>
@@ -350,7 +356,11 @@
         >
           删除设备
         </div>
-        <div class="delBtn" v-if="selGraphPartType == 2 && operState == 1">
+        <div
+          class="delBtn"
+          v-if="selGraphPartType == 2 && operState == 1"
+          @click="delLine"
+        >
           删除管线
         </div>
         <div
@@ -363,7 +373,11 @@
       </div>
     </div>
 
-    <addGraph :isVisible="operState == 2" v-if="operState == 2"></addGraph>
+    <addGraph
+      :isVisible="operState == 2"
+      v-if="operState == 2"
+      @graphCreated="createSuccessed"
+    ></addGraph>
   </div>
 </template>
 <script>
@@ -375,7 +389,7 @@ import { logicConfig } from "@/logicConfig";
 import { Message } from "element-ui";
 import Vue from "vue";
 import vueStore from "@/store";
-
+import { mapState } from "vuex";
 export default {
   props: [],
   data() {
@@ -536,7 +550,9 @@ export default {
       isEditGraphName: false,
     };
   },
-  computed: {},
+  computed: {
+    ...mapState(["projects"]),
+  },
   methods: {
     /**
      * 新建成功后执行的操作
@@ -547,7 +563,21 @@ export default {
       this.operState = 1;
       this.graphOriginInfo = JSON.parse(JSON.stringify(graphInfo));
       this.graphInfo = graphInfo;
+      this.diagramId = graphInfo.id;
       this.$refs.graphc.drawEntry(graphInfo);
+
+      for (let i = 0; i < this.projects.length; i++) {
+        let currProject = this.projects[i];
+        if (currProject.id == graphInfo.projectId) {
+          this.project = {
+            id: currProject.id,
+            name: currProject.name,
+            groupCode: currProject.groupCode,
+          };
+          vueStore.commit("updateSelectProject", this.project);
+          break;
+        }
+      }
     },
     //线的起点选择事件
     selStartPointChange: function () {
@@ -850,6 +880,11 @@ export default {
       this.$refs.graphc.updateDataAndGraph(1, 1, { id: this.selEquip.id });
       this.updateGraphInfo(1, 1, { id: this.selEquip.id });
     },
+    //删除选择的线
+    delLine: function () {
+      this.$refs.graphc.updateDataAndGraph(2, 8, { id: this.selLine.id });
+      this.updateGraphInfo(2, 8, { id: this.selLine.id });
+    },
     //graphInfo中移出对应的数据
     removeFromData: function (id) {
       this.graphInfo.template.frame.children = remove(
@@ -878,12 +913,33 @@ export default {
     /**
      * 更新graphInfo中的数据
      * dataType 1 设备;  2 线;  3 文本
-     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点;  6 修改文本位置;  7 修改文本内容
+     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点;  6 修改文本位置;  7 修改文本内容; 8删除线
      * exprObj 扩展数据,支持:{id:'数据id',text:{xChange:1 新的绝对坐标减去旧的绝对坐标得出的值 ,yChange:1 新的绝对坐标减去旧的绝对坐标得出的值,content:'文本内容'}}
      */
     updateGraphInfo: function (dataType, operType, exprObj) {
       var _this = this;
-      _each(this.graphInfo.template.frame.children);
+      switch (dataType) {
+        case 2:
+          operLine();
+          break;
+        default:
+          _each(this.graphInfo.template.frame.children);
+          break;
+      }
+
+      function operLine() {
+        var arr = _this.graphInfo.lines;
+        for (let i = 0; i < arr.length; i++) {
+          if (arr[i].id == exprObj.id) {
+            switch (operType) {
+              case 8:
+                arr.splice(i, 1);
+                break;
+            }
+            break;
+          }
+        }
+      }
 
       function _each(dataArr) {
         for (let i = 0; i < dataArr.length; i++) {

+ 2 - 6
src/components/systemGraph/graph.vue

@@ -639,14 +639,9 @@ export default {
       );
     },
     /**
-     * 从舞台上移出元素:图例、线、文本
-     * id 数据ID,即元素的name
-     * type 1 设备;  2 线;  3 文本
-     */
-    /**
      * 更新graphInfo中的数据
      * dataType 1 设备;  2 线;  3 文本
-     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点  6 修改文本位置;  7 修改文本内容
+     * operType 1 移除设备节点;  2 更新文本字体大小;  3 更新文本颜色;  4 更新文本背景色;  5 移除文本节点  6 修改文本位置;  7 修改文本内容;   8删除线
      * exprObj 扩展数据,支持:{id:'数据id',fontSize:'字体大小',fontColor:'文本颜色',fontBackColor:'文本背景色',text:{xChange:1 新的绝对坐标减去旧的绝对坐标得出的值 ,yChange:1 新的绝对坐标减去旧的绝对坐标得出的值,content:'文本内容'}}
      */
     updateDataAndGraph: function (dataType, operType, exprObj) {
@@ -666,6 +661,7 @@ export default {
           switch (operType) {
             case 1:
             case 5:
+            case 8:
               dataArr.splice(i, 1);
               this.pixiApp.stage.removeChild(stageChild);
               break;

+ 68 - 7
src/controller/old-adm/ScanController.ts

@@ -8,6 +8,7 @@ import {
   graphhic_pre,
   object_pre,
   rwd_pre,
+  zone
 } from "./preTypes";
 import { middlewareHttpUtils } from "@/utils/http/middlewareHttpUtils";
 class ScanController {
@@ -168,10 +169,9 @@ class ScanController {
   @return {*}
   */
   static async buildingQuery(params) {
-    return await ScanController.http.postRequest(
-      object_pre + "/building/query",
-      params
-    );
+    var result = await ScanController.http.postRequest(object_pre + "/building/query", params);
+    result.content = result.content || result.data;
+    return result;
   }
   /**
   @description: 关系-竖井所在建筑
@@ -295,8 +295,7 @@ class ScanController {
     );
     return fn ? fn(res) : res;
   }
-  static async zoneQuery() {}
-  static async TypePartsDie() {}
+  static async TypePartsDie() { }
   /**
    * 下载报告-查询key值
    * @param params
@@ -331,7 +330,7 @@ class ScanController {
   static async queryUpdate(params) {
     return await this.http.postRequest(equipquery_pre + "/update", params);
   }
-  static async equipLinkSys() {}
+  static async equipLinkSys() { }
   /**
    * 查询建筑信息+count
    */
@@ -437,6 +436,68 @@ class ScanController {
   static async updateProjectInfo(params) {
     return await this.http.postRequest(object_pre + "/project/update", params);
   }
+
+  //修改业务空间对象和建筑楼层的关系
+  static async handleZoneUpdateBd(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/update-fl-bd', param);
+    success(result);
+  }
+
+  //创建空间分区对象
+  static async zoneCreate(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/create', param);
+    success(result);
+  }
+
+  //跟据id删除分区对象
+  static async zoneDelete(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/delete', param);
+    success(result);
+  }
+
+  //查询分区对象信息
+  static async zoneQuery(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/query', param);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //更新分区对象信息
+  static async zoneUpdate(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/update', param);
+    success(result);
+  }
+
+  //创建空间分类型
+  static async zoneCreateType(param, success) {
+    let result = await this.middlewareHttp.postRequest('/object/zone/create-type', param);
+    success(result);
+  }
+
+  //查询分区信息
+  static async queryZone(param, success) {
+    let data = param.data
+    let url = `/object/${zone[param.zone]}/query`;
+    var result = await this.middlewareHttp.postRequest(url, data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //查询分区对象轮廓线
+  static async zoneQueryOutline(param, success) {
+    let url = `/object/zone/query-outline`
+    let result = await this.middlewareHttp.postRequest(url, param);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //更新分区对象轮廓线
+  static async zoneUpdateOutline(param, success) {
+    let url = `/object//zone/update-outline`
+    let result = await this.middlewareHttp.postRequest(url, param);
+    success(result);
+  }
+
 }
 
 export default ScanController;

+ 3 - 1
src/controller/old-adm/buildController.ts

@@ -18,7 +18,9 @@ class BuildController {
    * @returns
    */
   static async buildingQuery(params: BuildReq) {
-    return await this.http.postRequest(this.pre + "/building/query", params);
+    var result = await this.http.postRequest(this.pre + "/building/query", params);
+    result.content = result.content || result.data;
+    return result;
   }
   /**
    * @description: 处理楼层接口数据为树状结构

+ 124 - 3
src/controller/old-adm/businessSpaceController.ts

@@ -6,7 +6,7 @@ export class businessSpaceController {
   //项目关系类型查询
   static async getrelationTypeProject(param, call) {
     var result = await this.middlewareHttpUtilsInstance.postRequest('/graphic/relation_type_project', param);
-    result.content = result.data || [];
+    result.content = result.content || result.data;
     call(result);
 
     // let url = '/datacenter/graphic/relation_type_project';
@@ -16,6 +16,7 @@ export class businessSpaceController {
   //关系-----统计 属于多建筑楼层的空间
   static async getSpaceBdFlCount(param, call) {
     var result = await this.middlewareHttpUtilsInstance.postRequest('/space/space-bd-fl', param);
+    result.content = result.content || result.data;
     call(result);
     // let url = '/equip-component/space/space-bd-fl';
     // http.postJson(url, param, success)
@@ -24,7 +25,7 @@ export class businessSpaceController {
   // 查询业务空间分区类型包含其他
   static async queryAllZoneType(param, call) {
     var result = await this.middlewareHttpUtilsInstance.postRequest('/object/zone/type', param);
-    result.content = result.data || [];
+    result.content = result.content || result.data;
     call(result);
     // let url = '/datacenter/object/zone/type';
     // http.postJson(url, param, success)
@@ -33,7 +34,7 @@ export class businessSpaceController {
   // 查询建筑楼层-统计业务空间state
   static async queryBFloorWithState(param, call) {
     var result = await this.middlewareHttpUtilsInstance.postRequest('/object/zone/building-floor', param);
-    result.content = result.data || [];
+    result.content = result.content || result.data;
     call(result);
     // let url = '/datacenter/object/zone/building-floor';
     // http.postJson(url, param, success)
@@ -42,9 +43,129 @@ export class businessSpaceController {
   //查询分区对象信息
   static async zoneCount(param, call) {
     var result = await this.middlewareHttpUtilsInstance.postRequest('/object/zone/count', param);
+    result.content = result.content || result.data;
     call(result);
     // let url = '/datacenter/object/zone/count'
     // http.postJson(url, param, success)
   }
 
+  //关系-----业务空间内的元空间,业务空间一对多,累计添加会覆盖以前记录
+  static async createRelateInZoneAndISp(param, success) {
+    var result = await this.middlewareHttpUtilsInstance.postRequest('/rel/si-in-sp-base/link-sp?type=' + param.type, param.data);
+    success(result);
+  }
+
+  //关系-----未关联业务空间的元空间
+  static async getIspNotInSpace(param, success) {
+    var result = await this.middlewareHttpUtilsInstance.postRequest(`/space/unspace-ispace?objectType=${param.objectType}`, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----业务空间内的元空间,创建业务空间内的元空间关系, 累计添加不会覆盖-批量关联
+  static async groupCreRelaZoneAndISp(param, success) {
+    let url = `/rel/si-in-sp-base/link-list?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----统计 属于多建筑楼层的空间数据
+  static async getSpaceBdFlData(param, success) {
+    let url = `/space/space-bd-fl-data`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----业务空间所属建筑楼层修改
+  static async updateRelateInSpAndBuild(param, success) {
+    let url = `/update-relationship/update-sp`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----设备所在业务空间--删除关系
+  static async eqInSpaceDelete(param, success) {
+    let url = `/rel/eq-in-sp-base/unlink-list?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
+  //关系-----设备服务业务空间--删除关系
+  static async eqForSpaceDelete(param, success) {
+    let url = `/rel/eq-for-sp-base/unlink-list?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
+  //关系-----没有和当前空间绑定的设备
+  static async notEqInSpaceQuery(param, success) {
+    let url = `/space/unspace-in-eq?type=${param.type}&spaceId=${param.spaceId}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----未服务当前空间的设备
+  static async notEqForSpaceQuery(param, success) {
+    let url = `/space/unspace-for-eq?type=${param.type}&spaceId=${param.spaceId}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----设备所在业务空间--创建关系
+  static async eqInSpaceCreate(param, success) {
+    let url = `/rel/eq-in-sp-base/link-eq-sp?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
+  //关系-----设备服务业务空间--创建关系
+  static async eqForSpaceCreate(param, success) {
+    let url = `/rel/eq-for-sp-base/link-eq-sp?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
+  //关系-----空间内没有和空间关联的设备 根据坐标计算(专用接口)
+  static async getEqNotInSpace(param, success) {
+    let url = `/space/unspace-fIn-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----空间内没有服务空间的设备 根据坐标计算(专用接口)
+  static async getEqNotForSpace(param, success) {
+    let url = `/space/unspace-for-eq-point?spaceId=${param.spaceId}&type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----系统所在业务空间--删除关系
+  static async syInSpaceDelete(param, success) {
+    let url = `/rel/sy-in-sp-base/unlink-list?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
+  //关系-----没有和当前空间绑定的系统
+  static async notSyInSpaceQuery(param, success) {
+    let url = `/space/unspace-in-sys?type=${param.type}&spaceId=${param.spaceId}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    result.content = result.content || result.data;
+    success(result);
+  }
+
+  //关系-----系统所在业务空间--创建关系
+  static async syInSpaceCreate(param, success) {
+    let url = `/rel/sy-in-sp-base/link-sp-sys?type=${param.type}`;
+    var result = await this.middlewareHttpUtilsInstance.postRequest(url, param.data);
+    success(result);
+  }
+
 }

+ 2 - 0
src/controller/old-adm/dicController.ts

@@ -10,6 +10,7 @@ class Dic {
    */
   static async getDataDictionary(params, fn) {
     const res = await Dic.http.postRequest(`${dict_pre}/query`, params);
+    res.content = res.content || res.data;
     return fn ? fn(res) : res;
   }
 
@@ -23,6 +24,7 @@ class Dic {
       dict_pre + "/delivered/infos",
       params
     );
+    res.content = res.content || res.data;
     return fn ? fn(res) : res;
   }
   /**

+ 3 - 1
src/controller/old-adm/floorController.ts

@@ -15,7 +15,9 @@ class FloorController {
    * @returns
    */
   static async floorQuery(params: QueryReq) {
-    return this.http.postRequest("/object/floor/query", params);
+    let result = await this.http.postRequest("/object/floor/query", params);
+    result.content = result.content || result.data;
+    return result;
   }
   /**
    * 建筑楼层管理-创建楼层

+ 16 - 0
src/controller/old-adm/preTypes.ts

@@ -12,3 +12,19 @@ export const graphhic_pre = `${datacenter_pre}/graphic`;
 export const floor_pre = `${object_pre}/floor`;
 
 export const model_pre = "/revit-algorithm";
+
+export const zone = {
+    GeneralZone: 'zone-general', //默认分区
+    PowerSupplyZone: 'zone-power-supply', //供电分区
+    LightingZone: 'zone-lighting', //照明分区
+    AirConditioningZone: 'metaspace', //空调分区
+    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', //安防分区
+    Ispace: 'ispace', //元空间
+  }

+ 62 - 57
src/controller/systemGraph/sysGraphController.ts

@@ -228,6 +228,7 @@ export class sysGraphController {
             loadResultObj.message = '加载模板数据失败:' + loadResultObj.message;
             return loadResultObj;
         }
+        loadResultObj.data = await this.parseSystemGraphInfo(loadResultObj.data, _paramObj.groupCode, _paramObj.projectId);
 
         // //加载数据成功后保存数据
         // var saveResultObj = await this.saveSysGraph(loadResultObj.data, _paramObj.projectId, _paramObj.groupCode);
@@ -243,19 +244,74 @@ export class sysGraphController {
      * 加载数据
      * @param _paramObj {projectId:'项目id',groupCode:'集团编码',id:'系统图ID'}
      */
-     static async loadData(_paramObj: any) {
+    static async loadData(_paramObj: any) {
         var loadDataUrl = '/diagram/loadData?groupCode=' + _paramObj.groupCode + '&projectId=' + _paramObj.projectId;
         var loadResultObj = await this.sysGraphHttpUtilsInstance.postRequest(loadDataUrl, { id: _paramObj.id });
         return loadResultObj;
     }
 
     /**
+     * 解析系统图数据
+     * @param dataObj 
+     */
+    static async parseSystemGraphInfo(dataObj: any, groupCode: string, projectId: string) {
+        //取得专业>系统类型>系统实例  以和系统图列表中的系统类型编码 对应以获取系统实例名称
+        if (this.zhuanyeArr.length == 0) {
+            var url2 = '/diagram/major/system/instance?groupCode=' + groupCode + '&projectId=' + projectId;
+            var zhuanyeObj = await this.sysGraphHttpUtilsInstance.postRequest(url2, {});
+            this.zhuanyeArr = zhuanyeObj.data || [];
+        }
+
+        //获取系统实例名称
+        var _systemInstance = getSystemInstanceByCode(dataObj.systemId);
+        dataObj.systemInstanceName = _systemInstance.name || '';
+
+
+        //获取系统图类型和系统图模版
+        var _temoObj = await this.getTemplateGraphTypeBySysTypeCode(dataObj.system, dataObj.templateId);
+        dataObj.graphTypeName = ((_temoObj || {}).graphType || {}).name;
+        dataObj.templateName = ((_temoObj || {}).template || {}).name;
+
+        //状态名称
+        dataObj.stateName = this.getStateNameByCode((dataObj.extraProps || {}).state);
+
+
+        return dataObj;
+
+        //获取系统实例信息
+        function getSystemInstanceByCode(systemInstanceId: string) {
+            for (let i = 0; i < sysGraphController.zhuanyeArr.length; i++) {
+                //专业
+                let zhuanye = sysGraphController.zhuanyeArr[i];
+                //系统类型数组
+                let systemTypeArr = zhuanye.children || [];
+                let isFind = false;
+                for (let j = 0; j < systemTypeArr.length; j++) {
+                    //系统类型
+                    let systemType = systemTypeArr[j];
+                    //系统实例数组
+                    let systemInstanceArr = systemType.children || [];
+                    for (let k = 0; k < systemInstanceArr.length; k++) {
+                        //系统实例
+                        let systemInstance = systemInstanceArr[k];
+                        if (systemInstance.id == systemInstanceId)
+                            return systemInstance;
+                    }
+                }
+                if (isFind)
+                    break;
+            }
+        };
+    };
+
+    /**
      * 重置数据
      * @param _paramObj {projectId:'项目id',groupCode:'集团编码',id:'系统图ID'}
      */
-     static async resetData(_paramObj: any) {
+    static async resetData(_paramObj: any) {
         var loadDataUrl = '/diagram/reset?groupCode=' + _paramObj.groupCode + '&projectId=' + _paramObj.projectId;
         var loadResultObj = await this.sysGraphHttpUtilsInstance.postRequest(loadDataUrl, { id: _paramObj.id });
+        loadResultObj.data = await this.parseSystemGraphInfo(loadResultObj.data, _paramObj.groupCode, _paramObj.projectId);
         return loadResultObj;
     }
 
@@ -292,61 +348,10 @@ export class sysGraphController {
         //   resultObj.data.lines=tempData.lines;
         //   resultObj.data.template=tempData.template;
 
-//#regionend -------------------------------------------------------------------------------测试结束
-
-
-        var dataObj = resultObj.data || {};
-        if (!dataObj.id)
-            return { result: logicConfig.resultObj.failure, message: '缺少系统图ID' };
-
-
-        //取得专业>系统类型>系统实例  以和系统图列表中的系统类型编码 对应以获取系统实例名称
-        if (this.zhuanyeArr.length == 0) {
-            var url2 = '/diagram/major/system/instance?groupCode=' + groupCode + '&projectId=' + projectId;
-            var zhuanyeObj = await this.sysGraphHttpUtilsInstance.postRequest(url2, {});
-            this.zhuanyeArr = zhuanyeObj.data || [];
-        }
-
-        //获取系统实例名称
-        var _systemInstance = getSystemInstanceByCode(resultObj.data.systemId);
-        resultObj.data.systemInstanceName = _systemInstance.name || '';
-
-
-        //获取系统图类型和系统图模版
-        var _temoObj = await this.getTemplateGraphTypeBySysTypeCode(resultObj.data.system, resultObj.data.templateId);
-        resultObj.data.graphTypeName = ((_temoObj || {}).graphType || {}).name;
-        resultObj.data.templateName = ((_temoObj || {}).template || {}).name;
-
-        //状态名称
-        resultObj.data.stateName = this.getStateNameByCode((resultObj.data.extraProps || {}).state);
-
+        //#regionend -------------------------------------------------------------------------------测试结束
 
+        resultObj.data = await this.parseSystemGraphInfo(resultObj.data, groupCode, projectId);
         return resultObj;
-
-        //获取系统实例信息
-        function getSystemInstanceByCode(systemInstanceId: string) {
-            for (let i = 0; i < sysGraphController.zhuanyeArr.length; i++) {
-                //专业
-                let zhuanye = sysGraphController.zhuanyeArr[i];
-                //系统类型数组
-                let systemTypeArr = zhuanye.children || [];
-                let isFind = false;
-                for (let j = 0; j < systemTypeArr.length; j++) {
-                    //系统类型
-                    let systemType = systemTypeArr[j];
-                    //系统实例数组
-                    let systemInstanceArr = systemType.children || [];
-                    for (let k = 0; k < systemInstanceArr.length; k++) {
-                        //系统实例
-                        let systemInstance = systemInstanceArr[k];
-                        if (systemInstance.id == systemInstanceId)
-                            return systemInstance;
-                    }
-                }
-                if (isFind)
-                    break;
-            }
-        };
     }
 
 
@@ -415,8 +420,8 @@ export class sysGraphController {
     * 保存系统图名称
     * @_paramObj {id:'系统图ID',name:'系统图名称'}
     */
-     static async saveGraphName(_paramObj: any) {
-         var url = '/diagram/update/name';
+    static async saveGraphName(_paramObj: any) {
+        var url = '/diagram/update/name';
         var resultObj = await this.sysGraphHttpUtilsInstance.postRequest(url, _paramObj);
         return resultObj;
     }

+ 23 - 0
src/router/system.js

@@ -17,6 +17,14 @@ import batchPointAssets from '@/components/old-adm/ledger/facility/batchPoint' /
 import buildFloor from '@/components/old-adm/ready/buildfloor/index'
 import repetitionGraphy from '@/components/old-adm/ready/buildfloor/repetitionGraphy'
 
+//-----------------业务空间台账
+//业务空间台账首页
+import businessSpaceLedger from '@/components/old-adm/businessSpaceLedger'
+//业务空间详情
+import businessSpaceDetail  from '@/components/old-adm/businessSpaceLedger/spaceDetail'
+//添加业务空间
+import businessSpaceAdd  from '@/components/old-adm/businessSpaceLedger/spaceadd'
+
 
 // 全部关系总览
 import overView from '@/components/old-adm/relation/overview'
@@ -134,6 +142,21 @@ export default [
         name: "编辑关系",
         component: relationShip,
       },
+      {
+        path: '/ledger/spacelist',
+        name: '业务空间台账',
+        component: businessSpaceLedger,
+      },
+      {
+        path: '/ledger/spaceDetail',
+        name: '业务空间台账详情',
+        component: businessSpaceDetail,
+      },
+      {
+        path: '/ledger/spaceadd',
+        name: '添加业务空间',
+        component: businessSpaceAdd,
+      },
     ],
   },
   {

+ 94 - 142
src/utils/old-adm/handsontable/buildFloorData.js

@@ -1,146 +1,98 @@
-// import { buildingQuery } from '@/api/object/build';
-// import { floorQuery } from '@/api/object/floor';
-// import BuildController from '@/controlls/buildController'
+import ScanController from "@/controller/old-adm/ScanController";
+import FloorController from "@/controller/old-adm/floorController";
 
-// const buildFloor = {
-//   getData: function (buildFloorData) {
-//     let data, buildParams = {
-//         pageNumber: 1,
-//         pageSize: 1000,
-//         orders: "localName asc",
-//         projection: [
-//             "id",
-//             "localName"
-//         ]
-//     }, floorParams = {
-//         orders: "floorSequenceID desc",
-//         pageNumber: 1,
-//         pageSize: 1000,
-//         projection: [
-//             "buildingId",
-//             "id",
-//             "localName",
-//             "floorSequenceID"
-//         ]
-//     }
+const buildFloor = {
+    getData: function (buildFloorData) {
+        let data, buildParams = {
+            pageNumber: 1,
+            pageSize: 1000,
+            orders: "localName asc",
+            projection: [
+                "id",
+                "localName"
+            ]
+        }, floorParams = {
+            orders: "floorSequenceID desc",
+            pageNumber: 1,
+            pageSize: 1000,
+            projection: [
+                "buildingId",
+                "id",
+                "localName",
+                "floorSequenceID"
+            ]
+        }
 
-//     let promise1 = new Promise((resolve, reject) => {
-//       buildingQuery(buildParams, res => {
-//         resolve(res)
-//       })
-//     })
-//     let promise2 = new Promise((resolve, reject) => {
-//       floorQuery(floorParams, res => {
-//         resolve(res)
-//       })
-//     })
+        let promise1 = new Promise((resolve, reject) => {
+            (async function () {
+                var res = await ScanController.buildingQuery(buildParams);
+                resolve(res);
+            })();
+        })
+        let promise2 = new Promise((resolve, reject) => {
+            (async function () {
+                var res = await FloorController.floorQuery(floorParams);
+                resolve(res);
+            })();
+        })
 
-//     Promise.all([promise1, promise2]).then(function(values) {
-//       let builData = values[0].content, floorData = values[1].content
-//       data = builData.map(build => {
-//           return {
-//               value: build.id,
-//               label: build.localName
-//           }
-//       })
-//       data.unshift({
-//         value: "",
-//         label: "未明确建筑"
-//       })
-//       data.forEach(build => {
-//         floorData.forEach(floor => {
-//           if (build.value == floor.buildingId && floor.id && floor.localName) {
-//             if (build.children) {
-//               build.children.push({
-//                 value: floor.id,
-//                 label: floor.localName
-//               })
-//             } else {
-//               build.children = []
-//               build.children.push({
-//                 value: "",
-//                 label: "未明确楼层"
-//               },{
-//                 value: floor.id,
-//                 label: floor.localName 
-//               })
-//             }
-//           }
-//         })
-//       })
-//       data.forEach(item => {
-//         if (item.children && item.children.length) {
-//           item.children.forEach(child => {
-//             if (child.value != "") {
-//               buildFloorData.push({
-//                 Code: item.value + "-" + child.value,
-//                 Name: item.label + "-" + child.label
-//               })
-//             } else {
-//               buildFloorData.push({
-//                 Code: item.value,
-//                 Name: item.label + "-" + child.label
-//               })
-//             }
-//           })
-//         } else {
-//           buildFloorData.push({
-//             Code: item.value,
-//             Name: item.label
-//           })
-//         }
-//       })
-//     })
-//     // buildingQuery(buildParams, res => {
-//     //   let builData = res.Content
-//     //   data = builData.map(build => {
-//     //       return {
-//     //           value: build.BuildID,
-//     //           label: build.BuildLocalName
-//     //       }
-//     //   })
-//     //   data.unshift({
-//     //     value: "",
-//     //     label: "未明确建筑的设备"
-//     //   })
-//     //   floorQuery(floorParams, res => {
-//     //       let floorData = res.Content
-//     //       data.forEach(build => {
-//     //           floorData.forEach(floor => {
-//     //               if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName) {
-//     //                   if (build.children) {
-//     //                       build.children.push({
-//     //                           value: floor.FloorID,
-//     //                           label: floor.FloorLocalName
-//     //                       })
-//     //                   } else {
-//     //                       build.children = []
-//     //                       build.children.push({
-//     //                           value: "",
-//     //                           label: "未明确楼层的设备"
-//     //                       })
-//     //                   }
-//     //               }
-//     //           })
-//     //       })
-//     //       data.forEach(item => {
-//     //         if (item.children && item.children.length) {
-//     //           item.children.forEach(child => {
-//     //             buildFloorData.push({
-//     //               Code: item.value + "-" + child.value,
-//     //               Name: item.label + "-" + child.label
-//     //             })
-//     //           })
-//     //         } else {
-//     //           buildFloorData.push({
-//     //             Code: item.value,
-//     //             Name: item.label
-//     //           })
-//     //         }
-//     //       })
-//     //   })
-//     // })
-//   }
-// }
+        Promise.all([promise1, promise2]).then(function (values) {
+            let builData = values[0].content, floorData = values[1].content
+            data = builData.map(build => {
+                return {
+                    value: build.id,
+                    label: build.localName
+                }
+            })
+            data.unshift({
+                value: "",
+                label: "未明确建筑"
+            })
+            data.forEach(build => {
+                floorData.forEach(floor => {
+                    if (build.value == floor.buildingId && floor.id && floor.localName) {
+                        if (build.children) {
+                            build.children.push({
+                                value: floor.id,
+                                label: floor.localName
+                            })
+                        } else {
+                            build.children = []
+                            build.children.push({
+                                value: "",
+                                label: "未明确楼层"
+                            }, {
+                                value: floor.id,
+                                label: floor.localName
+                            })
+                        }
+                    }
+                })
+            })
+            data.forEach(item => {
+                if (item.children && item.children.length) {
+                    item.children.forEach(child => {
+                        if (child.value != "") {
+                            buildFloorData.push({
+                                Code: item.value + "-" + child.value,
+                                Name: item.label + "-" + child.label
+                            })
+                        } else {
+                            buildFloorData.push({
+                                Code: item.value,
+                                Name: item.label + "-" + child.label
+                            })
+                        }
+                    })
+                } else {
+                    buildFloorData.push({
+                        Code: item.value,
+                        Name: item.label
+                    })
+                }
+            })
+        })
+    }
+}
 
-// export default buildFloor
+export default buildFloor

+ 1 - 2
src/utils/old-adm/scan/tools.js

@@ -1,5 +1,4 @@
 import Handsontable from "handsontable-pro"
-import localMenusList from '@/data/old-adm/menus'
 
 const tools = {}
 
@@ -692,7 +691,7 @@ tools.formatMenu = (originaMenuList) => {
   var newMenuList = [];
   var tempNewMenuList = [];
   var menuNameList = [];
-  var _localMenusList = JSON.parse(JSON.stringify(localMenusList));
+  var _localMenusList = JSON.parse(JSON.stringify([]));
   (originaMenuList || []).forEach(originaMenu => {
     for (var i = 0; i < _localMenusList.length; i++) {
       var localMenu = _localMenusList[i];

+ 10 - 0
src/utils/old-adm/spaceColor.js

@@ -0,0 +1,10 @@
+export const colorArr = [
+  "#fed44c",
+  "#3485d6",
+  "#a384fc",
+  "#4caf50",
+  "#ff6316",
+  "#fd8bbe",
+  "#03a9f3",
+  "#ea615b"
+];

+ 1 - 0
vue.config.js

@@ -93,6 +93,7 @@ module.exports = {
   //     .end();
   // },
   configureWebpack: {
+    devtool: '#source-map',
     resolve: {
       alias: {
         'vue$': 'vue/dist/vue.esm.js',