vue2-client 1.9.78 → 1.9.79
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/.env +19 -19
- package/.env.gaslink +19 -19
- package/.env.his +19 -19
- package/.env.revenue +19 -19
- package/.eslintrc.js +90 -90
- package/CHANGELOG.md +824 -824
- package/Components.md +60 -60
- package/babel.config.js +21 -21
- 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/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +143 -143
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.config.js +21 -21
- package/jest.setup.js +7 -7
- package/package.json +1 -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/App.vue +192 -192
- 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/common/AMisRender/index.js +3 -3
- package/src/base-client/components/common/AMisRender/index.vue +263 -263
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +470 -470
- 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/CitySelect.vue +342 -342
- 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/FormGroupEdit.vue +149 -149
- 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/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/Upload.vue +239 -239
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +107 -107
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +868 -868
- package/src/base-client/components/common/XAddNativeForm/demo.vue +30 -30
- 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/XAddReport.vue +207 -207
- 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/XConversation/XConversation.vue +140 -140
- package/src/base-client/components/common/XConversation/XConversationDemo.vue +28 -28
- package/src/base-client/components/common/XDataCard/XDataCard.vue +420 -420
- 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/XDescriptions/XDescriptions.vue +169 -169
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +304 -304
- package/src/base-client/components/common/XDescriptions/demo.vue +50 -50
- 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/XForm.vue +340 -340
- package/src/base-client/components/common/XForm/XFormItem.vue +4 -3
- package/src/base-client/components/common/XForm/XTreeSelect.vue +250 -250
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XFormCol/XFormCol.vue +96 -96
- package/src/base-client/components/common/XFormGroup/XFormGroup.vue +261 -261
- package/src/base-client/components/common/XFormGroup/demo.vue +45 -45
- 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/XFormTable.vue +713 -713
- package/src/base-client/components/common/XFormTable/demo.vue +76 -76
- package/src/base-client/components/common/XFormTable/index.md +92 -92
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +162 -162
- 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/XReport/XReport.vue +892 -892
- package/src/base-client/components/common/XReport/XReportDemo.vue +304 -304
- 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/XReportTrGroup.vue +808 -808
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XReport/index.md +44 -44
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +201 -201
- package/src/base-client/components/common/XReportDrawer/index.js +3 -3
- package/src/base-client/components/common/XReportGrid/XReport.vue +995 -959
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +42 -42
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +557 -557
- package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +999 -999
- 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/XReportGrid/print.js +184 -184
- 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 +201 -201
- 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/TableCellRenderer.vue +161 -161
- package/src/base-client/components/common/XTable/XTable.vue +1191 -1191
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTree/XTree.vue +423 -423
- package/src/base-client/components/common/XTree/XTreePro.vue +434 -434
- 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/XHisEditor.vue +203 -203
- 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/XPageView/RenderRow.vue +63 -63
- package/src/base-client/components/layout/XPageView/XErrorView.vue +11 -11
- package/src/base-client/components/layout/XPageView/XPageView.vue +155 -155
- package/src/base-client/components/layout/XPageView/index.js +3 -3
- package/src/base-client/components/layout/XPageView/index.md +38 -38
- 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/AppData.js +121 -121
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/GetLoginInfoService.js +183 -183
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/bootstrap.js +39 -39
- package/src/components/CodeMirror/inedx.vue +118 -118
- package/src/components/CodeMirror/setting.js +40 -40
- package/src/components/FilePreview/FilePreview.vue +166 -166
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/STable/index.js +380 -380
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/tool/AStepItem.vue +60 -60
- 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/GridView.vue +45 -45
- 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/tabs/TabsHead.vue +189 -189
- package/src/layouts/tabs/TabsView.vue +389 -389
- package/src/lib.js +1 -1
- package/src/main.js +30 -30
- 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 +76 -0
- package/src/pages/ReportGrid/index.vue +76 -76
- package/src/pages/ServiceReview/index.vue +284 -284
- package/src/pages/SubExample/index.vue +26 -26
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +32 -32
- package/src/pages/WorkflowDetail/WorkflowDetail.vue +230 -230
- package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +131 -131
- package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +302 -302
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformationDetails.vue +276 -276
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +864 -864
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandleReso.vue +997 -997
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +222 -222
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +233 -233
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +261 -261
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +248 -248
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowLog.vue +73 -73
- package/src/pages/XPageViewExample/index.vue +38 -38
- package/src/pages/XReportView/index.vue +64 -64
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- 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/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/plugins/EventLogPlugin.js +33 -33
- package/src/plugins/FindParentsData.js +17 -17
- package/src/router/async/config.async.js +1 -0
- package/src/router/async/router.map.js +183 -183
- package/src/router/guards.js +263 -263
- package/src/router/index.js +27 -27
- package/src/router.js +19 -19
- package/src/services/api/TicketDetailsViewApi.js +46 -46
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +329 -329
- package/src/services/api/entity.js +18 -18
- package/src/services/api/index.js +17 -17
- package/src/services/api/restTools.js +67 -67
- package/src/services/api/workFlow.js +63 -63
- package/src/services/apiService.js +15 -15
- package/src/services/user.js +90 -90
- package/src/services/v3Api.js +116 -116
- 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/indexedDB.js +263 -263
- 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/microAppUtils.js +40 -40
- package/src/utils/reg.js +95 -95
- package/src/utils/request.js +362 -362
- package/src/utils/routerUtil.js +450 -450
- package/src/utils/runEvalFunction.js +14 -14
- package/src/utils/util.js +313 -313
- package/src/utils/waterMark.js +31 -31
- package/test/Amis.spec.js +163 -163
- package/test/Tree.spec.js +167 -167
- package/test/myDialog.spec.js +46 -46
- package/test/util.test.js +36 -36
- package/test/v3Api.test.js +1983 -1983
- package/vue.config.js +199 -199
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
- /package/src/base-client/components/common/Recording/{Recoding.vue → Recording.vue} +0 -0
@@ -1,713 +1,713 @@
|
|
1
|
-
<template>
|
2
|
-
<a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
|
3
|
-
<a-col
|
4
|
-
:xs="14"
|
5
|
-
:sm="14"
|
6
|
-
:md="12"
|
7
|
-
:lg="9"
|
8
|
-
:xl="6"
|
9
|
-
:xxl="5"
|
10
|
-
v-if="xTreeConfigName"
|
11
|
-
:style="{ maxWidth: '400px'}">
|
12
|
-
<x-tree-pro
|
13
|
-
:config-name="xTreeConfigName"
|
14
|
-
:env="env"
|
15
|
-
@action="action"
|
16
|
-
@btnFuncClick="treeBtnFuncClick"
|
17
|
-
@treeOnChecked="treeOnChecked"
|
18
|
-
ref="xtree"
|
19
|
-
></x-tree-pro>
|
20
|
-
</a-col>
|
21
|
-
<a-col
|
22
|
-
:xs="xTreeConfigName ? 10 : 24"
|
23
|
-
:sm="xTreeConfigName ? 10 : 24"
|
24
|
-
:md="xTreeConfigName ? 12 : 24"
|
25
|
-
:lg="xTreeConfigName ? 15 : 24"
|
26
|
-
:xl="xTreeConfigName ? 18 : 24"
|
27
|
-
:xxl="xTreeConfigName ? 19 : 24">
|
28
|
-
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
|
29
|
-
<a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
|
30
|
-
<div v-show="!loading">
|
31
|
-
<template v-if="!loadError">
|
32
|
-
<x-add-form
|
33
|
-
ref="xAddForm"
|
34
|
-
@onLocalSubmit="onLocalSubmit"
|
35
|
-
@afterSubmit="onAddOrEditSubmitAfterSubmit"
|
36
|
-
>
|
37
|
-
<template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
|
38
|
-
<slot
|
39
|
-
name="groupFormItems"
|
40
|
-
:form="form"
|
41
|
-
:model="model"
|
42
|
-
:rules="rules"
|
43
|
-
:modifyModelData="modifyModelData"></slot>
|
44
|
-
</template>
|
45
|
-
</x-add-form>
|
46
|
-
<x-add-report
|
47
|
-
v-if="moveType"
|
48
|
-
ref="xAddReport"
|
49
|
-
>
|
50
|
-
</x-add-report>
|
51
|
-
<div v-if="crudTitle" class="crud_title">
|
52
|
-
{{ crudTitle }}
|
53
|
-
</div>
|
54
|
-
<x-form
|
55
|
-
ref="xForm"
|
56
|
-
@toggleAdvanced="toggleAdvanced"
|
57
|
-
@onSubmit="onSearchSubmit">
|
58
|
-
<slot name="formBtnExpand"></slot>
|
59
|
-
</x-form>
|
60
|
-
<x-table
|
61
|
-
ref="xTable"
|
62
|
-
:fixedQueryForm="fixedQueryForm"
|
63
|
-
:queryParamsName="queryParamsName"
|
64
|
-
:query-params-json="queryParamsJson"
|
65
|
-
:show-pagination="showPagination"
|
66
|
-
:customDelete="customDelete"
|
67
|
-
:extraHeight="extraHeight"
|
68
|
-
@add="add"
|
69
|
-
@move="move"
|
70
|
-
@edit="edit"
|
71
|
-
@del="del"
|
72
|
-
@rowChoose="rowChoose"
|
73
|
-
@afterDelete="afterDelete"
|
74
|
-
@action="action"
|
75
|
-
@selectRow="selectRow"
|
76
|
-
@afterQuery="afterQuery"
|
77
|
-
@columnClick="columnClick"
|
78
|
-
@editButtonStateDataClick="editButtonStateDataClick"
|
79
|
-
@importExcelOk="importExcelOk">
|
80
|
-
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
81
|
-
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
82
|
-
</template>
|
83
|
-
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
84
|
-
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
85
|
-
</template>
|
86
|
-
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
87
|
-
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
88
|
-
<a-tooltip title="收起查询条件" placement="bottom">
|
89
|
-
<a-button @click="toggleIsFormShow">
|
90
|
-
<a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
|
91
|
-
</a-button>
|
92
|
-
</a-tooltip>
|
93
|
-
</template>
|
94
|
-
<!-- 底部插槽 -->
|
95
|
-
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
96
|
-
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
97
|
-
</template>
|
98
|
-
<!-- excel导入说明插槽 -->
|
99
|
-
<template #importExcelSlot>
|
100
|
-
<slot name="importExcelSlot"></slot>
|
101
|
-
</template>
|
102
|
-
</x-table>
|
103
|
-
</template>
|
104
|
-
<template v-else>
|
105
|
-
<a-empty>
|
106
|
-
<span slot="description"> 页面配置不存在,请联系系统管理员</span>
|
107
|
-
</a-empty>
|
108
|
-
</template>
|
109
|
-
</div>
|
110
|
-
</a-col>
|
111
|
-
</a-row>
|
112
|
-
</template>
|
113
|
-
<script>
|
114
|
-
import XForm from '@vue2-client/base-client/components/common/XForm'
|
115
|
-
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
116
|
-
import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
|
117
|
-
import XTable from '@vue2-client/base-client/components/common/XTable'
|
118
|
-
import XTree from '@vue2-client/base-client/components/common/XTree'
|
119
|
-
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
120
|
-
import {
|
121
|
-
getConfigByName,
|
122
|
-
getConfigByLogic,
|
123
|
-
parseConfig, runLogic, getConfigByNameAsync,
|
124
|
-
} from '@vue2-client/services/api/common'
|
125
|
-
import { mapState } from 'vuex'
|
126
|
-
import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
|
127
|
-
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
128
|
-
import util, { getRealKeyData } from '@vue2-client/utils/util'
|
129
|
-
|
130
|
-
export default {
|
131
|
-
name: 'XFormTable',
|
132
|
-
components: {
|
133
|
-
XTreePro,
|
134
|
-
XTable,
|
135
|
-
XForm,
|
136
|
-
XTree,
|
137
|
-
XAddForm,
|
138
|
-
XAddReport,
|
139
|
-
XImportExcel
|
140
|
-
},
|
141
|
-
inject: ['getSelectedId', 'getSelectedData', 'getMixinData', 'getOutEnv', 'currUser'],
|
142
|
-
data () {
|
143
|
-
return {
|
144
|
-
// 加载状态
|
145
|
-
loading: false,
|
146
|
-
// 图标样式
|
147
|
-
iconStyle: {
|
148
|
-
position: 'relative',
|
149
|
-
top: '1px'
|
150
|
-
},
|
151
|
-
loadError: false,
|
152
|
-
moveType: false,
|
153
|
-
// 添加按钮对应的配置名
|
154
|
-
moveconfig: '',
|
155
|
-
// 实际查询配置内容
|
156
|
-
realQueryConfig: {},
|
157
|
-
toggleIsFormIcon: 'vertical-align-top',
|
158
|
-
table_selectedRowKeys: [],
|
159
|
-
table_selectedRows: []
|
160
|
-
}
|
161
|
-
},
|
162
|
-
computed: {
|
163
|
-
...mapState('setting', ['isMobile'])
|
164
|
-
},
|
165
|
-
props: {
|
166
|
-
// 业务名称
|
167
|
-
title: {
|
168
|
-
type: String,
|
169
|
-
default: ''
|
170
|
-
},
|
171
|
-
// 卡片标题
|
172
|
-
crudTitle: {
|
173
|
-
type: String,
|
174
|
-
default: null
|
175
|
-
},
|
176
|
-
// 查询配置文件名
|
177
|
-
queryParamsName: {
|
178
|
-
type: String,
|
179
|
-
default: null
|
180
|
-
},
|
181
|
-
// 配置所属命名空间
|
182
|
-
serviceName: {
|
183
|
-
type: String,
|
184
|
-
default: undefined
|
185
|
-
},
|
186
|
-
// 查询配置文件Json,用于查询配置生成器的预览
|
187
|
-
queryParamsJson: {
|
188
|
-
type: Object,
|
189
|
-
default: null
|
190
|
-
},
|
191
|
-
// xTree 配置
|
192
|
-
xTreeConfigName: {
|
193
|
-
type: String,
|
194
|
-
default: null
|
195
|
-
},
|
196
|
-
// 业务逻辑名称, 通过logic获取表单表格配置
|
197
|
-
logicName: {
|
198
|
-
type: String,
|
199
|
-
default: null
|
200
|
-
},
|
201
|
-
// 执行logic传递的参数
|
202
|
-
logicParam: {
|
203
|
-
type: Object,
|
204
|
-
default: () => {
|
205
|
-
}
|
206
|
-
},
|
207
|
-
// 固定新增表单
|
208
|
-
fixedAddForm: {
|
209
|
-
type: Object,
|
210
|
-
default: () => {
|
211
|
-
return {}
|
212
|
-
}
|
213
|
-
},
|
214
|
-
// 固定查询表单
|
215
|
-
fixedQueryForm: {
|
216
|
-
type: Object,
|
217
|
-
default: () => {
|
218
|
-
return {}
|
219
|
-
}
|
220
|
-
},
|
221
|
-
// 预览模式
|
222
|
-
viewMode: {
|
223
|
-
type: Boolean,
|
224
|
-
default: () => {
|
225
|
-
return false
|
226
|
-
}
|
227
|
-
},
|
228
|
-
// 本地编辑模式
|
229
|
-
localEditMode: {
|
230
|
-
type: Boolean,
|
231
|
-
default: () => {
|
232
|
-
return false
|
233
|
-
}
|
234
|
-
},
|
235
|
-
// 行选择模式
|
236
|
-
rowSelectMode: {
|
237
|
-
type: Boolean,
|
238
|
-
default: () => {
|
239
|
-
return false
|
240
|
-
}
|
241
|
-
},
|
242
|
-
// 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
|
243
|
-
allowSelectRowNum: {
|
244
|
-
type: Number,
|
245
|
-
default: () => {
|
246
|
-
return 0
|
247
|
-
}
|
248
|
-
},
|
249
|
-
// 环境
|
250
|
-
env: {
|
251
|
-
type: String,
|
252
|
-
default: () => {
|
253
|
-
return 'prod'
|
254
|
-
}
|
255
|
-
},
|
256
|
-
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
257
|
-
showPagination: {
|
258
|
-
type: Boolean,
|
259
|
-
default: true
|
260
|
-
},
|
261
|
-
// 调用logic获取数据源的追加参数
|
262
|
-
getDataParams: {
|
263
|
-
type: Object,
|
264
|
-
default: undefined
|
265
|
-
},
|
266
|
-
// 可以控制组件中导出等按钮的隐藏
|
267
|
-
buttonState: {
|
268
|
-
type: Object,
|
269
|
-
default: undefined
|
270
|
-
},
|
271
|
-
// 是否自定义新增按钮的功能
|
272
|
-
customAdd: {
|
273
|
-
type: Boolean,
|
274
|
-
default: false
|
275
|
-
},
|
276
|
-
reportQueryName: {
|
277
|
-
type: String,
|
278
|
-
default: undefined,
|
279
|
-
},
|
280
|
-
// 是否自定义删除按钮的功能
|
281
|
-
customDelete: {
|
282
|
-
type: Boolean,
|
283
|
-
default: false
|
284
|
-
},
|
285
|
-
// 是否自定义修改按钮的功能
|
286
|
-
customEdit: {
|
287
|
-
type: Boolean,
|
288
|
-
default: false
|
289
|
-
},
|
290
|
-
// 是否自定义增加按钮
|
291
|
-
customMove: {
|
292
|
-
type: Boolean,
|
293
|
-
default: false
|
294
|
-
},
|
295
|
-
// 自适应底部边距
|
296
|
-
extraHeight: {
|
297
|
-
type: Number,
|
298
|
-
default: 80
|
299
|
-
}
|
300
|
-
},
|
301
|
-
watch: {
|
302
|
-
logicParam: {
|
303
|
-
handler () {
|
304
|
-
this.initConfig()
|
305
|
-
},
|
306
|
-
deep: true
|
307
|
-
},
|
308
|
-
queryParamsJson: {
|
309
|
-
handler () {
|
310
|
-
this.initConfig()
|
311
|
-
},
|
312
|
-
deep: true
|
313
|
-
},
|
314
|
-
queryParamsName: {
|
315
|
-
handler () {
|
316
|
-
this.initConfig()
|
317
|
-
}
|
318
|
-
},
|
319
|
-
serviceName: {
|
320
|
-
handler () {
|
321
|
-
this.initConfig()
|
322
|
-
}
|
323
|
-
}
|
324
|
-
},
|
325
|
-
methods: {
|
326
|
-
runLogic,
|
327
|
-
getRealKeyData,
|
328
|
-
getConfigByNameAsync,
|
329
|
-
getConfigByName,
|
330
|
-
columnClick (key, value, record) {
|
331
|
-
this.$emit('columnClick', key, value, record)
|
332
|
-
},
|
333
|
-
importExcelOk () {
|
334
|
-
this.$emit('importExcelOk')
|
335
|
-
},
|
336
|
-
initConfig () {
|
337
|
-
this.loading = true
|
338
|
-
this.loadError = false
|
339
|
-
if (this.queryParamsName) {
|
340
|
-
this.getConfig()
|
341
|
-
} else if (this.queryParamsJson) {
|
342
|
-
this.getConfigBySource()
|
343
|
-
} else if (this.logicName && this.logicParam) {
|
344
|
-
this.getColumnJsonByLogic()
|
345
|
-
} else {
|
346
|
-
this.loading = false
|
347
|
-
this.loadError = true
|
348
|
-
}
|
349
|
-
},
|
350
|
-
|
351
|
-
getConfig () {
|
352
|
-
getConfigByName(this.queryParamsName, this.serviceName, (res) => {
|
353
|
-
if (!res) {
|
354
|
-
this.loading = false
|
355
|
-
this.loadError = true
|
356
|
-
return
|
357
|
-
}
|
358
|
-
this.updateComponents(res)
|
359
|
-
}, this.env === 'dev')
|
360
|
-
},
|
361
|
-
getConfigBySource () {
|
362
|
-
parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
|
363
|
-
if (!res) {
|
364
|
-
this.loading = false
|
365
|
-
this.loadError = true
|
366
|
-
return
|
367
|
-
}
|
368
|
-
this.updateComponents(res, true)
|
369
|
-
})
|
370
|
-
},
|
371
|
-
getColumnJsonByLogic () {
|
372
|
-
getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
|
373
|
-
if (!res) {
|
374
|
-
this.loading = false
|
375
|
-
this.loadError = true
|
376
|
-
return
|
377
|
-
}
|
378
|
-
this.updateComponents(res, true)
|
379
|
-
}, this.env === 'dev')
|
380
|
-
},
|
381
|
-
/**
|
382
|
-
* 更新子组件
|
383
|
-
* @param res 参数
|
384
|
-
* @param setQueryParams 是否设置queryParams参数
|
385
|
-
*/
|
386
|
-
updateComponents (res, setQueryParams) {
|
387
|
-
this.realQueryConfig = res
|
388
|
-
if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
|
389
|
-
// 设置添加按钮对应的配置名
|
390
|
-
this.moveconfig = res.moveconfig
|
391
|
-
const initTable = () => {
|
392
|
-
// 初始化 xTable 子组件
|
393
|
-
this.$refs.xTable.init({
|
394
|
-
formItems: res.formJson,
|
395
|
-
primaryKey: res.primaryKey,
|
396
|
-
createdQuery: res.createdQuery,
|
397
|
-
queryParams: setQueryParams ? res : null,
|
398
|
-
tableColumns: res.columnJson,
|
399
|
-
buttonState: Object.assign(res.buttonState, this.buttonState),
|
400
|
-
buttonPermissions: res.buttonPermissions,
|
401
|
-
editButtonStateData: res.editButtonStateData,
|
402
|
-
title: this.title,
|
403
|
-
viewMode: this.viewMode,
|
404
|
-
localEditMode: this.localEditMode,
|
405
|
-
rowSelectMode: this.rowSelectMode,
|
406
|
-
allowSelectRowNum: this.allowSelectRowNum,
|
407
|
-
tableSummaryMap: res.tableSummaryMap,
|
408
|
-
serviceName: this.serviceName,
|
409
|
-
env: this.env,
|
410
|
-
form: this.$refs.xForm.form,
|
411
|
-
allowedCardMode: res.allowedCardMode,
|
412
|
-
cardModeConfig: res.cardModeConfig,
|
413
|
-
createdEditMode: res.createdEditMode,
|
414
|
-
summaryUpdate: true,
|
415
|
-
simpleMode: res.simpleMode
|
416
|
-
})
|
417
|
-
if (this.realQueryConfig?.funcData?.pageMounted) {
|
418
|
-
executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
|
419
|
-
}
|
420
|
-
}
|
421
|
-
// 初始化 xForm 子组件
|
422
|
-
if (!this.localEditMode && !this.rowSelectMode) {
|
423
|
-
this.$refs.xForm.init({
|
424
|
-
formItems: res.formJson,
|
425
|
-
serviceName: this.serviceName,
|
426
|
-
getDataParams: this.getDataParams,
|
427
|
-
simpleMode: res.simpleMode,
|
428
|
-
env: this.env
|
429
|
-
})
|
430
|
-
} else {
|
431
|
-
// TODO 此处应删除
|
432
|
-
initTable()
|
433
|
-
}
|
434
|
-
// 初始化 xTable 子组件
|
435
|
-
// 等待 x-from-item 的 mounted 完成
|
436
|
-
this.$refs.xForm.$on('itemsMounted', initTable)
|
437
|
-
}
|
438
|
-
this.loading = false
|
439
|
-
},
|
440
|
-
// 自定义按钮
|
441
|
-
editButtonStateDataClick (functionName, rows) {
|
442
|
-
console.log('functionName', functionName)
|
443
|
-
console.log('rows', rows)
|
444
|
-
this.$emit(functionName, rows)
|
445
|
-
},
|
446
|
-
|
447
|
-
/**
|
448
|
-
* 提交查询表单事件
|
449
|
-
* @param res 参数
|
450
|
-
*/
|
451
|
-
onSearchSubmit (res) {
|
452
|
-
if (res.valid) {
|
453
|
-
// 表单赋值
|
454
|
-
this.$refs.xTable.setQueryForm(res.form)
|
455
|
-
this.$refs.xTable.summaryUpdate = true
|
456
|
-
// commit
|
457
|
-
this.$emit('afterSearchSubmit', res)
|
458
|
-
} else {
|
459
|
-
return false
|
460
|
-
}
|
461
|
-
},
|
462
|
-
active (props) {
|
463
|
-
let num = false
|
464
|
-
for (const key in props) {
|
465
|
-
// eslint-disable-next-line no-prototype-builtins
|
466
|
-
if (this.$props.hasOwnProperty(key)) {
|
467
|
-
if (this.$props[key] instanceof Object) {
|
468
|
-
this.$props[key] = JSON.parse(props[key])
|
469
|
-
} else {
|
470
|
-
this.$props[key] = props[key]
|
471
|
-
}
|
472
|
-
num = true
|
473
|
-
}
|
474
|
-
}
|
475
|
-
if (num) {
|
476
|
-
this.initConfig()
|
477
|
-
}
|
478
|
-
},
|
479
|
-
/**
|
480
|
-
* 提交新增/修改表单后事件
|
481
|
-
*/
|
482
|
-
onAddOrEditSubmitAfterSubmit (res) {
|
483
|
-
this.refreshTable(res.businessType === '新增')
|
484
|
-
// commit
|
485
|
-
this.$emit('afterSubmit', res)
|
486
|
-
},
|
487
|
-
/**
|
488
|
-
* 表格查询后事件
|
489
|
-
* @param res 参数
|
490
|
-
* @param conditionParams 查询条件
|
491
|
-
*/
|
492
|
-
afterQuery (res, conditionParams) {
|
493
|
-
this.$emit('afterQuery', res, conditionParams)
|
494
|
-
},
|
495
|
-
/**
|
496
|
-
* 详情按钮事件
|
497
|
-
* @param record 本条数据
|
498
|
-
* @param id 数据标识
|
499
|
-
* @param actionType 操作类型
|
500
|
-
* @param fun 向上级传递的事件
|
501
|
-
*/
|
502
|
-
action (record, id, actionType, fun = 'action') {
|
503
|
-
this.$emit(fun, record, id, actionType)
|
504
|
-
},
|
505
|
-
treeOnChecked (checkedKeys, deepNodes, deepKeys) {
|
506
|
-
this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
|
507
|
-
},
|
508
|
-
treeBtnFuncClick (index, func) {
|
509
|
-
this.$emit('treeBtnFuncClick', index, func)
|
510
|
-
},
|
511
|
-
/**
|
512
|
-
* 新增按钮事件
|
513
|
-
*/
|
514
|
-
add () {
|
515
|
-
if (this.customAdd) {
|
516
|
-
this.$emit('add')
|
517
|
-
} else {
|
518
|
-
const res = this.realQueryConfig
|
519
|
-
this.$refs.xAddForm.init({
|
520
|
-
businessType: '新增',
|
521
|
-
title: this.title,
|
522
|
-
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
523
|
-
configName: this.queryParamsName,
|
524
|
-
configContent: this.queryParamsJson,
|
525
|
-
formItems: res.formJson,
|
526
|
-
viewMode: this.viewMode,
|
527
|
-
localEditMode: this.localEditMode,
|
528
|
-
isHandleFormKey: this.localEditMode ? false : undefined,
|
529
|
-
serviceName: this.serviceName,
|
530
|
-
fixedAddForm: this.fixedAddForm,
|
531
|
-
getDataParams: this.getDataParams,
|
532
|
-
layout: res.xAddFormLayout || 'horizontal',
|
533
|
-
env: this.env
|
534
|
-
})
|
535
|
-
}
|
536
|
-
},
|
537
|
-
/**
|
538
|
-
* 添加按钮事件
|
539
|
-
*/
|
540
|
-
move () {
|
541
|
-
this.moveType = true
|
542
|
-
this.$nextTick(
|
543
|
-
() => {
|
544
|
-
this.$refs.xAddReport.init({
|
545
|
-
configName: this.moveconfig,
|
546
|
-
selectedId: this.fixedAddForm.selected_id
|
547
|
-
})
|
548
|
-
}
|
549
|
-
)
|
550
|
-
},
|
551
|
-
/**
|
552
|
-
* 修改按钮事件
|
553
|
-
* @param modifyModelData 修改表单数据
|
554
|
-
*/
|
555
|
-
edit (modifyModelData) {
|
556
|
-
if (this.customEdit) {
|
557
|
-
this.$emit('edit')
|
558
|
-
} else {
|
559
|
-
const res = this.realQueryConfig
|
560
|
-
this.$refs.xAddForm.init({
|
561
|
-
businessType: '修改',
|
562
|
-
title: this.title,
|
563
|
-
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
564
|
-
configName: this.queryParamsName,
|
565
|
-
configContent: this.queryParamsJson,
|
566
|
-
formItems: res.formJson,
|
567
|
-
viewMode: this.viewMode,
|
568
|
-
localEditMode: this.localEditMode,
|
569
|
-
isHandleFormKey: this.localEditMode ? false : undefined,
|
570
|
-
serviceName: this.serviceName,
|
571
|
-
fixedAddForm: this.fixedAddForm,
|
572
|
-
getDataParams: this.getDataParams,
|
573
|
-
modifyModelData: modifyModelData,
|
574
|
-
layout: res.xAddFormLayout || 'horizontal',
|
575
|
-
env: this.env
|
576
|
-
})
|
577
|
-
}
|
578
|
-
},
|
579
|
-
/**
|
580
|
-
* 删除按钮事件
|
581
|
-
*/
|
582
|
-
del (keys, callback) {
|
583
|
-
if (this.customDelete) {
|
584
|
-
this.$emit('del', keys, callback)
|
585
|
-
}
|
586
|
-
},
|
587
|
-
/**
|
588
|
-
* 删除后事件
|
589
|
-
* @param res
|
590
|
-
*/
|
591
|
-
afterDelete (res) {
|
592
|
-
this.$emit('afterDelete', res)
|
593
|
-
},
|
594
|
-
/**
|
595
|
-
* 行选择事件
|
596
|
-
* @param row 选中行
|
597
|
-
*/
|
598
|
-
rowChoose (row) {
|
599
|
-
this.$emit('rowChoose', row)
|
600
|
-
},
|
601
|
-
/**
|
602
|
-
* 更多条件是否展示
|
603
|
-
*/
|
604
|
-
toggleAdvanced () {
|
605
|
-
this.$refs.xTable.setScrollYHeight({})
|
606
|
-
},
|
607
|
-
/**
|
608
|
-
* 查询表单部分显示/隐藏切换
|
609
|
-
*/
|
610
|
-
toggleIsFormShow () {
|
611
|
-
this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
|
612
|
-
this.$refs.xForm.toggleVisible()
|
613
|
-
this.$refs.xTable.setScrollYHeight({})
|
614
|
-
},
|
615
|
-
/**
|
616
|
-
* 选择列事件
|
617
|
-
* @param selectedRowKeys 选中列Key集合
|
618
|
-
* @param selectedRows 选中列
|
619
|
-
*/
|
620
|
-
selectRow (selectedRowKeys, selectedRows) {
|
621
|
-
this.table_selectedRowKeys = selectedRowKeys
|
622
|
-
this.table_selectedRows = selectedRows
|
623
|
-
this.$emit('selectRow', selectedRowKeys, selectedRows)
|
624
|
-
},
|
625
|
-
/**
|
626
|
-
* 清除勾选数据
|
627
|
-
*/
|
628
|
-
clearRowKeys () {
|
629
|
-
this.$refs.xTable.clearRowKeys()
|
630
|
-
},
|
631
|
-
/**
|
632
|
-
* 刷新表格
|
633
|
-
* @param toFirstPage 是否到第一页
|
634
|
-
*/
|
635
|
-
refreshTable (toFirstPage = true) {
|
636
|
-
this.$refs.xTable.refresh(toFirstPage)
|
637
|
-
},
|
638
|
-
/**
|
639
|
-
* 刷新表格
|
640
|
-
* @param toFirstPage 是否到第一页
|
641
|
-
*/
|
642
|
-
refresh (toFirstPage = true) {
|
643
|
-
this.$refs.xTable.refresh(toFirstPage)
|
644
|
-
},
|
645
|
-
/**
|
646
|
-
* 获取表格数据
|
647
|
-
*/
|
648
|
-
getTableData () {
|
649
|
-
return this.$refs.xTable.getTableData()
|
650
|
-
},
|
651
|
-
/**
|
652
|
-
* 表单本地提交
|
653
|
-
*/
|
654
|
-
onLocalSubmit (res, callback) {
|
655
|
-
const form = res.realForm
|
656
|
-
if (res.businessType === '新增') {
|
657
|
-
this.$refs.xTable.appendLocalData(form)
|
658
|
-
} else {
|
659
|
-
this.$refs.xTable.modifyLocalData(form['序号'], form)
|
660
|
-
}
|
661
|
-
this.$message.success(res.businessType + '成功!')
|
662
|
-
this.onAddOrEditSubmitAfterSubmit(res, callback)
|
663
|
-
if (callback) {
|
664
|
-
callback()
|
665
|
-
}
|
666
|
-
}
|
667
|
-
},
|
668
|
-
action: {
|
669
|
-
/**
|
670
|
-
* 实现doAction方法
|
671
|
-
*/
|
672
|
-
doAction (actionType, args, data) {
|
673
|
-
switch (actionType) {
|
674
|
-
case 'refreshTable':
|
675
|
-
for (const item in args) {
|
676
|
-
console.log('item', item)
|
677
|
-
}
|
678
|
-
break
|
679
|
-
default:
|
680
|
-
break
|
681
|
-
}
|
682
|
-
}
|
683
|
-
},
|
684
|
-
mounted () {
|
685
|
-
this.initConfig()
|
686
|
-
if (this.getSelectedData && typeof this.getSelectedData === 'function') {
|
687
|
-
const selectedId = this.getSelectedData()
|
688
|
-
if (typeof selectedId === 'object') {
|
689
|
-
const data = JSON.parse(JSON.stringify(selectedId))
|
690
|
-
if (data.selectedId) {
|
691
|
-
data.selected_id = data.selectedId
|
692
|
-
delete data.selectedId
|
693
|
-
}
|
694
|
-
Object.assign(this.fixedAddForm, data)
|
695
|
-
Object.assign(this.fixedQueryForm, data)
|
696
|
-
} else {
|
697
|
-
Object.assign(this.fixedAddForm, { selected_id: selectedId })
|
698
|
-
Object.assign(this.fixedQueryForm, { selected_id: selectedId })
|
699
|
-
}
|
700
|
-
}
|
701
|
-
}
|
702
|
-
}
|
703
|
-
</script>
|
704
|
-
<style lang="less" scoped>
|
705
|
-
.crud_title {
|
706
|
-
height: 32px;
|
707
|
-
font-size: 16px;
|
708
|
-
font-weight: 500;
|
709
|
-
color: #000000d9;
|
710
|
-
line-height: 32px;
|
711
|
-
margin-bottom: 12px;
|
712
|
-
}
|
713
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
|
3
|
+
<a-col
|
4
|
+
:xs="14"
|
5
|
+
:sm="14"
|
6
|
+
:md="12"
|
7
|
+
:lg="9"
|
8
|
+
:xl="6"
|
9
|
+
:xxl="5"
|
10
|
+
v-if="xTreeConfigName"
|
11
|
+
:style="{ maxWidth: '400px'}">
|
12
|
+
<x-tree-pro
|
13
|
+
:config-name="xTreeConfigName"
|
14
|
+
:env="env"
|
15
|
+
@action="action"
|
16
|
+
@btnFuncClick="treeBtnFuncClick"
|
17
|
+
@treeOnChecked="treeOnChecked"
|
18
|
+
ref="xtree"
|
19
|
+
></x-tree-pro>
|
20
|
+
</a-col>
|
21
|
+
<a-col
|
22
|
+
:xs="xTreeConfigName ? 10 : 24"
|
23
|
+
:sm="xTreeConfigName ? 10 : 24"
|
24
|
+
:md="xTreeConfigName ? 12 : 24"
|
25
|
+
:lg="xTreeConfigName ? 15 : 24"
|
26
|
+
:xl="xTreeConfigName ? 18 : 24"
|
27
|
+
:xxl="xTreeConfigName ? 19 : 24">
|
28
|
+
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
|
29
|
+
<a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
|
30
|
+
<div v-show="!loading">
|
31
|
+
<template v-if="!loadError">
|
32
|
+
<x-add-form
|
33
|
+
ref="xAddForm"
|
34
|
+
@onLocalSubmit="onLocalSubmit"
|
35
|
+
@afterSubmit="onAddOrEditSubmitAfterSubmit"
|
36
|
+
>
|
37
|
+
<template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
|
38
|
+
<slot
|
39
|
+
name="groupFormItems"
|
40
|
+
:form="form"
|
41
|
+
:model="model"
|
42
|
+
:rules="rules"
|
43
|
+
:modifyModelData="modifyModelData"></slot>
|
44
|
+
</template>
|
45
|
+
</x-add-form>
|
46
|
+
<x-add-report
|
47
|
+
v-if="moveType"
|
48
|
+
ref="xAddReport"
|
49
|
+
>
|
50
|
+
</x-add-report>
|
51
|
+
<div v-if="crudTitle" class="crud_title">
|
52
|
+
{{ crudTitle }}
|
53
|
+
</div>
|
54
|
+
<x-form
|
55
|
+
ref="xForm"
|
56
|
+
@toggleAdvanced="toggleAdvanced"
|
57
|
+
@onSubmit="onSearchSubmit">
|
58
|
+
<slot name="formBtnExpand"></slot>
|
59
|
+
</x-form>
|
60
|
+
<x-table
|
61
|
+
ref="xTable"
|
62
|
+
:fixedQueryForm="fixedQueryForm"
|
63
|
+
:queryParamsName="queryParamsName"
|
64
|
+
:query-params-json="queryParamsJson"
|
65
|
+
:show-pagination="showPagination"
|
66
|
+
:customDelete="customDelete"
|
67
|
+
:extraHeight="extraHeight"
|
68
|
+
@add="add"
|
69
|
+
@move="move"
|
70
|
+
@edit="edit"
|
71
|
+
@del="del"
|
72
|
+
@rowChoose="rowChoose"
|
73
|
+
@afterDelete="afterDelete"
|
74
|
+
@action="action"
|
75
|
+
@selectRow="selectRow"
|
76
|
+
@afterQuery="afterQuery"
|
77
|
+
@columnClick="columnClick"
|
78
|
+
@editButtonStateDataClick="editButtonStateDataClick"
|
79
|
+
@importExcelOk="importExcelOk">
|
80
|
+
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
81
|
+
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
82
|
+
</template>
|
83
|
+
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
84
|
+
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
85
|
+
</template>
|
86
|
+
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
87
|
+
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
88
|
+
<a-tooltip title="收起查询条件" placement="bottom">
|
89
|
+
<a-button @click="toggleIsFormShow">
|
90
|
+
<a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
|
91
|
+
</a-button>
|
92
|
+
</a-tooltip>
|
93
|
+
</template>
|
94
|
+
<!-- 底部插槽 -->
|
95
|
+
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
96
|
+
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
97
|
+
</template>
|
98
|
+
<!-- excel导入说明插槽 -->
|
99
|
+
<template #importExcelSlot>
|
100
|
+
<slot name="importExcelSlot"></slot>
|
101
|
+
</template>
|
102
|
+
</x-table>
|
103
|
+
</template>
|
104
|
+
<template v-else>
|
105
|
+
<a-empty>
|
106
|
+
<span slot="description"> 页面配置不存在,请联系系统管理员</span>
|
107
|
+
</a-empty>
|
108
|
+
</template>
|
109
|
+
</div>
|
110
|
+
</a-col>
|
111
|
+
</a-row>
|
112
|
+
</template>
|
113
|
+
<script>
|
114
|
+
import XForm from '@vue2-client/base-client/components/common/XForm'
|
115
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
116
|
+
import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
|
117
|
+
import XTable from '@vue2-client/base-client/components/common/XTable'
|
118
|
+
import XTree from '@vue2-client/base-client/components/common/XTree'
|
119
|
+
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
120
|
+
import {
|
121
|
+
getConfigByName,
|
122
|
+
getConfigByLogic,
|
123
|
+
parseConfig, runLogic, getConfigByNameAsync,
|
124
|
+
} from '@vue2-client/services/api/common'
|
125
|
+
import { mapState } from 'vuex'
|
126
|
+
import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
|
127
|
+
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
128
|
+
import util, { getRealKeyData } from '@vue2-client/utils/util'
|
129
|
+
|
130
|
+
export default {
|
131
|
+
name: 'XFormTable',
|
132
|
+
components: {
|
133
|
+
XTreePro,
|
134
|
+
XTable,
|
135
|
+
XForm,
|
136
|
+
XTree,
|
137
|
+
XAddForm,
|
138
|
+
XAddReport,
|
139
|
+
XImportExcel
|
140
|
+
},
|
141
|
+
inject: ['getSelectedId', 'getSelectedData', 'getMixinData', 'getOutEnv', 'currUser'],
|
142
|
+
data () {
|
143
|
+
return {
|
144
|
+
// 加载状态
|
145
|
+
loading: false,
|
146
|
+
// 图标样式
|
147
|
+
iconStyle: {
|
148
|
+
position: 'relative',
|
149
|
+
top: '1px'
|
150
|
+
},
|
151
|
+
loadError: false,
|
152
|
+
moveType: false,
|
153
|
+
// 添加按钮对应的配置名
|
154
|
+
moveconfig: '',
|
155
|
+
// 实际查询配置内容
|
156
|
+
realQueryConfig: {},
|
157
|
+
toggleIsFormIcon: 'vertical-align-top',
|
158
|
+
table_selectedRowKeys: [],
|
159
|
+
table_selectedRows: []
|
160
|
+
}
|
161
|
+
},
|
162
|
+
computed: {
|
163
|
+
...mapState('setting', ['isMobile'])
|
164
|
+
},
|
165
|
+
props: {
|
166
|
+
// 业务名称
|
167
|
+
title: {
|
168
|
+
type: String,
|
169
|
+
default: ''
|
170
|
+
},
|
171
|
+
// 卡片标题
|
172
|
+
crudTitle: {
|
173
|
+
type: String,
|
174
|
+
default: null
|
175
|
+
},
|
176
|
+
// 查询配置文件名
|
177
|
+
queryParamsName: {
|
178
|
+
type: String,
|
179
|
+
default: null
|
180
|
+
},
|
181
|
+
// 配置所属命名空间
|
182
|
+
serviceName: {
|
183
|
+
type: String,
|
184
|
+
default: undefined
|
185
|
+
},
|
186
|
+
// 查询配置文件Json,用于查询配置生成器的预览
|
187
|
+
queryParamsJson: {
|
188
|
+
type: Object,
|
189
|
+
default: null
|
190
|
+
},
|
191
|
+
// xTree 配置
|
192
|
+
xTreeConfigName: {
|
193
|
+
type: String,
|
194
|
+
default: null
|
195
|
+
},
|
196
|
+
// 业务逻辑名称, 通过logic获取表单表格配置
|
197
|
+
logicName: {
|
198
|
+
type: String,
|
199
|
+
default: null
|
200
|
+
},
|
201
|
+
// 执行logic传递的参数
|
202
|
+
logicParam: {
|
203
|
+
type: Object,
|
204
|
+
default: () => {
|
205
|
+
}
|
206
|
+
},
|
207
|
+
// 固定新增表单
|
208
|
+
fixedAddForm: {
|
209
|
+
type: Object,
|
210
|
+
default: () => {
|
211
|
+
return {}
|
212
|
+
}
|
213
|
+
},
|
214
|
+
// 固定查询表单
|
215
|
+
fixedQueryForm: {
|
216
|
+
type: Object,
|
217
|
+
default: () => {
|
218
|
+
return {}
|
219
|
+
}
|
220
|
+
},
|
221
|
+
// 预览模式
|
222
|
+
viewMode: {
|
223
|
+
type: Boolean,
|
224
|
+
default: () => {
|
225
|
+
return false
|
226
|
+
}
|
227
|
+
},
|
228
|
+
// 本地编辑模式
|
229
|
+
localEditMode: {
|
230
|
+
type: Boolean,
|
231
|
+
default: () => {
|
232
|
+
return false
|
233
|
+
}
|
234
|
+
},
|
235
|
+
// 行选择模式
|
236
|
+
rowSelectMode: {
|
237
|
+
type: Boolean,
|
238
|
+
default: () => {
|
239
|
+
return false
|
240
|
+
}
|
241
|
+
},
|
242
|
+
// 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
|
243
|
+
allowSelectRowNum: {
|
244
|
+
type: Number,
|
245
|
+
default: () => {
|
246
|
+
return 0
|
247
|
+
}
|
248
|
+
},
|
249
|
+
// 环境
|
250
|
+
env: {
|
251
|
+
type: String,
|
252
|
+
default: () => {
|
253
|
+
return 'prod'
|
254
|
+
}
|
255
|
+
},
|
256
|
+
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
257
|
+
showPagination: {
|
258
|
+
type: Boolean,
|
259
|
+
default: true
|
260
|
+
},
|
261
|
+
// 调用logic获取数据源的追加参数
|
262
|
+
getDataParams: {
|
263
|
+
type: Object,
|
264
|
+
default: undefined
|
265
|
+
},
|
266
|
+
// 可以控制组件中导出等按钮的隐藏
|
267
|
+
buttonState: {
|
268
|
+
type: Object,
|
269
|
+
default: undefined
|
270
|
+
},
|
271
|
+
// 是否自定义新增按钮的功能
|
272
|
+
customAdd: {
|
273
|
+
type: Boolean,
|
274
|
+
default: false
|
275
|
+
},
|
276
|
+
reportQueryName: {
|
277
|
+
type: String,
|
278
|
+
default: undefined,
|
279
|
+
},
|
280
|
+
// 是否自定义删除按钮的功能
|
281
|
+
customDelete: {
|
282
|
+
type: Boolean,
|
283
|
+
default: false
|
284
|
+
},
|
285
|
+
// 是否自定义修改按钮的功能
|
286
|
+
customEdit: {
|
287
|
+
type: Boolean,
|
288
|
+
default: false
|
289
|
+
},
|
290
|
+
// 是否自定义增加按钮
|
291
|
+
customMove: {
|
292
|
+
type: Boolean,
|
293
|
+
default: false
|
294
|
+
},
|
295
|
+
// 自适应底部边距
|
296
|
+
extraHeight: {
|
297
|
+
type: Number,
|
298
|
+
default: 80
|
299
|
+
}
|
300
|
+
},
|
301
|
+
watch: {
|
302
|
+
logicParam: {
|
303
|
+
handler () {
|
304
|
+
this.initConfig()
|
305
|
+
},
|
306
|
+
deep: true
|
307
|
+
},
|
308
|
+
queryParamsJson: {
|
309
|
+
handler () {
|
310
|
+
this.initConfig()
|
311
|
+
},
|
312
|
+
deep: true
|
313
|
+
},
|
314
|
+
queryParamsName: {
|
315
|
+
handler () {
|
316
|
+
this.initConfig()
|
317
|
+
}
|
318
|
+
},
|
319
|
+
serviceName: {
|
320
|
+
handler () {
|
321
|
+
this.initConfig()
|
322
|
+
}
|
323
|
+
}
|
324
|
+
},
|
325
|
+
methods: {
|
326
|
+
runLogic,
|
327
|
+
getRealKeyData,
|
328
|
+
getConfigByNameAsync,
|
329
|
+
getConfigByName,
|
330
|
+
columnClick (key, value, record) {
|
331
|
+
this.$emit('columnClick', key, value, record)
|
332
|
+
},
|
333
|
+
importExcelOk () {
|
334
|
+
this.$emit('importExcelOk')
|
335
|
+
},
|
336
|
+
initConfig () {
|
337
|
+
this.loading = true
|
338
|
+
this.loadError = false
|
339
|
+
if (this.queryParamsName) {
|
340
|
+
this.getConfig()
|
341
|
+
} else if (this.queryParamsJson) {
|
342
|
+
this.getConfigBySource()
|
343
|
+
} else if (this.logicName && this.logicParam) {
|
344
|
+
this.getColumnJsonByLogic()
|
345
|
+
} else {
|
346
|
+
this.loading = false
|
347
|
+
this.loadError = true
|
348
|
+
}
|
349
|
+
},
|
350
|
+
|
351
|
+
getConfig () {
|
352
|
+
getConfigByName(this.queryParamsName, this.serviceName, (res) => {
|
353
|
+
if (!res) {
|
354
|
+
this.loading = false
|
355
|
+
this.loadError = true
|
356
|
+
return
|
357
|
+
}
|
358
|
+
this.updateComponents(res)
|
359
|
+
}, this.env === 'dev')
|
360
|
+
},
|
361
|
+
getConfigBySource () {
|
362
|
+
parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
|
363
|
+
if (!res) {
|
364
|
+
this.loading = false
|
365
|
+
this.loadError = true
|
366
|
+
return
|
367
|
+
}
|
368
|
+
this.updateComponents(res, true)
|
369
|
+
})
|
370
|
+
},
|
371
|
+
getColumnJsonByLogic () {
|
372
|
+
getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
|
373
|
+
if (!res) {
|
374
|
+
this.loading = false
|
375
|
+
this.loadError = true
|
376
|
+
return
|
377
|
+
}
|
378
|
+
this.updateComponents(res, true)
|
379
|
+
}, this.env === 'dev')
|
380
|
+
},
|
381
|
+
/**
|
382
|
+
* 更新子组件
|
383
|
+
* @param res 参数
|
384
|
+
* @param setQueryParams 是否设置queryParams参数
|
385
|
+
*/
|
386
|
+
updateComponents (res, setQueryParams) {
|
387
|
+
this.realQueryConfig = res
|
388
|
+
if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
|
389
|
+
// 设置添加按钮对应的配置名
|
390
|
+
this.moveconfig = res.moveconfig
|
391
|
+
const initTable = () => {
|
392
|
+
// 初始化 xTable 子组件
|
393
|
+
this.$refs.xTable.init({
|
394
|
+
formItems: res.formJson,
|
395
|
+
primaryKey: res.primaryKey,
|
396
|
+
createdQuery: res.createdQuery,
|
397
|
+
queryParams: setQueryParams ? res : null,
|
398
|
+
tableColumns: res.columnJson,
|
399
|
+
buttonState: Object.assign(res.buttonState, this.buttonState),
|
400
|
+
buttonPermissions: res.buttonPermissions,
|
401
|
+
editButtonStateData: res.editButtonStateData,
|
402
|
+
title: this.title,
|
403
|
+
viewMode: this.viewMode,
|
404
|
+
localEditMode: this.localEditMode,
|
405
|
+
rowSelectMode: this.rowSelectMode,
|
406
|
+
allowSelectRowNum: this.allowSelectRowNum,
|
407
|
+
tableSummaryMap: res.tableSummaryMap,
|
408
|
+
serviceName: this.serviceName,
|
409
|
+
env: this.env,
|
410
|
+
form: this.$refs.xForm.form,
|
411
|
+
allowedCardMode: res.allowedCardMode,
|
412
|
+
cardModeConfig: res.cardModeConfig,
|
413
|
+
createdEditMode: res.createdEditMode,
|
414
|
+
summaryUpdate: true,
|
415
|
+
simpleMode: res.simpleMode
|
416
|
+
})
|
417
|
+
if (this.realQueryConfig?.funcData?.pageMounted) {
|
418
|
+
executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
|
419
|
+
}
|
420
|
+
}
|
421
|
+
// 初始化 xForm 子组件
|
422
|
+
if (!this.localEditMode && !this.rowSelectMode) {
|
423
|
+
this.$refs.xForm.init({
|
424
|
+
formItems: res.formJson,
|
425
|
+
serviceName: this.serviceName,
|
426
|
+
getDataParams: this.getDataParams,
|
427
|
+
simpleMode: res.simpleMode,
|
428
|
+
env: this.env
|
429
|
+
})
|
430
|
+
} else {
|
431
|
+
// TODO 此处应删除
|
432
|
+
initTable()
|
433
|
+
}
|
434
|
+
// 初始化 xTable 子组件
|
435
|
+
// 等待 x-from-item 的 mounted 完成
|
436
|
+
this.$refs.xForm.$on('itemsMounted', initTable)
|
437
|
+
}
|
438
|
+
this.loading = false
|
439
|
+
},
|
440
|
+
// 自定义按钮
|
441
|
+
editButtonStateDataClick (functionName, rows) {
|
442
|
+
console.log('functionName', functionName)
|
443
|
+
console.log('rows', rows)
|
444
|
+
this.$emit(functionName, rows)
|
445
|
+
},
|
446
|
+
|
447
|
+
/**
|
448
|
+
* 提交查询表单事件
|
449
|
+
* @param res 参数
|
450
|
+
*/
|
451
|
+
onSearchSubmit (res) {
|
452
|
+
if (res.valid) {
|
453
|
+
// 表单赋值
|
454
|
+
this.$refs.xTable.setQueryForm(res.form)
|
455
|
+
this.$refs.xTable.summaryUpdate = true
|
456
|
+
// commit
|
457
|
+
this.$emit('afterSearchSubmit', res)
|
458
|
+
} else {
|
459
|
+
return false
|
460
|
+
}
|
461
|
+
},
|
462
|
+
active (props) {
|
463
|
+
let num = false
|
464
|
+
for (const key in props) {
|
465
|
+
// eslint-disable-next-line no-prototype-builtins
|
466
|
+
if (this.$props.hasOwnProperty(key)) {
|
467
|
+
if (this.$props[key] instanceof Object) {
|
468
|
+
this.$props[key] = JSON.parse(props[key])
|
469
|
+
} else {
|
470
|
+
this.$props[key] = props[key]
|
471
|
+
}
|
472
|
+
num = true
|
473
|
+
}
|
474
|
+
}
|
475
|
+
if (num) {
|
476
|
+
this.initConfig()
|
477
|
+
}
|
478
|
+
},
|
479
|
+
/**
|
480
|
+
* 提交新增/修改表单后事件
|
481
|
+
*/
|
482
|
+
onAddOrEditSubmitAfterSubmit (res) {
|
483
|
+
this.refreshTable(res.businessType === '新增')
|
484
|
+
// commit
|
485
|
+
this.$emit('afterSubmit', res)
|
486
|
+
},
|
487
|
+
/**
|
488
|
+
* 表格查询后事件
|
489
|
+
* @param res 参数
|
490
|
+
* @param conditionParams 查询条件
|
491
|
+
*/
|
492
|
+
afterQuery (res, conditionParams) {
|
493
|
+
this.$emit('afterQuery', res, conditionParams)
|
494
|
+
},
|
495
|
+
/**
|
496
|
+
* 详情按钮事件
|
497
|
+
* @param record 本条数据
|
498
|
+
* @param id 数据标识
|
499
|
+
* @param actionType 操作类型
|
500
|
+
* @param fun 向上级传递的事件
|
501
|
+
*/
|
502
|
+
action (record, id, actionType, fun = 'action') {
|
503
|
+
this.$emit(fun, record, id, actionType)
|
504
|
+
},
|
505
|
+
treeOnChecked (checkedKeys, deepNodes, deepKeys) {
|
506
|
+
this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
|
507
|
+
},
|
508
|
+
treeBtnFuncClick (index, func) {
|
509
|
+
this.$emit('treeBtnFuncClick', index, func)
|
510
|
+
},
|
511
|
+
/**
|
512
|
+
* 新增按钮事件
|
513
|
+
*/
|
514
|
+
add () {
|
515
|
+
if (this.customAdd) {
|
516
|
+
this.$emit('add')
|
517
|
+
} else {
|
518
|
+
const res = this.realQueryConfig
|
519
|
+
this.$refs.xAddForm.init({
|
520
|
+
businessType: '新增',
|
521
|
+
title: this.title,
|
522
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
523
|
+
configName: this.queryParamsName,
|
524
|
+
configContent: this.queryParamsJson,
|
525
|
+
formItems: res.formJson,
|
526
|
+
viewMode: this.viewMode,
|
527
|
+
localEditMode: this.localEditMode,
|
528
|
+
isHandleFormKey: this.localEditMode ? false : undefined,
|
529
|
+
serviceName: this.serviceName,
|
530
|
+
fixedAddForm: this.fixedAddForm,
|
531
|
+
getDataParams: this.getDataParams,
|
532
|
+
layout: res.xAddFormLayout || 'horizontal',
|
533
|
+
env: this.env
|
534
|
+
})
|
535
|
+
}
|
536
|
+
},
|
537
|
+
/**
|
538
|
+
* 添加按钮事件
|
539
|
+
*/
|
540
|
+
move () {
|
541
|
+
this.moveType = true
|
542
|
+
this.$nextTick(
|
543
|
+
() => {
|
544
|
+
this.$refs.xAddReport.init({
|
545
|
+
configName: this.moveconfig,
|
546
|
+
selectedId: this.fixedAddForm.selected_id
|
547
|
+
})
|
548
|
+
}
|
549
|
+
)
|
550
|
+
},
|
551
|
+
/**
|
552
|
+
* 修改按钮事件
|
553
|
+
* @param modifyModelData 修改表单数据
|
554
|
+
*/
|
555
|
+
edit (modifyModelData) {
|
556
|
+
if (this.customEdit) {
|
557
|
+
this.$emit('edit')
|
558
|
+
} else {
|
559
|
+
const res = this.realQueryConfig
|
560
|
+
this.$refs.xAddForm.init({
|
561
|
+
businessType: '修改',
|
562
|
+
title: this.title,
|
563
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
564
|
+
configName: this.queryParamsName,
|
565
|
+
configContent: this.queryParamsJson,
|
566
|
+
formItems: res.formJson,
|
567
|
+
viewMode: this.viewMode,
|
568
|
+
localEditMode: this.localEditMode,
|
569
|
+
isHandleFormKey: this.localEditMode ? false : undefined,
|
570
|
+
serviceName: this.serviceName,
|
571
|
+
fixedAddForm: this.fixedAddForm,
|
572
|
+
getDataParams: this.getDataParams,
|
573
|
+
modifyModelData: modifyModelData,
|
574
|
+
layout: res.xAddFormLayout || 'horizontal',
|
575
|
+
env: this.env
|
576
|
+
})
|
577
|
+
}
|
578
|
+
},
|
579
|
+
/**
|
580
|
+
* 删除按钮事件
|
581
|
+
*/
|
582
|
+
del (keys, callback) {
|
583
|
+
if (this.customDelete) {
|
584
|
+
this.$emit('del', keys, callback)
|
585
|
+
}
|
586
|
+
},
|
587
|
+
/**
|
588
|
+
* 删除后事件
|
589
|
+
* @param res
|
590
|
+
*/
|
591
|
+
afterDelete (res) {
|
592
|
+
this.$emit('afterDelete', res)
|
593
|
+
},
|
594
|
+
/**
|
595
|
+
* 行选择事件
|
596
|
+
* @param row 选中行
|
597
|
+
*/
|
598
|
+
rowChoose (row) {
|
599
|
+
this.$emit('rowChoose', row)
|
600
|
+
},
|
601
|
+
/**
|
602
|
+
* 更多条件是否展示
|
603
|
+
*/
|
604
|
+
toggleAdvanced () {
|
605
|
+
this.$refs.xTable.setScrollYHeight({})
|
606
|
+
},
|
607
|
+
/**
|
608
|
+
* 查询表单部分显示/隐藏切换
|
609
|
+
*/
|
610
|
+
toggleIsFormShow () {
|
611
|
+
this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
|
612
|
+
this.$refs.xForm.toggleVisible()
|
613
|
+
this.$refs.xTable.setScrollYHeight({})
|
614
|
+
},
|
615
|
+
/**
|
616
|
+
* 选择列事件
|
617
|
+
* @param selectedRowKeys 选中列Key集合
|
618
|
+
* @param selectedRows 选中列
|
619
|
+
*/
|
620
|
+
selectRow (selectedRowKeys, selectedRows) {
|
621
|
+
this.table_selectedRowKeys = selectedRowKeys
|
622
|
+
this.table_selectedRows = selectedRows
|
623
|
+
this.$emit('selectRow', selectedRowKeys, selectedRows)
|
624
|
+
},
|
625
|
+
/**
|
626
|
+
* 清除勾选数据
|
627
|
+
*/
|
628
|
+
clearRowKeys () {
|
629
|
+
this.$refs.xTable.clearRowKeys()
|
630
|
+
},
|
631
|
+
/**
|
632
|
+
* 刷新表格
|
633
|
+
* @param toFirstPage 是否到第一页
|
634
|
+
*/
|
635
|
+
refreshTable (toFirstPage = true) {
|
636
|
+
this.$refs.xTable.refresh(toFirstPage)
|
637
|
+
},
|
638
|
+
/**
|
639
|
+
* 刷新表格
|
640
|
+
* @param toFirstPage 是否到第一页
|
641
|
+
*/
|
642
|
+
refresh (toFirstPage = true) {
|
643
|
+
this.$refs.xTable.refresh(toFirstPage)
|
644
|
+
},
|
645
|
+
/**
|
646
|
+
* 获取表格数据
|
647
|
+
*/
|
648
|
+
getTableData () {
|
649
|
+
return this.$refs.xTable.getTableData()
|
650
|
+
},
|
651
|
+
/**
|
652
|
+
* 表单本地提交
|
653
|
+
*/
|
654
|
+
onLocalSubmit (res, callback) {
|
655
|
+
const form = res.realForm
|
656
|
+
if (res.businessType === '新增') {
|
657
|
+
this.$refs.xTable.appendLocalData(form)
|
658
|
+
} else {
|
659
|
+
this.$refs.xTable.modifyLocalData(form['序号'], form)
|
660
|
+
}
|
661
|
+
this.$message.success(res.businessType + '成功!')
|
662
|
+
this.onAddOrEditSubmitAfterSubmit(res, callback)
|
663
|
+
if (callback) {
|
664
|
+
callback()
|
665
|
+
}
|
666
|
+
}
|
667
|
+
},
|
668
|
+
action: {
|
669
|
+
/**
|
670
|
+
* 实现doAction方法
|
671
|
+
*/
|
672
|
+
doAction (actionType, args, data) {
|
673
|
+
switch (actionType) {
|
674
|
+
case 'refreshTable':
|
675
|
+
for (const item in args) {
|
676
|
+
console.log('item', item)
|
677
|
+
}
|
678
|
+
break
|
679
|
+
default:
|
680
|
+
break
|
681
|
+
}
|
682
|
+
}
|
683
|
+
},
|
684
|
+
mounted () {
|
685
|
+
this.initConfig()
|
686
|
+
if (this.getSelectedData && typeof this.getSelectedData === 'function') {
|
687
|
+
const selectedId = this.getSelectedData()
|
688
|
+
if (typeof selectedId === 'object') {
|
689
|
+
const data = JSON.parse(JSON.stringify(selectedId))
|
690
|
+
if (data.selectedId) {
|
691
|
+
data.selected_id = data.selectedId
|
692
|
+
delete data.selectedId
|
693
|
+
}
|
694
|
+
Object.assign(this.fixedAddForm, data)
|
695
|
+
Object.assign(this.fixedQueryForm, data)
|
696
|
+
} else {
|
697
|
+
Object.assign(this.fixedAddForm, { selected_id: selectedId })
|
698
|
+
Object.assign(this.fixedQueryForm, { selected_id: selectedId })
|
699
|
+
}
|
700
|
+
}
|
701
|
+
}
|
702
|
+
}
|
703
|
+
</script>
|
704
|
+
<style lang="less" scoped>
|
705
|
+
.crud_title {
|
706
|
+
height: 32px;
|
707
|
+
font-size: 16px;
|
708
|
+
font-weight: 500;
|
709
|
+
color: #000000d9;
|
710
|
+
line-height: 32px;
|
711
|
+
margin-bottom: 12px;
|
712
|
+
}
|
713
|
+
</style>
|