workflow-editor 0.9.84-dw-tmp8 → 0.9.84-dw-tmp10

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 (111) hide show
  1. package/lib/workflow-editor.css +1 -1
  2. package/lib/workflow-editor.umd.min.js +5 -5
  3. package/package.json +1 -1
  4. package/packages/index.js +0 -34
  5. package/packages/plugins/formValidatorUtil.js +0 -528
  6. package/packages/plugins/index.js +0 -8
  7. package/packages/workflow-editor/index.js +0 -14
  8. package/packages/workflow-editor/src/api.js +0 -7
  9. package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
  10. package/packages/workflow-editor/src/constant.js +0 -8
  11. package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -67
  12. package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
  13. package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
  14. package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
  15. package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
  16. package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -199
  17. package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
  18. package/packages/workflow-editor/src/json-object-templates/process.js +0 -98
  19. package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
  20. package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -30
  21. package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
  22. package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -66
  23. package/packages/workflow-editor/src/main/canvas.vue +0 -479
  24. package/packages/workflow-editor/src/main/context-menu.vue +0 -132
  25. package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
  26. package/packages/workflow-editor/src/main/selection-region.vue +0 -66
  27. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
  28. package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
  29. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -35
  30. package/packages/workflow-editor/src/main/toolbox.vue +0 -60
  31. package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -302
  32. package/packages/workflow-editor/src/process-json.js +0 -622
  33. package/packages/workflow-editor/src/process-service.js +0 -31
  34. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -522
  35. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -276
  36. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
  37. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -239
  38. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -47
  39. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -241
  40. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
  41. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -116
  42. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -75
  43. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -125
  44. package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -98
  45. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -179
  46. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -83
  47. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -65
  48. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -355
  49. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -63
  50. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -148
  51. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -220
  52. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -386
  53. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -209
  54. package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -135
  55. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
  56. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
  57. package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -80
  58. package/packages/workflow-editor/src/properties-editors/decision.vue +0 -90
  59. package/packages/workflow-editor/src/properties-editors/fork.vue +0 -72
  60. package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -44
  61. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -60
  62. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -156
  63. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -291
  64. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -249
  65. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -392
  66. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -241
  67. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -220
  68. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -204
  69. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -59
  70. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -207
  71. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -390
  72. package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -103
  73. package/packages/workflow-editor/src/properties-editors/join.vue +0 -44
  74. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -273
  75. package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -76
  76. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -60
  77. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -95
  78. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
  79. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -81
  80. package/packages/workflow-editor/src/properties-editors/process.vue +0 -109
  81. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -176
  82. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
  83. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -206
  84. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -64
  85. package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -79
  86. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
  87. package/packages/workflow-editor/src/properties-editors/transition.vue +0 -74
  88. package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -177
  89. package/packages/workflow-editor/src/store/getters.js +0 -27
  90. package/packages/workflow-editor/src/store/workflow-editor.js +0 -125
  91. package/packages/workflow-editor/src/taches/common-methods.js +0 -21
  92. package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
  93. package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
  94. package/packages/workflow-editor/src/taches/decision.vue +0 -102
  95. package/packages/workflow-editor/src/taches/end.vue +0 -76
  96. package/packages/workflow-editor/src/taches/fork.vue +0 -102
  97. package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
  98. package/packages/workflow-editor/src/taches/human-task.vue +0 -113
  99. package/packages/workflow-editor/src/taches/join.vue +0 -91
  100. package/packages/workflow-editor/src/taches/joint.vue +0 -177
  101. package/packages/workflow-editor/src/taches/start.vue +0 -76
  102. package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
  103. package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
  104. package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
  105. package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
  106. package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
  107. package/packages/workflow-editor/src/transitions/transition.vue +0 -212
  108. package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
  109. package/packages/workflow-editor/src/util.js +0 -493
  110. package/packages/workflow-editor/src/workflow-editor.vue +0 -605
  111. package/packages/workflow-editor/src/workflow-history.vue +0 -153
@@ -1,81 +0,0 @@
1
- <template>
2
- <el-dialog
3
- :show-close="true"
4
- :append-to-body="true"
5
- :title="$t('workflowEditorPublicModel.selectPage')"
6
- width="60%"
7
- visible
8
- @close="savePage"
9
- >
10
- <div style="overflow-y:auto;max-height: 500px">
11
- <div class="operation-area">
12
- <el-button size="small" @click="savePage">
13
- <span>{{ $t('workflowEditorPublicModel.close') }}</span>
14
- </el-button>
15
- </div>
16
- <div>
17
- <super-grid
18
- ref="grid"
19
- :url="baseURL + listURL"
20
- code="MMS_MODULE_PAGE"
21
- @select="select"
22
- />
23
- </div>
24
- </div>
25
- </el-dialog>
26
- </template>
27
- <script>
28
-
29
- // import modulePageService from '@/subsystems/mms/api/module-page'
30
- import Vue from 'vue'
31
-
32
- export default {
33
- props: {
34
- pageFormCode: {
35
- type: String,
36
- default: null
37
- }
38
- },
39
- data() {
40
- return {
41
- baseURL: '',
42
- listURL: '',
43
- selection: []
44
- }
45
- },
46
- watch: {
47
- conditionList: {
48
- handler(newValue, oldValue) {
49
- this.judgeHeavyData = newValue
50
- }
51
- }
52
- },
53
- created() {
54
- this.baseURL = Vue.prototype.baseURL
55
- if (this.pageFormCode) {
56
- this.listURL = '/wf-editor/workflow-editors/modulePages/' + this.pageFormCode
57
- }
58
- },
59
- methods: {
60
- savePage() {
61
- if (this.selection && this.selection.length > 0) {
62
- if (this.selection.length !== 1) {
63
- this.$message({
64
- showClose: true,
65
- type: 'error',
66
- message: this.$t('message.pleaseSelectARecord')
67
- })
68
- } else {
69
- const code = 'page:' + this.selection[0].code
70
- this.$emit('setPage', code)
71
- }
72
- } else {
73
- this.$emit('setPage', '')
74
- }
75
- },
76
- select(selection, row) {
77
- this.selection = selection
78
- }
79
- }
80
- }
81
- </script>
@@ -1,109 +0,0 @@
1
- <template>
2
- <el-dialog
3
- visible
4
- :title="$t('workflowEditor.process.processProperties')"
5
- :center="true"
6
- top="10vh"
7
- append-to-body
8
- custom-class="properties-editor"
9
- @open="$emit('open')"
10
- @opend="$emit('opend')"
11
- @close="$emit('close')"
12
- @closed="$emit('closed')"
13
- >
14
- <el-tabs v-model="activeTab" type="border-card" @tab-click="handleClick">
15
- <el-tab-pane :label="$t('workflowEditor.process.basicProperties')" name="basicProperties">
16
- <basic-properties
17
- :name.sync="model.attr.name"
18
- :code.sync="model.attr.code"
19
- :model="model.properties.basicProperties"
20
- />
21
- </el-tab-pane>
22
- <el-tab-pane :label="$t('workflowEditor.process.permissionSettings')" name="permissions">
23
- <permission-settings :model="model.properties.permissionSettings" />
24
- </el-tab-pane>
25
- <el-tab-pane :label="$t('workflowEditor.process.notificationSettings')" name="inform">
26
- <notice-settings v-model="model.properties.inform" />
27
- </el-tab-pane>
28
- <el-tab-pane :label="$t('workflowEditor.process.reminderSettings')" name="reminders">
29
- <reminder v-model="model.properties.reminder" />
30
- </el-tab-pane>
31
- <el-tab-pane :label="$t('workflowEditor.process.parameterSsetting')" name="parameterSettings">
32
- <parameter-settings :model="model.properties.parameterSettings" />
33
- </el-tab-pane>
34
- <el-tab-pane :label="$t('workflowEditor.process.event')" name="events">
35
- <events v-model="model.properties.events" />
36
- </el-tab-pane>
37
- <el-tab-pane :label="$t('workflowEditor.process.processVariables')" name="variables">
38
- <variables v-model="model.properties.variables" />
39
- </el-tab-pane>
40
- </el-tabs>
41
- </el-dialog>
42
- </template>
43
- <script>
44
- import convert from 'xml-js'
45
- import BasicProperties from './process/basic-properties'
46
- import PermissionSettings from './process/permission-settings'
47
- import Reminder from './common/reminder'
48
- import ParameterSettings from './process/parameter-settings'
49
- import Events from './process/events'
50
- import Variables from './common/variables'
51
- import NoticeSettings from './process/notice-settings.vue'
52
- export default {
53
- name: 'ProcessPropertiesEditor',
54
- components: {
55
- BasicProperties,
56
- PermissionSettings,
57
- Reminder,
58
- ParameterSettings,
59
- Events,
60
- Variables,
61
- NoticeSettings
62
- },
63
- props: {
64
- model: {
65
- type: Object,
66
- default: null
67
- }
68
- },
69
- data() {
70
- // if (this.model.properties.inform === undefined) {
71
- // this.model.properties.inform = {}
72
- // }
73
- return {
74
- activeTab: 'basicProperties'
75
- }
76
- },
77
- computed: {
78
- // 定义这些计算属性只是为了减少模板中的代码量
79
- basicProperties() {
80
- return this.model.properties.basicProperties
81
- },
82
- accessRight() {
83
- return this.model.properties.accessRight
84
- },
85
- reminder() {
86
- return this.model.properties.reminder
87
- },
88
- parameterSettings() {
89
- return this.model.properties.parameterSettings
90
- },
91
- events() {
92
- return this.model.properties.events
93
- },
94
- variables() {
95
- return this.model.properties.variables
96
- }
97
- },
98
- methods: {
99
- toXml() {
100
- const options = { compact: true, ignoreComment: true, spaces: 4 }
101
- console.log(convert.js2xml({ basicProperties: this.basicProperties }, options))
102
- },
103
- handleClick(tab, event) {
104
- // console.log(tab, event)
105
- }
106
- }
107
- }
108
- </script>
109
-
@@ -1,176 +0,0 @@
1
- <template>
2
- <el-form :model="formModel">
3
- <el-row>
4
- <el-col :span="12">
5
- <el-form-item :label="$t('workflowEditor.process.name')" label-width="50px">
6
- <!-- <el-input v-model="formModel.name" /> -->
7
- <i18n-input v-model="formModel.name" :i18n-key="formModel.tache.i18nKey?formModel.tache.i18nKey:'name.'+formModel.id" @setI18n="setI18nValue" />
8
- </el-form-item>
9
- </el-col>
10
- <el-col :span="12">
11
- <el-form-item :label="$t('workflowEditor.process.code')" label-width="50px">
12
- <el-input v-model="formModel.id" @blur="validateId" />
13
- </el-form-item>
14
- </el-col>
15
- </el-row>
16
- <el-form-item :label="$t('workflowEditor.process.subprocess')" label-width="60px">
17
- <el-cascader
18
- v-model="selectedProcess"
19
- :show-all-levels="false"
20
- :options="processes"
21
- @change="handleChange"
22
- />
23
- </el-form-item>
24
- <el-form-item :label="$t('workflowEditor.process.transferValueFromMainFormToSubForm')">
25
- <field-mappings
26
- v-model="formModel.tache.parameters"
27
- :src-label="$t('workflowEditor.process.fieldsOfTheMainForm')"
28
- :target-label="$t('workflowEditor.process.fieldsOfSubform')"
29
- :target-fields="subprocessFormFields"
30
- />
31
- </el-form-item>
32
- <el-form-item :label="$t('workflowEditor.process.subformReturnsResultsToMainForm')">
33
- <field-mappings
34
- v-model="formModel.tache.result"
35
- :src-label="$t('workflowEditor.process.fieldsOfSubform')"
36
- :target-label="$t('workflowEditor.process.fieldsOfTheMainForm')"
37
- :src-fields="subprocessFormFields"
38
- />
39
- </el-form-item>
40
- </el-form>
41
- </template>
42
-
43
- <script>
44
- import FieldMappings from './field-mappings'
45
- import processService from '../../process-service.js'
46
- import { validateTacheCode } from '../../util'
47
- import i18nInput from '../common/i18n-input'
48
- export default {
49
- name: 'BasicProperties',
50
- components: {
51
- FieldMappings,
52
- i18nInput
53
- },
54
- props: {
55
- model: {
56
- type: Object,
57
- default: null
58
- },
59
- id: {
60
- type: String,
61
- default: null
62
- },
63
- name: {
64
- type: String,
65
- default: null
66
- }
67
- },
68
- data() {
69
- return {
70
- selectedProcess: [],
71
- processes: [],
72
- subprocessFormFields: [],
73
- formModel: {
74
- name: this.name,
75
- id: this.id,
76
- tache: this.model
77
- }
78
- }
79
- },
80
- computed: {
81
- },
82
- created() {
83
- this.listAllProcesses().then(() => {
84
- this.fetchSubprocessFormFields()
85
- })
86
-
87
- if (this.formModel.tache.parameters === '') {
88
- this.formModel.tache.parameters = {}
89
- }
90
- if (this.formModel.tache.result === '') {
91
- this.formModel.tache.result = {}
92
- }
93
- },
94
- mounted() {
95
- // this.$watch('model.attr.id', function(newVal, oldVal) {
96
- // // updateTransitionsWhenTacheIdChanged(newVal, oldVal)
97
- // this.$emit('update:id', newVal)
98
- // })
99
- },
100
- methods: {
101
- fetchSubprocessFormFields() {
102
- if (this.model.processCode) {
103
- // 获得子流程对应表单字段集合
104
- processService.fetchSubprocessFormFields(this.model.processCode, this.model.processVersion).then(formFields => {
105
- this.subprocessFormFields = formFields
106
- })
107
- }
108
- },
109
- handleChange(values) {
110
- console.log('handleChange=', values)
111
- const processInfo = values[1]
112
- this.model.processCode = processInfo.substring(processInfo.indexOf('/') + 1, processInfo.lastIndexOf('/'))
113
- this.model.processVersion = processInfo.substring(processInfo.lastIndexOf('/') + 1)
114
- this.fetchSubprocessFormFields()
115
- },
116
- // 获得对应表单列表
117
- listAllProcesses() {
118
- return new Promise((resolve, reject) => {
119
- this.$http.get(this.baseAPI + '/wf-editor/workflow-editors/all-active-definitions').then(activeDefinitions => {
120
- if (activeDefinitions.length > 0) {
121
- // 设置表单信息
122
- const selectedProcessInfo = this.model.processCode + '/' + this.model.processVersion
123
- // 修改时,获得默认选中的表单项
124
- this.setDefaultSelectedProcessWhenUpdate(activeDefinitions, selectedProcessInfo)
125
- this.processes = activeDefinitions
126
- resolve()
127
- }
128
- }).catch(error => {
129
- reject(error)
130
- })
131
- })
132
- },
133
- // 修改时,获得默认选中的流程项
134
- setDefaultSelectedProcessWhenUpdate(activeDefinitions, selectedProcessInfo) {
135
- let selectedProcess
136
- let selectedSystemCode
137
- for (var i = 0; i < activeDefinitions.length; i++) {
138
- const systemCode = activeDefinitions[i].value
139
- const definitions = activeDefinitions[i].children
140
- const selectedProcesses = definitions.filter(this.filterProcess(selectedProcessInfo))
141
- if (selectedProcesses.length > 0) {
142
- selectedSystemCode = systemCode
143
- selectedProcess = selectedProcesses[0]
144
- break
145
- }
146
- }
147
- if (selectedProcess) {
148
- const result = []
149
- result.push(selectedSystemCode)
150
- result.push(selectedProcess.value)
151
- this.selectedProcess = result
152
- }
153
- },
154
- // 过滤流程
155
- filterProcess(selectedProcessInfo) {
156
- return (process) => {
157
- // systemAndProcessInfo/流程编号/流程版本”
158
- const systemAndProcessInfo = process.value
159
- // 获得“流程编号/流程版本”
160
- const processInfo = systemAndProcessInfo.substring(systemAndProcessInfo.indexOf('/') + 1)
161
- return (selectedProcessInfo === processInfo)
162
- }
163
- },
164
- validateId() {
165
- validateTacheCode(this)
166
- },
167
- setI18nValue(i18nKey) {
168
- this.formModel.tache.i18nKey = i18nKey
169
- }
170
- }
171
- }
172
- </script>
173
-
174
- <style lang="scss" scoped>
175
-
176
- </style>
@@ -1,26 +0,0 @@
1
- <template>
2
- <el-form>
3
- <el-form-item :label="$t('workflowEditor.process.eventsTriggeredBeforeStartingASubprocess')" label-width="150px">
4
- <el-switch v-model="model.beforeStart" />
5
- </el-form-item>
6
- <el-form-item :label="$t('workflowEditor.process.triggerSubprocessEndEvent')">
7
- <el-switch v-model="model.end" />
8
- </el-form-item>
9
- </el-form>
10
- </template>
11
-
12
- <script>
13
- export default {
14
- name: 'Events',
15
- props: {
16
- model: {
17
- type: Object,
18
- default: null
19
- }
20
- }
21
- }
22
- </script>
23
-
24
- <style lang="scss" scoped>
25
-
26
- </style>
@@ -1,206 +0,0 @@
1
- <template>
2
- <div>
3
- <el-row>
4
- <el-button type="primary" size="mini" plain icon="el-icon-circle-plus-outline" @click="add">
5
- {{ $t('workflowEditorPublicModel.add') }}
6
- </el-button>
7
- <el-button type="primary" size="mini" plain icon="el-icon-delete" @click="remove">
8
- {{ $t('workflowEditorPublicModel.delete') }}
9
- </el-button>
10
- </el-row>
11
- <el-table
12
- ref="table"
13
- :data="tableData"
14
- border
15
- highlight-current-row
16
- style="width: 100%"
17
- @current-change="handleCurrentChange"
18
- >
19
- <el-table-column
20
- type="index"
21
- width="50"
22
- />
23
- <el-table-column
24
- prop="source"
25
- :label="srcLabel"
26
- >
27
- <template slot-scope="scope">
28
- <el-input :value="showSourceFieldLabel(scope.row.source)" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @focus="showSourceFields = true" />
29
- </template>
30
- </el-table-column>
31
- <el-table-column
32
- prop="target"
33
- :label="targetLabel"
34
- >
35
- <template slot-scope="scope">
36
- <el-input :value="showTargetFieldLabel(scope.row.target)" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @focus="showTargetFields=true" />
37
- </template>
38
- </el-table-column>
39
- </el-table>
40
- <form-fields v-if="showSourceFields||showTargetFields" :fields="formFields" @close="selectField" />
41
- </div>
42
- </template>
43
- <script>
44
- import FormFields from '../common/form-fields'
45
- import { getFormFieldLabel } from '../common/form-fields-utils.js'
46
- export default {
47
- name: 'FieldMappings',
48
- components: {
49
- FormFields
50
- },
51
- props: {
52
- value: {
53
- type: Object,
54
- default: null
55
- },
56
- srcLabel: {
57
- type: String,
58
- default: null
59
- },
60
- targetLabel: {
61
- type: String,
62
- default: null
63
- },
64
- srcFields: {
65
- type: Array,
66
- default: null
67
- },
68
- targetFields: {
69
- type: Array,
70
- default: null
71
- }
72
- },
73
- data() {
74
- let tableData = []
75
- if (this.value.field !== undefined) {
76
- // xml中有多个field时是数组,只有一个field时是Object
77
- if (Array.isArray(this.value.field)) {
78
- tableData = this.value.field
79
- } else {
80
- tableData.push(this.value.field)
81
- }
82
- }
83
- return {
84
- tableData,
85
- currentRow: null,
86
- showSourceFields: false,
87
- showTargetFields: false
88
- }
89
- },
90
- computed: {
91
- formFields() {
92
- if (this.showSourceFields) {
93
- return this.srcFields
94
- } else if (this.showTargetFields) {
95
- return this.targetFields
96
- } else {
97
- return []
98
- }
99
- }
100
- },
101
- watch: {
102
-
103
- },
104
- mounted() {
105
- if (this.tableData.length > 0) {
106
- this.setCurrentRow(this.tableData[0])
107
- }
108
- this.$watch('tableData', function() {
109
- const filteredData = this.tableData.filter(field => {
110
- return field.source !== '' && field.target !== ''
111
- })
112
- this.$emit('input', {
113
- field: filteredData
114
- })
115
- }, {
116
- // deep为true可以监控数组中的元素的某个属性的变化
117
- deep: true
118
- })
119
- },
120
- methods: {
121
- getSubFormFieldLabel(name) {
122
- const fields = this.srcFields || this.targetFields
123
- const field = fields.filter(item => {
124
- return item.name === name
125
- })
126
- if (field.length > 0) {
127
- return field[0].label
128
- } else {
129
- return name
130
- }
131
- },
132
- showSourceFieldLabel(value) {
133
- if (this.srcFields) {
134
- return this.getSubFormFieldLabel(value)
135
- } else {
136
- return getFormFieldLabel(value)
137
- }
138
- },
139
- showTargetFieldLabel(value) {
140
- if (this.targetFields) {
141
- return this.getSubFormFieldLabel(value)
142
- } else {
143
- return getFormFieldLabel(value)
144
- }
145
- },
146
- add() {
147
- for (let i = 0; i < this.tableData.length; i++) {
148
- if (this.tableData[i].source === '' || this.tableData[i].target === '') {
149
- this.$alert(this.$t('workflowEditorMessage.dataInLineCannotBeEmpty', { row: (i + 1), data1: this.srcLabel, data2: this.targetLabel }))
150
- return
151
- }
152
- }
153
- const newRow = {
154
- source: '',
155
- target: ''
156
- }
157
- this.tableData.push(newRow)
158
- this.setCurrentRow(newRow)
159
- },
160
- remove() {
161
- if (this.currentRow === null) {
162
- this.$alert(this.$t('workflowEditorMessage.pleaseSelectARow'))
163
- return
164
- }
165
- let index
166
- for (let i = 0; i < this.tableData.length; i++) {
167
- if (this.tableData[i].source === this.currentRow.source) {
168
- index = i
169
- break
170
- }
171
- }
172
- this.tableData.splice(index, 1)
173
- // 当前选中的index如果是最后一行,那么删除后,index会等于length造成下标越界,因此需要让index等于新的最后一行
174
- index = (index <= (this.tableData.length - 1) ? index : (this.tableData.length - 1))
175
- this.setCurrentRow(this.tableData[index])
176
- },
177
- setCurrentRow(row) {
178
- this.$refs.table.setCurrentRow(row)
179
- },
180
- handleCurrentChange(val) {
181
- this.currentRow = val
182
- },
183
- checkSource(name) {
184
- if (name === '') {
185
- this.$alert(this.$t('workflowEditorMessage.dataCannotBeEmpty', { data: this.srcLabel }))
186
- }
187
- },
188
- checkTarget(value) {
189
- if (value === '') {
190
- this.$alert(this.$t('workflowEditorMessage.dataCannotBeEmpty', { data: this.targetLabel }))
191
- }
192
- },
193
- selectField(field) {
194
- if (this.showSourceFields) {
195
- this.$set(this.currentRow, 'source', field)
196
- this.showSourceFields = false
197
- }
198
- if (this.showTargetFields) {
199
- this.$set(this.currentRow, 'target', field)
200
- this.showTargetFields = false
201
- }
202
- console.log('this.tableData===', this.tableData, 'this.srcFields===', this.srcFields, 'this.targetFields===', this.targetFields)
203
- }
204
- }
205
- }
206
- </script>
@@ -1,64 +0,0 @@
1
- <template>
2
- <div>
3
- <el-row>
4
- {{ $t('workflowEditor.process.setTheHandlerOfTheFirstPhaseOfTheSubProcess') }}<el-switch v-model="model.showTransactorSettings" />
5
- </el-row>
6
-
7
- <transactor-settings v-if="model.showTransactorSettings" :model="model.transactorSettings" />
8
- </div>
9
- </template>
10
-
11
- <script>
12
- import TransactorSettings from '../common/transactor-settings'
13
- import { deepCopy } from '../../util.js'
14
- export default {
15
- name: 'SubprocessTransactorSettings',
16
- components: {
17
- TransactorSettings
18
- },
19
- props: {
20
- value: {
21
- type: Object,
22
- default: null
23
- }
24
- },
25
- data() {
26
- let showTransactorSettings = false
27
- if (this.value.userCondition) {
28
- showTransactorSettings = true
29
- }
30
- let transactorSettings = deepCopy(this.value)
31
- if (!transactorSettings.userCondition) {
32
- transactorSettings = {
33
- userCondition: '${instanceCreator}',
34
- additionalCondition: {
35
- onlyInCreatorDepartment: false,
36
- withCreatorDepartment: false,
37
- selectOneFromMultiple: false
38
- }
39
- }
40
- }
41
- return {
42
- model: {
43
- showTransactorSettings,
44
- transactorSettings
45
- }
46
- }
47
- },
48
- mounted() {
49
- this.$watch('model', function(model) {
50
- if (model.showTransactorSettings) {
51
- this.$emit('input', model.transactorSettings)
52
- } else {
53
- this.$emit('input', {})
54
- }
55
- }, {
56
- deep: true
57
- })
58
- }
59
- }
60
- </script>
61
-
62
- <style lang="scss" scoped>
63
-
64
- </style>