|
@@ -21,6 +21,8 @@ import {
|
|
getBussines2, //
|
|
getBussines2, //
|
|
} from "@/api/scan/request";
|
|
} from "@/api/scan/request";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
|
+import pako from '@/assets/pako/pako'
|
|
|
|
+import axios from "axios";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -30,6 +32,7 @@ export default {
|
|
label: "BuildLocalName",
|
|
label: "BuildLocalName",
|
|
children: "Floor"
|
|
children: "Floor"
|
|
},
|
|
},
|
|
|
|
+ floorIdToMap: {}, //楼层id->楼层图
|
|
options: [],
|
|
options: [],
|
|
tabsList: [
|
|
tabsList: [
|
|
{
|
|
{
|
|
@@ -57,7 +60,8 @@ export default {
|
|
"Code": 'TenantZone'
|
|
"Code": 'TenantZone'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- allSiListMap: {}, //Si id 与轮廓线的对应关系
|
|
|
|
|
|
+ allSiListMap: {}, //Si id ->sourceid
|
|
|
|
+ sourceIdToOutline: {}, //sourceid -> outline
|
|
graphyId: '',
|
|
graphyId: '',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -97,7 +101,6 @@ export default {
|
|
queryZone(pa, res => {
|
|
queryZone(pa, res => {
|
|
res.Content.map(t => {
|
|
res.Content.map(t => {
|
|
let arr = t.BIMID.split(":");
|
|
let arr = t.BIMID.split(":");
|
|
- //arr[1] sourceid
|
|
|
|
this.allSiListMap[t.RoomID] = arr[1];
|
|
this.allSiListMap[t.RoomID] = arr[1];
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -146,6 +149,7 @@ export default {
|
|
t.Floor = t.Floor.map(item => {
|
|
t.Floor = t.Floor.map(item => {
|
|
item.BuildID = item.FloorID;
|
|
item.BuildID = item.FloorID;
|
|
item.BuildLocalName = item.FloorLocalName;
|
|
item.BuildLocalName = item.FloorLocalName;
|
|
|
|
+ this.floorIdToMap[item.FloorID] = item.StructureInfo ? item.StructureInfo.FloorMap : ''
|
|
return item;
|
|
return item;
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -157,8 +161,7 @@ export default {
|
|
},
|
|
},
|
|
// 切换楼层
|
|
// 切换楼层
|
|
changeCascader() {
|
|
changeCascader() {
|
|
- this.getGraphy();
|
|
|
|
- this.querySi();
|
|
|
|
|
|
+ this.getJson(this.floorIdToMap[this.buildFloorSelectd[1]])
|
|
},
|
|
},
|
|
// 获取tabs的列表
|
|
// 获取tabs的列表
|
|
getTypes() {
|
|
getTypes() {
|
|
@@ -189,12 +192,10 @@ export default {
|
|
Outline: []
|
|
Outline: []
|
|
}
|
|
}
|
|
t.children.map(item => {
|
|
t.children.map(item => {
|
|
- obj.Outline.push(this.allSiListMap[item]);
|
|
|
|
|
|
+ obj.Outline.push(this.sourceIdToOutline[this.allSiListMap[item]]);
|
|
})
|
|
})
|
|
pa.data.Content.push(obj);
|
|
pa.data.Content.push(obj);
|
|
})
|
|
})
|
|
- console.log(pa)
|
|
|
|
- // return
|
|
|
|
updateZone(pa, res => { console.log(res) })
|
|
updateZone(pa, res => { console.log(res) })
|
|
},
|
|
},
|
|
// 查询绑定了元空间的业务空间
|
|
// 查询绑定了元空间的业务空间
|
|
@@ -237,37 +238,25 @@ export default {
|
|
responseType: 'blob',
|
|
responseType: 'blob',
|
|
}).then(res => {
|
|
}).then(res => {
|
|
let data = null
|
|
let data = null
|
|
- var blob = res.data;
|
|
|
|
- var reader = new FileReader();
|
|
|
|
|
|
+ let blob = res.data;
|
|
|
|
+ let reader = new FileReader();
|
|
reader.readAsBinaryString(blob)
|
|
reader.readAsBinaryString(blob)
|
|
let _this = this
|
|
let _this = this
|
|
reader.onload = function (readerEvt) {
|
|
reader.onload = function (readerEvt) {
|
|
- var binaryString = readerEvt.target.result;
|
|
|
|
|
|
+ let binaryString = readerEvt.target.result;
|
|
let base64Data = btoa(binaryString)
|
|
let base64Data = btoa(binaryString)
|
|
let unGzipData = pako.unzip(base64Data)
|
|
let unGzipData = pako.unzip(base64Data)
|
|
data = unGzipData
|
|
data = unGzipData
|
|
- _this.exportJsonData = JSON.stringify(data);
|
|
|
|
- _this.jsonId = jsonId.split('.')[0];
|
|
|
|
- _this.dataMax = tools.getPoint(data);
|
|
|
|
- if (data.SpaceList && data.SpaceList.length) {
|
|
|
|
- tools.changeMap(data.SpaceList, -1, "Paths");
|
|
|
|
- }
|
|
|
|
let ids = [];
|
|
let ids = [];
|
|
if (data.SpaceList && data.SpaceList.length) {
|
|
if (data.SpaceList && data.SpaceList.length) {
|
|
data.SpaceList.map(items => {
|
|
data.SpaceList.map(items => {
|
|
- items.BimId = _this.buildMess.code + ":" + items.BimId;
|
|
|
|
- ids.push(items.BimId);
|
|
|
|
|
|
+ _this.sourceIdToOutline[items.BimId] = items.Paths;
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
_this.$message("没有元空间数据")
|
|
_this.$message("没有元空间数据")
|
|
}
|
|
}
|
|
- if (!!ids && ids.length) {
|
|
|
|
- _this.bimIdToId(ids, data);
|
|
|
|
- } else {
|
|
|
|
- //没有id没有map
|
|
|
|
- _this.hasMap = false
|
|
|
|
- }
|
|
|
|
- _this.myLoading = true;
|
|
|
|
|
|
+ _this.getGraphy();
|
|
|
|
+ _this.querySi();
|
|
};
|
|
};
|
|
});
|
|
});
|
|
},
|
|
},
|