|
@@ -315,6 +315,7 @@ import graph from "./graph.vue";
|
|
|
import { logicConfig } from "@/logicConfig";
|
|
|
import { Message } from "element-ui";
|
|
|
import Vue from "vue";
|
|
|
+import vueStore from "@/store";
|
|
|
|
|
|
export default {
|
|
|
props: [],
|
|
@@ -582,15 +583,33 @@ export default {
|
|
|
*/
|
|
|
saveGraph: async function () {
|
|
|
this.fullscreenLoading = true;
|
|
|
- var saveResultObj = await sysGraphController.saveSysGraph(this.graphInfo);
|
|
|
- this.fullscreenLoading = false;
|
|
|
+ var saveResultObj = await sysGraphController.saveSysGraph(
|
|
|
+ this.graphInfo,
|
|
|
+ this.project.id,
|
|
|
+ this.project.groupCode
|
|
|
+ );
|
|
|
switch (saveResultObj.result) {
|
|
|
case logicConfig.resultObj.failure:
|
|
|
+ this.fullscreenLoading = false;
|
|
|
Message.error("保存失败:" + (saveResultObj.message || ""));
|
|
|
return;
|
|
|
case logicConfig.resultObj.success:
|
|
|
- Message.success("保存成功");
|
|
|
this.graphOriginInfo = JSON.parse(JSON.stringify(this.graphInfo));
|
|
|
+ //保存成功后,更新系统图状态为下架
|
|
|
+ var draftResultObj = await sysGraphController.draftGraph(
|
|
|
+ this.diagramId
|
|
|
+ );
|
|
|
+ this.fullscreenLoading = false;
|
|
|
+ switch (draftResultObj.result) {
|
|
|
+ case logicConfig.resultObj.success:
|
|
|
+ Message.success("保存成功");
|
|
|
+ break;
|
|
|
+ case logicConfig.resultObj.failure:
|
|
|
+ Message.error(
|
|
|
+ "保存成功,更新状态失败,原因:" + (resultObj.message || "")
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
@@ -613,7 +632,7 @@ export default {
|
|
|
this.graphInfo.extraProps.state = graphStateEnum.Publish;
|
|
|
return Message.success("上架成功");
|
|
|
case logicConfig.resultObj.failure:
|
|
|
- return Message.success("上架失败,原因:" + (resultObj.message || ""));
|
|
|
+ return Message.error("上架失败,原因:" + (resultObj.message || ""));
|
|
|
}
|
|
|
},
|
|
|
//下架系统图
|
|
@@ -627,7 +646,7 @@ export default {
|
|
|
this.graphInfo.extraProps.state = graphStateEnum.Draft;
|
|
|
return Message.success("下架成功");
|
|
|
case logicConfig.resultObj.failure:
|
|
|
- return Message.success("下架失败,原因:" + (resultObj.message || ""));
|
|
|
+ return Message.error("下架失败,原因:" + (resultObj.message || ""));
|
|
|
}
|
|
|
},
|
|
|
//删除系统图
|
|
@@ -655,7 +674,7 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
case logicConfig.resultObj.failure:
|
|
|
- return Message.success(
|
|
|
+ return Message.error(
|
|
|
"删除图纸失败,原因:" + (resultObj.message || "")
|
|
|
);
|
|
|
}
|
|
@@ -778,6 +797,9 @@ export default {
|
|
|
groupCode: this.$route.query.gc,
|
|
|
name: this.$route.query.prn,
|
|
|
};
|
|
|
+ if (this.operState === 0 || this.operState === 1) {
|
|
|
+ vueStore.commit("updateSelectProject", this.project);
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
var _this = this;
|