process.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. <template #signal>
  10. <el-badge :value="signalLength">
  11. <el-button size="small" @click="dialogName = 'signalDialog'">编辑</el-button>
  12. </el-badge>
  13. </template>
  14. </x-form>
  15. <executionListenerDialog
  16. v-if="dialogName === 'executionListenerDialog'"
  17. :element="element"
  18. :modeler="modeler"
  19. @close="finishExecutionListener"
  20. />
  21. <signalDialog
  22. v-if="dialogName === 'signalDialog'"
  23. :element="element"
  24. :modeler="modeler"
  25. @close="finishExecutionListener"
  26. />
  27. </div>
  28. </template>
  29. <script>
  30. import mixinPanel from '../../common/mixinPanel'
  31. import mixinExecutionListener from '../../common/mixinExecutionListener'
  32. import signalDialog from './property/signal'
  33. import { commonParse } from '../../common/parseElement'
  34. export default {
  35. components: {
  36. signalDialog
  37. },
  38. mixins: [mixinPanel, mixinExecutionListener],
  39. data() {
  40. return {
  41. signalLength: 0,
  42. formData: {}
  43. }
  44. },
  45. computed: {
  46. formConfig() {
  47. const _this = this
  48. return {
  49. inline: false,
  50. item: [
  51. // {
  52. // xType: 'select',
  53. // name: 'processCategory',
  54. // label: '流程分类',
  55. // dic: { data: _this.categorys, label: 'name', value: 'id' }
  56. // },
  57. {
  58. xType: 'input',
  59. name: 'id',
  60. label: '流程标识key',
  61. rules: [{ required: true, message: 'Id 不能为空' }],
  62. disabled : true
  63. },
  64. {
  65. xType: 'input',
  66. name: 'name',
  67. label: '流程名称'
  68. },
  69. {
  70. xType: 'input',
  71. name: 'documentation',
  72. label: '节点描述'
  73. },
  74. // {
  75. // xType: 'slot',
  76. // name: 'executionListener',
  77. // label: '执行监听器'
  78. // },
  79. // {
  80. // xType: 'slot',
  81. // name: 'signal',
  82. // label: '信号定义'
  83. // }
  84. ]
  85. }
  86. }
  87. },
  88. watch: {
  89. 'formData.processCategory': function(val) {
  90. if (val === '') val = null
  91. this.updateProperties({ 'flowable:processCategory': val })
  92. }
  93. },
  94. created() {
  95. this.formData = commonParse(this.element)
  96. },
  97. methods: {
  98. computedSignalLength() {
  99. this.signalLength = this.element.businessObject.extensionElements?.values?.length ?? 0
  100. },
  101. finishSignal() {
  102. if (this.dialogName === 'signalDialog') {
  103. this.computedSignalLength()
  104. }
  105. this.dialogName = ''
  106. }
  107. }
  108. }
  109. </script>
  110. <style>
  111. </style>