cloud-module-bpm 6.4.0 → 6.4.3

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": "cloud-module-bpm",
3
- "version": "6.4.0",
3
+ "version": "6.4.3",
4
4
  "description": " bpm base lib",
5
5
  "main": "dist/cloud-module-bpm.umd.min.js",
6
6
  "author": "wujx",
@@ -16,7 +16,7 @@
16
16
  "axios": "0.19.0",
17
17
  "babel-loader": "^8.0.6",
18
18
  "babel-polyfill": "^6.26.0",
19
- "cloud-module-base": "6.4.0",
19
+ "cloud-module-base": "^6.4.0",
20
20
  "core-js": "^3.4.4",
21
21
  "css-loader": "^3.4.1",
22
22
  "element-ui": "^2.13.2",
@@ -89,8 +89,8 @@ export default {
89
89
  bpmBtn: {},
90
90
  ruleEngine: {
91
91
  businessId: '', //流程业务数据id
92
- procInstId: undefined,//流程实例id
93
- undoId:''//待办业务id
92
+ procInstId: undefined, //流程实例id
93
+ undoId: '' //待办业务id
94
94
  }
95
95
  };
96
96
  },
@@ -104,11 +104,13 @@ export default {
104
104
  created() {
105
105
  Object.assign(this.ruleEngine, { procDefKey: this.procDefKey });
106
106
  let id = MeritBPM.getUrlParameter('id') || '';
107
- let undoId = MeritBPM.getUrlParameter('undoId') || '';//截取表单url中undoId, add by zhangyan,
107
+ let undoId = MeritBPM.getUrlParameter('undoId') || ''; //截取表单url中undoId, add by zhangyan,
108
+ let params = MeritBPM.getUrlParameter('params') || ''; // 截取路径中传入的参数
108
109
  //打开表单之前,触发外层的init事件。业务模块获取业务数据对象
109
110
  this.$emit('init', {
110
111
  id: id.replace('businessId', ''),
111
- undoId: undoId.replace('undoId', ''), //add by zhangyan
112
+ undoId: undoId.replace('undoId', ''), //add by zhangyan
113
+ params: params.replace('params', ''),
112
114
  callback: this.bpmInit
113
115
  });
114
116
  },
@@ -121,7 +123,7 @@ export default {
121
123
  this.MeritBPM.initRuleEngine(this);
122
124
  } else {
123
125
  this.ruleEngine.businessId = businessData.id;
124
- this.ruleEngine.undoId = businessData.undoId; //add by zhangyan
126
+ this.ruleEngine.undoId = businessData.undoId; //add by zhangyan
125
127
  this.MeritBPM.runRuleEngine(this, {}, {});
126
128
  }
127
129
  },
@@ -141,7 +143,9 @@ export default {
141
143
  var bpmVersion = _this.ruleEngine.runtime.mainForm.bpmVersion;
142
144
  var businessId = _this.ruleEngine.businessId;
143
145
  axios['bpm-engine']
144
- .post('/api/engine/bpm/process/version/' + businessId + '/' + bpmVersion)
146
+ .post(
147
+ '/api/engine/bpm/process/version/' + businessId + '/' + bpmVersion
148
+ )
145
149
  .then(function(res) {
146
150
  if (res.data.isDifferent == 'NoBusinessData') {
147
151
  _this.$alert('业务数据不存在!', '警告', {
@@ -150,14 +154,18 @@ export default {
150
154
  callback: action => {}
151
155
  });
152
156
  } else if (res.data.isDifferent) {
153
- _this.$alert('数据已被' + res.data.lockUserName + '修改!', '警告', {
154
- confirmButtonText: '确定',
155
- type: 'warning',
156
- callback: action => {}
157
- });
157
+ _this.$alert(
158
+ '数据已被' + res.data.lockUserName + '修改!',
159
+ '警告',
160
+ {
161
+ confirmButtonText: '确定',
162
+ type: 'warning',
163
+ callback: action => {}
164
+ }
165
+ );
158
166
  } else {
159
167
  //业务应用保存数据的方法,保存后回调方法
160
- _this.$emit('save', _this.bpmSaveAfter);
168
+ _this.$emit('save', _this.bpmSaveAfter, bpmBtn);
161
169
  }
162
170
  })
163
171
  .catch(function(err) {
@@ -165,7 +173,7 @@ export default {
165
173
  });
166
174
  } else {
167
175
  //业务应用保存数据的方法,保存后回调方法
168
- _this.$emit('save', _this.bpmSaveAfter);
176
+ _this.$emit('save', _this.bpmSaveAfter, bpmBtn);
169
177
  }
170
178
  },
171
179
 
@@ -178,7 +186,10 @@ export default {
178
186
  if (this.bpmBtn.id == 'bpmSaveOrUpdateBtn') {
179
187
  this.$message.success(_this.$t('base.operation.save_success'));
180
188
  }
181
- if (this.ruleEngine.procInstId == undefined || this.ruleEngine.procInstId == '') {
189
+ if (
190
+ this.ruleEngine.procInstId == undefined ||
191
+ this.ruleEngine.procInstId == ''
192
+ ) {
182
193
  this.MeritBPM.startProcess(this, this.bpmBtn, function(params) {
183
194
  _this.bpmBtn.isSave = '1';
184
195
  _this.MeritBPM.doSend(_this, _this.bpmBtn);
@@ -2,6 +2,7 @@
2
2
  <el-col :span="7" class="cloud-bpm-grid-buttons">
3
3
  <el-button
4
4
  v-if="MeritBPM.procCreatePermit"
5
+ :disabled="isDisabledAddButton"
5
6
  class="cloud-bpm-grid-button"
6
7
  type="primary"
7
8
  icon="el-icon-plus"
@@ -85,6 +86,15 @@ export default {
85
86
  isShowButton: {
86
87
  type: Boolean,
87
88
  default: true
89
+ },
90
+ isDisabledAddButton: {
91
+ type: Boolean,
92
+ default: false,
93
+ required: false
94
+ },
95
+ params: {
96
+ type: String,
97
+ required: false
88
98
  }
89
99
  },
90
100
  computed: {
@@ -126,7 +136,7 @@ export default {
126
136
  },
127
137
  //流程新建方法
128
138
  createBpm() {
129
- MeritBPM.create(this, this.procDefKey, {});
139
+ MeritBPM.create(this, this.procDefKey, { params: this.params });
130
140
  },
131
141
  //删除流程方法
132
142
  deleteBpm() {
@@ -2,6 +2,7 @@
2
2
  <el-col :span="7" class="cloud-bpm-grid-buttons">
3
3
  <el-button
4
4
  v-if="MeritBPM.procCreatePermit"
5
+ :disabled="isDisabledAddButton"
5
6
  class="cloud-bpm-grid-button"
6
7
  type="primary"
7
8
  icon="el-icon-plus"
@@ -111,6 +112,15 @@ export default {
111
112
  isShowButton: {
112
113
  type: Boolean,
113
114
  default: true
115
+ },
116
+ isDisabledAddButton: {
117
+ type: Boolean,
118
+ default: false,
119
+ required: false
120
+ },
121
+ params: {
122
+ type: String,
123
+ required: false
114
124
  }
115
125
  },
116
126
  computed: {
@@ -159,7 +169,7 @@ export default {
159
169
  },
160
170
  //流程新建方法
161
171
  createBpm() {
162
- MeritBPM.create(this, this.procDefKey, {});
172
+ MeritBPM.create(this, this.procDefKey, { params: this.params });
163
173
  },
164
174
  //删除流程方法
165
175
  deleteBpm() {
@@ -211,11 +211,12 @@ export default {
211
211
  //关闭人员选择对话框
212
212
  handleClose() {
213
213
  this.procOpinion.content = undefined;
214
+ this.$refs.procOpinion.resetFields();
214
215
  this.$emit('dialog-close', this.dialogVisible);
215
216
  },
216
217
  handleSave() {
217
218
  let _this = this;
218
- if (_this.procOpinion.content.length > 255) {
219
+ if (_this.procOpinion.content.length > 200) {
219
220
  return this.$message.error(
220
221
  _this.$t('bpm.opinion.opinion_content_beyond')
221
222
  );
@@ -247,7 +248,7 @@ export default {
247
248
  },
248
249
  handlePublish() {
249
250
  let _this = this;
250
- if (_this.procOpinion.content.length > 255) {
251
+ if (_this.procOpinion.content.length > 200) {
251
252
  return this.$message.error(
252
253
  _this.$t('bpm.opinion.opinion_content_beyond')
253
254
  );
@@ -206,7 +206,7 @@ export default {
206
206
  this.procOpinion.content = opinion;
207
207
  return;
208
208
  }
209
- if (this.procOpinion.content.length < 255) {
209
+ if (this.procOpinion.content.length + opinion.length < 200) {
210
210
  this.procOpinion.content += ';' + opinion;
211
211
  return;
212
212
  }
@@ -18,13 +18,16 @@ var MeritBPM = {
18
18
  */
19
19
  MeritBPM.create = function(that, procDefKey, params, callback) {
20
20
  axios['bpm-engine']
21
- .post('/api/engine/bpm/ruleengine/init/' + procDefKey, params)
21
+ .post('/api/engine/bpm/ruleengine/init/' + procDefKey, {})
22
22
  .then(function(res) {
23
23
  if (res.success) {
24
24
  if (typeof callback == 'function') {
25
25
  callback(res);
26
26
  } else if (res.data != null) {
27
27
  let url = res.data.runtime.formLink;
28
+ if (params.params != null && params.params != '') {
29
+ url = url + '&params=' + params.params;
30
+ }
28
31
  // var iTop = (window.screen.availHeight - 30 - 700) / 2;
29
32
  // var iLeft = (window.screen.availWidth - 10 - 900) / 2;
30
33
  // var features =
@@ -641,30 +644,36 @@ MeritBPM.openProcTrackWindow = function(that, params) {
641
644
  axios['bpm-engine'].post('/api/engine/track/port', {}).then(function(res) {
642
645
  var port = res.data;
643
646
  var url = '';
644
- if (port == '80') {
645
- url =
646
- 'http://' +
647
- window.location.hostname +
648
- '/bpm/proctrack/index.html?procInstId=' +
649
- params.procInstId +
650
- '&procDefId=' +
651
- params.procDefId +
652
- '&IsShielding=' +
653
- shielding;
654
- } else {
655
- url =
656
- 'http://' +
657
- window.location.hostname +
658
- ':' +
659
- port +
660
- '/bpm/proctrack/index.html?procInstId=' +
661
- params.procInstId +
662
- '&procDefId=' +
663
- params.procDefId +
664
- '&IsShielding=' +
665
- shielding;
666
- }
667
- MeritBPM.openWindow(url, params);
647
+
648
+ axios['bpm-engine'].post('/api/engine/track/http', {}).then(function(res) {
649
+ var http = res.data;
650
+ if (port == '80') {
651
+ url =
652
+ http +
653
+ '://' +
654
+ window.location.hostname +
655
+ '/bpm/proctrack/index.html?procInstId=' +
656
+ params.procInstId +
657
+ '&procDefId=' +
658
+ params.procDefId +
659
+ '&IsShielding=' +
660
+ shielding;
661
+ } else {
662
+ url =
663
+ http +
664
+ '://' +
665
+ window.location.hostname +
666
+ ':' +
667
+ port +
668
+ '/bpm/proctrack/index.html?procInstId=' +
669
+ params.procInstId +
670
+ '&procDefId=' +
671
+ params.procDefId +
672
+ '&IsShielding=' +
673
+ shielding;
674
+ }
675
+ MeritBPM.openWindow(url, params);
676
+ });
668
677
  });
669
678
  };
670
679
 
@@ -806,7 +815,7 @@ MeritBPM.validatePermit = function(that, procDefKey, callback) {
806
815
  * 拼接参数/bpm-demo/example/index.html#/formEdit?id=businessId&undoId=undoId
807
816
  */
808
817
  MeritBPM.getUrlParameter = function(name) {
809
- var query = window.location.hash.substring(
818
+ var query = window.location.href.substring(
810
819
  window.location.hash.indexOf('?') + 1
811
820
  );
812
821
  var vars = query.split('&');