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.
- package/dist/index.full.min.js +3237 -0
- package/dist/style.css +1 -0
- package/es/_virtual/FileSaver.min.mjs +4 -0
- package/es/_virtual/___vite-browser-external.mjs +6 -0
- package/es/_virtual/__vite-browser-external.mjs +4 -0
- package/es/_virtual/_commonjsHelpers.mjs +30 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/_virtual/clipboard.mjs +4 -0
- package/es/_virtual/dayjs.min.mjs +4 -0
- package/es/_virtual/index.mjs +4 -0
- package/es/_virtual/nprogress.mjs +4 -0
- package/es/_virtual/prism.mjs +4 -0
- package/es/_virtual/sax.mjs +4 -0
- package/es/_virtual/string_decoder.mjs +4 -0
- package/es/_virtual/tinymce.mjs +4 -0
- package/es/_virtual/weekOfYear.mjs +4 -0
- package/es/index.mjs +20 -0
- package/es/plugins/formValidatorUtil.mjs +391 -0
- package/es/plugins/index.mjs +9 -0
- package/es/style.css +1 -0
- package/es/vite.svg +1 -0
- package/es/workflow-editor/index.mjs +14 -0
- package/lib/_virtual/FileSaver.min.cjs +1 -0
- package/lib/_virtual/___vite-browser-external.cjs +1 -0
- package/lib/_virtual/__vite-browser-external.cjs +1 -0
- package/lib/_virtual/_commonjsHelpers.cjs +1 -0
- package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -0
- package/lib/_virtual/clipboard.cjs +1 -0
- package/lib/_virtual/dayjs.min.cjs +1 -0
- package/lib/_virtual/index.cjs +1 -0
- package/lib/_virtual/nprogress.cjs +1 -0
- package/lib/_virtual/prism.cjs +1 -0
- package/lib/_virtual/sax.cjs +1 -0
- package/lib/_virtual/string_decoder.cjs +1 -0
- package/lib/_virtual/tinymce.cjs +1 -0
- package/lib/_virtual/weekOfYear.cjs +1 -0
- package/lib/index.cjs +1 -0
- package/lib/plugins/formValidatorUtil.cjs +1 -0
- package/lib/plugins/index.cjs +1 -0
- package/lib/style.css +1 -0
- package/lib/workflow-editor/index.cjs +1 -0
- package/package.json +5 -3
- package/vite.config.js +44 -10
- package/lib/401-5a92e011.js +0 -101
- package/lib/404-2e472acc.js +0 -26
- package/lib/authredirect-ae6e75b4.js +0 -10
- package/lib/iframe-page-4e84c0f8.js +0 -33
- package/lib/index-27119bd2.js +0 -31464
- package/lib/index-369eae4a.js +0 -13
- package/lib/tab-content-iframe-index-e9146736.js +0 -33
- package/lib/tab-content-index-bbc6792b.js +0 -1241
- package/lib/tache-subprocess-history-d51d6a50.js +0 -56
- package/lib/workflow-editor.css +0 -1
- package/lib/workflow-editor.js +0 -5
- package/lib/workflow-editor.umd.cjs +0 -85
- package/packages/index.js +0 -34
- package/packages/plugins/formValidatorUtil.js +0 -723
- package/packages/plugins/index.js +0 -8
- package/packages/workflow-editor/index.js +0 -14
- package/packages/workflow-editor/src/api.js +0 -7
- package/packages/workflow-editor/src/assets/tab-select.png +0 -0
- package/packages/workflow-editor/src/assets/tab-selectWhite.png +0 -0
- package/packages/workflow-editor/src/assets/wf-editor-icons.js +0 -2
- package/packages/workflow-editor/src/constant.js +0 -8
- package/packages/workflow-editor/src/json-object-templates/auto-task.js +0 -70
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -72
- package/packages/workflow-editor/src/json-object-templates/decision.js +0 -11
- package/packages/workflow-editor/src/json-object-templates/end.js +0 -14
- package/packages/workflow-editor/src/json-object-templates/fork.js +0 -10
- package/packages/workflow-editor/src/json-object-templates/human-decision.js +0 -9
- package/packages/workflow-editor/src/json-object-templates/human-task.js +0 -208
- package/packages/workflow-editor/src/json-object-templates/join.js +0 -10
- package/packages/workflow-editor/src/json-object-templates/process.js +0 -99
- package/packages/workflow-editor/src/json-object-templates/start.js +0 -13
- package/packages/workflow-editor/src/json-object-templates/subprocess.js +0 -31
- package/packages/workflow-editor/src/json-object-templates/transition.js +0 -26
- package/packages/workflow-editor/src/main/admin-save-dialog.vue +0 -67
- package/packages/workflow-editor/src/main/canvas.vue +0 -493
- package/packages/workflow-editor/src/main/context-menu.vue +0 -147
- package/packages/workflow-editor/src/main/icon-svg.vue +0 -32
- package/packages/workflow-editor/src/main/selection-region.vue +0 -66
- package/packages/workflow-editor/src/main/tache-history-tooltip.vue +0 -38
- package/packages/workflow-editor/src/main/tache-name-input.vue +0 -19
- package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +0 -40
- package/packages/workflow-editor/src/main/toolbox.vue +0 -60
- package/packages/workflow-editor/src/main/wf-history-canvas.vue +0 -309
- package/packages/workflow-editor/src/process-json.js +0 -624
- package/packages/workflow-editor/src/process-service.js +0 -69
- package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +0 -81
- package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +0 -155
- package/packages/workflow-editor/src/properties-editors/auto-task.vue +0 -74
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +0 -568
- package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +0 -320
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +0 -34
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +0 -268
- package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +0 -81
- package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +0 -242
- package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +0 -23
- package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +0 -117
- package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +0 -88
- package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +0 -143
- package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +0 -149
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +0 -108
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +0 -272
- package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +0 -92
- package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +0 -66
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +0 -354
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +0 -68
- package/packages/workflow-editor/src/properties-editors/common/task-title.vue +0 -165
- package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +0 -275
- package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +0 -426
- package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +0 -272
- package/packages/workflow-editor/src/properties-editors/common/variables.vue +0 -139
- package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +0 -90
- package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +0 -155
- package/packages/workflow-editor/src/properties-editors/copy-task.vue +0 -95
- package/packages/workflow-editor/src/properties-editors/decision.vue +0 -95
- package/packages/workflow-editor/src/properties-editors/fork.vue +0 -77
- package/packages/workflow-editor/src/properties-editors/human-decision.vue +0 -49
- package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +0 -62
- package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +0 -184
- package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +0 -359
- package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +0 -256
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +0 -405
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +0 -257
- package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +0 -430
- package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +0 -206
- package/packages/workflow-editor/src/properties-editors/human-task/events.vue +0 -60
- package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +0 -224
- package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +0 -499
- package/packages/workflow-editor/src/properties-editors/human-task.vue +0 -107
- package/packages/workflow-editor/src/properties-editors/join.vue +0 -49
- package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +0 -336
- package/packages/workflow-editor/src/properties-editors/process/events.vue +0 -79
- package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +0 -68
- package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +0 -106
- package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +0 -28
- package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +0 -88
- package/packages/workflow-editor/src/properties-editors/process.vue +0 -115
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +0 -201
- package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +0 -26
- package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +0 -216
- package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +0 -66
- package/packages/workflow-editor/src/properties-editors/subprocess.vue +0 -80
- package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +0 -53
- package/packages/workflow-editor/src/properties-editors/transition.vue +0 -75
- package/packages/workflow-editor/src/properties-editors/user-condition.js +0 -183
- package/packages/workflow-editor/src/store/getters.js +0 -33
- package/packages/workflow-editor/src/store/workflow-editor.js +0 -153
- package/packages/workflow-editor/src/taches/auto-task.vue +0 -99
- package/packages/workflow-editor/src/taches/common-methods.js +0 -21
- package/packages/workflow-editor/src/taches/copy-task.vue +0 -99
- package/packages/workflow-editor/src/taches/custom-task.vue +0 -88
- package/packages/workflow-editor/src/taches/decision.vue +0 -102
- package/packages/workflow-editor/src/taches/end.vue +0 -76
- package/packages/workflow-editor/src/taches/fork.vue +0 -102
- package/packages/workflow-editor/src/taches/human-decision.vue +0 -102
- package/packages/workflow-editor/src/taches/human-task.vue +0 -113
- package/packages/workflow-editor/src/taches/join.vue +0 -91
- package/packages/workflow-editor/src/taches/joint.vue +0 -177
- package/packages/workflow-editor/src/taches/start.vue +0 -76
- package/packages/workflow-editor/src/taches/subprocess.vue +0 -99
- package/packages/workflow-editor/src/taches/tache-resizer.vue +0 -80
- package/packages/workflow-editor/src/transitions/broken-line.vue +0 -91
- package/packages/workflow-editor/src/transitions/curve-line.vue +0 -91
- package/packages/workflow-editor/src/transitions/straight-line.vue +0 -26
- package/packages/workflow-editor/src/transitions/transition.vue +0 -209
- package/packages/workflow-editor/src/transitions/virtual-transition.vue +0 -43
- package/packages/workflow-editor/src/util.js +0 -499
- package/packages/workflow-editor/src/workflow-editor.vue +0 -852
- package/packages/workflow-editor/src/workflow-history.vue +0 -153
- package/src/i18n/i18n.js +0 -16
- package/src/i18n/langs/cn.js +0 -521
- package/src/i18n/langs/en.js +0 -529
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g>
|
|
3
|
-
<path
|
|
4
|
-
:d="path"
|
|
5
|
-
marker-end="url(#arrow)"
|
|
6
|
-
/>
|
|
7
|
-
<template v-if="owner.isSelected">
|
|
8
|
-
<template v-if="controlPoint">
|
|
9
|
-
<circle
|
|
10
|
-
v-for="(point,index) in controlPoint"
|
|
11
|
-
:key="point.x+point.y"
|
|
12
|
-
:cx="point.x"
|
|
13
|
-
:cy="point.y"
|
|
14
|
-
r="3"
|
|
15
|
-
class="control-point"
|
|
16
|
-
@mousedown.stop="startDrag(index, $event)"
|
|
17
|
-
@mouseup.stop="endDrag"
|
|
18
|
-
/>
|
|
19
|
-
</template>
|
|
20
|
-
</template>
|
|
21
|
-
</g>
|
|
22
|
-
</template>
|
|
23
|
-
<script>
|
|
24
|
-
import { getJoint } from '../util'
|
|
25
|
-
import { mapMutations } from 'vuex'
|
|
26
|
-
export default {
|
|
27
|
-
name: 'BrokenLine',
|
|
28
|
-
props: {
|
|
29
|
-
owner: {
|
|
30
|
-
type: Object,
|
|
31
|
-
default: null
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
computed: {
|
|
35
|
-
// 二次贝塞尔曲线由两个端点和一个控制点组成,Q命令就是用来画二次曲线的
|
|
36
|
-
startPoint() {
|
|
37
|
-
return getJoint(this.owner.startJoint.parent, this.owner.startJoint.position)
|
|
38
|
-
},
|
|
39
|
-
endPoint() {
|
|
40
|
-
return getJoint(this.owner.endJoint.parent, this.owner.endJoint.position)
|
|
41
|
-
},
|
|
42
|
-
controlPoint() {
|
|
43
|
-
return this.owner.lineInfo.controlPoint
|
|
44
|
-
},
|
|
45
|
-
path() {
|
|
46
|
-
let myPath = 'M ' + this.startPoint.x + ' ' + this.startPoint.y + ' '
|
|
47
|
-
if (this.controlPoint) {
|
|
48
|
-
this.controlPoint.forEach(point => {
|
|
49
|
-
myPath += 'L ' + point.x + ' ' + point.y
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
myPath += 'L ' + this.endPoint.x + ' ' + this.endPoint.y
|
|
53
|
-
return myPath
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
created: function() {
|
|
57
|
-
console.log('this.owner.lineInfo=', this.owner.lineInfo)
|
|
58
|
-
// controlPoint没有值是需要给一个初始值:默认的控制点是起点的x坐标和终点的y坐标结合
|
|
59
|
-
if (!this.owner.lineInfo.controlPoint) {
|
|
60
|
-
const x = this.startPoint.x + (this.endPoint.x - this.startPoint.x) / 2
|
|
61
|
-
const y = this.startPoint.y + (this.endPoint.y - this.startPoint.y) / 2
|
|
62
|
-
this.owner.lineInfo.controlPoint = [{ x, y }]
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
methods: {
|
|
66
|
-
...mapMutations('wfEditor', [
|
|
67
|
-
'setControlPointToMove'
|
|
68
|
-
]),
|
|
69
|
-
startDrag(pointIndex, $event) {
|
|
70
|
-
console.log('brokenLine--startDrag-----')
|
|
71
|
-
this.setControlPointToMove({
|
|
72
|
-
owner: this.owner,
|
|
73
|
-
pointIndex: pointIndex
|
|
74
|
-
})
|
|
75
|
-
},
|
|
76
|
-
endDrag() {
|
|
77
|
-
this.setControlPointToMove(null)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
</script>
|
|
82
|
-
<style scoped>
|
|
83
|
-
.control-point{
|
|
84
|
-
fill: #fff;
|
|
85
|
-
cursor: move;
|
|
86
|
-
}
|
|
87
|
-
.control-line {
|
|
88
|
-
stroke-dasharray: 2 2
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
91
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g>
|
|
3
|
-
<path
|
|
4
|
-
:d="path"
|
|
5
|
-
marker-end="url(#arrow)"
|
|
6
|
-
/>
|
|
7
|
-
<template v-if="owner.isSelected">
|
|
8
|
-
<path :d="pathToStartPoint" class="control-line" />
|
|
9
|
-
<path :d="pathToEndPoint" class="control-line" />
|
|
10
|
-
<circle
|
|
11
|
-
:cx="controlPoint.x"
|
|
12
|
-
:cy="controlPoint.y"
|
|
13
|
-
r="3"
|
|
14
|
-
class="control-point"
|
|
15
|
-
@mousedown.stop="startDrag"
|
|
16
|
-
@mouseup.stop="endDrag"
|
|
17
|
-
/>
|
|
18
|
-
</template>
|
|
19
|
-
</g>
|
|
20
|
-
</template>
|
|
21
|
-
<script>
|
|
22
|
-
import { getJoint } from '../util'
|
|
23
|
-
import { mapMutations } from 'vuex'
|
|
24
|
-
export default {
|
|
25
|
-
name: 'CurveLine',
|
|
26
|
-
props: {
|
|
27
|
-
owner: {
|
|
28
|
-
type: Object,
|
|
29
|
-
default: null
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
computed: {
|
|
33
|
-
// 二次贝塞尔曲线由两个端点和一个控制点组成,Q命令就是用来画二次曲线的
|
|
34
|
-
startPoint() {
|
|
35
|
-
return getJoint(this.owner.startJoint.parent, this.owner.startJoint.position)
|
|
36
|
-
},
|
|
37
|
-
endPoint() {
|
|
38
|
-
return getJoint(this.owner.endJoint.parent, this.owner.endJoint.position)
|
|
39
|
-
},
|
|
40
|
-
controlPoint() {
|
|
41
|
-
return this.owner.lineInfo.controlPoint
|
|
42
|
-
},
|
|
43
|
-
path() {
|
|
44
|
-
return 'M ' + this.startPoint.x + ' ' + this.startPoint.y + ' ' +
|
|
45
|
-
'Q ' + this.controlPoint.x + ' ' + this.controlPoint.y + ' ' +
|
|
46
|
-
this.endPoint.x + ' ' + this.endPoint.y
|
|
47
|
-
},
|
|
48
|
-
pathToStartPoint() {
|
|
49
|
-
return 'M ' + this.controlPoint.x + ' ' + this.controlPoint.y +
|
|
50
|
-
'L ' + this.startPoint.x + ' ' + this.startPoint.y
|
|
51
|
-
},
|
|
52
|
-
pathToEndPoint() {
|
|
53
|
-
return 'M ' + this.controlPoint.x + ' ' + this.controlPoint.y +
|
|
54
|
-
'L ' + this.endPoint.x + ' ' + this.endPoint.y
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
created: function() {
|
|
58
|
-
// controlPoint没有值是需要给一个初始值:默认的控制点是起点的x坐标和终点的y坐标结合
|
|
59
|
-
if (!this.owner.lineInfo.controlPoint) {
|
|
60
|
-
let x = this.startPoint.x + (this.endPoint.x - this.startPoint.x) / 2
|
|
61
|
-
if (x + 10 < this.startPoint.x || x < this.startPoint.x + 10) {
|
|
62
|
-
x = this.startPoint.x + 30
|
|
63
|
-
}
|
|
64
|
-
this.owner.lineInfo.controlPoint = { x, y: this.endPoint.y }
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
methods: {
|
|
68
|
-
...mapMutations('wfEditor', [
|
|
69
|
-
'setControlPointToMove'
|
|
70
|
-
]),
|
|
71
|
-
startDrag(event) {
|
|
72
|
-
this.setControlPointToMove({
|
|
73
|
-
owner: this.owner
|
|
74
|
-
})
|
|
75
|
-
},
|
|
76
|
-
endDrag() {
|
|
77
|
-
this.setControlPointToMove(null)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
</script>
|
|
82
|
-
<style scoped>
|
|
83
|
-
.control-point{
|
|
84
|
-
fill: #fff;
|
|
85
|
-
cursor: move;
|
|
86
|
-
}
|
|
87
|
-
.control-line {
|
|
88
|
-
stroke-dasharray: 2 2
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
91
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<path
|
|
3
|
-
:d="path"
|
|
4
|
-
marker-end="url(#arrow)"
|
|
5
|
-
/>
|
|
6
|
-
</template>
|
|
7
|
-
<script>
|
|
8
|
-
import { getJoint } from '../util'
|
|
9
|
-
export default {
|
|
10
|
-
name: 'StraightLine',
|
|
11
|
-
props: {
|
|
12
|
-
owner: {
|
|
13
|
-
type: Object,
|
|
14
|
-
default: null
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
computed: {
|
|
18
|
-
path() {
|
|
19
|
-
const startPoint = getJoint(this.owner.startJoint.parent, this.owner.startJoint.position)
|
|
20
|
-
const endPoint = getJoint(this.owner.endJoint.parent, this.owner.endJoint.position)
|
|
21
|
-
return 'M' + startPoint.x + ' ' + startPoint.y + ' L' + endPoint.x + ' ' + endPoint.y
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
26
|
-
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g :class="{ 'no-events': draggerToMove != null }" @mousedown.stop="select" @dblclick.stop="showPropertiesEditor">
|
|
3
|
-
<text :x="text.x" :y="text.y" text-anchor="middle" class="draggable">
|
|
4
|
-
{{ name }}
|
|
5
|
-
</text>
|
|
6
|
-
<component
|
|
7
|
-
:is="model.lineInfo.type"
|
|
8
|
-
:owner="model"
|
|
9
|
-
:class="{
|
|
10
|
-
transition: true,
|
|
11
|
-
selected: model.isSelected || (model.startJoint.parent.isSelected && model.endJoint.parent.isSelected)
|
|
12
|
-
}"
|
|
13
|
-
/>
|
|
14
|
-
<!-- <straight-line :owner="model" :class="{'transition':true,'selected':model.isSelected||(model.startJoint.parent.isSelected&&model.endJoint.parent.isSelected)}"/> -->
|
|
15
|
-
<g v-if="model.isSelected">
|
|
16
|
-
<circle
|
|
17
|
-
v-for="dragger in draggers"
|
|
18
|
-
:key="dragger.position"
|
|
19
|
-
:cx="dragger.x"
|
|
20
|
-
:cy="dragger.y"
|
|
21
|
-
class="transition-dragger"
|
|
22
|
-
r="4"
|
|
23
|
-
@mousedown.stop="startDrag($event, dragger.position)"
|
|
24
|
-
@mouseup="endDrag"
|
|
25
|
-
/>
|
|
26
|
-
</g>
|
|
27
|
-
</g>
|
|
28
|
-
</template>
|
|
29
|
-
<script>
|
|
30
|
-
import { getJoint, getMousePosition, clearAllSelectedComponents, watchShowName } from '../util'
|
|
31
|
-
import { mapGetters, mapMutations } from 'vuex'
|
|
32
|
-
import StraightLine from './straight-line'
|
|
33
|
-
import CurveLine from './curve-line'
|
|
34
|
-
import BrokenLine from './broken-line'
|
|
35
|
-
export default {
|
|
36
|
-
name: 'Transition',
|
|
37
|
-
components: {
|
|
38
|
-
StraightLine,
|
|
39
|
-
CurveLine,
|
|
40
|
-
BrokenLine
|
|
41
|
-
},
|
|
42
|
-
props: {
|
|
43
|
-
model: {
|
|
44
|
-
type: Object,
|
|
45
|
-
default: null
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
data() {
|
|
49
|
-
const point = this.getTextPoint()
|
|
50
|
-
return {
|
|
51
|
-
text: {
|
|
52
|
-
x: point.x,
|
|
53
|
-
y: point.y
|
|
54
|
-
},
|
|
55
|
-
name: this.model.remark
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
computed: {
|
|
59
|
-
...mapGetters('wfEditor', ['draggerToMove', 'processI18n']),
|
|
60
|
-
draggers() {
|
|
61
|
-
const startPoint = getJoint(this.model.startJoint.parent, this.model.startJoint.position)
|
|
62
|
-
startPoint.position = 'start'
|
|
63
|
-
const endPoint = getJoint(this.model.endJoint.parent, this.model.endJoint.position)
|
|
64
|
-
endPoint.position = 'end'
|
|
65
|
-
return [startPoint, endPoint]
|
|
66
|
-
},
|
|
67
|
-
path() {
|
|
68
|
-
return 'M' + this.draggers[0].x + ' ' + this.draggers[0].y + ' L' + this.draggers[1].x + ' ' + this.draggers[1].y
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
created() {
|
|
72
|
-
this.name = watchShowName(this, this.name)
|
|
73
|
-
},
|
|
74
|
-
mounted() {
|
|
75
|
-
// 线条名称内容修改时
|
|
76
|
-
this.$watch('model.remark', function (newVal) {
|
|
77
|
-
this.name = watchShowName(this, newVal)
|
|
78
|
-
if (this.name && this.name !== '') {
|
|
79
|
-
// 计算文本框的x、y坐标
|
|
80
|
-
const point = this.getTextPoint()
|
|
81
|
-
this.text.x = point.x
|
|
82
|
-
this.text.y = point.y
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
// 右键菜单更改线条方式时
|
|
86
|
-
this.$watch('model.lineInfo.type', function (newVal) {
|
|
87
|
-
// 计算文本框的x、y坐标
|
|
88
|
-
const point = this.getTextPoint()
|
|
89
|
-
this.text.x = point.x
|
|
90
|
-
this.text.y = point.y
|
|
91
|
-
})
|
|
92
|
-
// 拖动控制点的位置时
|
|
93
|
-
this.$watch('model.lineInfo.controlPoint', function (newVal) {
|
|
94
|
-
// 计算文本框的x、y坐标
|
|
95
|
-
const point = this.getTextPoint()
|
|
96
|
-
this.text.x = point.x
|
|
97
|
-
this.text.y = point.y
|
|
98
|
-
})
|
|
99
|
-
// 水平拖动起点节点
|
|
100
|
-
this.$watch('model.startJoint.parent.x', function (newVal) {
|
|
101
|
-
// 计算文本框的x、y坐标
|
|
102
|
-
const point = this.getTextPoint()
|
|
103
|
-
this.text.x = point.x
|
|
104
|
-
this.text.y = point.y
|
|
105
|
-
})
|
|
106
|
-
// 垂直拖动起点节点
|
|
107
|
-
this.$watch('model.startJoint.parent.y', function (newVal) {
|
|
108
|
-
// 计算文本框的x、y坐标
|
|
109
|
-
const point = this.getTextPoint()
|
|
110
|
-
this.text.x = point.x
|
|
111
|
-
this.text.y = point.y
|
|
112
|
-
})
|
|
113
|
-
// 水平拖动终点节点
|
|
114
|
-
this.$watch('model.endJoint.parent.x', function (newVal) {
|
|
115
|
-
// 计算文本框的x、y坐标
|
|
116
|
-
const point = this.getTextPoint()
|
|
117
|
-
this.text.x = point.x
|
|
118
|
-
this.text.y = point.y
|
|
119
|
-
})
|
|
120
|
-
// 垂直拖动终点节点
|
|
121
|
-
this.$watch('model.endJoint.parent.y', function (newVal) {
|
|
122
|
-
// 计算文本框的x、y坐标
|
|
123
|
-
const point = this.getTextPoint()
|
|
124
|
-
this.text.x = point.x
|
|
125
|
-
this.text.y = point.y
|
|
126
|
-
})
|
|
127
|
-
},
|
|
128
|
-
methods: {
|
|
129
|
-
...mapMutations('wfEditor', [
|
|
130
|
-
'setMouseDownPosition',
|
|
131
|
-
'setDraggerToMove',
|
|
132
|
-
'setSelectedTransition',
|
|
133
|
-
'setPropertiesEditorFor'
|
|
134
|
-
]),
|
|
135
|
-
getTextPoint() {
|
|
136
|
-
const startPoint = getJoint(this.model.startJoint.parent, this.model.startJoint.position)
|
|
137
|
-
const endPoint = getJoint(this.model.endJoint.parent, this.model.endJoint.position)
|
|
138
|
-
let minX = startPoint.x < endPoint.x ? startPoint.x : endPoint.x
|
|
139
|
-
let minY = startPoint.y < endPoint.y ? startPoint.y : endPoint.y
|
|
140
|
-
let textX = minX + Math.abs(startPoint.x - endPoint.x) / 2
|
|
141
|
-
let textY = minY + Math.abs(startPoint.y - endPoint.y) / 2
|
|
142
|
-
if (this.model.lineInfo.type === 'CurveLine') {
|
|
143
|
-
// 曲线
|
|
144
|
-
const point = this.model.lineInfo.controlPoint
|
|
145
|
-
if (point) {
|
|
146
|
-
minX = startPoint.x < point.x ? startPoint.x : parseFloat(point.x)
|
|
147
|
-
minY = startPoint.y < point.y ? startPoint.y : parseFloat(point.y)
|
|
148
|
-
textX = minX + Math.abs(startPoint.x - point.x) / 2 + 10
|
|
149
|
-
textY = minY + Math.abs(startPoint.y - point.y) / 2 - 10
|
|
150
|
-
}
|
|
151
|
-
} else if (this.model.lineInfo.type === 'BrokenLine') {
|
|
152
|
-
if (this.model.lineInfo.controlPoint && this.model.lineInfo.controlPoint.length > 0) {
|
|
153
|
-
const point = this.model.lineInfo.controlPoint[0]
|
|
154
|
-
if (point) {
|
|
155
|
-
minX = startPoint.x < point.x ? startPoint.x : parseFloat(point.x)
|
|
156
|
-
minY = startPoint.y < point.y ? startPoint.y : parseFloat(point.y)
|
|
157
|
-
textX = minX + Math.abs(startPoint.x - point.x) / 2
|
|
158
|
-
textY = minY + Math.abs(startPoint.y - point.y) / 2 - 10
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return { x: textX, y: textY }
|
|
163
|
-
},
|
|
164
|
-
select(event) {
|
|
165
|
-
clearAllSelectedComponents()
|
|
166
|
-
this.model.isSelected = true
|
|
167
|
-
this.setSelectedTransition(this.model)
|
|
168
|
-
},
|
|
169
|
-
startDrag(event, position) {
|
|
170
|
-
console.log('start dragging line')
|
|
171
|
-
this.setMouseDownPosition(getMousePosition(event))
|
|
172
|
-
this.setDraggerToMove({
|
|
173
|
-
owner: this.model,
|
|
174
|
-
position,
|
|
175
|
-
originStartJoint: this.model.startJoint,
|
|
176
|
-
originEndJoint: this.model.endJoint
|
|
177
|
-
})
|
|
178
|
-
},
|
|
179
|
-
endDrag() {
|
|
180
|
-
// this.setSe
|
|
181
|
-
},
|
|
182
|
-
showPropertiesEditor() {
|
|
183
|
-
if (this.model.endJoint.parent.type !== 'Decision') {
|
|
184
|
-
this.setPropertiesEditorFor('Transition')
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
</script>
|
|
190
|
-
<style scoped>
|
|
191
|
-
.transition {
|
|
192
|
-
stroke-width: 2;
|
|
193
|
-
stroke: #666;
|
|
194
|
-
fill: none;
|
|
195
|
-
cursor: pointer;
|
|
196
|
-
}
|
|
197
|
-
.selected {
|
|
198
|
-
stroke: red;
|
|
199
|
-
}
|
|
200
|
-
.transition-dragger {
|
|
201
|
-
stroke: red;
|
|
202
|
-
stroke-width: 1;
|
|
203
|
-
fill: white;
|
|
204
|
-
cursor: move;
|
|
205
|
-
}
|
|
206
|
-
.no-events {
|
|
207
|
-
pointer-events: none;
|
|
208
|
-
}
|
|
209
|
-
</style>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g>
|
|
3
|
-
<path v-show="path" :d="path" class="virtual-transition" marker-end="url(#arrow)" />
|
|
4
|
-
</g>
|
|
5
|
-
</template>
|
|
6
|
-
<script>
|
|
7
|
-
import { getJoint } from '../util'
|
|
8
|
-
import { mapGetters } from 'vuex'
|
|
9
|
-
export default {
|
|
10
|
-
name: 'VirtualTransition',
|
|
11
|
-
props: {
|
|
12
|
-
toPosition: {
|
|
13
|
-
type: Object,
|
|
14
|
-
default: null
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
computed: {
|
|
18
|
-
...mapGetters('wfEditor', [
|
|
19
|
-
'startJoint'
|
|
20
|
-
]),
|
|
21
|
-
path() {
|
|
22
|
-
if (!this.startJoint) {
|
|
23
|
-
return null
|
|
24
|
-
}
|
|
25
|
-
const startJoint = getJoint(this.startJoint.parent, this.startJoint.position)
|
|
26
|
-
// 虚线的endJoint存的就是鼠标的当前位置,此时还没有连接到任何环节上
|
|
27
|
-
const endJoint = this.toPosition
|
|
28
|
-
return 'M' + startJoint.x + ' ' + startJoint.y + ' L' + endJoint.x + ' ' + endJoint.y
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
<style>
|
|
37
|
-
.virtual-transition{
|
|
38
|
-
stroke-width: 2;
|
|
39
|
-
stroke:#000;
|
|
40
|
-
stroke-dasharray: 2 2;
|
|
41
|
-
fill: none;
|
|
42
|
-
}
|
|
43
|
-
</style>
|