|
@@ -1,28 +1,21 @@
|
|
|
<template>
|
|
|
- <el-button @click="saveHandler" type="primary" size="small"
|
|
|
- >保存
|
|
|
- <!-- <div class="button-list_column">
|
|
|
- <el-button type="primary" size="small" @click="getProcessAsBpmn"
|
|
|
- >导出为 Bpmn</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" size="small" @click="getProcessAsXml"
|
|
|
- >导出为 XML</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" size="small" @click="getProcessAsSvg"
|
|
|
- >导出为 SVG</el-button
|
|
|
- >
|
|
|
- </div> -->
|
|
|
- </el-button>
|
|
|
+ <el-button @click="saveHandler" type="primary" size="small">保存 </el-button>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { downloadFile, setEncoded } from "@utils/files";
|
|
|
import { mapGetters } from "vuex";
|
|
|
-import { addProcess, updateProcess } from "@/api/bpmprocess/process";
|
|
|
+import {
|
|
|
+ addProcess,
|
|
|
+ updateProcess,
|
|
|
+ addConfiguration,
|
|
|
+ updateConfiguration,
|
|
|
+} from "@/api/bpmprocess/process";
|
|
|
import xml from "highlight.js/lib/languages/xml";
|
|
|
import { getProcessEngine } from "@packages/bpmn-utils/BpmnDesignerUtils";
|
|
|
import EventEmitter from "@utils/EventEmitter";
|
|
|
import { formDataValidate } from "@utils/formDataValidate";
|
|
|
+import { getNodeMsg } from "@packages/bo-utils/getNodeMsg";
|
|
|
export default {
|
|
|
name: "BpmnSave",
|
|
|
computed: {
|
|
@@ -98,7 +91,9 @@ export default {
|
|
|
let _this = this;
|
|
|
let formData = _this.formData() || {}; // 当前流程表单详细数据
|
|
|
let processJsonObj = await this.getProcessJson(); // xml标签转换json
|
|
|
- console.log(processJsonObj);
|
|
|
+ // console.log(processJsonObj);
|
|
|
+ // this.saveNodeMsg(processJsonObj);
|
|
|
+ // return;
|
|
|
let validateRes = formDataValidate(processJsonObj);
|
|
|
if (!validateRes.flag) {
|
|
|
this.$message.error(validateRes.msg);
|
|
@@ -135,6 +130,7 @@ export default {
|
|
|
updateProcess(subformData).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
_this.$message.success("修改成功");
|
|
|
+ this.saveNodeMsg(processJsonObj);
|
|
|
} else {
|
|
|
_this.$message.error("修改失败");
|
|
|
}
|
|
@@ -143,12 +139,25 @@ export default {
|
|
|
addProcess(subformData).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
_this.$message.success("保存成功");
|
|
|
+ this.saveNodeMsg(processJsonObj);
|
|
|
} else {
|
|
|
_this.$message.error("保存失败");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ async saveNodeMsg(obj) {
|
|
|
+ let data = getNodeMsg(obj.warnings);
|
|
|
+ data.forEach((item) => {
|
|
|
+ item.createBy = this.$store.state.user.name;
|
|
|
+ item.nodeProcessKey = obj.rootElement.rootElements[0].id;
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ let res = await addConfiguration(data);
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|