UNPKG

dareway-rui

Version:

1,213 lines (1,030 loc) 42.9 kB
'use strict'; var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault'); Object.defineProperty(exports, '__esModule', { value: true }); exports.default = void 0; var _typeof2 = _interopRequireDefault(require('@babel/runtime/helpers/typeof')); var _regenerator = _interopRequireDefault(require('@babel/runtime/regenerator')); var _ = require('../'); var _openRES = _interopRequireDefault(require('../taglib/res/openRES.js')); var _marked = /*#__PURE__*/ _regenerator.default.mark(openTask), _marked2 = /*#__PURE__*/ _regenerator.default.mark(openMyNextTaskAboutTi), _marked3 = /*#__PURE__*/ _regenerator.default.mark(isTaskLaneNewable), _marked4 = /*#__PURE__*/ _regenerator.default.mark(doTask), _marked5 = /*#__PURE__*/ _regenerator.default.mark(goProcess), _marked6 = /*#__PURE__*/ _regenerator.default.mark(openTaskAboutNewProcess), _marked7 = /*#__PURE__*/ _regenerator.default.mark(enterViewProcessDetail), _marked8 = /*#__PURE__*/ _regenerator.default.mark(goProcessInPara), _marked9 = /*#__PURE__*/ _regenerator.default.mark(executeWhenWorklistNull), _marked10 = /*#__PURE__*/ _regenerator.default.mark(openTaskByPara); // 查看流程是否存在 function checkPIExsit(piid) { var existUrl = new _.URL('process/checkPIExsit'); existUrl.addPara('piid', piid); return (0, _.request)(existUrl); } // 判断是否有权限处理当前任务 function canDoTask(tid) { var getTaskInfoUrl = new _.URL('process/getTaskAllInfo'); getTaskInfoUrl.addPara('tid', tid); return (0, _.request)(getTaskInfoUrl).then(function(taskInfoVdo) { // 判断是否能处理当前任务 var enable = taskInfoVdo.enable, dotaskalert = taskInfoVdo.alert; if (!enable || enable === false || enable == 'false') { _.MsgBox.show(dotaskalert); return false; } return taskInfoVdo; }); } // 打开Task function openTask(tid) { var taskInfo, taskTitle, currentappid, piid, appid, currenturl, urlAll, tpid, eid, utp_width, utp_height, isassignee, laneContainer, currentLane, prepareDoTaskUrl, utp_para; return _regenerator.default.wrap(function openTask$(_context) { while (1) { switch ((_context.prev = _context.next)) { case 0: if (!(!tid || tid == 'undefined' || tid == 'null')) { _context.next = 2; break; } return _context.abrupt('return', false); case 2: _context.next = 4; return canDoTask(tid); case 4: taskInfo = _context.sent; (taskTitle = taskInfo.windowtitle), (currentappid = taskInfo.currentappid), (piid = taskInfo.piid), (appid = taskInfo.appid), (currenturl = taskInfo.currenturl), (urlAll = taskInfo.urlall), (tpid = taskInfo.tpid), (eid = taskInfo.eid), (utp_width = taskInfo.utp_width), (utp_height = taskInfo.utp_height), (isassignee = taskInfo.isassignee); // 任务的appid和当前应用的appid if (!(currentappid == appid || tpid.indexOf('AUT') >= 0 || appid == 'SEFSupportApp')) { _context.next = 25; break; } _context.next = 9; return (0, _.getLaneContainer)(); case 9: laneContainer = _context.sent; _context.next = 12; return laneContainer.getCurrentLane(); case 12: currentLane = _context.sent; prepareDoTaskUrl = new _.URL('process/prepareDoTask'); prepareDoTaskUrl.addPara('tid', tid); prepareDoTaskUrl.addPara('isassignee', isassignee); _context.next = 18; return (0, _.request)(prepareDoTaskUrl); case 18: utp_para = _context.sent; _context.next = 21; return currentLane.openBeacon( tid, taskTitle, null, '_lib/workflow/vm/WorkflowPanel.js', utp_width, utp_height, { utp_para: utp_para } ); case 21: _context.next = 23; return openMyNextTaskAboutTi(piid, tid, eid); case 23: _context.next = 26; break; case 25: // TODO 切入点开流程,先跳过 console.log('打开beacon时进入了切入点开流程的分支。'); case 26: case 'end': return _context.stop(); } } }, _marked); } // 打开当前操作员定的下一个任务(适用于完成当前任务后,此任务的认领人还是当前操作员的情况),若存在多个tid,打开Beacon,显示待办事项 function openMyNextTaskAboutTi(piid, tid, eid) { var laneContainer, currentLane, keySet, fromLaneId, currentLaneID, urlGetTask, tokenVdo, tidToOpen, worklist, msgText, msgDetail, callBackjsp, callBackjs, callBackvarStr, msgDetailText, i, desktopadjustjsvarObj; return _regenerator.default.wrap(function openMyNextTaskAboutTi$(_context2) { while (1) { switch ((_context2.prev = _context2.next)) { case 0: _context2.next = 2; return (0, _.getLaneContainer)(); case 2: laneContainer = _context2.sent; _context2.next = 5; return laneContainer.getCurrentLane(); case 5: currentLane = _context2.sent; _context2.next = 8; return currentLane.getKeySet(); case 8: keySet = _context2.sent; fromLaneId = keySet.fromLaneId; _context2.next = 12; return currentLane.getID(); case 12: currentLaneID = _context2.sent; // TODO 进度条现在没有 // LanePromptUtil.startLanePrompt("正在工作"); urlGetTask = new _.URL('flowToken/getFlowToken'); urlGetTask.addPara('piid', piid); urlGetTask.addPara('eid', eid); urlGetTask.addPara('tid', tid); _context2.next = 19; return (0, _.request)(urlGetTask); case 19: tokenVdo = _context2.sent; (tidToOpen = tokenVdo.tidtoopen), (worklist = tokenVdo.worklist), (msgText = tokenVdo.msgtext), (msgDetail = tokenVdo.msgdetail), (callBackjsp = tokenVdo.desktopadjustjsp), (callBackjs = tokenVdo.desktopadjustjs), (callBackvarStr = tokenVdo.desktopadjustjsvar); msgDetailText = ''; for (i = 0; i < msgDetail.length; i++) { if (i == 0) { msgDetailText = msgDetail[i].msgdetail; } else { msgDetailText += '\r\n' + msgDetail[i].msgdetail; } } // 有信息展示 if (msgText) { if (!msgDetail.length) { _.MsgBox.show(msgText); } else { _.MsgBox.show(msgText, msgDetailText); } } // 打开下一个utp if (!tidToOpen) { _context2.next = 30; break; } _context2.next = 27; return doTask(tidToOpen, fromLaneId); case 27: _context2.next = 29; return laneContainer.removeInActiveLane(currentLaneID); case 29: return _context2.abrupt('return'); case 30: // 打开待办事项列表 if (worklist.length != 0) { alert('打开待办事项列表'); // keyset = { // "id" : "worklistLane", // "fromlaneid":fromLaneId // }; // var newWorklistLane = laneManager.addLane(keyset, "待办事项列表"); // var newWorklistLaneID = newWorklistLane.getID(); // // laneManager.removeActiveLane(newWorklistLaneID); // newWorklistLane.openBeacon("multiworklist", "待办事项列表", // "flowToken.do?method=fwBeaconMultiWorklist&worklist=" // + JSON.stringify(worklist)+"&piid="+piid, function() { // //回调函数存在执行回调 // if (callBackjsp && callBackjs && callBackvarStr) { // var desktopadjustjsvarObj = JSON.parse(callBackvarStr); // WorkFlowUtil.executeWhenWorklistNull(callBackjsp, callBackjs,desktopadjustjsvarObj,callbackFn); // } else { // try{ // callbackFn(); // }catch(oE){ // } // } // },function(){ // var currentLaneNew = laneManager.getCurrentLane().getID(); // var mainlaneID = laneManager.getMainLane().getID(); // // if(currentLaneNew!=mainlaneID){ // laneManager.removeActiveLane(fromLaneId); // } // },1024, 600); // return; } // 流程回调 desktopadjustjsvarObj = JSON.parse(callBackvarStr); _context2.next = 34; return executeWhenWorklistNull(callBackjsp, callBackjs, desktopadjustjsvarObj); case 34: case 'end': return _context2.stop(); } } }, _marked2); } function isTaskLaneNewable(tid) { var laneContainer, keyset, taskLaneList, taskLane, laneID; return _regenerator.default.wrap(function isTaskLaneNewable$(_context3) { while (1) { switch ((_context3.prev = _context3.next)) { case 0: _context3.next = 2; return (0, _.getLaneContainer)(); case 2: laneContainer = _context3.sent; keyset = { tid: tid }; // LaneContainer 中若存在多个 tid 为 keySet 的 Lane,报错; // LaneContainer 中若存在一个 tid 为 keySet 的 Lane,直接激活; _context3.next = 6; return laneContainer.searchLanesByKeySet(keyset); case 6: taskLaneList = _context3.sent; if (!(taskLaneList.length > 1)) { _context3.next = 9; break; } throw new Error( '\u5173\u4E8Etid['.concat(tid, ']\u5B58\u5728\u591A\u4E2ALane\uFF0C\u4E0D\u5408\u6CD5\u3002') ); case 9: if (!(taskLaneList.length == 1)) { _context3.next = 17; break; } taskLane = taskLaneList[0]; _context3.next = 13; return taskLane.getID(); case 13: laneID = _context3.sent; _context3.next = 16; return laneContainer.activeLane(laneID); case 16: return _context3.abrupt('return', false); case 17: return _context3.abrupt('return', true); case 18: case 'end': return _context3.stop(); } } }, _marked3); } // 在此方法中,校验是否有关于tid的Lane存在 function doTask(tid, sourceFromLaneID) { var taskInfoJson, getTaskInfoUrl, taskInfo, laneContainer, piid, eid, todoAbstractModel, currentLane, keySet, fromlaneid, keysetForNewLane, newLane, newLaneID; return _regenerator.default.wrap(function doTask$(_context4) { while (1) { switch ((_context4.prev = _context4.next)) { case 0: _context4.next = 2; return canDoTask(tid); case 2: taskInfoJson = _context4.sent; if (taskInfoJson) { _context4.next = 5; break; } return _context4.abrupt('return'); case 5: _context4.next = 7; return isTaskLaneNewable(tid); case 7: if (_context4.sent) { _context4.next = 9; break; } return _context4.abrupt('return'); case 9: getTaskInfoUrl = new _.URL('process/getTaskAllInfo'); getTaskInfoUrl.addPara('tid', tid); _context4.next = 13; return (0, _.request)(getTaskInfoUrl); case 13: taskInfo = _context4.sent; _context4.next = 16; return isTaskLaneNewable(tid); case 16: if (_context4.sent) { _context4.next = 18; break; } return _context4.abrupt('return'); case 18: _context4.next = 20; return (0, _.getLaneContainer)(); case 20: laneContainer = _context4.sent; (piid = taskInfo.piid), (eid = taskInfo.eid), (todoAbstractModel = taskInfo.todoabstractmodel); _context4.next = 24; return laneContainer.getCurrentLane(); case 24: currentLane = _context4.sent; _context4.next = 27; return currentLane.getKeySet(); case 27: keySet = _context4.sent; fromlaneid = ''; if (sourceFromLaneID) { fromlaneid = sourceFromLaneID; } else { fromlaneid = keySet.fromlaneid; if (!fromlaneid) { fromlaneid = currentLane.getID(); } } keysetForNewLane = { tid: tid, eid: eid, piid: piid, fromlaneid: fromlaneid }; _context4.next = 33; return laneContainer.addLane(keysetForNewLane, todoAbstractModel); case 33: newLane = _context4.sent; _context4.next = 36; return newLane.getID(); case 36: newLaneID = _context4.sent; _context4.next = 39; return laneContainer.activeLane(newLaneID); case 39: _context4.next = 41; return openTask(tid); case 41: case 'end': return _context4.stop(); } } }, _marked4); } function goProcess(pPiid) { var dbid, piid, locate, isExist, urlGoProcess, goProcessVdo, goprocess_code, goprocess_info, goprocess_info_obj, pdlabel, tid, dptdlabel, worklistWindowTitle, laneContainer, currentLane, keySet, fromLaneId, viewProcessParams, result, _tid, _worklistWindowTitle, _laneContainer, _currentLane, _keySet, _fromLaneId, _viewProcessParams, _result, _tid2; return _regenerator.default.wrap(function goProcess$(_context5) { while (1) { switch ((_context5.prev = _context5.next)) { case 0: if (!pPiid || pPiid == 'null') { _.MsgBox.show('请输入业务流水号;'); } // 解析出dbid-piid dbid = ''; piid = pPiid; locate = pPiid.indexOf('-'); if (locate > 0) { dbid = pPiid.substring(0, locate); piid = pPiid.substring(locate + 1, pPiid.length); } _context5.next = 7; return checkPIExsit(piid); case 7: isExist = _context5.sent; if (!(isExist !== '1')) { _context5.next = 11; break; } _.MsgBox.show( '\u4E0D\u5B58\u5728\u4E1A\u52A1\u6D41\u6C34\u53F7\u4E3A\u3010'.concat( piid, '\u3011\u7684\u4E1A\u52A1\u3002' ) ); return _context5.abrupt('return'); case 11: urlGoProcess = new _.URL('worklistAboutEid/goProcess'); urlGoProcess.addPara('piid', piid); urlGoProcess.addPara('eid', piid); urlGoProcess.addPara('dbid', dbid); _context5.next = 17; return (0, _.request)(urlGoProcess); case 17: goProcessVdo = _context5.sent; (goprocess_code = goProcessVdo.goprocess_code), (goprocess_info = goProcessVdo.goprocess_info); goprocess_info_obj = JSON.parse(goprocess_info); pdlabel = goprocess_info_obj.pdlabel; _context5.t0 = goprocess_code; _context5.next = _context5.t0 === '1' ? 24 : _context5.t0 === '2' ? 29 : _context5.t0 === '3' ? 34 : _context5.t0 === '4' ? 55 : _context5.t0 === '5' ? 76 : 80; break; case 24: // 流程处于活动状态,且有当前用户可以处理的UT tid = goprocess_info_obj.tid; _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat(pdlabel, ']\u4E1A\u52A1\u7EE7\u7EED\u529E\u7406\u3002') ); _context5.next = 28; return doTask(tid); case 28: return _context5.abrupt('break', 82); case 29: // 活动,但没有可以处理的任务,提示活动tid所属的DP dptdlabel = goprocess_info_obj.dptdlabel; if (dptdlabel == null || dptdlabel == '') { _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat(pdlabel, ']\u4E1A\u52A1\u7B49\u5019\u5904\u7406\u3002') ); } else { _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat(pdlabel, ']\u4E1A\u52A1\u7B49\u5019[') .concat(dptdlabel, ']\u5904\u7406\u3002') ); } _context5.next = 33; return enterViewProcessDetail(piid); case 33: return _context5.abrupt('break', 82); case 34: // 流程活动,且有多个可以处理的任务 _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat(pdlabel, ']\u6709\u591A\u4E2A\u5F85\u529E\u4E8B\u9879\u3002') ); worklistWindowTitle = piid + '[' + pdlabel + ']'; _context5.next = 38; return (0, _.getLaneContainer)(); case 38: laneContainer = _context5.sent; _context5.next = 41; return laneContainer.getCurrentLane(); case 41: currentLane = _context5.sent; _context5.next = 44; return currentLane.getKeySet(); case 44: keySet = _context5.sent; fromLaneId = keySet.fromLaneId; viewProcessParams = { eid: piid, piid: piid }; _context5.next = 49; return (0, _openRES.default)( worklistWindowTitle, null, '_lib/workflow/vm/component/worklist/resSelectWorklist.js', 1024, 600, viewProcessParams ); case 49: result = _context5.sent; if (!(result != undefined && result != null)) { _context5.next = 54; break; } _tid = result.tid; _context5.next = 54; return doTask(_tid); case 54: return _context5.abrupt('break', 82); case 55: // 子流程或父流程中有活动任务 _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat( pdlabel, ']\u4E1A\u52A1\u5B58\u5728\u5B50\u4E1A\u52A1\u6216\u7236\u4E1A\u52A1\u3002' ) ); _worklistWindowTitle = piid + '[' + pdlabel + ']'; _context5.next = 59; return (0, _.getLaneContainer)(); case 59: _laneContainer = _context5.sent; _context5.next = 62; return _laneContainer.getCurrentLane(); case 62: _currentLane = _context5.sent; _context5.next = 65; return _currentLane.getKeySet(); case 65: _keySet = _context5.sent; _fromLaneId = _keySet.fromLaneId; _viewProcessParams = { eid: piid, piid: piid }; _context5.next = 70; return (0, _openRES.default)( _worklistWindowTitle, null, '_lib/workflow/vm/component/worklist/resSelectWorklist.js', 1024, 600, _viewProcessParams ); case 70: _result = _context5.sent; if (!(_result != undefined && _result != null)) { _context5.next = 75; break; } _tid2 = _result.tid; _context5.next = 75; return doTask(_tid2); case 75: return _context5.abrupt('break', 82); case 76: // 流程结束,且子流程、父流程无可处理的活动任务 _.MsgBox.show( '\u4E1A\u52A1\u53F7\u4E3A[' .concat(piid, ']\u7684[') .concat(pdlabel, ']\u4E1A\u52A1\u5DF2\u7ECF\u529E\u7406\u5B8C\u6210\u3002') ); _context5.next = 79; return enterViewProcessDetail(piid); case 79: return _context5.abrupt('break', 82); case 80: _.MsgBox.show( '\u6253\u5F00\u4E0B\u4E00\u4E2A\u4EFB\u52A1\u7684\u8BF7\u6C42\u8FD4\u56DE\u503C'.concat( goprocess_code, '\u4E0D\u5408\u6CD5\u3002' ) ); return _context5.abrupt('break', 82); case 82: case 'end': return _context5.stop(); } } }, _marked5); } // TODO 这里需要再考虑,应该迁移到全局workflow.redux空间中管理 function isSupportRWTS() { return false; } function checkClaim(tid) { if (!tid || typeof tid !== 'string') { throw new Error( '\u51FD\u6570\u5B9A\u4E49\uFF1AWorkFlowUtil.checkClaim(tid)\n\u51FD\u6570\u8C03\u7528\uFF1AWorkFlowUtil.checkClaim(' .concat( tid, ')\n\u5F02\u5E38\u4FE1\u606F\uFF1A\u671F\u671B\u5165\u53C2 tid \u4E3A\u975E\u7A7A string \u7C7B\u578B\uFF1B\u5B9E\u9645\u4F20\u5165\u503C ' ) .concat(tid, '\uFF0C\u7C7B\u578B\u4E3A ') .concat((0, _typeof2.default)(tid), '\n\u8BF7\u68C0\u67E5!') ); } var urlCheck = new _.URL('process/checkClaim'); urlCheck.addPara('tid', tid); return (0, _.request)(urlCheck).then(function(vdo) { return vdo.auth; }); } function openTaskAboutNewProcess(piid) { var laneContainer, currentLane, keySet, fromLaneId, currentLaneID, urlGetTask, tokenVdo, tidToOpen, worklist, msgText, msgDetail, callBackjsp, callBackjs, callBackvarStr, msgDetailText, i, desktopadjustjsvarObj; return _regenerator.default.wrap(function openTaskAboutNewProcess$(_context6) { while (1) { switch ((_context6.prev = _context6.next)) { case 0: _context6.next = 2; return (0, _.getLaneContainer)(); case 2: laneContainer = _context6.sent; _context6.next = 5; return laneContainer.getCurrentLane(); case 5: currentLane = _context6.sent; _context6.next = 8; return currentLane.getKeySet(); case 8: keySet = _context6.sent; fromLaneId = keySet.fromLaneId; _context6.next = 12; return currentLane.getID(); case 12: currentLaneID = _context6.sent; urlGetTask = new _.URL('flowToken/getFlowToken'); urlGetTask.addPara('piid', piid); urlGetTask.addPara('eid', piid); urlGetTask.addPara('tid', 'undefined'); _context6.next = 19; return (0, _.request)(urlGetTask); case 19: tokenVdo = _context6.sent; (tidToOpen = tokenVdo.tidtoopen), (worklist = tokenVdo.worklist), (msgText = tokenVdo.msgtext), (msgDetail = tokenVdo.msgdetail), (callBackjsp = tokenVdo.desktopadjustjsp), (callBackjs = tokenVdo.desktopadjustjs), (callBackvarStr = tokenVdo.desktopadjustjsvar); // 有信息展示 msgDetailText = ''; for (i = 0; i < msgDetail.length; i++) { if (i == 0) { msgDetailText = msgDetail[i].msgdetail; } else { msgDetailText += '\r\n' + msgDetail[i].msgdetail; } } // 有信息展示 if (msgText) { if (!msgDetail.length) { _.MsgBox.show(msgText); } else { _.MsgBox.show(msgText, msgDetailText); } } // 打开下一个utp if (!tidToOpen) { _context6.next = 30; break; } _context6.next = 27; return doTask(tidToOpen); case 27: _context6.next = 29; return laneContainer.removeInActiveLane(currentLaneID); case 29: return _context6.abrupt('return'); case 30: // 打开待办事项列表 if (worklist.length != 0) { alert('打开待办事项列表'); // keyset = { // "id" : "worklistLane", // "fromlaneid":fromLaneId // }; // var newWorklistLane = laneManager.addLane(keyset, "待办事项列表"); // var newWorklistLaneID = newWorklistLane.getID(); // // laneManager.removeActiveLane(newWorklistLaneID); // newWorklistLane.openBeacon("multiworklist", "待办事项列表", // "flowToken.do?method=fwBeaconMultiWorklist&worklist=" // + JSON.stringify(worklist)+"&piid="+piid, function() { // //回调函数存在执行回调 // if (callBackjsp && callBackjs && callBackvarStr) { // var desktopadjustjsvarObj = JSON.parse(callBackvarStr); // WorkFlowUtil.executeWhenWorklistNull(callBackjsp, callBackjs,desktopadjustjsvarObj,callbackFn); // } else { // try{ // callbackFn(); // }catch(oE){ // } // } // },function(){ // var currentLaneNew = laneManager.getCurrentLane().getID(); // var mainlaneID = laneManager.getMainLane().getID(); // // if(currentLaneNew!=mainlaneID){ // laneManager.removeActiveLane(fromLaneId); // } // },1024, 600); // return; } // 流程回调 desktopadjustjsvarObj = JSON.parse(callBackvarStr); _context6.next = 34; return executeWhenWorklistNull(callBackjsp, callBackjs, desktopadjustjsvarObj); case 34: case 'end': return _context6.stop(); } } }, _marked6); } function enterViewProcessDetail(piid) { var width, height, viewProcessParams, result, entrance, _tid3, laneContainer, currentLane, currentKeyset, fromLaneID, tid, urlCheck, urlCheckResultVdo, auth, shouMsg, beacon; return _regenerator.default.wrap(function enterViewProcessDetail$(_context7) { while (1) { switch ((_context7.prev = _context7.next)) { case 0: width = 1000; height = 1000; viewProcessParams = { piid: piid }; _context7.next = 5; return (0, _openRES.default)( '业务详情', null, '_lib/workflow/vm/detail/viewProcessDetail.js', width, height, viewProcessParams ); case 5: result = _context7.sent; if (!(result != undefined && result != null)) { _context7.next = 12; break; } entrance = result.entrance; if (!(entrance != null && entrance == 'goProcess')) { _context7.next = 12; break; } _tid3 = result.tid; _context7.next = 12; return doTask(_tid3); case 12: _context7.next = 14; return (0, _.getLaneContainer)(); case 14: laneContainer = _context7.sent; _context7.next = 17; return laneContainer.getCurrentLane(); case 17: currentLane = _context7.sent; _context7.next = 20; return currentLane.getKeySet(); case 20: currentKeyset = _context7.sent; (fromLaneID = currentKeyset.fromlaneid), (tid = currentKeyset.tid); if (tid) { _context7.next = 24; break; } return _context7.abrupt('return'); case 24: urlCheck = new _.URL('process/getClaimInfo'); _context7.next = 27; return urlCheck.addPara('tid', tid); case 27: _context7.next = 29; return (0, _.request)(urlCheck); case 29: urlCheckResultVdo = _context7.sent; (auth = urlCheckResultVdo.auth), (shouMsg = urlCheckResultVdo.shouMsg); if (!(auth === 'true')) { _context7.next = 33; break; } return _context7.abrupt('return'); case 33: _context7.next = 35; return currentLane.getBeacon(tid); case 35: beacon = _context7.sent; _context7.next = 38; return beacon.closeBeacon(); case 38: case 'end': return _context7.stop(); } } }, _marked7); } function goProcessInPara(piid) { return _regenerator.default.wrap(function goProcessInPara$(_context8) { while (1) { switch ((_context8.prev = _context8.next)) { case 0: _context8.next = 2; return goProcess(piid); case 2: case 'end': return _context8.stop(); } } }, _marked8); } // 用于开启流程后获取活动任务 如在一主体多流程页面进行开启流程 function getOneTaskAboutPiForMe(piid) { var eid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : piid; // doAT var urlDoAUT = new _.URL('process/doAUTAboutPI'); urlDoAUT.addPara('piid', piid); (0, _.request)(urlDoAUT); var url = new _.URL('process/getOneTaskAboutPiForMe'); url.addPara('eid', eid); url.addPara('piid', piid); url.addPara('pretid', ''); return (0, _.request)(url); } function executeWhenWorklistNull(desktopJSP, desktopJS, desktopadjustjsvarObj, callbackFn) { var laneContainer, currentLane, currentLaneID, currentKeyset, fromLaneID, mainLane, mainLaneID, fromLaneExsits; return _regenerator.default.wrap(function executeWhenWorklistNull$(_context9) { while (1) { switch ((_context9.prev = _context9.next)) { case 0: _context9.next = 2; return (0, _.getLaneContainer)(); case 2: laneContainer = _context9.sent; _context9.next = 5; return laneContainer.getCurrentLane(); case 5: currentLane = _context9.sent; _context9.next = 8; return currentLane.getID(); case 8: currentLaneID = _context9.sent; _context9.next = 11; return currentLane.getKeySet(); case 11: currentKeyset = _context9.sent; fromLaneID = currentKeyset.fromlaneid; _context9.next = 15; return laneContainer.getMainLane(); case 15: mainLane = _context9.sent; _context9.next = 18; return mainLane.getID(); case 18: mainLaneID = _context9.sent; if (fromLaneID) { _context9.next = 21; break; } return _context9.abrupt('return'); case 21: _context9.next = 23; return laneContainer.isLaneExist(fromLaneID); case 23: fromLaneExsits = _context9.sent; if (!fromLaneExsits) { _context9.next = 29; break; } if (!(fromLaneID != mainLaneID)) { _context9.next = 29; break; } _context9.next = 28; return laneContainer.removeActiveLane(fromLaneID); case 28: return _context9.abrupt('return'); case 29: _context9.next = 31; return laneContainer.removeActiveLane(mainLaneID); case 31: return _context9.abrupt('return'); case 32: case 'end': return _context9.stop(); } } }, _marked9); } // 根据任务节点打开任务处理页面 function openTaskByPara(tid) { return _regenerator.default.wrap(function openTaskByPara$(_context10) { while (1) { switch ((_context10.prev = _context10.next)) { case 0: _context10.next = 2; return doTask(tid); case 2: case 'end': return _context10.stop(); } } }, _marked10); } // 获取附加属性的值 function getAdditiveAttributeValue(tid, attributeName) { var url = new _.URL('process/getAdditiveAttributeValue'); url.addPara('tid', tid); url.addPara('attributeName', attributeName); return (0, _.request)(url).then(function(_ref) { var attributevalue = _ref.attributevalue; return attributevalue; }); } var _default = { checkClaim: checkClaim, doTask: doTask, enterViewProcessDetail: enterViewProcessDetail, getAdditiveAttributeValue: getAdditiveAttributeValue, getOneTaskAboutPiForMe: getOneTaskAboutPiForMe, goProcess: goProcess, goProcessInPara: goProcessInPara, isSupportRWTS: isSupportRWTS, openTaskAboutNewProcess: openTaskAboutNewProcess, openTaskByPara: openTaskByPara, canDoTask: canDoTask }; exports.default = _default; //@ sourceMappingURL=WorkFlowUtil.js.map