|
@@ -328,7 +328,7 @@ export default {
|
|
bus.$emit("exportItem", data);
|
|
bus.$emit("exportItem", data);
|
|
});
|
|
});
|
|
bus.$on("saveMsgItem", () => {
|
|
bus.$on("saveMsgItem", () => {
|
|
- this.saveMsg()
|
|
|
|
|
|
+ this.saveMsg();
|
|
});
|
|
});
|
|
bus.$on("exportByKey", val => {
|
|
bus.$on("exportByKey", val => {
|
|
const list = this.fParser.spaceList
|
|
const list = this.fParser.spaceList
|
|
@@ -365,7 +365,7 @@ export default {
|
|
this.scene.Nodes.push(t);
|
|
this.scene.Nodes.push(t);
|
|
});
|
|
});
|
|
// undo/redo事件
|
|
// undo/redo事件
|
|
- this.scene.AddListCommand(parserData.zoneLegendList)
|
|
|
|
|
|
+ this.scene.AddListCommand(parserData.zoneLegendList);
|
|
});
|
|
});
|
|
// 设备图例样式对象
|
|
// 设备图例样式对象
|
|
bus.$on("setLenged", obj => {
|
|
bus.$on("setLenged", obj => {
|
|
@@ -427,13 +427,12 @@ export default {
|
|
}),
|
|
}),
|
|
//发布图
|
|
//发布图
|
|
bus.$on("publishMap", () => {
|
|
bus.$on("publishMap", () => {
|
|
- if (this.graphId == "") {
|
|
|
|
- this.$message.error("请先保存");
|
|
|
|
- // 如果没有保存则先保存
|
|
|
|
- bus.$emit("saveMsgItem");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- this.publishBtn();
|
|
|
|
|
|
+ // 发布信息时必须保存数据
|
|
|
|
+ this.saveMsg().then(res => {
|
|
|
|
+ if (res) {
|
|
|
|
+ this.publishBtn();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
/**
|
|
/**
|
|
* @name changeScale缩放底图
|
|
* @name changeScale缩放底图
|
|
@@ -478,7 +477,6 @@ export default {
|
|
},
|
|
},
|
|
//发布
|
|
//发布
|
|
publishBtn() {
|
|
publishBtn() {
|
|
- console.log(this.graphId);
|
|
|
|
const loadings = Loading.service({
|
|
const loadings = Loading.service({
|
|
lock: true,
|
|
lock: true,
|
|
text: "Loading",
|
|
text: "Loading",
|
|
@@ -531,21 +529,37 @@ export default {
|
|
FloorID: this.urlMsg.FloorID, // 楼层id
|
|
FloorID: this.urlMsg.FloorID, // 楼层id
|
|
Seq // 楼层id
|
|
Seq // 楼层id
|
|
};
|
|
};
|
|
- Message({
|
|
|
|
|
|
+ const loading = Message({
|
|
message: "保存中,切勿关闭窗口!",
|
|
message: "保存中,切勿关闭窗口!",
|
|
type: "warning"
|
|
type: "warning"
|
|
});
|
|
});
|
|
- saveGroup(data)
|
|
|
|
- .then(res => {
|
|
|
|
- Message.close();
|
|
|
|
- this.graphId = res.Data;
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- Message({
|
|
|
|
- message: "保存失败!",
|
|
|
|
- type: "error"
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ saveGroup(data)
|
|
|
|
+ .then(res => {
|
|
|
|
+ loading.close();
|
|
|
|
+ if (res.Result == "success") {
|
|
|
|
+ this.graphId = res.Data;
|
|
|
|
+ Message({
|
|
|
|
+ message: "保存成功!",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ resolve(true);
|
|
|
|
+ } else {
|
|
|
|
+ Message({
|
|
|
|
+ message: "保存失败!",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ resolve(false);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ Message({
|
|
|
|
+ message: "保存失败!",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ resolve(false);
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|