workflow-editor 0.9.68-boe3 → 0.9.68-pv

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 (31) hide show
  1. package/lib/workflow-editor.css +1 -1
  2. package/lib/workflow-editor.umd.min.js +8 -8
  3. package/package.json +2 -2
  4. package/packages/plugins/formValidatorUtil.js +1 -6
  5. package/packages/workflow-editor/src/json-object-templates/copy-task.js +0 -5
  6. package/packages/workflow-editor/src/json-object-templates/subprocess.js +1 -2
  7. package/packages/workflow-editor/src/main/canvas.vue +1 -5
  8. package/packages/workflow-editor/src/main/wf-history-canvas.vue +1 -3
  9. package/packages/workflow-editor/src/process-json.js +1 -2
  10. package/packages/workflow-editor/src/process-service.js +2 -2
  11. package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +10 -20
  12. package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +1 -1
  13. package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +1 -1
  14. package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +9 -51
  15. package/packages/workflow-editor/src/properties-editors/copy-task.vue +1 -15
  16. package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +1 -5
  17. package/packages/workflow-editor/src/properties-editors/human-task.vue +2 -2
  18. package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +62 -9
  19. package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +8 -1
  20. package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +6 -18
  21. package/packages/workflow-editor/src/store/getters.js +2 -1
  22. package/packages/workflow-editor/src/store/workflow-editor.js +3 -0
  23. package/packages/workflow-editor/src/util.js +36 -32
  24. package/packages/workflow-editor/src/workflow-editor.vue +27 -7
  25. package/src/i18n/langs/cn.js +6 -12
  26. package/src/i18n/langs/en.js +2 -8
  27. package/packages/workflow-editor/src/json-object-templates/auto-task.js +0 -70
  28. package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +0 -81
  29. package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +0 -155
  30. package/packages/workflow-editor/src/properties-editors/auto-task.vue +0 -73
  31. package/packages/workflow-editor/src/taches/auto-task.vue +0 -99
@@ -4,11 +4,7 @@
4
4
  <el-col :span="12">
5
5
  <el-form-item :label="$t('workflowEditor.process.name')" label-width="50px">
6
6
  <!-- <el-input v-model="formModel.name" /> -->
7
- <i18n-input
8
- v-model="formModel.name"
9
- :i18n-key="formModel.tache.i18nKey?formModel.tache.i18nKey:'name.'+formModel.id"
10
- @setI18n="setI18nValue"
11
- />
7
+ <i18n-input v-model="formModel.name" :i18n-key="formModel.tache.i18nKey?formModel.tache.i18nKey:'name.'+formModel.id" @setI18n="setI18nValue" />
12
8
  </el-form-item>
13
9
  </el-col>
14
10
  <el-col :span="12">
@@ -17,9 +13,6 @@
17
13
  </el-form-item>
18
14
  </el-col>
19
15
  </el-row>
20
- <el-form-item :label="$t('workflowEditor.task.taskTitle')">
21
- <task-title v-model="tache.taskTitle" />
22
- </el-form-item>
23
16
  <el-form-item :label="$t('workflowEditor.process.subprocess')" label-width="60px">
24
17
  <el-cascader
25
18
  v-model="selectedProcess"
@@ -63,13 +56,11 @@ import FieldMappings from './field-mappings'
63
56
  import processService from '../../process-service.js'
64
57
  import { validateTacheCode } from '../../util'
65
58
  import i18nInput from '../common/i18n-input'
66
- import TaskTitle from '../common/task-title'
67
59
  export default {
68
60
  name: 'BasicProperties',
69
61
  components: {
70
62
  FieldMappings,
71
- i18nInput,
72
- TaskTitle
63
+ i18nInput
73
64
  },
74
65
  props: {
75
66
  model: {
@@ -98,9 +89,6 @@ export default {
98
89
  }
99
90
  },
100
91
  computed: {
101
- tache() {
102
- return this.model
103
- }
104
92
  },
105
93
  created() {
106
94
  this.listAllProcesses().then(() => {
@@ -115,10 +103,10 @@ export default {
115
103
  }
116
104
  },
117
105
  mounted() {
118
- // 支持.snyc修饰符的写法
119
- this.$watch('formModel.name', function(newVal, oldVal) {
120
- this.$emit('update:name', newVal)
121
- })
106
+ // this.$watch('model.attr.id', function(newVal, oldVal) {
107
+ // // updateTransitionsWhenTacheIdChanged(newVal, oldVal)
108
+ // this.$emit('update:id', newVal)
109
+ // })
122
110
  },
123
111
  methods: {
124
112
  fetchSubprocessFormFields() {
@@ -22,6 +22,7 @@ const getters = {
22
22
  processCode: state => state.processCode,
23
23
  processI18n: state => state.processI18n,
24
24
  subtableConditionMap: state => state.subtableConditionMap,
25
- propSettingKeyList: state => state.propSettingKeyList
25
+ propSettingKeyList: state => state.propSettingKeyList,
26
+ systemVersion: state => state.systemVersion
26
27
  }
27
28
  export default getters
@@ -118,6 +118,9 @@ const wfEditor = {
118
118
  },
119
119
  setPropSettingKeyList(state, propSettingKeyList) {
120
120
  state.propSettingKeyList = propSettingKeyList
121
+ },
122
+ setSystemVersion(state, systemVersion) {
123
+ state.systemVersion = systemVersion
121
124
  }
122
125
  }
123
126
  }
@@ -1,18 +1,5 @@
1
1
 
2
2
  import { getLanguageWithLocale } from 'imatrix-ui/src/utils/util'
3
- import i18n from '../../../src/i18n/i18n'
4
- import newAutoTask from './json-object-templates/auto-task'
5
- import newCopyTask from './json-object-templates/copy-task'
6
- import newDecision from './json-object-templates/decision'
7
- import newEnd from './json-object-templates/end'
8
- import newFork from './json-object-templates/fork'
9
- import newHumanDecision from './json-object-templates/human-decision'
10
- import newHumanTask from './json-object-templates/human-task'
11
- import newJoin from './json-object-templates/join'
12
- import newProcess from './json-object-templates/process'
13
- import newStart from './json-object-templates/start'
14
- import newSubprocess from './json-object-templates/subprocess'
15
- import newTransition from './json-object-templates/transition'
16
3
  function getStore() {
17
4
  return window.$store
18
5
  }
@@ -105,16 +92,6 @@ export function getComponentList() {
105
92
  height: 40,
106
93
  color: '#0777D4'
107
94
  },
108
- {
109
- name: 'AutoTask',
110
- label: getI18n().t('workflowEditor.task.autoTask'),
111
- icon: 'human-task',
112
- type: '',
113
- round: false,
114
- width: 80,
115
- height: 40,
116
- color: '#0777D4'
117
- },
118
95
  {
119
96
  name: 'End',
120
97
  label: getI18n().t('workflowEditor.task.end'),
@@ -292,7 +269,7 @@ function clearAllSelectedComponents() {
292
269
  */
293
270
  function removeTextProperty(obj) {
294
271
  const keys = Object.getOwnPropertyNames(obj)
295
- keys.forEach(function (key) {
272
+ keys.forEach(function(key) {
296
273
  if (typeof obj[key] === 'object') {
297
274
  if (obj[key]._text !== undefined) {
298
275
  obj[key] = obj[key]._text
@@ -313,7 +290,7 @@ function removeTextProperty(obj) {
313
290
  })
314
291
  }
315
292
  function generateTaches(type, arr) {
316
- if (!arr) arr = []
293
+ if (!arr)arr = []
317
294
  if (!Array.isArray(arr)) {
318
295
  arr = [arr]
319
296
  }
@@ -335,7 +312,7 @@ function generateTaches(type, arr) {
335
312
  }
336
313
  }
337
314
  function generateTransitions(type, arr) {
338
- if (!arr) arr = []
315
+ if (!arr)arr = []
339
316
  if (!Array.isArray(arr)) {
340
317
  arr = [arr]
341
318
  }
@@ -384,7 +361,6 @@ function initializeProcessData(process) {
384
361
  generateTaches('Subprocess', process.subprocess)
385
362
  generateTaches('HumanDecision', process.humanDecision)
386
363
  generateTaches('CopyTask', process.copyTask)
387
- generateTaches('AutoTask', process.autoTask)
388
364
  generateTaches('Start', process.start)
389
365
  generateTaches('End', process.end)
390
366
  generateTransitions('Transition', process.transition)
@@ -466,9 +442,39 @@ function watchShowName(vm, newVal) {
466
442
  return showName
467
443
  }
468
444
  export {
469
- clearAllSelectedComponents, deepCopy, endDragTache, findIncomingTransitionsByTacheId, findOutgoingTransitionsByTacheId, findTacheById, getClientMousePosition, getComponentInfo, getI18n, getJoint, getMouseOffset, getMousePosition, getRealRegion, getVirtualRegion, initializeProcessData, removeTextProperty, startDragTache, updateTransitionsWhenTacheIdChanged,
470
- validateTacheCode, watchShowName
445
+ getComponentInfo,
446
+ getJoint,
447
+ getMousePosition,
448
+ getClientMousePosition,
449
+ getMouseOffset,
450
+ getVirtualRegion,
451
+ getRealRegion,
452
+ startDragTache,
453
+ endDragTache,
454
+ clearAllSelectedComponents,
455
+ removeTextProperty,
456
+ initializeProcessData,
457
+ findOutgoingTransitionsByTacheId,
458
+ findIncomingTransitionsByTacheId,
459
+ findTacheById,
460
+ deepCopy,
461
+ updateTransitionsWhenTacheIdChanged,
462
+ validateTacheCode,
463
+ getI18n,
464
+ watchShowName
471
465
  }
466
+ import newProcess from './json-object-templates/process'
467
+ import newHumanTask from './json-object-templates/human-task'
468
+ import newDecision from './json-object-templates/decision'
469
+ import newStart from './json-object-templates/start'
470
+ import newEnd from './json-object-templates/end'
471
+ import newTransition from './json-object-templates/transition'
472
+ import newSubprocess from './json-object-templates/subprocess'
473
+ import newFork from './json-object-templates/fork'
474
+ import newJoin from './json-object-templates/join'
475
+ import newHumanDecision from './json-object-templates/human-decision'
476
+ import i18n from '../../../src/i18n/i18n'
477
+ import newCopyTask from './json-object-templates/copy-task'
472
478
 
473
479
  const processTemplate = {
474
480
  newProcess,
@@ -481,9 +487,7 @@ const processTemplate = {
481
487
  newFork,
482
488
  newJoin,
483
489
  newHumanDecision,
484
- newCopyTask,
485
- newAutoTask
490
+ newCopyTask
486
491
  }
487
492
 
488
493
  export { processTemplate }
489
-
@@ -99,6 +99,7 @@ import processService from './process-service'
99
99
  import FileSaver from 'file-saver'
100
100
  import Prism from 'prismjs'
101
101
  import AdminSaveDialog from './main/admin-save-dialog'
102
+ import authApi from 'imatrix-ui/src/utils/auth-api'
102
103
  export default {
103
104
  name: 'WorkflowEditor',
104
105
  components: {
@@ -127,6 +128,16 @@ export default {
127
128
  readonly: {
128
129
  type: Boolean,
129
130
  default: false
131
+ },
132
+ // 系统编码,新增时选中的系统编码,或修改时流程定义所属的系统编码
133
+ systemCode: {
134
+ type: String,
135
+ default: null
136
+ },
137
+ // 系统版本号,修改时流程定义中的系统版本号,例如:v1.0.0,新增不会使用该属性
138
+ systemPublishVersion: {
139
+ type: Number,
140
+ default: null
130
141
  }
131
142
  },
132
143
  data: function() {
@@ -143,7 +154,7 @@ export default {
143
154
  },
144
155
  computed: {
145
156
  ...mapGetters(
146
- 'wfEditor', ['componentToDraw', 'taches', 'transitions', 'contextMenuVisible']
157
+ 'wfEditor', ['componentToDraw', 'taches', 'transitions', 'contextMenuVisible', 'systemVersion']
147
158
  ),
148
159
  ...mapGetters([
149
160
  'sidebar'
@@ -163,6 +174,10 @@ export default {
163
174
  }
164
175
  },
165
176
  created: function() {
177
+ authApi.setSessionCache('wf_editor_systemVersion', this.systemPublishVersion)
178
+ if (this.systemCode) {
179
+ this.setSystemCode(this.systemCode)
180
+ }
166
181
  // 打开或新建流程图时先清空画布,开发过程中代码热更新的时候可以避免节点重复
167
182
  this.clearCanvas()
168
183
  if (this.id) {
@@ -181,7 +196,6 @@ export default {
181
196
  }
182
197
  },
183
198
  mounted: function() {
184
-
185
199
  },
186
200
  methods: {
187
201
  ...mapMutations('wfEditor', [
@@ -189,6 +203,7 @@ export default {
189
203
  'clearCanvas',
190
204
  'setContextMenuVisible',
191
205
  'setSystemCode',
206
+ 'setSystemVersion',
192
207
  'setProcessCode'
193
208
  ]),
194
209
  showContextMenu(event) {
@@ -208,6 +223,9 @@ export default {
208
223
  this.process = processObj.process
209
224
  if (this.process && this.process.properties && this.process.properties.basicProperties) {
210
225
  this.setSystemCode(this.process.properties.basicProperties.systemCode)
226
+ } else {
227
+ // 新增时,将传过来的系统编码缓存起来
228
+ this.setSystemCode(this.systemCode)
211
229
  }
212
230
  if (this.process && this.process.attr) {
213
231
  this.setProcessCode(this.process.attr.code)
@@ -223,7 +241,7 @@ export default {
223
241
  const formVersion = processProperties.formVersion
224
242
  if (formCode && formCode !== '' && formVersion) {
225
243
  // 取出formFields放到vuex中
226
- processService.fetchFormFields(processProperties.formCode, processProperties.formVersion)
244
+ processService.fetchFormFields(processProperties.formCode, processProperties.formVersion, this.systemPublishVersion)
227
245
  }
228
246
  },
229
247
  packageUrlParam(url) {
@@ -246,7 +264,6 @@ export default {
246
264
  subprocess: [],
247
265
  humanDecision: [],
248
266
  copyTask: [],
249
- autoTask: [],
250
267
  end: []
251
268
  }
252
269
  process.attr = this.process.attr
@@ -302,7 +319,8 @@ export default {
302
319
  } else {
303
320
  // 表示新建
304
321
  const param = {
305
- xml: xml
322
+ xml: xml,
323
+ publishVersion: this.systemPublishVersion
306
324
  }
307
325
  this.$http.post(this.baseAPI + '/wf-editor/workflow-definitions', param).then(definition => {
308
326
  this.definitionId = definition.id
@@ -324,7 +342,8 @@ export default {
324
342
  },
325
343
  packageSaveXmlParam(xml) {
326
344
  const param = {
327
- xml: xml
345
+ xml: xml,
346
+ publishVersion: this.systemPublishVersion
328
347
  }
329
348
  if (this.definitionId) {
330
349
  // 表示已保存过,新流程定义的id
@@ -373,7 +392,8 @@ export default {
373
392
  } else {
374
393
  // 表示新建
375
394
  const param = {
376
- xml: xml
395
+ xml: xml,
396
+ publishVersion: this.systemPublishVersion
377
397
  }
378
398
  this.$http.post(this.baseAPI + '/wf-editor/workflow-definitions', param).then(definition => {
379
399
  this.definitionId = definition.id
@@ -30,7 +30,7 @@ const cn = {
30
30
  i18nEn: '英文',
31
31
  i18nKey: '国际化key',
32
32
  subprocessTitle: '子流程流转历史',
33
- custom: '自定义'
33
+ custom:'自定义'
34
34
  },
35
35
  workflowEditorMessage: {
36
36
  requiredAndMustBeADate: '必填且必须为日期',
@@ -139,9 +139,9 @@ const cn = {
139
139
  variableName: '变量名',
140
140
  variableValue: '变量值',
141
141
  selectField: '选择字段',
142
- taskNotice: '待办通知',
143
- reminderNotice: '催办通知',
144
- customMsg: '自定义消息内容'
142
+ taskNotice:'待办通知',
143
+ reminderNotice:'催办通知',
144
+ customMsg:'自定义消息内容'
145
145
  },
146
146
  // 流程属性
147
147
  process: {
@@ -321,9 +321,7 @@ const cn = {
321
321
  defaultMailTemplate: '默认邮件模板',
322
322
  trustTask: '委托任务',
323
323
  subprocessIsSharedForm: '主子流程共用表单',
324
- generateForParttimeDept: '为兼职部门人员生成任务',
325
- deptSpecifiedInFormField: '表单字段中指定的部门',
326
- activateOneVoteVeto: '一票否决'
324
+ systemVersion: '系统版本'
327
325
  },
328
326
  // 环节属性
329
327
  task: {
@@ -429,11 +427,7 @@ const cn = {
429
427
  cCtask: '抄送任务',
430
428
  canItBeRejected: '是否可驳回',
431
429
  selectMailTemplate: '选择通知模板',
432
- selectTemplate: '选择模板',
433
- autoTask: '自动任务',
434
- newAutoTask: '新自动任务',
435
- propertiesOfAutoTask: '自动任务的属性',
436
- custombeanName: '自定义bean'
430
+ selectTemplate: '选择模板'
437
431
  },
438
432
  // 流向属性
439
433
  transition: {
@@ -321,9 +321,7 @@ const en = {
321
321
  defaultMailTemplate: 'Default Mail Template',
322
322
  trustTask: 'Trust Task',
323
323
  subprocessIsSharedForm: 'Main process and subprocess shared form',
324
- generateForParttimeDept: 'Generate tasks for part-time department personnel',
325
- deptSpecifiedInFormField: 'Dept Specified In Form Field',
326
- activateOneVoteVeto: 'Activate one vote veto'
324
+ systemVersion: 'System Version'
327
325
  },
328
326
  // 环节属性
329
327
  task: {
@@ -429,11 +427,7 @@ const en = {
429
427
  cCtask: 'CC Task',
430
428
  canItBeRejected: 'Can It Be Rejected',
431
429
  selectMailTemplate: 'Select Notice Template',
432
- selectTemplate: 'Select Template',
433
- autoTask: 'Auto Task',
434
- newAutoTask: 'New Auto Task',
435
- propertiesOfAutoTask: 'Properties Of Auto Task',
436
- custombeanName: 'Custom Bean Name'
430
+ selectTemplate: 'Select Template'
437
431
  },
438
432
  // 流向属性
439
433
  transition: {
@@ -1,70 +0,0 @@
1
- import i18n from '../../../../src/i18n/i18n'
2
- export default function newAutoTask() {
3
- return {
4
- attr: {
5
- id: '',
6
- name: i18n.t('workflowEditor.task.newAutoTask')
7
- },
8
- g: {},
9
- taskNotice: {
10
-
11
- },
12
- basicProperties: {
13
- beanName: ''
14
- },
15
- transactorSettings: {
16
- userCondition: '',
17
- moreTransactor: false,
18
- additionalCondition: {
19
- onlyInCreatorDepartment: false,
20
- withCreatorDepartment: false,
21
- selectOneFromMultiple: false
22
- }
23
- },
24
- events: {
25
- },
26
- permissionSettings: {
27
- editForm: {
28
- permission: false,
29
- field: []
30
- },
31
- viewOpinion: {
32
- permission: false,
33
- condition: ''
34
- },
35
- editOpinion: {
36
- permission: false,
37
- condition: ''
38
- },
39
- requireOpinion: {
40
- permission: false,
41
- condition: ''
42
- },
43
- viewMeetingResult: {
44
- permission: false,
45
- condition: ''
46
- },
47
- viewVoteResult: {
48
- permission: false,
49
- condition: ''
50
- },
51
- viewFlowHistory: {
52
- permission: false,
53
- condition: ''
54
- },
55
- printForm: {
56
- permission: false,
57
- condition: ''
58
- },
59
- officialText: {
60
- permission: false // 控制是否设置正文权限,false时就没有后续的create,edit等权限设置了
61
- },
62
- attachment: {
63
- permission: false // 控制是否设置附件权限,false时就没有后面的add,delete等权限设置了
64
- },
65
- deleteInstance: {
66
- userCondition: ''
67
- }
68
- }
69
- }
70
- }
@@ -1,81 +0,0 @@
1
- <template>
2
- <el-form :model="formModel" label-width="110px">
3
- <el-row>
4
- <el-col :span="12">
5
- <el-form-item :label="$t('workflowEditor.task.name')">
6
- <!-- <el-input v-model="formModel.name" /> -->
7
- <i18n-input v-model="formModel.name" :i18n-key="tache.i18nKey?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.task.code')">
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.task.custombeanName')">
17
- <el-input v-model="tache.beanName" />
18
- </el-form-item>
19
- </el-form>
20
- </template>
21
- <script>
22
- import TaskTitle from '../common/task-title'
23
- import { validateTacheCode } from '../../util'
24
- import i18nInput from '../common/i18n-input'
25
- export default {
26
- name: 'BasicProperties',
27
- components: {
28
- TaskTitle,
29
- i18nInput
30
- },
31
- props: {
32
- model: {
33
- type: Object,
34
- default: null
35
- },
36
- id: {
37
- type: String,
38
- default: null
39
- },
40
- name: {
41
- type: String,
42
- default: null
43
- }
44
- },
45
- data() {
46
- return {
47
- formModel: {
48
- name: this.name,
49
- id: this.id,
50
- tache: this.model
51
- }
52
- }
53
- },
54
- computed: {
55
- tache() {
56
- return this.model
57
- }
58
- },
59
- mounted() {
60
- // 支持.snyc修饰符的写法
61
- this.$watch('formModel.name', function(newVal, oldVal) {
62
- this.$emit('update:name', newVal)
63
- })
64
- },
65
- methods: {
66
- validateId() {
67
- validateTacheCode(this)
68
- },
69
- setI18nValue(i18nKey) {
70
- this.tache.i18nKey = i18nKey
71
- }
72
- }
73
- }
74
- </script>
75
- <style scoped>
76
- .percent{
77
- margin-left: 10px;
78
- color:red;
79
- font-size:1.2em;
80
- }
81
- </style>