workflow-editor 0.9.65 → 0.9.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/lib/workflow-editor.css +1 -1
  2. package/lib/workflow-editor.umd.min.js +10 -10
  3. package/package.json +2 -2
  4. package/packages/index.js +34 -0
  5. package/packages/plugins/formValidatorUtil.js +528 -0
  6. package/packages/plugins/index.js +8 -0
  7. package/packages/workflow-editor/index.js +14 -0
  8. package/packages/workflow-editor/src/api.js +7 -0
  9. package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
  10. package/packages/workflow-editor/src/constant.js +8 -0
  11. package/packages/workflow-editor/src/json-object-templates/copy-task.js +67 -0
  12. package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
  13. package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
  14. package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
  15. package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
  16. package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
  17. package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
  18. package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
  19. package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
  20. package/packages/workflow-editor/src/json-object-templates/subprocess.js +30 -0
  21. package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
  22. package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
  23. package/packages/workflow-editor/src/main/canvas.vue +479 -0
  24. package/packages/workflow-editor/src/main/context-menu.vue +132 -0
  25. package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
  26. package/packages/workflow-editor/src/main/selection-region.vue +66 -0
  27. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
  28. package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
  29. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
  30. package/packages/workflow-editor/src/main/toolbox.vue +60 -0
  31. package/packages/workflow-editor/src/main/wf-history-canvas.vue +302 -0
  32. package/packages/workflow-editor/src/process-json.js +622 -0
  33. package/packages/workflow-editor/src/process-service.js +31 -0
  34. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +531 -0
  35. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
  36. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
  37. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
  38. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +47 -0
  39. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
  40. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
  41. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
  42. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
  43. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
  44. package/packages/workflow-editor/src/properties-editors/common/notice.vue +98 -0
  45. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +179 -0
  46. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
  47. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
  48. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
  49. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
  50. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
  51. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +233 -0
  52. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
  53. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
  54. package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
  55. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
  56. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
  57. package/packages/workflow-editor/src/properties-editors/copy-task.vue +80 -0
  58. package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
  59. package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
  60. package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
  61. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
  62. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +156 -0
  63. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
  64. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
  65. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
  66. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
  67. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
  68. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
  69. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
  70. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
  71. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
  72. package/packages/workflow-editor/src/properties-editors/human-task.vue +103 -0
  73. package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
  74. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
  75. package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
  76. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
  77. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
  78. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
  79. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
  80. package/packages/workflow-editor/src/properties-editors/process.vue +109 -0
  81. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +187 -0
  82. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
  83. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
  84. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
  85. package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
  86. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
  87. package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
  88. package/packages/workflow-editor/src/properties-editors/user-condition.js +177 -0
  89. package/packages/workflow-editor/src/store/getters.js +27 -0
  90. package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
  91. package/packages/workflow-editor/src/taches/common-methods.js +21 -0
  92. package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
  93. package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
  94. package/packages/workflow-editor/src/taches/decision.vue +102 -0
  95. package/packages/workflow-editor/src/taches/end.vue +76 -0
  96. package/packages/workflow-editor/src/taches/fork.vue +102 -0
  97. package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
  98. package/packages/workflow-editor/src/taches/human-task.vue +113 -0
  99. package/packages/workflow-editor/src/taches/join.vue +91 -0
  100. package/packages/workflow-editor/src/taches/joint.vue +177 -0
  101. package/packages/workflow-editor/src/taches/start.vue +76 -0
  102. package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
  103. package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
  104. package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
  105. package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
  106. package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
  107. package/packages/workflow-editor/src/transitions/transition.vue +212 -0
  108. package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
  109. package/packages/workflow-editor/src/util.js +493 -0
  110. package/packages/workflow-editor/src/workflow-editor.vue +605 -0
  111. package/packages/workflow-editor/src/workflow-history.vue +153 -0
  112. package/src/i18n/langs/cn.js +4 -1
  113. package/src/i18n/langs/en.js +4 -1
@@ -0,0 +1,212 @@
1
+ <template>
2
+ <g
3
+ :class="{'no-events': draggerToMove!=null}"
4
+ @mousedown.stop="select"
5
+ @dblclick.stop="showPropertiesEditor"
6
+ >
7
+ <text
8
+ :x="text.x"
9
+ :y="text.y"
10
+ text-anchor="middle"
11
+ class="draggable"
12
+ >
13
+ {{ name }}
14
+ </text>
15
+ <component :is="model.lineInfo.type" :owner="model" :class="{'transition':true,'selected':model.isSelected||(model.startJoint.parent.isSelected&&model.endJoint.parent.isSelected)}" />
16
+ <!-- <straight-line :owner="model" :class="{'transition':true,'selected':model.isSelected||(model.startJoint.parent.isSelected&&model.endJoint.parent.isSelected)}"/> -->
17
+ <g v-if="model.isSelected">
18
+ <circle
19
+ v-for="dragger in draggers"
20
+ :key="dragger.position"
21
+ :cx="dragger.x"
22
+ :cy="dragger.y"
23
+ class="transition-dragger"
24
+ r="4"
25
+ @mousedown.stop="startDrag($event,dragger.position)"
26
+ @mouseup="endDrag"
27
+ />
28
+ </g>
29
+ </g>
30
+ </template>
31
+ <script>
32
+ import { getJoint, getMousePosition, clearAllSelectedComponents, watchShowName } from '../util'
33
+ import { mapGetters, mapMutations } from 'vuex'
34
+ import StraightLine from './straight-line'
35
+ import CurveLine from './curve-line'
36
+ import BrokenLine from './broken-line'
37
+ export default {
38
+ name: 'Transition',
39
+ components: {
40
+ StraightLine,
41
+ CurveLine,
42
+ BrokenLine
43
+ },
44
+ props: {
45
+ model: {
46
+ type: Object,
47
+ default: null
48
+ }
49
+ },
50
+ data() {
51
+ const point = this.getTextPoint()
52
+ return {
53
+ text: {
54
+ x: point.x,
55
+ y: point.y
56
+ },
57
+ name: this.model.remark
58
+ }
59
+ },
60
+ computed: {
61
+ ...mapGetters('wfEditor', [
62
+ 'draggerToMove',
63
+ 'processI18n'
64
+ ]),
65
+ draggers() {
66
+ const startPoint = getJoint(this.model.startJoint.parent, this.model.startJoint.position)
67
+ startPoint.position = 'start'
68
+ const endPoint = getJoint(this.model.endJoint.parent, this.model.endJoint.position)
69
+ endPoint.position = 'end'
70
+ return [startPoint, endPoint]
71
+ },
72
+ path() {
73
+ return 'M' + this.draggers[0].x + ' ' + this.draggers[0].y + ' L' + this.draggers[1].x + ' ' + this.draggers[1].y
74
+ }
75
+ },
76
+ created() {
77
+ this.name = watchShowName(this, this.name)
78
+ },
79
+ mounted() {
80
+ // 线条名称内容修改时
81
+ this.$watch('model.remark', function(newVal) {
82
+ this.name = watchShowName(this, newVal)
83
+ if (this.name && this.name !== '') {
84
+ // 计算文本框的x、y坐标
85
+ const point = this.getTextPoint()
86
+ this.text.x = point.x
87
+ this.text.y = point.y
88
+ }
89
+ })
90
+ // 右键菜单更改线条方式时
91
+ this.$watch('model.lineInfo.type', function(newVal) {
92
+ // 计算文本框的x、y坐标
93
+ const point = this.getTextPoint()
94
+ this.text.x = point.x
95
+ this.text.y = point.y
96
+ })
97
+ // 拖动控制点的位置时
98
+ this.$watch('model.lineInfo.controlPoint', function(newVal) {
99
+ // 计算文本框的x、y坐标
100
+ const point = this.getTextPoint()
101
+ this.text.x = point.x
102
+ this.text.y = point.y
103
+ })
104
+ // 水平拖动起点节点
105
+ this.$watch('model.startJoint.parent.x', function(newVal) {
106
+ // 计算文本框的x、y坐标
107
+ const point = this.getTextPoint()
108
+ this.text.x = point.x
109
+ this.text.y = point.y
110
+ })
111
+ // 垂直拖动起点节点
112
+ this.$watch('model.startJoint.parent.y', function(newVal) {
113
+ // 计算文本框的x、y坐标
114
+ const point = this.getTextPoint()
115
+ this.text.x = point.x
116
+ this.text.y = point.y
117
+ })
118
+ // 水平拖动终点节点
119
+ this.$watch('model.endJoint.parent.x', function(newVal) {
120
+ // 计算文本框的x、y坐标
121
+ const point = this.getTextPoint()
122
+ this.text.x = point.x
123
+ this.text.y = point.y
124
+ })
125
+ // 垂直拖动终点节点
126
+ this.$watch('model.endJoint.parent.y', function(newVal) {
127
+ // 计算文本框的x、y坐标
128
+ const point = this.getTextPoint()
129
+ this.text.x = point.x
130
+ this.text.y = point.y
131
+ })
132
+ },
133
+ methods: {
134
+ ...mapMutations('wfEditor', [
135
+ 'setMouseDownPosition',
136
+ 'setDraggerToMove',
137
+ 'setSelectedTransition',
138
+ 'setPropertiesEditorFor'
139
+ ]),
140
+ getTextPoint() {
141
+ const startPoint = getJoint(this.model.startJoint.parent, this.model.startJoint.position)
142
+ const endPoint = getJoint(this.model.endJoint.parent, this.model.endJoint.position)
143
+ let minX = startPoint.x < endPoint.x ? startPoint.x : endPoint.x
144
+ let minY = startPoint.y < endPoint.y ? startPoint.y : endPoint.y
145
+ let textX = minX + Math.abs(startPoint.x - endPoint.x) / 2
146
+ let textY = minY + Math.abs(startPoint.y - endPoint.y) / 2
147
+ if (this.model.lineInfo.type === 'CurveLine') {
148
+ // 曲线
149
+ const point = this.model.lineInfo.controlPoint
150
+ if (point) {
151
+ minX = startPoint.x < point.x ? startPoint.x : parseFloat(point.x)
152
+ minY = startPoint.y < point.y ? startPoint.y : parseFloat(point.y)
153
+ textX = minX + Math.abs(startPoint.x - point.x) / 2 + 10
154
+ textY = minY + Math.abs(startPoint.y - point.y) / 2 - 10
155
+ }
156
+ } else if (this.model.lineInfo.type === 'BrokenLine') {
157
+ const point = this.model.lineInfo.controlPoint[0]
158
+ if (point) {
159
+ minX = startPoint.x < point.x ? startPoint.x : parseFloat(point.x)
160
+ minY = startPoint.y < point.y ? startPoint.y : parseFloat(point.y)
161
+ textX = minX + Math.abs(startPoint.x - point.x) / 2
162
+ textY = minY + Math.abs(startPoint.y - point.y) / 2 - 10
163
+ }
164
+ }
165
+ return { x: textX, y: textY }
166
+ },
167
+ select(event) {
168
+ clearAllSelectedComponents()
169
+ this.model.isSelected = true
170
+ this.setSelectedTransition(this.model)
171
+ },
172
+ startDrag(event, position) {
173
+ console.log('start dragging line')
174
+ this.setMouseDownPosition(getMousePosition(event))
175
+ this.setDraggerToMove({
176
+ owner: this.model,
177
+ position,
178
+ originStartJoint: this.model.startJoint,
179
+ originEndJoint: this.model.endJoint
180
+ })
181
+ },
182
+ endDrag() {
183
+ // this.setSe
184
+ },
185
+ showPropertiesEditor() {
186
+ if (this.model.endJoint.parent.type !== 'Decision') {
187
+ this.setPropertiesEditorFor('Transition')
188
+ }
189
+ }
190
+ }
191
+ }
192
+ </script>
193
+ <style scoped>
194
+ .transition{
195
+ stroke-width: 2;
196
+ stroke:#666;
197
+ fill: none;
198
+ cursor: pointer;
199
+ }
200
+ .selected{
201
+ stroke:red;
202
+ }
203
+ .transition-dragger{
204
+ stroke: red;
205
+ stroke-width: 1;
206
+ fill: white;
207
+ cursor:move;
208
+ }
209
+ .no-events{
210
+ pointer-events: none;
211
+ }
212
+ </style>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <g>
3
+ <path v-show="path" :d="path" class="virtual-transition" marker-end="url(#arrow)" />
4
+ </g>
5
+ </template>
6
+ <script>
7
+ import { getJoint } from '../util'
8
+ import { mapGetters } from 'vuex'
9
+ export default {
10
+ name: 'VirtualTransition',
11
+ props: {
12
+ toPosition: {
13
+ type: Object,
14
+ default: null
15
+ }
16
+ },
17
+ computed: {
18
+ ...mapGetters('wfEditor', [
19
+ 'startJoint'
20
+ ]),
21
+ path() {
22
+ if (!this.startJoint) {
23
+ return null
24
+ }
25
+ const startJoint = getJoint(this.startJoint.parent, this.startJoint.position)
26
+ // 虚线的endJoint存的就是鼠标的当前位置,此时还没有连接到任何环节上
27
+ const endJoint = this.toPosition
28
+ return 'M' + startJoint.x + ' ' + startJoint.y + ' L' + endJoint.x + ' ' + endJoint.y
29
+ }
30
+ },
31
+ methods: {
32
+
33
+ }
34
+ }
35
+ </script>
36
+ <style>
37
+ .virtual-transition{
38
+ stroke-width: 2;
39
+ stroke:#000;
40
+ stroke-dasharray: 2 2;
41
+ fill: none;
42
+ }
43
+ </style>