vue2-client 1.17.21 → 1.17.23
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/.claude/settings.local.json +20 -20
- package/.cursorrules +19 -19
- package/.env.apply +19 -19
- package/.env.gaslink +19 -19
- package/.env.his +19 -19
- package/.env.liuli +20 -20
- package/.env.message +19 -19
- package/.env.scada +19 -19
- package/.eslintrc.js +90 -90
- package/.serena/memories/code_style_conventions.md +217 -217
- package/.serena/memories/project_overview.md +54 -54
- package/.serena/memories/project_structure.md +329 -329
- package/.serena/memories/suggested_commands.md +127 -127
- package/.serena/memories/task_completion_checklist.md +183 -183
- package/.serena/memories/tech_stack.md +94 -94
- package/CHANGELOG.md +830 -830
- package/CLAUDE.md +97 -97
- package/Components.md +60 -60
- 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 +112 -112
- 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/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/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/HIS/demo.vue +61 -61
- package/src/base-client/components/common/ImagePreviewModal/ImagePreviewModal.vue +427 -0
- package/src/base-client/components/common/ImagePreviewModal/index.js +3 -0
- 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/Upload.vue +53 -49
- 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 +1288 -1288
- package/src/base-client/components/common/XAddNativeForm/demo.vue +54 -54
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +304 -304
- 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/index.js +3 -3
- package/src/base-client/components/common/XButtons/index.md +61 -61
- package/src/base-client/components/common/XCalendar/XCalendar.vue +4 -4
- 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/index.js +3 -3
- package/src/base-client/components/common/XFormTable/index.md +92 -92
- 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/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 +612 -614
- 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/XCharge/XChargeDemo.vue +145 -145
- package/src/base-client/components/his/XHDescriptions/XHDescriptions.vue +109 -10
- 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/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 +60 -60
- 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/lib.js +1 -1
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- 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/WorkflowPageDetail/TrimTextTail.vue +23 -23
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +1811 -1811
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +1014 -1014
- package/src/pages/XReportView/index.vue +64 -64
- package/src/pages/XTreeOneProExample/index.vue +67 -67
- package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
- package/src/pages/login/Login.vue +379 -379
- 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/router.map.js +133 -133
- 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/entity.js +18 -18
- package/src/services/api/index.js +17 -17
- package/src/store/modules/account.js +121 -121
- 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/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//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
|
@@ -1,614 +1,612 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card v-if="config" :bordered="false" :body-style="bodyStyle">
|
|
3
|
-
<a-tabs
|
|
4
|
-
:tabBarGutter="tabBarGutter"
|
|
5
|
-
:activeKey="activeKey"
|
|
6
|
-
@change="(activeKey) => tabPaneChange(activeKey, false)"
|
|
7
|
-
:hideAdd="true"
|
|
8
|
-
:tabBarStyle="{ display: showTabBar ? 'block' : 'none' }"
|
|
9
|
-
>
|
|
10
|
-
<template #tabBarExtraContent v-if="$slots.tabBarExtraContent || tabBarExtraContent">
|
|
11
|
-
<slot name="tabBarExtraContent"></slot>
|
|
12
|
-
</template>
|
|
13
|
-
<slot name="extraBeforeTabs"></slot>
|
|
14
|
-
<a-tab-pane
|
|
15
|
-
v-for="(tab, index) in config.data"
|
|
16
|
-
:key="index"
|
|
17
|
-
:tab="tab.title"
|
|
18
|
-
:forceRender="isTabLoaded(index)"
|
|
19
|
-
>
|
|
20
|
-
<component
|
|
21
|
-
v-if="isTabLoaded(index)"
|
|
22
|
-
:is="tab.slotType"
|
|
23
|
-
:key="'xTabPaneComp' + index"
|
|
24
|
-
:ref="`tab_com_${tab.slotType}_${index}`"
|
|
25
|
-
:serviceName="tab.serviceName"
|
|
26
|
-
:serverName="tab.serviceName"
|
|
27
|
-
:queryParamsName="tab.slotConfig"
|
|
28
|
-
v-on="getEventHandlers(tab,index)"
|
|
29
|
-
@hook:mounted="(h)=>onComponentMounted(h,tab,index)"
|
|
30
|
-
:config-name="tab.slotConfig"
|
|
31
|
-
:env="env"
|
|
32
|
-
v-bind="compProp"
|
|
33
|
-
:extra-data="extraData"
|
|
34
|
-
/>
|
|
35
|
-
</a-tab-pane>
|
|
36
|
-
</a-tabs>
|
|
37
|
-
</a-card>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import { getConfigByName, getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
|
|
42
|
-
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
43
|
-
import { getRealKeyData } from '@vue2-client/utils/util'
|
|
44
|
-
import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
45
|
-
import { mapState } from 'vuex'
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
name: 'XTab',
|
|
49
|
-
components: {
|
|
50
|
-
XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable'),
|
|
51
|
-
XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
|
|
52
|
-
XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue')
|
|
53
|
-
},
|
|
54
|
-
inject: {
|
|
55
|
-
isInAModal: { default: false },
|
|
56
|
-
getSelectedId: { default: false },
|
|
57
|
-
getSelectedData: { default: false },
|
|
58
|
-
getOutEnv: { default: false },
|
|
59
|
-
setGlobalData: { default: false },
|
|
60
|
-
getGlobalData: { default: false },
|
|
61
|
-
generalFunction: { default: false },
|
|
62
|
-
},
|
|
63
|
-
provide () {
|
|
64
|
-
return {
|
|
65
|
-
currUser: this.currUser,
|
|
66
|
-
getSelectedId: this.getSelectedId,
|
|
67
|
-
// 暴露页签加载相关方法,供子组件调用
|
|
68
|
-
ensureTabLoaded: this.ensureTabLoaded,
|
|
69
|
-
getTabComponent: this.getTabComponent,
|
|
70
|
-
isTabLoaded: this.isTabLoaded
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
data () {
|
|
74
|
-
return {
|
|
75
|
-
activeKey: 0,
|
|
76
|
-
// 配置
|
|
77
|
-
config: undefined,
|
|
78
|
-
tabBarExtraContent: undefined,
|
|
79
|
-
attr: {},
|
|
80
|
-
showTabBar: true, // 默认显示页签
|
|
81
|
-
loadedTabs: [] // 记录已加载的页签索引
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
computed: {
|
|
85
|
-
...mapState('account', { currUser: 'user' })
|
|
86
|
-
},
|
|
87
|
-
mounted () {
|
|
88
|
-
this.activeKey = this.defaultActiveKey
|
|
89
|
-
// 标记默认激活的页签为已加载
|
|
90
|
-
this.markTabAsLoaded(this.defaultActiveKey)
|
|
91
|
-
this.tabPaneChange('initTabLoading', true)
|
|
92
|
-
},
|
|
93
|
-
methods: {
|
|
94
|
-
// 自定义函数中调用的方法 这个不能删
|
|
95
|
-
getWindow,
|
|
96
|
-
runLogic,
|
|
97
|
-
isMicroAppEnv,
|
|
98
|
-
microDispatch,
|
|
99
|
-
getMicroData,
|
|
100
|
-
getRealKeyData,
|
|
101
|
-
getConfigByName,
|
|
102
|
-
getConfigByNameAsync,
|
|
103
|
-
async tabPaneChange (newKey, initStatus = false) {
|
|
104
|
-
let result = {}
|
|
105
|
-
if (this.activeKey === newKey) {
|
|
106
|
-
return
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const oldKey = this.activeKey
|
|
110
|
-
|
|
111
|
-
// 标记新页签为已加载
|
|
112
|
-
if (this.config && this.config.data && this.config.data[newKey] !== undefined) {
|
|
113
|
-
this.markTabAsLoaded(newKey)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (this.config && this.config.changeFunc) {
|
|
117
|
-
let oldRef
|
|
118
|
-
let oldTabName
|
|
119
|
-
let newRef
|
|
120
|
-
let newTabName
|
|
121
|
-
|
|
122
|
-
if (!this.config.data[oldKey]) {
|
|
123
|
-
oldTabName = `tab_com_${oldKey}`
|
|
124
|
-
oldRef = this.$refs[oldTabName]
|
|
125
|
-
} else {
|
|
126
|
-
const oldTabSlotType = this.config.data[oldKey].slotType
|
|
127
|
-
oldTabName = `tab_com_${oldTabSlotType}_${oldKey}`
|
|
128
|
-
oldRef = this.$refs[oldTabName]
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (!this.config.data[newKey]) {
|
|
132
|
-
newTabName = `tab_com_${newKey}`
|
|
133
|
-
newRef = this.$refs[newTabName]
|
|
134
|
-
} else {
|
|
135
|
-
const newTabSlotType = this.config.data[newKey].slotType
|
|
136
|
-
newTabName = `tab_com_${newTabSlotType}_${newKey}`
|
|
137
|
-
newRef = this.$refs[newTabName]
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const args = [
|
|
141
|
-
oldKey,
|
|
142
|
-
newKey,
|
|
143
|
-
this.config.data[oldKey],
|
|
144
|
-
this.config.data[newKey],
|
|
145
|
-
oldRef ? oldRef[0] : undefined,
|
|
146
|
-
]
|
|
147
|
-
args.push(newTabName)
|
|
148
|
-
|
|
149
|
-
// 关键修改:确保新组件实例存在
|
|
150
|
-
if (!newRef || !newRef[0]) {
|
|
151
|
-
console.log('等待新页签组件初始化...')
|
|
152
|
-
// 等待组件挂载完成
|
|
153
|
-
await this.waitForComponentReady(newKey)
|
|
154
|
-
newRef = this.$refs[newTabName]
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (newRef && newRef[0]) {
|
|
158
|
-
args.push(newRef[0])
|
|
159
|
-
} else {
|
|
160
|
-
args.push(null)
|
|
161
|
-
console.warn('新页签组件实例获取失败')
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
args.push(this.extraData)
|
|
165
|
-
|
|
166
|
-
// 使用 $nextTick 确保 DOM 更新完成
|
|
167
|
-
await this.$nextTick()
|
|
168
|
-
|
|
169
|
-
// 确保组件完全就绪后再执行 changeFunc
|
|
170
|
-
if (newRef && newRef[0]) {
|
|
171
|
-
// 等待组件完全就绪(包括内部异步初始化)
|
|
172
|
-
await this.waitForComponentFullyReady(newRef[0], newKey)
|
|
173
|
-
} else {
|
|
174
|
-
// 如果没有组件实例,等待一个 tick 确保 DOM 更新
|
|
175
|
-
await this.$nextTick()
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
result = executeStrFunctionByContext(this, this.config.changeFunc, args)
|
|
179
|
-
|
|
180
|
-
if (result && result.noChange) {
|
|
181
|
-
console.info('不切换页签作为按钮使用')
|
|
182
|
-
// 如果返回 noChange,恢复原来的 activeKey
|
|
183
|
-
if (this.activeKey === newKey) {
|
|
184
|
-
this.activeKey = oldKey
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
// 确保 activeKey 已更新(如果还没更新的话)
|
|
188
|
-
if (this.activeKey !== newKey) {
|
|
189
|
-
this.activeKey = newKey
|
|
190
|
-
}
|
|
191
|
-
// 确保回调在组件完全就绪后执行
|
|
192
|
-
if (result && result.callback && typeof result.callback === 'function') {
|
|
193
|
-
await this.$nextTick()
|
|
194
|
-
result.callback()
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
this.activeKey = newKey
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (initStatus) {
|
|
202
|
-
this.activeKey = this.defaultActiveKey
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
// 新增:等待组件就绪的方法
|
|
207
|
-
waitForComponentReady (index) {
|
|
208
|
-
return new Promise((resolve) => {
|
|
209
|
-
const checkComponent = () => {
|
|
210
|
-
const tab = this.config.data[index]
|
|
211
|
-
const refName = `tab_com_${tab.slotType}_${index}`
|
|
212
|
-
const ref = this.$refs[refName]
|
|
213
|
-
|
|
214
|
-
if (ref && ref[0]) {
|
|
215
|
-
// 额外检查组件内部是否已初始化(如果有相关状态的话)
|
|
216
|
-
if (ref[0].isReady !== undefined) {
|
|
217
|
-
if (ref[0].isReady) {
|
|
218
|
-
resolve(ref[0])
|
|
219
|
-
} else {
|
|
220
|
-
setTimeout(checkComponent, 50)
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
resolve(ref[0])
|
|
224
|
-
}
|
|
225
|
-
} else {
|
|
226
|
-
setTimeout(checkComponent, 50)
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
checkComponent()
|
|
231
|
-
})
|
|
232
|
-
},
|
|
233
|
-
// 等待组件完全就绪(包括内部异步初始化)
|
|
234
|
-
waitForComponentFullyReady (component, index) {
|
|
235
|
-
return new Promise((resolve) => {
|
|
236
|
-
if (!component) {
|
|
237
|
-
resolve()
|
|
238
|
-
return
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
let attempts = 0
|
|
242
|
-
const maxAttempts = 60 // 最多等待3秒
|
|
243
|
-
const checkInterval = 50
|
|
244
|
-
|
|
245
|
-
const checkReady = () => {
|
|
246
|
-
attempts++
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
tab?.slotType === '
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if (this.
|
|
325
|
-
this.
|
|
326
|
-
|
|
327
|
-
this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
//
|
|
332
|
-
this.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
this.
|
|
341
|
-
//
|
|
342
|
-
this.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
//
|
|
455
|
-
this
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
</
|
|
613
|
-
<style scoped>
|
|
614
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card v-if="config" :bordered="false" :body-style="bodyStyle">
|
|
3
|
+
<a-tabs
|
|
4
|
+
:tabBarGutter="tabBarGutter"
|
|
5
|
+
:activeKey="activeKey"
|
|
6
|
+
@change="(activeKey) => tabPaneChange(activeKey, false)"
|
|
7
|
+
:hideAdd="true"
|
|
8
|
+
:tabBarStyle="{ display: showTabBar ? 'block' : 'none' }"
|
|
9
|
+
>
|
|
10
|
+
<template #tabBarExtraContent v-if="$slots.tabBarExtraContent || tabBarExtraContent">
|
|
11
|
+
<slot name="tabBarExtraContent"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
<slot name="extraBeforeTabs"></slot>
|
|
14
|
+
<a-tab-pane
|
|
15
|
+
v-for="(tab, index) in config.data"
|
|
16
|
+
:key="index"
|
|
17
|
+
:tab="tab.title"
|
|
18
|
+
:forceRender="isTabLoaded(index)"
|
|
19
|
+
>
|
|
20
|
+
<component
|
|
21
|
+
v-if="isTabLoaded(index)"
|
|
22
|
+
:is="tab.slotType"
|
|
23
|
+
:key="'xTabPaneComp' + index"
|
|
24
|
+
:ref="`tab_com_${tab.slotType}_${index}`"
|
|
25
|
+
:serviceName="tab.serviceName"
|
|
26
|
+
:serverName="tab.serviceName"
|
|
27
|
+
:queryParamsName="tab.slotConfig"
|
|
28
|
+
v-on="getEventHandlers(tab,index)"
|
|
29
|
+
@hook:mounted="(h)=>onComponentMounted(h,tab,index)"
|
|
30
|
+
:config-name="tab.slotConfig"
|
|
31
|
+
:env="env"
|
|
32
|
+
v-bind="compProp"
|
|
33
|
+
:extra-data="extraData"
|
|
34
|
+
/>
|
|
35
|
+
</a-tab-pane>
|
|
36
|
+
</a-tabs>
|
|
37
|
+
</a-card>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { getConfigByName, getConfigByNameAsync, runLogic } from '@vue2-client/services/api/common'
|
|
42
|
+
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
43
|
+
import { getRealKeyData } from '@vue2-client/utils/util'
|
|
44
|
+
import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
45
|
+
import { mapState } from 'vuex'
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'XTab',
|
|
49
|
+
components: {
|
|
50
|
+
XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable'),
|
|
51
|
+
XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
|
|
52
|
+
XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue')
|
|
53
|
+
},
|
|
54
|
+
inject: {
|
|
55
|
+
isInAModal: { default: false },
|
|
56
|
+
getSelectedId: { default: false },
|
|
57
|
+
getSelectedData: { default: false },
|
|
58
|
+
getOutEnv: { default: false },
|
|
59
|
+
setGlobalData: { default: false },
|
|
60
|
+
getGlobalData: { default: false },
|
|
61
|
+
generalFunction: { default: false },
|
|
62
|
+
},
|
|
63
|
+
provide () {
|
|
64
|
+
return {
|
|
65
|
+
currUser: this.currUser,
|
|
66
|
+
getSelectedId: this.getSelectedId,
|
|
67
|
+
// 暴露页签加载相关方法,供子组件调用
|
|
68
|
+
ensureTabLoaded: this.ensureTabLoaded,
|
|
69
|
+
getTabComponent: this.getTabComponent,
|
|
70
|
+
isTabLoaded: this.isTabLoaded
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
data () {
|
|
74
|
+
return {
|
|
75
|
+
activeKey: 0,
|
|
76
|
+
// 配置
|
|
77
|
+
config: undefined,
|
|
78
|
+
tabBarExtraContent: undefined,
|
|
79
|
+
attr: {},
|
|
80
|
+
showTabBar: true, // 默认显示页签
|
|
81
|
+
loadedTabs: [] // 记录已加载的页签索引
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
computed: {
|
|
85
|
+
...mapState('account', { currUser: 'user' })
|
|
86
|
+
},
|
|
87
|
+
mounted () {
|
|
88
|
+
this.activeKey = this.defaultActiveKey
|
|
89
|
+
// 标记默认激活的页签为已加载
|
|
90
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
91
|
+
this.tabPaneChange('initTabLoading', true)
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
// 自定义函数中调用的方法 这个不能删
|
|
95
|
+
getWindow,
|
|
96
|
+
runLogic,
|
|
97
|
+
isMicroAppEnv,
|
|
98
|
+
microDispatch,
|
|
99
|
+
getMicroData,
|
|
100
|
+
getRealKeyData,
|
|
101
|
+
getConfigByName,
|
|
102
|
+
getConfigByNameAsync,
|
|
103
|
+
async tabPaneChange (newKey, initStatus = false) {
|
|
104
|
+
let result = {}
|
|
105
|
+
if (this.activeKey === newKey) {
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const oldKey = this.activeKey
|
|
110
|
+
|
|
111
|
+
// 标记新页签为已加载
|
|
112
|
+
if (this.config && this.config.data && this.config.data[newKey] !== undefined) {
|
|
113
|
+
this.markTabAsLoaded(newKey)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (this.config && this.config.changeFunc) {
|
|
117
|
+
let oldRef
|
|
118
|
+
let oldTabName
|
|
119
|
+
let newRef
|
|
120
|
+
let newTabName
|
|
121
|
+
|
|
122
|
+
if (!this.config.data[oldKey]) {
|
|
123
|
+
oldTabName = `tab_com_${oldKey}`
|
|
124
|
+
oldRef = this.$refs[oldTabName]
|
|
125
|
+
} else {
|
|
126
|
+
const oldTabSlotType = this.config.data[oldKey].slotType
|
|
127
|
+
oldTabName = `tab_com_${oldTabSlotType}_${oldKey}`
|
|
128
|
+
oldRef = this.$refs[oldTabName]
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (!this.config.data[newKey]) {
|
|
132
|
+
newTabName = `tab_com_${newKey}`
|
|
133
|
+
newRef = this.$refs[newTabName]
|
|
134
|
+
} else {
|
|
135
|
+
const newTabSlotType = this.config.data[newKey].slotType
|
|
136
|
+
newTabName = `tab_com_${newTabSlotType}_${newKey}`
|
|
137
|
+
newRef = this.$refs[newTabName]
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const args = [
|
|
141
|
+
oldKey,
|
|
142
|
+
newKey,
|
|
143
|
+
this.config.data[oldKey],
|
|
144
|
+
this.config.data[newKey],
|
|
145
|
+
oldRef ? oldRef[0] : undefined,
|
|
146
|
+
]
|
|
147
|
+
args.push(newTabName)
|
|
148
|
+
|
|
149
|
+
// 关键修改:确保新组件实例存在
|
|
150
|
+
if (!newRef || !newRef[0]) {
|
|
151
|
+
console.log('等待新页签组件初始化...')
|
|
152
|
+
// 等待组件挂载完成
|
|
153
|
+
await this.waitForComponentReady(newKey)
|
|
154
|
+
newRef = this.$refs[newTabName]
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (newRef && newRef[0]) {
|
|
158
|
+
args.push(newRef[0])
|
|
159
|
+
} else {
|
|
160
|
+
args.push(null)
|
|
161
|
+
console.warn('新页签组件实例获取失败')
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
args.push(this.extraData)
|
|
165
|
+
|
|
166
|
+
// 使用 $nextTick 确保 DOM 更新完成
|
|
167
|
+
await this.$nextTick()
|
|
168
|
+
|
|
169
|
+
// 确保组件完全就绪后再执行 changeFunc
|
|
170
|
+
if (newRef && newRef[0]) {
|
|
171
|
+
// 等待组件完全就绪(包括内部异步初始化)
|
|
172
|
+
await this.waitForComponentFullyReady(newRef[0], newKey)
|
|
173
|
+
} else {
|
|
174
|
+
// 如果没有组件实例,等待一个 tick 确保 DOM 更新
|
|
175
|
+
await this.$nextTick()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
result = executeStrFunctionByContext(this, this.config.changeFunc, args)
|
|
179
|
+
|
|
180
|
+
if (result && result.noChange) {
|
|
181
|
+
console.info('不切换页签作为按钮使用')
|
|
182
|
+
// 如果返回 noChange,恢复原来的 activeKey
|
|
183
|
+
if (this.activeKey === newKey) {
|
|
184
|
+
this.activeKey = oldKey
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
// 确保 activeKey 已更新(如果还没更新的话)
|
|
188
|
+
if (this.activeKey !== newKey) {
|
|
189
|
+
this.activeKey = newKey
|
|
190
|
+
}
|
|
191
|
+
// 确保回调在组件完全就绪后执行
|
|
192
|
+
if (result && result.callback && typeof result.callback === 'function') {
|
|
193
|
+
await this.$nextTick()
|
|
194
|
+
result.callback()
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
this.activeKey = newKey
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (initStatus) {
|
|
202
|
+
this.activeKey = this.defaultActiveKey
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
// 新增:等待组件就绪的方法
|
|
207
|
+
waitForComponentReady (index) {
|
|
208
|
+
return new Promise((resolve) => {
|
|
209
|
+
const checkComponent = () => {
|
|
210
|
+
const tab = this.config.data[index]
|
|
211
|
+
const refName = `tab_com_${tab.slotType}_${index}`
|
|
212
|
+
const ref = this.$refs[refName]
|
|
213
|
+
|
|
214
|
+
if (ref && ref[0]) {
|
|
215
|
+
// 额外检查组件内部是否已初始化(如果有相关状态的话)
|
|
216
|
+
if (ref[0].isReady !== undefined) {
|
|
217
|
+
if (ref[0].isReady) {
|
|
218
|
+
resolve(ref[0])
|
|
219
|
+
} else {
|
|
220
|
+
setTimeout(checkComponent, 50)
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
resolve(ref[0])
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
setTimeout(checkComponent, 50)
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
checkComponent()
|
|
231
|
+
})
|
|
232
|
+
},
|
|
233
|
+
// 等待组件完全就绪(包括内部异步初始化)
|
|
234
|
+
waitForComponentFullyReady (component, index) {
|
|
235
|
+
return new Promise((resolve) => {
|
|
236
|
+
if (!component) {
|
|
237
|
+
resolve()
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
let attempts = 0
|
|
242
|
+
const maxAttempts = 60 // 最多等待3秒
|
|
243
|
+
const checkInterval = 50
|
|
244
|
+
|
|
245
|
+
const checkReady = () => {
|
|
246
|
+
attempts++
|
|
247
|
+
// 1. 检查组件是否有 loading 状态,确保不在加载中
|
|
248
|
+
if (component.loading === true) {
|
|
249
|
+
if (attempts < maxAttempts) {
|
|
250
|
+
setTimeout(checkReady, checkInterval)
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 2. 检查组件是否有 loaded 状态(如 XAddNativeForm)
|
|
256
|
+
if (component.loaded === false) {
|
|
257
|
+
if (attempts < maxAttempts) {
|
|
258
|
+
setTimeout(checkReady, checkInterval)
|
|
259
|
+
return
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 3. 检查组件是否有 realQueryConfig(如 XFormTable)
|
|
264
|
+
const tab = this.config.data[index]
|
|
265
|
+
const isFormTableType = tab?.slotType === 'x-form-table' ||
|
|
266
|
+
tab?.slotType === 'XFormTable' ||
|
|
267
|
+
tab?.slotType?.toLowerCase() === 'xformtable'
|
|
268
|
+
if (isFormTableType && component.realQueryConfig === undefined && !component.loadError) {
|
|
269
|
+
if (attempts < maxAttempts) {
|
|
270
|
+
setTimeout(checkReady, checkInterval)
|
|
271
|
+
return
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 4. 检查关键方法是否存在(如 setForm、setFormWithKey)
|
|
276
|
+
const hasSetForm = typeof component.setForm === 'function'
|
|
277
|
+
const hasSetFormWithKey = typeof component.setFormWithKey === 'function'
|
|
278
|
+
const hasSetFormWithNoKey = typeof component.setFormWithNoKey === 'function'
|
|
279
|
+
// 5. 如果组件有这些方法,确保表单对象存在
|
|
280
|
+
if (hasSetForm || hasSetFormWithKey || hasSetFormWithNoKey) {
|
|
281
|
+
// 检查组件是否有 form 对象
|
|
282
|
+
if (component.form && Object.keys(component.form).length > 0) {
|
|
283
|
+
// 表单已初始化,等待 DOM 渲染完成
|
|
284
|
+
this.$nextTick(() => {
|
|
285
|
+
// 额外等待一个 tick,确保所有子组件也渲染完成
|
|
286
|
+
this.$nextTick(() => {
|
|
287
|
+
resolve()
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
return
|
|
291
|
+
} else if (component.loaded !== false) {
|
|
292
|
+
// 如果没有 form 对象但 loaded 不为 false,可能还在初始化
|
|
293
|
+
if (attempts < maxAttempts) {
|
|
294
|
+
setTimeout(checkReady, checkInterval)
|
|
295
|
+
return
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// 6. 如果以上都通过,或者超时,等待 DOM 渲染完成
|
|
301
|
+
if (attempts >= 3 || attempts >= maxAttempts) {
|
|
302
|
+
// 至少等待几次检查,确保有时间初始化
|
|
303
|
+
this.$nextTick(() => {
|
|
304
|
+
this.$nextTick(() => {
|
|
305
|
+
resolve()
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// 继续等待
|
|
312
|
+
setTimeout(checkReady, checkInterval)
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// 首次检查前等待一个 tick
|
|
316
|
+
this.$nextTick(() => {
|
|
317
|
+
checkReady()
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
},
|
|
321
|
+
initConfig () {
|
|
322
|
+
if (this.configName) {
|
|
323
|
+
this.getConfig()
|
|
324
|
+
} else if (this.localConfig) {
|
|
325
|
+
this.config = this.localConfig
|
|
326
|
+
// 设置是否显示页签
|
|
327
|
+
this.showTabBar = this.localConfig.showTabBar !== false
|
|
328
|
+
}
|
|
329
|
+
// 重置已加载页签集合,确保配置变更后重新加载
|
|
330
|
+
this.loadedTabs = []
|
|
331
|
+
// 标记默认激活的页签为已加载
|
|
332
|
+
if (this.config && this.config.data) {
|
|
333
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
getConfig () {
|
|
337
|
+
getConfigByName(this.configName, this.serverName, res => {
|
|
338
|
+
this.config = res
|
|
339
|
+
// 设置是否显示页签
|
|
340
|
+
this.showTabBar = res.showTabBar !== false
|
|
341
|
+
// 标记默认激活的页签为已加载
|
|
342
|
+
if (this.config && this.config.data) {
|
|
343
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
344
|
+
}
|
|
345
|
+
}, this.env === 'dev')
|
|
346
|
+
},
|
|
347
|
+
getEventHandlers (tab, index) {
|
|
348
|
+
const handlers = {}
|
|
349
|
+
if (!tab?.events || tab?.events?.length === 0) {
|
|
350
|
+
return handlers
|
|
351
|
+
}
|
|
352
|
+
tab.events.forEach(event => {
|
|
353
|
+
handlers[event.type] = (...args) => {
|
|
354
|
+
executeStrFunctionByContext(this.$refs[`tab_com_${tab.slotType}_${index}`][0], event.customFunction, args)
|
|
355
|
+
}
|
|
356
|
+
})
|
|
357
|
+
return handlers
|
|
358
|
+
},
|
|
359
|
+
onComponentMounted (h, tab, index) {
|
|
360
|
+
if (tab.slotType === 'x-add-native-form') {
|
|
361
|
+
// 建议表单需要主动调用初始化方法
|
|
362
|
+
getConfigByName(tab.slotConfig, tab.serviceName, async (res) => {
|
|
363
|
+
// 如果配置了 表单初始化logic
|
|
364
|
+
// 调用 logic 获取参数
|
|
365
|
+
let param = {}
|
|
366
|
+
let selectedId
|
|
367
|
+
if (res.paramLogicName) {
|
|
368
|
+
if (!!this.getSelectedId) {
|
|
369
|
+
selectedId = this.getSelectedId()
|
|
370
|
+
if (typeof selectedId !== 'object') {
|
|
371
|
+
selectedId = { selectedId: selectedId }
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, tab.serviceName))
|
|
375
|
+
}
|
|
376
|
+
this.$refs[`tab_com_${tab.slotType}_${index}`][0].init({
|
|
377
|
+
formItems: res.formJson,
|
|
378
|
+
showSubmitBtn: !this.isInAModal,
|
|
379
|
+
businessType: '新增',
|
|
380
|
+
layout: res.xAddFormLayout,
|
|
381
|
+
...res,
|
|
382
|
+
fixedAddForm: param,
|
|
383
|
+
modifyModelData: {
|
|
384
|
+
files: param.files,
|
|
385
|
+
images: param.images
|
|
386
|
+
}
|
|
387
|
+
})
|
|
388
|
+
}, this.env === 'dev')
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
// 判断页签是否已加载
|
|
392
|
+
isTabLoaded (index) {
|
|
393
|
+
const numIndex = Number(index)
|
|
394
|
+
return this.loadedTabs.includes(numIndex) || Number(this.activeKey) === numIndex
|
|
395
|
+
},
|
|
396
|
+
// 标记页签为已加载
|
|
397
|
+
markTabAsLoaded (index) {
|
|
398
|
+
const numIndex = Number(index)
|
|
399
|
+
// 确保是有效的数字索引,且未添加过
|
|
400
|
+
if (!isNaN(numIndex) && numIndex >= 0 && !this.loadedTabs.includes(numIndex)) {
|
|
401
|
+
this.loadedTabs.push(numIndex)
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
// 确保页签已加载,如果未加载则先加载,返回 Promise 等待组件渲染完成
|
|
405
|
+
ensureTabLoaded (index, options = {}) {
|
|
406
|
+
return new Promise((resolve, reject) => {
|
|
407
|
+
const numIndex = Number(index)
|
|
408
|
+
const innerRefs = Array.isArray(options.innerRefs) ? options.innerRefs : []
|
|
409
|
+
const allowSwitch = options.allowSwitch !== false
|
|
410
|
+
// 验证索引有效性
|
|
411
|
+
if (isNaN(numIndex) || numIndex < 0) {
|
|
412
|
+
reject(new Error(`无效的页签索引: ${index}`))
|
|
413
|
+
return
|
|
414
|
+
}
|
|
415
|
+
if (!this.config || !this.config.data || !this.config.data[numIndex]) {
|
|
416
|
+
reject(new Error(`页签索引 ${index} 不存在`))
|
|
417
|
+
return
|
|
418
|
+
}
|
|
419
|
+
// 如果已经加载,直接返回组件实例
|
|
420
|
+
if (this.isTabLoaded(numIndex)) {
|
|
421
|
+
const component = this.getTabComponent(numIndex)
|
|
422
|
+
if (component) {
|
|
423
|
+
if (innerRefs.length === 0) {
|
|
424
|
+
resolve(component)
|
|
425
|
+
} else {
|
|
426
|
+
this.waitForInnerRefs(component, innerRefs, resolve, reject)
|
|
427
|
+
}
|
|
428
|
+
} else {
|
|
429
|
+
// 已标记但组件可能还在渲染中,等待一下
|
|
430
|
+
this.$nextTick(() => {
|
|
431
|
+
const comp = this.getTabComponent(numIndex)
|
|
432
|
+
if (comp) {
|
|
433
|
+
if (innerRefs.length === 0) {
|
|
434
|
+
resolve(comp)
|
|
435
|
+
} else {
|
|
436
|
+
this.waitForInnerRefs(comp, innerRefs, resolve, reject)
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
// 等待组件mounted
|
|
440
|
+
this.waitForComponent(numIndex, (c) => {
|
|
441
|
+
if (innerRefs.length === 0) {
|
|
442
|
+
resolve(c)
|
|
443
|
+
} else {
|
|
444
|
+
this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
445
|
+
}
|
|
446
|
+
}, reject)
|
|
447
|
+
}
|
|
448
|
+
})
|
|
449
|
+
}
|
|
450
|
+
return
|
|
451
|
+
}
|
|
452
|
+
// 标记为已加载,触发渲染
|
|
453
|
+
this.markTabAsLoaded(numIndex)
|
|
454
|
+
// 优先尝试在不切换页签的情况下获取组件
|
|
455
|
+
this.$nextTick(() => {
|
|
456
|
+
const comp = this.getTabComponent(numIndex)
|
|
457
|
+
if (comp) {
|
|
458
|
+
if (innerRefs.length === 0) resolve(comp)
|
|
459
|
+
else this.waitForInnerRefs(comp, innerRefs, resolve, reject)
|
|
460
|
+
return
|
|
461
|
+
}
|
|
462
|
+
// 若仍未渲染,且允许临时切换,则进行一次激活-恢复回退
|
|
463
|
+
if (!allowSwitch) {
|
|
464
|
+
// 不允许切换则进入常规等待(可能更慢)
|
|
465
|
+
this.waitForComponent(numIndex, (c) => {
|
|
466
|
+
if (innerRefs.length === 0) resolve(c)
|
|
467
|
+
else this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
468
|
+
}, reject)
|
|
469
|
+
return
|
|
470
|
+
}
|
|
471
|
+
const prevActive = this.activeKey
|
|
472
|
+
this.activeKey = numIndex
|
|
473
|
+
this.$nextTick(() => {
|
|
474
|
+
this.waitForComponent(numIndex, (c) => {
|
|
475
|
+
// 组件到位后再恢复原激活页签
|
|
476
|
+
if (prevActive !== numIndex) {
|
|
477
|
+
this.$nextTick(() => { this.activeKey = prevActive })
|
|
478
|
+
}
|
|
479
|
+
if (innerRefs.length === 0) resolve(c)
|
|
480
|
+
else this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
481
|
+
}, reject)
|
|
482
|
+
})
|
|
483
|
+
})
|
|
484
|
+
})
|
|
485
|
+
},
|
|
486
|
+
// 等待组件渲染完成
|
|
487
|
+
waitForComponent (index, resolve, reject) {
|
|
488
|
+
const maxAttempts = 50 // 最多尝试50次
|
|
489
|
+
let attempts = 0
|
|
490
|
+
const checkInterval = 50 // 每50ms检查一次
|
|
491
|
+
const tab = this.config.data[index]
|
|
492
|
+
const refName = `tab_com_${tab.slotType}_${index}`
|
|
493
|
+
const checkComponent = () => {
|
|
494
|
+
attempts++
|
|
495
|
+
const component = this.$refs[refName]
|
|
496
|
+
if (component && component[0]) {
|
|
497
|
+
resolve(component[0])
|
|
498
|
+
return
|
|
499
|
+
}
|
|
500
|
+
if (attempts >= maxAttempts) {
|
|
501
|
+
reject(new Error(`等待页签 ${index} 组件加载超时`))
|
|
502
|
+
return
|
|
503
|
+
}
|
|
504
|
+
setTimeout(checkComponent, checkInterval)
|
|
505
|
+
}
|
|
506
|
+
// 首次检查
|
|
507
|
+
this.$nextTick(() => {
|
|
508
|
+
checkComponent()
|
|
509
|
+
})
|
|
510
|
+
},
|
|
511
|
+
// 等待内部 $refs 就绪
|
|
512
|
+
waitForInnerRefs (component, innerRefs, resolve, reject) {
|
|
513
|
+
const maxAttempts = 50
|
|
514
|
+
let attempts = 0
|
|
515
|
+
const checkInterval = 50
|
|
516
|
+
const allReady = () => innerRefs.every(name => component.$refs && component.$refs[name])
|
|
517
|
+
const check = () => {
|
|
518
|
+
attempts++
|
|
519
|
+
if (allReady()) {
|
|
520
|
+
resolve(component)
|
|
521
|
+
return
|
|
522
|
+
}
|
|
523
|
+
if (attempts >= maxAttempts) {
|
|
524
|
+
reject(new Error(`等待内部 refs [${innerRefs.join(', ')}] 就绪超时`))
|
|
525
|
+
return
|
|
526
|
+
}
|
|
527
|
+
setTimeout(check, checkInterval)
|
|
528
|
+
}
|
|
529
|
+
this.$nextTick(() => check())
|
|
530
|
+
},
|
|
531
|
+
// 获取页签的组件实例
|
|
532
|
+
getTabComponent (index) {
|
|
533
|
+
const numIndex = Number(index)
|
|
534
|
+
if (isNaN(numIndex) || numIndex < 0 || !this.config || !this.config.data || !this.config.data[numIndex]) {
|
|
535
|
+
return null
|
|
536
|
+
}
|
|
537
|
+
const tab = this.config.data[numIndex]
|
|
538
|
+
const refName = `tab_com_${tab.slotType}_${numIndex}`
|
|
539
|
+
const ref = this.$refs[refName]
|
|
540
|
+
return ref && ref[0] ? ref[0] : null
|
|
541
|
+
},
|
|
542
|
+
|
|
543
|
+
},
|
|
544
|
+
props: {
|
|
545
|
+
// 配置名
|
|
546
|
+
configName: {
|
|
547
|
+
type: String,
|
|
548
|
+
default: undefined
|
|
549
|
+
},
|
|
550
|
+
serverName: {
|
|
551
|
+
type: String,
|
|
552
|
+
default: undefined
|
|
553
|
+
},
|
|
554
|
+
env: {
|
|
555
|
+
type: String,
|
|
556
|
+
default: 'prod'
|
|
557
|
+
},
|
|
558
|
+
// 本地配置,调试用
|
|
559
|
+
localConfig: {
|
|
560
|
+
type: Object,
|
|
561
|
+
default: undefined
|
|
562
|
+
},
|
|
563
|
+
tabBarGutter: {
|
|
564
|
+
type: Number,
|
|
565
|
+
default: 10
|
|
566
|
+
},
|
|
567
|
+
bodyStyle: {
|
|
568
|
+
type: Object,
|
|
569
|
+
default: () => {
|
|
570
|
+
return {}
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
defaultActiveKey: {
|
|
574
|
+
type: [String, Number],
|
|
575
|
+
default: 0
|
|
576
|
+
},
|
|
577
|
+
// 新增compProp参数,用于穿透到动态组件
|
|
578
|
+
compProp: {
|
|
579
|
+
type: Object,
|
|
580
|
+
default: () => {
|
|
581
|
+
return {}
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
// 额外数据
|
|
585
|
+
extraData: {
|
|
586
|
+
type: Object,
|
|
587
|
+
default: () => {
|
|
588
|
+
return {}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
watch: {
|
|
593
|
+
configName: {
|
|
594
|
+
deep: true,
|
|
595
|
+
immediate: true,
|
|
596
|
+
handler (val) {
|
|
597
|
+
this.initConfig()
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
// 如果本地配置更改了,重新初始化
|
|
601
|
+
localConfig: {
|
|
602
|
+
deep: true,
|
|
603
|
+
immediate: true,
|
|
604
|
+
handler (val) {
|
|
605
|
+
this.initConfig()
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
}
|
|
610
|
+
</script>
|
|
611
|
+
<style scoped>
|
|
612
|
+
</style>
|