hs-admin-ui 1.0.0
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 +11 -0
- package/.env.development +5 -0
- package/.env.production +5 -0
- package/.eslintignore +18 -0
- package/.eslintrc.js +104 -0
- package/.prettierrc.js +39 -0
- package/.vite/deps_temp_3669a513/chunk-FVXAE7ZR.js +11400 -0
- package/.vite/deps_temp_3669a513/chunk-ZS7NZCD4.js +36 -0
- package/.vite/deps_temp_3669a513/default-passive-events.js +25 -0
- package/.vite/deps_temp_3669a513/element-plus.js +65013 -0
- package/.vite/deps_temp_3669a513/lodash.js +5497 -0
- package/.vite/deps_temp_3669a513/package.json +3 -0
- package/.vite/deps_temp_3669a513/vue.js +324 -0
- package/.vite/deps_temp_3669a513/vxe-table.js +32336 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/directoryList.md +180 -0
- package/package.json +78 -0
- package/postcss.config.js +7 -0
- package/src/App.vue +88 -0
- package/src/api/fieldConfigController/index.ts +76 -0
- package/src/api/fieldConfigController/type.ts +44 -0
- package/src/api/login/index.ts +78 -0
- package/src/api/loginController/index.ts +74 -0
- package/src/api/menu/index.ts +34 -0
- package/src/api/menu/index2.ts +291 -0
- package/src/api/menuController/index.ts +189 -0
- package/src/api/systemController/index.ts +26 -0
- package/src/api/systemController/type.ts +16 -0
- package/src/api/test/index.ts +22 -0
- package/src/api/user/index.ts +30 -0
- package/src/assets/404.png +0 -0
- package/src/assets/logo-main.svg +12 -0
- package/src/assets/logo-mini.svg +12 -0
- package/src/components/base/hsAffix/src/hsAffix.vue +22 -0
- package/src/components/base/hsAlert/src/hsAlert.vue +15 -0
- package/src/components/base/hsAutocomplete/src/hsAutocomplete.vue +36 -0
- package/src/components/base/hsButton/src/hsButton.vue +26 -0
- package/src/components/base/hsButton/src/hsButtonGroup.vue +8 -0
- package/src/components/base/hsButton/useButtonEvents.ts +19 -0
- package/src/components/base/hsCalendar/src/hsCalendar.vue +36 -0
- package/src/components/base/hsCarousel/src/hsCarousel.vue +15 -0
- package/src/components/base/hsCarousel/src/hsCarouselItem.vue +15 -0
- package/src/components/base/hsCascader/src/hsCascader.vue +36 -0
- package/src/components/base/hsCascader/src/hsCascaderPanel.vue +29 -0
- package/src/components/base/hsCheckbox/src/hsCheckbox.vue +32 -0
- package/src/components/base/hsCheckbox/src/hsCheckboxButton.vue +18 -0
- package/src/components/base/hsCheckbox/src/hsCheckboxGroup.vue +32 -0
- package/src/components/base/hsCol/src/hsCol.vue +20 -0
- package/src/components/base/hsCollapse/src/hsCollapse.vue +36 -0
- package/src/components/base/hsCollapse/src/hsCollapseItem.vue +22 -0
- package/src/components/base/hsColorPicker/src/hsColorPicker.vue +32 -0
- package/src/components/base/hsDatePicker/src/hsDatePicker.vue +40 -0
- package/src/components/base/hsDialog/src/hsDialog.vue +36 -0
- package/src/components/base/hsDrawer/src/hsDrawer.vue +29 -0
- package/src/components/base/hsDropdown/src/hsDropdown.vue +15 -0
- package/src/components/base/hsDropdown/src/hsDropdownItem.vue +15 -0
- package/src/components/base/hsDropdown/src/hsDropdownMenu.vue +15 -0
- package/src/components/base/hsForm/src/hsForm.vue +23 -0
- package/src/components/base/hsForm/src/hsFormItem.vue +22 -0
- package/src/components/base/hsGetApi/src/hsGetApis.vue +231 -0
- package/src/components/base/hsGetApi/useGetApis.ts +158 -0
- package/src/components/base/hsInput/src/hsInput.vue +40 -0
- package/src/components/base/hsInput/useInputEvents.ts +52 -0
- package/src/components/base/hsInputNumber/src/hsInputNumber.vue +31 -0
- package/src/components/base/hsPopconfirm/src/hsPopconfirm.vue +15 -0
- package/src/components/base/hsPopover/src/hsPopover.vue +22 -0
- package/src/components/base/hsProgress/src/hsProgress.vue +15 -0
- package/src/components/base/hsRadio/src/hsRadio.vue +32 -0
- package/src/components/base/hsRadio/src/hsRadioButton.vue +18 -0
- package/src/components/base/hsRadio/src/hsRadioGroup.vue +32 -0
- package/src/components/base/hsRate/src/hsRate.vue +33 -0
- package/src/components/base/hsResult/src/hsResult.vue +15 -0
- package/src/components/base/hsRow/src/hsRow.vue +20 -0
- package/src/components/base/hsScrollbar/src/hsScrollbar.vue +22 -0
- package/src/components/base/hsSelect/src/hsOption.vue +8 -0
- package/src/components/base/hsSelect/src/hsOptionGroup.vue +8 -0
- package/src/components/base/hsSelect/src/hsSelect.vue +42 -0
- package/src/components/base/hsSelect/useSelectEvents.ts +60 -0
- package/src/components/base/hsSlider/src/hsSlider.vue +25 -0
- package/src/components/base/hsSteps/src/hsStep.vue +15 -0
- package/src/components/base/hsSteps/src/hsSteps.vue +15 -0
- package/src/components/base/hsSwitch/src/hsSwitch.vue +35 -0
- package/src/components/base/hsTable/hsBCTable.vue +116 -0
- package/src/components/base/hsTable/hsTable copy.vue +226 -0
- package/src/components/base/hsTable/hsTable.vue +213 -0
- package/src/components/base/hsTable/useHsTableConfig.ts +95 -0
- package/src/components/base/hsTable/useTableEvents.ts +118 -0
- package/src/components/base/hsTabs/src/hsTabPane.vue +15 -0
- package/src/components/base/hsTabs/src/hsTabs.vue +29 -0
- package/src/components/base/hsTag/src/hsCheckTag.vue +16 -0
- package/src/components/base/hsTag/src/hsTag.vue +15 -0
- package/src/components/base/hsTest/HsTest.vue +320 -0
- package/src/components/base/hsTooltip/src/hsTooltip.vue +22 -0
- package/src/components/base/hsTour/src/hsTour.vue +31 -0
- package/src/components/base/hsTour/src/hsTourStep.vue +15 -0
- package/src/components/base/hsTransfer/src/hsTransfer.vue +36 -0
- package/src/components/base/hsTree/src/hsTree.vue +24 -0
- package/src/components/base/hsTreeSelect/src/hsTreeSelect.vue +39 -0
- package/src/components/base/hsUpload/src/hsUpload.vue +32 -0
- package/src/components/base/hsWatermark/src/hsWatermark.vue +15 -0
- package/src/components/business/bcAutoComplete/bcAutoComplete.vue +38 -0
- package/src/components/business/bcAutoComplete/defaultData.ts +25 -0
- package/src/components/business/bcAutoComplete/useAutoComplete.ts +65 -0
- package/src/components/business/bcBtn/bcBtn.vue +40 -0
- package/src/components/business/bcForm/bcForm.vue +113 -0
- package/src/components/business/bcForm/bcFormDrag.vue +104 -0
- package/src/components/business/bcForm/bcFormSearch.vue +154 -0
- package/src/components/business/bcForm/components/sortForm/index.ts +18 -0
- package/src/components/business/bcForm/components/sortForm/sortForm.vue +92 -0
- package/src/components/business/bcFormConfig/bcFormConfig.vue +196 -0
- package/src/components/business/bcFormTable/bcFormTable.vue +91 -0
- package/src/components/business/bcFormTable/components/bcTabs/bcTabs.vue +53 -0
- package/src/components/business/bcFormTable/components/contextBody/contextBody.vue +67 -0
- package/src/components/business/bcFormTable/components/contextBody/useContextMenu.ts +53 -0
- package/src/components/business/bcFormTable/components/formSearchBtn/formSearchBtn.vue +21 -0
- package/src/components/business/bcFormTable/methods/cellDetailMethod.ts +5 -0
- package/src/components/business/bcFormTable/methods/filterAgeMethod.ts +5 -0
- package/src/components/business/bcFormTable/methods/footerMethod.ts +25 -0
- package/src/components/business/bcFormTable/methods/index.ts +10 -0
- package/src/components/business/bcFormTable/utils/onFormKey.ts +121 -0
- package/src/components/business/bcFormTable/utils/onTableKey.ts +119 -0
- package/src/components/business/bcFormTable/utils/parseTable.ts +201 -0
- package/src/components/business/bcFormTable/utils/useButon.ts +20 -0
- package/src/components/business/bcFormTable/utils/useTableHeight.ts +44 -0
- package/src/components/business/bcPageConfig/bcPageConfig.vue +79 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsAttrBtn.vue +39 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnItemConfig.vue +32 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnPanel.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useAttrBtn.ts +58 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnConfigList.ts +71 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnItemConfig.ts +35 -0
- package/src/components/business/bcPageConfig/components/hsExpand/src/hsExpand.vue +33 -0
- package/src/components/business/bcPageConfig/components/hsExpand/useExpand.ts +9 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsAttrForm.vue +54 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormPanel.vue +64 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormParse.vue +24 -0
- package/src/components/business/bcPageConfig/components/hsForm/useAttrForm.ts +108 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormListConfig.ts +69 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormParse.ts +120 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/src/saveForm.vue +48 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/useSaveForm.ts +148 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsAttrTable.vue +122 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableConfig.vue +51 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableConfigList.vue +46 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTablePanel.vue +68 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableParse.vue +24 -0
- package/src/components/business/bcPageConfig/components/hsTables/useAttrTable.ts +218 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableConfigList.ts +77 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableParse.ts +78 -0
- package/src/components/business/bcPageConfig/default/apis.json +24712 -0
- package/src/components/business/bcPageConfig/default/baseBtnConfig.ts +256 -0
- package/src/components/business/bcPageConfig/default/baseFormConfig.ts +380 -0
- package/src/components/business/bcPageConfig/default/baseTableConfig.ts +2399 -0
- package/src/components/business/bcPageConfig/usePageConfig.ts +469 -0
- package/src/components/business/bcSelect/bcSelect.vue +50 -0
- package/src/components/business/bcSwitchSystems/bcSwitchSystems.vue +36 -0
- package/src/components/business/bcSwitchSystems/useSwitchSystems.ts +74 -0
- package/src/components/business/bcTable/bcTable.vue +63 -0
- package/src/components/business/bcTable/components/sortColumn/index.ts +19 -0
- package/src/components/business/bcTable/components/sortColumn/sortColumn.vue +107 -0
- package/src/components/business/bcTable/useTable.ts +51 -0
- package/src/components/business/bcTable/useTableHeight.ts +24 -0
- package/src/components/business/bcTreeSelect/bcTreeSelect.vue +12 -0
- package/src/components/business/cardID/cardID.vue +24 -0
- package/src/components/business/cardID/type.ts +0 -0
- package/src/components/business/cardID/useCardID.ts +0 -0
- package/src/components/component.ts +188 -0
- package/src/components/config/autocompleteAttrConfig/autocompleteAttrConfig.vue +26 -0
- package/src/components/config/autocompleteAttrConfig/config.ts +170 -0
- package/src/components/config/baseForm.vue +175 -0
- package/src/components/config/buttonAttrConfig/buttonAttrConfig.vue +26 -0
- package/src/components/config/buttonAttrConfig/config.ts +261 -0
- package/src/components/config/cascaderAttrConfig/cascaderAttrConfig.vue +26 -0
- package/src/components/config/cascaderAttrConfig/config.ts +287 -0
- package/src/components/config/cascaderPanelAttrConfig/cascaderPanelAttrConfig.vue +26 -0
- package/src/components/config/cascaderPanelAttrConfig/config.ts +278 -0
- package/src/components/config/checkboxAttrConfig/checkboxAttrConfig.vue +26 -0
- package/src/components/config/checkboxAttrConfig/config.ts +301 -0
- package/src/components/config/datePickerAttrConfig/config.ts +256 -0
- package/src/components/config/datePickerAttrConfig/datePickerAttrConfig.vue +26 -0
- package/src/components/config/inputAttrConfig/config.ts +322 -0
- package/src/components/config/inputAttrConfig/inputAttrConfig.vue +33 -0
- package/src/components/config/inputAttrConfig/inputEventConfig.vue +35 -0
- package/src/components/config/inputNumberAttrConfig/config.ts +177 -0
- package/src/components/config/inputNumberAttrConfig/inputNumberAttrConfig.vue +26 -0
- package/src/components/config/radioAttrConfig/config.ts +212 -0
- package/src/components/config/radioAttrConfig/radioAttrConfig.vue +26 -0
- package/src/components/config/selectAttrConfig/config.ts +478 -0
- package/src/components/config/selectAttrConfig/selectAttrConfig.vue +26 -0
- package/src/components/config/switchAttrConfig/config.ts +195 -0
- package/src/components/config/switchAttrConfig/switchAttrConfig.vue +26 -0
- package/src/components/config/treeSelectAttrConfig/config.ts +625 -0
- package/src/components/config/treeSelectAttrConfig/treeSelectAttrConfig.vue +26 -0
- package/src/components/config/type/formType.ts +25 -0
- package/src/components/config/uploadAttrConfig/config.ts +250 -0
- package/src/components/config/uploadAttrConfig/uploadAttrConfig.vue +26 -0
- package/src/components/iconSelector/index.vue +247 -0
- package/src/components/iconSelector/list.vue +84 -0
- package/src/components/svgIcon/index.vue +61 -0
- package/src/directive/authDirective.ts +40 -0
- package/src/directive/customDirective.ts +178 -0
- package/src/directive/index.ts +18 -0
- package/src/hooks/useCrypto.ts +36 -0
- package/src/hooks/useExpose.ts +60 -0
- package/src/layout/component/aside.vue +160 -0
- package/src/layout/component/columnsAside.vue +299 -0
- package/src/layout/component/header.vue +18 -0
- package/src/layout/component/main.vue +65 -0
- package/src/layout/footer/index.vue +25 -0
- package/src/layout/index.vue +53 -0
- package/src/layout/lockScreen/index.vue +352 -0
- package/src/layout/logo/index.vue +75 -0
- package/src/layout/main/classic.vue +73 -0
- package/src/layout/main/columns.vue +73 -0
- package/src/layout/main/defaults.vue +73 -0
- package/src/layout/main/transverse.vue +60 -0
- package/src/layout/navBars/index.vue +35 -0
- package/src/layout/navBars/tagsView/contextmenu.vue +133 -0
- package/src/layout/navBars/tagsView/tagsView.vue +737 -0
- package/src/layout/navBars/topBar/breadcrumb.vue +146 -0
- package/src/layout/navBars/topBar/closeFull.vue +53 -0
- package/src/layout/navBars/topBar/index.vue +107 -0
- package/src/layout/navBars/topBar/search.vue +123 -0
- package/src/layout/navBars/topBar/setings.vue +789 -0
- package/src/layout/navBars/topBar/user.vue +222 -0
- package/src/layout/navBars/topBar/userNews.vue +107 -0
- package/src/layout/navMenu/horizontal.vue +138 -0
- package/src/layout/navMenu/subItem.vue +49 -0
- package/src/layout/navMenu/vertical.vue +100 -0
- package/src/layout/routerView/iframes.vue +101 -0
- package/src/layout/routerView/link.vue +93 -0
- package/src/layout/routerView/parent.vue +104 -0
- package/src/layout/upgrade/index.vue +147 -0
- package/src/main.ts +70 -0
- package/src/router/backEnd.ts +173 -0
- package/src/router/frontEnd.ts +155 -0
- package/src/router/index.ts +138 -0
- package/src/router/route.ts +94 -0
- package/src/stores/index.ts +8 -0
- package/src/stores/keepAliveNames.ts +38 -0
- package/src/stores/requestOldRoutes.ts +16 -0
- package/src/stores/routesList.ts +26 -0
- package/src/stores/tagsViewRoutes.ts +23 -0
- package/src/stores/themeConfig.ts +142 -0
- package/src/stores/userInfo.ts +65 -0
- package/src/style/index.scss +0 -0
- package/src/style/tailwind.css +29 -0
- package/src/theme/app.scss +333 -0
- package/src/theme/common/transition.scss +147 -0
- package/src/theme/dark.scss +255 -0
- package/src/theme/element.scss +321 -0
- package/src/theme/iconSelector.scss +31 -0
- package/src/theme/index.scss +8 -0
- package/src/theme/loading.scss +51 -0
- package/src/theme/media/chart.scss +94 -0
- package/src/theme/media/cityLinkage.scss +10 -0
- package/src/theme/media/date.scss +25 -0
- package/src/theme/media/dialog.scss +12 -0
- package/src/theme/media/error.scss +45 -0
- package/src/theme/media/form.scss +31 -0
- package/src/theme/media/home.scss +23 -0
- package/src/theme/media/index.scss +15 -0
- package/src/theme/media/layout.scss +63 -0
- package/src/theme/media/login.scss +74 -0
- package/src/theme/media/media.scss +13 -0
- package/src/theme/media/pagination.scss +15 -0
- package/src/theme/media/personal.scss +16 -0
- package/src/theme/media/scrollbar.scss +56 -0
- package/src/theme/media/tagsView.scss +11 -0
- package/src/theme/mixins/index.scss +56 -0
- package/src/theme/other.scss +36 -0
- package/src/theme/tableTool.scss +27 -0
- package/src/theme/waves.scss +101 -0
- package/src/types/auth.d.ts +44 -0
- package/src/types/axios.d.ts +13 -0
- package/src/types/components.d.ts +30 -0
- package/src/types/customData.d.ts +163 -0
- package/src/types/form.ts +68 -0
- package/src/types/formItem/autocomplete.ts +43 -0
- package/src/types/formItem/button.ts +39 -0
- package/src/types/formItem/input.ts +66 -0
- package/src/types/formItem/inputNumber.ts +42 -0
- package/src/types/formItem/selelct.ts +54 -0
- package/src/types/formItem/treeSelect.ts +37 -0
- package/src/types/formTable.d.ts +210 -0
- package/src/types/global.d.ts +118 -0
- package/src/types/layout.d.ts +59 -0
- package/src/types/mitt.d.ts +38 -0
- package/src/types/pinia.d.ts +92 -0
- package/src/types/views.d.ts +331 -0
- package/src/utils/arrayOperation.ts +65 -0
- package/src/utils/authFunction.ts +38 -0
- package/src/utils/build.ts +124 -0
- package/src/utils/commonFunction.ts +64 -0
- package/src/utils/formatTime.ts +137 -0
- package/src/utils/getDataType.ts +136 -0
- package/src/utils/getStyleSheets.ts +101 -0
- package/src/utils/loading.ts +44 -0
- package/src/utils/mitt.ts +8 -0
- package/src/utils/other.ts +214 -0
- package/src/utils/request.ts +82 -0
- package/src/utils/setIconfont.ts +48 -0
- package/src/utils/showMessage.ts +57 -0
- package/src/utils/showMessageBox.ts +39 -0
- package/src/utils/showNotification.ts +50 -0
- package/src/utils/showPopup.ts +81 -0
- package/src/utils/storage.ts +137 -0
- package/src/utils/theme.ts +65 -0
- package/src/utils/toolsValidate.ts +370 -0
- package/src/utils/watermark.ts +47 -0
- package/src/views/error/401.vue +88 -0
- package/src/views/error/404.vue +89 -0
- package/src/views/home/index.vue +62 -0
- package/src/views/login/component/account.vue +172 -0
- package/src/views/login/component/mobile.vue +72 -0
- package/src/views/login/component/scan.vue +63 -0
- package/src/views/login/index.vue +254 -0
- package/src/views/system/auth/index.vue +48 -0
- package/src/views/system/auth/list.ts +50 -0
- package/src/views/system/auth/useAuth.ts +34 -0
- package/src/views/system/dept/dialog.vue +167 -0
- package/src/views/system/dept/index.vue +135 -0
- package/src/views/system/dic/dialog.vue +150 -0
- package/src/views/system/dic/index.vue +132 -0
- package/src/views/system/form/data.json +360 -0
- package/src/views/system/form/index.vue +24 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsAttrBtn.vue +58 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnPanel.vue +51 -0
- package/src/views/system/formSetting/components/hsBtn/useAttrBtn.ts +129 -0
- package/src/views/system/formSetting/components/hsBtn/useBtnConfigList.ts +73 -0
- package/src/views/system/formSetting/components/hsExpand/src/hsExpand.vue +27 -0
- package/src/views/system/formSetting/components/hsExpand/useExpand.ts +9 -0
- package/src/views/system/formSetting/components/hsForm/src/hsAttrForm.vue +124 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormPanel.vue +152 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormParse.vue +33 -0
- package/src/views/system/formSetting/components/hsForm/useAttrForm.ts +109 -0
- package/src/views/system/formSetting/components/hsForm/useFormListConfig.ts +70 -0
- package/src/views/system/formSetting/components/hsPageTree/configData.ts +3700 -0
- package/src/views/system/formSetting/components/hsPageTree/src/hsPageTree.vue +30 -0
- package/src/views/system/formSetting/components/hsPageTree/usePageTree.ts +50 -0
- package/src/views/system/formSetting/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/views/system/formSetting/components/hsSaveForm/src/saveForm.vue +47 -0
- package/src/views/system/formSetting/components/hsSaveForm/useSaveForm.ts +122 -0
- package/src/views/system/formSetting/components/hsTables/src/hsAttrTable.vue +91 -0
- package/src/views/system/formSetting/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableConfig.vue +39 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTablePanel.vue +56 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableParse.vue +29 -0
- package/src/views/system/formSetting/components/hsTables/useAttrTable.ts +125 -0
- package/src/views/system/formSetting/components/hsTables/useTableConfigList.ts +77 -0
- package/src/views/system/formSetting/components/selectConfig/config.ts +476 -0
- package/src/views/system/formSetting/components/selectConfig/selectConfig.vue +30 -0
- package/src/views/system/formSetting/data.json +360 -0
- package/src/views/system/formSetting/default/baseBtnConfig.ts +216 -0
- package/src/views/system/formSetting/default/baseFormConfig.ts +567 -0
- package/src/views/system/formSetting/default/baseTableConfig.ts +2353 -0
- package/src/views/system/formSetting/formConfig.vue +108 -0
- package/src/views/system/formSetting/index.vue +35 -0
- package/src/views/system/formSetting/menuType.d.ts +12 -0
- package/src/views/system/formSetting/panelConfig.json +164 -0
- package/src/views/system/formSetting/useForm.ts +89 -0
- package/src/views/system/formSetting/useFormConfig.ts +192 -0
- package/src/views/system/menu/dialog.vue +285 -0
- package/src/views/system/menu/index.vue +180 -0
- package/src/views/system/page/components/hsPageTree/configData.ts +3700 -0
- package/src/views/system/page/components/hsPageTree/src/hsPageTree.vue +30 -0
- package/src/views/system/page/components/hsPageTree/usePageTree.ts +49 -0
- package/src/views/system/page/index.vue +32 -0
- package/src/views/system/page/menuType.d.ts +12 -0
- package/src/views/system/page/usePage.ts +125 -0
- package/src/views/system/role/dialog.vue +236 -0
- package/src/views/system/role/index.vue +146 -0
- package/src/views/system/table/data.json +747 -0
- package/src/views/system/table/formate.js +49 -0
- package/src/views/system/table/index.vue +53 -0
- package/src/views/system/user/dialog.vue +187 -0
- package/src/views/system/user/index.vue +161 -0
- package/src/views/test/test/components/hsBtn/src/hsAttrBtn.vue +58 -0
- package/src/views/test/test/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/views/test/test/components/hsBtn/src/hsBtnPanel.vue +51 -0
- package/src/views/test/test/components/hsBtn/useAttrBtn.ts +129 -0
- package/src/views/test/test/components/hsBtn/useBtnConfigList.ts +73 -0
- package/src/views/test/test/components/hsExpand/src/hsExpand.vue +27 -0
- package/src/views/test/test/components/hsExpand/useExpand.ts +9 -0
- package/src/views/test/test/components/hsForm/src/hsAttrForm.vue +124 -0
- package/src/views/test/test/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/views/test/test/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/views/test/test/components/hsForm/src/hsFormPanel.vue +152 -0
- package/src/views/test/test/components/hsForm/src/hsFormParse.vue +33 -0
- package/src/views/test/test/components/hsForm/useAttrForm.ts +109 -0
- package/src/views/test/test/components/hsForm/useFormListConfig.ts +70 -0
- package/src/views/test/test/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/views/test/test/components/hsSaveForm/src/saveForm.vue +47 -0
- package/src/views/test/test/components/hsSaveForm/useSaveForm.ts +122 -0
- package/src/views/test/test/components/hsTables/src/hsAttrTable.vue +91 -0
- package/src/views/test/test/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/views/test/test/components/hsTables/src/hsTableConfig.vue +39 -0
- package/src/views/test/test/components/hsTables/src/hsTableConfigList.vue +45 -0
- package/src/views/test/test/components/hsTables/src/hsTablePanel.vue +56 -0
- package/src/views/test/test/components/hsTables/src/hsTableParse.vue +29 -0
- package/src/views/test/test/components/hsTables/useAttrTable.ts +125 -0
- package/src/views/test/test/components/hsTables/useTableConfigList.ts +77 -0
- package/src/views/test/test/components/selectConfig/config.ts +476 -0
- package/src/views/test/test/components/selectConfig/selectConfig.vue +30 -0
- package/src/views/test/test/data.json +360 -0
- package/src/views/test/test/default/baseBtnConfig.ts +216 -0
- package/src/views/test/test/default/baseFormConfig.ts +567 -0
- package/src/views/test/test/default/baseTableConfig.ts +2353 -0
- package/src/views/test/test/formConfig.vue +102 -0
- package/src/views/test/test/test.vue +28 -0
- package/src/views/test/test/test3.vue +24 -0
- package/src/views/test/test/test4.vue +107 -0
- package/src/views/test/test/test/345/211/257/346/234/254.vue +2424 -0
- package/src/views/test/test/useFormConfig.ts +192 -0
- package/src/views/test/test2/test2.vue +17 -0
- package/src/views/test/test3/test.vue +20 -0
- package/tailwind.config.js +12 -0
- package/tsconfig.json +75 -0
- package/vite.config.ts +123 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-padding layout-padding-unset layout-iframe">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="w100" v-for="v in setIframeList" :key="v.path" v-loading="v.meta.loading" element-loading-background="white">
|
|
5
|
+
<transition-group :name="name">
|
|
6
|
+
<iframe
|
|
7
|
+
:src="v.meta.isLink"
|
|
8
|
+
:key="v.path"
|
|
9
|
+
frameborder="0"
|
|
10
|
+
height="100%"
|
|
11
|
+
width="100%"
|
|
12
|
+
style="position: absolute"
|
|
13
|
+
:data-url="v.path"
|
|
14
|
+
v-show="getRoutePath === v.path"
|
|
15
|
+
ref="iframeRef"
|
|
16
|
+
/>
|
|
17
|
+
</transition-group>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts" name="layoutIframeView">
|
|
24
|
+
import { computed, watch, ref, nextTick } from 'vue';
|
|
25
|
+
import { useRoute } from 'vue-router';
|
|
26
|
+
|
|
27
|
+
// 定义父组件传过来的值
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
// 刷新 iframe
|
|
30
|
+
refreshKey: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: () => '',
|
|
33
|
+
},
|
|
34
|
+
// 过渡动画 name
|
|
35
|
+
name: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: () => 'slide-right',
|
|
38
|
+
},
|
|
39
|
+
// iframe 列表
|
|
40
|
+
list: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default: () => [],
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 定义变量内容
|
|
47
|
+
const iframeRef = ref();
|
|
48
|
+
const route = useRoute();
|
|
49
|
+
|
|
50
|
+
// 处理 list 列表,当打开时,才进行加载
|
|
51
|
+
const setIframeList = computed(() => {
|
|
52
|
+
return (<RouteItems>props.list).filter((v: RouteItem) => v.meta?.isIframeOpen);
|
|
53
|
+
});
|
|
54
|
+
// 获取 iframe 当前路由 path
|
|
55
|
+
const getRoutePath = computed(() => {
|
|
56
|
+
return route.path;
|
|
57
|
+
});
|
|
58
|
+
// 关闭 iframe loading
|
|
59
|
+
const closeIframeLoading = (val: string, item: RouteItem) => {
|
|
60
|
+
nextTick(() => {
|
|
61
|
+
if (!iframeRef.value) return false;
|
|
62
|
+
iframeRef.value.forEach((v: HTMLElement) => {
|
|
63
|
+
if (v.dataset.url === val) {
|
|
64
|
+
v.onload = () => {
|
|
65
|
+
if (item.meta?.isIframeOpen && item.meta.loading) item.meta.loading = false;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
// 监听路由变化,初始化 iframe 数据,防止多个 iframe 时,切换不生效
|
|
72
|
+
watch(
|
|
73
|
+
() => route.fullPath,
|
|
74
|
+
(val) => {
|
|
75
|
+
const item: any = props.list.find((v: any) => v.path === val);
|
|
76
|
+
if (!item) return false;
|
|
77
|
+
if (!item.meta.isIframeOpen) item.meta.isIframeOpen = true;
|
|
78
|
+
closeIframeLoading(val, item);
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
immediate: true,
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
// 监听 iframe refreshKey 变化,用于 tagsview 右键菜单刷新
|
|
85
|
+
watch(
|
|
86
|
+
() => props.refreshKey,
|
|
87
|
+
() => {
|
|
88
|
+
const item: any = props.list.find((v: any) => v.path === route.path);
|
|
89
|
+
if (!item) return false;
|
|
90
|
+
if (item.meta.isIframeOpen) item.meta.isIframeOpen = false;
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
item.meta.isIframeOpen = true;
|
|
93
|
+
item.meta.loading = true;
|
|
94
|
+
closeIframeLoading(route.fullPath, item);
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
deep: true,
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-padding layout-link-container">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="layout-link-warp">
|
|
5
|
+
<i class="layout-link-icon iconfont icon-xingqiu"></i>
|
|
6
|
+
<div class="layout-link-msg">页面 {{ state.title }} 已在新窗口中打开</div>
|
|
7
|
+
<el-button class="mt30" round size="default" @click="onGotoFullPage">
|
|
8
|
+
<i class="iconfont icon-lianjie"></i>
|
|
9
|
+
<span>立即前往体验</span>
|
|
10
|
+
</el-button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts" name="layoutLinkView">
|
|
17
|
+
import { reactive, watch } from 'vue';
|
|
18
|
+
import { useRoute } from 'vue-router';
|
|
19
|
+
import { verifyUrl } from '/@/utils/toolsValidate';
|
|
20
|
+
|
|
21
|
+
// 定义变量内容
|
|
22
|
+
const route = useRoute();
|
|
23
|
+
const state = reactive<LinkViewState>({
|
|
24
|
+
title: '',
|
|
25
|
+
isLink: '',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// 立即前往
|
|
29
|
+
const onGotoFullPage = () => {
|
|
30
|
+
const { origin, pathname } = window.location;
|
|
31
|
+
if (verifyUrl(<string>state.isLink)) window.open(state.isLink);
|
|
32
|
+
else window.open(`${origin}${pathname}#${state.isLink}`);
|
|
33
|
+
};
|
|
34
|
+
// 监听路由的变化,设置内容
|
|
35
|
+
watch(
|
|
36
|
+
() => route.path,
|
|
37
|
+
() => {
|
|
38
|
+
state.title = <string>route.meta.title;
|
|
39
|
+
state.isLink = <string>route.meta.isLink;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
immediate: true,
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style scoped lang="scss">
|
|
48
|
+
.layout-link-container {
|
|
49
|
+
.layout-link-warp {
|
|
50
|
+
margin: auto;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
i.layout-link-icon {
|
|
56
|
+
position: relative;
|
|
57
|
+
font-size: 100px;
|
|
58
|
+
color: var(--el-color-primary);
|
|
59
|
+
&::after {
|
|
60
|
+
content: '';
|
|
61
|
+
position: absolute;
|
|
62
|
+
left: 50px;
|
|
63
|
+
top: 0;
|
|
64
|
+
width: 15px;
|
|
65
|
+
height: 100px;
|
|
66
|
+
background: linear-gradient(
|
|
67
|
+
rgba(255, 255, 255, 0.01),
|
|
68
|
+
rgba(255, 255, 255, 0.01),
|
|
69
|
+
rgba(255, 255, 255, 0.01),
|
|
70
|
+
rgba(255, 255, 255, 0.05),
|
|
71
|
+
rgba(255, 255, 255, 0.05),
|
|
72
|
+
rgba(255, 255, 255, 0.05),
|
|
73
|
+
rgba(235, 255, 255, 0.5),
|
|
74
|
+
rgba(255, 255, 255, 0.05),
|
|
75
|
+
rgba(255, 255, 255, 0.05),
|
|
76
|
+
rgba(255, 255, 255, 0.05),
|
|
77
|
+
rgba(255, 255, 255, 0.01),
|
|
78
|
+
rgba(255, 255, 255, 0.01),
|
|
79
|
+
rgba(255, 255, 255, 0.01)
|
|
80
|
+
);
|
|
81
|
+
transform: rotate(-15deg);
|
|
82
|
+
animation: toRight 5s linear infinite;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.layout-link-msg {
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
color: var(--next-bg-topBarColor);
|
|
88
|
+
opacity: 0.7;
|
|
89
|
+
margin-top: 15px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-parent">
|
|
3
|
+
<router-view v-slot="{ Component }">
|
|
4
|
+
<transition :name="setTransitionName" mode="out-in">
|
|
5
|
+
<keep-alive :include="getKeepAliveNames">
|
|
6
|
+
<component :is="Component" :key="state.refreshRouterViewKey" class="w100" v-show="!isIframePage" />
|
|
7
|
+
</keep-alive>
|
|
8
|
+
</transition>
|
|
9
|
+
</router-view>
|
|
10
|
+
<transition :name="setTransitionName" mode="out-in">
|
|
11
|
+
<Iframes class="w100" v-show="isIframePage" :refreshKey="state.iframeRefreshKey" :name="setTransitionName" :list="state.iframeList" />
|
|
12
|
+
</transition>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts" name="layoutParentView">
|
|
17
|
+
import { defineAsyncComponent, computed, reactive, onBeforeMount, onUnmounted, nextTick, watch, onMounted } from 'vue';
|
|
18
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
19
|
+
import { storeToRefs } from 'pinia';
|
|
20
|
+
import { useKeepALiveNames } from '/@/stores/keepAliveNames';
|
|
21
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
22
|
+
import { Session } from '/@/utils/storage';
|
|
23
|
+
import mittBus from '/@/utils/mitt';
|
|
24
|
+
|
|
25
|
+
// 引入组件
|
|
26
|
+
const Iframes = defineAsyncComponent(() => import('/@/layout/routerView/iframes.vue'));
|
|
27
|
+
|
|
28
|
+
// 定义变量内容
|
|
29
|
+
const route = useRoute();
|
|
30
|
+
const router = useRouter();
|
|
31
|
+
const storesKeepAliveNames = useKeepALiveNames();
|
|
32
|
+
const storesThemeConfig = useThemeConfig();
|
|
33
|
+
const { keepAliveNames, cachedViews } = storeToRefs(storesKeepAliveNames);
|
|
34
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
35
|
+
const state = reactive<ParentViewState>({
|
|
36
|
+
refreshRouterViewKey: '', // 非 iframe tagsview 右键菜单刷新时
|
|
37
|
+
iframeRefreshKey: '', // iframe tagsview 右键菜单刷新时
|
|
38
|
+
keepAliveNameList: [],
|
|
39
|
+
iframeList: [],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// 设置主界面切换动画
|
|
43
|
+
const setTransitionName = computed(() => {
|
|
44
|
+
return themeConfig.value.animation;
|
|
45
|
+
});
|
|
46
|
+
// 获取组件缓存列表(name值)
|
|
47
|
+
const getKeepAliveNames = computed(() => {
|
|
48
|
+
return themeConfig.value.isTagsview ? cachedViews.value : state.keepAliveNameList;
|
|
49
|
+
});
|
|
50
|
+
// 设置 iframe 显示/隐藏
|
|
51
|
+
const isIframePage = computed(() => {
|
|
52
|
+
return route.meta.isIframe;
|
|
53
|
+
});
|
|
54
|
+
// 获取 iframe 组件列表(未进行渲染)
|
|
55
|
+
const getIframeListRoutes = async () => {
|
|
56
|
+
router.getRoutes().forEach((v) => {
|
|
57
|
+
if (v.meta.isIframe) {
|
|
58
|
+
v.meta.isIframeOpen = false;
|
|
59
|
+
v.meta.loading = true;
|
|
60
|
+
state.iframeList.push({ ...v });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
// 页面加载前,处理缓存,页面刷新时路由缓存处理
|
|
65
|
+
onBeforeMount(() => {
|
|
66
|
+
state.keepAliveNameList = keepAliveNames.value;
|
|
67
|
+
mittBus.on('onTagsViewRefreshRouterView', (fullPath: string) => {
|
|
68
|
+
state.keepAliveNameList = keepAliveNames.value.filter((name: string) => route.name !== name);
|
|
69
|
+
state.refreshRouterViewKey = '';
|
|
70
|
+
state.iframeRefreshKey = '';
|
|
71
|
+
nextTick(() => {
|
|
72
|
+
state.refreshRouterViewKey = fullPath;
|
|
73
|
+
state.iframeRefreshKey = fullPath;
|
|
74
|
+
state.keepAliveNameList = keepAliveNames.value;
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
// 页面加载时
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
getIframeListRoutes();
|
|
81
|
+
nextTick(() => {
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
if (themeConfig.value.isCacheTagsView) {
|
|
84
|
+
let tagsViewArr: RouteItem[] = Session.get('tagsViewList') || [];
|
|
85
|
+
cachedViews.value = tagsViewArr.filter((item) => item.meta?.isKeepAlive).map((item) => item.name as string);
|
|
86
|
+
}
|
|
87
|
+
}, 0);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
// 页面卸载时
|
|
91
|
+
onUnmounted(() => {
|
|
92
|
+
mittBus.off('onTagsViewRefreshRouterView', () => {});
|
|
93
|
+
});
|
|
94
|
+
// 监听路由变化,防止 tagsView 多标签时,切换动画消失
|
|
95
|
+
watch(
|
|
96
|
+
() => route.fullPath,
|
|
97
|
+
() => {
|
|
98
|
+
state.refreshRouterViewKey = decodeURI(route.fullPath);
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
immediate: true,
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
</script>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="upgrade-dialog">
|
|
3
|
+
<el-dialog
|
|
4
|
+
v-model="state.isUpgrade"
|
|
5
|
+
width="300px"
|
|
6
|
+
destroy-on-close
|
|
7
|
+
:show-close="false"
|
|
8
|
+
:close-on-click-modal="false"
|
|
9
|
+
:close-on-press-escape="false"
|
|
10
|
+
>
|
|
11
|
+
<div class="upgrade-title">
|
|
12
|
+
<div class="upgrade-title-warp">
|
|
13
|
+
<span class="upgrade-title-warp-txt">新版本升级</span>
|
|
14
|
+
<span class="upgrade-title-warp-version">v{{ state.version }}</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="upgrade-content">
|
|
18
|
+
{{ getThemeConfig.globalTitle }} 新版本来啦,马上更新尝鲜吧!不用担心,更新很快的哦!
|
|
19
|
+
<div class="mt5">
|
|
20
|
+
<el-link type="primary" class="font12" target="_black"> CHANGELOG.md </el-link>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="upgrade-content-desc mt5">提示:更新会还原默认配置</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="upgrade-btn">
|
|
25
|
+
<el-button round size="default" type="info" text @click="onCancel">残忍拒绝</el-button>
|
|
26
|
+
<el-button type="primary" round size="default" @click="onUpgrade" :loading="state.isLoading">{{ state.btnTxt }}</el-button>
|
|
27
|
+
</div>
|
|
28
|
+
</el-dialog>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts" name="layoutUpgrade">
|
|
33
|
+
import { reactive, computed, onMounted } from 'vue';
|
|
34
|
+
import { storeToRefs } from 'pinia';
|
|
35
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
36
|
+
import { systemStore } from '/@/utils/storage';
|
|
37
|
+
|
|
38
|
+
// 定义变量内容
|
|
39
|
+
const storesThemeConfig = useThemeConfig();
|
|
40
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
41
|
+
const state = reactive({
|
|
42
|
+
isUpgrade: false,
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
version: __NEXT_VERSION__,
|
|
45
|
+
isLoading: false,
|
|
46
|
+
btnTxt: '',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// 获取布局配置信息
|
|
50
|
+
const getThemeConfig = computed(() => {
|
|
51
|
+
return themeConfig.value;
|
|
52
|
+
});
|
|
53
|
+
// 残忍拒绝
|
|
54
|
+
const onCancel = () => {
|
|
55
|
+
state.isUpgrade = false;
|
|
56
|
+
};
|
|
57
|
+
// 马上更新
|
|
58
|
+
const onUpgrade = () => {
|
|
59
|
+
state.isLoading = true;
|
|
60
|
+
state.btnTxt = '更新中';
|
|
61
|
+
setTimeout(async () => {
|
|
62
|
+
await systemStore.clear();
|
|
63
|
+
window.location.reload();
|
|
64
|
+
await systemStore.set('version', state.version);
|
|
65
|
+
}, 2000);
|
|
66
|
+
};
|
|
67
|
+
// 延迟显示,防止刷新时界面显示太快
|
|
68
|
+
const delayShow = () => {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
state.isUpgrade = true;
|
|
71
|
+
}, 2000);
|
|
72
|
+
};
|
|
73
|
+
// 页面加载时
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
delayShow();
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
state.btnTxt = '马上更新';
|
|
78
|
+
}, 200);
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style scoped lang="scss">
|
|
83
|
+
.upgrade-dialog {
|
|
84
|
+
:deep(.el-dialog) {
|
|
85
|
+
.el-dialog__body {
|
|
86
|
+
padding: 0 !important;
|
|
87
|
+
}
|
|
88
|
+
.el-dialog__header {
|
|
89
|
+
display: none !important;
|
|
90
|
+
}
|
|
91
|
+
.upgrade-title {
|
|
92
|
+
text-align: center;
|
|
93
|
+
height: 130px;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
position: relative;
|
|
98
|
+
&::after {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
background-color: var(--el-color-primary-light-1);
|
|
102
|
+
width: 130%;
|
|
103
|
+
height: 130px;
|
|
104
|
+
border-bottom-left-radius: 100%;
|
|
105
|
+
border-bottom-right-radius: 100%;
|
|
106
|
+
}
|
|
107
|
+
.upgrade-title-warp {
|
|
108
|
+
z-index: 1;
|
|
109
|
+
position: relative;
|
|
110
|
+
.upgrade-title-warp-txt {
|
|
111
|
+
color: var(--next-color-white);
|
|
112
|
+
font-size: 22px;
|
|
113
|
+
letter-spacing: 3px;
|
|
114
|
+
}
|
|
115
|
+
.upgrade-title-warp-version {
|
|
116
|
+
color: var(--next-color-white);
|
|
117
|
+
background-color: var(--el-color-primary-light-4);
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
position: absolute;
|
|
120
|
+
display: flex;
|
|
121
|
+
top: -2px;
|
|
122
|
+
right: -50px;
|
|
123
|
+
padding: 2px 4px;
|
|
124
|
+
border-radius: 2px;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.upgrade-content {
|
|
129
|
+
padding: 20px;
|
|
130
|
+
line-height: 22px;
|
|
131
|
+
.upgrade-content-desc {
|
|
132
|
+
color: var(--el-color-info-light-5);
|
|
133
|
+
font-size: 12px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.upgrade-btn {
|
|
137
|
+
border-top: 1px solid var(--el-border-color-lighter, #ebeef5);
|
|
138
|
+
display: flex;
|
|
139
|
+
justify-content: space-around;
|
|
140
|
+
padding: 15px 20px;
|
|
141
|
+
.el-button {
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { createApp } from 'vue';
|
|
3
|
+
/** 用于提高滚动性能和防止滚动阻塞。 它的作用是在触摸事件上默认使用passive选项,以避免阻止滚动。 这样可以提高页面的响应速度和流畅度,减少用户的等待时间 */
|
|
4
|
+
import 'default-passive-events';
|
|
5
|
+
// 放在前面是为了解决打包后样式冲突问题 会出现 tailwind 覆盖element-plus 按钮背景冲突问题
|
|
6
|
+
import '/@/style/tailwind.css';
|
|
7
|
+
import 'vxe-table/lib/style.css';
|
|
8
|
+
// 代替vuex 进行跨组件/页面共享状态 https://pinia.web3doc.top/introduction.html
|
|
9
|
+
import pinia from '/@/stores/index';
|
|
10
|
+
// 页面入口点 包含路由入口 锁屏 设置 全屏
|
|
11
|
+
import App from '/@/App.vue';
|
|
12
|
+
// 路由
|
|
13
|
+
import router from '/@/router';
|
|
14
|
+
// 指令集
|
|
15
|
+
// import { directive } from '/@/directive/index';
|
|
16
|
+
// 基础的工具集
|
|
17
|
+
import other from '/@/utils/other';
|
|
18
|
+
// element-plus UI框架 https://element-plus.org/zh-CN/
|
|
19
|
+
import ElementPlus from 'element-plus';
|
|
20
|
+
// 主题样式 框架样式库 勿动
|
|
21
|
+
import '/@/theme/index.scss';
|
|
22
|
+
// 项目中业务样式库 包含了页面和组件样式 框架内所有样式都写到这个文件下
|
|
23
|
+
import '/@/style/index.scss';
|
|
24
|
+
// 引入 vxe
|
|
25
|
+
import VXETable from 'vxe-table';
|
|
26
|
+
import { popupPlugin } from './utils/showPopup';
|
|
27
|
+
|
|
28
|
+
function useVxe(app: App) {
|
|
29
|
+
app.use(VXETable);
|
|
30
|
+
}
|
|
31
|
+
// 全局组件注册
|
|
32
|
+
import component from '/@/components/component';
|
|
33
|
+
import showMessage from '/@/utils/showMessage';
|
|
34
|
+
import showNotification from '/@/utils/showNotification';
|
|
35
|
+
import showMessageBox from '/@/utils/showMessageBox';
|
|
36
|
+
// TRTC
|
|
37
|
+
// import TRTC from 'trtc-sdk-v5';
|
|
38
|
+
const app = createApp(App);
|
|
39
|
+
other.elSvg(app);
|
|
40
|
+
(window as any).app = app;
|
|
41
|
+
console.debug('app');
|
|
42
|
+
app
|
|
43
|
+
.use(pinia)
|
|
44
|
+
.use(router)
|
|
45
|
+
.use(ElementPlus)
|
|
46
|
+
.use(component)
|
|
47
|
+
.use(useVxe)
|
|
48
|
+
.use(showMessage)
|
|
49
|
+
.use(showNotification)
|
|
50
|
+
.use(showMessageBox)
|
|
51
|
+
.use(popupPlugin, {
|
|
52
|
+
width: 1000,
|
|
53
|
+
height: 600,
|
|
54
|
+
mask: false,
|
|
55
|
+
maskClosable: false,
|
|
56
|
+
destroyOnClose: true,
|
|
57
|
+
escClosable: false,
|
|
58
|
+
showZoom: false,
|
|
59
|
+
resize: false,
|
|
60
|
+
})
|
|
61
|
+
.mount('#app');
|
|
62
|
+
// 用于为 Vue 的运行时警告指定一个自定义处理函数
|
|
63
|
+
// app.config.warnHandler = (msg, instance, trace) => {
|
|
64
|
+
// console.table([{ "自定义处理函数->来源组件": instance }, { "组件追踪字符串": trace }, { "警告信息": msg }]);
|
|
65
|
+
// }
|
|
66
|
+
// // 追踪运行时错误报告
|
|
67
|
+
// app.config.errorHandler = (err, instance, info) => {
|
|
68
|
+
// console.debug({ "应用级错误处理->来源组件": instance, "错误信息": err, "警告信息": info });
|
|
69
|
+
// }
|
|
70
|
+
export { component };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
import pinia from '/@/stores/index';
|
|
3
|
+
import { useUserInfo } from '/@/stores/userInfo';
|
|
4
|
+
import { useRequestOldRoutes } from '/@/stores/requestOldRoutes';
|
|
5
|
+
import { NextLoading } from '/@/utils/loading';
|
|
6
|
+
import { dynamicRoutes, notFoundAndNoPower } from '/@/router/route';
|
|
7
|
+
import { formatTwoStageRoutes, formatFlatteningRoutes, router } from '/@/router/index';
|
|
8
|
+
import { useRoutesList } from '/@/stores/routesList';
|
|
9
|
+
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
|
|
10
|
+
// import { useMenuController } from '/@/api/menu/index';
|
|
11
|
+
import { useMenuController } from '/@/api/menuController/index';
|
|
12
|
+
|
|
13
|
+
// 后端控制路由
|
|
14
|
+
|
|
15
|
+
// 引入 api 请求接口
|
|
16
|
+
const menuApi = useMenuController();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 获取目录下的 .vue、.tsx 全部文件
|
|
20
|
+
* @method import.meta.glob
|
|
21
|
+
* @link 参考:https://cn.vitejs.dev/guide/features.html#json
|
|
22
|
+
*/
|
|
23
|
+
const layouModules: any = import.meta.glob('../layout/routerView/*.{vue,tsx}');
|
|
24
|
+
const viewsModules: any = import.meta.glob('../views/**/*.{vue,tsx}');
|
|
25
|
+
const dynamicViewsModules: Record<string, Function> = Object.assign({}, { ...layouModules }, { ...viewsModules });
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 后端控制路由:初始化方法,防止刷新时路由丢失
|
|
29
|
+
* @method NextLoading 界面 loading 动画开始执行
|
|
30
|
+
* @method useUserInfo().setUserInfos() 触发初始化用户信息 pinia
|
|
31
|
+
* @method useRequestOldRoutes().setRequestOldRoutes() 存储接口原始路由(未处理component),根据需求选择使用
|
|
32
|
+
* @method setAddRoute 添加动态路由
|
|
33
|
+
* @method setFilterMenuAndCacheTagsViewRoutes 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
|
34
|
+
*/
|
|
35
|
+
export async function initBackEndControlRoutes() {
|
|
36
|
+
// 界面 loading 动画开始执行
|
|
37
|
+
if (window.nextLoading === undefined) NextLoading.start();
|
|
38
|
+
// 无 token 停止执行下一步
|
|
39
|
+
const userInfo = useUserInfo();
|
|
40
|
+
const token = await userInfo.isLogin();
|
|
41
|
+
if (!token) return false;
|
|
42
|
+
// 获取路由菜单数据
|
|
43
|
+
const res = await getBackEndControlRoutes();
|
|
44
|
+
// 无登录权限时,添加判断
|
|
45
|
+
if (res.data.length <= 0) return Promise.resolve(true);
|
|
46
|
+
// 存储接口原始路由(未处理component),根据需求选择使用
|
|
47
|
+
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
|
48
|
+
// 处理路由(component),替换 dynamicRoutes(@/router/route)第一个顶级 children 的路由
|
|
49
|
+
dynamicRoutes[0].children = await backEndComponent(res.data);
|
|
50
|
+
// 添加动态路由
|
|
51
|
+
await setAddRoute();
|
|
52
|
+
// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
|
53
|
+
setFilterMenuAndCacheTagsViewRoutes();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
|
58
|
+
* @description 用于左侧菜单、横向菜单的显示
|
|
59
|
+
* @description 用于 tagsView、菜单搜索中:未过滤隐藏的(isHide)
|
|
60
|
+
*/
|
|
61
|
+
export async function setFilterMenuAndCacheTagsViewRoutes() {
|
|
62
|
+
const storesRoutesList = useRoutesList(pinia);
|
|
63
|
+
storesRoutesList.setRoutesList(dynamicRoutes[0].children as any);
|
|
64
|
+
setCacheTagsViewRoutes();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 缓存多级嵌套数组处理后的一维数组
|
|
69
|
+
* @description 用于 tagsView、菜单搜索中:未过滤隐藏的(isHide)
|
|
70
|
+
*/
|
|
71
|
+
export function setCacheTagsViewRoutes() {
|
|
72
|
+
const storesTagsView = useTagsViewRoutes(pinia);
|
|
73
|
+
storesTagsView.setTagsViewRoutes(formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes))[0].children);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 处理路由格式及添加捕获所有路由或 404 Not found 路由
|
|
78
|
+
* @description 替换 dynamicRoutes(@/router/route)第一个顶级 children 的路由
|
|
79
|
+
* @returns 返回替换后的路由数组
|
|
80
|
+
*/
|
|
81
|
+
export function setFilterRouteEnd() {
|
|
82
|
+
let filterRouteEnd: any = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes));
|
|
83
|
+
// notFoundAndNoPower 防止 404、401 不在 layout 布局中,不设置的话,404、401 界面将全屏显示
|
|
84
|
+
// 关联问题 No match found for location with path 'xxx'
|
|
85
|
+
filterRouteEnd[0].children = [...filterRouteEnd[0].children, ...notFoundAndNoPower];
|
|
86
|
+
return filterRouteEnd;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 添加动态路由
|
|
91
|
+
* @method router.addRoute
|
|
92
|
+
* @description 此处循环为 dynamicRoutes(@/router/route)第一个顶级 children 的路由一维数组,非多级嵌套
|
|
93
|
+
* @link 参考:https://next.router.vuejs.org/zh/api/#addroute
|
|
94
|
+
*/
|
|
95
|
+
export async function setAddRoute() {
|
|
96
|
+
await setFilterRouteEnd().forEach((route: RouteRecordRaw) => {
|
|
97
|
+
router.addRoute(route);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 请求后端路由菜单接口
|
|
103
|
+
* @description isRequestRoutes 为 true,则开启后端控制路由
|
|
104
|
+
* @returns 返回后端路由菜单数据
|
|
105
|
+
*/
|
|
106
|
+
export async function getBackEndControlRoutes() {
|
|
107
|
+
// 模拟 admin 与 test
|
|
108
|
+
// const stores = useUserInfo(pinia);
|
|
109
|
+
// const { userInfos } = storeToRefs(stores);
|
|
110
|
+
// const auth = userInfos.value.roles[0];
|
|
111
|
+
// 管理员 admin
|
|
112
|
+
let menu = await menuApi.getMenuList();
|
|
113
|
+
console.debug('menu:', menu);
|
|
114
|
+
return menu;
|
|
115
|
+
// if (auth === 'admin') return menuApi.getAdminMenu();
|
|
116
|
+
// // 其它用户 test
|
|
117
|
+
// else return menuApi.getTestMenu();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 重新请求后端路由菜单接口
|
|
122
|
+
* @description 用于菜单管理界面刷新菜单(未进行测试)
|
|
123
|
+
* @description 路径:/src/views/system/menu/component/addMenu.vue
|
|
124
|
+
*/
|
|
125
|
+
export async function setBackEndControlRefreshRoutes() {
|
|
126
|
+
// 获取路由菜单数据
|
|
127
|
+
const res = await getBackEndControlRoutes();
|
|
128
|
+
// 无登录权限时,添加判断
|
|
129
|
+
if (res.data.length <= 0) return Promise.resolve(true);
|
|
130
|
+
// 存储接口原始路由(未处理component),根据需求选择使用
|
|
131
|
+
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
|
132
|
+
// 处理路由(component),替换 dynamicRoutes(@/router/route)第一个顶级 children 的路由
|
|
133
|
+
dynamicRoutes[0].children = await backEndComponent(res.data);
|
|
134
|
+
// 添加动态路由
|
|
135
|
+
await setAddRoute();
|
|
136
|
+
// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
|
137
|
+
setFilterMenuAndCacheTagsViewRoutes();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 后端路由 component 转换
|
|
142
|
+
* @param routes 后端返回的路由表数组
|
|
143
|
+
* @returns 返回处理成函数后的 component
|
|
144
|
+
*/
|
|
145
|
+
export function backEndComponent(routes: any) {
|
|
146
|
+
if (!routes) return;
|
|
147
|
+
return routes.map((item: any) => {
|
|
148
|
+
if (item.component) item.component = dynamicImport(dynamicViewsModules, item.component as string);
|
|
149
|
+
item.children && backEndComponent(item.children);
|
|
150
|
+
return item;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 后端路由 component 转换函数
|
|
156
|
+
* @param dynamicViewsModules 获取目录下的 .vue、.tsx 全部文件
|
|
157
|
+
* @param component 当前要处理项 component
|
|
158
|
+
* @returns 返回处理成函数后的 component
|
|
159
|
+
*/
|
|
160
|
+
export function dynamicImport(dynamicViewsModules: Record<string, Function>, component: string) {
|
|
161
|
+
const keys = Object.keys(dynamicViewsModules);
|
|
162
|
+
const matchKeys = keys.filter((key) => {
|
|
163
|
+
const k = key.replace(/..\/views|../, '');
|
|
164
|
+
return k.startsWith(`${component}`) || k.startsWith(`/${component}`);
|
|
165
|
+
});
|
|
166
|
+
if (matchKeys?.length === 1) {
|
|
167
|
+
const matchKey = matchKeys[0];
|
|
168
|
+
return dynamicViewsModules[matchKey];
|
|
169
|
+
}
|
|
170
|
+
if (matchKeys?.length > 1) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
}
|