|
@@ -5,25 +5,26 @@
|
|
|
<div class="obj-item" v-for="form in forms" :key="form.id">
|
|
|
<el-form :model="form" label-width="150px">
|
|
|
<el-form-item label="对象类型:">
|
|
|
- {{form.TypeName}}
|
|
|
+ {{form.TypeName || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对象实例本地名称:">
|
|
|
- {{form.ObjectLocalName}}
|
|
|
+ {{form.ObjectLocalName || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对象实例本地编码:">
|
|
|
- {{form.ObjectLocalCode}}
|
|
|
+ {{form.ObjectLocalCode || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对象实例ID:">
|
|
|
- {{form.ObjectID}}
|
|
|
+ {{form.ObjectID || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="信息点名称:">
|
|
|
- {{form.InfomationPointName}}
|
|
|
+ {{form.InfomationPointName || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对应值:">
|
|
|
- {{ reValue }}
|
|
|
+ {{ reValue || '--'}}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="对象实例位置图:">
|
|
|
- <canvas height="200" width="100" class="instanceMap" :id="form.instanceId" v-loading="form.loading"></canvas>
|
|
|
+ <span v-if="!drawCanvas">--</span>
|
|
|
+ <canvas v-else height="300px" width="600" class="instanceMap" :id="form.instanceId" v-loading="form.loading"></canvas>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -34,12 +35,16 @@
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
|
|
|
|
|
import { SGraphyView } from "@sybotan-web/graphy/lib";
|
|
|
-import { DivideFloorScene, } from "cad-engine"
|
|
|
+import { LocationPointScene, DivideFloorScene } from "cad-engine"
|
|
|
import { SColor, SPoint } from "@sybotan-web/draw/lib";
|
|
|
|
|
|
import {
|
|
|
- getTabFunNumObjInstance
|
|
|
+ getTabFunNumObjInstance, getEquipByEqID, getFloorMsgByFloorID
|
|
|
} from '@/api/point/request'
|
|
|
+import {
|
|
|
+ queryZone
|
|
|
+} from '@/api/scan/request'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -48,7 +53,10 @@ export default {
|
|
|
views: [],
|
|
|
scenes: [],
|
|
|
loading: true,
|
|
|
- BSPRelaISPLists: [[]]
|
|
|
+ canvasLoadings: [],
|
|
|
+ BSPRelaISPLists: [[]],
|
|
|
+ refreshCanvas:'',
|
|
|
+ drawCanvas:true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -56,72 +64,131 @@ export default {
|
|
|
loadObjectInstance() {
|
|
|
this.loading = true;
|
|
|
let pa = {
|
|
|
- Filters: "MeterFuncid='" + this.tabFunNum + "'"
|
|
|
+ Filters: `MeterFuncid='${this.tabFunNum}';Related='true'`//
|
|
|
};
|
|
|
-
|
|
|
let that = this;
|
|
|
+ //获取所有实例
|
|
|
getTabFunNumObjInstance(pa, res => {
|
|
|
that.loading = false;
|
|
|
that.forms = res.Content;
|
|
|
+ //清除画布
|
|
|
that.clearGraphy()
|
|
|
- //加载canvas
|
|
|
- // that.forms.map((key, item) => {
|
|
|
- // that.views[key] = new SGraphyView('floorCanvas')
|
|
|
- // that.scenes[key] = new DivideFloorScene();
|
|
|
- // that.forms[key].loading = flase;
|
|
|
+ //实例化所有实例
|
|
|
+ res.Content.map((item, key) => {
|
|
|
+ if (item.ObjectID) {
|
|
|
+
|
|
|
+ that.forms[key].instanceId = item.ObjectID;
|
|
|
+ console.log(item.ObjectID);
|
|
|
+ //设备或者组件
|
|
|
+ if (item.TypeCode == 'Eq' || item.TypeCode == 'Ec') {
|
|
|
+ let pa = {
|
|
|
+ Filters: `EquipID='${item.TypeCode + this.projectId.substring(2) + item.ObjectID}'`
|
|
|
+ }
|
|
|
+ getEquipByEqID(pa, res1 => {
|
|
|
+ console.log(res1);
|
|
|
+ if (res1.Content[0].LocationJson && res1.Content[0].FloorId) {
|
|
|
+ let param = {
|
|
|
+ Filters: `FloorId='${res1.Content[0].FloorId}'`
|
|
|
+ }
|
|
|
+ getFloorMsgByFloorID(param, res2 => {
|
|
|
+ // this.clearGraphy();
|
|
|
+ // that.refreshCanvas = new Date().getTime();
|
|
|
+ if(!that.views[key]){
|
|
|
+ that.views[key] = new SGraphyView(`${that.forms[key].instanceId}`)
|
|
|
+ }
|
|
|
+ that.views[key].scene = null;
|
|
|
+ that.scenes[key] = null;
|
|
|
+ console.log(that.forms[key].instanceId)
|
|
|
+ that.scenes[key] = new LocationPointScene();
|
|
|
+ that.canvasLoadings[key] = true;
|
|
|
+
|
|
|
+ if (res2.Content[0].StructureInfo && res2.Content[0].StructureInfo.FloorMap) {
|
|
|
+ that.scenes[key].loadUrl(`/image-service/common/file_get?systemId=revit&key=${res2.Content[0].StructureInfo.FloorMap}`).then(() => {
|
|
|
+ that.forms[key].loading = false;
|
|
|
+ that.views[key].scene = that.scenes[key];
|
|
|
+ that.scenes[key].isSpaceSelectable = false;
|
|
|
+ let canvasOption = {
|
|
|
+ /** 标记的id */
|
|
|
+ Id: res1.Content[0].EquipID,
|
|
|
+ /** 标记的名称 */
|
|
|
+ Name: res1.Content[0].EquipName,
|
|
|
+ /** X坐标 */
|
|
|
+ X: res1.Content[0].LocationJson.X,
|
|
|
+ /** Y坐标 */
|
|
|
+ Y: -res1.Content[0].LocationJson.Y
|
|
|
+ }
|
|
|
+ that.scenes[key].addMarker(canvasOption);
|
|
|
+ that.views[key].fitSceneToView();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else if (item.TypeCode == 'Sp') {
|
|
|
+ let pa = {
|
|
|
+ data: {
|
|
|
+ Filters: `RoomID='${item.TypeCode + this.projectId.substring(2) + item.ObjectID}'`
|
|
|
+ },
|
|
|
+ zone: item.SubTypeCode
|
|
|
+ }
|
|
|
+ queryZone(pa, res1 => {
|
|
|
+ if (res1.Content[0] && res1.Content[0].Outline) {
|
|
|
+ let param = {
|
|
|
+ Filters: `FloorId='${res1.Content[0].FloorId}'`
|
|
|
+ }
|
|
|
+ getFloorMsgByFloorID(param, res2 => {
|
|
|
+ // this.clearGraphy();
|
|
|
+ // that.refreshCanvas = new Date().getTime();
|
|
|
+ if(!that.views[key]){
|
|
|
+ that.views[key] = new SGraphyView(`${that.forms[key].instanceId}`)
|
|
|
+ }
|
|
|
+ that.views[key].scene = null;
|
|
|
+ that.scenes[key] = null;
|
|
|
+ that.scenes[key] = new DivideFloorScene();
|
|
|
+ that.canvasLoadings[key] = true;
|
|
|
|
|
|
- // that.scenes[key].loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(() => {
|
|
|
- // that.forms[key].loading = false;
|
|
|
- // that.views[key].scene = that.scenes[key];
|
|
|
- // let tempArr = that.BSPRelaISPLists[key].map((t, i) => {
|
|
|
- // return {
|
|
|
- // RoomLocalName: t.RoomLocalName,
|
|
|
- // OutLine: t.Outline,
|
|
|
- // RoomID: t.RoomID,
|
|
|
- // Color: new SColor(colorArr[i % colorArr.length]),
|
|
|
- // }
|
|
|
- // })
|
|
|
- // that.scenes[key].addZoneList(tempArr);
|
|
|
- // that.scenes[key].click(that, that.canvasClick)
|
|
|
- // that.views[key].fitSceneToView();
|
|
|
- // that.views[key].maxScale = that.views[key].scale * 10;
|
|
|
- // that.views[key].minScale = that.views[key].scale;
|
|
|
- // // that.$refs.canvasFun.everyScale = that.views[key].scale;
|
|
|
- // })
|
|
|
- // });
|
|
|
+ if (res2.Content[0].StructureInfo && res2.Content[0].StructureInfo.FloorMap) {
|
|
|
+ that.scenes[key].loadUrl(`/image-service/common/file_get?systemId=revit&key=${res2.Content[0].StructureInfo.FloorMap}`).then(() => {
|
|
|
+ that.forms[key].loading = false;
|
|
|
+ that.views[key].scene = that.scenes[key];
|
|
|
+ that.scenes[key].isSpaceSelectable = false;
|
|
|
+ let canvasOption = {
|
|
|
+ RoomLocalName: res1.Content[0].RoomLocalName,
|
|
|
+ OutLine: res1.Content[0].Outline,
|
|
|
+ RoomID: res1.Content[0].RoomID,
|
|
|
+ Color: new SColor('#F9C3C3')
|
|
|
+ }
|
|
|
+ that.scenes[key].addZone(canvasOption);
|
|
|
+ that.views[key].fitSceneToView();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.drawCanvas = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.drawCanvas = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.drawCanvas = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
},
|
|
|
- //清楚画布
|
|
|
+ //清除画布
|
|
|
clearGraphy() {
|
|
|
- if (this.view) {
|
|
|
+ if (this.views.length) {
|
|
|
this.views = [];
|
|
|
- this.scenes = this.scenes.map(item => {
|
|
|
- item.root.children = null;
|
|
|
- return item;
|
|
|
- })
|
|
|
+ // this.scenes.map(())
|
|
|
this.scenes = [];
|
|
|
}
|
|
|
- },
|
|
|
- // canvas点击事件
|
|
|
- canvasClick(item, event) {
|
|
|
- // this.scene.setSpaceSelectable(true);
|
|
|
- // this.scene.setZoneSelectable(true);
|
|
|
- // if (this.type == 4) {
|
|
|
-
|
|
|
- // } else {
|
|
|
- // if (item instanceof SpaceItem) {
|
|
|
- // this.type = 3;
|
|
|
- // this.curZoneItem = {};
|
|
|
- // this.scene.setZoneSelectable(false);
|
|
|
- // }
|
|
|
- // if (item instanceof ZoneItem) {
|
|
|
- // this.type = 2;
|
|
|
- // this.curZoneItem = item;
|
|
|
- // this.scene.setSpaceSelectable(false);
|
|
|
- // }
|
|
|
- // }
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.loadObjectInstance();
|
|
@@ -155,5 +222,6 @@ export default {
|
|
|
box-shadow: 2px 2px 2px 2px #aaa;
|
|
|
background-color: white;
|
|
|
padding: 10px 10px;
|
|
|
+ height: 600px;
|
|
|
}
|
|
|
</style>
|