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,222 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
|
|
3
|
+
<div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
|
|
4
|
+
<el-icon title="菜单搜索">
|
|
5
|
+
<ele-Search />
|
|
6
|
+
</el-icon>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="layout-navbars-breadcrumb-user-icon" @click="onLayoutSetingClick">
|
|
9
|
+
<i class="icon-skin iconfont" title="布局配置"></i>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="layout-navbars-breadcrumb-user-icon" ref="userNewsBadgeRef" v-click-outside="onUserNewsClick">
|
|
12
|
+
<el-badge :is-dot="true">
|
|
13
|
+
<el-icon title="消息">
|
|
14
|
+
<ele-Bell />
|
|
15
|
+
</el-icon>
|
|
16
|
+
</el-badge>
|
|
17
|
+
</div>
|
|
18
|
+
<el-popover
|
|
19
|
+
ref="userNewsRef"
|
|
20
|
+
:virtual-ref="userNewsBadgeRef"
|
|
21
|
+
placement="bottom"
|
|
22
|
+
trigger="click"
|
|
23
|
+
transition="el-zoom-in-top"
|
|
24
|
+
virtual-triggering
|
|
25
|
+
:width="300"
|
|
26
|
+
:persistent="false"
|
|
27
|
+
>
|
|
28
|
+
<UserNews />
|
|
29
|
+
</el-popover>
|
|
30
|
+
<div class="layout-navbars-breadcrumb-user-icon mr10" @click="onScreenfullClick">
|
|
31
|
+
<i
|
|
32
|
+
class="iconfont"
|
|
33
|
+
:title="state.isScreenfull ? '关全屏' : '开全屏'"
|
|
34
|
+
:class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
|
|
35
|
+
></i>
|
|
36
|
+
</div>
|
|
37
|
+
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
|
|
38
|
+
<span class="layout-navbars-breadcrumb-user-link">
|
|
39
|
+
<img :src="userInfos.photo" class="layout-navbars-breadcrumb-user-link-photo mr5" />
|
|
40
|
+
{{ userInfos.userName === '' ? 'common' : userInfos.userName }}
|
|
41
|
+
<el-icon class="el-icon--right">
|
|
42
|
+
<ele-ArrowDown />
|
|
43
|
+
</el-icon>
|
|
44
|
+
</span>
|
|
45
|
+
<template #dropdown>
|
|
46
|
+
<el-dropdown-menu>
|
|
47
|
+
<el-dropdown-item divided command="logOut">退出登录</el-dropdown-item>
|
|
48
|
+
</el-dropdown-menu>
|
|
49
|
+
</template>
|
|
50
|
+
</el-dropdown>
|
|
51
|
+
<Search ref="searchRef" />
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script setup lang="ts" name="layoutBreadcrumbUser">
|
|
56
|
+
import { defineAsyncComponent, ref, unref, computed, reactive, onMounted } from 'vue';
|
|
57
|
+
import { useRouter } from 'vue-router';
|
|
58
|
+
import { ElMessageBox, ElMessage, ClickOutside as vClickOutside } from 'element-plus';
|
|
59
|
+
import screenfull from 'screenfull';
|
|
60
|
+
import { storeToRefs } from 'pinia';
|
|
61
|
+
import { useUserInfo } from '/@/stores/userInfo';
|
|
62
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
63
|
+
import mittBus from '/@/utils/mitt';
|
|
64
|
+
import { systemStore } from '/@/utils/storage';
|
|
65
|
+
import { useLoginController } from '/@/api/loginController/index';
|
|
66
|
+
// 引入组件
|
|
67
|
+
const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/topBar/userNews.vue'));
|
|
68
|
+
const Search = defineAsyncComponent(() => import('/@/layout/navBars/topBar/search.vue'));
|
|
69
|
+
const login = useLoginController();
|
|
70
|
+
// 定义变量内容
|
|
71
|
+
const userNewsRef = ref();
|
|
72
|
+
const userNewsBadgeRef = ref();
|
|
73
|
+
const router = useRouter();
|
|
74
|
+
const stores = useUserInfo();
|
|
75
|
+
const storesThemeConfig = useThemeConfig();
|
|
76
|
+
const { userInfos } = storeToRefs(stores);
|
|
77
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
78
|
+
const searchRef = ref();
|
|
79
|
+
const state = reactive({
|
|
80
|
+
isScreenfull: false,
|
|
81
|
+
disabledSize: 'large',
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// 设置分割样式
|
|
85
|
+
const layoutUserFlexNum = computed(() => {
|
|
86
|
+
let num: string | number = '';
|
|
87
|
+
const { layout, isClassicSplitMenu } = themeConfig.value;
|
|
88
|
+
const layoutArr: string[] = ['defaults', 'columns'];
|
|
89
|
+
if (layoutArr.includes(layout) || (layout === 'classic' && !isClassicSplitMenu)) num = '1';
|
|
90
|
+
else num = '';
|
|
91
|
+
return num;
|
|
92
|
+
});
|
|
93
|
+
// 全屏点击时
|
|
94
|
+
const onScreenfullClick = () => {
|
|
95
|
+
if (!screenfull.isEnabled) {
|
|
96
|
+
ElMessage.warning('暂不不支持全屏');
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
screenfull.toggle();
|
|
100
|
+
screenfull.on('change', () => {
|
|
101
|
+
if (screenfull.isFullscreen) state.isScreenfull = true;
|
|
102
|
+
else state.isScreenfull = false;
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
// 消息通知点击时
|
|
106
|
+
const onUserNewsClick = () => {
|
|
107
|
+
unref(userNewsRef).popperRef?.delayHide?.();
|
|
108
|
+
};
|
|
109
|
+
// 布局配置 icon 点击时
|
|
110
|
+
const onLayoutSetingClick = () => {
|
|
111
|
+
mittBus.emit('openSetingsDrawer');
|
|
112
|
+
};
|
|
113
|
+
// 下拉菜单点击时
|
|
114
|
+
const onHandleCommandClick = (path: string) => {
|
|
115
|
+
if (path === 'logOut') {
|
|
116
|
+
ElMessageBox({
|
|
117
|
+
closeOnClickModal: false,
|
|
118
|
+
closeOnPressEscape: false,
|
|
119
|
+
title: '提示',
|
|
120
|
+
message: '此操作将退出登录, 是否继续?',
|
|
121
|
+
showCancelButton: true,
|
|
122
|
+
confirmButtonText: '确定',
|
|
123
|
+
cancelButtonText: '取消',
|
|
124
|
+
buttonSize: 'default',
|
|
125
|
+
beforeClose: (action, instance, done) => {
|
|
126
|
+
if (action === 'confirm') {
|
|
127
|
+
instance.confirmButtonLoading = true;
|
|
128
|
+
instance.confirmButtonText = '退出中';
|
|
129
|
+
login
|
|
130
|
+
.postAjaxLogout()
|
|
131
|
+
.then(() => {
|
|
132
|
+
done();
|
|
133
|
+
})
|
|
134
|
+
.finally(() => {
|
|
135
|
+
instance.confirmButtonLoading = false;
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
done();
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
.then(() => {
|
|
143
|
+
stores.logout();
|
|
144
|
+
})
|
|
145
|
+
.catch(() => {});
|
|
146
|
+
} else if (path === 'wareHouse') {
|
|
147
|
+
window.open('https://www.baidu.com');
|
|
148
|
+
} else {
|
|
149
|
+
router.push(path);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
// 菜单搜索点击
|
|
153
|
+
const onSearchClick = () => {
|
|
154
|
+
searchRef.value.openSearch();
|
|
155
|
+
};
|
|
156
|
+
// 初始化组件大小/i18n
|
|
157
|
+
const initI18nOrSize = async (value: string, attr: string) => {
|
|
158
|
+
(<any>state)[attr] = await systemStore.get('themeConfig').then((res) => res[value]);
|
|
159
|
+
};
|
|
160
|
+
// 组件大小改变
|
|
161
|
+
const onComponentSizeChange = async (size: string) => {
|
|
162
|
+
await systemStore.remove('themeConfig');
|
|
163
|
+
themeConfig.value.globalComponentSize = size;
|
|
164
|
+
await systemStore.set('themeConfig', themeConfig.value);
|
|
165
|
+
await initI18nOrSize('globalComponentSize', 'disabledSize');
|
|
166
|
+
window.location.reload();
|
|
167
|
+
};
|
|
168
|
+
// 页面加载时
|
|
169
|
+
onMounted(async () => {
|
|
170
|
+
const themeConfig = await systemStore.get('themeConfig');
|
|
171
|
+
if (themeConfig) {
|
|
172
|
+
await initI18nOrSize('globalComponentSize', 'disabledSize');
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
<style scoped lang="scss">
|
|
178
|
+
.layout-navbars-breadcrumb-user {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: flex-end;
|
|
182
|
+
&-link {
|
|
183
|
+
height: 100%;
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
&-photo {
|
|
188
|
+
width: 25px;
|
|
189
|
+
height: 25px;
|
|
190
|
+
border-radius: 100%;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
&-icon {
|
|
194
|
+
padding: 0 10px;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
color: var(--next-bg-topBarColor);
|
|
197
|
+
height: 50px;
|
|
198
|
+
line-height: 50px;
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
&:hover {
|
|
202
|
+
background: var(--next-color-user-hover);
|
|
203
|
+
i {
|
|
204
|
+
display: inline-block;
|
|
205
|
+
animation: logoAnimation 0.3s ease-in-out;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
:deep(.el-dropdown) {
|
|
210
|
+
color: var(--next-bg-topBarColor);
|
|
211
|
+
}
|
|
212
|
+
:deep(.el-badge) {
|
|
213
|
+
height: 40px;
|
|
214
|
+
line-height: 40px;
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
}
|
|
218
|
+
:deep(.el-badge__content.is-fixed) {
|
|
219
|
+
top: 12px;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-navbars-breadcrumb-user-news">
|
|
3
|
+
<div class="head-box">
|
|
4
|
+
<div class="head-box-title">通知</div>
|
|
5
|
+
<div class="head-box-btn" v-if="state.newsList.length > 0" @click="onAllReadClick">全部已读</div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="content-box">
|
|
8
|
+
<template v-if="state.newsList.length > 0">
|
|
9
|
+
<div class="content-box-item" v-for="(v, k) in state.newsList" :key="k">
|
|
10
|
+
<div>{{ v.label }}</div>
|
|
11
|
+
<div class="content-box-msg">
|
|
12
|
+
{{ v.value }}
|
|
13
|
+
</div>
|
|
14
|
+
<div class="content-box-time">{{ v.time }}</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<el-empty description="暂无通知" v-else></el-empty>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="foot-box" @click="onGoToGiteeClick" v-if="state.newsList.length > 0">前往通知中心</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts" name="layoutBreadcrumbUserNews">
|
|
24
|
+
import { reactive } from 'vue';
|
|
25
|
+
|
|
26
|
+
// 定义变量内容
|
|
27
|
+
const state = reactive({
|
|
28
|
+
newsList: [
|
|
29
|
+
{
|
|
30
|
+
label: '关于版本发布的通知',
|
|
31
|
+
value: '华速消息',
|
|
32
|
+
time: '2023-12-28',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: '关于学习交流的通知',
|
|
36
|
+
value: '华速消息',
|
|
37
|
+
time: '2023-12-28',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// 全部已读点击
|
|
43
|
+
const onAllReadClick = () => {
|
|
44
|
+
state.newsList = [];
|
|
45
|
+
};
|
|
46
|
+
// 前往通知中心点击
|
|
47
|
+
const onGoToGiteeClick = () => {
|
|
48
|
+
window.open('https://www.baidu.com');
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style scoped lang="scss">
|
|
53
|
+
.layout-navbars-breadcrumb-user-news {
|
|
54
|
+
.head-box {
|
|
55
|
+
display: flex;
|
|
56
|
+
border-bottom: 1px solid var(--el-border-color-lighter);
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
color: var(--el-text-color-primary);
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
height: 35px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
.head-box-btn {
|
|
63
|
+
color: var(--el-color-primary);
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
opacity: 0.8;
|
|
67
|
+
&:hover {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.content-box {
|
|
73
|
+
font-size: 13px;
|
|
74
|
+
.content-box-item {
|
|
75
|
+
padding-top: 12px;
|
|
76
|
+
&:last-of-type {
|
|
77
|
+
padding-bottom: 12px;
|
|
78
|
+
}
|
|
79
|
+
.content-box-msg {
|
|
80
|
+
color: var(--el-text-color-secondary);
|
|
81
|
+
margin-top: 5px;
|
|
82
|
+
margin-bottom: 5px;
|
|
83
|
+
}
|
|
84
|
+
.content-box-time {
|
|
85
|
+
color: var(--el-text-color-secondary);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.foot-box {
|
|
90
|
+
height: 35px;
|
|
91
|
+
color: var(--el-color-primary);
|
|
92
|
+
font-size: 13px;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
opacity: 0.8;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
border-top: 1px solid var(--el-border-color-lighter);
|
|
99
|
+
&:hover {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
:deep(.el-empty__description p) {
|
|
104
|
+
font-size: 13px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="el-menu-horizontal-warp">
|
|
3
|
+
<el-menu router :default-active="state.defaultActive" background-color="transparent" mode="horizontal">
|
|
4
|
+
<template v-for="val in menuLists">
|
|
5
|
+
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
|
6
|
+
<template #title>
|
|
7
|
+
<SvgIcon :name="val.meta.icon" />
|
|
8
|
+
<span>{{ val.meta.title }}</span>
|
|
9
|
+
</template>
|
|
10
|
+
<SubItem :chil="val.children" />
|
|
11
|
+
</el-sub-menu>
|
|
12
|
+
<template v-else>
|
|
13
|
+
<el-menu-item :index="val.path" :key="val.path">
|
|
14
|
+
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
|
15
|
+
<SvgIcon :name="val.meta.icon" />
|
|
16
|
+
{{ val.meta.title }}
|
|
17
|
+
</template>
|
|
18
|
+
<template #title v-else>
|
|
19
|
+
<a class="w100" @click.prevent="onALinkClick(val)">
|
|
20
|
+
<SvgIcon :name="val.meta.icon" />
|
|
21
|
+
{{ val.meta.title }}
|
|
22
|
+
</a>
|
|
23
|
+
</template>
|
|
24
|
+
</el-menu-item>
|
|
25
|
+
</template>
|
|
26
|
+
</template>
|
|
27
|
+
</el-menu>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts" name="navMenuHorizontal">
|
|
32
|
+
import { defineAsyncComponent, reactive, computed, onBeforeMount } from 'vue';
|
|
33
|
+
import { useRoute, onBeforeRouteUpdate, RouteRecordRaw } from 'vue-router';
|
|
34
|
+
import { storeToRefs } from 'pinia';
|
|
35
|
+
import { useRoutesList } from '/@/stores/routesList';
|
|
36
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
37
|
+
import other from '/@/utils/other';
|
|
38
|
+
import mittBus from '/@/utils/mitt';
|
|
39
|
+
|
|
40
|
+
// 引入组件
|
|
41
|
+
const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
|
|
42
|
+
|
|
43
|
+
// 定义父组件传过来的值
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
// 菜单列表
|
|
46
|
+
menuList: {
|
|
47
|
+
type: Array<RouteRecordRaw>,
|
|
48
|
+
default: () => [],
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 定义变量内容
|
|
53
|
+
const stores = useRoutesList();
|
|
54
|
+
const storesThemeConfig = useThemeConfig();
|
|
55
|
+
const { routesList } = storeToRefs(stores);
|
|
56
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
57
|
+
const route = useRoute();
|
|
58
|
+
const state = reactive({
|
|
59
|
+
defaultActive: '' as string | undefined,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// 获取父级菜单数据
|
|
63
|
+
const menuLists = computed(() => {
|
|
64
|
+
return <RouteItems>props.menuList;
|
|
65
|
+
});
|
|
66
|
+
// 路由过滤递归函数
|
|
67
|
+
const filterRoutesFun = <T extends RouteItem>(arr: T[]): T[] => {
|
|
68
|
+
return arr
|
|
69
|
+
.filter((item: T) => !item.meta?.isHide)
|
|
70
|
+
.map((item: T) => {
|
|
71
|
+
item = Object.assign({}, item);
|
|
72
|
+
if (item.children) item.children = filterRoutesFun(item.children);
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
// 传送当前子级数据到菜单中
|
|
77
|
+
const setSendClassicChildren = (path: string) => {
|
|
78
|
+
const currentPathSplit = path.split('/');
|
|
79
|
+
let currentData: MittMenu = { children: [] };
|
|
80
|
+
filterRoutesFun(routesList.value).map((v, k) => {
|
|
81
|
+
if (v.path === `/${currentPathSplit[1]}`) {
|
|
82
|
+
v['k'] = k;
|
|
83
|
+
currentData['item'] = { ...v };
|
|
84
|
+
currentData['children'] = [{ ...v }];
|
|
85
|
+
if (v.children) currentData['children'] = v.children;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return currentData;
|
|
89
|
+
};
|
|
90
|
+
// 设置页面当前路由高亮
|
|
91
|
+
const setCurrentRouterHighlight = (currentRoute: RouteToFrom) => {
|
|
92
|
+
const { path, meta } = currentRoute;
|
|
93
|
+
if (themeConfig.value.layout === 'classic') {
|
|
94
|
+
state.defaultActive = `/${path?.split('/')[1]}`;
|
|
95
|
+
} else {
|
|
96
|
+
const pathSplit = meta?.isDynamic ? meta.isDynamicPath!.split('/') : path!.split('/');
|
|
97
|
+
if (pathSplit.length >= 4 && meta?.isHide) state.defaultActive = pathSplit.splice(0, 3).join('/');
|
|
98
|
+
else state.defaultActive = path;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
// 打开外部链接
|
|
102
|
+
const onALinkClick = (val: RouteItem) => {
|
|
103
|
+
other.handleOpenLink(val);
|
|
104
|
+
};
|
|
105
|
+
// 页面加载前
|
|
106
|
+
onBeforeMount(() => {
|
|
107
|
+
setCurrentRouterHighlight(route);
|
|
108
|
+
});
|
|
109
|
+
// 路由更新时
|
|
110
|
+
onBeforeRouteUpdate((to) => {
|
|
111
|
+
setCurrentRouterHighlight(to);
|
|
112
|
+
// 修复经典布局开启切割菜单时,点击tagsView后左侧导航菜单数据不变的问题
|
|
113
|
+
let { layout, isClassicSplitMenu } = themeConfig.value;
|
|
114
|
+
if (layout === 'classic' && isClassicSplitMenu) {
|
|
115
|
+
mittBus.emit('setSendClassicChildren', setSendClassicChildren(to.path));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped lang="scss">
|
|
121
|
+
.el-menu-horizontal-warp {
|
|
122
|
+
flex: 1;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
margin-right: 30px;
|
|
125
|
+
:deep(.el-scrollbar__bar.is-vertical) {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
:deep(a) {
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
.el-menu.el-menu--horizontal {
|
|
132
|
+
display: flex;
|
|
133
|
+
height: 100%;
|
|
134
|
+
width: 100%;
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-for="val in chils">
|
|
3
|
+
<el-sub-menu :index="val.path" :key="val.path" v-if="val.children && val.children.length > 0">
|
|
4
|
+
<template #title>
|
|
5
|
+
<SvgIcon :name="val.meta.icon" />
|
|
6
|
+
<span>{{ val.meta.title }}</span>
|
|
7
|
+
</template>
|
|
8
|
+
<sub-item :chil="val.children" />
|
|
9
|
+
</el-sub-menu>
|
|
10
|
+
<template v-else>
|
|
11
|
+
<el-menu-item :index="val.path" :key="val.path">
|
|
12
|
+
<template v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
|
13
|
+
<SvgIcon :name="val.meta.icon" />
|
|
14
|
+
<span>{{ val.meta.title }}</span>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<a class="w100" @click.prevent="onALinkClick(val)">
|
|
18
|
+
<SvgIcon :name="val.meta.icon" />
|
|
19
|
+
{{ val.meta.title }}
|
|
20
|
+
</a>
|
|
21
|
+
</template>
|
|
22
|
+
</el-menu-item>
|
|
23
|
+
</template>
|
|
24
|
+
</template>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts" name="navMenuSubItem">
|
|
28
|
+
import { computed } from 'vue';
|
|
29
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
30
|
+
import other from '/@/utils/other';
|
|
31
|
+
|
|
32
|
+
// 定义父组件传过来的值
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
// 菜单列表
|
|
35
|
+
chil: {
|
|
36
|
+
type: Array<RouteRecordRaw>,
|
|
37
|
+
default: () => [],
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 获取父级菜单数据
|
|
42
|
+
const chils = computed(() => {
|
|
43
|
+
return <RouteItems>props.chil;
|
|
44
|
+
});
|
|
45
|
+
// 打开外部链接
|
|
46
|
+
const onALinkClick = (val: RouteItem) => {
|
|
47
|
+
other.handleOpenLink(val);
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-menu
|
|
3
|
+
router
|
|
4
|
+
:default-active="state.defaultActive"
|
|
5
|
+
background-color="transparent"
|
|
6
|
+
:collapse="state.isCollapse"
|
|
7
|
+
:unique-opened="getThemeConfig.isUniqueOpened"
|
|
8
|
+
:collapse-transition="false"
|
|
9
|
+
>
|
|
10
|
+
<template v-for="val in menuLists">
|
|
11
|
+
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
|
12
|
+
<template #title>
|
|
13
|
+
<SvgIcon :name="val.meta.icon" />
|
|
14
|
+
<span>{{ val.meta.title }}</span>
|
|
15
|
+
</template>
|
|
16
|
+
<SubItem :chil="val.children" />
|
|
17
|
+
</el-sub-menu>
|
|
18
|
+
<template v-else>
|
|
19
|
+
<el-menu-item :index="val.path" :key="val.path">
|
|
20
|
+
<SvgIcon :name="val.meta.icon" />
|
|
21
|
+
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
|
22
|
+
<span>{{ val.meta.title }}</span>
|
|
23
|
+
</template>
|
|
24
|
+
<template #title v-else>
|
|
25
|
+
<a class="w100" @click.prevent="onALinkClick(val)">{{ val.meta.title }}</a>
|
|
26
|
+
</template>
|
|
27
|
+
</el-menu-item>
|
|
28
|
+
</template>
|
|
29
|
+
</template>
|
|
30
|
+
</el-menu>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts" name="navMenuVertical">
|
|
34
|
+
import { defineAsyncComponent, reactive, computed, onMounted, watch } from 'vue';
|
|
35
|
+
import { useRoute, onBeforeRouteUpdate, RouteRecordRaw } from 'vue-router';
|
|
36
|
+
import { storeToRefs } from 'pinia';
|
|
37
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
38
|
+
import other from '/@/utils/other';
|
|
39
|
+
|
|
40
|
+
// 引入组件
|
|
41
|
+
const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
|
|
42
|
+
|
|
43
|
+
// 定义父组件传过来的值
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
// 菜单列表
|
|
46
|
+
menuList: {
|
|
47
|
+
type: Array<RouteRecordRaw>,
|
|
48
|
+
default: () => [],
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 定义变量内容
|
|
53
|
+
const storesThemeConfig = useThemeConfig();
|
|
54
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
55
|
+
const route = useRoute();
|
|
56
|
+
const state = reactive({
|
|
57
|
+
defaultActive: route.meta.isDynamic ? route.meta.isDynamicPath : route.path,
|
|
58
|
+
isCollapse: false,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// 获取父级菜单数据
|
|
62
|
+
const menuLists = computed(() => {
|
|
63
|
+
return <RouteItems>props.menuList;
|
|
64
|
+
});
|
|
65
|
+
// 获取布局配置信息
|
|
66
|
+
const getThemeConfig = computed(() => {
|
|
67
|
+
return themeConfig.value;
|
|
68
|
+
});
|
|
69
|
+
// 菜单高亮(详情时,父级高亮)
|
|
70
|
+
const setParentHighlight = (currentRoute: RouteToFrom) => {
|
|
71
|
+
const { path, meta } = currentRoute;
|
|
72
|
+
const pathSplit = meta?.isDynamic ? meta.isDynamicPath!.split('/') : path!.split('/');
|
|
73
|
+
if (pathSplit.length >= 4 && meta?.isHide) return pathSplit.splice(0, 3).join('/');
|
|
74
|
+
else return path;
|
|
75
|
+
};
|
|
76
|
+
// 打开外部链接
|
|
77
|
+
const onALinkClick = (val: RouteItem) => {
|
|
78
|
+
other.handleOpenLink(val);
|
|
79
|
+
};
|
|
80
|
+
// 页面加载时
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
state.defaultActive = setParentHighlight(route);
|
|
83
|
+
});
|
|
84
|
+
// 路由更新时
|
|
85
|
+
onBeforeRouteUpdate((to) => {
|
|
86
|
+
state.defaultActive = setParentHighlight(to);
|
|
87
|
+
const clientWidth = document.body.clientWidth;
|
|
88
|
+
if (clientWidth < 1000) themeConfig.value.isCollapse = false;
|
|
89
|
+
});
|
|
90
|
+
// 设置菜单的收起/展开
|
|
91
|
+
watch(
|
|
92
|
+
() => themeConfig.value.isCollapse,
|
|
93
|
+
(isCollapse) => {
|
|
94
|
+
document.body.clientWidth <= 1000 ? (state.isCollapse = false) : (state.isCollapse = isCollapse);
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
immediate: true,
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
</script>
|