|
@@ -2,7 +2,7 @@
|
|
|
* @Author: zhangyu
|
|
|
* @Date: 2020-06-03 17:21:15
|
|
|
* @Info:
|
|
|
- * @LastEditTime: 2020-06-03 17:25:05
|
|
|
+ * @LastEditTime: 2020-06-03 18:32:53
|
|
|
-->
|
|
|
<template>
|
|
|
<div id="baseEditer">
|
|
@@ -14,11 +14,11 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { SFengParser } from "@saga-web/feng-map";
|
|
|
-import { SFloorParser, SImageItem,STextItem } from "@saga-web/big";
|
|
|
-// import { DirectRelationItem } from "@saga-web/topology/lib/items/DirectRelationItem.js";
|
|
|
-import { SGraphyView, SGraphyScene } from "@saga-web/graphy/lib";
|
|
|
+import { SPoint } from "@saga-web/draw/lib";
|
|
|
+import { SFloorParser, SImageItem, STextItem, SLineItem, SPolylineItem } from "@saga-web/big";
|
|
|
import { SPolygonItem } from "./mapClass/SPolygonItem";
|
|
|
-import {FloorView} from "./../lib/FloorView"
|
|
|
+import { FloorView } from "./../lib/FloorView"
|
|
|
+import { FloorScene } from "./../lib/FloorScene"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -29,7 +29,9 @@ export default {
|
|
|
fmap: null,
|
|
|
canvasWidth: 700,
|
|
|
canvasHeight: 800,
|
|
|
- fParser: null
|
|
|
+ fParser: null,
|
|
|
+ scene: null,
|
|
|
+ view: null
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -41,7 +43,7 @@ export default {
|
|
|
init() {
|
|
|
document.getElementById(`canvas`).focus()
|
|
|
this.clearGraphy();
|
|
|
- this.scene = new SGraphyScene();
|
|
|
+ this.scene = new FloorScene();
|
|
|
this.fmap = new SFengParser(
|
|
|
"fengMap",
|
|
|
this.mapServerURL,
|
|
@@ -50,19 +52,22 @@ export default {
|
|
|
null
|
|
|
);
|
|
|
console.log(this.fmap);
|
|
|
- this.fmap.parseData("1001724_29", 1, res => {
|
|
|
+ this.fmap.parseData("1001724_29", 6, res => {
|
|
|
console.log(res);
|
|
|
this.fParser = new SFloorParser(null);
|
|
|
console.log(this.fParser);
|
|
|
this.fParser.parseData(res);
|
|
|
- this.fParser.spaceList.forEach(t => this.scene.addItem(t));
|
|
|
+ this.fParser.spaceList.forEach(t => {
|
|
|
+ t.connect('clicjnnmnk', this, this.spaceClick)
|
|
|
+ this.scene.addItem(t)
|
|
|
+ });
|
|
|
this.fParser.wallList.forEach(t => this.scene.addItem(t));
|
|
|
this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
|
|
|
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.addPolyLine();
|
|
|
- this.DirectRelationItem();
|
|
|
+ // this.addPolyLine();
|
|
|
+ // this.DirectRelationItem();
|
|
|
this.view.scene = this.scene;
|
|
|
this.view.fitSceneToView();
|
|
|
});
|
|
@@ -78,21 +83,21 @@ export default {
|
|
|
]
|
|
|
};
|
|
|
const Polylines = new SPolygonItem(null);
|
|
|
- Polylines.setStatus =2;
|
|
|
+ Polylines.setStatus = 2;
|
|
|
this.scene.addItem(Polylines);
|
|
|
this.scene.grabItem = Polylines;
|
|
|
},
|
|
|
// 引入折线
|
|
|
- DirectRelationItem() {
|
|
|
- const data = {
|
|
|
- PointList: [
|
|
|
- { X: -138.71000000089407, Y: -17.5 },
|
|
|
- { X: -130.31000000052154, Y: -17.5 }
|
|
|
- ]
|
|
|
- };
|
|
|
- const directRelationItem = new DirectRelationItem(null, data);
|
|
|
- this.scene.addItem(directRelationItem);
|
|
|
- },
|
|
|
+ // DirectRelationItem() {
|
|
|
+ // const data = {
|
|
|
+ // PointList: [
|
|
|
+ // { X: -138.71000000089407, Y: -17.5 },
|
|
|
+ // { X: -130.31000000052154, Y: -17.5 }
|
|
|
+ // ]
|
|
|
+ // };
|
|
|
+ // const directRelationItem = new DirectRelationItem(null, data);
|
|
|
+ // this.scene.addItem(directRelationItem);
|
|
|
+ // },
|
|
|
clearGraphy() {
|
|
|
if (this.view) {
|
|
|
this.view.scene = null;
|
|
@@ -107,18 +112,19 @@ export default {
|
|
|
// Height: 32,
|
|
|
// Url: "https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1569891320,3644984535&fm=85&app=52&f=JPEG?w=121&h=75&s=891B0FD8964406EF8091EA200300E056"
|
|
|
// })
|
|
|
- const item = new STextItem(null);
|
|
|
- item.moveTo(event[0].x, event[0].y)
|
|
|
- item.font.size = 12;
|
|
|
- item.zOrder = 999;
|
|
|
- item.connect('mousedown', this, this.iconClick)
|
|
|
- this.scene.addItem(item)
|
|
|
- setInterval(()=>{item.text+='魔'},1000)
|
|
|
+ // const item = new SImageItem(null);
|
|
|
+ // item.moveTo(event[0].x, event[0].y)
|
|
|
+ // item.url = 'https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1569891320,3644984535&fm=85&app=52&f=JPEG?w=121&h=75&s=891B0FD8964406EF8091EA200300E056'
|
|
|
+ // item.font.size = 12;
|
|
|
+ // item.zOrder = 999;
|
|
|
+ // item.connect('mousedown', this, this.iconClick)
|
|
|
+ // this.scene.addItem(item)
|
|
|
+ // setInterval(() => { item.text += '魔' }, 1000)
|
|
|
},
|
|
|
iconClick(item, event) {
|
|
|
console.log(2222222222222)
|
|
|
},
|
|
|
- changeFloor() { },
|
|
|
+ // changeFloor() { },
|
|
|
changeStatus(name) {
|
|
|
switch (name) {
|
|
|
case '选择':
|
|
@@ -127,7 +133,6 @@ export default {
|
|
|
break;
|
|
|
case '画线':
|
|
|
this.scene.isLining = true;
|
|
|
- console.log('lining')
|
|
|
break;
|
|
|
case '画文字':
|
|
|
this.scene.isTexting = true;
|