workflow-editor 0.9.67-dw → 0.9.67
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.
- package/lib/workflow-editor.css +1 -1
- package/lib/workflow-editor.umd.min.js +10 -10
- package/package.json +2 -2
- package/packages/index.js +34 -0
- package/packages/plugins/formValidatorUtil.js +528 -0
- package/packages/plugins/index.js +8 -0
- package/packages/workflow-editor/index.js +14 -0
- package/packages/workflow-editor/src/api.js +7 -0
- package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
- package/packages/workflow-editor/src/constant.js +8 -0
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +67 -0
- package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
- package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
- package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
- package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
- package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
- package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
- package/packages/workflow-editor/src/json-object-templates/subprocess.js +30 -0
- package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
- package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
- package/packages/workflow-editor/src/main/canvas.vue +479 -0
- package/packages/workflow-editor/src/main/context-menu.vue +132 -0
- package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
- package/packages/workflow-editor/src/main/selection-region.vue +66 -0
- package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
- package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
- package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
- package/packages/workflow-editor/src/main/toolbox.vue +60 -0
- package/packages/workflow-editor/src/main/wf-history-canvas.vue +302 -0
- package/packages/workflow-editor/src/process-json.js +622 -0
- package/packages/workflow-editor/src/process-service.js +31 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +531 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
- package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +47 -0
- package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +98 -0
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +179 -0
- package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
- package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
- package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
- package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +233 -0
- package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
- package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
- package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/copy-task.vue +80 -0
- package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +156 -0
- package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
- package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
- package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
- package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
- package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
- package/packages/workflow-editor/src/properties-editors/human-task.vue +103 -0
- package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
- package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
- package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
- package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
- package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/process.vue +109 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +187 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
- package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
- package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
- package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
- package/packages/workflow-editor/src/properties-editors/user-condition.js +177 -0
- package/packages/workflow-editor/src/store/getters.js +27 -0
- package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
- package/packages/workflow-editor/src/taches/common-methods.js +21 -0
- package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
- package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
- package/packages/workflow-editor/src/taches/decision.vue +102 -0
- package/packages/workflow-editor/src/taches/end.vue +76 -0
- package/packages/workflow-editor/src/taches/fork.vue +102 -0
- package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
- package/packages/workflow-editor/src/taches/human-task.vue +113 -0
- package/packages/workflow-editor/src/taches/join.vue +91 -0
- package/packages/workflow-editor/src/taches/joint.vue +177 -0
- package/packages/workflow-editor/src/taches/start.vue +76 -0
- package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
- package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
- package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
- package/packages/workflow-editor/src/transitions/transition.vue +212 -0
- package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
- package/packages/workflow-editor/src/util.js +493 -0
- package/packages/workflow-editor/src/workflow-editor.vue +605 -0
- package/packages/workflow-editor/src/workflow-history.vue +153 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +6 -1
- package/src/i18n/langs/en.js +6 -1
|
@@ -0,0 +1,81 @@
|
|
|
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>
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,187 @@
|
|
|
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.subprocessIsSharedForm')" label-width="60px">
|
|
25
|
+
<el-switch v-model="formModel.tache.isSharedForm" />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
<el-radio-group v-model="formModel.tache.moreTransactor">
|
|
28
|
+
<el-radio :label="false">
|
|
29
|
+
{{ $t('workflowEditor.task.anyOneCanHandleIt') }}
|
|
30
|
+
</el-radio>
|
|
31
|
+
<el-radio :label="true">
|
|
32
|
+
{{ $t('workflowEditor.task.forAll') }}
|
|
33
|
+
</el-radio>
|
|
34
|
+
</el-radio-group>
|
|
35
|
+
<el-form-item :label="$t('workflowEditor.process.transferValueFromMainFormToSubForm')">
|
|
36
|
+
<field-mappings
|
|
37
|
+
v-model="formModel.tache.parameters"
|
|
38
|
+
:src-label="$t('workflowEditor.process.fieldsOfTheMainForm')"
|
|
39
|
+
:target-label="$t('workflowEditor.process.fieldsOfSubform')"
|
|
40
|
+
:target-fields="subprocessFormFields"
|
|
41
|
+
/>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
<el-form-item :label="$t('workflowEditor.process.subformReturnsResultsToMainForm')">
|
|
44
|
+
<field-mappings
|
|
45
|
+
v-model="formModel.tache.result"
|
|
46
|
+
:src-label="$t('workflowEditor.process.fieldsOfSubform')"
|
|
47
|
+
:target-label="$t('workflowEditor.process.fieldsOfTheMainForm')"
|
|
48
|
+
:src-fields="subprocessFormFields"
|
|
49
|
+
/>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</el-form>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
import FieldMappings from './field-mappings'
|
|
56
|
+
import processService from '../../process-service.js'
|
|
57
|
+
import { validateTacheCode } from '../../util'
|
|
58
|
+
import i18nInput from '../common/i18n-input'
|
|
59
|
+
export default {
|
|
60
|
+
name: 'BasicProperties',
|
|
61
|
+
components: {
|
|
62
|
+
FieldMappings,
|
|
63
|
+
i18nInput
|
|
64
|
+
},
|
|
65
|
+
props: {
|
|
66
|
+
model: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
70
|
+
id: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: null
|
|
73
|
+
},
|
|
74
|
+
name: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: null
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
selectedProcess: [],
|
|
82
|
+
processes: [],
|
|
83
|
+
subprocessFormFields: [],
|
|
84
|
+
formModel: {
|
|
85
|
+
name: this.name,
|
|
86
|
+
id: this.id,
|
|
87
|
+
tache: this.model
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
computed: {
|
|
92
|
+
},
|
|
93
|
+
created() {
|
|
94
|
+
this.listAllProcesses().then(() => {
|
|
95
|
+
this.fetchSubprocessFormFields()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
if (this.formModel.tache.parameters === '') {
|
|
99
|
+
this.formModel.tache.parameters = {}
|
|
100
|
+
}
|
|
101
|
+
if (this.formModel.tache.result === '') {
|
|
102
|
+
this.formModel.tache.result = {}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
mounted() {
|
|
106
|
+
// this.$watch('model.attr.id', function(newVal, oldVal) {
|
|
107
|
+
// // updateTransitionsWhenTacheIdChanged(newVal, oldVal)
|
|
108
|
+
// this.$emit('update:id', newVal)
|
|
109
|
+
// })
|
|
110
|
+
},
|
|
111
|
+
methods: {
|
|
112
|
+
fetchSubprocessFormFields() {
|
|
113
|
+
if (this.model.processCode) {
|
|
114
|
+
// 获得子流程对应表单字段集合
|
|
115
|
+
processService.fetchSubprocessFormFields(this.model.processCode, this.model.processVersion).then(formFields => {
|
|
116
|
+
this.subprocessFormFields = formFields
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
handleChange(values) {
|
|
121
|
+
console.log('handleChange=', values)
|
|
122
|
+
const processInfo = values[1]
|
|
123
|
+
this.model.processCode = processInfo.substring(processInfo.indexOf('/') + 1, processInfo.lastIndexOf('/'))
|
|
124
|
+
this.model.processVersion = processInfo.substring(processInfo.lastIndexOf('/') + 1)
|
|
125
|
+
this.fetchSubprocessFormFields()
|
|
126
|
+
},
|
|
127
|
+
// 获得对应表单列表
|
|
128
|
+
listAllProcesses() {
|
|
129
|
+
return new Promise((resolve, reject) => {
|
|
130
|
+
this.$http.get(this.baseAPI + '/wf-editor/workflow-editors/all-active-definitions').then(activeDefinitions => {
|
|
131
|
+
if (activeDefinitions.length > 0) {
|
|
132
|
+
// 设置表单信息
|
|
133
|
+
const selectedProcessInfo = this.model.processCode + '/' + this.model.processVersion
|
|
134
|
+
// 修改时,获得默认选中的表单项
|
|
135
|
+
this.setDefaultSelectedProcessWhenUpdate(activeDefinitions, selectedProcessInfo)
|
|
136
|
+
this.processes = activeDefinitions
|
|
137
|
+
resolve()
|
|
138
|
+
}
|
|
139
|
+
}).catch(error => {
|
|
140
|
+
reject(error)
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
},
|
|
144
|
+
// 修改时,获得默认选中的流程项
|
|
145
|
+
setDefaultSelectedProcessWhenUpdate(activeDefinitions, selectedProcessInfo) {
|
|
146
|
+
let selectedProcess
|
|
147
|
+
let selectedSystemCode
|
|
148
|
+
for (var i = 0; i < activeDefinitions.length; i++) {
|
|
149
|
+
const systemCode = activeDefinitions[i].value
|
|
150
|
+
const definitions = activeDefinitions[i].children
|
|
151
|
+
const selectedProcesses = definitions.filter(this.filterProcess(selectedProcessInfo))
|
|
152
|
+
if (selectedProcesses.length > 0) {
|
|
153
|
+
selectedSystemCode = systemCode
|
|
154
|
+
selectedProcess = selectedProcesses[0]
|
|
155
|
+
break
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (selectedProcess) {
|
|
159
|
+
const result = []
|
|
160
|
+
result.push(selectedSystemCode)
|
|
161
|
+
result.push(selectedProcess.value)
|
|
162
|
+
this.selectedProcess = result
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
// 过滤流程
|
|
166
|
+
filterProcess(selectedProcessInfo) {
|
|
167
|
+
return (process) => {
|
|
168
|
+
// systemAndProcessInfo/流程编号/流程版本”
|
|
169
|
+
const systemAndProcessInfo = process.value
|
|
170
|
+
// 获得“流程编号/流程版本”
|
|
171
|
+
const processInfo = systemAndProcessInfo.substring(systemAndProcessInfo.indexOf('/') + 1)
|
|
172
|
+
return (selectedProcessInfo === processInfo)
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
validateId() {
|
|
176
|
+
validateTacheCode(this)
|
|
177
|
+
},
|
|
178
|
+
setI18nValue(i18nKey) {
|
|
179
|
+
this.formModel.tache.i18nKey = i18nKey
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<style lang="scss" scoped>
|
|
186
|
+
|
|
187
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
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>
|
|
@@ -0,0 +1,206 @@
|
|
|
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>
|
|
@@ -0,0 +1,64 @@
|
|
|
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" :is-subprocess="true" :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>
|