|
@@ -21,7 +21,7 @@ import store from "../store";
|
|
import { Loading } from "element-ui";
|
|
import { Loading } from "element-ui";
|
|
import { Message } from 'element-ui';
|
|
import { Message } from 'element-ui';
|
|
let fengmap = null;
|
|
let fengmap = null;
|
|
-
|
|
|
|
|
|
+//// 底图空间增加字段 isExtracted:boolean true 已被提取过
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
cmdType: {
|
|
cmdType: {
|
|
@@ -91,52 +91,10 @@ export default {
|
|
.then(response => {
|
|
.then(response => {
|
|
console.log("获取rf成功", response);
|
|
console.log("获取rf成功", response);
|
|
this.parserData(floorid);
|
|
this.parserData(floorid);
|
|
|
|
+ this.readGraph()
|
|
loadings.close();
|
|
loadings.close();
|
|
});
|
|
});
|
|
this.view.fitSceneToView();
|
|
this.view.fitSceneToView();
|
|
-
|
|
|
|
- });
|
|
|
|
- // 获取主题数据
|
|
|
|
- this.readGroup().then(data => {
|
|
|
|
- this.graphId = data.Data[0].ID;
|
|
|
|
- bus.$emit('setGraphId',this.graphId)
|
|
|
|
- if (data.Data) {
|
|
|
|
- const parserData = new STopologyParser(null);
|
|
|
|
- parserData.parseData(data.Data[0].Elements);
|
|
|
|
- // 多边形
|
|
|
|
- parserData.zoneLegendList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Nodes.push(t);
|
|
|
|
- });
|
|
|
|
- // 增加文字
|
|
|
|
- parserData.textMarkerList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Markers.push(t);
|
|
|
|
- });
|
|
|
|
- // 增加图片
|
|
|
|
- parserData.imageMarkerList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Markers.push(t);
|
|
|
|
- });
|
|
|
|
- // 增加直线
|
|
|
|
- parserData.lineMarkerList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Markers.push(t);
|
|
|
|
- });
|
|
|
|
- // 增加图标类图例
|
|
|
|
- parserData.imageLegendList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Nodes.push(t);
|
|
|
|
- });
|
|
|
|
- // 增加管线类
|
|
|
|
- // 增加图标类图例
|
|
|
|
- parserData.relationList.forEach(t => {
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- this.scene.Relations.push(t);
|
|
|
|
- });
|
|
|
|
- this.view.fitSceneToView();
|
|
|
|
- bus.$emit("elementDataChange", this.scene);
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
// 获取typeid
|
|
// 获取typeid
|
|
this.getTypeId();
|
|
this.getTypeId();
|
|
@@ -166,8 +124,11 @@ export default {
|
|
}
|
|
}
|
|
this.fParser = new SFloorParser(null);
|
|
this.fParser = new SFloorParser(null);
|
|
this.fParser.parseData(res);
|
|
this.fParser.parseData(res);
|
|
|
|
+ this.scene.fidToItem = {}
|
|
this.fParser.spaceList.forEach(t => {
|
|
this.fParser.spaceList.forEach(t => {
|
|
|
|
+ t.zOrder = t.zOrder + t.data.Height;
|
|
t.selectable = true;
|
|
t.selectable = true;
|
|
|
|
+ this.scene.fidToItem[t.data.SourceId] = t;
|
|
this.scene.addItem(t);
|
|
this.scene.addItem(t);
|
|
});
|
|
});
|
|
this.scene.spaceList = this.fParser.spaceList;
|
|
this.scene.spaceList = this.fParser.spaceList;
|
|
@@ -190,6 +151,54 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 读取绘制数据
|
|
|
|
+ readGraph(){
|
|
|
|
+ this.readGroup().then(data => {
|
|
|
|
+ this.graphId = data.Data[0].ID;
|
|
|
|
+ bus.$emit('setGraphId',this.graphId)
|
|
|
|
+ if (data.Data) {
|
|
|
|
+ const parserData = new STopologyParser(null);
|
|
|
|
+ parserData.parseData(data.Data[0].Elements);
|
|
|
|
+ // 多边形
|
|
|
|
+ parserData.zoneLegendList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ // 记录提取
|
|
|
|
+ if (t.data.Properties && t.data.Properties.FID) {
|
|
|
|
+ this.scene.fidToItem[t.data.Properties.FID].isExtracted = true
|
|
|
|
+ }
|
|
|
|
+ this.scene.Nodes.push(t);
|
|
|
|
+ });
|
|
|
|
+ // 增加文字
|
|
|
|
+ parserData.textMarkerList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ this.scene.Markers.push(t);
|
|
|
|
+ });
|
|
|
|
+ // 增加图片
|
|
|
|
+ parserData.imageMarkerList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ this.scene.Markers.push(t);
|
|
|
|
+ });
|
|
|
|
+ // 增加直线
|
|
|
|
+ parserData.lineMarkerList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ this.scene.Markers.push(t);
|
|
|
|
+ });
|
|
|
|
+ // 增加图标类图例
|
|
|
|
+ parserData.imageLegendList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ this.scene.Nodes.push(t);
|
|
|
|
+ });
|
|
|
|
+ // 增加管线类
|
|
|
|
+ // 增加图标类图例
|
|
|
|
+ parserData.relationList.forEach(t => {
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ this.scene.Relations.push(t);
|
|
|
|
+ });
|
|
|
|
+ this.view.fitSceneToView();
|
|
|
|
+ bus.$emit("elementDataChange", this.scene);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 监听变化
|
|
// 监听变化
|
|
emitChange(itemMsg) {
|
|
emitChange(itemMsg) {
|
|
this.chiceItemList = itemMsg.itemList;
|
|
this.chiceItemList = itemMsg.itemList;
|
|
@@ -283,30 +292,34 @@ export default {
|
|
saveGroup(data).then(res => {
|
|
saveGroup(data).then(res => {
|
|
Message.close()
|
|
Message.close()
|
|
console.log("aaaaaaaaaaaaaa", res);
|
|
console.log("aaaaaaaaaaaaaa", res);
|
|
|
|
+ this.graphId = res.Data;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
bus.$on("exportByKey", val => {
|
|
bus.$on("exportByKey", val => {
|
|
const list = this.fParser.spaceList
|
|
const list = this.fParser.spaceList
|
|
.map(t => {
|
|
.map(t => {
|
|
if (t.data.Type == val.key) {
|
|
if (t.data.Type == val.key) {
|
|
- return {
|
|
|
|
- ID: uuid(),
|
|
|
|
- Name: val.name,
|
|
|
|
- GraphElementType: val.properties.Type,
|
|
|
|
- GraphElementId: "273d633cc5c54a4882794b34843d1a00",
|
|
|
|
- AttachObjectIds: [],
|
|
|
|
- Pos: { x: t.x, y: t.y },
|
|
|
|
- OutLine: t.pointArr[0],
|
|
|
|
- SubType: "",
|
|
|
|
- Properties: {
|
|
|
|
- StrokeColor: "#3d73c0",
|
|
|
|
- FillColor: "#72f5f980",
|
|
|
|
- font: 0,
|
|
|
|
- color: "",
|
|
|
|
- TextPos: { X: 0, Y: 0 }
|
|
|
|
- },
|
|
|
|
- Num: 1
|
|
|
|
- };
|
|
|
|
|
|
+ if (!t.isExtracted) {
|
|
|
|
+ t.isExtracted = true
|
|
|
|
+ return {
|
|
|
|
+ ID: uuid(),
|
|
|
|
+ Name: val.name,
|
|
|
|
+ GraphElementType: val.properties.Type,
|
|
|
|
+ GraphElementId: "273d633cc5c54a4882794b34843d1a00",
|
|
|
|
+ AttachObjectIds: [],
|
|
|
|
+ Pos: { x: t.x, y: t.y },
|
|
|
|
+ OutLine: t.pointArr[0],
|
|
|
|
+ SubType: "",
|
|
|
|
+ Properties: {
|
|
|
|
+ StrokeColor: "#3d73c0",
|
|
|
|
+ FillColor: "#72f5f980",
|
|
|
|
+ font: 0,
|
|
|
|
+ color: "",
|
|
|
|
+ TextPos: { X: 0, Y: 0 }
|
|
|
|
+ },
|
|
|
|
+ Num: 1
|
|
|
|
+ };
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.filter(item => item);
|
|
.filter(item => item);
|
|
@@ -377,6 +390,10 @@ export default {
|
|
}),
|
|
}),
|
|
//发布图
|
|
//发布图
|
|
bus.$on("publishMap", () => {
|
|
bus.$on("publishMap", () => {
|
|
|
|
+ if(this.graphId==''){
|
|
|
|
+ this.$message.error('请先保存');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
this.publishBtn()
|
|
this.publishBtn()
|
|
})
|
|
})
|
|
/**
|
|
/**
|
|
@@ -424,13 +441,15 @@ export default {
|
|
publishGraph(data).then(res => {
|
|
publishGraph(data).then(res => {
|
|
loadings.close();
|
|
loadings.close();
|
|
if (res.Result == "success") {
|
|
if (res.Result == "success") {
|
|
- this.$message.success(res.Message);
|
|
|
|
- const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
|
|
|
|
- const url =
|
|
|
|
- window.location.origin +
|
|
|
|
- "/wandaEditer/drafts?" +
|
|
|
|
- encodeURIComponent(data);
|
|
|
|
- window.open(url, true);
|
|
|
|
|
|
+ this.$message.success('发布成功');
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
|
|
|
|
+ const url =
|
|
|
|
+ window.location.origin +
|
|
|
|
+ "/wandaEditer/drafts?" +
|
|
|
|
+ encodeURIComponent(data);
|
|
|
|
+ window.open(url, true);
|
|
|
|
+ },1000);
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.Message);
|
|
this.$message.error(res.Message);
|
|
}
|
|
}
|