|
@@ -792,6 +792,7 @@ export default {
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.Result == "success") {
|
|
if (res.Result == "success") {
|
|
this.graphId = res.Data;
|
|
this.graphId = res.Data;
|
|
|
|
+ this.scene.undoStack.isChange = false;
|
|
Message({
|
|
Message({
|
|
message: "保存成功!",
|
|
message: "保存成功!",
|
|
type: "success"
|
|
type: "success"
|
|
@@ -816,37 +817,40 @@ export default {
|
|
},
|
|
},
|
|
// 自动保存接口
|
|
// 自动保存接口
|
|
saveMsgNoMessage() {
|
|
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({
|
|
message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
type: "error"
|
|
type: "error"
|
|
});
|
|
});
|
|
console.log("自动保存失败");
|
|
console.log("自动保存失败");
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- Message({
|
|
|
|
- message: "服务器连接失败!请关掉编辑器窗口,重新打开绘制!",
|
|
|
|
- type: "error"
|
|
|
|
});
|
|
});
|
|
- console.log("自动保存失败");
|
|
|
|
- });
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|