sasp-flow-render 1.1.26-decoupling → 1.1.28-decoupling

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": "sasp-flow-render",
3
- "version": "1.1.26-decoupling",
3
+ "version": "1.1.28-decoupling",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -251,6 +251,7 @@ let objResult = {
251
251
  saveDataFlowDrafts: "/flowEngine/saveDataFlowDrafts",
252
252
  startFlow: "/flowEngine/startFlow",
253
253
  completeTask: "/flowEngine/completeTask",
254
+ saveFlowDraft: "/flowEngine/saveFlowDraft",
254
255
  }
255
256
  };
256
257
 
@@ -641,6 +641,7 @@
641
641
  saveFormInfo: this.saveFormInfo,
642
642
  getFormInfo: this.getFormInfo,
643
643
  forceUpdateComponent: this.forceUpdateComponent,
644
+ setParams:this.setParams
644
645
  }
645
646
  });
646
647
 
@@ -23,6 +23,12 @@ class WorkflowEngine {
23
23
  this.currentInst = {};
24
24
  this.installListObj = this.$this.EVENT_PLUGIN['installEventObj']||{}; //已经安装的流程事件
25
25
  this.loginUser = this.$this.FLOW_CACHE_GLOBAL.getLoginUser();
26
+ if(!this.loginUser.id){ // 判断是否是表单独立登录
27
+ if(this.$this.FORM_USER_GLOBAL){
28
+ this.loginUser = this.$this.FORM_USER_GLOBAL.getLoginUser();
29
+ }
30
+ }
31
+
26
32
  this.skipAutoInit = false;
27
33
  if(flowAttrs.skipAutoInit){
28
34
  this.skipAutoInit = flowAttrs.skipAutoInit;
@@ -1843,6 +1849,13 @@ class WorkflowEngine {
1843
1849
  })
1844
1850
  }
1845
1851
 
1852
+ syncFlowDialogPrams(params){
1853
+ Object.keys(params).forEach(key => {
1854
+ this[key] = params[key];
1855
+ });
1856
+ this.setParams && this.setParams(params);
1857
+ }
1858
+
1846
1859
  /**
1847
1860
  * 恢复方法
1848
1861
  */
@@ -2206,7 +2219,14 @@ class WorkflowEngine {
2206
2219
  })
2207
2220
  }
2208
2221
 
2209
- open(dataId,type,callback){
2222
+ /**
2223
+ *
2224
+ * @param dataId 数据ID
2225
+ * @param type 操作类型,view-查看、update-编辑
2226
+ * @param forceOpen 是否强制打开,默认false,为true时可以将非工作流列表数据自动插入草稿数据并打开
2227
+ * @param callback 回调函数
2228
+ */
2229
+ open(dataId,type,forceOpen,callback){
2210
2230
  if(!this.tableviewId){
2211
2231
  this.$this.$message.error("请先设置tableviewId");
2212
2232
  return;
@@ -2220,12 +2240,11 @@ class WorkflowEngine {
2220
2240
  formInfo: this.formInfo
2221
2241
  });
2222
2242
  if(dataId){
2223
- this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:this.flowId,dataId:dataId}).then(res => {
2224
- if(!res.data){
2243
+ this.getDataByDataId(dataId,forceOpen).then(rowData => {
2244
+ if(!rowData){
2225
2245
  this.$this.$message.error("未获取到此流程数据!");
2226
2246
  return;
2227
2247
  }
2228
- let rowData = res.data || {};
2229
2248
  if(type !== "view" && rowData.operateAuth === "0"){
2230
2249
  console.log("当前登录用户无此流程数据操作权限,已自动切换为查看!");
2231
2250
  type = "view";
@@ -2260,6 +2279,53 @@ class WorkflowEngine {
2260
2279
  })
2261
2280
  }
2262
2281
 
2282
+ /**
2283
+ * 根据数据ID获取流程数据
2284
+ * @param dataId
2285
+ * @returns {Promise<unknown>}
2286
+ */
2287
+ getDataByDataId(dataId,forceOpen){
2288
+ return new Promise(resolve => {
2289
+ this.getFlowInstByDataId(dataId).then(rowData => {
2290
+ if(!rowData) {
2291
+ if (forceOpen) {
2292
+ this.$this.axios.post(this.$this.api.flowEngine.saveFlowDraft, {
2293
+ flowId: this.flowId,
2294
+ dataId: dataId,
2295
+ userCode: this.loginUser.id
2296
+ }).then(flowDraftRes => {
2297
+ let flowDraftData = flowDraftRes.data || {};
2298
+ if (flowDraftData.requestStatus === "1") {
2299
+ this.getFlowInstByDataId(dataId).then(rowData => {
2300
+ resolve(rowData);
2301
+ });
2302
+ }else{
2303
+ resolve(false);
2304
+ }
2305
+ });
2306
+ }else{
2307
+ resolve(false);
2308
+ }
2309
+ }else{
2310
+ resolve(rowData);
2311
+ }
2312
+ })
2313
+ })
2314
+ }
2315
+
2316
+ getFlowInstByDataId(dataId){
2317
+ return new Promise(resolve => {
2318
+ this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:this.flowId,dataId:dataId}).then(res => {
2319
+ if(!res.data){
2320
+ resolve(false);
2321
+ return;
2322
+ }
2323
+ let rowData = res.data || {};
2324
+ resolve(rowData);
2325
+ });
2326
+ })
2327
+ }
2328
+
2263
2329
  openFlowDialog(args){
2264
2330
  this.$flowDialog.openFlowDialog(args);
2265
2331
  }
@@ -645,6 +645,11 @@ export default {
645
645
  if(this.flowNextOperation) {
646
646
  this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
647
647
  }
648
+ this.workFlowUtil.syncFlowDialogPrams({
649
+ chooseNextUserId: this.chooseNextUserId,
650
+ chooseNextUserName: this.chooseNextUserName,
651
+ chooseNextUserIdObj: this.chooseNextUserIdObj
652
+ });
648
653
  let params = {"SASP_FLOW_USE_VARIABLES":"yes"};
649
654
  Object.assign(params,this.flowParams || {},obj);
650
655
  this.saspFlowAxios.post(this.api.plFlowInst.executeNextStep,params).then(res => {