startEnd.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div>
  3. <x-form ref="xForm" v-model="formData" :config="formConfig">
  4. <template #executionListener>
  5. <el-badge :value="executionListenerLength">
  6. <el-button size="small" @click="dialogName = 'executionListenerDialog'">编辑</el-button>
  7. </el-badge>
  8. </template>
  9. </x-form>
  10. <executionListenerDialog
  11. v-if="dialogName === 'executionListenerDialog'"
  12. :element="element"
  13. :modeler="modeler"
  14. @close="finishExecutionListener"
  15. />
  16. </div>
  17. </template>
  18. <script>
  19. import mixinPanel from '../../common/mixinPanel'
  20. import mixinExecutionListener from '../../common/mixinExecutionListener'
  21. import { commonParse } from '../../common/parseElement'
  22. export default {
  23. mixins: [mixinPanel, mixinExecutionListener],
  24. data() {
  25. return {
  26. formData: {}
  27. }
  28. },
  29. computed: {
  30. formConfig() {
  31. const _this = this
  32. return {
  33. inline: false,
  34. item: [
  35. {
  36. xType: 'input',
  37. name: 'id',
  38. label: '节点 id',
  39. rules: [{ required: true, message: 'Id 不能为空' }],
  40. disabled : true
  41. },
  42. {
  43. xType: 'input',
  44. name: 'name',
  45. label: '节点名称'
  46. },
  47. {
  48. xType: 'input',
  49. name: 'documentation',
  50. label: '节点描述'
  51. },
  52. {
  53. xType: 'slot',
  54. name: 'executionListener',
  55. label: '执行监听器'
  56. },
  57. {
  58. xType: 'input',
  59. name: 'initiator',
  60. label: '发起人',
  61. show: !!_this.showConfig.initiator
  62. },
  63. {
  64. xType: 'input',
  65. name: 'formKey',
  66. label: '表单标识key',
  67. show: !!_this.showConfig.formKey
  68. }
  69. ]
  70. }
  71. }
  72. },
  73. watch: {
  74. 'formData.initiator': function(val) {
  75. if (val === '') val = null
  76. this.updateProperties({ 'flowable:initiator': val })
  77. },
  78. 'formData.formKey': function(val) {
  79. if (val === '') val = null
  80. this.updateProperties({ 'flowable:formKey': val })
  81. }
  82. },
  83. created() {
  84. this.formData = commonParse(this.element)
  85. if (!!this.element.businessObject.extensionElements) {
  86. this.executionListenerLength = this.element.businessObject.extensionElements.values.length;
  87. }
  88. }
  89. }
  90. </script>
  91. <style>
  92. </style>