|
@@ -19,7 +19,7 @@
|
|
|
<script>
|
|
|
import canvasFun from "@/components/business_space/newGraphy/canvasFun";
|
|
|
import { SColor, SPoint } from "@saga-web/draw/lib";
|
|
|
-import { DivideFloorScene, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
|
|
|
+import { DivideFloorScene, SpaceItem, ZoneItem, Opt } from "@saga-web/cad-engine/lib";
|
|
|
import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
|
|
|
import { colorArr } from '@/utils/spaceColor';
|
|
|
import { getFloorMsgByFloorID, shaftSpaceQuery, shaftZoneLinkReplace, zoneQuery } from '@/api/scan/request';
|
|
@@ -44,6 +44,7 @@ export default {
|
|
|
isEdit: false,
|
|
|
groupSelect: true
|
|
|
},
|
|
|
+ sceneMarkList: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -54,7 +55,7 @@ export default {
|
|
|
canvasFun
|
|
|
},
|
|
|
created() {
|
|
|
-
|
|
|
+ Opt.sceneMarkColor = new SColor('#ffffff');
|
|
|
},
|
|
|
methods: {
|
|
|
//获取楼层map
|
|
@@ -67,6 +68,12 @@ export default {
|
|
|
getFloorMsgByFloorID(pa, res => {
|
|
|
this.floorMap = res.Content[0].StructureInfo ? res.Content[0].StructureInfo.FloorMap : '';
|
|
|
this.space = space;
|
|
|
+ // 蒙版
|
|
|
+ if (res.Content[0].Outline) {
|
|
|
+ this.sceneMarkList = res.Content[0].Outline.map(t => {
|
|
|
+ return new SPoint(t.X, t.Y);
|
|
|
+ })
|
|
|
+ }
|
|
|
this.getGraphy();
|
|
|
})
|
|
|
}
|
|
@@ -87,6 +94,7 @@ export default {
|
|
|
getGraphy() {
|
|
|
let that = this;
|
|
|
that.clearGraphy()
|
|
|
+ if (!this.floorMap) return
|
|
|
that.scene = new DivideFloorScene();
|
|
|
that.canvasLoading = true;
|
|
|
that.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.floorMap}`).then(res => {
|
|
@@ -97,10 +105,13 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
that.view.scene = that.scene;
|
|
|
+ if (that.sceneMarkList.length) {
|
|
|
+ that.scene.addSceneMark(that.sceneMarkList)
|
|
|
+ }
|
|
|
that.scene.isSpaceSelectable = false;
|
|
|
// 绘制业务空间
|
|
|
that.getBusinessSpace();
|
|
|
- that.view.fitSceneToView();
|
|
|
+ that.fit();
|
|
|
that.view.minScale = that.view.scale;
|
|
|
if (that.$refs.canvasFun) {
|
|
|
that.$refs.canvasFun.everyScale = that.view.scale;
|
|
@@ -244,6 +255,10 @@ export default {
|
|
|
},
|
|
|
// 适配底图到窗口
|
|
|
fit() {
|
|
|
+ if (this.scene.sceneMark) {
|
|
|
+ this.view.fitItemToView([this.scene.sceneMark])
|
|
|
+ return
|
|
|
+ }
|
|
|
this.view.fitSceneToView()
|
|
|
},
|
|
|
// 缩放
|