cloud-module-bpm 6.7.0 → 6.9.0

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.7.0",
3
+ "version": "6.9.0",
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.7.0",
19
+ "cloud-module-base": "^6.9.0",
20
20
  "core-js": "^3.4.4",
21
21
  "css-loader": "^3.4.1",
22
22
  "element-ui": "^2.15.7",
@@ -5,10 +5,10 @@
5
5
  v-for="bpmBtn in MeritBPM.bpmBtns"
6
6
  :key="bpmBtn.id"
7
7
  :type="bpmBtn.type"
8
+ v-prevent-re-click
8
9
  :class="bpmBtn.id"
9
10
  @click="BPMEventBus('doSend', bpmBtn)"
10
- >{{ bpmBtn.name }}</el-button
11
- >
11
+ >{{ bpmBtn.name }}</el-button>
12
12
  <bpm-user-select
13
13
  :dialogVisible="MeritBPM.userSelectDialogVisible"
14
14
  :ruleEngine="ruleEngine"
@@ -81,10 +81,12 @@
81
81
  <script>
82
82
  import { MeritBPM, BPMEventBus } from '../utils/merit-bpm.js';
83
83
  import axios from 'cloud-module-base/packages/httpConfig/http';
84
+ import { preventReClick } from 'cloud-module-base/static/js/utils/preventReClick';
84
85
  export default {
85
86
  name: 'bpm-form-tools',
86
- data() {
87
+ data () {
87
88
  return {
89
+ // repetFlag: true,
88
90
  MeritBPM,
89
91
  bpmBtn: {},
90
92
  ruleEngine: {
@@ -101,7 +103,7 @@ export default {
101
103
  required: true
102
104
  }
103
105
  },
104
- created() {
106
+ created () {
105
107
  Object.assign(this.ruleEngine, { procDefKey: this.procDefKey });
106
108
  let id = MeritBPM.getUrlParameter('id') || '';
107
109
  let undoId = MeritBPM.getUrlParameter('undoId') || ''; //截取表单url中undoId, add by zhangyan,
@@ -117,7 +119,7 @@ export default {
117
119
  methods: {
118
120
  BPMEventBus,
119
121
  //初始化表单,返回值为业务数据对象
120
- bpmInit(businessData) {
122
+ bpmInit (businessData) {
121
123
  Object.assign(this.ruleEngine, businessData);
122
124
  if (businessData.id == null || businessData.id == '') {
123
125
  this.MeritBPM.initRuleEngine(this);
@@ -127,15 +129,15 @@ export default {
127
129
  this.MeritBPM.runRuleEngine(this, {}, {});
128
130
  }
129
131
  },
130
- getEventSendRead() {},
132
+ getEventSendRead () { },
131
133
 
132
- getBpmVar() {
134
+ getBpmVar () {
133
135
  return this.ruleEngine;
134
136
  },
135
- opinionCallback() {
137
+ opinionCallback () {
136
138
  this.$emit('opinion-Callback');
137
139
  },
138
- bpmAddOrUpdate(bpmBtn) {
140
+ bpmAddOrUpdate (bpmBtn) {
139
141
  var _this = this;
140
142
  // 初始化
141
143
  if (_this.ruleEngine.procInstId != null) {
@@ -146,12 +148,12 @@ export default {
146
148
  .post(
147
149
  '/api/engine/bpm/process/version/' + businessId + '/' + bpmVersion
148
150
  )
149
- .then(function(res) {
151
+ .then(function (res) {
150
152
  if (res.data.isDifferent == 'NoBusinessData') {
151
153
  _this.$alert('业务数据不存在!', '警告', {
152
154
  confirmButtonText: '确定',
153
155
  type: 'warning',
154
- callback: action => {}
156
+ callback: action => { }
155
157
  });
156
158
  } else if (res.data.isDifferent) {
157
159
  _this.$alert(
@@ -160,7 +162,7 @@ export default {
160
162
  {
161
163
  confirmButtonText: '确定',
162
164
  type: 'warning',
163
- callback: action => {}
165
+ callback: action => { }
164
166
  }
165
167
  );
166
168
  } else {
@@ -168,7 +170,7 @@ export default {
168
170
  _this.$emit('save', _this.bpmSaveAfter);
169
171
  }
170
172
  })
171
- .catch(function(err) {
173
+ .catch(function (err) {
172
174
  console.log(err);
173
175
  });
174
176
  } else {
@@ -177,11 +179,14 @@ export default {
177
179
  }
178
180
  },
179
181
 
180
- bpmSaveAfter(data, Func) {
182
+ bpmSaveAfter (data, Func) {
181
183
  let _this = this;
182
184
  this.customFun = Func;
183
185
  Object.assign(this.ruleEngine, data);
184
186
  this.ruleEngine.businessId = data.id;
187
+ // if (!this.ruleEngine.procInstId && !_this.repetFlag) {
188
+ // return;
189
+ // }
185
190
  //如果没有流程实例id 创建流程
186
191
  if (this.bpmBtn.id == 'bpmSaveOrUpdateBtn') {
187
192
  this.$message.success(_this.$t('base.operation.save_success'));
@@ -190,10 +195,11 @@ export default {
190
195
  this.ruleEngine.procInstId == undefined ||
191
196
  this.ruleEngine.procInstId == ''
192
197
  ) {
193
- this.MeritBPM.startProcess(this, this.bpmBtn, function(params) {
198
+ this.MeritBPM.startProcess(this, this.bpmBtn, function (params) {
194
199
  _this.bpmBtn.isSave = '1';
195
200
  _this.MeritBPM.doSend(_this, _this.bpmBtn);
196
201
  });
202
+ // this.repetFlag = false;
197
203
  } else {
198
204
  if (this.bpmBtn.id == 'bpmSaveOrUpdateBtn') {
199
205
  // 点击保存按钮
@@ -207,13 +213,13 @@ export default {
207
213
  },
208
214
 
209
215
  // 判断是否存在回调函数,如果存在,回调
210
- bpmCustomFunction() {
216
+ bpmCustomFunction () {
211
217
  if (this.customFun != undefined && typeof this.customFun == 'function') {
212
218
  this.customFun.apply();
213
219
  }
214
220
  },
215
221
  //关闭按钮事件
216
- bpmClose() {
222
+ bpmClose () {
217
223
  //关闭按钮事件,如果有父窗口,则调用父窗口的监听事件
218
224
  if (window.opener && window.opener.refreshBpmGrid) {
219
225
  window.opener.refreshBpmGrid();