sasp-flow-render 1.0.6 → 1.0.8

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.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -15,11 +15,8 @@
15
15
  </el-form-item>
16
16
 
17
17
  <el-form-item label="当前处理人" v-if="isShow('flowQuery')">
18
- <el-select v-model="crud.searchForm.dealUserId" style="width: 90px;" filterable allow-create clearable>
19
- <el-option v-for="item in userArr" :key="item.id" :value="item.id" :label="item.userName">
20
-
21
- </el-option>
22
- </el-select>
18
+ <el-input v-model="crud.searchForm.dealUserName" style="width: 90px;">
19
+ </el-input>
23
20
  </el-form-item>
24
21
  <el-form-item label="当前任务" v-if="isShow('pending,processed,flowQuery')">
25
22
  <el-select v-model="crud.searchForm.currentNode" filterable clearable style="width: 130px;">
@@ -1275,6 +1275,7 @@
1275
1275
  flowInst = Object.assign(flowInst,{"version":this.flowDefine.releaseVersion,"isRelease":this.flowDefine.isRelease})
1276
1276
  }
1277
1277
  this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1278
+ this.runFlowEvt();
1278
1279
  resolve(instRes.data.operateObj);
1279
1280
  });
1280
1281
  }else{
@@ -1299,6 +1300,7 @@
1299
1300
  };
1300
1301
  }
1301
1302
  this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1303
+ this.runFlowEvt();
1302
1304
  resolve(instRes.data.operateObj);
1303
1305
  this.currentInst=instRes.data.operateObj;
1304
1306
  });
@@ -1306,82 +1308,98 @@
1306
1308
  })
1307
1309
  },
1308
1310
 
1311
+ runFlowEvt(){
1312
+ let type = this.flowBatchPendingDialog ? "batch" : "";
1313
+ let afterClickResult;
1314
+ let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1315
+ if (type == 'batch') {//批量处理 需处理tab页
1316
+ let ref = "batchTableForm"+this.batchUpdateFormInfo.activeName+"Ref";
1317
+ if(currentNodeObj.openEvent == '1'){
1318
+ afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId,ref);
1319
+ }
1320
+ }else {
1321
+ if(currentNodeObj.openEvent == '1'){
1322
+ afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId);
1323
+ }
1324
+ }
1325
+ },
1326
+
1309
1327
  /**
1310
1328
  * 保存草稿
1311
1329
  */
1312
1330
  saveData() {
1313
1331
  let type = this.flowBatchPendingDialog ? "batch" : "";
1314
1332
  return new Promise(resolve => {
1315
- let flowInstDataInfoRef = "";
1316
- if (type == 'batch') {
1317
- // 批量处理
1318
- flowInstDataInfoRef = this.$refs[`batchTableForm${this.batchUpdateFormInfo.activeName}Ref`];
1319
- flowInstDataInfoRef = flowInstDataInfoRef[0] || flowInstDataInfoRef;
1320
- } else {
1321
- flowInstDataInfoRef = this.$refs.flowInstDataInfo;
1322
- }
1323
- let startNodeKey = this.startNodeKeyObj[this.flowDefine.releaseVersion];
1324
- flowInstDataInfoRef.saveData(this.loginUser.id).then(res => {
1325
- if (res && res.operateSuccess) {
1326
- let flowSummary = this.getFlowSummary(flowInstDataInfoRef.optFormData,flowInstDataInfoRef.fieldSysDataObj || {});
1327
- let flowInst = {};
1328
- let dataId = res.operateObj;
1329
- this.dataId = dataId;
1330
- if(this.currentInst && this.currentInst.id){
1331
- this.$set(this.formInfo,"opt","update");
1332
- flowInst = {
1333
- "id": this.currentInst.id,
1334
- "flowSummary": flowSummary,
1335
- "updated": this.loginUser.id,
1336
- };
1337
- if(this.formInfo.opt == 'add' || this.tabActive == 'draft'){ //版本号也要随之更新
1338
- flowInst = Object.assign(flowInst,{"version":this.flowDefine.releaseVersion,"isRelease":this.flowDefine.isRelease})
1339
- }
1340
- this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1341
- resolve(instRes.data);
1342
- });
1343
- }else{
1344
- if (this.formInfo.opt == "add") {
1345
- flowInst = {
1346
- flowId: this.flowDefine.id,
1347
- flowSummary: flowSummary,
1348
- dataId: dataId,
1349
- startUserId: this.loginUser.id,
1350
- version:this.flowDefine.releaseVersion, //版本号
1351
- startTime: this.DATE_UTIL.getCurrentDateTime(), flowStatus: "0",
1352
- created: this.loginUser.id,
1353
- currentNode: this.flowVersionNodeObj[this.flowDefine.releaseVersion][startNodeKey].id,
1354
- isRelease:this.flowDefine.isRelease
1355
- };
1356
- } else {
1357
- flowInst = {
1358
- id: this.currentInst.id,
1359
- flowSummary: flowSummary,
1360
- version:this.flowDefine.releaseVersion, //版本号也要随之更新
1361
- updated: this.loginUser.id,
1362
- };
1363
- }
1364
- this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1365
- resolve(instRes.data);
1366
- this.currentInst=instRes.data;
1367
- });
1368
- }
1369
- let afterClickResult;
1370
- let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1371
- if (type == 'batch') {//批量处理 需处理tab页
1372
- let ref = "batchTableForm"+this.batchUpdateFormInfo.activeName+"Ref";
1373
- if(currentNodeObj.openEvent == '1'){
1374
- afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId,ref);
1375
- }
1376
- }else {
1377
- if(currentNodeObj.openEvent == '1'){
1378
- afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId);
1379
- }
1380
- }
1381
- }else{
1382
- this.$message({type:"error",message:"保存失败!"});
1383
- }
1384
- });
1333
+ // let flowInstDataInfoRef = "";
1334
+ // if (type == 'batch') {
1335
+ // // 批量处理
1336
+ // flowInstDataInfoRef = this.$refs[`batchTableForm${this.batchUpdateFormInfo.activeName}Ref`];
1337
+ // flowInstDataInfoRef = flowInstDataInfoRef[0] || flowInstDataInfoRef;
1338
+ // } else {
1339
+ // flowInstDataInfoRef = this.$refs.flowInstDataInfo;
1340
+ // }
1341
+ // let startNodeKey = this.startNodeKeyObj[this.flowDefine.releaseVersion];
1342
+ // flowInstDataInfoRef.saveData(this.loginUser.id).then(res => {
1343
+ // if (res && res.operateSuccess) {
1344
+ // let flowSummary = this.getFlowSummary(flowInstDataInfoRef.optFormData,flowInstDataInfoRef.fieldSysDataObj || {});
1345
+ // let flowInst = {};
1346
+ // let dataId = res.operateObj;
1347
+ // this.dataId = dataId;
1348
+ // if(this.currentInst && this.currentInst.id){
1349
+ // this.$set(this.formInfo,"opt","update");
1350
+ // flowInst = {
1351
+ // "id": this.currentInst.id,
1352
+ // "flowSummary": flowSummary,
1353
+ // "updated": this.loginUser.id,
1354
+ // };
1355
+ // if(this.formInfo.opt == 'add' || this.tabActive == 'draft'){ //版本号也要随之更新
1356
+ // flowInst = Object.assign(flowInst,{"version":this.flowDefine.releaseVersion,"isRelease":this.flowDefine.isRelease})
1357
+ // }
1358
+ // this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1359
+ // resolve(instRes.data);
1360
+ // });
1361
+ // }else{
1362
+ // if (this.formInfo.opt == "add") {
1363
+ // flowInst = {
1364
+ // flowId: this.flowDefine.id,
1365
+ // flowSummary: flowSummary,
1366
+ // dataId: dataId,
1367
+ // startUserId: this.loginUser.id,
1368
+ // version:this.flowDefine.releaseVersion, //版本号
1369
+ // startTime: this.DATE_UTIL.getCurrentDateTime(), flowStatus: "0",
1370
+ // created: this.loginUser.id,
1371
+ // currentNode: this.flowVersionNodeObj[this.flowDefine.releaseVersion][startNodeKey].id,
1372
+ // isRelease:this.flowDefine.isRelease
1373
+ // };
1374
+ // } else {
1375
+ // flowInst = {
1376
+ // id: this.currentInst.id,
1377
+ // flowSummary: flowSummary,
1378
+ // version:this.flowDefine.releaseVersion, //版本号也要随之更新
1379
+ // updated: this.loginUser.id,
1380
+ // };
1381
+ // }
1382
+ // this.axios.post(this.api.plFlowInst.url + "/" + this.formInfo.opt, flowInst).then(instRes => {
1383
+ // resolve(instRes.data);
1384
+ // this.currentInst=instRes.data;
1385
+ // });
1386
+ // }
1387
+ // let afterClickResult;
1388
+ // let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1389
+ // if (type == 'batch') {//批量处理 需处理tab页
1390
+ // let ref = "batchTableForm"+this.batchUpdateFormInfo.activeName+"Ref";
1391
+ // if(currentNodeObj.openEvent == '1'){
1392
+ // afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId,ref);
1393
+ // }
1394
+ // }else {
1395
+ // if(currentNodeObj.openEvent == '1'){
1396
+ // afterClickResult=this.exeNewFlowEvent("saveAfter", currentNodeObj.nodeLinkId);
1397
+ // }
1398
+ // }
1399
+ // }else{
1400
+ // this.$message({type:"error",message:"保存失败!"});
1401
+ // }
1402
+ // });
1385
1403
  });
1386
1404
  },
1387
1405
 
@@ -2372,13 +2390,14 @@
2372
2390
  try{
2373
2391
  if(item.content){
2374
2392
  let value = item.content;
2375
- value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2376
- value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2377
- value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2378
- value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2379
- value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2380
- value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2381
- value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2393
+ // value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2394
+ // value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2395
+ // value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2396
+ // value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2397
+ // value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2398
+ // value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2399
+ // value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2400
+ value = this.replaceUrl(value);
2382
2401
  item.content = value;
2383
2402
  }
2384
2403
  scriptObj[item.executePosition][item.executeTime].push(new Function(...arr,item.content));
@@ -2402,12 +2421,13 @@
2402
2421
  try{
2403
2422
  if(item.content){
2404
2423
  let value = item.content;
2405
- value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2406
- value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2407
- value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2408
- value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2409
- value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2410
- value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2424
+ // value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2425
+ // value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2426
+ // value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2427
+ // value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2428
+ // value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2429
+ // value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2430
+ value = this.replaceUrl(value);
2411
2431
  item.content = value;
2412
2432
  }
2413
2433
  executeTimeArr.push(new Function(...arr,item.content));
@@ -2443,13 +2463,14 @@
2443
2463
  try{
2444
2464
  if(item.funcBody){ //方法体
2445
2465
  let value = item.funcBody;
2446
- value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2447
- value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2448
- value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2449
- value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2450
- value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2451
- value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2452
- value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2466
+ // value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2467
+ // value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2468
+ // value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2469
+ // value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2470
+ // value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2471
+ // value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2472
+ // value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2473
+ value = this.replaceUrl(value);
2453
2474
  item.funcBody = value;
2454
2475
  }
2455
2476
  scriptObj[executeType].push(new Function(...arr,item.funcBody));
@@ -2469,13 +2490,14 @@
2469
2490
  try{
2470
2491
  if(item.funcBody){
2471
2492
  let value = item.funcBody;
2472
- value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2473
- value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2474
- value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2475
- value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2476
- value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2477
- value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2478
- value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2493
+ // value = this.platStringUtil.replaceAll(value,"/admin/",adminServeName);
2494
+ // value = this.platStringUtil.replaceAll(value,"/form/",formServeName);
2495
+ // value = this.platStringUtil.replaceAll(value,"/flow/",flowServeName);
2496
+ // value = this.platStringUtil.replaceAll(value,"/oaproject/",oaServeName);
2497
+ // value = this.platStringUtil.replaceAll(value,"/oaadmin/",adminServeName);
2498
+ // value = this.platStringUtil.replaceAll(value,"/oaform/",formServeName);
2499
+ // value = this.platStringUtil.replaceAll(value,"/oaflow/",flowServeName);
2500
+ value = this.replaceUrl(value);
2479
2501
  item.funcBody = value;
2480
2502
  }
2481
2503
  positionArr.push(new Function(...arr,item.funcBody));
@@ -2539,6 +2561,42 @@
2539
2561
  })
2540
2562
  },
2541
2563
 
2564
+ replaceUrl(value){
2565
+ if(window.ADMIN_URL && (value.indexOf("/admin/") > -1 || value.indexOf("/oaadmin/") > -1)){
2566
+ if(value.indexOf("/admin/") > -1){
2567
+ value = this.platStringUtil.replaceAll(value,"/admin/", window.ADMIN_URL + "/");
2568
+ }else{
2569
+ value = this.platStringUtil.replaceAll(value,"/oaadmin/",window.ADMIN_URL + "/");
2570
+ }
2571
+ }
2572
+ if(window.FLOW_URL && (value.indexOf("/flow/") > -1 || value.indexOf("/oaflow/") > -1)){
2573
+ if(value.indexOf("/flow/") > -1){
2574
+ value = this.platStringUtil.replaceAll(value,"/flow/", window.FLOW_URL + "/");
2575
+ }else{
2576
+ value = this.platStringUtil.replaceAll(value,"/oaflow/",window.FLOW_URL + "/");
2577
+ }
2578
+ }
2579
+ if(window.FORM_RENDER_URL && (value.indexOf("/form/") > -1|| value.indexOf("/oaform/") > -1)){
2580
+ if(value.indexOf("/form/") > -1){
2581
+ value = this.platStringUtil.replaceAll(value,"/form/", window.FORM_RENDER_URL + "/");
2582
+ }else{
2583
+ value = this.platStringUtil.replaceAll(value,"/oaform/",window.FORM_RENDER_URL + "/");
2584
+ }
2585
+ }
2586
+ if(window.OA_URL && (value.indexOf("/project/") > -1 || value.indexOf("/oaproject/") > -1)){
2587
+ if(value.indexOf("/project/") > -1){
2588
+ value = this.platStringUtil.replaceAll(value,"/project/", window.OA_URL + "/");
2589
+ }else{
2590
+ value = this.platStringUtil.replaceAll(value,"/oaproject/",window.OA_URL + "/");
2591
+ }
2592
+ }
2593
+ value = this.platStringUtil.replaceAll(value,"window.JAVA_URL","''");
2594
+ value = this.platStringUtil.replaceAll(value,"JAVA_URL","''");
2595
+ value = this.platStringUtil.replaceAll(value,"window.baseUrl","''");
2596
+ value = this.platStringUtil.replaceAll(value,"baseUrl","''");
2597
+ return value;
2598
+ },
2599
+
2542
2600
  /**
2543
2601
  * 执行工作流脚本,为兼容1.0版本定制
2544
2602
  */
@@ -2556,7 +2614,8 @@
2556
2614
  // }else{
2557
2615
  // formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2558
2616
  // }
2559
- let CTX = window.JAVA_URL;
2617
+ // let CTX = window.JAVA_URL;
2618
+ let CTX = "";
2560
2619
  let paramValues = [this,this.axios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
2561
2620
  if(executePosition == "add" || executePosition == "update"){
2562
2621
  ((this.scriptObj[executePosition] || {})[executeTime] || []).forEach(event => {
@@ -2597,7 +2656,8 @@
2597
2656
  // formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2598
2657
  // }
2599
2658
  //执行自定义脚本
2600
- let CTX = window.JAVA_URL;
2659
+ // let CTX = window.JAVA_URL;
2660
+ let CTX = "";
2601
2661
  let paramValues = [this,this.axios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
2602
2662
  if(executeType == "addAfter" || executeType == "editAfter"){ //新增或者修改后
2603
2663
  (this.newScriptObj[executeType] || []).forEach(event => {
@@ -30,6 +30,7 @@
30
30
  <el-timeline v-show="showStyle=='图形展现'">
31
31
  <el-timeline-item
32
32
  v-for="(item, index) in flowInstNodeArr"
33
+ v-if="!hideMap[item.id]"
33
34
  :key="index"
34
35
  placement="top"
35
36
  :class="{'appendsign-item':(item.isAppendsign=='1' || item.activityType=='multiInstanceBody' || item.turnSign)}"
@@ -226,6 +227,7 @@
226
227
  return {
227
228
  loading: true,
228
229
  flowInstNodeArr: [],
230
+ hideMap:{},
229
231
  flowSummary:"",
230
232
  showStyle: "图形展现",
231
233
  flowStatusCode: {
@@ -350,6 +352,9 @@
350
352
  default:
351
353
  let assignee = item.taskAssignee || "";
352
354
  if(assignee.indexOf("completeSign") > -1){
355
+ if(!item.endTime){
356
+ this.hideMap[item.id] = true;
357
+ }
353
358
  assignee = assignee.substring(0,assignee.lastIndexOf("completeSign"));
354
359
  }
355
360
  if(assignee.indexOf("revoke") > -1){