workflow-editor 0.9.84-dw-tmp2 → 0.9.84-dw-tmp3

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 (110) hide show
  1. package/package.json +2 -2
  2. package/packages/index.js +34 -0
  3. package/packages/plugins/formValidatorUtil.js +528 -0
  4. package/packages/plugins/index.js +8 -0
  5. package/packages/workflow-editor/index.js +14 -0
  6. package/packages/workflow-editor/src/api.js +7 -0
  7. package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
  8. package/packages/workflow-editor/src/constant.js +8 -0
  9. package/packages/workflow-editor/src/json-object-templates/copy-task.js +67 -0
  10. package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
  11. package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
  12. package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
  13. package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
  14. package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
  15. package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
  16. package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
  17. package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
  18. package/packages/workflow-editor/src/json-object-templates/subprocess.js +30 -0
  19. package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
  20. package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
  21. package/packages/workflow-editor/src/main/canvas.vue +479 -0
  22. package/packages/workflow-editor/src/main/context-menu.vue +132 -0
  23. package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
  24. package/packages/workflow-editor/src/main/selection-region.vue +66 -0
  25. package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
  26. package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
  27. package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
  28. package/packages/workflow-editor/src/main/toolbox.vue +60 -0
  29. package/packages/workflow-editor/src/main/wf-history-canvas.vue +302 -0
  30. package/packages/workflow-editor/src/process-json.js +622 -0
  31. package/packages/workflow-editor/src/process-service.js +31 -0
  32. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +522 -0
  33. package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
  34. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
  35. package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
  36. package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +47 -0
  37. package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
  38. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
  39. package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
  40. package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
  41. package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
  42. package/packages/workflow-editor/src/properties-editors/common/notice.vue +98 -0
  43. package/packages/workflow-editor/src/properties-editors/common/reminder.vue +179 -0
  44. package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
  45. package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
  46. package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +355 -0
  47. package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
  48. package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
  49. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +220 -0
  50. package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
  51. package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
  52. package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
  53. package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
  54. package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
  55. package/packages/workflow-editor/src/properties-editors/copy-task.vue +80 -0
  56. package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
  57. package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
  58. package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
  59. package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
  60. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +156 -0
  61. package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
  62. package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
  63. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
  64. package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
  65. package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
  66. package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
  67. package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
  68. package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
  69. package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
  70. package/packages/workflow-editor/src/properties-editors/human-task.vue +103 -0
  71. package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
  72. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
  73. package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
  74. package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
  75. package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
  76. package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
  77. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
  78. package/packages/workflow-editor/src/properties-editors/process.vue +109 -0
  79. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +176 -0
  80. package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
  81. package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
  82. package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
  83. package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
  84. package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
  85. package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
  86. package/packages/workflow-editor/src/properties-editors/user-condition.js +177 -0
  87. package/packages/workflow-editor/src/store/getters.js +27 -0
  88. package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
  89. package/packages/workflow-editor/src/taches/common-methods.js +21 -0
  90. package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
  91. package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
  92. package/packages/workflow-editor/src/taches/decision.vue +102 -0
  93. package/packages/workflow-editor/src/taches/end.vue +76 -0
  94. package/packages/workflow-editor/src/taches/fork.vue +102 -0
  95. package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
  96. package/packages/workflow-editor/src/taches/human-task.vue +113 -0
  97. package/packages/workflow-editor/src/taches/join.vue +91 -0
  98. package/packages/workflow-editor/src/taches/joint.vue +177 -0
  99. package/packages/workflow-editor/src/taches/start.vue +76 -0
  100. package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
  101. package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
  102. package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
  103. package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
  104. package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
  105. package/packages/workflow-editor/src/transitions/transition.vue +212 -0
  106. package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
  107. package/packages/workflow-editor/src/util.js +493 -0
  108. package/packages/workflow-editor/src/workflow-editor.vue +605 -0
  109. package/packages/workflow-editor/src/workflow-history.vue +153 -0
  110. package/src/index.js +28 -0
@@ -0,0 +1,153 @@
1
+ <template>
2
+ <div
3
+ ref="wfEditor"
4
+ style="position:relative;height:100%;"
5
+ >
6
+ <div
7
+ class="main"
8
+ >
9
+ <section>
10
+ <wf-history-canvas
11
+ onselectstart="return false"
12
+ :process="process"
13
+ :histories="histories"
14
+ :current-tasks="currentTasks"
15
+ :all-process-i18n="allProcessI18n"
16
+ :show-history="true"
17
+ class="canvas"
18
+ @contextmenu.native.prevent="showContextMenu"
19
+ />
20
+ </section>
21
+ </div>
22
+ </div>
23
+ </template>
24
+ <script>
25
+ import './assets/wf-editor-icons.js'
26
+ import { mapGetters, mapMutations } from 'vuex'
27
+ import { removeTextProperty, initializeProcessData, processTemplate } from './util'
28
+ import WfHistoryCanvas from './main/wf-history-canvas'
29
+ import convert from 'xml-js'
30
+ import ApiJs from './api'
31
+ export default {
32
+ name: 'WorkflowHistory',
33
+ components: {
34
+ WfHistoryCanvas
35
+ },
36
+ props: {
37
+ // 实例id
38
+ id: {
39
+ type: Number,
40
+ default: null
41
+ }
42
+ },
43
+ data: function() {
44
+ return {
45
+ process: null,
46
+ histories: [],
47
+ currentTasks: [],
48
+ allProcessI18n: null
49
+ }
50
+ },
51
+ computed: {
52
+ ...mapGetters(
53
+ 'wfEditor', ['componentToDraw', 'taches', 'transitions', 'contextMenuVisible']
54
+ ),
55
+ ...mapGetters([
56
+ 'sidebar'
57
+ ])
58
+
59
+ },
60
+ watch: {
61
+
62
+ },
63
+ created: function() {
64
+ this.showHistory()
65
+ },
66
+ mounted: function() {
67
+
68
+ },
69
+ methods: {
70
+ ...ApiJs,
71
+ ...mapMutations('wfEditor', [
72
+ 'setComponentToDraw',
73
+ 'clearCanvas',
74
+ 'setContextMenuVisible',
75
+ 'setProcessI18n'
76
+ ]),
77
+ showHistory() {
78
+ // 打开或新建流程图时先清空画布,开发过程中代码热更新的时候可以避免节点重复
79
+ this.clearCanvas()
80
+ if (this.id) {
81
+ this.$http.get(this.baseAPI + '/wf-editor/i18n-settings/get-bundle-info?workflowId=' + this.id).then(processI18n => {
82
+ this.allProcessI18n = processI18n
83
+ const url = this.baseAPI + '/wf-editor/instance-histories/' + this.id
84
+ this.$http.get(url).then(data => {
85
+ this.initProcessByXml(data.xml)
86
+ let mainBundleCode
87
+ if (data.histories && data.histories.length > 0) {
88
+ mainBundleCode = data.histories[0].bundleCode
89
+ }
90
+ if (!mainBundleCode && data.currentTasks && data.currentTasks.length > 0) {
91
+ mainBundleCode = data.currentTasks[0].bundleCode
92
+ }
93
+ if (mainBundleCode) {
94
+ this.setProcessI18n(processI18n[mainBundleCode])
95
+ }
96
+ this.histories = data.histories
97
+ this.currentTasks = data.currentTasks
98
+ })
99
+ })
100
+ } else {
101
+ this.process = processTemplate.newProcess()
102
+ initializeProcessData(this.process)
103
+ }
104
+ },
105
+ showContextMenu(event) {
106
+
107
+ },
108
+ initProcessByXml(xml) {
109
+ const options = { nativeType: true, attributesKey: 'attr', compact: true, ignoreComment: true, spaces: 4 }
110
+ const processObj = convert.xml2js(xml, options)
111
+ removeTextProperty(processObj.process)
112
+ this.process = processObj.process
113
+
114
+ initializeProcessData(this.process)
115
+ }
116
+ }
117
+ }
118
+ </script>
119
+ <style lang="scss" scoped>
120
+ .main{
121
+ position: relative;
122
+ display:flex;
123
+ height: 100%;
124
+ width:100%;
125
+ }
126
+ .canvas-container{
127
+ position: relative;
128
+ // display:flex;
129
+ height: 100%;
130
+ width:100%;
131
+ }
132
+
133
+ section{
134
+ overflow: hidden;
135
+ width:100%;
136
+ height:100%;
137
+ padding: 0;
138
+ // min-height: 500px;
139
+ }
140
+ .canvas{
141
+ overflow: auto;
142
+ height:100%;
143
+ // border:1px solid red;
144
+ // background: #ffffff;
145
+ padding: 0;
146
+ min-height: 500px;
147
+
148
+ }
149
+ .canvas /deep/ .draggable{
150
+ cursor: default;
151
+ }
152
+ </style>
153
+
package/src/index.js ADDED
@@ -0,0 +1,28 @@
1
+ // 依次导入组件库的各个组件
2
+ import workflow from '../packages/workflow-editor'
3
+ import formValidator from '../packages/plugins/index'
4
+ const WorkflowEditor = workflow.WorkflowEditor
5
+ const WorkflowHistory = workflow.WorkflowHistory
6
+ const wfEditorStore = workflow.wfEditorStore
7
+
8
+ // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
9
+ const install = function(Vue) {
10
+ if (install.installed) return
11
+ // components.map(component => Vue.component(component.name, component))
12
+ Vue.use(formValidator)
13
+ }
14
+
15
+ // 判断是否是直接引入vue的js文件,即全局引用可自动安装所有组件
16
+ if (typeof window !== 'undefined' && window.Vue) {
17
+ install(window.Vue)
18
+ }
19
+ export {
20
+ WorkflowEditor,
21
+ WorkflowHistory
22
+ }
23
+
24
+ export default {
25
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
26
+ install,
27
+ wfEditorStore
28
+ }