vue2-client 1.15.5 → 1.15.7
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/.cursorrules +19 -19
- package/.env.apply +19 -0
- package/.env.gaslink +19 -19
- package/.env.his +19 -19
- package/.env.liuli +19 -19
- package/.env.scada +19 -19
- package/.eslintrc.js +90 -90
- package/CHANGELOG.md +824 -824
- package/Components.md +60 -60
- package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +45 -45
- package/docs/LowCode/lowcode.md +155 -155
- package/docs/LowCode/lowcodeForDeveloper.md +230 -230
- package/docs/index.md +30 -30
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.setup.js +7 -7
- package/jsconfig.json +19 -19
- package/package.json +2 -1
- package/public/his/editor/editor.html +51 -51
- package/public/his/editor/mock/bind_data.html +779 -779
- package/public/his/editor/mock/data_table.html +40 -40
- package/public/his/editor/mock/sign.html +75 -75
- package/public/his/editor/vender/JsBarcode.all.js +3669 -3669
- package/public/his/editor/vender/date97/My97DatePicker.htm +65 -65
- package/public/his/editor/vender/date97/WdatePicker.js +677 -677
- package/public/his/editor/vender/date97/calendar.js +4 -4
- package/public/his/editor/vender/date97/lang/en.js +13 -13
- package/public/his/editor/vender/date97/lang/zh-cn.js +13 -13
- package/public/his/editor/vender/date97/lang/zh-tw.js +13 -13
- package/public/his/editor/vender/date97/skin/WdatePicker.css +10 -10
- package/public/his/editor/vender/date97/skin/default/datepicker.css +328 -328
- package/public/his/editor/vender/date97/skin/ext/datepicker.css +308 -308
- package/public/his/editor/vender/date97/skin/whyGreen/datepicker.css +255 -255
- package/public/his/editor/vender/diff.js +1627 -1627
- package/public/his/editor/vender/editor.js +1 -1
- package/public/his/editor/vender/fabric.js +31187 -31187
- package/public/his/editor/vender/jquery/jquery.base64.js +190 -190
- package/public/his/editor/vender/jquery/jquery.js +10872 -10872
- package/public/his/editor/vender/jquery/jquery.print.js +255 -255
- package/public/his/editor/vender/jquery/zTreeStyle/zTreeStyle.css +96 -96
- package/public/his/editor/vender/mui/mui.min.css +4 -4
- package/public/his/editor/vender/mui/mui.min.js +5 -5
- package/public/his/editor/vender/mui/mui.picker.min.css +6 -6
- package/public/his/editor/vender/mui/mui.picker.min.js +6 -6
- package/public/his/editor/vender/qrcode.js +7 -7
- package/public/his/editor/vender/requirejs/require.js +2145 -2145
- package/public/his/editor/vender/signature/jSignature.CompressorSVG.js +518 -518
- package/public/his/editor/vender/signature/jSignature.UndoButton.js +164 -164
- package/public/his/editor/vender/signature/jSignature.js +1486 -1486
- package/public/his/editor/vender/validator.js +5094 -5094
- package/public/his/editor/vender/weui/weui.css +5659 -5659
- package/public/his/editor/vender/weui/weui.min.css +4 -4
- package/public/his/editor/vender/weui/weui.min.js +11 -11
- package/public/index.html +27 -27
- package/src/ReportView.js +19 -19
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/assets/svg/badtwo.svg +1 -1
- package/src/assets/svg/goodtwo.svg +1 -1
- package/src/base-client/components/AI/AskAiBtn.vue +136 -136
- package/src/base-client/components/AI/demo.vue +31 -31
- package/src/base-client/components/common/AMisRender/index.js +3 -3
- package/src/base-client/components/common/AMisRender/index.vue +263 -263
- package/src/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue +16 -16
- package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
- package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
- package/src/base-client/components/common/CreateQuery/index.js +3 -3
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
- package/src/base-client/components/common/LowCodeComponent/LowCodeEditorModal.vue +108 -108
- package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -413
- package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
- package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -728
- package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
- package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -219
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeAddPageModal.vue +117 -117
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeCustomJSModal.vue +80 -80
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeEventEditorModal.vue +398 -398
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLifeCycleModal.vue +65 -65
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicCallbackModal.vue +64 -64
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicParamModal.vue +73 -73
- package/src/base-client/components/common/LowCodeComponent/modal/lowCodeRunFunctionParamModal.vue +76 -76
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Recording/Recording.vue +243 -243
- package/src/base-client/components/common/Recording/index.js +3 -3
- package/src/base-client/components/common/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +113 -113
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +13 -0
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
- package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
- package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
- package/src/base-client/components/common/XAddReport/index.js +3 -3
- package/src/base-client/components/common/XAddReport/index.md +56 -56
- package/src/base-client/components/common/XBadge/XBadge.vue +94 -94
- package/src/base-client/components/common/XButtons/XButtonDemo.vue +28 -28
- package/src/base-client/components/common/XButtons/XButtons.vue +71 -71
- package/src/base-client/components/common/XButtons/index.js +3 -3
- package/src/base-client/components/common/XButtons/index.md +61 -61
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XCheckList/XCheckList.vue +106 -106
- package/src/base-client/components/common/XCheckList/XCheckListDemo.vue +41 -41
- package/src/base-client/components/common/XDataCard/index.js +3 -3
- package/src/base-client/components/common/XDataCard/index.md +1 -1
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
- package/src/base-client/components/common/XDataDrawer/index.js +3 -3
- package/src/base-client/components/common/XDataDrawer/index.md +41 -41
- package/src/base-client/components/common/XDatePicker/demo.vue +153 -153
- package/src/base-client/components/common/XDescriptions/index.js +3 -3
- package/src/base-client/components/common/XDescriptions/index.md +83 -83
- package/src/base-client/components/common/XDetailsView/XDetailsView.vue +238 -238
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XForm/XStatusButton.vue +54 -54
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XForm/itemComponent/XClickChangeBtn/index.vue +49 -49
- package/src/base-client/components/common/XFormGroup/index.js +3 -3
- package/src/base-client/components/common/XFormGroup/index.md +38 -38
- package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XFormTable/index.md +92 -92
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +167 -167
- package/src/base-client/components/common/XLabelSelect/XLabelSelect.vue +110 -110
- package/src/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue +35 -35
- package/src/base-client/components/common/XLicensePlate/XLicensePlate.vue +193 -193
- package/src/base-client/components/common/XLicensePlate/XLicensePlateDemo.vue +48 -48
- package/src/base-client/components/common/XPrint/OpenInvoice.vue +21 -21
- package/src/base-client/components/common/XPrint/PrintBill.vue +302 -302
- package/src/base-client/components/common/XPrint/PrintHtml.js +98 -98
- package/src/base-client/components/common/XPrint/css/hiPrintCss.js +359 -359
- package/src/base-client/components/common/XPrint/css/lodopCss.js +26 -26
- package/src/base-client/components/common/XPrint/css/print-lock.css +351 -351
- package/src/base-client/components/common/XPrint/index.vue +97 -97
- package/src/base-client/components/common/XReport/XReportDesign.vue +463 -463
- package/src/base-client/components/common/XReport/XReportJsonRender.vue +381 -381
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XReportDrawer/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/index.md +44 -44
- package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
- package/src/base-client/components/common/XReportSlot/index.js +3 -3
- package/src/base-client/components/common/XReportSlot/index.md +48 -48
- package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
- package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -3
- package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -7
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/base-client/components/common/XStepView/index.js +3 -3
- package/src/base-client/components/common/XStepView/index.md +31 -31
- package/src/base-client/components/common/XTab/XTab.vue +1 -1
- package/src/base-client/components/common/XTab/XTabDemo.vue +22 -22
- package/src/base-client/components/common/XTab/index.js +3 -3
- package/src/base-client/components/common/XTable/CustomFuncCel.vue +51 -51
- package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -161
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTagGroup/index.vue +52 -52
- package/src/base-client/components/common/XTree/XTree.vue +424 -424
- package/src/base-client/components/common/XTree/index.js +3 -3
- package/src/base-client/components/common/XTree/index.md +36 -36
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +113 -113
- package/src/base-client/components/common/XTreeOne/XTreeOnePro.vue +128 -128
- package/src/base-client/components/common/richTextModal/index.vue +56 -56
- package/src/base-client/components/common/richTextModal/richDemo.vue +48 -48
- package/src/base-client/components/his/XHisEditor/index.js +3 -3
- package/src/base-client/components/index.js +51 -51
- package/src/base-client/components/layout/XTreeView/XTreeView.vue +130 -130
- package/src/base-client/components/layout/XTreeView/index.js +3 -3
- package/src/base-client/components/layout/XTreeView/index.md +46 -46
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/GetLoginInfoService.js +183 -183
- package/src/base-client/plugins/Recording.js +258 -258
- package/src/base-client/plugins/index.js +23 -23
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/components/Charts/Bar.vue +62 -62
- package/src/components/Charts/ChartCard.vue +134 -134
- package/src/components/Charts/Liquid.vue +67 -67
- package/src/components/Charts/MiniArea.vue +39 -39
- package/src/components/Charts/MiniBar.vue +39 -39
- package/src/components/Charts/MiniProgress.vue +75 -75
- package/src/components/Charts/MiniSmoothArea.vue +40 -40
- package/src/components/Charts/Radar.vue +68 -68
- package/src/components/Charts/RankList.vue +77 -77
- package/src/components/Charts/TagCloud.vue +113 -113
- package/src/components/Charts/TransferBar.vue +64 -64
- package/src/components/Charts/Trend.vue +82 -82
- package/src/components/Charts/chart.less +12 -12
- package/src/components/Charts/smooth.area.less +13 -13
- package/src/components/CodeMirror/inedx.vue +118 -118
- package/src/components/CodeMirror/setting.js +40 -40
- package/src/components/HeightScanner/index.vue +571 -571
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/NumberInfo/index.js +3 -3
- package/src/components/NumberInfo/index.less +54 -54
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/card/ChartCard.vue +79 -79
- package/src/components/chart/Bar.vue +60 -60
- package/src/components/chart/MiniArea.vue +67 -67
- package/src/components/chart/MiniBar.vue +59 -59
- package/src/components/chart/MiniProgress.vue +57 -57
- package/src/components/chart/Radar.vue +80 -80
- package/src/components/chart/RankingList.vue +60 -60
- package/src/components/chart/Trend.vue +79 -79
- package/src/components/chart/index.less +9 -9
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +117 -117
- package/src/components/checkbox/ImgCheckboxGroup.vue +76 -76
- package/src/components/checkbox/index.js +9 -9
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/g2Charts/constants.js +202 -202
- package/src/components/g2Charts/demo.vue +808 -808
- package/src/components/g2Charts/designer.vue +228 -228
- package/src/components/g2Charts/designerBaseConfig.vue +61 -61
- package/src/components/g2Charts/designerDataConfig.vue +259 -259
- package/src/components/g2Charts/designerStyleConfig.vue +16 -16
- package/src/components/g2Charts/index.vue +397 -397
- package/src/components/index.js +36 -36
- package/src/components/input/IInput.vue +66 -66
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/setting/Setting.vue +234 -234
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/config/CreateQueryConfig.js +325 -325
- package/src/config/default/antd.config.js +89 -89
- package/src/config/default/setting.config.js +55 -55
- package/src/font-style/font.css +4 -4
- package/src/layouts/CommonLayout.vue +56 -56
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +136 -136
- package/src/layouts/header/AdminHeader.vue +132 -132
- package/src/layouts/header/HeaderNotice.vue +177 -177
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/tabs/TabsHead.vue +189 -189
- package/src/layouts/tabs/TabsView.vue +389 -389
- package/src/lib.js +1 -1
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- package/src/pages/AMisDemo/AMisDemo.vue +325 -325
- package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
- package/src/pages/DefaultExample/index.vue +77 -77
- package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
- package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/DynamicStatistics/FavoriteList.vue +50 -50
- package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
- package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
- package/src/pages/DynamicStatistics/index.vue +282 -282
- package/src/pages/Example/childIndex.vue +15 -15
- package/src/pages/Example/index.vue +30 -30
- package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
- package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/NewDynamicStatistics/FavoriteList.vue +50 -50
- package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
- package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
- package/src/pages/NewDynamicStatistics/index.vue +258 -258
- package/src/pages/Recording/index.vue +77 -77
- package/src/pages/ServiceReview/index.vue +284 -284
- package/src/pages/SubExample/index.vue +26 -26
- package/src/pages/WorkflowDetail/WorkflowDetail.vue +41 -36
- package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformationDetails.vue +276 -276
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +632 -386
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandleReso.vue +6 -6
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowPreview.vue +2 -3
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +240 -8
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +1 -12
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +1 -19
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +248 -248
- package/src/pages/WorkflowDetail/WorkflowPageDetail/components/WorkflowPersonSelector.vue +104 -0
- package/src/pages/XReportView/index.vue +64 -64
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/src/pages/addressSelect/addressDemo.vue +24 -24
- package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
- package/src/pages/login/Login.vue +378 -378
- package/src/pages/login/LoginV3.vue +389 -389
- package/src/pages/lowCode/lowCodeEditor.vue +1219 -1219
- package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +44 -44
- package/src/pages/system/monitor/loginInfor/index.vue +37 -37
- package/src/pages/system/monitor/operLog/index.vue +37 -37
- package/src/pages/system/settings/modifyPassword.vue +117 -117
- package/src/pages/system/ticket/index.vue +480 -480
- package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
- package/src/pages/userInfoDetailManage/ChangeMeterRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/InfoChangeRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/InstructRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/MeterParamRecordQuery/index.vue +64 -64
- package/src/pages/userInfoDetailManage/TransferRecordQuery/index.vue +66 -66
- package/src/pages/userInfoDetailManage/WatchCollectionRecordQuery/index.vue +64 -64
- package/src/plugins/EventLogPlugin.js +33 -33
- package/src/plugins/FindParentsData.js +17 -17
- package/src/router/async/config.async.js +35 -35
- package/src/router/index.js +27 -27
- package/src/router.js +19 -19
- package/src/services/DataModel.js +30 -30
- package/src/services/LodopFuncs.js +137 -137
- package/src/services/api/TicketDetailsViewApi.js +46 -46
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +346 -346
- package/src/services/api/entity.js +18 -18
- package/src/services/api/index.js +17 -17
- package/src/services/api/workFlow.js +0 -2
- package/src/store/modules/account.js +115 -115
- package/src/store/modules/index.js +5 -5
- package/src/store/modules/lowCode.js +33 -33
- package/src/store/modules/setting.js +119 -119
- package/src/theme/default/style.less +58 -58
- package/src/theme/global.less +159 -159
- package/src/utils/authority-utils.js +85 -85
- package/src/utils/errorCode.js +6 -6
- package/src/utils/formatter.js +74 -74
- package/src/utils/htmlToPDF.js +108 -108
- package/src/utils/htmlToPDFApi.js +5 -5
- package/src/utils/login.js +188 -188
- package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
- package/src/utils/lowcode/lowcodeLog.js +29 -29
- package/src/utils/lowcode/lowcodeUtils.js +373 -373
- package/src/utils/lowcode/registerComponentForEditor.js +1 -1
- package/src/utils/lowcode/registerComponentForRender.js +11 -11
- package/src/utils/map-utils.js +47 -47
- package/src/utils/reg.js +95 -95
- package/src/utils/runEvalFunction.js +14 -14
- package/src/utils/theme-color-replacer-extend.js +92 -92
- package/src/utils/util.js +329 -329
- package/src/utils/waterMark.js +31 -31
- package/vue.config.js +5 -0
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -13,182 +13,171 @@
|
|
13
13
|
@activeStep="activeStep"/>
|
14
14
|
</a-card>
|
15
15
|
<!-- 无权访问的提示 -->
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
</template>
|
20
|
-
<template v-else>
|
16
|
+
<a-result v-show="!canSubmit" status="403" title="无权操作" sub-title="您没有访问该步骤的权限.">
|
17
|
+
</a-result>
|
18
|
+
<div v-show="canSubmit">
|
21
19
|
<!-- 流程被退回的提示 -->
|
22
|
-
<
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
20
|
+
<a-alert v-if="currentStep && currentStep.back && !(beforeStepActive || workflowState)" type="info" show-icon style="margin-bottom: 14px">
|
21
|
+
<div slot="message">
|
22
|
+
<span style="font-weight: bold">流程被退回</span>
|
23
|
+
<span style="margin-left: 14px; font-size: 14px; color: rgba(0, 0, 0, 0.65)">请重新填写信息发起提交</span>
|
24
|
+
</div>
|
25
|
+
<div slot="description">
|
26
|
+
<div>操作人:{{
|
27
|
+
currentStep.back.f_operator
|
28
|
+
}} 操作时间:{{ currentStep.back.f_date }}
|
27
29
|
</div>
|
28
|
-
<div
|
29
|
-
|
30
|
-
|
31
|
-
</div>
|
32
|
-
</a-alert>
|
33
|
-
</template>
|
30
|
+
<div>原因:{{ currentStep.back.f_notes }}</div>
|
31
|
+
</div>
|
32
|
+
</a-alert>
|
34
33
|
<!-- 步骤内容主体 -->
|
35
34
|
<a-tabs default-active-key="1" @change="note = ''" type="card">
|
36
|
-
<
|
37
|
-
<a-
|
38
|
-
|
39
|
-
|
40
|
-
<
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
<
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<a-
|
96
|
-
|
97
|
-
|
98
|
-
<a-radio
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<a-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
35
|
+
<a-tab-pane key="0" tab="步骤详情" v-if="beforeStepActive || workflowState">
|
36
|
+
<a-card :bordered="false" :loading="loadingHistory" :body-style="{ paddingTop: 0 }">
|
37
|
+
<!-- 当前步骤历史记录 -->
|
38
|
+
<template v-if="showTab">
|
39
|
+
<x-tab
|
40
|
+
:compProp="{ buttonState: { add: false, edit: false, delete: false, import: false }, disableAction: true }"
|
41
|
+
:local-config="tabDesigner"
|
42
|
+
:body-style="{ padding: 0 }"
|
43
|
+
:tabBarGutter="24"
|
44
|
+
:extra-data="{ workflowId: workflowId }"
|
45
|
+
default-active-key="workFlowTab">
|
46
|
+
<a-tab-pane
|
47
|
+
:forceRender="true"
|
48
|
+
v-if="formCompletedDataPreview"
|
49
|
+
slot="extraBeforeTabs"
|
50
|
+
key="workFlowTab"
|
51
|
+
tab="表单"
|
52
|
+
>
|
53
|
+
<work-flow-preview :form-completed-data-preview="formCompletedDataPreview"/>
|
54
|
+
</a-tab-pane>
|
55
|
+
</x-tab>
|
56
|
+
</template>
|
57
|
+
<template v-else-if="formCompletedDataPreview">
|
58
|
+
<work-flow-preview :form-completed-data-preview="formCompletedDataPreview"/>
|
59
|
+
</template>
|
60
|
+
<template v-else>
|
61
|
+
<a-result status="404" title="暂无数据" sub-title="该步骤暂无数据。">
|
62
|
+
</a-result>
|
63
|
+
</template>
|
64
|
+
</a-card>
|
65
|
+
</a-tab-pane>
|
66
|
+
<a-tab-pane key="1" tab="业务操作" v-else>
|
67
|
+
<a-card :bordered="false" :loading="loadingHistory" :body-style="{ paddingTop: 0 }">
|
68
|
+
<x-tab
|
69
|
+
v-if="showTab"
|
70
|
+
:local-config="tabDesigner"
|
71
|
+
:extra-data="{ workflowId:workflowId }"
|
72
|
+
:body-style="{ padding: 0 }"
|
73
|
+
:tabBarGutter="24"
|
74
|
+
default-active-key="workFlowTab">
|
75
|
+
<a-tab-pane
|
76
|
+
:forceRender="true"
|
77
|
+
v-if="showForm"
|
78
|
+
slot="extraBeforeTabs"
|
79
|
+
key="workFlowTab"
|
80
|
+
tab="表单"
|
81
|
+
>
|
82
|
+
<x-add-native-form
|
83
|
+
ref="xAddForm"
|
84
|
+
@onSubmit="submitForm"/>
|
85
|
+
</a-tab-pane>
|
86
|
+
</x-tab>
|
87
|
+
<x-add-native-form
|
88
|
+
v-else
|
89
|
+
ref="xAddForm"
|
90
|
+
@x-form-item-emit-func="formItemEmitFunc"
|
91
|
+
@onSubmit="submitForm"/>
|
92
|
+
<a-divider/>
|
93
|
+
<a-form v-show="!lastStep" label-align="left" :label-col="{ span: 3 }" :wrapper-col="{ span: 13 }">
|
94
|
+
<a-form-item v-if="showStepNextBtn" label="操作类型" required>
|
95
|
+
<a-radio-group v-model="operationType" @change="handleOperationTypeChange">
|
96
|
+
<a-radio value="submit">到下一步</a-radio>
|
97
|
+
<a-radio value="skip">{{ stepNextBtnTitle }}</a-radio>
|
98
|
+
</a-radio-group>
|
99
|
+
</a-form-item>
|
100
|
+
<!-- 智能分支人员选择组件 -->
|
101
|
+
<WorkflowPersonSelector ref="personSelector"/>
|
102
|
+
<a-form-item
|
103
|
+
label="下一环节截止时间"
|
104
|
+
:validate-status="deadlineValidateStatus"
|
105
|
+
:help="deadlineHelp"
|
106
|
+
required>
|
107
|
+
<a-date-picker
|
108
|
+
v-model="deadline"
|
109
|
+
value-format="YYYY-MM-DD HH:mm"
|
110
|
+
format="YYYY-MM-DD HH:mm"
|
111
|
+
:allow-clear="false"
|
112
|
+
:show-today="false"
|
113
|
+
show-time
|
114
|
+
placeholder="请选择"/>
|
115
|
+
</a-form-item>
|
116
|
+
</a-form>
|
117
|
+
<a-divider/>
|
118
|
+
<!-- 备注信息 -->
|
119
|
+
<a-textarea
|
120
|
+
v-model="note"
|
121
|
+
:auto-size="{ minRows: 3, maxRows: 5 }"
|
122
|
+
placeholder="填写本环节备注事项"
|
123
|
+
/>
|
124
|
+
<!-- 当前步骤完成后,控制流程按钮 -->
|
125
|
+
<div style="text-align: center">
|
126
|
+
<a-radio-group style="margin-top: 20px">
|
127
|
+
<a-space>
|
128
|
+
<!-- 动态按钮渲染 -->
|
129
|
+
<template v-if="buttonGroup && buttonGroup.actionArr">
|
130
|
+
<a-button
|
131
|
+
v-for="(button, index) in buttonGroup.actionArr"
|
132
|
+
:key="index"
|
133
|
+
v-show="checkButtonVisible(button)"
|
134
|
+
:type="button.type ? button.type : 'default'"
|
135
|
+
@click="handleCustomButtonClick(button)"
|
136
|
+
>
|
137
|
+
{{ button.text }}
|
138
|
+
</a-button>
|
139
|
+
</template>
|
140
|
+
<!-- 原有的按钮逻辑 -->
|
141
|
+
<template>
|
142
|
+
<a-popover v-if="operationType === 'submit'">
|
143
|
+
<template slot="content">
|
144
|
+
<p>{{ nextBtnTitle }}</p>
|
145
|
+
</template>
|
140
146
|
<a-button
|
141
|
-
v-
|
142
|
-
:
|
143
|
-
|
144
|
-
|
145
|
-
@click="handleCustomButtonClick(button)"
|
147
|
+
v-show="!lastStep"
|
148
|
+
:disabled="!showNextBtn && !stepDone"
|
149
|
+
type="primary"
|
150
|
+
@click="nextClick"
|
146
151
|
>
|
147
|
-
|
152
|
+
完成提交
|
153
|
+
<a-icon type="right"/>
|
148
154
|
</a-button>
|
149
|
-
</
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
<p>{{ nextBtnTitle }}</p>
|
155
|
-
</template>
|
156
|
-
<a-button
|
157
|
-
v-show="!lastStep"
|
158
|
-
:disabled="!showNextBtn && !stepDone"
|
159
|
-
type="primary"
|
160
|
-
@click="nextClick"
|
161
|
-
>
|
162
|
-
完成提交
|
163
|
-
<a-icon type="right"/>
|
164
|
-
</a-button>
|
165
|
-
</a-popover>
|
166
|
-
<a-popover v-else :title="stepNextBtnTitle">
|
167
|
-
<template slot="content">
|
168
|
-
<p v-for="(item,index) in stepNextBtnText" :key="index">{{ item }}</p>
|
169
|
-
</template>
|
170
|
-
<a-button
|
171
|
-
v-if="showStepNextBtn && !lastStep"
|
172
|
-
type="primary"
|
173
|
-
@click="stepNextClick"
|
174
|
-
>
|
175
|
-
跳过
|
176
|
-
</a-button>
|
177
|
-
</a-popover>
|
155
|
+
</a-popover>
|
156
|
+
<a-popover v-else :title="stepNextBtnTitle">
|
157
|
+
<template slot="content">
|
158
|
+
<p v-for="(item,index) in stepNextBtnText" :key="index">{{ item }}</p>
|
159
|
+
</template>
|
178
160
|
<a-button
|
179
|
-
v-if="lastStep"
|
161
|
+
v-if="showStepNextBtn && !lastStep"
|
180
162
|
type="primary"
|
181
|
-
@click="
|
163
|
+
@click="stepNextClick"
|
182
164
|
>
|
183
|
-
|
165
|
+
跳过
|
184
166
|
</a-button>
|
185
|
-
</
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
167
|
+
</a-popover>
|
168
|
+
<a-button
|
169
|
+
v-if="lastStep"
|
170
|
+
type="primary"
|
171
|
+
@click="lastStepNextClick"
|
172
|
+
>
|
173
|
+
确认完成
|
174
|
+
</a-button>
|
175
|
+
</template>
|
176
|
+
</a-space>
|
177
|
+
</a-radio-group>
|
178
|
+
</div>
|
179
|
+
</a-card>
|
180
|
+
</a-tab-pane>
|
192
181
|
<!-- 退回 -->
|
193
182
|
<a-tab-pane v-if="canSubmit && !beforeStepActive && showPrevBtn && !workflowState" key="2" tab="退回">
|
194
183
|
<a-form layout="vertical">
|
@@ -220,7 +209,7 @@
|
|
220
209
|
<workflow-list-resolution :workflow-project-id="workflowId" :details="details"></workflow-list-resolution>
|
221
210
|
</a-tab-pane>-->
|
222
211
|
</a-tabs>
|
223
|
-
</
|
212
|
+
</div>
|
224
213
|
</div>
|
225
214
|
</template>
|
226
215
|
|
@@ -230,23 +219,30 @@ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XF
|
|
230
219
|
import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
|
231
220
|
import { postByServiceName } from '@vue2-client/services/api/restTools'
|
232
221
|
import { workFlowViewApi } from '@vue2-client/services/api/workFlow'
|
222
|
+
import { commonApi } from '@vue2-client/services/api'
|
233
223
|
import { formatDate } from '@vue2-client/utils/util'
|
234
|
-
// import { commonApi } from '@vue2-client/services/api/common'
|
235
224
|
import { mapState } from 'vuex'
|
236
225
|
import moment from 'moment'
|
237
226
|
import FilePreview from '@vue2-client/components/FilePreview'
|
238
227
|
import WorkFlowTimeline from './WorkFlowTimeline.vue'
|
239
228
|
import { FileItem, ImageItem } from '@vue2-client/components/FileImageItem'
|
240
229
|
import WorkflowListResolution from './WorkflowListResolution'
|
241
|
-
import { commonApi } from '@vue2-client/services/api'
|
242
230
|
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
243
231
|
import * as util from '@vue2-client/utils/util'
|
244
232
|
import { getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
|
233
|
+
import LogicRunner from '@vue2-client/logic/LogicRunner'
|
245
234
|
import XTab from '@vue2-client/base-client/components/common/XTab/XTab.vue'
|
246
235
|
import WorkFlowPreview from './WorkFlowPreview'
|
236
|
+
import WorkflowPersonSelector from './components/WorkflowPersonSelector.vue'
|
247
237
|
|
248
238
|
export default {
|
249
239
|
name: 'WorkFlowHandle',
|
240
|
+
provide () {
|
241
|
+
return {
|
242
|
+
formDataChange: this.handleFormDataChange,
|
243
|
+
workflowHandleWrap: this.workflowHandleWrap
|
244
|
+
}
|
245
|
+
},
|
250
246
|
components: {
|
251
247
|
XTab,
|
252
248
|
WorkflowListResolution,
|
@@ -257,9 +253,13 @@ export default {
|
|
257
253
|
FilePreview,
|
258
254
|
FileItem,
|
259
255
|
ImageItem,
|
260
|
-
WorkFlowPreview
|
256
|
+
WorkFlowPreview,
|
257
|
+
WorkflowPersonSelector
|
261
258
|
},
|
262
259
|
computed: {
|
260
|
+
workflowHandleWrap () {
|
261
|
+
return this
|
262
|
+
},
|
263
263
|
...mapState('account', { currUser: 'user' }),
|
264
264
|
canSubmit () {
|
265
265
|
// 对于超级管理员直接认为可以提交
|
@@ -272,7 +272,7 @@ export default {
|
|
272
272
|
}
|
273
273
|
// 如果当前选中节点不是正在进行的节点,则判断viewers权限
|
274
274
|
if (this.activeStepId !== this.currentStepId) {
|
275
|
-
const activeStep = this.stepsForChild
|
275
|
+
const activeStep = this.stepsForChild.find(item => item.id === this.activeStepId)
|
276
276
|
const viewers = activeStep?.properties?.otherProperty?.viewers ?? []
|
277
277
|
if (viewers.length > 0) {
|
278
278
|
// 使用some方法判断当前人员是否满足任一条件
|
@@ -291,7 +291,7 @@ export default {
|
|
291
291
|
return true
|
292
292
|
}
|
293
293
|
} else {
|
294
|
-
const step = this.stepsForChild
|
294
|
+
const step = this.stepsForChild.find(item => item.id === this.currentStepId)
|
295
295
|
// 检查角色和部门权限
|
296
296
|
if (step && step.properties && step.properties.chargePerson) {
|
297
297
|
if (step.properties.chargePerson.personList && step.properties.chargePerson.personList.length > 0) {
|
@@ -410,11 +410,16 @@ export default {
|
|
410
410
|
// 下一环节人员信息
|
411
411
|
chargePerson: {},
|
412
412
|
// 动态按钮配置
|
413
|
-
buttonGroup: null
|
413
|
+
buttonGroup: null,
|
414
|
+
// 分支节点相关数据
|
415
|
+
branchNodes: [], // 需要选择人员的分支节点列表
|
416
|
+
branchChargePersons: {}, // 分支节点人员选择 格式:{stepId: personId}
|
417
|
+
isWfResultBranch: false, // 是否包含WF_RESULT的分支
|
418
|
+
calculatedTargetNode: null // 前台计算出的目标节点
|
414
419
|
}
|
415
420
|
},
|
416
421
|
async mounted () {
|
417
|
-
this.init()
|
422
|
+
await this.init()
|
418
423
|
// this.checkDeadline()
|
419
424
|
},
|
420
425
|
props: {
|
@@ -469,6 +474,12 @@ export default {
|
|
469
474
|
this.formCompletedData = {}
|
470
475
|
this.formCompletedDataPreview = null
|
471
476
|
this.operationType = 'submit'
|
477
|
+
|
478
|
+
// 清理分支节点相关数据
|
479
|
+
this.branchNodes = []
|
480
|
+
this.branchChargePersons = {}
|
481
|
+
this.isWfResultBranch = false
|
482
|
+
this.calculatedTargetNode = null
|
472
483
|
},
|
473
484
|
async showQueryFormItemFunc () {
|
474
485
|
if (this.attr.showQueryFormItemFunc) {
|
@@ -503,42 +514,39 @@ export default {
|
|
503
514
|
workflowId: this.workflowId
|
504
515
|
})
|
505
516
|
.then(res => {
|
506
|
-
res.state = this.stepsForChild[res.id - 1].name
|
507
517
|
this.currentStepId = res.id
|
518
|
+
const currentStep = this.stepsForChild.find(item => item.id === res.id)
|
519
|
+
res.state = currentStep.name
|
508
520
|
// 获取到当前步骤后复制下一步时间
|
509
|
-
this.deadline = this.getDefaultDeadline(
|
521
|
+
this.deadline = this.getDefaultDeadline(currentStep.properties?.otherProperty?.nextNodeInterval)
|
510
522
|
this.currentStep = res
|
511
523
|
this.getDirection()
|
512
524
|
}, err => {
|
513
525
|
console.log(err)
|
514
526
|
})
|
515
527
|
},
|
516
|
-
// 判断id是否为流程中最后一个
|
517
|
-
isLastStep (stepId) {
|
518
|
-
const lastStepId = this.stepsDefine[this.stepsDefine.length - 1].id
|
519
|
-
this.lastStep = stepId === lastStepId
|
520
|
-
},
|
521
528
|
// 完工按钮
|
522
529
|
async lastStepNextClick () {
|
523
530
|
this.$refs.xAddForm.asyncSubmit().then((res) => {
|
524
|
-
this.submitForm(res)
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
531
|
+
this.submitForm(res).then(_ => {
|
532
|
+
postByServiceName(workFlowViewApi.afterWorkFlowFinalStepSubmit, {
|
533
|
+
workflowId: this.workflowId,
|
534
|
+
stepId: this.currentStepId,
|
535
|
+
submitUser: this.currUser.name,
|
536
|
+
submitUserId: this.currUser.id
|
537
|
+
}).then(_res => {
|
538
|
+
this.saveWorkflowLog('确认完工', '最后一步: ' + this.getStepNameByStepId(this.currentStepId), { notes: this.note.trim() })
|
539
|
+
this.$message.success('已完工!')
|
540
|
+
this.loading = true
|
541
|
+
this.loadingHistory = true
|
542
|
+
this.onClose()
|
543
|
+
this.$emit('success', { note: this.note.trim(), form: res.realForm, workflowId: this.workflowId })
|
544
|
+
},
|
545
|
+
() => {
|
546
|
+
this.$message.error('提交失败!')
|
547
|
+
}
|
548
|
+
)
|
549
|
+
})
|
542
550
|
})
|
543
551
|
},
|
544
552
|
// 三个按钮点击后逻辑
|
@@ -558,29 +566,35 @@ export default {
|
|
558
566
|
})
|
559
567
|
})
|
560
568
|
this.$refs.xAddForm.asyncSubmit().then(res => {
|
561
|
-
this.submitForm(res)
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
+
this.submitForm(res).then(_ => {
|
570
|
+
postByServiceName(workFlowViewApi.submitToNextStep, extraData)
|
571
|
+
.then(
|
572
|
+
() => {
|
573
|
+
const extra = {
|
574
|
+
setHandler: this.getStepHandler(),
|
575
|
+
setDeadline: this.deadline,
|
576
|
+
notes: this.note.trim()
|
577
|
+
}
|
578
|
+
this.saveWorkflowLog('提交', this.generateStepChangeText(this.currentStepId, this.nextBtnTo), extra)
|
579
|
+
this.$message.success('提交成功')
|
580
|
+
this.loading = true
|
581
|
+
this.loadingHistory = true
|
582
|
+
this.$emit('nextClick', {
|
583
|
+
note: this.note.trim(),
|
584
|
+
form: res.realForm,
|
585
|
+
workflowId: this.workflowId,
|
586
|
+
...this.generateStepChange(this.currentStepId, this.nextBtnTo)
|
587
|
+
})
|
588
|
+
this.$emit('refresh')
|
589
|
+
this.onClose()
|
590
|
+
this.init()
|
591
|
+
},
|
592
|
+
err => {
|
593
|
+
this.$message.error('提交失败!')
|
594
|
+
console.log(err)
|
569
595
|
}
|
570
|
-
|
571
|
-
|
572
|
-
this.loading = true
|
573
|
-
this.loadingHistory = true
|
574
|
-
this.$emit('nextClick', { note: this.note.trim(), form: res.realForm, workflowId: this.workflowId, ...this.generateStepChange(this.currentStepId, this.nextBtnTo) })
|
575
|
-
this.$emit('refresh')
|
576
|
-
this.onClose()
|
577
|
-
this.init()
|
578
|
-
},
|
579
|
-
err => {
|
580
|
-
this.$message.error('提交失败!')
|
581
|
-
console.log(err)
|
582
|
-
}
|
583
|
-
)
|
596
|
+
)
|
597
|
+
})
|
584
598
|
})
|
585
599
|
},
|
586
600
|
async preClick () {
|
@@ -591,7 +605,8 @@ export default {
|
|
591
605
|
}
|
592
606
|
return postByServiceName(workFlowViewApi.updateWorkFlowState, {
|
593
607
|
stepId: this.preBtnTo,
|
594
|
-
workflowId: this.workflowId
|
608
|
+
workflowId: this.workflowId,
|
609
|
+
type: 'back'
|
595
610
|
})
|
596
611
|
.then(
|
597
612
|
res => {
|
@@ -615,72 +630,75 @@ export default {
|
|
615
630
|
return
|
616
631
|
}
|
617
632
|
this.$refs.xAddForm.asyncSubmit().then(res => {
|
618
|
-
this.submitForm(res)
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
633
|
+
this.submitForm(res).then(_ => {
|
634
|
+
postByServiceName(workFlowViewApi.submitToNextStep, extraData)
|
635
|
+
.then(
|
636
|
+
() => {
|
637
|
+
const extra = {
|
638
|
+
setHandler: this.getStepHandler(),
|
639
|
+
setDeadline: this.deadline,
|
640
|
+
notes: this.note.trim()
|
641
|
+
}
|
642
|
+
this.saveWorkflowLog('跳过', this.generateStepChangeText(this.currentStepId, this.stepNextBtnTo), extra)
|
643
|
+
this.$message.success('提交成功')
|
644
|
+
this.$emit('nextClick', {
|
645
|
+
note: this.note.trim(),
|
646
|
+
form: res.realForm,
|
647
|
+
workflowId: this.workflowId,
|
648
|
+
...this.generateStepChange(this.currentStepId, this.stepNextBtnTo)
|
649
|
+
})
|
650
|
+
this.loading = true
|
651
|
+
this.loadingHistory = true
|
652
|
+
this.$emit('refresh')
|
653
|
+
this.onClose()
|
654
|
+
this.init()
|
655
|
+
},
|
656
|
+
err => {
|
657
|
+
this.$message.error('提交失败!')
|
658
|
+
console.log(err)
|
626
659
|
}
|
627
|
-
|
628
|
-
|
629
|
-
this.$emit('nextClick', { note: this.note.trim(), form: res.realForm, workflowId: this.workflowId, ...this.generateStepChange(this.currentStepId, this.stepNextBtnTo) })
|
630
|
-
this.loading = true
|
631
|
-
this.loadingHistory = true
|
632
|
-
this.$emit('refresh')
|
633
|
-
this.onClose()
|
634
|
-
this.init()
|
635
|
-
},
|
636
|
-
err => {
|
637
|
-
this.$message.error('提交失败!')
|
638
|
-
console.log(err)
|
639
|
-
}
|
640
|
-
)
|
660
|
+
)
|
661
|
+
})
|
641
662
|
})
|
642
663
|
},
|
643
664
|
// 获取当前步骤节点,连通的节点
|
644
|
-
getDirection () {
|
665
|
+
async getDirection () {
|
645
666
|
// 获取流程定义
|
646
667
|
return postByServiceName(workFlowViewApi.getWorkFlowDefine, {
|
647
668
|
id: this.workflowId
|
648
669
|
})
|
649
|
-
.then(res => {
|
670
|
+
.then(async res => {
|
650
671
|
res = JSON.parse(res.value)
|
651
672
|
this.directions = []
|
652
673
|
this.stepsDefine = res.steps
|
653
|
-
this.resolveDirections()
|
674
|
+
await this.resolveDirections()
|
654
675
|
this.resolveStep()
|
655
676
|
}, err => {
|
656
677
|
console.log(err)
|
657
678
|
})
|
658
679
|
},
|
659
680
|
// 分析当前节点,能通向的节点
|
660
|
-
resolveDirections () {
|
661
|
-
|
662
|
-
if (
|
663
|
-
this.currentDirections =
|
664
|
-
if (item.type === 'back') {
|
665
|
-
hasBack = true
|
666
|
-
}
|
667
|
-
return true
|
668
|
-
})
|
669
|
-
}
|
670
|
-
// 默认可退回到上一步
|
671
|
-
if (!hasBack && this.currentStepId !== 1) {
|
672
|
-
this.currentDirections.push({ head: this.currentStepId, tail: this.currentStepId - 1, type: 'back' })
|
681
|
+
async resolveDirections () {
|
682
|
+
const currentStep = this.stepsForChild.find(item => item.id === this.currentStepId)
|
683
|
+
if (currentStep?.properties?.actions) {
|
684
|
+
this.currentDirections = currentStep.properties.actions
|
673
685
|
}
|
674
|
-
|
686
|
+
// 判断是否是最后ige节点
|
687
|
+
this.lastStep = (currentStep?.properties?.actions || []).filter(item => {
|
688
|
+
return item.type !== 'back'
|
689
|
+
}).length === 0
|
690
|
+
|
691
|
+
// 处理跳转按钮
|
692
|
+
this.workflowControl()
|
693
|
+
|
675
694
|
if (!this.lastStep) {
|
676
|
-
//
|
677
|
-
this.
|
695
|
+
// 分析分支节点并设置智能人员选择
|
696
|
+
await this.analyzeBranchNodes()
|
678
697
|
}
|
679
|
-
this.workflowControl()
|
680
698
|
},
|
681
699
|
// 根据步骤id获取步骤名称
|
682
700
|
getStepNameByStepId (stepId) {
|
683
|
-
return this.stepsDefine
|
701
|
+
return this.stepsDefine.find(item => item.id === stepId)?.name
|
684
702
|
},
|
685
703
|
// 表单提交的回调
|
686
704
|
submitForm (obj) {
|
@@ -710,7 +728,7 @@ export default {
|
|
710
728
|
},
|
711
729
|
// 获取当前步骤定义内容,构建组件
|
712
730
|
buildComp () {
|
713
|
-
const properties = this.stepsDefine
|
731
|
+
const properties = this.stepsDefine.find(item => item.id === this.currentStep.id).properties
|
714
732
|
// 表单的渲染
|
715
733
|
if (properties.form && properties.form.formJson) {
|
716
734
|
this.stepDefine = properties.form.formJson
|
@@ -737,34 +755,66 @@ export default {
|
|
737
755
|
},
|
738
756
|
// 根据当前节点,判断之后流程,以及按钮的显示
|
739
757
|
workflowControl () {
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
758
|
+
// 分类收集不同类型的actions
|
759
|
+
const submitActions = this.currentDirections.filter(item => item.type === 'submit')
|
760
|
+
const conditionalActions = this.currentDirections.filter(item => item.type === 'conditionalBranch')
|
761
|
+
const parallelActions = this.currentDirections.filter(item => item.type === 'parallelBranch')
|
762
|
+
const skipActions = this.currentDirections.filter(item => item.type === 'skip')
|
763
|
+
const backActions = this.currentDirections.filter(item => item.type === 'back')
|
764
|
+
|
765
|
+
// 处理提交按钮 - 优先级:submit > conditionalBranch > parallelBranch
|
766
|
+
if (submitActions.length > 0) {
|
767
|
+
this.showNextBtn = true
|
768
|
+
this.nextBtnTo = submitActions[0].to // 如果有多个submit,取第一个作为主要跳转目标
|
769
|
+
if (submitActions.length === 1) {
|
770
|
+
this.nextBtnTitle = '进行下一环节:' + this.getStepNameByStepId(submitActions[0].to)
|
771
|
+
} else {
|
772
|
+
this.nextBtnTitle = '将进入以下环节:' + submitActions.map(item => this.getStepNameByStepId(item.to)).join(' , ')
|
773
|
+
}
|
774
|
+
} else if (conditionalActions.length > 0) {
|
775
|
+
this.showNextBtn = true
|
776
|
+
this.nextBtnTo = conditionalActions[0].to // 条件分支的第一个作为主要跳转目标
|
777
|
+
const targetSteps = conditionalActions.map(item => this.getStepNameByStepId(item.to)).join(' , ')
|
778
|
+
this.nextBtnTitle = '后台判断后跳转到:' + targetSteps
|
779
|
+
} else if (parallelActions.length > 0) {
|
780
|
+
this.showNextBtn = true
|
781
|
+
this.nextBtnTo = parallelActions[0].to // 并行分支的第一个作为主要跳转目标
|
782
|
+
const targetSteps = parallelActions.map(item => this.getStepNameByStepId(item.to)).join(' , ')
|
783
|
+
this.nextBtnTitle = '将并行进入以下分支:' + targetSteps
|
784
|
+
}
|
785
|
+
|
786
|
+
// 处理跳过按钮
|
787
|
+
if (skipActions.length > 0) {
|
788
|
+
this.showStepNextBtn = true
|
789
|
+
this.stepNextBtnTo = skipActions[0].to
|
790
|
+
if (skipActions.length === 1) {
|
791
|
+
this.stepNextBtnTitle = '跳至:' + this.getStepNameByStepId(skipActions[0].to) + '环节'
|
749
792
|
this.stepNextBtnText.push('将跳过以下环节:')
|
750
|
-
for (let i = this.currentStepId; i <
|
793
|
+
for (let i = this.currentStepId; i < skipActions[0].to - 1; i++) {
|
751
794
|
this.stepNextBtnText.push(this.stepsDefine[i].name)
|
752
795
|
}
|
753
|
-
} else
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
this.
|
796
|
+
} else {
|
797
|
+
const targetSteps = skipActions.map(item => this.getStepNameByStepId(item.to)).join(' , ')
|
798
|
+
this.stepNextBtnTitle = '跳至:' + targetSteps
|
799
|
+
}
|
800
|
+
}
|
801
|
+
|
802
|
+
// 处理退回按钮
|
803
|
+
if (backActions.length > 0) {
|
804
|
+
const backAction = backActions[0] // 通常只有一个back action
|
805
|
+
for (let i = this.currentStepId - 1; i > 0; i--) {
|
806
|
+
if (backAction.to >= i && this.stepsForChild.find(item => item.id === i)?.handler) {
|
807
|
+
this.preBtnTo = i
|
808
|
+
this.preBtnTitle = '回退至:' + this.getStepNameByStepId(i) + '环节'
|
809
|
+
this.showPrevBtn = true
|
810
|
+
break
|
811
|
+
} else {
|
812
|
+
this.preBtnText.push(this.getStepNameByStepId(i))
|
766
813
|
}
|
767
814
|
}
|
815
|
+
if (this.preBtnText.length) {
|
816
|
+
this.preBtnText.unshift('将跳过以下环节:')
|
817
|
+
}
|
768
818
|
}
|
769
819
|
},
|
770
820
|
// 获取表单字段实际值
|
@@ -779,7 +829,7 @@ export default {
|
|
779
829
|
// 加载完成
|
780
830
|
resolveStep () {
|
781
831
|
// 获取当前步骤的按钮组配置
|
782
|
-
const currentStep = this.stepsDefine
|
832
|
+
const currentStep = this.stepsDefine.find(item => item.id === this.currentStepId)
|
783
833
|
if (currentStep && currentStep.properties && currentStep.properties.buttonGroup) {
|
784
834
|
this.buttonGroup = currentStep.properties.buttonGroup
|
785
835
|
} else {
|
@@ -789,6 +839,7 @@ export default {
|
|
789
839
|
},
|
790
840
|
// 流程图组件给当前组件传值用,stepNo为用户点击的非当前步骤
|
791
841
|
async activeStep (stepId) {
|
842
|
+
console.log('activeStep', stepId)
|
792
843
|
// 开启加载
|
793
844
|
this.loadingHistory = true
|
794
845
|
this.activeStepId = stepId
|
@@ -806,7 +857,8 @@ export default {
|
|
806
857
|
formCompletedDataPreview = JSON.parse(JSON.stringify(this.formCompletedData))
|
807
858
|
// 使用字段定义中内容,将回显数据的列名,替换为定义的中文名
|
808
859
|
const formData = formCompletedDataPreview.data
|
809
|
-
const
|
860
|
+
const currentStepDefine = this.stepsDefine.find(item => item.id === stepId)
|
861
|
+
const isKeyHandle = currentStepDefine?.properties?.form?.isKeyHandle || false
|
810
862
|
for (const key in formData) {
|
811
863
|
for (let i = 0; i < this.targetStepDefine.length; i++) {
|
812
864
|
const stepDefine = this.targetStepDefine[i]
|
@@ -837,19 +889,15 @@ export default {
|
|
837
889
|
formCompletedDataPreview.data = null
|
838
890
|
}
|
839
891
|
// 备注
|
840
|
-
formCompletedDataPreview.note = this.stepsForChild
|
892
|
+
formCompletedDataPreview.note = this.stepsForChild.find(item => item.id === stepId)?.note
|
841
893
|
if (!formCompletedDataPreview.data && !formCompletedDataPreview.files.length && !formCompletedDataPreview.images.length && !formCompletedDataPreview.note) {
|
842
894
|
formCompletedDataPreview = null
|
843
895
|
}
|
844
896
|
this.formCompletedDataPreview = formCompletedDataPreview
|
845
897
|
// 渲染已完成步骤的Tab
|
846
|
-
const properties = this.stepsDefine
|
898
|
+
const properties = this.stepsDefine.find(item => item.id === stepId).properties
|
847
899
|
this.tabDesigner = properties.tabDesigner
|
848
|
-
|
849
|
-
this.showTab = true
|
850
|
-
} else {
|
851
|
-
this.showTab = false
|
852
|
-
}
|
900
|
+
this.showTab = !!this.tabDesigner
|
853
901
|
// 完成
|
854
902
|
this.loadingHistory = false
|
855
903
|
this.beforeStepActive = this.activeStepName !== this.currentStep.state
|
@@ -884,11 +932,28 @@ export default {
|
|
884
932
|
// if (!this.checkDeadline(true)) {
|
885
933
|
// return false
|
886
934
|
// }
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
935
|
+
|
936
|
+
// 验证人员选择
|
937
|
+
if (this.needSelectPerson) {
|
938
|
+
if (this.isWfResultBranch) {
|
939
|
+
// 多分支情况:检查是否所有需要的分支都选择了人员
|
940
|
+
const missingSelections = this.branchNodes.filter(node => !this.branchChargePersons[node.stepId])
|
941
|
+
if (missingSelections.length > 0) {
|
942
|
+
const missingNames = missingSelections.map(node => node.stepName).join('、')
|
943
|
+
this.$message.error(`请设置以下节点的处理人:${missingNames}`)
|
944
|
+
return false
|
945
|
+
}
|
946
|
+
} else {
|
947
|
+
// 单分支情况:检查是否选择了处理人
|
948
|
+
if (!this.checkedChargePerson) {
|
949
|
+
this.$message.error('请设置下一环节处理人')
|
950
|
+
return false
|
951
|
+
}
|
952
|
+
}
|
891
953
|
}
|
954
|
+
|
955
|
+
const stepHandler = this.getStepHandler()
|
956
|
+
|
892
957
|
return {
|
893
958
|
workflowId: this.workflowId,
|
894
959
|
stepId,
|
@@ -899,20 +964,50 @@ export default {
|
|
899
964
|
personList: this.chargePerson.personList,
|
900
965
|
deadline: this.deadline,
|
901
966
|
submitUser: this.currUser.name,
|
902
|
-
submitUserId: this.currUser.id
|
967
|
+
submitUserId: this.currUser.id,
|
968
|
+
// 新增:分支节点信息
|
969
|
+
branchChargePersons: this.branchChargePersons
|
903
970
|
}
|
904
971
|
},
|
905
972
|
// 获取当前选择的负责人
|
906
973
|
getStepHandler () {
|
907
974
|
let stepHandler
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
975
|
+
|
976
|
+
if (this.isWfResultBranch) {
|
977
|
+
// 多分支情况:返回所有已选择的人员信息
|
978
|
+
const selectedHandlers = []
|
979
|
+
for (const node of this.branchNodes) {
|
980
|
+
const personId = this.branchChargePersons[node.stepId]
|
981
|
+
if (personId) {
|
982
|
+
const personName = this.getBranchPersonName(node.stepId)
|
983
|
+
selectedHandlers.push(`${node.stepName}:${personName}`)
|
984
|
+
}
|
985
|
+
}
|
986
|
+
stepHandler = selectedHandlers.join(';')
|
987
|
+
} else {
|
988
|
+
// 单分支情况:原有逻辑
|
989
|
+
if (this.checkedChargePerson) {
|
990
|
+
// 使用 value 找到对应的 label
|
991
|
+
stepHandler = this.chargePersonOptions.find(item => item.value === this.checkedChargePerson)?.label
|
992
|
+
} else if (this.chargePerson.personList && this.chargePerson.personList.length > 0) {
|
993
|
+
stepHandler = this.chargePerson.personList.map(item => item.name).join(',')
|
994
|
+
}
|
913
995
|
}
|
996
|
+
|
914
997
|
return stepHandler
|
915
998
|
},
|
999
|
+
|
1000
|
+
// 获取分支节点选择的人员姓名
|
1001
|
+
getBranchPersonName (stepId) {
|
1002
|
+
const personId = this.branchChargePersons[stepId]
|
1003
|
+
if (!personId) return ''
|
1004
|
+
|
1005
|
+
const node = this.branchNodes.find(n => n.stepId === stepId)
|
1006
|
+
if (!node) return ''
|
1007
|
+
|
1008
|
+
const person = node.chargePersonOptions.find(p => p.value === personId)
|
1009
|
+
return person ? person.label : ''
|
1010
|
+
},
|
916
1011
|
// 生成工作流日志步骤变化描述
|
917
1012
|
generateStepChangeText (fromStepId, toStepId) {
|
918
1013
|
return `第${fromStepId}步: ${this.getStepNameByStepId(fromStepId)} --> 第${toStepId}步: ${this.getStepNameByStepId(toStepId)}`
|
@@ -970,86 +1065,13 @@ export default {
|
|
970
1065
|
return true
|
971
1066
|
},
|
972
1067
|
// 操作类型单选按钮改变时重新设置负责人选择框
|
973
|
-
handleOperationTypeChange (event) {
|
1068
|
+
async handleOperationTypeChange (event) {
|
974
1069
|
this.checkedChargePerson = undefined
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
this.setChargePersonOptions(this.stepNextBtnTo)
|
979
|
-
}
|
1070
|
+
this.branchChargePersons = {}
|
1071
|
+
// 重新分析分支节点
|
1072
|
+
await this.analyzeBranchNodes()
|
980
1073
|
},
|
981
|
-
// 从指定步骤设置负责人下拉选择框
|
982
|
-
async setChargePersonOptions (stepId) {
|
983
|
-
this.checkedChargePerson = undefined
|
984
|
-
const define = this.stepsDefine[stepId - 1]
|
985
|
-
const defineProperties = define.properties
|
986
|
-
// chargePerson 改造 旧数据类型是 {chrgePerson: {role: '1', department: '1'}}
|
987
|
-
// 新数据类型是
|
988
|
-
// "chargePerson": {
|
989
|
-
// "personList": [
|
990
|
-
// {
|
991
|
-
// "type": "department",
|
992
|
-
// "name": "营业厅"
|
993
|
-
// },
|
994
|
-
// {
|
995
|
-
// "type": "role",
|
996
|
-
// "name": "管理员"
|
997
|
-
// }
|
998
|
-
// ],
|
999
|
-
// "needSelectPerson": true
|
1000
|
-
// }
|
1001
|
-
const chargePerson = defineProperties.chargePerson
|
1002
|
-
if (!chargePerson) {
|
1003
|
-
this.needSelectPerson = false
|
1004
|
-
this.chargePersonOptions = []
|
1005
|
-
return
|
1006
|
-
}
|
1007
|
-
// 如果是旧的格式 转换成新的格式后再作处理
|
1008
|
-
if (chargePerson.role || chargePerson.department) {
|
1009
|
-
chargePerson.needSelectPerson = true
|
1010
|
-
chargePerson.personList = [{ type: chargePerson.role ? 'role' : 'department', name: chargePerson.role || chargePerson.department }]
|
1011
|
-
}
|
1012
|
-
this.needSelectPerson = chargePerson.needSelectPerson
|
1013
|
-
this.chargePerson = chargePerson
|
1014
|
-
const chargePersonOptions = []
|
1015
|
-
// 如果需要选择人员 则在这里选择人员 否则 后台选择人员 这里不处理
|
1016
|
-
if (chargePerson.needSelectPerson) {
|
1017
|
-
// 获取所有用户信息
|
1018
|
-
const allUser = await postByServiceName(commonApi.getAllUserOptionList, {})
|
1019
|
-
|
1020
|
-
// 使用reduce累积结果
|
1021
|
-
const options = chargePerson.personList.reduce((acc, personItem) => {
|
1022
|
-
let filteredUsers = []
|
1023
1074
|
|
1024
|
-
if (personItem.type === 'role') {
|
1025
|
-
// 根据角色获取人员
|
1026
|
-
filteredUsers = allUser.filter(user =>
|
1027
|
-
user.rolestr && user.rolestr.split(',').includes(personItem.name)
|
1028
|
-
).map(user => {
|
1029
|
-
return { label: user.label, value: user.value }
|
1030
|
-
})
|
1031
|
-
} else if (personItem.type === 'department') {
|
1032
|
-
// 根据部门获取人员
|
1033
|
-
filteredUsers = allUser.filter(user =>
|
1034
|
-
user.depname === personItem.name
|
1035
|
-
).map(user => {
|
1036
|
-
return { label: user.label, value: user.value }
|
1037
|
-
})
|
1038
|
-
}
|
1039
|
-
|
1040
|
-
return [...acc, ...filteredUsers]
|
1041
|
-
}, [])
|
1042
|
-
|
1043
|
-
// 去重处理
|
1044
|
-
const uniqueOptions = Array.from(new Map(options.map(item => [item.value, item])).values())
|
1045
|
-
chargePersonOptions.push(...uniqueOptions)
|
1046
|
-
}
|
1047
|
-
this.chargePersonOptions = chargePersonOptions
|
1048
|
-
// 默认选中下一环节负责人
|
1049
|
-
if (this.chargePersonOptions.length === 1) {
|
1050
|
-
this.checkedChargePerson = this.chargePersonOptions[0].value
|
1051
|
-
}
|
1052
|
-
},
|
1053
1075
|
// 处理动态按钮点击
|
1054
1076
|
handleCustomButtonClick (button) {
|
1055
1077
|
try {
|
@@ -1084,7 +1106,225 @@ export default {
|
|
1084
1106
|
},
|
1085
1107
|
formItemEmitFunc (func, data, value) {
|
1086
1108
|
this.$emit('x-form-item-emit-func', func, data, value)
|
1087
|
-
}
|
1109
|
+
},
|
1110
|
+
// 检查条件表达式是否包含WF_RESULT
|
1111
|
+
checkIfContainsWfResult () {
|
1112
|
+
const conditionalActions = this.currentDirections.filter(action => action.type === 'conditionalBranch')
|
1113
|
+
if (conditionalActions.length === 0) return false
|
1114
|
+
|
1115
|
+
return conditionalActions.some(action => {
|
1116
|
+
return action.expression && action.expression.includes('WF_RESULT')
|
1117
|
+
})
|
1118
|
+
},
|
1119
|
+
|
1120
|
+
// 分析分支节点并设置选择框
|
1121
|
+
async analyzeBranchNodes () {
|
1122
|
+
const conditionalActions = this.currentDirections.filter(action => action.type === 'conditionalBranch')
|
1123
|
+
// 如果没有分支节点,处理普通单线流程
|
1124
|
+
if (conditionalActions.length === 0) {
|
1125
|
+
this.branchNodes = []
|
1126
|
+
this.isWfResultBranch = false
|
1127
|
+
|
1128
|
+
await this.handleNormalFlow()
|
1129
|
+
return
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
this.isWfResultBranch = this.checkIfContainsWfResult()
|
1133
|
+
|
1134
|
+
if (this.isWfResultBranch) {
|
1135
|
+
// 包含WF_RESULT,需要显示所有可能分支的人员选择
|
1136
|
+
await this.setupMultipleBranchSelection(conditionalActions)
|
1137
|
+
} else {
|
1138
|
+
this.branchNodes = []
|
1139
|
+
// 不包含WF_RESULT,可以前台实时计算
|
1140
|
+
await this.calculateTargetNodeFromForm(conditionalActions)
|
1141
|
+
}
|
1142
|
+
},
|
1143
|
+
|
1144
|
+
// 根据表单数据计算目标节点
|
1145
|
+
async calculateTargetNodeFromForm (conditionalActions = null) {
|
1146
|
+
if (!conditionalActions) {
|
1147
|
+
conditionalActions = this.currentDirections.filter(action => action.type === 'conditionalBranch')
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
if (conditionalActions.length === 0) return
|
1151
|
+
|
1152
|
+
try {
|
1153
|
+
const formData = this.$refs.xAddForm?.form || {}
|
1154
|
+
|
1155
|
+
// 遍历条件找到匹配的
|
1156
|
+
for (const action of conditionalActions) {
|
1157
|
+
if (action.expression) {
|
1158
|
+
const result = await this.evaluateExpression(action.expression, formData)
|
1159
|
+
if (result) {
|
1160
|
+
this.calculatedTargetNode = action.to
|
1161
|
+
// 设置对应节点的人员选择
|
1162
|
+
const stepDefine = this.stepsDefine.find(step => step.id === action.to)
|
1163
|
+
if (stepDefine?.properties?.chargePerson?.needSelectPerson) {
|
1164
|
+
this.chargePerson = stepDefine?.properties?.chargePerson
|
1165
|
+
this.checkedChargePerson = undefined
|
1166
|
+
this.chargePersonOptions = await this.getChargePersonOptionsForStep(action.to)
|
1167
|
+
// 如果只有一个选项,自动选中
|
1168
|
+
if (this.chargePersonOptions.length === 1) {
|
1169
|
+
this.checkedChargePerson = this.chargePersonOptions[0].value
|
1170
|
+
}
|
1171
|
+
this.needSelectPerson = true
|
1172
|
+
} else {
|
1173
|
+
this.needSelectPerson = false
|
1174
|
+
this.chargePersonOptions = []
|
1175
|
+
}
|
1176
|
+
return
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
}
|
1180
|
+
// 如果没有匹配的条件,清空选择
|
1181
|
+
this.calculatedTargetNode = null
|
1182
|
+
this.needSelectPerson = false
|
1183
|
+
this.chargePersonOptions = []
|
1184
|
+
} catch (error) {
|
1185
|
+
console.warn('计算目标节点失败:', error)
|
1186
|
+
this.calculatedTargetNode = null
|
1187
|
+
}
|
1188
|
+
},
|
1189
|
+
|
1190
|
+
// 表达式评估 - 使用 LogicRunner
|
1191
|
+
async evaluateExpression (expression, formData) {
|
1192
|
+
try {
|
1193
|
+
// 构建参数对象,传递当前表单数据
|
1194
|
+
const params = {
|
1195
|
+
WF_FORM: { ...formData }
|
1196
|
+
}
|
1197
|
+
|
1198
|
+
// 使用 LogicRunner 执行表达式
|
1199
|
+
const result = await LogicRunner.runExpression(expression, params)
|
1200
|
+
return result
|
1201
|
+
} catch (error) {
|
1202
|
+
console.warn('表达式评估失败:', expression, error)
|
1203
|
+
return false
|
1204
|
+
}
|
1205
|
+
},
|
1206
|
+
|
1207
|
+
// 获取指定步骤的人员选项
|
1208
|
+
async getChargePersonOptionsForStep (stepId) {
|
1209
|
+
const define = this.stepsDefine.find(item => item.id === stepId)
|
1210
|
+
if (!define?.properties?.chargePerson) return []
|
1211
|
+
|
1212
|
+
const chargePerson = define.properties.chargePerson
|
1213
|
+
this.chargePerson = chargePerson
|
1214
|
+
// 如果是旧的格式 转换成新的格式
|
1215
|
+
if (chargePerson.role || chargePerson.department) {
|
1216
|
+
chargePerson.needSelectPerson = true
|
1217
|
+
chargePerson.personList = [{
|
1218
|
+
type: chargePerson.role ? 'role' : 'department',
|
1219
|
+
name: chargePerson.role || chargePerson.department
|
1220
|
+
}]
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
if (!chargePerson.needSelectPerson || !chargePerson.personList) return []
|
1224
|
+
|
1225
|
+
// 获取所有用户信息
|
1226
|
+
const allUser = await postByServiceName(commonApi.getAllUserOptionList, {})
|
1227
|
+
|
1228
|
+
// 使用reduce累积结果
|
1229
|
+
const options = chargePerson.personList.reduce((acc, personItem) => {
|
1230
|
+
let filteredUsers = []
|
1231
|
+
|
1232
|
+
if (personItem.type === 'role') {
|
1233
|
+
filteredUsers = allUser.filter(user =>
|
1234
|
+
user.rolestr && user.rolestr.split(',').includes(personItem.name)
|
1235
|
+
).map(user => ({
|
1236
|
+
label: user.label,
|
1237
|
+
value: user.value
|
1238
|
+
}))
|
1239
|
+
} else if (personItem.type === 'department') {
|
1240
|
+
filteredUsers = allUser.filter(user =>
|
1241
|
+
user.depname === personItem.name
|
1242
|
+
).map(user => ({
|
1243
|
+
label: user.label,
|
1244
|
+
value: user.value
|
1245
|
+
}))
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
return [...acc, ...filteredUsers]
|
1249
|
+
}, [])
|
1250
|
+
|
1251
|
+
// 去重处理
|
1252
|
+
return Array.from(new Map(options.map(item => [item.value, item])).values())
|
1253
|
+
},
|
1254
|
+
|
1255
|
+
// 设置多分支人员选择(包含WF_RESULT的情况)
|
1256
|
+
async setupMultipleBranchSelection (conditionalActions) {
|
1257
|
+
this.branchNodes = []
|
1258
|
+
this.branchChargePersons = {}
|
1259
|
+
|
1260
|
+
for (const action of conditionalActions) {
|
1261
|
+
const stepDefine = this.stepsDefine.find(step => step.id === action.to)
|
1262
|
+
if (stepDefine?.properties?.chargePerson?.needSelectPerson) {
|
1263
|
+
// 都使用多分支了 肯定是新数据 那么不用做兼容处理
|
1264
|
+
this.chargePerson = stepDefine?.properties?.chargePerson
|
1265
|
+
// 获取这个节点的人员选项
|
1266
|
+
const chargePersonOptions = await this.getChargePersonOptionsForStep(action.to)
|
1267
|
+
|
1268
|
+
this.branchNodes.push({
|
1269
|
+
stepId: action.to,
|
1270
|
+
stepName: this.getStepNameByStepId(action.to),
|
1271
|
+
chargePerson: stepDefine.properties.chargePerson,
|
1272
|
+
chargePersonOptions: chargePersonOptions
|
1273
|
+
})
|
1274
|
+
// 初始化选择值
|
1275
|
+
this.branchChargePersons[action.to] = undefined
|
1276
|
+
} else {
|
1277
|
+
this.branchChargePersons[action.to] = stepDefine?.properties?.chargePerson
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
// 如果没有需要选择人员的分支,隐藏选择区域
|
1282
|
+
this.needSelectPerson = this.branchNodes.length > 0
|
1283
|
+
},
|
1284
|
+
|
1285
|
+
// 处理普通单线流程(没有分支的情况)
|
1286
|
+
async handleNormalFlow () {
|
1287
|
+
let targetStepId = this.nextBtnTo
|
1288
|
+
if (this.operationType === 'skip') {
|
1289
|
+
targetStepId = this.stepNextBtnTo
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
this.calculatedTargetNode = targetStepId
|
1293
|
+
const stepDefine = this.stepsDefine.find(step => step.id === targetStepId)
|
1294
|
+
const defineProperties = stepDefine.properties
|
1295
|
+
this.chargePerson = defineProperties?.chargePerson
|
1296
|
+
if (defineProperties.chargePerson?.role || defineProperties.chargePerson?.department) {
|
1297
|
+
defineProperties.chargePerson.needSelectPerson = true
|
1298
|
+
defineProperties.chargePerson.personList = [{
|
1299
|
+
type: defineProperties.chargePerson.role ? 'role' : 'department',
|
1300
|
+
name: defineProperties.chargePerson.role || defineProperties.chargePerson.department
|
1301
|
+
}]
|
1302
|
+
}
|
1303
|
+
console.warn('defineProperties', defineProperties)
|
1304
|
+
|
1305
|
+
if (defineProperties?.chargePerson?.needSelectPerson) {
|
1306
|
+
// 获取人员选项并设置
|
1307
|
+
this.checkedChargePerson = undefined
|
1308
|
+
this.chargePersonOptions = await this.getChargePersonOptionsForStep(targetStepId)
|
1309
|
+
// 如果只有一个选项,自动选中
|
1310
|
+
if (this.chargePersonOptions.length === 1) {
|
1311
|
+
this.checkedChargePerson = this.chargePersonOptions[0].value
|
1312
|
+
}
|
1313
|
+
this.needSelectPerson = true
|
1314
|
+
console.warn('设置人员选择,选项数量:', this.chargePersonOptions.length)
|
1315
|
+
} else {
|
1316
|
+
this.branchChargePersons[targetStepId] = stepDefine?.properties?.chargePerson
|
1317
|
+
this.needSelectPerson = false
|
1318
|
+
this.chargePersonOptions = []
|
1319
|
+
console.warn('无需选择人员')
|
1320
|
+
}
|
1321
|
+
},
|
1322
|
+
// 表单数据变化处理函数(将通过provide传递给表单组件)
|
1323
|
+
async handleFormDataChange (formData) {
|
1324
|
+
if (!this.isWfResultBranch) {
|
1325
|
+
await this.calculateTargetNodeFromForm()
|
1326
|
+
}
|
1327
|
+
},
|
1088
1328
|
},
|
1089
1329
|
watch: {}
|
1090
1330
|
}
|
@@ -1094,23 +1334,29 @@ export default {
|
|
1094
1334
|
margin-top: 8px;
|
1095
1335
|
margin-bottom: 8px;
|
1096
1336
|
}
|
1097
|
-
|
1337
|
+
|
1338
|
+
:deep(.ant-result) {
|
1098
1339
|
padding: 0;
|
1099
1340
|
}
|
1341
|
+
|
1100
1342
|
.descriptionPreviewItem {
|
1101
1343
|
margin-bottom: 22px;
|
1344
|
+
|
1102
1345
|
:deep(.ant-descriptions-view) {
|
1103
1346
|
overflow: visible;
|
1104
1347
|
}
|
1105
1348
|
}
|
1349
|
+
|
1106
1350
|
.allWidth {
|
1107
1351
|
:deep(.ant-descriptions-item-content) {
|
1108
1352
|
width: 100%;
|
1109
1353
|
}
|
1110
1354
|
}
|
1355
|
+
|
1111
1356
|
.descriptionTitle {
|
1112
1357
|
position: relative;
|
1113
1358
|
padding-left: 12px;
|
1359
|
+
|
1114
1360
|
&::before {
|
1115
1361
|
content: '';
|
1116
1362
|
position: absolute;
|