|
@@ -14,6 +14,7 @@ import { SGraphyView } from "@sybotan-web/graphy/lib";
|
|
|
import { DivideFloorScene } from "cad-engine"
|
|
|
import { SColor, SPoint } from "@sybotan-web/draw/lib";
|
|
|
import canvasFun from "@/components/business_space/newGraphy/canvasFun"
|
|
|
+import { floorQuery } from "@/api/scan/request";
|
|
|
export default {
|
|
|
components: {
|
|
|
canvasFun
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
created() {
|
|
|
this.modelId = this.$route.query.modelId;
|
|
|
this.FloorID = this.$route.query.FloorID;
|
|
|
- this.Outline = this.$route.query.Outline || [];
|
|
|
+ this.OutlineFlag = this.$route.query.OutlineFlag;
|
|
|
},
|
|
|
mounted() {
|
|
|
this.cadWidth = document.getElementById(`drawFloor${this.id}`).offsetWidth;
|
|
@@ -56,31 +57,44 @@ export default {
|
|
|
let that = this;
|
|
|
that.clearGraphy()
|
|
|
let id = `floorCanvas${that.id}`;
|
|
|
- console.log(id)
|
|
|
that.view = new SGraphyView(id)
|
|
|
that.drawMainScene = new DivideFloorScene();
|
|
|
that.canvasLoading = true;
|
|
|
+ // base/a12a88d1d92411e98e2ded11576ff4c3.jsonz
|
|
|
+ // that.drawMainScene.loadUrl(`/image-service/common/file_get?systemId=revit&key=base/a12a88d1d92411e98e2ded11576ff4c3.jsonz`).then(res=>{
|
|
|
+ // console.log(res)
|
|
|
+ // that.view.scene = that.drawMainScene
|
|
|
+ // that.view.fitSceneToView();
|
|
|
+ // })
|
|
|
that.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: ModelId }).then(res => {
|
|
|
- // let Elements = res.EntityList[0].Elements;
|
|
|
- // let flag = false;
|
|
|
- // for (let key in Elements) {
|
|
|
- // if (Elements[key].length > 0) {
|
|
|
- // flag = true;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (flag) {
|
|
|
- that.view.scene = that.drawMainScene
|
|
|
- that.view.fitSceneToView();
|
|
|
- that.canvasLoading = false;
|
|
|
- // that.view.maxScale = that.view.scale * 1000;
|
|
|
- // that.$refs.canvasFun.maxScale = that.view.maxScale;
|
|
|
- // if (that.Outline.length) {
|
|
|
- // let newArr = that.Outline.map(t => {
|
|
|
- // return new SPoint(t.X, t.Y);
|
|
|
- // })
|
|
|
- // that.drawMainScene.addSceneMark(newArr)
|
|
|
- // }
|
|
|
- // }
|
|
|
+ let Elements = res.EntityList[0].Elements;
|
|
|
+ let flag = false;
|
|
|
+ for (let key in Elements) {
|
|
|
+ if (Elements[key].length > 0) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ that.view.scene = that.drawMainScene
|
|
|
+ that.view.fitSceneToView();
|
|
|
+ that.canvasLoading = false;
|
|
|
+ that.view.maxScale = that.view.scale * 1000;
|
|
|
+ that.$refs.canvasFun.maxScale = that.view.maxScale;
|
|
|
+ if (that.OutlineFlag) {
|
|
|
+ this.getFloorData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFloorData() {
|
|
|
+ let pa = {
|
|
|
+ Filters: `FloorID='${this.FloorID}'`
|
|
|
+ }
|
|
|
+ floorQuery(pa, res => {
|
|
|
+ let newArr = res.Content[0].Outline.map(t => {
|
|
|
+ return new SPoint(t.X, t.Y);
|
|
|
+ })
|
|
|
+ this.drawMainScene.addSceneMark(newArr)
|
|
|
})
|
|
|
},
|
|
|
// 清空平面图
|