Commit 6373aeaa by Mr. Lan

fix bug.

parent d7f325f7
...@@ -204,7 +204,6 @@ export default { ...@@ -204,7 +204,6 @@ export default {
this.graph.on('afteritemselected', (items) => { this.graph.on('afteritemselected', (items) => {
if (items && items.length > 0) { if (items && items.length > 0) {
if (this.previous !== '') { if (this.previous !== '') {
// 1. 获取之前的数据
var previousValue = '' var previousValue = ''
const item = this.graph.findById(this.previous[0]) const item = this.graph.findById(this.previous[0])
previousValue = { ...item.getModel() } previousValue = { ...item.getModel() }
......
...@@ -199,6 +199,7 @@ export default { ...@@ -199,6 +199,7 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 查询参数 // 查询参数
structureValue: [],
users: [], users: [],
groups: [], groups: [],
departments: [], departments: [],
...@@ -338,9 +339,11 @@ export default { ...@@ -338,9 +339,11 @@ export default {
}) })
}) })
}, },
verifyProcess() { verifyProcess(structureValue) {
this.ruleForm.structure = this.$refs.wfd.graph.save() if (structureValue === undefined && structureValue === null) {
for (var r of this.ruleForm.structure.nodes) { structureValue = this.ruleForm.structure
}
for (var r of structureValue.nodes) {
if (r.sort === undefined || r.sort === null || r.sort === '') { if (r.sort === undefined || r.sort === null || r.sort === '') {
return '流程节点顺序不能为空' return '流程节点顺序不能为空'
} else if (r.label === undefined || r.label === null || r.label === '') { } else if (r.label === undefined || r.label === null || r.label === '') {
...@@ -354,7 +357,7 @@ export default { ...@@ -354,7 +357,7 @@ export default {
} }
} }
} }
for (var e of this.ruleForm.structure.edges) { for (var e of structureValue.edges) {
if (e.sort === undefined || e.sort === null || e.sort === '') { if (e.sort === undefined || e.sort === null || e.sort === '') {
return '流转顺序不能为空' return '流转顺序不能为空'
} else if (e.label === undefined || e.label === null || e.label === '') { } else if (e.label === undefined || e.label === null || e.label === '') {
...@@ -385,20 +388,20 @@ export default { ...@@ -385,20 +388,20 @@ export default {
}) })
}, },
editForm(formName) { editForm(formName) {
var r = this.verifyProcess()
if (r !== '') {
this.$message.error(r)
return
}
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
var structureValue = this.$refs.wfd.graph.save() var structureValue = this.$refs.wfd.graph.save()
var r = this.verifyProcess(structureValue)
if (r !== '') {
this.$message.error(r)
return
}
if (structureValue.nodes.length > 0 && structureValue.edges.length > 0) { if (structureValue.nodes.length > 0 && structureValue.edges.length > 0) {
updateProcess({ updateProcess({
id: this.ruleForm.id, id: this.ruleForm.id,
name: this.ruleForm.name, name: this.ruleForm.name,
tpls: this.ruleForm.tpls, tpls: this.ruleForm.tpls,
structure: this.$refs.wfd.graph.save(), structure: structureValue,
classify: this.ruleForm.classify, classify: this.ruleForm.classify,
task: this.ruleForm.task, task: this.ruleForm.task,
notice: this.ruleForm.notice notice: this.ruleForm.notice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment