workflow-editor 0.0.81-up → 0.0.81-up-tmp1

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 (175) hide show
  1. package/dist/index.full.min.js +3237 -0
  2. package/dist/style.css +1 -0
  3. package/es/_virtual/FileSaver.min.mjs +4 -0
  4. package/es/_virtual/___vite-browser-external.mjs +6 -0
  5. package/es/_virtual/__vite-browser-external.mjs +4 -0
  6. package/es/_virtual/_commonjsHelpers.mjs +30 -0
  7. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  8. package/es/_virtual/clipboard.mjs +4 -0
  9. package/es/_virtual/dayjs.min.mjs +4 -0
  10. package/es/_virtual/index.mjs +4 -0
  11. package/es/_virtual/nprogress.mjs +4 -0
  12. package/es/_virtual/prism.mjs +4 -0
  13. package/es/_virtual/sax.mjs +4 -0
  14. package/es/_virtual/string_decoder.mjs +4 -0
  15. package/es/_virtual/tinymce.mjs +4 -0
  16. package/es/_virtual/weekOfYear.mjs +4 -0
  17. package/es/index.mjs +20 -0
  18. package/es/plugins/formValidatorUtil.mjs +391 -0
  19. package/es/plugins/index.mjs +9 -0
  20. package/es/style.css +1 -0
  21. package/es/vite.svg +1 -0
  22. package/es/workflow-editor/index.mjs +14 -0
  23. package/lib/_virtual/FileSaver.min.cjs +1 -0
  24. package/lib/_virtual/___vite-browser-external.cjs +1 -0
  25. package/lib/_virtual/__vite-browser-external.cjs +1 -0
  26. package/lib/_virtual/_commonjsHelpers.cjs +1 -0
  27. package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -0
  28. package/lib/_virtual/clipboard.cjs +1 -0
  29. package/lib/_virtual/dayjs.min.cjs +1 -0
  30. package/lib/_virtual/index.cjs +1 -0
  31. package/lib/_virtual/nprogress.cjs +1 -0
  32. package/lib/_virtual/prism.cjs +1 -0
  33. package/lib/_virtual/sax.cjs +1 -0
  34. package/lib/_virtual/string_decoder.cjs +1 -0
  35. package/lib/_virtual/tinymce.cjs +1 -0
  36. package/lib/_virtual/weekOfYear.cjs +1 -0
  37. package/lib/index.cjs +1 -0
  38. package/lib/plugins/formValidatorUtil.cjs +1 -0
  39. package/lib/plugins/index.cjs +1 -0
  40. package/lib/style.css +1 -0
  41. package/lib/workflow-editor/index.cjs +1 -0
  42. package/package.json +5 -3
  43. package/vite.config.js +44 -10
  44. package/lib/401-5a92e011.js +0 -101
  45. package/lib/404-2e472acc.js +0 -26
  46. package/lib/authredirect-ae6e75b4.js +0 -10
  47. package/lib/iframe-page-4e84c0f8.js +0 -33
  48. package/lib/index-27119bd2.js +0 -31464
  49. package/lib/index-369eae4a.js +0 -13
  50. package/lib/tab-content-iframe-index-e9146736.js +0 -33
  51. package/lib/tab-content-index-bbc6792b.js +0 -1241
  52. package/lib/tache-subprocess-history-d51d6a50.js +0 -56
  53. package/lib/workflow-editor.css +0 -1
  54. package/lib/workflow-editor.js +0 -5
  55. package/lib/workflow-editor.umd.cjs +0 -85
  56. package/packages/index.js +0 -34
  57. package/packages/plugins/formValidatorUtil.js +0 -723
  58. package/packages/plugins/index.js +0 -8
  59. package/packages/workflow-editor/index.js +0 -14
  60. package/packages/workflow-editor/src/api.js +0 -7
  61. package/packages/workflow-editor/src/assets/tab-select.png +0 -0
  62. package/packages/workflow-editor/src/assets/tab-selectWhite.png +0 -0
  63. package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
  64. package/packages/workflow-editor/src/constant.js +0 -8
  65. package/packages/workflow-editor/src/json-object-templates/auto-task.js +0 -70
  66. package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -72
  67. package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
  68. package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
  69. package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
  70. package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
  71. package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -208
  72. package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
  73. package/packages/workflow-editor/src/json-object-templates/process.js +0 -99
  74. package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
  75. package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -31
  76. package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
  77. package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -67
  78. package/packages/workflow-editor/src/main/canvas.vue +0 -493
  79. package/packages/workflow-editor/src/main/context-menu.vue +0 -147
  80. package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
  81. package/packages/workflow-editor/src/main/selection-region.vue +0 -66
  82. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
  83. package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
  84. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -40
  85. package/packages/workflow-editor/src/main/toolbox.vue +0 -60
  86. package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -309
  87. package/packages/workflow-editor/src/process-json.js +0 -624
  88. package/packages/workflow-editor/src/process-service.js +0 -69
  89. package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +0 -81
  90. package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +0 -155
  91. package/packages/workflow-editor/src/properties-editors/auto-task.vue +0 -74
  92. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -568
  93. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -320
  94. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
  95. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -268
  96. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -81
  97. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -242
  98. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
  99. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -117
  100. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -88
  101. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -143
  102. package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +0 -149
  103. package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -108
  104. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -272
  105. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -92
  106. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -66
  107. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -354
  108. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -68
  109. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -165
  110. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -275
  111. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -426
  112. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -272
  113. package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -139
  114. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
  115. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
  116. package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -95
  117. package/packages/workflow-editor/src/properties-editors/decision.vue +0 -95
  118. package/packages/workflow-editor/src/properties-editors/fork.vue +0 -77
  119. package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -49
  120. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -62
  121. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -184
  122. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -359
  123. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -256
  124. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -405
  125. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -257
  126. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -430
  127. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -206
  128. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -60
  129. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -224
  130. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -499
  131. package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -107
  132. package/packages/workflow-editor/src/properties-editors/join.vue +0 -49
  133. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -336
  134. package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -79
  135. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -68
  136. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -106
  137. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
  138. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -88
  139. package/packages/workflow-editor/src/properties-editors/process.vue +0 -115
  140. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -201
  141. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
  142. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -216
  143. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -66
  144. package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -80
  145. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
  146. package/packages/workflow-editor/src/properties-editors/transition.vue +0 -75
  147. package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -183
  148. package/packages/workflow-editor/src/store/getters.js +0 -33
  149. package/packages/workflow-editor/src/store/workflow-editor.js +0 -153
  150. package/packages/workflow-editor/src/taches/auto-task.vue +0 -99
  151. package/packages/workflow-editor/src/taches/common-methods.js +0 -21
  152. package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
  153. package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
  154. package/packages/workflow-editor/src/taches/decision.vue +0 -102
  155. package/packages/workflow-editor/src/taches/end.vue +0 -76
  156. package/packages/workflow-editor/src/taches/fork.vue +0 -102
  157. package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
  158. package/packages/workflow-editor/src/taches/human-task.vue +0 -113
  159. package/packages/workflow-editor/src/taches/join.vue +0 -91
  160. package/packages/workflow-editor/src/taches/joint.vue +0 -177
  161. package/packages/workflow-editor/src/taches/start.vue +0 -76
  162. package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
  163. package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
  164. package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
  165. package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
  166. package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
  167. package/packages/workflow-editor/src/transitions/transition.vue +0 -209
  168. package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
  169. package/packages/workflow-editor/src/util.js +0 -499
  170. package/packages/workflow-editor/src/workflow-editor.vue +0 -852
  171. package/packages/workflow-editor/src/workflow-history.vue +0 -153
  172. package/src/i18n/i18n.js +0 -16
  173. package/src/i18n/langs/cn.js +0 -521
  174. package/src/i18n/langs/en.js +0 -529
  175. /package/{public → dist}/vite.svg +0 -0
@@ -1,49 +0,0 @@
1
- <template>
2
- <el-dialog
3
- model-value
4
- :title="$t('workflowEditor.task.attributesOfManualJudgment')"
5
- :center="true"
6
- append-to-body
7
- @open="$emit('open')"
8
- @opend="$emit('opend')"
9
- @close="$emit('close')"
10
- @closed="$emit('closed')"
11
- >
12
- <el-form>
13
- <el-form-item :label="$t('workflowEditor.task.name')" label-width="40px">
14
- <el-input v-model="formModel.attr.name" />
15
- </el-form-item>
16
- </el-form>
17
- </el-dialog>
18
- </template>
19
-
20
- <script>
21
- export default {
22
- name: 'HumanDecisionPropertiesEditor',
23
- props: {
24
- model: {
25
- type: Object,
26
- default: null
27
- }
28
- },
29
- data(){
30
- return {
31
- dialogVisible: true
32
- }
33
- },
34
- computed: {
35
- formModel() {
36
- return this.model.ref
37
- }
38
- },
39
- mounted() {
40
- this.$watch('model.ref.attr.name', function(newVal) {
41
- this.model.name = newVal
42
- })
43
- }
44
- }
45
- </script>
46
-
47
- <style lang="scss" scoped>
48
-
49
- </style>
@@ -1,62 +0,0 @@
1
- <template>
2
- <el-dialog
3
- width="50%"
4
- :title="$t('workflowEditor.task.setConditions')"
5
- model-value
6
- top="10vh"
7
- append-to-body
8
- class="properties-editor-noTab"
9
- center
10
- @close="$emit('close')"
11
- >
12
- <el-form-item>
13
- <additional-condition v-model="condition" />
14
- </el-form-item>
15
- <template #footer>
16
- <el-button type="primary" size="small" @click="setConditions">
17
- {{ $t('workflowEditorPublicModel.determine') }}
18
- </el-button>
19
- <el-button size="small" @click="$emit('close')">
20
- {{ $t('workflowEditorPublicModel.cancel') }}
21
- </el-button>
22
- </template>
23
- </el-dialog>
24
- </template>
25
-
26
- <script>
27
- import AdditionalCondition from '../common/additional-condition'
28
- export default {
29
- name: 'AdditionalConditionDialog',
30
- components: {
31
- AdditionalCondition
32
- },
33
- props: {
34
- modelValue: {
35
- type: String,
36
- default: ''
37
- }
38
- },
39
- data() {
40
- return {
41
- condition: this.modelValue,
42
- dialogVisible: true
43
- }
44
- },
45
- watch: {
46
- value(val) {
47
- this.condition = val
48
- }
49
- },
50
- methods: {
51
- setConditions() {
52
- // this.$emit('input', this.condition)
53
- this.$emit('update:modelValue', this.condition)
54
- this.$emit('close')
55
- }
56
- }
57
- }
58
- </script>
59
-
60
- <style lang="scss" scoped>
61
-
62
- </style>
@@ -1,184 +0,0 @@
1
- <template>
2
- <el-form :model="formModel" label-width="110px">
3
- <el-row>
4
- <el-col :span="12">
5
- <el-form-item :label="$t('workflowEditor.task.name')">
6
- <!-- <el-input v-model="formModel.name" /> -->
7
- <i18n-input
8
- v-model="formModel.name"
9
- :i18n-key="tache.i18nKey ? tache.i18nKey : 'name.' + formModel.id"
10
- @setI18n="setI18nValue"
11
- />
12
- </el-form-item>
13
- </el-col>
14
- <el-col :span="12">
15
- <el-form-item :label="$t('workflowEditor.task.code')">
16
- <el-input v-model="formModel.id" @blur="validateId" />
17
- </el-form-item>
18
- </el-col>
19
- </el-row>
20
- <el-form-item :label="$t('workflowEditor.task.taskTitle')">
21
- <task-title v-model="tache.taskTitle" />
22
- </el-form-item>
23
- <el-form-item :label="$t('workflowEditor.task.canItBeRejected')">
24
- <el-switch v-model="tache.rebuttable" />
25
- </el-form-item>
26
- <el-form-item :label="$t('workflowEditor.task.emailNotification')">
27
- <el-switch v-model="tache.mailNotice" />
28
- </el-form-item>
29
- <el-form-item v-if="tache.mailNotice" :label="$t('workflowEditor.task.selectNoticeTemplate')">
30
- <select-mail-templates v-model="tache.mailTemplateCode" @set-value="setMailTemplateCode" />
31
- </el-form-item>
32
- <el-form-item v-if="tache.mailNotice" :label="$t('workflowEditor.task.selectMailTemplate')">
33
- <select-mail-templates v-model="tache.mailPointTemplateCode" @set-value="setMailPointTemplateCode" />
34
- </el-form-item>
35
- <el-form-item :label="$t('workflowEditor.task.HandlingMethod')">
36
- <el-radio-group v-model="tache.processingMode.type">
37
- <el-radio label="EDIT">
38
- {{ $t('workflowEditor.task.editorial') }}
39
- </el-radio>
40
- <el-radio label="APPROVE">
41
- {{ $t('workflowEditor.task.approvalType') }}
42
- </el-radio>
43
- <el-radio label="COUNTERSIGN">
44
- {{ $t('workflowEditor.task.countersign') }}
45
- </el-radio>
46
- <el-radio label="VOTE">
47
- {{ $t('workflowEditor.task.voting') }}
48
- </el-radio>
49
- </el-radio-group>
50
- </el-form-item>
51
- <el-form-item
52
- v-if="tache.processingMode.type === 'EDIT' || tache.processingMode.type === 'APPROVE'"
53
- :label="$t('workflowEditorMessage.whenThereAreMultipleManagers')"
54
- >
55
- <el-radio-group v-model="tache.processingMode.moreTransactor">
56
- <el-radio :label="false">
57
- {{ $t('workflowEditor.task.anyOneCanHandleIt') }}
58
- </el-radio>
59
- <el-radio :label="true">
60
- {{ $t('workflowEditor.task.forAll') }}
61
- </el-radio>
62
- </el-radio-group>
63
- </el-form-item>
64
- <el-form-item
65
- v-if="tache.processingMode.type === 'COUNTERSIGN' || tache.processingMode.type === 'VOTE'"
66
- :label="$t('workflowEditor.task.passRate')"
67
- >
68
- <el-input-number
69
- v-model="tache.processingMode.passRate"
70
- :step="10"
71
- size="small"
72
- :min="0"
73
- :max="100"
74
- />
75
- <span class="percent"> % </span>
76
- </el-form-item>
77
- <el-form-item :label="$t('workflowEditor.task.modifyOperationName')">
78
- <el-switch v-model="showActions" />
79
- <custom-actions
80
- v-if="showActions"
81
- :model="tache.processingMode.actions"
82
- @updateAction="updateAction"
83
- />
84
- </el-form-item>
85
- <el-form-item :label="$t('workflowEditor.task.handlingPage')">
86
- <el-input v-model="tache.taskUrl" />
87
- </el-form-item>
88
- <el-form-item :label="$t('workflowEditor.task.remarks')">
89
- <el-input v-model="tache.remark" type="textarea" autosize />
90
- </el-form-item>
91
- </el-form>
92
- </template>
93
- <script>
94
- import TaskTitle from '../common/task-title'
95
- import CustomActions from './custom-actions'
96
- import { validateTacheCode } from '../../util'
97
- import i18nInput from '../common/i18n-input'
98
- import SelectMailTemplates from '../common/select-mail-template.vue'
99
- export default {
100
- name: 'BasicProperties',
101
- components: {
102
- TaskTitle,
103
- CustomActions,
104
- i18nInput,
105
- SelectMailTemplates
106
- },
107
- props: {
108
- model: {
109
- type: Object,
110
- default: null
111
- },
112
- id: {
113
- type: String,
114
- default: null
115
- },
116
- name: {
117
- type: String,
118
- default: null
119
- }
120
- },
121
- data() {
122
- let showActions = false
123
- const actions = this.model.processingMode.actions.action
124
- if (actions) {
125
- if (Array.isArray(actions) && actions.length === 0) {
126
- showActions = false
127
- } else {
128
- showActions = true
129
- }
130
- }
131
- return {
132
- showActions,
133
- formModel: {
134
- name: this.name,
135
- id: this.id,
136
- tache: this.model
137
- }
138
- }
139
- },
140
- computed: {
141
- tache() {
142
- return this.model
143
- }
144
- },
145
- created() {
146
- if (!this.tache.processingMode.actions) {
147
- this.tache.processingMode.actions = {}
148
- // this.$set(this.tache.processingMode, 'actions', {})
149
- }
150
- },
151
- mounted() {
152
- // 支持.snyc修饰符的写法
153
- this.$watch('formModel.name', function (newVal, oldVal) {
154
- this.$emit('update:name', newVal)
155
- })
156
- },
157
- methods: {
158
- // 原来使用$watch来监听id的更改是不行的:input框每输入一个字符都会导致$watch的触发,输入过程中不应该触发(这时候没有输入完成,做的id重复判断是无效的),而是等blur后触发才能保证正确性
159
- validateId() {
160
- validateTacheCode(this)
161
- },
162
- // 关闭选择邮件模板弹框
163
- setMailTemplateCode(mailTemplateCode) {
164
- this.tache.mailTemplateCode = mailTemplateCode
165
- },
166
- setMailPointTemplateCode(mailTemplateCode){
167
- this.tache.mailPointTemplateCode = mailTemplateCode
168
- },
169
- setI18nValue(i18nKey) {
170
- this.tache.i18nKey = i18nKey
171
- },
172
- updateAction(action) {
173
- this.tache.processingMode.actions.action = action
174
- }
175
- }
176
- }
177
- </script>
178
- <style scoped>
179
- .percent {
180
- margin-left: 10px;
181
- color: red;
182
- font-size: 1.2em;
183
- }
184
- </style>
@@ -1,359 +0,0 @@
1
- // import modulePageService from '@/subsystems/mms/api/module-page'
2
- import { getI18n } from '../../../../workflow-editor/src/util'
3
- const utiljs = {
4
- // 格式化json
5
- xmlToData(xmlData) {
6
- const tableData = []
7
- if (xmlData) {
8
- const arr = xmlData.split(' ')
9
- if (arr && arr.length > 0) {
10
- let num = 1
11
- let leftBracket = ''
12
- let propName = ''
13
- let operator = ''
14
- let propValue = ''
15
- let rightBracket = ''
16
- let logicOperator = ''
17
- let propValueType = null
18
- for (var i = 0; i < arr.length; i++) {
19
- var str = arr[i]
20
- if (str.indexOf('(') !== -1) {
21
- if (this.operationArr) {
22
- this.operationArr.push([])
23
- }
24
- leftBracket = ''
25
- propName = ''
26
- operator = ''
27
- propValue = ''
28
- rightBracket = ''
29
- logicOperator = ''
30
- const leftarr = str.split('${field[')
31
- leftBracket = leftarr[0]
32
- propName = leftarr[1].replace(']}', '')
33
- if (this.operationArr) {
34
- const operatorsArr = this.getOperators(this.fieldMap[propName])
35
- this.operationArr[num - 1] = operatorsArr
36
- }
37
- continue
38
- }
39
- if (str.indexOf('(') === -1 && str.indexOf('${field[') !== -1) {
40
- if (this.operationArr) {
41
- this.operationArr.push([])
42
- }
43
- leftBracket = ''
44
- propName = ''
45
- operator = ''
46
- propValue = ''
47
- rightBracket = ''
48
- logicOperator = ''
49
- propName = str.replace('${field[', '').replace(']}', '')
50
- if (this.operationArr) {
51
- const operatorsArr = this.getOperators(this.fieldMap[propName])
52
- this.operationArr[num - 1] = operatorsArr
53
- }
54
- continue
55
- }
56
- if (str.indexOf('operator.') !== -1 && str.indexOf('condition.') === -1) {
57
- operator = str
58
- continue
59
- }
60
- if (operator !== '' && propValue === '') {
61
- if (str.indexOf(')') !== -1) {
62
- if (str.indexOf(')))') !== -1) {
63
- propValue = str.replace(')))', '')
64
- rightBracket = ')))'
65
- } else if (str.indexOf('))') !== -1) {
66
- propValue = str.replace('))', '')
67
- rightBracket = '))'
68
- } else if (str.indexOf(')') !== -1) {
69
- propValue = str.replace(')', '')
70
- rightBracket = ')'
71
- }
72
- } else {
73
- propValue = str
74
- }
75
- if (propValue && propValue !== '') {
76
- if (propValue.indexOf('${task.') !== -1) {
77
- propValueType = 'task'
78
- } else if (propValue.indexOf('${context.') !== -1) {
79
- propValueType = 'context'
80
- } else if (propValue.indexOf('${obj.') !== -1) {
81
- propValueType = 'obj'
82
- } else if (propValue.indexOf('${subObj.') !== -1) {
83
- propValueType = 'subObj'
84
- } else if (propValue.indexOf('${request.') !== -1) {
85
- propValueType = 'request'
86
- } else if (propValue.indexOf('${input.') !== -1) {
87
- propValueType = 'input'
88
- } else if (propValue.indexOf('${custom.') !== -1) {
89
- propValueType = 'custom'
90
- }
91
- }
92
- continue
93
- }
94
- if (str.indexOf('condition.') !== -1) {
95
- logicOperator = str
96
- tableData.push({
97
- id: num,
98
- leftBracket: leftBracket,
99
- propName: propName,
100
- operator: operator,
101
- propValue: propValue,
102
- rightBracket: rightBracket,
103
- logicOperator: logicOperator,
104
- propValueType: propValueType
105
- })
106
- num += 1
107
- } else if (propValue && propValue !== '') {
108
- if (!logicOperator || logicOperator === '') {
109
- logicOperator = 'condition.operator.or'
110
- tableData.push({
111
- id: num,
112
- leftBracket: leftBracket,
113
- propName: propName,
114
- operator: operator,
115
- propValue: propValue,
116
- rightBracket: rightBracket,
117
- logicOperator: logicOperator,
118
- propValueType: propValueType
119
- })
120
- num += 1
121
- }
122
- }
123
- }
124
- }
125
- }
126
- return tableData
127
- },
128
- getOperatorsArr(conditionList) {
129
- if (conditionList && conditionList.length > 0) {
130
- for (var i = 0; i < conditionList.length; i++) {
131
- this.operationArr.push([])
132
- const item = conditionList[i]
133
- const operatorsArr = this.getOperators(this.fieldMap[item.propName])
134
- this.operationArr[i] = operatorsArr
135
- }
136
- }
137
- },
138
- getRetunrOperatorsArr(conditionList, fieldMap) {
139
- const operationArr = []
140
- if (conditionList && conditionList.length > 0) {
141
- for (var i = 0; i < conditionList.length; i++) {
142
- operationArr.push([])
143
- const item = conditionList[i]
144
- const operatorsArr = this.getOperators(fieldMap[item.propName])
145
- operationArr[i] = operatorsArr
146
- }
147
- }
148
- return operationArr
149
- },
150
- dataToXml(tableData) {
151
- let stringData = ''
152
- if (tableData && tableData.length > 0) {
153
- for (var i = 0; i < tableData.length; i++) {
154
- var item = tableData[i]
155
- let logicOperator = item.logicOperator
156
- if (i === tableData.length - 1) {
157
- logicOperator = ''
158
- }
159
-
160
- stringData =
161
- stringData +
162
- item.leftBracket +
163
- '${field[' +
164
- item.propName +
165
- ']} ' +
166
- item.operator +
167
- ' ' +
168
- item.propValue +
169
- item.rightBracket +
170
- ' ' +
171
- logicOperator +
172
- ' '
173
- }
174
- }
175
- return stringData
176
- },
177
- formatConditionList(conditionList) {
178
- let returnStr = ''
179
- if (conditionList) {
180
- if (typeof conditionList === 'string') {
181
- // 先进行转换再解析
182
- const dataList = this.xmlToData(conditionList)
183
- returnStr = this.formatConditionListTwo(dataList)
184
- } else {
185
- returnStr = this.formatConditionListTwo(conditionList)
186
- }
187
- }
188
- if (returnStr && returnStr !== '') {
189
- const endStr = returnStr.substring(returnStr.length - 1)
190
- if (endStr === '者' || endStr === '且') {
191
- returnStr = returnStr.substring(0, returnStr.length - 2)
192
- }
193
- }
194
- return returnStr
195
- },
196
- formatConditionListTwo(conditionList) {
197
- let returnStr = ''
198
- if (conditionList && conditionList.length > 0) {
199
- for (var i = 0; i < conditionList.length; i++) {
200
- const item = conditionList[i]
201
- if (item && item.propName) {
202
- const operatorsArr = this.getOperators(this.fieldMap[item.propName])
203
- if (operatorsArr && operatorsArr.length > 0) {
204
- const operator = operatorsArr.filter((operItem) => {
205
- return operItem.name === item.operator
206
- })
207
- returnStr += item.leftBracket
208
- if (this.fieldMap[item.propName] && this.fieldMap[item.propName].label) {
209
- returnStr += this.fieldMap[item.propName].label + ' '
210
- }
211
-
212
- if (operator && operator.length > 0) {
213
- returnStr += operator[0].label + ' '
214
- }
215
- returnStr += item.propValue + item.rightBracket + ' '
216
- if (item.logicOperator) {
217
- if (item.logicOperator === 'or') {
218
- returnStr += '或者'
219
- } else {
220
- returnStr += '并且'
221
- }
222
- }
223
- }
224
- }
225
- }
226
- }
227
- return returnStr
228
- },
229
- // 实时根据类型改变连接符
230
- getOperators(item) {
231
- if (item) {
232
- if (item.type === 'INTEGER' || item.type === 'LONG' || item.type === 'DOUBLE' || item.type === 'FLOAT') {
233
- return [
234
- {
235
- name: 'operator.number.gt',
236
- label: getI18n().t('workflowEditor.process.greaterThan')
237
- },
238
- {
239
- name: 'operator.number.lt',
240
- label: getI18n().t('workflowEditor.process.lessThan')
241
- },
242
- {
243
- name: 'operator.number.eq',
244
- label: getI18n().t('workflowEditor.process.beEqualTo')
245
- },
246
- {
247
- name: 'operator.number.le',
248
- label: getI18n().t('workflowEditor.process.notGreaterThan')
249
- },
250
- {
251
- name: 'operator.number.ge',
252
- label: getI18n().t('workflowEditor.process.notLessThan')
253
- },
254
- {
255
- name: 'operator.number.ne',
256
- label: getI18n().t('workflowEditor.process.notEqualTo')
257
- },
258
- {
259
- name: 'operator.text.is.null',
260
- label: getI18n().t('workflowEditor.process.isNull')
261
- },
262
- {
263
- name: 'operator.text.not.null',
264
- label: getI18n().t('workflowEditor.process.isNotNull')
265
- }
266
- ]
267
- } else if (item.type === 'DATE' || item.type === 'TIME') {
268
- return [
269
- {
270
- name: 'operator.date.gt',
271
- label: getI18n().t('workflowEditor.process.laterThan')
272
- },
273
- {
274
- name: 'operator.date.lt',
275
- label: getI18n().t('workflowEditor.process.earlierThan')
276
- },
277
- {
278
- name: 'operator.date.eq',
279
- label: getI18n().t('workflowEditor.process.beEqualTo')
280
- },
281
- {
282
- name: 'operator.date.le',
283
- label: getI18n().t('workflowEditor.process.noLaterThan')
284
- },
285
- {
286
- name: 'operator.date.ge',
287
- label: getI18n().t('workflowEditor.process.noEarlierThan')
288
- },
289
- {
290
- name: 'operator.text.is.null',
291
- label: getI18n().t('workflowEditor.process.isNull')
292
- },
293
- {
294
- name: 'operator.text.not.null',
295
- label: getI18n().t('workflowEditor.process.isNotNull')
296
- }
297
- ]
298
- } else if (item.type === 'TEXT') {
299
- return [
300
- {
301
- name: 'operator.text.eq',
302
- label: getI18n().t('workflowEditor.process.beEqualTo')
303
- },
304
- {
305
- name: 'operator.text.neq',
306
- label: getI18n().t('workflowEditor.process.notEqualTo')
307
- },
308
- {
309
- name: 'operator.text.contain',
310
- label: getI18n().t('workflowEditor.process.contain')
311
- },
312
- {
313
- name: 'operator.text.contain.not',
314
- label: getI18n().t('workflowEditor.process.notIncluded')
315
- },
316
- {
317
- name: 'operator.text.is.null',
318
- label: getI18n().t('workflowEditor.process.isNull')
319
- },
320
- {
321
- name: 'operator.text.not.null',
322
- label: getI18n().t('workflowEditor.process.isNotNull')
323
- }
324
- ]
325
- } else {
326
- return [
327
- {
328
- name: 'operator.text.eq',
329
- label: getI18n().t('workflowEditor.process.beEqualTo')
330
- },
331
- {
332
- name: 'operator.text.neq',
333
- label: getI18n().t('workflowEditor.process.notEqualTo')
334
- },
335
- {
336
- name: 'operator.text.is.null',
337
- label: getI18n().t('workflowEditor.process.isNull')
338
- },
339
- {
340
- name: 'operator.text.not.null',
341
- label: getI18n().t('workflowEditor.process.isNotNull')
342
- }
343
- ]
344
- }
345
- } else {
346
- return [
347
- {
348
- name: 'operator.text.eq',
349
- label: getI18n().t('workflowEditor.process.beEqualTo')
350
- },
351
- {
352
- name: 'operator.text.neq',
353
- label: getI18n().t('workflowEditor.process.notEqualTo')
354
- }
355
- ]
356
- }
357
- }
358
- }
359
- export default utiljs