|
@@ -24,7 +24,7 @@
|
|
|
<p>平面图上的位置:<span>{{ item.local | localTransformation }}</span></p>
|
|
|
<div class="img-box">
|
|
|
<canvas :id="'canvas'+index" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"
|
|
|
- :data-modelid="item.modelId"
|
|
|
+ :data-modelid="equipComAddMap[item.modelId]"
|
|
|
:data-equipid='item.id' :data-x="item.local.X" :data-y="item.local.Y"></canvas>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
pageData: [],
|
|
|
- equipComDelList: null,
|
|
|
+ equipComAddMap: null,
|
|
|
canvasWidth: 400,
|
|
|
canvasHeight: 280,
|
|
|
scene: '',
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
created() {
|
|
|
- this.equipComDelList = decodeURIComponent(this.$route.query.equipComDelList);
|
|
|
+ this.equipComAddMap = this.$route.query;
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters('layout', ['projectId'])
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
},
|
|
|
getToBeSuppement() {
|
|
|
let params = {
|
|
|
- filters: `modelId in ${this.equipComDelList}`,
|
|
|
+ filters: `modelId in ${JSON.stringify(Object.keys(this.equipComAddMap))}`,
|
|
|
pageNumber: this.page.pageNumber,
|
|
|
pageSize: this.page.pageSize
|
|
|
}
|
|
@@ -168,7 +168,6 @@ export default {
|
|
|
this.getGraphy();
|
|
|
})
|
|
|
}
|
|
|
- // this.pageData = res.Content;
|
|
|
this.pageData.forEach(item => {
|
|
|
if (item.bimLocation) {
|
|
|
let local = {};
|
|
@@ -198,35 +197,38 @@ export default {
|
|
|
getGraphy() {// 绘制空间位置图片
|
|
|
let can = this.$refs.canvas;
|
|
|
let that = this;
|
|
|
- let modelId = can[this.i].dataset.modelid;
|
|
|
- that.clearGraphy(this.i)
|
|
|
- that.scene = new LocationPointScene();
|
|
|
- this.canvasLoading = true;
|
|
|
- that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: modelId }).then(res => {
|
|
|
- that.canvasLoading = false;
|
|
|
- if (res == 'error') {
|
|
|
- this.FloorMap = '';
|
|
|
- console.log('数据解析异常');
|
|
|
- return;
|
|
|
- }
|
|
|
- let equipId = can[this.i].dataset.equipid;
|
|
|
- let X = Number(can[this.i].dataset.x);
|
|
|
- let Y = can[this.i].dataset.y * -1;
|
|
|
- that.view.scene = that.scene;
|
|
|
- this.scene.addMarker({
|
|
|
- Id: equipId,
|
|
|
- X: X,
|
|
|
- Y: Y
|
|
|
+ if (can && can.length) {
|
|
|
+ let modelId = can[this.i].dataset.modelid;
|
|
|
+ that.clearGraphy(this.i)
|
|
|
+ that.scene = new LocationPointScene();
|
|
|
+ this.canvasLoading = true;
|
|
|
+ that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: modelId }).then(res => {
|
|
|
+ that.canvasLoading = false;
|
|
|
+ if (res == 'error') {
|
|
|
+ this.FloorMap = '';
|
|
|
+ console.log('数据解析异常');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let equipId = can[this.i].dataset.equipid;
|
|
|
+ let X = Number(can[this.i].dataset.x);
|
|
|
+ let Y = can[this.i].dataset.y * -1;
|
|
|
+ that.view.scene = that.scene;
|
|
|
+ this.scene.addMarker({
|
|
|
+ Id: equipId,
|
|
|
+ X: X,
|
|
|
+ Y: Y
|
|
|
+ })
|
|
|
+ that.view.fitSceneToView();
|
|
|
+ that.view.scalable = false;
|
|
|
+ this.scene.isSpaceSelectable = false;
|
|
|
+ this.i++;
|
|
|
+ if (this.i !== this.pageData.length) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.getGraphy();
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- that.view.fitSceneToView();
|
|
|
- this.scene.isSpaceSelectable = false;
|
|
|
- this.i++;
|
|
|
- if (this.i !== this.pageData.length) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.getGraphy();
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
clearGraphy(i) {
|
|
|
this.view = new FloorView(`canvas${i}`)
|