|
@@ -8,7 +8,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { SFengParser } from "@saga-web/feng-map";
|
|
|
-import { SFloorParser } from "@saga-web/big";
|
|
|
+import { SFloorParser,SItemStatus } from "@saga-web/big";
|
|
|
import { FloorView } from "./../lib/FloorView";
|
|
|
import { EditScence } from "./mapClass/EditScence";
|
|
|
import bus from "@/bus";
|
|
@@ -22,9 +22,11 @@ import { STopologyParser } from "./../lib/parsers/STopologyParser";
|
|
|
import { uuid } from "@/components/mapClass/until";
|
|
|
import { SImageItem } from "@saga-web/graph/lib";
|
|
|
import { SPainter, SColor, SFont, SPoint } from "@saga-web/draw";
|
|
|
+import { SImageLegendItem } from "@/lib/items/SImageLegendItem";
|
|
|
import store from "../store";
|
|
|
import { Loading } from "element-ui";
|
|
|
import { Message } from "element-ui";
|
|
|
+import { SCircleItem } from "@/lib/items/SCircleItem"
|
|
|
let fengmap = null;
|
|
|
//// 底图空间增加字段 isExtracted:boolean true 已被提取过
|
|
|
export default {
|
|
@@ -160,6 +162,13 @@ export default {
|
|
|
this.fParser.doorList.forEach(t => this.scene.addItem(t));
|
|
|
this.fParser.columnList.forEach(t => this.scene.addItem(t));
|
|
|
this.fParser.casementList.forEach(t => this.scene.addItem(t));
|
|
|
+ this.fParser.pList = [];
|
|
|
+ res.PList.forEach(t => {
|
|
|
+ const item = new SCircleItem(null, t);
|
|
|
+ this.fParser.pList.push(item);
|
|
|
+ this.scene.fidToItem[t.SourceId] = item;
|
|
|
+ this.scene.addItem(item);
|
|
|
+ })
|
|
|
this.view.scene = this.scene;
|
|
|
this.view.fitSceneToView();
|
|
|
this.loading = false;
|
|
@@ -307,9 +316,20 @@ export default {
|
|
|
this.scene.changeAlignItem(val);
|
|
|
});
|
|
|
bus.$on("extractItem", () => {
|
|
|
- const map = {};
|
|
|
+ const map = {},type={};
|
|
|
this.fParser.spaceList.forEach(t => {
|
|
|
if (this.hasTypeList.indexOf(t.data.Type) > -1) {
|
|
|
+ type[t.data.Type] = 'Zone'
|
|
|
+ if (map[t.data.Type]) {
|
|
|
+ map[t.data.Type]++;
|
|
|
+ } else {
|
|
|
+ map[t.data.Type] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.fParser.pList.forEach(t => {
|
|
|
+ if (this.hasTypeList.indexOf(t.data.Type) > -1) {
|
|
|
+ type[t.data.Type] = 'Image'
|
|
|
if (map[t.data.Type]) {
|
|
|
map[t.data.Type]++;
|
|
|
} else {
|
|
@@ -324,6 +344,7 @@ export default {
|
|
|
name: key,
|
|
|
age: "",
|
|
|
number: map[key],
|
|
|
+ type: type[key],
|
|
|
address: "提取"
|
|
|
});
|
|
|
}
|
|
@@ -333,41 +354,89 @@ export default {
|
|
|
this.saveMsg();
|
|
|
});
|
|
|
bus.$on("exportByKey", val => {
|
|
|
- const list = this.fParser.spaceList
|
|
|
- .map(t => {
|
|
|
- if (t.data.Type == val.key) {
|
|
|
- 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
|
|
|
- };
|
|
|
+ if (val.type == "Image") {
|
|
|
+ const list = this.fParser.pList.map(t => {
|
|
|
+ if (t.data.Type == val.key && val.age.Url) {
|
|
|
+ if (!t.isExtracted) {
|
|
|
+ t.isExtracted = true;
|
|
|
+ const data = {
|
|
|
+ ID: uuid(),
|
|
|
+ Name: val.age.Name,
|
|
|
+ GraphElementType: val.age.Type,
|
|
|
+ Num: 1,
|
|
|
+ GraphElementId: val.age.Id,
|
|
|
+ AttachObjectIds: [],
|
|
|
+ Pos: { X: t.data.Pos.X, Y: -t.data.Pos.Y },
|
|
|
+ Scale: { X: 1, Y: 1, Z: 1 }, // 缩放
|
|
|
+ Rolate: { X: 0, Y: 0, Z: 0 },
|
|
|
+ Size: { Width: 0, Height: 0 }, // 大小
|
|
|
+ Type: val.age.Type,
|
|
|
+ Properties: {
|
|
|
+ IconUrl: '/serve/topology-wanda/Picture/query/' + val.age.Url,
|
|
|
+ Url: '/serve/topology-wanda/Picture/query/' + val.age.Url,
|
|
|
+ Num: 1, // 此num与信息工程化得num无关
|
|
|
+ sWidth: 24, //icon 的宽
|
|
|
+ sHeight: 24, //icon 的高
|
|
|
+ font: 12, //font
|
|
|
+ color: '', //字体颜色
|
|
|
+ GraphCategoryId: val.age.GraphCategoryId,
|
|
|
+ InfoSystemId: val.age.InfoSystemId?val.age.InfoSystemId:'', //信息工程话分类ID分类
|
|
|
+ FID: t.data.SourceId
|
|
|
+ },
|
|
|
+ };
|
|
|
+ const item = new SImageLegendItem(null, data)
|
|
|
+ item.selectable = true;
|
|
|
+ item.moveable = true;
|
|
|
+ this.scene.addItem(item);
|
|
|
+ this.scene.Nodes.push(item);
|
|
|
+ return item
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- .filter(item => item);
|
|
|
- const parserData = new STopologyParser(null);
|
|
|
- parserData.parseData({ Nodes: list });
|
|
|
- parserData.zoneLegendList.forEach(t => {
|
|
|
- this.scene.addItem(t);
|
|
|
- this.scene.Nodes.push(t);
|
|
|
- });
|
|
|
- // undo/redo事件
|
|
|
- this.scene.AddListCommand(parserData.zoneLegendList);
|
|
|
+ }).filter(item => item);
|
|
|
+ this.scene.AddListCommand(list);
|
|
|
+ bus.$emit("elementDataChange", this.scene);
|
|
|
+ } else if (val.type == "Zone") {
|
|
|
+ const list = this.fParser.spaceList
|
|
|
+ .map(t => {
|
|
|
+ if (t.data.Type == val.key && val.age.Url) {
|
|
|
+ if (!t.isExtracted) {
|
|
|
+ t.isExtracted = true;
|
|
|
+ return {
|
|
|
+ ID: uuid(),
|
|
|
+ Name: val.age.Name,
|
|
|
+ GraphElementType: val.age.Type,
|
|
|
+ GraphElementId: val.age.Id,
|
|
|
+ AttachObjectIds: [],
|
|
|
+ Pos: { x: t.x, y: t.y },
|
|
|
+ OutLine: t.pointArr[0],
|
|
|
+ SubType: "",
|
|
|
+ Properties: {
|
|
|
+ IconUrl: '/serve/topology-wanda/Picture/query/' + val.age.Url,
|
|
|
+ StrokeColor: val.age.Color,
|
|
|
+ FillColor: val.age.FillColor,
|
|
|
+ LineDash: val.age.LineDash,
|
|
|
+ font: 12,
|
|
|
+ color: "",
|
|
|
+ TextPos: { X: 0, Y: 0},
|
|
|
+ FID: t.data.SourceId
|
|
|
+ },
|
|
|
+ Num: 1
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .filter(item => item);
|
|
|
+ const parserData = new STopologyParser(null);
|
|
|
+ parserData.parseData({ Nodes: list });
|
|
|
+ parserData.zoneLegendList.forEach(t => {
|
|
|
+ t.$emit('finishCreated')
|
|
|
+ this.scene.addItem(t);
|
|
|
+ this.scene.Nodes.push(t);
|
|
|
+ });
|
|
|
+ // undo/redo事件
|
|
|
+ this.scene.AddListCommand(parserData.zoneLegendList);
|
|
|
+ bus.$emit("elementDataChange", this.scene);
|
|
|
+ }
|
|
|
});
|
|
|
// 设备图例样式对象
|
|
|
bus.$on("setLenged", obj => {
|
|
@@ -451,7 +520,6 @@ export default {
|
|
|
this.canvasHeight / 2
|
|
|
);
|
|
|
this.changeScaleByClick = false;
|
|
|
- setTimeout(() => {}, 100);
|
|
|
});
|
|
|
// 更改图例数据工程化数据
|
|
|
bus.$on("changeAttachObjectIds", arr => {
|