workflow-editor 0.9.66-pv1 → 0.9.66-pv3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workflow-editor",
3
- "version": "0.9.66-pv1",
3
+ "version": "0.9.66-pv3",
4
4
  "description": "流程编辑器",
5
5
  "main": "lib/workflow-editor.umd.min.js",
6
6
  "private": false,
@@ -33,7 +33,7 @@
33
33
  "element-ui": "2.15.3",
34
34
  "eslint": "5.16.0",
35
35
  "eslint-plugin-vue": "5.2.2",
36
- "imatrix-ui": "2.8.22",
36
+ "imatrix-ui": "2.9.8-pv2",
37
37
  "node-sass": "4.12.0",
38
38
  "nprogress": "^0.2.0",
39
39
  "sass-loader": "^7.1.0",
@@ -6,8 +6,8 @@ function getHttp() {
6
6
  return window.$http
7
7
  }
8
8
  const processService = {
9
- fetchFormFields(formCode, formVersion) {
10
- getHttp().get(Vue.prototype.baseAPI + '/wf-editor/workflow-editors/form-fields?formCode=' + formCode + '&formVersion=' + formVersion).then(resultFields => {
9
+ fetchFormFields(formCode, formVersion, publishVersion) {
10
+ getHttp().get(Vue.prototype.baseAPI + '/wf-editor/workflow-editors/form-fields?formCode=' + formCode + '&formVersion=' + formVersion + '&publishVersion=' + publishVersion).then(resultFields => {
11
11
  const formFields = resultFields.formFields
12
12
  const subFormFields = resultFields.subFormFields
13
13
  getStore().commit('wfEditor/setFormCode', formCode)
@@ -53,7 +53,7 @@
53
53
  <el-row>
54
54
  <el-col :span="12">
55
55
  <el-form-item :label="$t('workflowEditor.process.system')" prop="model.systemCode" :rules="[requiredRule]">
56
- <el-select v-model="model.systemCode" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @change="changeSystem">
56
+ <el-select v-model="model.systemCode" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @change="changeSystem(model.systemCode, null)">
57
57
  <el-option
58
58
  v-for="item in allSystems"
59
59
  :key="item.code"
@@ -65,7 +65,7 @@
65
65
  </el-col>
66
66
  <el-col :span="12">
67
67
  <el-form-item :label="$t('workflowEditor.process.systemVersion')" :rules="[requiredRule]">
68
- <el-select v-model="systemPublishVersion" :placeholder="$t('workflowEditorMessage.pleaseSelect')">
68
+ <el-select v-model="systemPublishVersion" :placeholder="$t('workflowEditorMessage.pleaseSelect')" @change="changeVersion">
69
69
  <el-option
70
70
  v-for="item in systems"
71
71
  :key="item.publishVersion"
@@ -101,6 +101,7 @@ import processService from '../../process-service'
101
101
  import { getI18n } from '../../../../workflow-editor/src/util'
102
102
  import i18nInput from '../common/i18n-input'
103
103
  import { getUsername } from 'imatrix-ui/src/utils/auth'
104
+ import authApi from 'imatrix-ui/src/utils/auth-api'
104
105
  export default {
105
106
  name: 'BasicProperties',
106
107
  components: {
@@ -144,19 +145,19 @@ export default {
144
145
  isSelectAdmin: false,
145
146
  selectedForm: [],
146
147
  systemPublishVersion: null,
148
+ sysCode: null,
147
149
  systems: []
148
150
 
149
151
  }
150
152
  },
151
153
  computed: {
152
154
  ...mapGetters('wfEditor', [
153
- 'systemVersion'
155
+ 'systemVersion', 'systemCode'
154
156
  ])
155
157
  },
156
158
  created() {
157
- this.systemPublishVersion = this.systemVersion
158
159
  this.getAdminNameWhenUpdate()
159
- this.listAllForms()
160
+ // this.listAllForms()
160
161
  this.listAllProcessTypes()
161
162
  this.listAllSystems()
162
163
  this.listAllBranches()
@@ -166,7 +167,16 @@ export default {
166
167
  this.model.creator = getUsername()
167
168
  }
168
169
  this.setProcessCode(this.formModel.code)
169
- this.setSystemCode(this.model.systemCode)
170
+ if (this.model.systemCode) {
171
+ // 编辑修改流程
172
+ this.setSystemCode(this.model.systemCode)
173
+ } else {
174
+ // 新建流程, model systemCode为空
175
+ this.model.systemCode = this.systemCode
176
+ }
177
+ this.systemPublishVersion = parseInt(authApi.getSessionCache('wf_editor_systemVersion'))
178
+ this.changeSystem(this.systemCode, this.systemPublishVersion)
179
+ this.listAllForms(this.systemCode, this.systemPublishVersion)
170
180
  },
171
181
  mounted() {
172
182
  // 支持.snyc修饰符的写法
@@ -198,7 +208,7 @@ export default {
198
208
  this.model.formCode = formInfo.substring(formInfo.indexOf('/') + 1, formInfo.lastIndexOf('/'))
199
209
  this.model.formVersion = formInfo.substring(formInfo.lastIndexOf('/') + 1)
200
210
  // 表单改变时,重新获取表单字段并放到vuex中
201
- processService.fetchFormFields(this.model.formCode, this.model.formVersion)
211
+ processService.fetchFormFields(this.model.formCode, this.model.formVersion, this.systemPublishVersion)
202
212
  },
203
213
  // 弹出人员树
204
214
  selectAdmin() {
@@ -223,8 +233,8 @@ export default {
223
233
  this.isSelectAdmin = false
224
234
  },
225
235
  // 获得对应表单列表
226
- listAllForms() {
227
- this.$http.get(this.baseAPI + '/wf-editor/workflow-editors/forms').then(systemAndForms => {
236
+ listAllForms(systemCode, publishVersion) {
237
+ this.$http.get(this.baseAPI + '/wf-editor/workflow-editors/forms?systemCode=' + systemCode + '&publishVersion=' + publishVersion).then(systemAndForms => {
228
238
  // 设置表单信息
229
239
  const selectedFormInfo = this.model.formCode + '/' + this.model.formVersion
230
240
  // 修改时,获得默认选中的表单项
@@ -294,7 +304,9 @@ export default {
294
304
  setI18nValue(i18nKey) {
295
305
  this.model.i18nKey = i18nKey
296
306
  },
297
- changeSystem(systemCode) {
307
+ changeSystem(systemCode, systemPublishVersion) {
308
+ this.systemPublishVersion = systemPublishVersion
309
+ this.allForms = []
298
310
  this.$http.get(this.baseAPI + '/wf-editor/systems/getPublishVersionsByCode/' + systemCode).then(result => {
299
311
  if (result) {
300
312
  this.systems = result
@@ -302,6 +314,9 @@ export default {
302
314
  this.systems = []
303
315
  }
304
316
  })
317
+ },
318
+ changeVersion() {
319
+ this.listAllForms(this.model.systemCode, this.systemPublishVersion)
305
320
  }
306
321
  }
307
322
  }
@@ -28,6 +28,7 @@
28
28
 
29
29
  // import modulePageService from '@/subsystems/mms/api/module-page'
30
30
  import Vue from 'vue'
31
+ import { mapGetters } from 'vuex'
31
32
 
32
33
  export default {
33
34
  props: {
@@ -43,6 +44,11 @@ export default {
43
44
  selection: []
44
45
  }
45
46
  },
47
+ computed: {
48
+ ...mapGetters('wfEditor', [
49
+ 'systemVersion'
50
+ ])
51
+ },
46
52
  watch: {
47
53
  conditionList: {
48
54
  handler(newValue, oldValue) {
@@ -53,7 +59,7 @@ export default {
53
59
  created() {
54
60
  this.baseURL = Vue.prototype.baseURL
55
61
  if (this.pageFormCode) {
56
- this.listURL = '/wf-editor/workflow-editors/modulePages/' + this.pageFormCode
62
+ this.listURL = '/wf-editor/workflow-editors/modulePages/' + this.pageFormCode + '/' + this.systemVersion
57
63
  }
58
64
  },
59
65
  methods: {
@@ -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: {
@@ -135,7 +136,7 @@ export default {
135
136
  },
136
137
  // 系统版本号,修改时流程定义中的系统版本号,例如:v1.0.0,新增不会使用该属性
137
138
  systemPublishVersion: {
138
- type: String,
139
+ type: Number,
139
140
  default: null
140
141
  }
141
142
  },
@@ -173,8 +174,9 @@ export default {
173
174
  }
174
175
  },
175
176
  created: function() {
176
- if (this.systemPublishVersion) {
177
- this.setSystemVersion(this.systemPublishVersion)
177
+ authApi.setSessionCache('wf_editor_systemVersion', this.systemPublishVersion)
178
+ if (this.systemCode) {
179
+ this.setSystemCode(this.systemCode)
178
180
  }
179
181
  // 打开或新建流程图时先清空画布,开发过程中代码热更新的时候可以避免节点重复
180
182
  this.clearCanvas()
@@ -194,7 +196,6 @@ export default {
194
196
  }
195
197
  },
196
198
  mounted: function() {
197
-
198
199
  },
199
200
  methods: {
200
201
  ...mapMutations('wfEditor', [
@@ -240,7 +241,7 @@ export default {
240
241
  const formVersion = processProperties.formVersion
241
242
  if (formCode && formCode !== '' && formVersion) {
242
243
  // 取出formFields放到vuex中
243
- processService.fetchFormFields(processProperties.formCode, processProperties.formVersion)
244
+ processService.fetchFormFields(processProperties.formCode, processProperties.formVersion, this.systemPublishVersion)
244
245
  }
245
246
  },
246
247
  packageUrlParam(url) {
@@ -316,7 +316,8 @@ const cn = {
316
316
  isNotNull: '不等于Null',
317
317
  defaultMailTemplate: '默认邮件模板',
318
318
  trustTask: '委托任务',
319
- subprocessIsSharedForm: '主子流程共用表单'
319
+ subprocessIsSharedForm: '主子流程共用表单',
320
+ systemVersion: '系统版本'
320
321
  },
321
322
  // 环节属性
322
323
  task: {
@@ -316,7 +316,8 @@ const en = {
316
316
  isNotNull: 'Is Not Null',
317
317
  defaultMailTemplate: 'Default Mail Template',
318
318
  trustTask: 'Trust Task',
319
- subprocessIsSharedForm: 'Main process and subprocess shared form'
319
+ subprocessIsSharedForm: 'Main process and subprocess shared form',
320
+ systemVersion: 'System Version'
320
321
  },
321
322
  // 环节属性
322
323
  task: {