Explorar el Código

修改老功能块的部分跳转方式

niuheng hace 2 años
padre
commit
e2b17b512c

+ 218 - 133
src/components/old-adm/businessSpaceLedger/index.vue

@@ -4,61 +4,119 @@
 <template>
   <div id="businessSpace">
     <!-- 空间属于多个建筑楼层 -->
-    <roomInFloorDialog ref="roomInFloorDialog" @relaSuc="relaSuc"></roomInFloorDialog>
+    <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">
+        <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>
+              <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">
+        <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-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-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 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-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>
+                <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 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
+          @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>
+      <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>
+    <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>
@@ -68,7 +126,7 @@
 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 { businessSpaceController } from "@/controller/old-adm/businessSpaceController";
 
 import floorCascader from "@/components/old-adm/ledger/components/lib/floorCascader";
 import { mapGetters } from "vuex";
@@ -81,14 +139,14 @@ export default {
     floorCascader,
   },
   computed: {
-    ...mapGetters('layout', ['projectId', 'userId', 'secret']),
+    ...mapGetters("layout", ["projectId", "userId", "secret"]),
     repeatTextTips() {
-      let str = `当前楼层与${this.repeatFloor.join('、')}关联同一个平面图`
+      let str = `当前楼层与${this.repeatFloor.join("、")}关联同一个平面图`;
       if (!this.handled) {
-        str += `,请通过「建筑楼层管理」页面处理`
+        str += `,请通过「建筑楼层管理」页面处理`;
       }
-      return str
-    }
+      return str;
+    },
   },
   data() {
     return {
@@ -96,12 +154,12 @@ export default {
         influence: false, //受影响的业务空间弹窗
         details: false, //详情弹窗
         notRelated: false,
-        facility: false
+        facility: false,
       },
       param: {
         ProjId: this.projectId, //项目id
         UserId: this.userId, //用户id
-        secret: this.secret
+        secret: this.secret,
       },
       buildMess: {
         name: "--",
@@ -110,27 +168,27 @@ export default {
         map: "",
         isChild: true,
         buildName: "--",
-        buildCode: ""
+        buildCode: "",
       },
       isMyTab: 1,
       activeName: "0",
       tabsList: [],
       activeTabType: {
-        "code": "GeneralZone",
-        "name": "默认分区",
-        "rel_type": "99"
+        code: "GeneralZone",
+        name: "默认分区",
+        rel_type: "99",
       },
       options: [], //建筑楼层级联下拉
       floorToMap: {}, //楼层及其对应的模型图
       FloorMap: "", //当前选中的楼层对象
-      zoneItemID: '',
-      buildFloorSelectd: [''], //当前所选的建筑楼层
+      zoneItemID: "",
+      buildFloorSelectd: [""], //当前所选的建筑楼层
       childBackParam: {},
       needCalculate: false, // 关系是否需要计算
       mutiCount: 0,
       infectedTotal: 0,
       infectedCurfloor: 0,
-      otherType: '',
+      otherType: "",
       tabsListLoadOver: false,
       isGetType: true, // 防止请求图时 分区类型还没有请求回来
       repeatFloor: [], // 与当前楼层重复的其他楼层
@@ -139,29 +197,28 @@ export default {
     };
   },
   created() {
-    this.getRelations()
+    this.getRelations();
     this.childBackParam = this.$route.params;
   },
-  mounted() {
-  },
+  mounted() {},
   methods: {
     // 初始化
     init() {
-      this.getTypes()
-      this.getBuilding()
-      this.getMutiCount()
+      this.getTypes();
+      this.getBuilding();
+      this.getMutiCount();
       this.getInfected();
     },
     // 获取项目下建筑
     getBuilding() {
-      businessSpaceController.queryBFloorWithState({}, res => {
+      businessSpaceController.queryBFloorWithState({}, (res) => {
         this.modelIdToFloor = {};
-        this.options = res.content.map(t => {
+        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 => {
+            t.children = t.floor.map((item) => {
               item.value = item.id;
               item.label = item.localName || item.name;
               item.buildName = t.localName || t.name;
@@ -173,177 +230,197 @@ export default {
                 if (this.modelIdToFloor[item.modelId]) {
                   this.modelIdToFloor[item.modelId].push(item);
                 } else {
-                  this.modelIdToFloor[item.modelId] = [item]
+                  this.modelIdToFloor[item.modelId] = [item];
                 }
               }
               return item;
-            })
-            t.children.unshift({ value: "all", label: "全部" }, { value: 'noKnow', label: "未明确楼层" })
+            });
+            t.children.unshift(
+              { value: "all", label: "全部" },
+              { value: "noKnow", label: "未明确楼层" }
+            );
           } else {
-            t.children = []
+            t.children = [];
           }
           return t;
-        })
-        this.options.unshift({ value: "all", label: "全部" }, { value: "noKnow", label: "未明确建筑" })
+        });
+        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`
-      }
+        filters: `state=1`,
+      };
       if (floor) {
-        pa.filters += `;floorId="${floor}"`
+        pa.filters += `;floorId="${floor}"`;
       }
-      businessSpaceController.zoneCount(pa, res => {
+      businessSpaceController.zoneCount(pa, (res) => {
         if (floor) {
-          this.infectedCurfloor = res.count
+          this.infectedCurfloor = res.count;
         } else {
-          this.infectedTotal = res.count
+          this.infectedTotal = res.count;
         }
-      })
+      });
     },
     // 切换平面图和列表
     changeRadio(val) {
-      this.changeGraphyOrTable(val)
+      this.changeGraphyOrTable(val);
     },
     // 获取tabs的列表
     getTypes(floorid) {
       let pa = {
         // Cascade: [{ Name: 'zoneType' }]
-      }
+      };
       if (floorid) {
-        pa.floorId = floorid
+        pa.floorId = floorid;
       }
-      businessSpaceController.queryAllZoneType(pa, res => {
-        this.tabsList = res.content.map(t => {
-          if (t.name == "元空间") {
-            return undefined;
-          }
-          return t;
-        }).filter(item => item);
+      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';
+        } else if (this.activeName == "0") {
+          this.activeName = "GeneralZone";
         }
-      })
+      });
     },
     // 获取多建筑楼层统计
     getMutiCount() {
-      businessSpaceController.getSpaceBdFlCount({}, res => {
+      businessSpaceController.getSpaceBdFlCount({}, (res) => {
         this.mutiCount = res.count;
         if (this.mutiCount > 0) {
           this.getTips();
         }
-      })
+      });
     },
     // 获取关系是否需要计算
     getRelations() {
       let pa = {
-        filters: `relationType in ["bd2sp","fl2sp"];computationalState>1`
-      }
+        filters: `relationType in ["bd2sp","fl2sp"];computationalState>1`,
+      };
       // 后台暂无接口提供 todo
-      businessSpaceController.getrelationTypeProject(pa, res => {
+      businessSpaceController.getrelationTypeProject(pa, (res) => {
         if (res.content.length) {
           this.needCalculate = true;
         } else {
           this.needCalculate = false;
-          this.init()
+          this.init();
         }
-      })
+      });
     },
     // 通过选中的tab-Code 获取选中的tab的所有数据
     getItemForType() {
-      let data = {}
-      this.tabsList.map(item => {
+      let data = {};
+      this.tabsList.map((item) => {
         if (item.code == this.activeName) {
           data.code = item.code;
           data.name = item.name;
         }
-      })
-      return data
+      });
+      return data;
     },
     // 点击tab
     tabClick(val) {
-      this.changeGraphyOrTable(this.isMyTab)
+      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)
-      })
+        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()
+      if (val.indexOf("noKnow") > -1 || val.indexOf("all") > -1) {
+        this.getTypes();
         this.isMyTab = 2;
-        this.FloorMap = {}
+        this.FloorMap = {};
       } else {
         // 选择的是具体某个楼层
-        if (!this.floorToMap[val[1]].infos || !this.floorToMap[val[1]].infos.floorMap) {
+        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()
+      this.setRepeatText();
     },
 
     // 判断切换至图还是表
     changeGraphyOrTable(num) {
-      this.activeTabType = this.getItemForType()
+      this.activeTabType = this.getItemForType();
       if (!this.buildFloorSelectd[0]) {
-        this.$message.warning('请选择建筑楼层')
-        return
+        this.$message.warning("请选择建筑楼层");
+        return;
       }
       if (!this.activeTabType.code) {
         this.isGetType = false;
-        return
+        return;
       }
       if (num == 2) {
         this.initMessage();
       } else {
         this.getInfected(this.buildFloorSelectd[1]);
-        /// 
-        console.log(this.FloorMap, '========================');
+        ///
+        console.log(this.FloorMap, "========================");
         this.isGetType = true;
-        this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, this.activeTabType);
-        this.childBackParam = {}
+        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 = []
+      if (
+        this.buildFloorSelectd.indexOf("noKnow") > -1 ||
+        this.buildFloorSelectd.indexOf("all") > -1
+      ) {
+        this.repeatFloor = [];
       } else {
-        const fId = this.buildFloorSelectd[1]
+        const fId = this.buildFloorSelectd[1];
         const mId = this.floorToMap[fId].modelId;
         if (mId) {
           const fList = this.modelIdToFloor[mId];
           if (fList.length < 2) {
-            this.repeatFloor = []
+            this.repeatFloor = [];
           } else {
-            this.repeatFloor = fList.map(t => {
-              if (t.id != fId) {
-                return `${t.buildName}-${t.localName}`
-              }
-            }).filter(item => item);
+            this.repeatFloor = fList
+              .map((t) => {
+                if (t.id != fId) {
+                  return `${t.buildName}-${t.localName}`;
+                }
+              })
+              .filter((item) => item);
           }
         }
       }
@@ -351,16 +428,24 @@ export default {
 
     // 触发获取表头-获取初始化信息点
     initMessage() {
-        this.$refs.handsontable.getHeader(this.activeName, this.buildFloorSelectd);
+      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.notRelated.getIdList(
+        list,
+        build,
+        graphyId,
+        this.activeTabType
+      );
       this.$refs["graphy"].getHasSpace();
     },
     changeShow() {
       this.floor.dialogVisible = true;
-      console.log(this.buildMess, 'buildMess')
+      console.log(this.buildMess, "buildMess");
     },
     //成功关联平面图
     createSuccess() {
@@ -380,10 +465,10 @@ export default {
       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)
+      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;
@@ -394,21 +479,21 @@ export default {
     },
     // 跳转至关系总览
     jumpToAllRelation() {
-      this.$router.push({path: '/relation/overview', name: 'overView' })
+      this.$router.push({ path: "/relation/overview" });
     },
     relaSuc() {
       this.init();
       if (this.buildFloorSelectd.length > 1) {
-        this.changeCascader(this.buildFloorSelectd)
+        this.changeCascader(this.buildFloorSelectd);
       }
     },
     // 受影响业务空间确认成功回调
     updateStateSuc() {
-      this.getBuilding()
+      this.getBuilding();
       this.getTypes(this.buildFloorSelectd[1]);
       this.infectedTotal--;
       this.infectedCurfloor--;
-    }
+    },
   },
   watch: {
     floor: {
@@ -417,7 +502,7 @@ export default {
         if (this.floor.notRelated) {
           this.$refs["graphy"].clearDimension();
         }
-      }
+      },
     },
     projectId() {
       this.getRelations();
@@ -426,13 +511,13 @@ export default {
       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)
+            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>
 
@@ -554,7 +639,7 @@ export default {
       background: #ec808d;
       color: #fff;
       z-index: 9;
-      .repeatTips{
+      .repeatTips {
         overflow: hidden;
         white-space: nowrap;
         text-overflow: ellipsis;

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

@@ -275,7 +275,7 @@ export default {
             this.$message.success("创建成功");
             session.remove("spaceAddData");
             this.$router.push({
-              name: "spacelist",
+              // name: "spacelist",
               path: "/ledger/spacelist",
               params: {
                 zone: this.space.otherType

+ 1 - 1
src/components/old-adm/ledger/components/handsontables/device.vue

@@ -1614,7 +1614,7 @@ export default {
       let query = {};
       // 跳转批量维护设备位置页面
       this.$router.push({
-        name: "BatchPointAssets",
+        // name: "BatchPointAssets",
         path: "/ledger/batchPointAssets",
         params: query,
       });

+ 1 - 1
src/components/old-adm/ledger/facility/addfacility.vue

@@ -348,7 +348,7 @@ export default {
         storage.remove("deviceAddData");
         this.$router.push({
           path:'/ledger/facility',
-          name: "facilityLedger",
+          // name: "facilityLedger",
           params: {
             deviceId: this.category.deviceId,
             facility: this.category.name,

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 667 - 522
src/components/old-adm/ledger/facility/batchPoint.vue


+ 208 - 105
src/components/old-adm/ledger/facility/batchlink.vue

@@ -2,55 +2,139 @@
   <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 class="statistics-title">发现未关联资产的设备:<b>{{ unlinkNumber }}</b></span>
-        <span class="statistics-title">可在此功能中批量关联的:<b>{{ linkNumber }}</b></span>
-        <el-button style="float:right;margin-top:1px;" @click="handleClickCreate">保存选定的设备资产关联关系</el-button>
-        <el-button v-show="Object.keys(radio).length" style="float:right;margin-top:1px;margin-right:15px;"
-                   @click="handleClickReset">重置
+        <el-button
+          style="float: left"
+          size="small"
+          type="default"
+          icon="el-icon-back"
+          @click="goBack"
+        ></el-button>
+        <span class="statistics-title"
+          >发现未关联资产的设备:<b>{{ unlinkNumber }}</b></span
+        >
+        <span class="statistics-title"
+          >可在此功能中批量关联的:<b>{{ linkNumber }}</b></span
+        >
+        <el-button
+          style="float: right; margin-top: 1px"
+          @click="handleClickCreate"
+          >保存选定的设备资产关联关系</el-button
+        >
+        <el-button
+          v-show="Object.keys(radio).length"
+          style="float: right; margin-top: 1px; margin-right: 15px"
+          @click="handleClickReset"
+          >重置
         </el-button>
-        <span style="float:right;margin-top:5px;font-size:12px;margin-right:10px;color:#999;">不能批量处理的请在设备台账列表中操作</span>
+        <span
+          style="
+            float: right;
+            margin-top: 5px;
+            font-size: 12px;
+            margin-right: 10px;
+            color: #999;
+          "
+          >不能批量处理的请在设备台账列表中操作</span
+        >
       </div>
       <div class="main">
-        <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%"
-                  :span-method="objectSpanMethod" :header-cell-style="headerStyle">
-          <el-table-column prop="localName" label="设备本地名称" show-overflow-tooltip width="150">
+        <el-table
+          ref="multipleTable"
+          :data="tableData"
+          v-loading="loading"
+          stripe
+          height="100%"
+          :span-method="objectSpanMethod"
+          :header-cell-style="headerStyle"
+        >
+          <el-table-column
+            prop="localName"
+            label="设备本地名称"
+            show-overflow-tooltip
+            width="150"
+          >
             <!-- <template slot-scope="scope">{{ scope.row.EquipLocalName?scope.row.EquipLocalName:scope.row.EquipName }}</template> -->
           </el-table-column>
-          <el-table-column prop="localId" label="设备本地编码" show-overflow-tooltip max-width="150">
+          <el-table-column
+            prop="localId"
+            label="设备本地编码"
+            show-overflow-tooltip
+            max-width="150"
+          >
             <!-- <template slot-scope="scope">{{ scope.row.EquipLocalID?scope.row.EquipLocalID:scope.row.EquipID }}</template> -->
           </el-table-column>
-          <el-table-column prop="equipCategory.name" label="设备类" show-overflow-tooltip
-                           width="100"></el-table-column>
-          <el-table-column prop="cADID" label="设计图纸中编码" show-overflow-tooltip max-width="150"></el-table-column>
+          <el-table-column
+            prop="equipCategory.name"
+            label="设备类"
+            show-overflow-tooltip
+            width="100"
+          ></el-table-column>
+          <el-table-column
+            prop="cADID"
+            label="设计图纸中编码"
+            show-overflow-tooltip
+            max-width="150"
+          ></el-table-column>
           <el-table-column label="所属建筑楼层">
             <template slot-scope="scope">
-              {{
-                scope.row.building ? scope.row.building.localName : ''
-              }}-{{ scope.row.floor ? scope.row.floor.localName : '' }}
+              {{ scope.row.building ? scope.row.building.localName : "" }}-{{
+                scope.row.floor ? scope.row.floor.localName : ""
+              }}
             </template>
           </el-table-column>
-          <el-table-column prop="PropertyItem.localName" label="资产本地名称" show-overflow-tooltip width="150">
+          <el-table-column
+            prop="PropertyItem.localName"
+            label="资产本地名称"
+            show-overflow-tooltip
+            width="150"
+          >
             <!-- <template slot-scope="scope">{{ scope.row.AssetsLocalName }}</template> -->
           </el-table-column>
-          <el-table-column prop="PropertyItem.localId" label="资产本地编码" show-overflow-tooltip max-width="150">
+          <el-table-column
+            prop="PropertyItem.localId"
+            label="资产本地编码"
+            show-overflow-tooltip
+            max-width="150"
+          >
             <!-- <template slot-scope="scope">{{ scope.row.AssetsLocalId }}</template> -->
           </el-table-column>
-          <el-table-column prop="PropertyItem.familyName.name" label="设备族" show-overflow-tooltip
-                           width="100"></el-table-column>
-          <el-table-column prop="PropertyItem.cADID" label="设计图纸中编码" show-overflow-tooltip
-                           max-width="150"></el-table-column>
-          <el-table-column label="所属建筑楼层" show-overflow-tooltip width="200">
+          <el-table-column
+            prop="PropertyItem.familyName.name"
+            label="设备族"
+            show-overflow-tooltip
+            width="100"
+          ></el-table-column>
+          <el-table-column
+            prop="PropertyItem.cADID"
+            label="设计图纸中编码"
+            show-overflow-tooltip
+            max-width="150"
+          ></el-table-column>
+          <el-table-column
+            label="所属建筑楼层"
+            show-overflow-tooltip
+            width="200"
+          >
             <template slot-scope="scope">
               {{
-                scope.row.PropertyItem.building ? scope.row.PropertyItem.building.localName : ''
-              }}-{{ scope.row.PropertyItem.floor ? scope.row.PropertyItem.floor.localName : '' }}
+                scope.row.PropertyItem.building
+                  ? scope.row.PropertyItem.building.localName
+                  : ""
+              }}-{{
+                scope.row.PropertyItem.floor
+                  ? scope.row.PropertyItem.floor.localName
+                  : ""
+              }}
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="100">
             <template slot-scope="scope">
-              <el-radio v-model="radio[scope.row.id]" :label="scope.row.PropertyItem.id"
-                        :disabled="scope.row.disabled" @change="handleChangeLink(scope.row)">&nbsp;
+              <el-radio
+                v-model="radio[scope.row.id]"
+                :label="scope.row.PropertyItem.id"
+                :disabled="scope.row.disabled"
+                @change="handleChangeLink(scope.row)"
+                >&nbsp;
               </el-radio>
             </template>
           </el-table-column>
@@ -74,18 +158,18 @@
 </template>
 
 <script>
-import {mapGetters} from "vuex"
+import { mapGetters } from "vuex";
 //api
-import {equipCategoryProperty, equipRproperty} from "@/api/scan/request";
+import { equipCategoryProperty, equipRproperty } from "@/api/scan/request";
 
 export default {
   components: {},
   computed: {
-    ...mapGetters("layout", ["projectId", "userId", "secret"])
+    ...mapGetters("layout", ["projectId", "userId", "secret"]),
   },
   created() {
-    this.params = this.$route.params
-    this.getTableData()
+    this.params = this.$route.params;
+    this.getTableData();
   },
   data() {
     return {
@@ -104,143 +188,156 @@ export default {
       tableData: [],
       mergeCol: [],
       headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#e1e4e5",
+        color: "#2b2b2b",
+        lineHeight: "30px",
       }, // 列表样式
-    }
+    };
   },
   methods: {
     //获取表格数据
     getTableData(pageNum) {
-      this.loading = true
-      let fl = this.formatFilter(pageNum)
+      this.loading = true;
+      let fl = this.formatFilter(pageNum);
       let param = {
         category: fl.category || undefined,
         spaceIdList: fl.spaceIdList || undefined,
-        
+
         orders: "createTime desc",
         pageNumber: 1,
-        pageSize: 1000
-      }
-      equipCategoryProperty(param, res => {
-        this.unlinkNumber = res.total
-        this.linkNumber += res.content.length
-        this.contentData = this.contentData.concat(res.content)
+        pageSize: 1000,
+      };
+      equipCategoryProperty(param, (res) => {
+        this.unlinkNumber = res.total;
+        this.linkNumber += res.content.length;
+        this.contentData = this.contentData.concat(res.content);
         if (res.total / (res.pageSize * res.pageNumber) > 1) {
-          this.getTableData(res.pageNumber + 1)
+          this.getTableData(res.pageNumber + 1);
         } else {
-          this.contentData.forEach(item => {
+          this.contentData.forEach((item) => {
             if (item.propertyList && item.propertyList.length) {
               item.propertyList.forEach((Assets, index) => {
-                let obj = JSON.parse(JSON.stringify(Object.assign(item, { PropertyItem: Assets, disabled: false })))
-                delete obj.propertyList
-                this.tableData.push(obj)
+                let obj = JSON.parse(
+                  JSON.stringify(
+                    Object.assign(item, {
+                      PropertyItem: Assets,
+                      disabled: false,
+                    })
+                  )
+                );
+                delete obj.propertyList;
+                this.tableData.push(obj);
                 if (index == 0) {
-                  this.mergeCol.push(item.propertyList.length)
+                  this.mergeCol.push(item.propertyList.length);
                 } else {
-                  this.mergeCol.push(false)
+                  this.mergeCol.push(false);
                 }
-              })
+              });
             }
-          })
-          this.loading = false
+          });
+          this.loading = false;
         }
-      })
+      });
     },
     //格式化条件
     formatFilter(pageNum) {
-      pageNum = pageNum ? pageNum : 1
+      pageNum = pageNum ? pageNum : 1;
       let param = {
         data: {
           orders: "createTime desc, id asc",
           pageNumber: pageNum,
-          pageSize: 1000
+          pageSize: 1000,
         },
-        category: this.params.deviceType
-      }
+        category: this.params.deviceType,
+      };
 
       if (this.params.buildFloor[0] == "noKnow") {
-        param.data.filters = `buildingId isNull`
-      } else if (this.params.buildFloor[0] && this.params.buildFloor[0] != "all") {
-        param.data.filters = `buildingId='${this.params.buildFloor[0]}'`
+        param.data.filters = `buildingId isNull`;
+      } else if (
+        this.params.buildFloor[0] &&
+        this.params.buildFloor[0] != "all"
+      ) {
+        param.data.filters = `buildingId='${this.params.buildFloor[0]}'`;
         if (this.params.buildFloor[1] == "noKnow") {
-          param.data.filters += `;floorId isNull`
-        } else if (this.params.buildFloor[1] && this.params.buildFloor[1] != "all") {
-          param.data.filters += `;floorId='${this.params.buildFloor[1]}'`
+          param.data.filters += `;floorId isNull`;
+        } else if (
+          this.params.buildFloor[1] &&
+          this.params.buildFloor[1] != "all"
+        ) {
+          param.data.filters += `;floorId='${this.params.buildFloor[1]}'`;
         }
       }
-      if (this.params.hasOwnProperty('spaceList')) {
-        if (typeof this.params.spaceList == 'string') {
-          param.spaceIdList = `&spacrType=${this.params.spaceList}`
+      if (this.params.hasOwnProperty("spaceList")) {
+        if (typeof this.params.spaceList == "string") {
+          param.spaceIdList = `&spacrType=${this.params.spaceList}`;
         } else {
-          let spaceIdList = ''
-          this.params.spaceList.forEach(item => {
-            spaceIdList += `&spaceIdList=${item}`
-          })
-          param.spaceIdList = spaceIdList
+          let spaceIdList = "";
+          this.params.spaceList.forEach((item) => {
+            spaceIdList += `&spaceIdList=${item}`;
+          });
+          param.spaceIdList = spaceIdList;
         }
       }
-      return param
+      return param;
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (columnIndex < 5) {
         if (this.mergeCol[rowIndex]) {
           return {
             rowspan: this.mergeCol[rowIndex],
-            colspan: 1
+            colspan: 1,
           };
         } else {
           return {
             rowspan: 0,
-            colspan: 1
+            colspan: 1,
           };
         }
       }
     },
     //切换关联
     handleChangeLink(row) {
-      this.tableData.forEach(item => {
-        item.disabled = false
+      this.tableData.forEach((item) => {
+        item.disabled = false;
         if (Object.keys(this.radio).length) {
           for (let key in this.radio) {
             if (item.id != key && item.PropertyItem.id == this.radio[key]) {
-              item.disabled = true
+              item.disabled = true;
             }
           }
         }
-      })
+      });
     },
     //重置关联选择
     handleClickReset() {
-      this.tableData.forEach(item => {
-        item.disabled = false
-      })
-      this.radio = {}
+      this.tableData.forEach((item) => {
+        item.disabled = false;
+      });
+      this.radio = {};
     },
     //创建已选
     handleClickCreate() {
       let params = {
-        content: []
-      }
+        content: [],
+      };
       if (Object.keys(this.radio).length) {
         for (let key in this.radio) {
           params.content.push({
             id: this.radio[key],
-            equipId: key
-          })
-          console.log(params.content)
+            equipId: key,
+          });
+          console.log(params.content);
         }
-        equipRproperty(params, res => {
-          this.radio = {}
-          this.linkNumber = 0
-          this.contentData = []
-          this.tableData = []
-          this.getTableData()
-          this.$message.success('关联成功!')
-        })
+        equipRproperty(params, (res) => {
+          this.radio = {};
+          this.linkNumber = 0;
+          this.contentData = [];
+          this.tableData = [];
+          this.getTableData();
+          this.$message.success("关联成功!");
+        });
       } else {
-        this.$message.info('请选择要关联的关系!')
+        this.$message.info("请选择要关联的关系!");
       }
     },
     //切换每页显示多少条数据
@@ -255,14 +352,20 @@ export default {
     // },
     //返回
     goBack() {
-      this.$router.push({path: "/ledger/facility", name: "facilityLedger" })
-    }
+      this.$router.push({
+        path: "/ledger/facility",
+        // name: "facilityLedger",
+      });
+    },
   },
   watch: {
     projectId() {
-      this.$router.push({ path: "/ledger/facility",name: "facilityLedger" })
-    }
-  }
+      this.$router.push({
+        path: "/ledger/facility",
+        // name: "facilityLedger",
+      });
+    },
+  },
 };
 </script>
 

+ 355 - 266
src/components/old-adm/ledger/facility/details/index.vue

@@ -1,15 +1,27 @@
 <template>
   <div class="tableDisplay">
     <div class="header">
-      <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
-      <span :title="`${name} - ${code}`" class="details-title"><b>{{ name }} - {{ code }}</b></span>
+      <el-button
+        style="float: left"
+        size="small"
+        type="default"
+        icon="el-icon-back"
+        @click="goBack"
+      ></el-button>
+      <span :title="`${name} - ${code}`" class="details-title"
+        ><b>{{ name }} - {{ code }}</b></span
+      >
     </div>
     <div class="content">
-      <el-scrollbar style="height:100%;">
+      <el-scrollbar style="height: 100%">
         <div class="content-scrollbar">
           <div class="content-left">
             <div class="content-keyPoint">
-              <exhibitionCrux :exhibitionCrux="exhibitionCrux" :type="type" @cruxSuccess="cruxSuccess"/>
+              <exhibitionCrux
+                :exhibitionCrux="exhibitionCrux"
+                :type="type"
+                @cruxSuccess="cruxSuccess"
+              />
             </div>
             <div class="content-showType">
               <selectRadio
@@ -19,48 +31,69 @@
             </div>
             <div class="content-point">
               <div class="content-point-left">
-                <exhibitionBaseInformation :exhibitionBaseInformation="exhibitionBaseInformation"/>
+                <exhibitionBaseInformation
+                  :exhibitionBaseInformation="exhibitionBaseInformation"
+                />
               </div>
               <div class="content-point-right">
-                <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy"/>
+                <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy" />
               </div>
             </div>
           </div>
           <div class="content-right">
             <div class="content-repair">
-              <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain"/>
+              <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain" />
             </div>
             <div class="content-media">
-              <exhibitionImage :exhibitionImage="exhibitionImage" v-show="isShowImage"/>
-              <exhibitionVideo :exhibitionVideo="exhibitionVideo" v-show="isShowVideo"/>
-              <exhibitionFile :exhibitionFile="exhibitionFile" v-show="isShowFile"/>
+              <exhibitionImage
+                :exhibitionImage="exhibitionImage"
+                v-show="isShowImage"
+              />
+              <exhibitionVideo
+                :exhibitionVideo="exhibitionVideo"
+                v-show="isShowVideo"
+              />
+              <exhibitionFile
+                :exhibitionFile="exhibitionFile"
+                v-show="isShowFile"
+              />
             </div>
           </div>
         </div>
       </el-scrollbar>
     </div>
     <div class="footer">
-      <el-button-group style="float:right;margin:8px 10px 0 0">
+      <el-button-group style="float: right; margin: 8px 10px 0 0">
         <el-button
-          :disabled="list.findIndex(item => item.value == id) == 0"
+          :disabled="list.findIndex((item) => item.value == id) == 0"
           @click="handleClickPrev"
           size="mini"
-          icon="el-icon-arrow-left">
+          icon="el-icon-arrow-left"
+        >
           上一页
         </el-button>
-        <el-select size="mini" style="float:left;margin:0 10px;" v-model="id" @change="handleChangeExample"
-                   placeholder="请选择">
+        <el-select
+          size="mini"
+          style="float: left; margin: 0 10px"
+          v-model="id"
+          @change="handleChangeExample"
+          placeholder="请选择"
+        >
           <el-option
             v-for="item in list"
             :key="item.value"
             :label="item.label"
-            :value="item.value">
+            :value="item.value"
+          >
           </el-option>
         </el-select>
         <el-button
-          :disabled="list.findIndex(item => item.value == id) == list.length-1"
+          :disabled="
+            list.findIndex((item) => item.value == id) == list.length - 1
+          "
           @click="handleClickNext"
-          size="mini">
+          size="mini"
+        >
           下一页
           <i class="el-icon-arrow-right el-icon--right"></i>
         </el-button>
@@ -78,11 +111,11 @@ import exhibitionCrux from "@/components/old-adm/ledger/components/details/detai
 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";
-import tools from "@/utils/old-adm/scan/tools"
+import tools from "@/utils/old-adm/scan/tools";
 import ScanController from "@/controller/old-adm/ScanController";
 import Dic from "@/controller/old-adm/dicController";
 import EquipController from "@/controller/old-adm/equipController";
-import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
 
 export default {
   name: "deviceDetails",
@@ -94,7 +127,7 @@ export default {
     exhibitionMaintain,
     selectRadio,
     exhibitionCrux,
-    exhibitionEnergy
+    exhibitionEnergy,
   },
   created() {
     this.id = this.$route.query.equipId;
@@ -105,365 +138,405 @@ export default {
     this.getData();
   },
   computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId", "group_code"])
+    ...mapGetters("layout", ["projectId", "secret", "userId", "group_code"]),
   },
   data() {
     return {
-      id: '', //当前设备id
-      name: '', //当前设备本地名称
-      code: '', //当前设备的本地编码
-      type: '', //设备类型
+      id: "", //当前设备id
+      name: "", //当前设备本地名称
+      code: "", //当前设备的本地编码
+      type: "", //设备类型
       list: [], //设备列表
       pointData: [], //信息点数据
       exampleData: {}, //实例数据
-      currentRadio: '1',//当前选中的select
+      currentRadio: "1", //当前选中的select
       criterias: [], //动态参数
       criteriasArray: [],
       selectRadio: {
-        information: '设备信息点',
-        initRadio: '1',
+        information: "设备信息点",
+        initRadio: "1",
         radioList: [
           {
-            value: '显示需采集信息点',
-            label: '1'
+            value: "显示需采集信息点",
+            label: "1",
           },
           {
-            value: '显示有值信息点',
-            label: '2'
+            value: "显示有值信息点",
+            label: "2",
           },
           {
-            value: '显示全部信息点',
-            label: '3'
-          }
-        ]
+            value: "显示全部信息点",
+            label: "3",
+          },
+        ],
       },
       exhibitionBaseInformation: {
-        information: {}
+        information: {},
       },
       exhibitionEnergy: {
-        title: '能耗信息',
-        firstName: '',
+        title: "能耗信息",
+        firstName: "",
         dynamic: [],
-        list: {}
+        list: {},
       },
       exhibitionMaintain: {
-        title: '维修/维保记录'
+        title: "维修/维保记录",
       },
       exhibitionFile: {
-        title: '文件',
-        list: {}
+        title: "文件",
+        list: {},
       },
       exhibitionCrux: {
-        title: '关键信息点:',
+        title: "关键信息点:",
         cruxArray: [],
-        allMessage: [],//全部信息点
+        allMessage: [], //全部信息点
       },
       exhibitionImage: {
-        title: '图片',
+        title: "图片",
         list: {},
-        arr: []
+        arr: [],
       },
       exhibitionVideo: {
-        title: '视频',
-        list: []
+        title: "视频",
+        list: [],
       },
-      instance: {},//实例信息处理
+      instance: {}, //实例信息处理
       isShowImage: false,
       isShowVideo: false,
       isShowFile: false,
-    }
+    };
   },
   methods: {
     deepCopy(obj) {
-      return JSON.parse(JSON.stringify(obj))
+      return JSON.parse(JSON.stringify(obj));
     },
     cruxSuccess() {
-      this.getData()
+      this.getData();
     },
     // 获取表头和实例数据(动态数据在组件中获取,在此格式化请求参数)
     getData() {
       let params1 = {
-        orders: "sort asc",
-        pageNumber: 1,
-        pageSize: 1000,
-        type: this.type
-      }, params2 = {
-        filters: `id='${this.id}'`,
-      };
+          orders: "sort asc",
+          pageNumber: 1,
+          pageSize: 1000,
+          type: this.type,
+        },
+        params2 = {
+          filters: `id='${this.id}'`,
+        };
       let promise1 = new Promise((resolve, reject) => {
-        Dic.getDataDictionary(params1, res => {
-          resolve(res)
-        })
-      })
+        Dic.getDataDictionary(params1, (res) => {
+          resolve(res);
+        });
+      });
       let promise2 = new Promise((resolve, reject) => {
-        EquipController.queryEquip(params2).then(res => {
-          resolve(res)
-        })
-      })
+        EquipController.queryEquip(params2).then((res) => {
+          resolve(res);
+        });
+      });
       // 数据初始化
       this.exhibitionEnergy.dynamic = [];
       this.criterias = [];
 
-      Promise.all([promise1, promise2]).then(values => {
+      Promise.all([promise1, promise2]).then((values) => {
         this.pointData = values[0].content;
         this.exampleData = values[1].content[0];
-        this.name = this.exampleData.localName ? this.exampleData.localName : this.exampleData.name ? this.exampleData.name : '';
-        this.code = this.exampleData.localId ? this.exampleData.localId : '';
+        this.name = this.exampleData.localName
+          ? this.exampleData.localName
+          : this.exampleData.name
+          ? this.exampleData.name
+          : "";
+        this.code = this.exampleData.localId ? this.exampleData.localId : "";
         let obj = this.deepCopy(values[1].content[0]);
         obj = tools.flattenKeys(obj);
-        for (let key in obj) {           //删除对象中数组为空的项
+        for (let key in obj) {
+          //删除对象中数组为空的项
           if (Array.isArray(obj[key]) && !obj[key].length) {
-            delete obj[key]
+            delete obj[key];
           }
         }
         this.instance = obj;
-        this.pointData.forEach(item => {
+        this.pointData.forEach((item) => {
           if (item.category != "STATIC") {
             let cur = tools.dataForKey(this.exampleData, item.path);
             if (cur) {
               this.criterias.push({
                 objectId: this.exampleData.id,
-                infoCode: item.code
-              })
+                infoCode: item.code,
+              });
             }
           }
-            if (this.instance.hasOwnProperty(item.path)) {
-                item.value = this.instance[item.path]
-            }
-        })
-        let params = { //获取动态参数
+          if (this.instance.hasOwnProperty(item.path)) {
+            item.value = this.instance[item.path];
+          }
+        });
+        let params = {
+          //获取动态参数
           groupCode: this.group_code,
           appId: "datacenter",
           projectId: this.projectId,
-          data: []
-        }
-        params.data = this.criterias
+          data: [],
+        };
+        params.data = this.criterias;
         if (this.criterias.length) {
-          ScanController.BeatchQueryParam(params, res => {
+          ScanController.BeatchQueryParam(params, (res) => {
             this.criteriasArray = res.data;
-            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)
+            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.value)
+                    this.$set(head, "svalue", child.infoValue);
+                    // this.$set(head, 'receivetime', child.receivetime)
+                    this.$set(head, "receivetime", child.time);
+                    this.$set(head, "error", child.error);
                   }
-                  // this.$set(head, 'svalue', child.value)
-                  this.$set(head, 'svalue', child.infoValue)
-                  // this.$set(head, 'receivetime', child.receivetime)
-                  this.$set(head, 'receivetime', child.time)
-                  this.$set(head, 'error', child.error)
-                }
-                return head
-              })
-            })
+                  return head;
+                });
+              });
             this.handleRadios(this.currentRadio);
-            this.handleEnclosure() //处理图片视频文件信息
-          })
+            this.handleEnclosure(); //处理图片视频文件信息
+          });
         } else {
           this.handleRadios(this.currentRadio);
-          this.handleEnclosure() //处理图片视频文件信息
+          this.handleEnclosure(); //处理图片视频文件信息
         }
-
-      })
+      });
     },
     handleEnclosure() {
       //图片文件处理,脱离radio控制
-      let isArr = []
-      isArr = this.pointData.filter(k => k.value)
-      this.handlePicList(isArr)
-      this.handleFileList(isArr)
+      let isArr = [];
+      isArr = this.pointData.filter((k) => k.value);
+      this.handlePicList(isArr);
+      this.handleFileList(isArr);
     },
-    handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
-      let arr = []
+    handleRadios(val) {
+      //判断radio的值显示关键信息,基本信息,图片,文件
+      let arr = [];
       //关键信息点
-      this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.keyWord)
-      this.exhibitionCrux.cruxArray.map(i => {
+      this.exhibitionCrux.cruxArray = this.pointData.filter((i) => i.keyWord);
+      this.exhibitionCrux.cruxArray.map((i) => {
         if (this.instance.hasOwnProperty(i.path)) {
           return {
             ...i,
-            value: this.instance[i.path]
-          }
+            value: this.instance[i.path],
+          };
         }
-      })
+      });
 
-      if (val == 1) { //需采集信息
-        arr = this.pointData.filter(i => i.visible)
-      } else if (val == 2) { //有值信息点
-        arr = this.pointData.filter(k => k.value)
-      } else { //全部信息点
-        arr = this.pointData
+      if (val == 1) {
+        //需采集信息
+        arr = this.pointData.filter((i) => i.visible);
+      } else if (val == 2) {
+        //有值信息点
+        arr = this.pointData.filter((k) => k.value);
+      } else {
+        //全部信息点
+        arr = this.pointData;
       }
-      this.displayData(arr)
+      this.displayData(arr);
     },
     handlePicList(arr) {
-      let picObject = {}
-      let video = []
+      let picObject = {};
+      let video = [];
       //处理数据格式
-      arr.map(i => {
-        if (i.dataType == 'ATTACHMENT') {
+      arr.map((i) => {
+        if (i.dataType == "ATTACHMENT") {
           switch (i.path) {
-            case 'infos.installPic':
-            case 'infos.nameplate':
-            case 'infos.pic':
+            case "infos.installPic":
+            case "infos.nameplate":
+            case "infos.pic":
               if (this.instance.hasOwnProperty(i.path)) {
-                i.PicList = this.instance[i.path].filter(i => i.type === 'image' || i.type === 'panorama')
-                video = video.concat(this.instance[i.path].filter(i => i.type === 'video'))
+                i.PicList = this.instance[i.path].filter(
+                  (i) => i.type === "image" || i.type === "panorama"
+                );
+                video = video.concat(
+                  this.instance[i.path].filter((i) => i.type === "video")
+                );
               }
               if (picObject[i.name]) {
               } else {
-                picObject[i.name] = []
+                picObject[i.name] = [];
               }
               picObject[i.name].push({
                 ...i,
-              })
+              });
               break;
           }
         }
-
-      })
+      });
       //展示图片
-      let isArray = [] //获取图片数组
+      let isArray = []; //获取图片数组
       for (let i in picObject) {
         if (Array.isArray(picObject[i])) {
-          let list = picObject[i]
-          list.forEach(i => {
+          let list = picObject[i];
+          list.forEach((i) => {
             if (i.PicList) {
-              isArray.push(...i.PicList)
+              isArray.push(...i.PicList);
             }
-          })
+          });
         }
       }
-      this.exhibitionImage.list = picObject
-      this.exhibitionImage.arr = isArray
-      this.exhibitionVideo.list = video
+      this.exhibitionImage.list = picObject;
+      this.exhibitionImage.arr = isArray;
+      this.exhibitionVideo.list = video;
       //判断是否显示图片组件
-      this.isShowImage = isArray.length ? true : false
+      this.isShowImage = isArray.length ? true : false;
       //判断是否显示video组件
-      this.isShowVideo = video.length ? true : false
-
+      this.isShowVideo = video.length ? true : false;
     },
     handleFileList(arr) {
-      let picObject = {}
+      let picObject = {};
       //处理数据格式
-      arr.map(i => {
-        if (i.dataType == 'ATTACHMENT') {
+      arr.map((i) => {
+        if (i.dataType == "ATTACHMENT") {
           switch (i.path) {
-            case 'infos.originalCertificate': //原厂证明
-            case 'infos.acceptanceReport': //验收报告
-            case 'infos.maintainManual': //维修保养手册
-            case 'infos.archive': //设备文档
-            case 'infos.drawing': //设备图纸
-            case 'infos.approachingAcceptance': //进场验收单
-            case 'infos.testReport': //检测报告
-            case 'infos.supplierContract': //供应合同
-            case 'infos.productCertification': //产品合格证
-            case 'infos.operationManual': //操作说明书
-            case 'infos.insuranceFile': //保险文件
-            case 'infos.checkReport': //安装质检报告
-            case 'infos.installDrawing': //安装图纸
-            case 'infos.installInstruction': //安装说明书
-            case 'infos.designIDGraph': //设计工况空调机组处理过程焓湿图
-            case 'infos.fanCharacterCurve': //风机性能曲线
+            case "infos.originalCertificate": //原厂证明
+            case "infos.acceptanceReport": //验收报告
+            case "infos.maintainManual": //维修保养手册
+            case "infos.archive": //设备文档
+            case "infos.drawing": //设备图纸
+            case "infos.approachingAcceptance": //进场验收单
+            case "infos.testReport": //检测报告
+            case "infos.supplierContract": //供应合同
+            case "infos.productCertification": //产品合格证
+            case "infos.operationManual": //操作说明书
+            case "infos.insuranceFile": //保险文件
+            case "infos.checkReport": //安装质检报告
+            case "infos.installDrawing": //安装图纸
+            case "infos.installInstruction": //安装说明书
+            case "infos.designIDGraph": //设计工况空调机组处理过程焓湿图
+            case "infos.fanCharacterCurve": //风机性能曲线
               if (this.instance.hasOwnProperty(i.path)) {
-                i.fileList = this.instance[i.path]
+                i.fileList = this.instance[i.path];
               }
               if (picObject[i.name]) {
-
               } else {
-                picObject[i.name] = []
+                picObject[i.name] = [];
               }
               picObject[i.name].push({
                 ...i,
-              })
-              break
+              });
+              break;
           }
         }
-      })
+      });
       //展示文件
-      this.exhibitionFile.list = picObject
-      let isArray = [] //获取文件数组
+      this.exhibitionFile.list = picObject;
+      let isArray = []; //获取文件数组
       for (let i in picObject) {
         if (Array.isArray(picObject[i])) {
-          let list = picObject[i]
-          list.forEach(i => {
+          let list = picObject[i];
+          list.forEach((i) => {
             if (i.fileList) {
-              isArray.push(...i.fileList)
+              isArray.push(...i.fileList);
             }
-          })
+          });
         }
       }
       //判断是否显示文件组件
-      this.isShowFile = isArray.length ? true : false
-
+      this.isShowFile = isArray.length ? true : false;
     },
-    changeRadio(val) { //1,需采集,2,有值,3,全部
-      this.handleRadios(val)
-      this.currentRadio = val
+    changeRadio(val) {
+      //1,需采集,2,有值,3,全部
+      this.handleRadios(val);
+      this.currentRadio = val;
     },
     formatDate(str) {
       if (str) {
-        if (str.includes('-')) {
-          return 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)
+            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)
+            return (
+              str.substr(0, 4) +
+              "-" +
+              str.substr(4, 2) +
+              "-" +
+              str.substr(6, 2) +
+              " " +
+              str.substr(8, 2)
+            );
           }
         }
       } else {
-        return '--'
+        return "--";
       }
     },
-    displayData(arr) {//对数据进行处理传给组件展示
-      const result = {}
+    displayData(arr) {
+      //对数据进行处理传给组件展示
+      const result = {};
       const resultEnergy = {};
-      arr.map(i => {
+      arr.map((i) => {
         if (this.instance.hasOwnProperty(i.path) && this.currentRadio != 2) {
-          i.value = this.instance[i.path]
+          i.value = this.instance[i.path];
         }
-        if (i.dataType == 'DATETIME') {
+        if (i.dataType == "DATETIME") {
           if (this.instance.hasOwnProperty(i.path)) {
-            let time = this.instance[i.path]
-            i.value = this.formatDate(time)
+            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
+          let source = i.dataSource;
           //判断输入类型
-          if (i.dataType == 'ENUM') {
-            let d1l = tools.formatDataSource(i.dataSource)
-            d1l.forEach(k => {
+          if (i.dataType == "ENUM") {
+            let d1l = tools.formatDataSource(i.dataSource);
+            d1l.forEach((k) => {
               if (k.code == this.instance[i.path]) {
-                i.value = k.name
+                i.value = k.name;
               }
-            })
-          } else if (i.dataType == 'MENUM' || i.dataType == 'DATETIME'){
+            });
+          } 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(',')
+                let transArray = this.instance[i.path].split(",");
+                i.value = source
+                  .filter((item) => transArray.includes(item.code))
+                  .map((item) => item.name)
+                  .join(",");
               }
             }
           }
-          source.forEach(j => {
+          source.forEach((j) => {
             if (j.code == this.instance[i.path]) {
-              i.value = j.name
+              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({
+            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,
@@ -476,29 +549,39 @@ export default {
                 type: i.type,
                 dataType: i.dataType,
                 dataSource: i.dataSource,
-              })
+              });
             } 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,
-                  dataSource: i.dataSource,
-                }]
-              }
+              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,
+                    dataSource: i.dataSource,
+                  },
+                ],
+              };
             }
-            break
+            break;
           default:
-            if (resultEnergy[`${i.firstName}${i.secondName ? '/' + i.secondName : ''}`]) {
-              resultEnergy[`${i.firstName}${i.secondName ? '/' + i.secondName : ''}`].paths.push({
+            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,
@@ -512,60 +595,67 @@ export default {
                 FirstName: i.firstName,
                 dataType: i.dataType,
                 dataSource: i.dataSource,
-              })
+              });
             } 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,
-                  dataSource: i.dataSource,
-                }]
-              }
+              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,
+                    dataSource: i.dataSource,
+                  },
+                ],
+              };
             }
         }
-      })
-      this.exhibitionBaseInformation.information = result
-      this.exhibitionCrux.allMessage = result
+      });
+      this.exhibitionBaseInformation.information = result;
+      this.exhibitionCrux.allMessage = result;
       this.exhibitionEnergy.list = resultEnergy;
     },
     goBack() {
-      this.$router.push({path: "/ledger/facility", name: "facilityLedger" })
+      this.$router.push({
+        path: "/ledger/facility",
+        // name: "facilityLedger",
+      });
     },
     // 切换实例
     handleChangeExample() {
-      this.selectRadio.initRadio = '1';
-      this.currentRadio = '1';
+      this.selectRadio.initRadio = "1";
+      this.currentRadio = "1";
       this.getData();
     },
     // 切换上一个实例
     handleClickPrev() {
-      let index = this.list.findIndex(item => item.value == this.id);
+      let index = this.list.findIndex((item) => item.value == this.id);
       this.id = this.list[index - 1].value;
       this.handleChangeExample();
     },
     // 切换下一个实例
     handleClickNext() {
-      let index = this.list.findIndex(item => item.value == this.id);
+      let index = this.list.findIndex((item) => item.value == this.id);
       this.id = this.list[index + 1].value;
       this.handleChangeExample();
     },
   },
   watch: {
     projectId() {
-      this.$router.push({ path: "/ledger/facility" })
-    }
-  }
-}
+      this.$router.push({ path: "/ledger/facility" });
+    },
+  },
+};
 </script>
 
 <style scoped lang="less">
@@ -671,5 +761,4 @@ export default {
 /deep/ .el-scrollbar__wrap {
   overflow-x: hidden;
 }
-
 </style>

+ 1 - 1
src/components/old-adm/ledger/system/addsystem.vue

@@ -242,7 +242,7 @@ export default {
         this.$message.success("创建成功");
         session.remove("systemAddData");
         this.$router.push({
-          name: "systemlist",
+          // name: "systemlist",
           path: "/ledger/list",
           params: { SysType: this.category.category },
         });

+ 182 - 125
src/components/old-adm/relation/overview/detail/index.vue

@@ -2,22 +2,44 @@
   <div id="spaceRelation">
     <el-row>
       <el-col :span="0.5">
-        <el-button size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
+        <el-button
+          size="small"
+          type="default"
+          icon="el-icon-back"
+          @click="goback"
+        ></el-button>
       </el-col>
       <el-col :span="0.5">
-        <span style="margin:0 10px;">建筑楼层</span>
-        <el-cascader placeholder="请选择建筑楼层" :options="options" v-model="buildFloor" filterable size="small" @change="changeCascader" :props="props">
+        <span style="margin: 0 10px">建筑楼层</span>
+        <el-cascader
+          placeholder="请选择建筑楼层"
+          :options="options"
+          v-model="buildFloor"
+          filterable
+          size="small"
+          @change="changeCascader"
+          :props="props"
+        >
         </el-cascader>
       </el-col>
       <el-col :span="0.5">
-        <span style="margin:0 10px;">业务空间类型</span>
-        <el-select placeholder="请选择" v-model="zoneType" @change="getBusinessSpace">
-          <el-option v-for="item in tabsList" :key="item.Code" :label="item.Name" :value="item.Code">
+        <span style="margin: 0 10px">业务空间类型</span>
+        <el-select
+          placeholder="请选择"
+          v-model="zoneType"
+          @change="getBusinessSpace"
+        >
+          <el-option
+            v-for="item in tabsList"
+            :key="item.Code"
+            :label="item.Name"
+            :value="item.Code"
+          >
           </el-option>
         </el-select>
       </el-col>
-      <el-col :span="0.5" style="float:right;" v-show='0'>
-        <span style="margin-right:10px;">当前状态 {{description}}</span>
+      <el-col :span="0.5" style="float: right" v-show="0">
+        <span style="margin-right: 10px">当前状态 {{ description }}</span>
         <el-button @click="cancel">取消</el-button>
         <el-button @click="removeRelation">清除</el-button>
         <el-button @click="removeAll">清除所有</el-button>
@@ -26,17 +48,36 @@
       </el-col>
     </el-row>
     <div class="canvas-container" v-loading="canvasLoading" ref="graphy">
-      <div v-show="!FloorMap" style="display:flex;align-items:center;justify-content:center;height:100%;">
-        <div class="center" style="flex:1">
+      <div
+        v-show="!FloorMap"
+        style="
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          height: 100%;
+        "
+      >
+        <div class="center" style="flex: 1">
           <i class="icon-wushuju iconfont"></i>
           暂无数据
         </div>
       </div>
       <div v-show="FloorMap" class="canvas-box">
-        <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
+        <canvas
+          id="floorCanvas"
+          :width="canvasWidth"
+          :height="canvasHeight"
+          ref="canvas"
+          tabindex="0"
+        ></canvas>
         <!-- 底部操作按钮 -->
         <el-row class="canvas-actions-box">
-          <canvasFun @fit="fit" @scale="scale" :config="config" ref="canvasFun"></canvasFun>
+          <canvasFun
+            @fit="fit"
+            @scale="scale"
+            :config="config"
+            ref="canvasFun"
+          ></canvasFun>
         </el-row>
       </div>
     </div>
@@ -52,42 +93,42 @@ import {
   delSpaceNeighborhood, //删除选中
   delFloorNeighborhood, //删除所有
 } from "@/api/scan/request";
-import { buildingQuery } from '@/api/object/build';
+import { buildingQuery } from "@/api/object/build";
 import { SColor, SPoint } from "@saga-web/draw/lib";
 import { RelationScene, FloorView } from "@saga-web/cad-engine/lib";
-import canvasFun from "@/components/business_space/newGraphy/canvasFun"
+import canvasFun from "@/components/business_space/newGraphy/canvasFun";
 import floorCascader from "@/components/ledger/lib/floorCascader";
-import { colorArr } from "@/utils/spaceColor"
+import { colorArr } from "@/utils/spaceColor";
 export default {
   components: {
     floorCascader,
-    canvasFun
+    canvasFun,
   },
   data() {
     return {
-      view: '',
-      scene: '',
+      view: "",
+      scene: "",
       canvasWidth: 800,
       canvasHeight: 600,
       canvasLoading: false,
-      FloorMap: '',
+      FloorMap: "",
       options: [],
       buildFloor: [],
       tabsList: [],
-      zoneType: 'GeneralZone',
+      zoneType: "GeneralZone",
       props: {
-        value: 'BuildID',
-        label: 'BuildLocalName',
-        children: 'floor'
+        value: "BuildID",
+        label: "BuildLocalName",
+        children: "floor",
       },
       idToFloor: {},
       config: {
         isEdit: false,
         divide: false,
-        groupSelect: false
+        groupSelect: false,
       },
-      description: '无'
-    }
+      description: "无",
+    };
   },
   created() {
     //图类型编码
@@ -111,20 +152,20 @@ export default {
           this.FloorMap = floor.StructureInfo.FloorMap;
           this.initGraphy();
         } else {
-          this.FloorMap = '';
+          this.FloorMap = "";
         }
       } else {
-        this.FloorMap = '';
+        this.FloorMap = "";
       }
     },
     // 保存邻接关系
     saveRelation() {
       let relationList = this.scene.relationList;
       let pa = {
-        Content: []
-      }
+        Content: [],
+      };
       if (relationList.length) {
-        pa.Content = relationList.map(t => {
+        pa.Content = relationList.map((t) => {
           return {
             FloorId: this.buildFloor[1],
             GraphType: this.type,
@@ -132,15 +173,15 @@ export default {
             LocationTwo: `${t.lastPoint.x},${-t.lastPoint.y}`,
             SpaceIdOne: t.startZone,
             SpaceIdTwo: t.endZone,
-            ZoneType: this.zoneType
-          }
-        })
+            ZoneType: this.zoneType,
+          };
+        });
       }
-      this.createRela(pa)
+      this.createRela(pa);
     },
     clearRelation() {
       if (this.scene) {
-        this.scene.removeAllRelation()
+        this.scene.removeAllRelation();
       }
     },
     //
@@ -148,74 +189,78 @@ export default {
       this.scene.removeRelationFlag = false;
       this.scene.createRelateFlag = false;
       this.scene.isAbsorbing = false;
-      this.description = '无'
+      this.description = "无";
     },
     //
     removeRelation() {
       this.scene.removeRelationFlag = true;
       this.scene.createRelateFlag = false;
       this.scene.isAbsorbing = false;
-      this.description = '清除'
+      this.description = "清除";
     },
     //
     addRelation() {
       this.scene.createRelateFlag = true;
       this.scene.removeRelationFlag = false;
       this.scene.isAbsorbing = true;
-      this.description = '添加'
+      this.description = "添加";
     },
     //
     removeAll() {
       let temp = {
         FloorId: this.buildFloor[1],
         ZoneType: this.zoneType,
-        GraphType: this.type
-      }
-      delFloorNeighborhood(temp, res => {
-        this.$message.success('删除成功');
+        GraphType: this.type,
+      };
+      delFloorNeighborhood(temp, (res) => {
+        this.$message.success("删除成功");
         this.clearRelation();
-      })
+      });
     },
     canvasClick(item, event) {
       console.log(item);
       item.selected = false;
     },
     initGraphy() {
-      this.clearGraphy()
+      this.clearGraphy();
       this.scene = new RelationScene();
       this.canvasLoading = true;
-      this.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(res => {
-        this.canvasLoading = false;
-        if (res == 'error') {
-          this.FloorMap = '';
-          console.log('数据解析异常');
-          return;
-        }
-        this.view.scene = this.scene;
-        this.view.fitSceneToView();
-        this.scene.isSpaceSelectable = false;
-        this.getBusinessSpace();
-        this.view.minScale = this.view.scale;
-        if (this.$refs.canvasFun) {
-          this.$refs.canvasFun.everyScale = this.view.scale;
-        }
-      })
+      this.scene
+        .loadUrl(
+          `/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`
+        )
+        .then((res) => {
+          this.canvasLoading = false;
+          if (res == "error") {
+            this.FloorMap = "";
+            console.log("数据解析异常");
+            return;
+          }
+          this.view.scene = this.scene;
+          this.view.fitSceneToView();
+          this.scene.isSpaceSelectable = false;
+          this.getBusinessSpace();
+          this.view.minScale = this.view.scale;
+          if (this.$refs.canvasFun) {
+            this.$refs.canvasFun.everyScale = this.view.scale;
+          }
+        });
     },
     // 清空场景并初始化视图
     clearGraphy() {
       if (this.view) {
         this.view.scene = null;
-        return
+        return;
       }
-      this.view = new FloorView('floorCanvas')
+      this.view = new FloorView("floorCanvas");
     },
     // canvas 获取焦点
     focus() {
-      document.getElementById(`floorCanvas`).focus()
+      document.getElementById(`floorCanvas`).focus();
     },
     // 适配底图到窗口
     fit() {
-      this.view.fitSceneToView()
+      this.view.fitSceneToView();
     },
     // 缩放
     scale(val) {
@@ -223,151 +268,163 @@ export default {
         return;
       }
       let scale = this.view.scale;
-      this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2);
+      this.view.scaleByPoint(
+        val / scale,
+        this.canvasWidth / 2,
+        this.canvasHeight / 2
+      );
     },
     goback() {
-      this.$router.push({path: '/relation/overview', name: 'overView' })
+      this.$router.push({
+        path: "/relation/overview",
+        // name: "overView",
+      });
     },
     // 获取项目下建筑
     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 => {
+      };
+      buildingQuery(pa, (res) => {
+        this.options = res.content.map((t) => {
           if (t.floor) {
-            t.floor = t.floor.map(item => {
+            t.floor = t.floor.map((item) => {
               item.BuildID = item.id;
               item.BuildLocalName = item.localName;
               this.idToFloor[item.id] = item;
               return item;
-            })
+            });
           } else {
-            t.floor = []
+            t.floor = [];
           }
           return t;
-        })
-      })
+        });
+      });
     },
     // 业务空间分区类型
     getTypes() {
       let pa = {
-        Filters: `parentId='Space'`
-      }
-      queryDictionaryHead(pa, res => {
-        this.tabsList = res.Content.map(t => {
+        Filters: `parentId='Space'`,
+      };
+      queryDictionaryHead(pa, (res) => {
+        this.tabsList = res.Content.map((t) => {
           if (t.Name == "元空间") {
             return undefined;
           }
           return t;
-        }).filter(item => item);
-      })
+        }).filter((item) => item);
+      });
     },
     getRelations() {
       let pa = {
-        Filters: `FloorId='${this.buildFloor[1]}';GraphType='${this.type}';ZoneType='${this.zoneType}'`
-      }
-      querySpaceNeighborhood(pa, res => {
-        let tempArr = res.Content.map(t => {
-          let p1 = t.LocationOne.split(',');
-          let p2 = t.LocationTwo.split(',');
+        Filters: `FloorId='${this.buildFloor[1]}';GraphType='${this.type}';ZoneType='${this.zoneType}'`,
+      };
+      querySpaceNeighborhood(pa, (res) => {
+        let tempArr = res.Content.map((t) => {
+          let p1 = t.LocationOne.split(",");
+          let p2 = t.LocationTwo.split(",");
           return {
             LocationOne: new SPoint(p1[0], -p1[1]),
             LocationTwo: new SPoint(p2[0], -p2[1]),
             SpaceIdOne: t.SpaceIdOne,
             SpaceIdTwo: t.SpaceIdTwo,
-          }
-        })
+          };
+        });
         this.clearRelation();
         this.scene.addAllRelaPoint(tempArr);
         this.canvasLoading = false;
-      })
+      });
     },
     // 获取当前分区下的业务空间
     getBusinessSpace() {
-      this.canvasLoading = true
+      this.canvasLoading = true;
       let pa = {
         Filters: `not RoomID isNull`,
         Orders: "createTime desc, RoomID asc",
         PageSize: 1000,
-        ZoneType: this.zoneType
-      }
+        ZoneType: this.zoneType,
+      };
       if (this.buildFloor.length && this.buildFloor.length > 1) {
         pa.BuildingId = this.buildFloor[0];
         pa.FloorId = this.buildFloor[1];
       } else {
         this.$message.warning("请选择建筑楼层");
       }
-      zoneQueryOutline(pa, res => {
+      zoneQueryOutline(pa, (res) => {
         // 所有业务空间
         this.businessSpaceList = res.Content;
         // 已关联元空间的业务空间
         this.BSPRelaISPList = [];
-        res.Content.map(t => {
+        res.Content.map((t) => {
           if (t.Outline && t.Outline.length) {
-            this.BSPRelaISPList.push(t)
+            this.BSPRelaISPList.push(t);
           }
-        })
+        });
         // 绘制业务空间
         let tempArr = this.BSPRelaISPList.map((t, i) => {
-          if (t.FloorId == this.buildFloor[1] && t.ObjectType == this.zoneType) {
+          if (
+            t.FloorId == this.buildFloor[1] &&
+            t.ObjectType == this.zoneType
+          ) {
             return {
               RoomLocalName: t.RoomLocalName,
               OutLine: t.Outline,
               RoomID: t.RoomID,
               Color: colorArr[i % colorArr.length],
-            }
+            };
           } else {
-            console.log('internet slow')
+            console.log("internet slow");
             return undefined;
           }
-        }).filter(item => item)
+        }).filter((item) => item);
         this.scene.removeAllZone();
         this.scene.addZoneList(tempArr);
-        this.scene.click(this, this.canvasClick)
+        this.scene.click(this, this.canvasClick);
         // 绘制关系
         this.getRelations();
-      })
+      });
     },
     // 创建邻接关系
     createRela(param) {
-      console.log(param)
-      createSpaceNeighborhood(param, res => {
-        this.$message.success('创建成功')
-      })
-    }
+      console.log(param);
+      createSpaceNeighborhood(param, (res) => {
+        this.$message.success("创建成功");
+      });
+    },
   },
   watch: {
     projectId() {
-      this.FloorMap = '';
+      this.FloorMap = "";
       this.init();
     },
     "view.scale": {
       handler(n) {
         if (this.$refs.canvasFun) {
-          let s = n * 10 / this.view.minScale
+          let s = (n * 10) / this.view.minScale;
           this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s;
         }
-      }
+      },
     },
     "scene.curRemoveItem": {
       handler(n) {
         if (n) {
-          let pa = [{
-            GraphType: this.type,
-            ZoneType: this.zoneType,
-            SpaceIdOne: n.startZone,
-            SpaceIdTwo: n.endZone
-          }]
-          delSpaceNeighborhood(pa, res => {
-            this.$message.success('删除成功');
-          })
+          let pa = [
+            {
+              GraphType: this.type,
+              ZoneType: this.zoneType,
+              SpaceIdOne: n.startZone,
+              SpaceIdTwo: n.endZone,
+            },
+          ];
+          delSpaceNeighborhood(pa, (res) => {
+            this.$message.success("删除成功");
+          });
         }
-      }
-    }
-  }
-}
+      },
+    },
+  },
+};
 </script>
 <style lang="less" scoped>
 #spaceRelation {