|
@@ -9,7 +9,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { SFengParser, ProjectRf } from "@saga-web/feng-map";
|
|
|
-import { SFloorParser } from "@saga-web/big";
|
|
|
+import { SFloorParser, SBoardItem } from "@saga-web/big";
|
|
|
import { FloorView } from "./../lib/FloorView";
|
|
|
import { EditScence } from "./mapClass/EditScence";
|
|
|
import bus from "@/bus";
|
|
@@ -220,8 +220,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 解析楼地板
|
|
|
+ loadBoard(floor){
|
|
|
+ window.FENGMAP.loadFloor(floor, res => {
|
|
|
+ const zone = new SBoardItem(null, res)
|
|
|
+ this.scene.addItem(zone);
|
|
|
+ })
|
|
|
+ },
|
|
|
// 解析底图
|
|
|
readBaseMap(floor){
|
|
|
+ this.loadBoard(this.floorList[floor]);
|
|
|
window.FENGMAP.parseData(this.floorList[floor], res => {
|
|
|
if (res.err) {
|
|
|
console.log(res.err);
|
|
@@ -784,6 +792,7 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.Result == "success") {
|
|
|
this.graphId = res.Data;
|
|
|
+ this.scene.undoStack.isChange = false;
|
|
|
Message({
|
|
|
message: "保存成功!",
|
|
|
type: "success"
|
|
@@ -808,37 +817,40 @@ export default {
|
|
|
},
|
|
|
// 自动保存接口
|
|
|
saveMsgNoMessage() {
|
|
|
- const Elements = this.scene.saveMsgItem();
|
|
|
- const Seq = Number(this.urlMsg.seq);
|
|
|
- const data = {
|
|
|
- Elements,
|
|
|
- Name: this.appName, // 名称
|
|
|
- CategoryId: this.urlMsg.categoryId,
|
|
|
- ProjectID: this.urlMsg.projectId, // 项目ID
|
|
|
- BuildingID: this.urlMsg.BuildingID, // 建筑ID
|
|
|
- FloorID: this.urlMsg.FloorID, // 楼层id
|
|
|
- Seq // 楼层id
|
|
|
- };
|
|
|
- saveGroup(data)
|
|
|
- .then(res => {
|
|
|
- if (res.Result == "success") {
|
|
|
- this.graphId = res.Data;
|
|
|
- console.log("自动保存成功");
|
|
|
- } else {
|
|
|
+ if (this.scene.undoStack.isChange) {
|
|
|
+ const Elements = this.scene.saveMsgItem();
|
|
|
+ const Seq = Number(this.urlMsg.seq);
|
|
|
+ const data = {
|
|
|
+ Elements,
|
|
|
+ Name: this.appName, // 名称
|
|
|
+ CategoryId: this.urlMsg.categoryId,
|
|
|
+ ProjectID: this.urlMsg.projectId, // 项目ID
|
|
|
+ BuildingID: this.urlMsg.BuildingID, // 建筑ID
|
|
|
+ FloorID: this.urlMsg.FloorID, // 楼层id
|
|
|
+ Seq // 楼层id
|
|
|
+ };
|
|
|
+ saveGroup(data)
|
|
|
+ .then(res => {
|
|
|
+ if (res.Result == "success") {
|
|
|
+ this.graphId = res.Data;
|
|
|
+ this.scene.undoStack.isChange = false;
|
|
|
+ console.log("自动保存成功");
|
|
|
+ } else {
|
|
|
+ Message({
|
|
|
+ message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ console.log("自动保存失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
Message({
|
|
|
message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
|
type: "error"
|
|
|
});
|
|
|
console.log("自动保存失败");
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- Message({
|
|
|
- message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
|
- type: "error"
|
|
|
});
|
|
|
- console.log("自动保存失败");
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|