workflow-editor 0.9.68-dw → 0.9.68
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 +533 -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/auto-task.js +70 -0
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +72 -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 +31 -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 +483 -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 +304 -0
- package/packages/workflow-editor/src/process-json.js +623 -0
- package/packages/workflow-editor/src/process-service.js +31 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/auto-task.vue +73 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +556 -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 +67 -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-reminder.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +101 -0
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +185 -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 +275 -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 +94 -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 +160 -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 +109 -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 +115 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +199 -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 +183 -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/auto-task.vue +99 -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 +489 -0
- package/packages/workflow-editor/src/workflow-editor.vue +607 -0
- package/packages/workflow-editor/src/workflow-history.vue +153 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +43 -24
- package/src/i18n/langs/en.js +23 -7
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tooltip">
|
|
3
|
+
<!--使用v-html是为了实现</br>换行-->
|
|
4
|
+
<div v-html="content" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'TacheHistoryTooltip',
|
|
11
|
+
props: {
|
|
12
|
+
content: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ''
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style lang="scss" scoped>
|
|
23
|
+
.tooltip{
|
|
24
|
+
position: absolute;
|
|
25
|
+
background: #fff;
|
|
26
|
+
min-width: 150px;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
border: 1px solid #ebeef5;
|
|
29
|
+
padding: 12px;
|
|
30
|
+
z-index: 2000;
|
|
31
|
+
color: #606266;
|
|
32
|
+
line-height: 1.4;
|
|
33
|
+
text-align: justify;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
|
36
|
+
word-break: break-all;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="area" :style="'position:absolute;x:{{area.x}};y:{{area.y}};width:{{area.width}};height:{{area.height}}'">
|
|
3
|
+
<textarea />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: 'TacheNameInput',
|
|
9
|
+
props: {
|
|
10
|
+
area: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: null
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
data() {
|
|
16
|
+
return {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
visible
|
|
4
|
+
:title="$t('workflowEditorPublicModel.subprocessTitle')"
|
|
5
|
+
:close-on-click-modal="false"
|
|
6
|
+
append-to-body
|
|
7
|
+
width="90%"
|
|
8
|
+
top="5vh"
|
|
9
|
+
@open="$emit('open')"
|
|
10
|
+
@opend="$emit('opend')"
|
|
11
|
+
@close="$emit('close')"
|
|
12
|
+
@closed="$emit('closed')"
|
|
13
|
+
>
|
|
14
|
+
<iframe id="_subprocess-content" :src="'#/show-sub-wf-history?workflowId='+workflowId" name="_subprocess-content" title="Subprocess Content" frameborder="0" />
|
|
15
|
+
</el-dialog>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'TacheSubprocessHistoryDialog',
|
|
21
|
+
props: {
|
|
22
|
+
// 当前子流程最新流程实例id
|
|
23
|
+
workflowId: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
<style lang="scss" scoped>
|
|
31
|
+
#_subprocess-content{
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: calc(100vh - 200px);
|
|
34
|
+
}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<h3>{{ $t('workflowEditor.main.tacheType') }}</h3>
|
|
4
|
+
<el-button
|
|
5
|
+
v-for="component in componentList"
|
|
6
|
+
:key="component.name"
|
|
7
|
+
:type="component.type"
|
|
8
|
+
size="medium"
|
|
9
|
+
:round="component.round"
|
|
10
|
+
@mousedown.native="select(component.name)"
|
|
11
|
+
>
|
|
12
|
+
<icon-svg :icon="component.icon" />
|
|
13
|
+
{{ component.label }}
|
|
14
|
+
</el-button>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import { mapGetters, mapMutations } from 'vuex'
|
|
19
|
+
import IconSvg from './icon-svg'
|
|
20
|
+
import { getComponentList } from '../util.js'
|
|
21
|
+
export default {
|
|
22
|
+
name: 'Toolbox',
|
|
23
|
+
components: {
|
|
24
|
+
IconSvg
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
componentList: getComponentList()
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
...mapGetters('wfEditor', ['componentToDraw'])
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
...mapMutations('wfEditor', [
|
|
36
|
+
'setComponentToDraw'
|
|
37
|
+
]),
|
|
38
|
+
select(name) {
|
|
39
|
+
this.setComponentToDraw(name)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
h3{
|
|
46
|
+
color: #999999;
|
|
47
|
+
margin:0;
|
|
48
|
+
padding:0;
|
|
49
|
+
font-weight:bold;
|
|
50
|
+
font-size:18px
|
|
51
|
+
}
|
|
52
|
+
.el-button{
|
|
53
|
+
margin: 6px 0;
|
|
54
|
+
min-width: 110px;
|
|
55
|
+
padding:9px 15px;
|
|
56
|
+
i{
|
|
57
|
+
padding-right: 4px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="svgContainer" style="position:relative">
|
|
3
|
+
<svg
|
|
4
|
+
id="svg"
|
|
5
|
+
width="2000"
|
|
6
|
+
height="2000"
|
|
7
|
+
@mousedown="mousedown"
|
|
8
|
+
@mousemove="mousemove"
|
|
9
|
+
@mouseup="mouseup"
|
|
10
|
+
@mouseleave="mouseleave"
|
|
11
|
+
>
|
|
12
|
+
<defs>
|
|
13
|
+
<marker id="arrow" markerWidth="10" markerHeight="10" refX="6" refY="2" orient="auto" markerUnits="strokeWidth">
|
|
14
|
+
<path d="M0,0 L0,4 L6,2 z" fill="#666" />
|
|
15
|
+
</marker>
|
|
16
|
+
</defs>
|
|
17
|
+
<component
|
|
18
|
+
:is="tache.type"
|
|
19
|
+
v-for="tache in taches"
|
|
20
|
+
:key="tache.id"
|
|
21
|
+
:model="tache"
|
|
22
|
+
:class="[getTacheClass(tache)]"
|
|
23
|
+
:display-mode="tache.displayMode"
|
|
24
|
+
@mouseenter.native="showTacheHistoryTooltip(tache,$event)"
|
|
25
|
+
@mouseleave.native="hideTacheHistoryTooltip(tache)"
|
|
26
|
+
@mousemove.native="updateTacheHistoryTooltipPosition"
|
|
27
|
+
@click.native="showSubprocessHistory(tache)"
|
|
28
|
+
/>
|
|
29
|
+
<transition
|
|
30
|
+
v-for="transition in transitions"
|
|
31
|
+
:key="transition.id"
|
|
32
|
+
:model="transition"
|
|
33
|
+
/>
|
|
34
|
+
</svg>
|
|
35
|
+
<tache-history-tooltip v-if="showHistory&&tacheHistoryInfo" :style="tooltipPosition" :content="tacheHistoryInfo" />
|
|
36
|
+
<tache-subprocess-history-dialog v-if="showSubprocessDialog" :workflow-id="subWorkflowId" @close="closeSubprocessHistory" />
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import Start from '../taches/start'
|
|
42
|
+
import End from '../taches/end'
|
|
43
|
+
import HumanTask from '../taches/human-task'
|
|
44
|
+
import Decision from '../taches/decision'
|
|
45
|
+
import Subprocess from '../taches/subprocess'
|
|
46
|
+
import CustomTask from '../taches/custom-task'
|
|
47
|
+
import Fork from '../taches/fork'
|
|
48
|
+
import Join from '../taches/join'
|
|
49
|
+
import HumanDecision from '../taches/human-decision'
|
|
50
|
+
import CopyTask from '../taches/copy-task'
|
|
51
|
+
import AutoTask from '../taches/auto-task'
|
|
52
|
+
import Transition from '../transitions/transition'
|
|
53
|
+
import TacheHistoryTooltip from './tache-history-tooltip'
|
|
54
|
+
import { mapGetters } from 'vuex'
|
|
55
|
+
import { getMousePosition } from '../util'
|
|
56
|
+
import { i18nOperation } from 'imatrix-ui/src/utils/workflow-util'
|
|
57
|
+
import { getLanguageWithLocale } from 'imatrix-ui/src/utils/util'
|
|
58
|
+
import TacheSubprocessHistoryDialog from './tache-subprocess-history-dialog'
|
|
59
|
+
|
|
60
|
+
export default {
|
|
61
|
+
name: 'WfHistoryCanvas',
|
|
62
|
+
components: {
|
|
63
|
+
Start,
|
|
64
|
+
End,
|
|
65
|
+
HumanTask,
|
|
66
|
+
Decision,
|
|
67
|
+
Subprocess,
|
|
68
|
+
CustomTask,
|
|
69
|
+
Fork,
|
|
70
|
+
Join,
|
|
71
|
+
HumanDecision,
|
|
72
|
+
CopyTask,
|
|
73
|
+
Transition,
|
|
74
|
+
TacheHistoryTooltip,
|
|
75
|
+
TacheSubprocessHistoryDialog,
|
|
76
|
+
AutoTask
|
|
77
|
+
},
|
|
78
|
+
props: {
|
|
79
|
+
process: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: null
|
|
82
|
+
},
|
|
83
|
+
histories: {
|
|
84
|
+
type: Array,
|
|
85
|
+
default: null
|
|
86
|
+
},
|
|
87
|
+
currentTasks: {
|
|
88
|
+
type: Array,
|
|
89
|
+
default: null
|
|
90
|
+
},
|
|
91
|
+
// 主子流程的国际化配置
|
|
92
|
+
allProcessI18n: {
|
|
93
|
+
type: Object,
|
|
94
|
+
default: null
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
data: function() {
|
|
98
|
+
return {
|
|
99
|
+
showHistory: false,
|
|
100
|
+
tooltipPosition: null,
|
|
101
|
+
tacheHistoryInfo: null,
|
|
102
|
+
showSubprocessDialog: false,
|
|
103
|
+
subWorkflowId: null // 子流程最新实例
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
computed: {
|
|
107
|
+
...mapGetters('wfEditor', [
|
|
108
|
+
'taches',
|
|
109
|
+
'transitions',
|
|
110
|
+
'processI18n'
|
|
111
|
+
])
|
|
112
|
+
// classifiedTaches() {
|
|
113
|
+
// this.taches.map(tache => {
|
|
114
|
+
// this.tagPassedTache(tache)
|
|
115
|
+
// this.tagCurrentTache(tache)
|
|
116
|
+
// })
|
|
117
|
+
// return this.taches
|
|
118
|
+
// }
|
|
119
|
+
|
|
120
|
+
},
|
|
121
|
+
mounted: function() {
|
|
122
|
+
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
getTacheClass(tache) {
|
|
126
|
+
// 先判断是否为当前节点 (流程中一个节点可能走多次,这个节点会同时出现在当前和历史节点中)
|
|
127
|
+
if (this.getCurrentTache(tache)) {
|
|
128
|
+
return 'current-tache'
|
|
129
|
+
} else {
|
|
130
|
+
const passTache = this.getPassedTache(tache)
|
|
131
|
+
if (passTache && passTache.current) {
|
|
132
|
+
// 子流程时会进入该判断
|
|
133
|
+
return 'current-tache'
|
|
134
|
+
} else if (passTache) {
|
|
135
|
+
return 'passed-tache'
|
|
136
|
+
} else {
|
|
137
|
+
return ''
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
getPassedTache(tache) {
|
|
142
|
+
let result = null
|
|
143
|
+
for (const item of this.histories) {
|
|
144
|
+
if ((item.historyType === 'PROCESS_START' && tache.ref.attr.id && tache.ref.attr.id === 'start') ||
|
|
145
|
+
(item.historyType === 'PROCESS_END' && tache.ref.attr.id && tache.ref.attr.id === 'end') ||
|
|
146
|
+
(tache.ref.attr.name && item.taskName && item.taskName === tache.ref.attr.name)) {
|
|
147
|
+
result = item
|
|
148
|
+
break
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return result
|
|
152
|
+
},
|
|
153
|
+
// 获得当前环节的流转历史信息,多条件流转历史记录之间换行显示。因为一个环节可能会走多次
|
|
154
|
+
getPassedTacheHistories(tache) {
|
|
155
|
+
const result = []
|
|
156
|
+
for (const item of this.histories) {
|
|
157
|
+
if ((item.historyType === 'PROCESS_START' && tache.ref.attr.id && tache.ref.attr.id === 'start') ||
|
|
158
|
+
(item.historyType === 'PROCESS_END' && tache.ref.attr.id && tache.ref.attr.id === 'end') ||
|
|
159
|
+
(tache.ref.attr.name && item.taskName && item.taskName === tache.ref.attr.name)) {
|
|
160
|
+
result.push(this.i18nOperation(item))
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return result
|
|
164
|
+
},
|
|
165
|
+
i18nOperation(item) {
|
|
166
|
+
let oneProcessI18n
|
|
167
|
+
let processNameI18n
|
|
168
|
+
const language = getLanguageWithLocale()
|
|
169
|
+
const bundleCode = item.bundleCode
|
|
170
|
+
if (bundleCode && bundleCode !== '' && this.processI18n) {
|
|
171
|
+
oneProcessI18n = this.processI18n[bundleCode]
|
|
172
|
+
}
|
|
173
|
+
if (oneProcessI18n && oneProcessI18n['processName']) {
|
|
174
|
+
processNameI18n = oneProcessI18n['processName'][language]
|
|
175
|
+
}
|
|
176
|
+
return i18nOperation(item, processNameI18n, oneProcessI18n, language)
|
|
177
|
+
},
|
|
178
|
+
getCurrentTache(tache) {
|
|
179
|
+
let result = null
|
|
180
|
+
for (const item of this.currentTasks) {
|
|
181
|
+
if (item.taskName === tache.ref.attr.name) {
|
|
182
|
+
result = item
|
|
183
|
+
break
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return result
|
|
187
|
+
},
|
|
188
|
+
getTacheHistory(tache) {
|
|
189
|
+
let content = null
|
|
190
|
+
let historyText
|
|
191
|
+
const histories = this.getPassedTacheHistories(tache)
|
|
192
|
+
if (histories && histories.length > 0) {
|
|
193
|
+
historyText = histories.join('</br>')
|
|
194
|
+
}
|
|
195
|
+
const current = this.getCurrentTache(tache)
|
|
196
|
+
if (current) {
|
|
197
|
+
content = this.$t('workflowEditorMessage.currentHandlingPersonnel') + ': ' + current.transactionResult
|
|
198
|
+
if (historyText) {
|
|
199
|
+
content += '</br>' + historyText
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
content = historyText
|
|
203
|
+
}
|
|
204
|
+
return content
|
|
205
|
+
},
|
|
206
|
+
forbidSelection() {
|
|
207
|
+
return false
|
|
208
|
+
},
|
|
209
|
+
mousedown(event) {
|
|
210
|
+
console.log('mousedown')
|
|
211
|
+
},
|
|
212
|
+
mousemove(event) {
|
|
213
|
+
},
|
|
214
|
+
// 有些组件上的mouseup,会传播到canvas上来
|
|
215
|
+
mouseup(event) {
|
|
216
|
+
|
|
217
|
+
},
|
|
218
|
+
mouseleave(event) {
|
|
219
|
+
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
endDrag(event) {
|
|
223
|
+
|
|
224
|
+
},
|
|
225
|
+
showTacheHistoryTooltip(tache, event) {
|
|
226
|
+
this.tacheHistoryInfo = this.getTacheHistory(tache)
|
|
227
|
+
this.showHistory = true
|
|
228
|
+
},
|
|
229
|
+
hideTacheHistoryTooltip() {
|
|
230
|
+
// this.tacheHistoryInfo = null
|
|
231
|
+
this.showHistory = false
|
|
232
|
+
},
|
|
233
|
+
updateTacheHistoryTooltipPosition(event) {
|
|
234
|
+
const position = getMousePosition(event)
|
|
235
|
+
this.tooltipPosition = {
|
|
236
|
+
// 提示框的位置要偏离鼠标指针5px,防止提示框不停闪烁
|
|
237
|
+
left: position.x + 5 + 'px',
|
|
238
|
+
top: position.y + 5 + 'px'
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
// 查看子流程流转历史
|
|
242
|
+
showSubprocessHistory(tache) {
|
|
243
|
+
const history = this.getPassedTache(tache)
|
|
244
|
+
if (history && history.hasChildren !== undefined && history.hasChildren === true) {
|
|
245
|
+
if (history.children && history.children.length > 0) {
|
|
246
|
+
this.subWorkflowId = history.children[0].workflowId
|
|
247
|
+
}
|
|
248
|
+
this.showSubprocessDialog = true
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
closeSubprocessHistory() {
|
|
252
|
+
this.showSubprocessDialog = false
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
</script>
|
|
257
|
+
<style >
|
|
258
|
+
#svg{
|
|
259
|
+
/* border:1px solid red; */
|
|
260
|
+
background: white;
|
|
261
|
+
background-image:
|
|
262
|
+
linear-gradient(rgba(242,242,242,.7) 1px, transparent 0),
|
|
263
|
+
linear-gradient(90deg, rgba(242,242,242,.7) 1px, transparent 0),
|
|
264
|
+
linear-gradient(#e5e5e5 1px, transparent 0),
|
|
265
|
+
linear-gradient(90deg,#e5e5e5 1px, transparent 0);
|
|
266
|
+
background-size:
|
|
267
|
+
15px 15px,
|
|
268
|
+
15px 15px,
|
|
269
|
+
75px 75px,
|
|
270
|
+
75px 75px;
|
|
271
|
+
}
|
|
272
|
+
g{
|
|
273
|
+
font-size: 16px;
|
|
274
|
+
}
|
|
275
|
+
g text{
|
|
276
|
+
dominant-baseline: middle;
|
|
277
|
+
}
|
|
278
|
+
.selected{
|
|
279
|
+
fill: #fff;
|
|
280
|
+
stroke: #f00;
|
|
281
|
+
stroke-width: 2;
|
|
282
|
+
}
|
|
283
|
+
.task-tache{
|
|
284
|
+
fill: #fff;
|
|
285
|
+
stroke: #666;
|
|
286
|
+
stroke-width: 2;
|
|
287
|
+
}
|
|
288
|
+
.passed-tache .task-tache{
|
|
289
|
+
fill: green;
|
|
290
|
+
stroke: green;
|
|
291
|
+
stroke-width: 2;
|
|
292
|
+
}
|
|
293
|
+
.current-tache .task-tache{
|
|
294
|
+
fill: red;
|
|
295
|
+
stroke: red;
|
|
296
|
+
stroke-width: 2;
|
|
297
|
+
}
|
|
298
|
+
.passed-tache text{
|
|
299
|
+
fill:white;
|
|
300
|
+
}
|
|
301
|
+
.current-tache text{
|
|
302
|
+
fill: white
|
|
303
|
+
}
|
|
304
|
+
</style>
|