Commit ed33ff9f046a7d432099fe162b92cd8e7da29622
1 parent
db541476
优化 bpmnProcessDesigner 在编辑流程图时,自动延迟赋值 key 和 name,保证一致性
Showing
1 changed file
with
15 additions
and
1 deletions
yudao-admin-ui/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue
| @@ -58,13 +58,24 @@ export default { | @@ -58,13 +58,24 @@ export default { | ||
| 58 | this.$nextTick(() => this.resetBaseInfo()); | 58 | this.$nextTick(() => this.resetBaseInfo()); |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | - } | 61 | + }, |
| 62 | + // 'model.key': { | ||
| 63 | + // immediate: false, | ||
| 64 | + // handler: function (val) { | ||
| 65 | + // this.handleKeyUpdate(val) | ||
| 66 | + // } | ||
| 67 | + // } | ||
| 62 | }, | 68 | }, |
| 63 | created() { | 69 | created() { |
| 64 | // 获得流程表单的下拉框的数据 | 70 | // 获得流程表单的下拉框的数据 |
| 65 | getSimpleForms().then(response => { | 71 | getSimpleForms().then(response => { |
| 66 | this.forms = response.data | 72 | this.forms = response.data |
| 67 | }) | 73 | }) |
| 74 | + // 针对上传的 bpmn 流程图时,需要延迟 1 秒的时间,保证 key 和 name 的更新 | ||
| 75 | + setTimeout(() => { | ||
| 76 | + this.handleKeyUpdate(this.model.key) | ||
| 77 | + this.handleNameUpdate(this.model.name) | ||
| 78 | + }, 1000) | ||
| 68 | }, | 79 | }, |
| 69 | methods: { | 80 | methods: { |
| 70 | resetBaseInfo() { | 81 | resetBaseInfo() { |
| @@ -87,6 +98,9 @@ export default { | @@ -87,6 +98,9 @@ export default { | ||
| 87 | this.updateBaseInfo('id'); | 98 | this.updateBaseInfo('id'); |
| 88 | }, | 99 | }, |
| 89 | handleNameUpdate(value) { | 100 | handleNameUpdate(value) { |
| 101 | + if (!value) { | ||
| 102 | + return | ||
| 103 | + } | ||
| 90 | this.elementBaseInfo['name'] = value; | 104 | this.elementBaseInfo['name'] = value; |
| 91 | this.updateBaseInfo('name'); | 105 | this.updateBaseInfo('name'); |
| 92 | }, | 106 | }, |