sasp-flow-render 1.0.3 → 1.0.5

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/index.js CHANGED
@@ -108,7 +108,7 @@ let initAxios = (Vue, props) => {
108
108
  const install = function (Vue, opts = {}) {
109
109
  SaspModuleUtil.registerModuleName(Vue, "flow");
110
110
 
111
- createAxiosIfNotExists(Vue,opts);
111
+ // createAxiosIfNotExists(Vue,opts);
112
112
 
113
113
  Vue.prototype.USE_SASP_FLOW = true; // 说明安装了流程插件,我们使用此参数作为表单对接的依据
114
114
  Vue.use(flowInstall, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasp-flow-render",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -14,7 +14,7 @@ const install = function (Vue, opts = {}) {
14
14
 
15
15
  Vue.use(flowUserGlobal,opts);
16
16
  Vue.prototype.FLOW_GLOBAL = flowGlobal;
17
- Vue.prototype.CACHE_GLOBAL = cacheGlobal;
17
+ Vue.prototype.FLOW_CACHE_GLOBAL = cacheGlobal;
18
18
  Vue.prototype.INTER_CACHE = interfaceCache;
19
19
  Vue.prototype.FLOW_USER_GLOBAL = flowUserGlobal;
20
20
  Object.assign(Vue.prototype.api, apiFlow.apis);
@@ -236,7 +236,7 @@
236
236
  },
237
237
  //初始化用户信息
238
238
  initUserInfo(){
239
- this.loginUser = this.CACHE_GLOBAL.getLoginUser();
239
+ this.loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser();
240
240
  }
241
241
  }
242
242
  }
@@ -134,6 +134,11 @@
134
134
  流转记录
135
135
  </el-button>
136
136
  </template>
137
+ <el-button size="small" v-if="scope.row.linkProcId && tabType == 'draft'"
138
+ @click="deleteRowFlow(scope.row)"
139
+ icon="el-icon-delete" type="danger">
140
+ 删除
141
+ </el-button>
137
142
  </template>
138
143
  </el-table-column>
139
144
  </el-table>
@@ -375,8 +380,8 @@
375
380
  noClearSearchColumns: this.initNoClearSearch(),
376
381
  initNoSearch: true,
377
382
  }),
378
- loginUser: this.CACHE_GLOBAL.getLoginUser(),//当前登录用户
379
- userDept: this.CACHE_GLOBAL.getLoginDept(),
383
+ loginUser: this.FLOW_CACHE_GLOBAL.getLoginUser(),//当前登录用户
384
+ userDept: this.FLOW_CACHE_GLOBAL.getLoginDept(),
380
385
  flowStatusObj: {//流程状态
381
386
  all: '',
382
387
  draft: 0,
@@ -477,6 +477,7 @@
477
477
  initFormInfo:{type: Function,default:null}, // 添加修改打开表单时执行的事件
478
478
  saveFormInfo:{type: Function,default:null}, // 保存表单时执行的事件
479
479
  dataPermis:{type:String,default:''},
480
+ flowNextOperation:{type: Function,default:null} // 流程下一步时的参数回调事件
480
481
  },
481
482
  data() {
482
483
  let vm = this;
@@ -887,8 +888,8 @@
887
888
  }
888
889
  this.agentFormObj.flowId = this.flowData.flowId;
889
890
  this.isShowAgentSet = false;
890
- this.loginUser = this.CACHE_GLOBAL.getLoginUser();
891
- this.userDept = this.CACHE_GLOBAL.getLoginDept();
891
+ this.loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser();
892
+ this.userDept = this.FLOW_CACHE_GLOBAL.getLoginDept();
892
893
  this.initTabOpts(); // 初始化外部选项卡权限
893
894
 
894
895
  this.getFlowInfo().then(res => {
@@ -953,7 +954,7 @@
953
954
  }
954
955
  // console.log(currentNode);
955
956
  return new Promise(resolve => {
956
- this.initFormInfo && this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData.id);
957
+ this.initFormInfo && this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
957
958
  resolve();
958
959
  })
959
960
  },
@@ -1707,6 +1708,9 @@
1707
1708
  nextNodeId: this.nextNode.id,
1708
1709
  nextNodeKey: this.nextNode.nodeLinkId,
1709
1710
  }
1711
+ if(this.flowNextOperation) {
1712
+ this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
1713
+ }
1710
1714
  let params = {};
1711
1715
  Object.assign(params,this.flowParams || {},obj);
1712
1716
  this.axios.post(this.api.plFlowInst.executeNextStep,params).then(res => {
@@ -1934,6 +1938,15 @@
1934
1938
  replaceVal = dataObj[fieldId + "_sequence"];
1935
1939
  }
1936
1940
  flowSummary = this.platStringUtil.replaceAll(flowSummary, "${" + fieldName + "}", replaceVal);
1941
+ }else if(fieldName && dataObj.hasOwnProperty(fieldName)){
1942
+ let replaceVal = dataObj[fieldName];
1943
+ if(dataObj[fieldName + "_SASP_SYS_DATA"]){
1944
+ replaceVal = dataObj[fieldName+ "_SASP_SYS_DATA"];
1945
+ }
1946
+ if(dataObj[fieldName + "_sequence"]){ // 自增序列
1947
+ replaceVal = dataObj[fieldName + "_sequence"];
1948
+ }
1949
+ flowSummary = this.platStringUtil.replaceAll(flowSummary, "${" + fieldName + "}", replaceVal);
1937
1950
  }else{
1938
1951
  flowSummary = this.platStringUtil.replaceAll(flowSummary, "${" + fieldName + "}", "");
1939
1952
  }
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <flow-inst-tab :flow-id="useFlowId" :userArr="userArr" :userMap="userMap"
3
3
  :operateRootArr="operateArr" :dataPermis="dataPermis"
4
- :initFormInfo="initFormInfo" :saveFormInfo="saveFormInfo" :class='flowViewMainClass'>
4
+ :initFormInfo="initFormInfo" :saveFormInfo="saveFormInfo" :class='flowViewMainClass'
5
+ :flow-next-operation="flowNextOperation">
5
6
  <template slot="formInfo">
6
7
  <slot name="formInfo"></slot>
7
8
  </template>
@@ -20,6 +21,7 @@
20
21
  operateArr:{type:Array,default:null},
21
22
  initFormInfo:{type: Function,default:null}, // 添加修改打开表单时执行的事件
22
23
  saveFormInfo:{type: Function,default:null}, // 保存表单时执行的事件
24
+ flowNextOperation:{type: Function,default:null} // 流程下一步时的参数回调事件
23
25
  },
24
26
  data(){
25
27
  return {
@@ -68,7 +70,7 @@
68
70
  },
69
71
  init(){
70
72
  if(this.loginUser){
71
- this.CACHE_GLOBAL.setLoginUser(this.loginUser);
73
+ this.FLOW_CACHE_GLOBAL.setLoginUser(this.loginUser);
72
74
  }else{
73
75
  let loginUser = {};
74
76
  if(this.userId){
@@ -79,7 +81,7 @@
79
81
  if(this.userName){
80
82
  loginUser.userName = this.userName;
81
83
  }
82
- this.CACHE_GLOBAL.setLoginUser(loginUser);
84
+ this.FLOW_CACHE_GLOBAL.setLoginUser(loginUser);
83
85
  }
84
86
  if(this.flowId){
85
87
  this.useFlowId = this.flowId;
@@ -178,4 +180,4 @@
178
180
 
179
181
  <style scoped>
180
182
 
181
- </style>
183
+ </style>
@@ -1,14 +1,12 @@
1
1
  <!--工作流菜单跳转-->
2
2
  <template>
3
3
  <div style="height: 100%">
4
- <flow-inst-tab v-if="isShow"
4
+ <flow-res-preview v-if="isShow"
5
5
  :default-tab="defaultTab"
6
6
  :flow-id="flowId"
7
7
  :operate-root-arr="operateRootArr"
8
- :data-permis="dataPermis"
9
- :flowobj="flowObj"
10
- :init-message-func="initMessageFunc">
11
- </flow-inst-tab>
8
+ :data-permis="dataPermis">
9
+ </flow-res-preview>
12
10
  </div>
13
11
  </template>
14
12
 
@@ -104,7 +102,7 @@
104
102
  }
105
103
  // let menuObj = window.menuIdToMenuObj[this.menuId] || {};
106
104
 
107
- let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
105
+ let loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser(); //获取当前用户
108
106
  //根据 当前用户查询 数据权限和操作权限
109
107
  //判断当前用户类型
110
108
  if(loginUser.userType == 'sup' || this.isCloudView){ //开发者
@@ -144,7 +142,7 @@
144
142
  this.RES_GLOBAL.getUserOwnMenuOpt().then(datas =>{
145
143
  if(datas){
146
144
  if(this.mesremind == "Y"){
147
- this.operateRootArr=[{powerCode:this.defaultTab}];
145
+ this.operateRootArr=[this.defaultTab];
148
146
  this.isShow = true;
149
147
  return;
150
148
  }
@@ -205,7 +203,7 @@
205
203
  operatePermisList.some(data =>{
206
204
  // 菜单与角色权限同时存在时可以显示
207
205
  if(item==data.id && menuOperatePermisList.indexOf(item) > -1){
208
- checkOperateKeysRoot.push(data);
206
+ checkOperateKeysRoot.push(data.powerCode);
209
207
  return data;
210
208
  }
211
209
  });
@@ -77,7 +77,7 @@
77
77
  //let menuObj = window.resourceToMemu[this.resourceId];
78
78
  //this.menuId = menuObj.id;
79
79
 
80
- let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
80
+ let loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser(); //获取当前用户
81
81
  //根据 当前用户查询 数据权限和操作权限
82
82
  //判断当前用户类型
83
83
  if(loginUser.userType == 'sup'){ //开发者
@@ -168,112 +168,112 @@ let eventObj = {}; //事件对象
168
168
  export default {
169
169
  name: "loadEventPlugin",
170
170
  installAll(){
171
- axios.post(apiFlow.apis.eventRule.findByVersion,{"eventTypes":"flow"}).then(res =>{ //查询流程相关事件规则
172
- if(res){
173
- Object.keys(diyEventObjs).forEach(key =>{
174
- //加载列格式化
175
- diyEventObjs[key].forEach(item =>{
176
- eventPlugin.preActiveEventRule(item);
177
- })
178
- });
179
- //加载系统事件规则
180
- Object.keys(sysEventObjs).forEach(key =>{
181
- //加载列格式化
182
- sysEventObjs[key].forEach(item =>{
183
- eventPlugin.installEventRule(item);
184
- })
185
- });
186
-
187
- (res.data || []).forEach(item =>{
188
- if(item.eventUse == '1' && item.dataSource == '2')
189
- {
190
- //将后台返回的配置字符串转换为config组件,渲染字符串转化为render组件
191
- let configStr = item.eventConfigurationStr; //配置文件字符串
192
- let renderStr = item.eventRenderStr; //渲染文件字符串
193
- let eventComp = {"id":item.eventKey,
194
- "name":item.eventName,
195
- "eventSource": item.eventSource,
196
- "eventType":item.eventType,
197
- "dataSource":item.dataSource,
198
- "config":null,
199
- "render":null};
200
- if(configStr){
201
- let configObj = JSON.parse(configStr);
202
- let tempComp = configObj["comp"];
203
- let method = configObj["method"];
204
- // 转化
205
- try {
206
- recoverComponent(method);
207
- }catch (e) {
208
- console.log(e);
209
- }
210
- assignLevel(tempComp,method);
211
- Object.assign(eventComp,{"config":tempComp});
212
- }
213
- if(renderStr){
214
- let renderObj = JSON.parse(renderStr);
215
- let tempComp = renderObj["comp"];
216
- let obj = renderObj["method"];
217
- recoverComponent(obj);
218
- assignLevel(tempComp,obj);
219
- Object.assign(eventComp,{"render":tempComp});
220
- }
221
- eventPlugin.installEventRule(eventComp); //执行注册
222
-
223
- function recoverComponent(result){
224
- Object.keys(result).forEach(key => {
225
- if(Array.isArray(result[key])){
226
- if(key == "beforeCreate" || key == "beforeDestroy"){
227
- result[key] = [];
228
- }else{
229
- result[key].forEach((item,index) => {
230
- let name = item.name || "a";
231
- result[key][index] = new Function("let " + name + " = "+ item +";return " + name + ";")();
232
- })
233
- }
234
- }else if (typeof result[key] === "object"){
235
- if(result[key]["beforeCreate"] && result[key]["beforeDestroy"]){
236
- recoverComponent(result[key]);
237
- }else{
238
- Object.keys(result[key]).forEach(temKey => {
239
- let name = result[key][temKey].name || temKey;
240
- if(Number(name) || Number(name) === 0){
241
- name = "a";
242
- }
243
- result[key][temKey] = new Function("let " + name + " = " + result[key][temKey] +";return " + name + ";")();
244
- })
245
- }
246
- }else{
247
- let name = result[key].name || key;
248
- result[key] = new Function("let " + name + " = " + result[key] +";return " + name + ";")();
249
- }
250
- })
251
- }
252
- // 多级对象复制方法
253
- function assignLevel(target,source){
254
- let value = {};
255
- Object.keys(target).forEach(key => {
256
- if(typeof target[key] === "object" && target[key]["beforeCreate"] && target[key]["beforeDestroy"]){
257
- value[key] = target[key];
258
- assignLevel(value[key],source[key]);
259
- delete target[key];
260
- }
261
- })
262
- Object.assign(target,source,value);
263
- }
264
- }
265
- else if(item.dataSource == '1') { //数据库已经保存得组件注册
266
- Object.keys(diyEventObjs).forEach(key => {
267
- diyEventObjs[key].forEach(comp =>{
268
- if(comp.id == item.eventKey){
269
- eventPlugin.installEventRule(comp);//全局注册
270
- }
271
- });
272
- });
273
- }
274
- });
275
- }
276
- });
171
+ // axios.post(apiFlow.apis.eventRule.findByVersion,{"eventTypes":"flow"}).then(res =>{ //查询流程相关事件规则
172
+ // if(res){
173
+ // Object.keys(diyEventObjs).forEach(key =>{
174
+ // //加载列格式化
175
+ // diyEventObjs[key].forEach(item =>{
176
+ // eventPlugin.preActiveEventRule(item);
177
+ // })
178
+ // });
179
+ // //加载系统事件规则
180
+ // Object.keys(sysEventObjs).forEach(key =>{
181
+ // //加载列格式化
182
+ // sysEventObjs[key].forEach(item =>{
183
+ // eventPlugin.installEventRule(item);
184
+ // })
185
+ // });
186
+ //
187
+ // (res.data || []).forEach(item =>{
188
+ // if(item.eventUse == '1' && item.dataSource == '2')
189
+ // {
190
+ // //将后台返回的配置字符串转换为config组件,渲染字符串转化为render组件
191
+ // let configStr = item.eventConfigurationStr; //配置文件字符串
192
+ // let renderStr = item.eventRenderStr; //渲染文件字符串
193
+ // let eventComp = {"id":item.eventKey,
194
+ // "name":item.eventName,
195
+ // "eventSource": item.eventSource,
196
+ // "eventType":item.eventType,
197
+ // "dataSource":item.dataSource,
198
+ // "config":null,
199
+ // "render":null};
200
+ // if(configStr){
201
+ // let configObj = JSON.parse(configStr);
202
+ // let tempComp = configObj["comp"];
203
+ // let method = configObj["method"];
204
+ // // 转化
205
+ // try {
206
+ // recoverComponent(method);
207
+ // }catch (e) {
208
+ // console.log(e);
209
+ // }
210
+ // assignLevel(tempComp,method);
211
+ // Object.assign(eventComp,{"config":tempComp});
212
+ // }
213
+ // if(renderStr){
214
+ // let renderObj = JSON.parse(renderStr);
215
+ // let tempComp = renderObj["comp"];
216
+ // let obj = renderObj["method"];
217
+ // recoverComponent(obj);
218
+ // assignLevel(tempComp,obj);
219
+ // Object.assign(eventComp,{"render":tempComp});
220
+ // }
221
+ // eventPlugin.installEventRule(eventComp); //执行注册
222
+ //
223
+ // function recoverComponent(result){
224
+ // Object.keys(result).forEach(key => {
225
+ // if(Array.isArray(result[key])){
226
+ // if(key == "beforeCreate" || key == "beforeDestroy"){
227
+ // result[key] = [];
228
+ // }else{
229
+ // result[key].forEach((item,index) => {
230
+ // let name = item.name || "a";
231
+ // result[key][index] = new Function("let " + name + " = "+ item +";return " + name + ";")();
232
+ // })
233
+ // }
234
+ // }else if (typeof result[key] === "object"){
235
+ // if(result[key]["beforeCreate"] && result[key]["beforeDestroy"]){
236
+ // recoverComponent(result[key]);
237
+ // }else{
238
+ // Object.keys(result[key]).forEach(temKey => {
239
+ // let name = result[key][temKey].name || temKey;
240
+ // if(Number(name) || Number(name) === 0){
241
+ // name = "a";
242
+ // }
243
+ // result[key][temKey] = new Function("let " + name + " = " + result[key][temKey] +";return " + name + ";")();
244
+ // })
245
+ // }
246
+ // }else{
247
+ // let name = result[key].name || key;
248
+ // result[key] = new Function("let " + name + " = " + result[key] +";return " + name + ";")();
249
+ // }
250
+ // })
251
+ // }
252
+ // // 多级对象复制方法
253
+ // function assignLevel(target,source){
254
+ // let value = {};
255
+ // Object.keys(target).forEach(key => {
256
+ // if(typeof target[key] === "object" && target[key]["beforeCreate"] && target[key]["beforeDestroy"]){
257
+ // value[key] = target[key];
258
+ // assignLevel(value[key],source[key]);
259
+ // delete target[key];
260
+ // }
261
+ // })
262
+ // Object.assign(target,source,value);
263
+ // }
264
+ // }
265
+ // else if(item.dataSource == '1') { //数据库已经保存得组件注册
266
+ // Object.keys(diyEventObjs).forEach(key => {
267
+ // diyEventObjs[key].forEach(comp =>{
268
+ // if(comp.id == item.eventKey){
269
+ // eventPlugin.installEventRule(comp);//全局注册
270
+ // }
271
+ // });
272
+ // });
273
+ // }
274
+ // });
275
+ // }
276
+ // });
277
277
 
278
278
  }
279
279
  }