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,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 时间日期转换
|
|
3
|
+
* @param date 当前时间,new Date() 格式
|
|
4
|
+
* @param format 需要转换的时间格式字符串
|
|
5
|
+
* @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd`
|
|
6
|
+
* @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ"
|
|
7
|
+
* @description format 星期:"YYYY-mm-dd HH:MM:SS WWW"
|
|
8
|
+
* @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ"
|
|
9
|
+
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
|
|
10
|
+
* @returns 返回拼接后的时间字符串
|
|
11
|
+
*/
|
|
12
|
+
export function formatDate(date: Date, format: string): string {
|
|
13
|
+
let we = date.getDay(); // 星期
|
|
14
|
+
let z = getWeek(date); // 周
|
|
15
|
+
let qut = Math.floor((date.getMonth() + 3) / 3).toString(); // 季度
|
|
16
|
+
const opt: { [key: string]: string } = {
|
|
17
|
+
'Y+': date.getFullYear().toString(), // 年
|
|
18
|
+
'm+': (date.getMonth() + 1).toString(), // 月(月份从0开始,要+1)
|
|
19
|
+
'd+': date.getDate().toString(), // 日
|
|
20
|
+
'H+': date.getHours().toString(), // 时
|
|
21
|
+
'M+': date.getMinutes().toString(), // 分
|
|
22
|
+
'S+': date.getSeconds().toString(), // 秒
|
|
23
|
+
'q+': qut, // 季度
|
|
24
|
+
};
|
|
25
|
+
// 中文数字 (星期)
|
|
26
|
+
const week: { [key: string]: string } = {
|
|
27
|
+
'0': '日',
|
|
28
|
+
'1': '一',
|
|
29
|
+
'2': '二',
|
|
30
|
+
'3': '三',
|
|
31
|
+
'4': '四',
|
|
32
|
+
'5': '五',
|
|
33
|
+
'6': '六',
|
|
34
|
+
};
|
|
35
|
+
// 中文数字(季度)
|
|
36
|
+
const quarter: { [key: string]: string } = {
|
|
37
|
+
'1': '一',
|
|
38
|
+
'2': '二',
|
|
39
|
+
'3': '三',
|
|
40
|
+
'4': '四',
|
|
41
|
+
};
|
|
42
|
+
if (/(W+)/.test(format))
|
|
43
|
+
format = format.replace(RegExp.$1, RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? '星期' + week[we] : '周' + week[we]) : week[we]);
|
|
44
|
+
if (/(Q+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 4 ? '第' + quarter[qut] + '季度' : quarter[qut]);
|
|
45
|
+
if (/(Z+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 3 ? '第' + z + '周' : z + '');
|
|
46
|
+
for (let k in opt) {
|
|
47
|
+
let r = new RegExp('(' + k + ')').exec(format);
|
|
48
|
+
// 若输入的长度不为1,则前面补零
|
|
49
|
+
if (r) format = format.replace(r[1], RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, '0'));
|
|
50
|
+
}
|
|
51
|
+
return format;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 获取当前日期是第几周
|
|
56
|
+
* @param dateTime 当前传入的日期值
|
|
57
|
+
* @returns 返回第几周数字值
|
|
58
|
+
*/
|
|
59
|
+
export function getWeek(dateTime: Date): number {
|
|
60
|
+
let temptTime = new Date(dateTime.getTime());
|
|
61
|
+
// 周几
|
|
62
|
+
let weekday = temptTime.getDay() || 7;
|
|
63
|
+
// 周1+5天=周六
|
|
64
|
+
temptTime.setDate(temptTime.getDate() - weekday + 1 + 5);
|
|
65
|
+
let firstDay = new Date(temptTime.getFullYear(), 0, 1);
|
|
66
|
+
let dayOfWeek = firstDay.getDay();
|
|
67
|
+
let spendDay = 1;
|
|
68
|
+
if (dayOfWeek != 0) spendDay = 7 - dayOfWeek + 1;
|
|
69
|
+
firstDay = new Date(temptTime.getFullYear(), 0, 1 + spendDay);
|
|
70
|
+
let d = Math.ceil((temptTime.valueOf() - firstDay.valueOf()) / 86400000);
|
|
71
|
+
let result = Math.ceil(d / 7);
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 将时间转换为 `几秒前`、`几分钟前`、`几小时前`、`几天前`
|
|
77
|
+
* @param param 当前时间,new Date() 格式或者字符串时间格式
|
|
78
|
+
* @param format 需要转换的时间格式字符串
|
|
79
|
+
* @description param 10秒: 10 * 1000
|
|
80
|
+
* @description param 1分: 60 * 1000
|
|
81
|
+
* @description param 1小时: 60 * 60 * 1000
|
|
82
|
+
* @description param 24小时:60 * 60 * 24 * 1000
|
|
83
|
+
* @description param 3天: 60 * 60* 24 * 1000 * 3
|
|
84
|
+
* @returns 返回拼接后的时间字符串
|
|
85
|
+
*/
|
|
86
|
+
export function formatPast(param: string | Date, format: string = 'YYYY-mm-dd'): string {
|
|
87
|
+
// 传入格式处理、存储转换值
|
|
88
|
+
let t: any, s: number;
|
|
89
|
+
// 获取js 时间戳
|
|
90
|
+
let time: number = new Date().getTime();
|
|
91
|
+
// 是否是对象
|
|
92
|
+
typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param);
|
|
93
|
+
// 当前时间戳 - 传入时间戳
|
|
94
|
+
time = Number.parseInt(`${time - t}`);
|
|
95
|
+
if (time < 10000) {
|
|
96
|
+
// 10秒内
|
|
97
|
+
return '刚刚';
|
|
98
|
+
} else if (time < 60000 && time >= 10000) {
|
|
99
|
+
// 超过10秒少于1分钟内
|
|
100
|
+
s = Math.floor(time / 1000);
|
|
101
|
+
return `${s}秒前`;
|
|
102
|
+
} else if (time < 3600000 && time >= 60000) {
|
|
103
|
+
// 超过1分钟少于1小时
|
|
104
|
+
s = Math.floor(time / 60000);
|
|
105
|
+
return `${s}分钟前`;
|
|
106
|
+
} else if (time < 86400000 && time >= 3600000) {
|
|
107
|
+
// 超过1小时少于24小时
|
|
108
|
+
s = Math.floor(time / 3600000);
|
|
109
|
+
return `${s}小时前`;
|
|
110
|
+
} else if (time < 259200000 && time >= 86400000) {
|
|
111
|
+
// 超过1天少于3天内
|
|
112
|
+
s = Math.floor(time / 86400000);
|
|
113
|
+
return `${s}天前`;
|
|
114
|
+
} else {
|
|
115
|
+
// 超过3天
|
|
116
|
+
let date = typeof param === 'string' || 'object' ? new Date(param) : param;
|
|
117
|
+
return formatDate(date, format);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 时间问候语
|
|
123
|
+
* @param param 当前时间,new Date() 格式
|
|
124
|
+
* @description param 调用 `formatAxis(new Date())` 输出 `上午好`
|
|
125
|
+
* @returns 返回拼接后的时间字符串
|
|
126
|
+
*/
|
|
127
|
+
export function formatAxis(param: Date): string {
|
|
128
|
+
let hour: number = new Date(param).getHours();
|
|
129
|
+
if (hour < 6) return '凌晨好';
|
|
130
|
+
else if (hour < 9) return '早上好';
|
|
131
|
+
else if (hour < 12) return '上午好';
|
|
132
|
+
else if (hour < 14) return '中午好';
|
|
133
|
+
else if (hour < 17) return '下午好';
|
|
134
|
+
else if (hour < 19) return '傍晚好';
|
|
135
|
+
else if (hour < 22) return '晚上好';
|
|
136
|
+
else return '夜里好';
|
|
137
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import IFormData from '/@/types/form';
|
|
2
|
+
import ICustomData from '/@/types/customData';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
|
|
5
|
+
type Data = Record<string, any>;
|
|
6
|
+
export function getDataType(data: Data) {
|
|
7
|
+
const isObject = (value: Data) => {
|
|
8
|
+
return value !== null && typeof value === 'object' && Array.isArray(value) === false;
|
|
9
|
+
};
|
|
10
|
+
const setDataType = (data: Data) => {
|
|
11
|
+
if (Array.isArray(data)) {
|
|
12
|
+
const arr = [
|
|
13
|
+
...new Set(
|
|
14
|
+
data.map((item) => {
|
|
15
|
+
if (typeof item === 'object') {
|
|
16
|
+
return item;
|
|
17
|
+
} else {
|
|
18
|
+
return typeof item;
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
),
|
|
22
|
+
];
|
|
23
|
+
const hasObj = arr.some((i) => isObject(i));
|
|
24
|
+
if (hasObj) {
|
|
25
|
+
const [arr1] = arr.filter((i) => isObject(i));
|
|
26
|
+
let result = 'Array<{';
|
|
27
|
+
Object.entries(setDataType(arr1)).forEach(([k, v]) => {
|
|
28
|
+
result += `${k}:${JSON.stringify(v)};`;
|
|
29
|
+
});
|
|
30
|
+
result += '}>';
|
|
31
|
+
return result;
|
|
32
|
+
} else {
|
|
33
|
+
return `Array<${arr.join('|')}>`;
|
|
34
|
+
}
|
|
35
|
+
} else if (isObject(data)) {
|
|
36
|
+
const result: Data = {};
|
|
37
|
+
for (const key in data) {
|
|
38
|
+
if (data.hasOwnProperty(key)) {
|
|
39
|
+
result[key] = setDataType(data[key]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
} else {
|
|
44
|
+
return typeof data;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const resultType = JSON.stringify(setDataType(data)).replaceAll(',', ';').replaceAll('"', '').replaceAll('\\', '');
|
|
49
|
+
return 'export interface DATA_TYPE' + resultType;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** form表单类型声明 */
|
|
53
|
+
export function getFormDataType(data: IFormData.Form) {
|
|
54
|
+
const result = _.cloneDeep(data) as IFormData.Form;
|
|
55
|
+
const formType: ICustomData.Data = {};
|
|
56
|
+
result.form.forEach((i) => getFormField(i, i.fieldID));
|
|
57
|
+
setDataType(result.data);
|
|
58
|
+
const formKeys = Object.keys(formType)
|
|
59
|
+
.map((i) => i.split('.')[1])
|
|
60
|
+
.join('|');
|
|
61
|
+
const typeData = JSON.stringify(result.data)
|
|
62
|
+
.replace(new RegExp(formKeys, 'gi'), function ($0) {
|
|
63
|
+
const [key] = Object.keys(result.data)
|
|
64
|
+
.map((i) => formType[`${i}.${$0}`])
|
|
65
|
+
.filter(Boolean);
|
|
66
|
+
return `\n\t${key.label}\n\t${$0}`;
|
|
67
|
+
})
|
|
68
|
+
.replaceAll(',', ';')
|
|
69
|
+
.replaceAll('"', '')
|
|
70
|
+
.replaceAll('\\', '');
|
|
71
|
+
|
|
72
|
+
/** 获取form表单类型声明文件,存储与 【formType】变量中 */
|
|
73
|
+
function getFormField(data: IFormData.Data, fieldID: string) {
|
|
74
|
+
for (let i in data) {
|
|
75
|
+
if (data[i].hasOwnProperty('baseData')) {
|
|
76
|
+
const { baseData } = data[i];
|
|
77
|
+
formType[`${fieldID}.${baseData.prop}`] = {
|
|
78
|
+
type: baseData.complexType ? `${baseData.complexType}<${baseData.baseType}>` : baseData.baseType,
|
|
79
|
+
label: `/** ${baseData.label} */`,
|
|
80
|
+
fieldID,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 递归属性查找
|
|
85
|
+
if (_.isObject(data[i]) && !_.isEmpty(data[i])) {
|
|
86
|
+
getFormField(data[i], fieldID);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** 设置data数据类型 */
|
|
92
|
+
function setDataType(data: ICustomData.Data, pid = '') {
|
|
93
|
+
for (let i in data) {
|
|
94
|
+
if (pid && formType.hasOwnProperty(`${pid}.${i}`)) {
|
|
95
|
+
data[i] = formType[`${pid}.${i}`].type;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 递归属性查找
|
|
99
|
+
if (_.isObject(data[i]) && !_.isEmpty(data[i])) {
|
|
100
|
+
setDataType(data[i], pid ? `${pid}.${i}` : i);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return `export interface ${result.config_name} ${typeData}`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** table表格数据类型声明 */
|
|
109
|
+
|
|
110
|
+
export function getTableDataType(tables: ICustomData.Table[]) {
|
|
111
|
+
const result = _.cloneDeep(tables) as ICustomData.Table[];
|
|
112
|
+
let tableInterface = '';
|
|
113
|
+
|
|
114
|
+
result.forEach((i) => {
|
|
115
|
+
const tableType: ICustomData.Data = {};
|
|
116
|
+
const tableField: ICustomData.Data = {};
|
|
117
|
+
i.tableConfig.forEach((i) => {
|
|
118
|
+
if (!i.data.type) {
|
|
119
|
+
tableField[i.data.field!] = i.data.returnValueType;
|
|
120
|
+
tableType[i.data.field!] = `/** ${i.data.title} */`;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const reg = new RegExp(Object.keys(tableField).join('|'), 'gi');
|
|
124
|
+
const typeData = JSON.stringify(tableField)
|
|
125
|
+
.replace(reg, function ($0) {
|
|
126
|
+
return `\n\t${tableType[$0]}\n\t${$0}`;
|
|
127
|
+
})
|
|
128
|
+
.replaceAll(',', ';')
|
|
129
|
+
.replaceAll('"', '')
|
|
130
|
+
.replaceAll('\\', '');
|
|
131
|
+
|
|
132
|
+
tableInterface += `\n\texport interface ${i.baseData.tableName} ${typeData}\n`;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
console.debug(tableInterface);
|
|
136
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import * as svg from '@element-plus/icons-vue';
|
|
3
|
+
|
|
4
|
+
// 获取阿里字体图标
|
|
5
|
+
const getAlicdnIconfont = () => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
nextTick(() => {
|
|
8
|
+
const styles: any = document.styleSheets;
|
|
9
|
+
let sheetsList = [];
|
|
10
|
+
let sheetsIconList = [];
|
|
11
|
+
for (let i = 0; i < styles.length; i++) {
|
|
12
|
+
if (styles[i].href && styles[i].href.indexOf('at.alicdn.com') > -1) {
|
|
13
|
+
sheetsList.push(styles[i]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
for (let i = 0; i < sheetsList.length; i++) {
|
|
17
|
+
for (let j = 0; j < sheetsList[i].cssRules.length; j++) {
|
|
18
|
+
if (sheetsList[i].cssRules[j].selectorText && sheetsList[i].cssRules[j].selectorText.indexOf('.icon-') > -1) {
|
|
19
|
+
sheetsIconList.push(
|
|
20
|
+
`${sheetsList[i].cssRules[j].selectorText.substring(1, sheetsList[i].cssRules[j].selectorText.length).replace(/\:\:before/gi, '')}`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (sheetsIconList.length > 0) resolve(sheetsIconList);
|
|
26
|
+
else reject('未获取到值,请刷新重试');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// 初始化获取 css 样式,获取 element plus 自带 svg 图标,增加了 ele- 前缀,使用时:ele-Aim
|
|
32
|
+
const getElementPlusIconfont = () => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
nextTick(() => {
|
|
35
|
+
const icons = svg as any;
|
|
36
|
+
const sheetsIconList = [];
|
|
37
|
+
for (const i in icons) {
|
|
38
|
+
sheetsIconList.push(`ele-${icons[i].name}`);
|
|
39
|
+
}
|
|
40
|
+
if (sheetsIconList.length > 0) resolve(sheetsIconList);
|
|
41
|
+
else reject('未获取到值,请刷新重试');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// 初始化获取 css 样式,这里使用 fontawesome 的图标
|
|
47
|
+
const getAwesomeIconfont = () => {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
nextTick(() => {
|
|
50
|
+
const styles: any = document.styleSheets;
|
|
51
|
+
let sheetsList = [];
|
|
52
|
+
let sheetsIconList = [];
|
|
53
|
+
for (let i = 0; i < styles.length; i++) {
|
|
54
|
+
if (styles[i].href && styles[i].href.indexOf('netdna.bootstrapcdn.com') > -1) {
|
|
55
|
+
sheetsList.push(styles[i]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
for (let i = 0; i < sheetsList.length; i++) {
|
|
59
|
+
for (let j = 0; j < sheetsList[i].cssRules.length; j++) {
|
|
60
|
+
if (
|
|
61
|
+
sheetsList[i].cssRules[j].selectorText &&
|
|
62
|
+
sheetsList[i].cssRules[j].selectorText.indexOf('.fa-') === 0 &&
|
|
63
|
+
sheetsList[i].cssRules[j].selectorText.indexOf(',') === -1
|
|
64
|
+
) {
|
|
65
|
+
if (/::before/.test(sheetsList[i].cssRules[j].selectorText)) {
|
|
66
|
+
sheetsIconList.push(
|
|
67
|
+
`${sheetsList[i].cssRules[j].selectorText.substring(1, sheetsList[i].cssRules[j].selectorText.length).replace(/\:\:before/gi, '')}`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (sheetsIconList.length > 0) resolve(sheetsIconList.reverse());
|
|
74
|
+
else reject('未获取到值,请刷新重试');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 获取字体图标 `document.styleSheets`
|
|
81
|
+
* @method ali 获取阿里字体图标 `<i class="iconfont 图标类名"></i>`
|
|
82
|
+
* @method ele 获取 element plus 自带图标 `<i class="图标类名"></i>`
|
|
83
|
+
* @method ali 获取 fontawesome 的图标 `<i class="fa 图标类名"></i>`
|
|
84
|
+
*/
|
|
85
|
+
const initIconfont = {
|
|
86
|
+
// iconfont
|
|
87
|
+
ali: () => {
|
|
88
|
+
return getAlicdnIconfont();
|
|
89
|
+
},
|
|
90
|
+
// element plus
|
|
91
|
+
ele: () => {
|
|
92
|
+
return getElementPlusIconfont();
|
|
93
|
+
},
|
|
94
|
+
// fontawesome
|
|
95
|
+
awe: () => {
|
|
96
|
+
return getAwesomeIconfont();
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 导出方法
|
|
101
|
+
export default initIconfont;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import '/@/theme/loading.scss';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 页面全局 Loading
|
|
6
|
+
* @method start 创建 loading
|
|
7
|
+
* @method done 移除 loading
|
|
8
|
+
*/
|
|
9
|
+
export const NextLoading = {
|
|
10
|
+
// 创建 loading
|
|
11
|
+
start: () => {
|
|
12
|
+
const bodys: Element = document.body;
|
|
13
|
+
const div = <HTMLElement>document.createElement('div');
|
|
14
|
+
div.setAttribute('class', 'loading-next');
|
|
15
|
+
const htmls = `
|
|
16
|
+
<div class="loading-next-box">
|
|
17
|
+
<div class="loading-next-box-warp">
|
|
18
|
+
<div class="loading-next-box-item"></div>
|
|
19
|
+
<div class="loading-next-box-item"></div>
|
|
20
|
+
<div class="loading-next-box-item"></div>
|
|
21
|
+
<div class="loading-next-box-item"></div>
|
|
22
|
+
<div class="loading-next-box-item"></div>
|
|
23
|
+
<div class="loading-next-box-item"></div>
|
|
24
|
+
<div class="loading-next-box-item"></div>
|
|
25
|
+
<div class="loading-next-box-item"></div>
|
|
26
|
+
<div class="loading-next-box-item"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
div.innerHTML = htmls;
|
|
31
|
+
bodys.insertBefore(div, bodys.childNodes[0]);
|
|
32
|
+
window.nextLoading = true;
|
|
33
|
+
},
|
|
34
|
+
// 移除 loading
|
|
35
|
+
done: (time: number = 0) => {
|
|
36
|
+
nextTick(() => {
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
window.nextLoading = false;
|
|
39
|
+
const el = <HTMLElement>document.querySelector('.loading-next');
|
|
40
|
+
el?.parentNode?.removeChild(el);
|
|
41
|
+
}, time);
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { nextTick, defineAsyncComponent } from 'vue';
|
|
2
|
+
import type { App } from 'vue';
|
|
3
|
+
import * as svg from '@element-plus/icons-vue';
|
|
4
|
+
import router from '/@/router/index';
|
|
5
|
+
import pinia from '/@/stores/index';
|
|
6
|
+
import { storeToRefs } from 'pinia';
|
|
7
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
8
|
+
import { systemStore } from '/@/utils/storage';
|
|
9
|
+
import { verifyUrl } from '/@/utils/toolsValidate';
|
|
10
|
+
|
|
11
|
+
// 引入组件
|
|
12
|
+
const SvgIcon = defineAsyncComponent(() => import('/@/components/svgIcon/index.vue'));
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 导出全局注册 element plus svg 图标
|
|
16
|
+
* @param app vue 实例
|
|
17
|
+
* @description 使用:https://element-plus.gitee.io/zh-CN/component/icon.html
|
|
18
|
+
*/
|
|
19
|
+
export function elSvg(app: App) {
|
|
20
|
+
const icons = svg as any;
|
|
21
|
+
for (const i in icons) {
|
|
22
|
+
app.component(`ele-${icons[i].name}`, icons[i]);
|
|
23
|
+
}
|
|
24
|
+
app.component('SvgIcon', SvgIcon);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 设置浏览器标题国际化
|
|
29
|
+
* @method const title = useTitle(); ==> title()
|
|
30
|
+
*/
|
|
31
|
+
export function useTitle() {
|
|
32
|
+
const stores = useThemeConfig(pinia);
|
|
33
|
+
const { themeConfig } = storeToRefs(stores);
|
|
34
|
+
nextTick(() => {
|
|
35
|
+
let webTitle = '';
|
|
36
|
+
let globalTitle: string = themeConfig.value.globalTitle;
|
|
37
|
+
const { path, meta } = router.currentRoute.value;
|
|
38
|
+
if (path === '/login') {
|
|
39
|
+
webTitle = <string>meta.title;
|
|
40
|
+
} else {
|
|
41
|
+
webTitle = setTagsViewNameI18n(router.currentRoute.value);
|
|
42
|
+
}
|
|
43
|
+
document.title = `${webTitle} - ${globalTitle}` || globalTitle;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 设置 自定义 tagsView 名称
|
|
49
|
+
* @param params 路由 query、params 中的 tagsViewName
|
|
50
|
+
* @returns 返回当前 tagsViewName 名称
|
|
51
|
+
*/
|
|
52
|
+
export function setTagsViewNameI18n(item: any) {
|
|
53
|
+
let tagsViewName: string = '';
|
|
54
|
+
const { query, params, meta } = item;
|
|
55
|
+
if (query?.tagsViewName || params?.tagsViewName) {
|
|
56
|
+
// 非国际化
|
|
57
|
+
tagsViewName = query?.tagsViewName || params?.tagsViewName;
|
|
58
|
+
} else {
|
|
59
|
+
// 非自定义 tagsView 名称
|
|
60
|
+
tagsViewName = meta.title;
|
|
61
|
+
}
|
|
62
|
+
return tagsViewName;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 图片懒加载
|
|
67
|
+
* @param el dom 目标元素
|
|
68
|
+
* @param arr 列表数据
|
|
69
|
+
* @description data-xxx 属性用于存储页面或应用程序的私有自定义数据
|
|
70
|
+
*/
|
|
71
|
+
export const lazyImg = (el: string, arr: EmptyArrayType) => {
|
|
72
|
+
const io = new IntersectionObserver((res) => {
|
|
73
|
+
res.forEach((v: any) => {
|
|
74
|
+
if (v.isIntersecting) {
|
|
75
|
+
const { img, key } = v.target.dataset;
|
|
76
|
+
v.target.src = img;
|
|
77
|
+
v.target.onload = () => {
|
|
78
|
+
io.unobserve(v.target);
|
|
79
|
+
arr[key]['loading'] = false;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
nextTick(() => {
|
|
85
|
+
document.querySelectorAll(el).forEach((img) => io.observe(img));
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 全局组件大小
|
|
91
|
+
* @returns 返回 `window.localStorage` 中读取的缓存值 `globalComponentSize`
|
|
92
|
+
*/
|
|
93
|
+
let themeConfigStore: any;
|
|
94
|
+
(async () => {
|
|
95
|
+
themeConfigStore = await systemStore.get('themeConfig');
|
|
96
|
+
})();
|
|
97
|
+
export const globalComponentSize = (): string => {
|
|
98
|
+
const stores = useThemeConfig(pinia);
|
|
99
|
+
const { themeConfig } = storeToRefs(stores);
|
|
100
|
+
return themeConfigStore?.globalComponentSize || themeConfig.value?.globalComponentSize;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 对象深克隆
|
|
105
|
+
* @param obj 源对象
|
|
106
|
+
* @returns 克隆后的对象
|
|
107
|
+
*/
|
|
108
|
+
export function deepClone(obj: EmptyObjectType) {
|
|
109
|
+
let newObj: EmptyObjectType;
|
|
110
|
+
try {
|
|
111
|
+
newObj = obj.push ? [] : {};
|
|
112
|
+
} catch (error) {
|
|
113
|
+
newObj = {};
|
|
114
|
+
}
|
|
115
|
+
for (let attr in obj) {
|
|
116
|
+
if (obj[attr] && typeof obj[attr] === 'object') {
|
|
117
|
+
newObj[attr] = deepClone(obj[attr]);
|
|
118
|
+
} else {
|
|
119
|
+
newObj[attr] = obj[attr];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return newObj;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* 判断是否是移动端
|
|
127
|
+
*/
|
|
128
|
+
export function isMobile() {
|
|
129
|
+
if (
|
|
130
|
+
navigator.userAgent.match(
|
|
131
|
+
/('phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone')/i
|
|
132
|
+
)
|
|
133
|
+
) {
|
|
134
|
+
return true;
|
|
135
|
+
} else {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 判断数组对象中所有属性是否为空,为空则删除当前行对象
|
|
142
|
+
* @description @感谢大黄
|
|
143
|
+
* @param list 数组对象
|
|
144
|
+
* @returns 删除空值后的数组对象
|
|
145
|
+
*/
|
|
146
|
+
export function handleEmpty(list: EmptyArrayType) {
|
|
147
|
+
const arr = [];
|
|
148
|
+
for (const i in list) {
|
|
149
|
+
const d = [];
|
|
150
|
+
for (const j in list[i]) {
|
|
151
|
+
d.push(list[i][j]);
|
|
152
|
+
}
|
|
153
|
+
const leng = d.filter((item) => item === '').length;
|
|
154
|
+
if (leng !== d.length) {
|
|
155
|
+
arr.push(list[i]);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return arr;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 打开外部链接
|
|
163
|
+
* @param val 当前点击项菜单
|
|
164
|
+
*/
|
|
165
|
+
export function handleOpenLink(val: RouteItem) {
|
|
166
|
+
const { origin, pathname } = window.location;
|
|
167
|
+
router.push(val.path);
|
|
168
|
+
if (verifyUrl(<string>val.meta?.isLink)) window.open(val.meta?.isLink);
|
|
169
|
+
else window.open(`${origin}${pathname}#${val.meta?.isLink}`);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 统一批量导出
|
|
174
|
+
* @method elSvg 导出全局注册 element plus svg 图标
|
|
175
|
+
* @method useTitle 设置浏览器标题国际化
|
|
176
|
+
* @method setTagsViewNameI18n 设置 自定义 tagsView 名称、 自定义 tagsView 名称国际化
|
|
177
|
+
* @method lazyImg 图片懒加载
|
|
178
|
+
* @method globalComponentSize() element plus 全局组件大小
|
|
179
|
+
* @method deepClone 对象深克隆
|
|
180
|
+
* @method isMobile 判断是否是移动端
|
|
181
|
+
* @method handleEmpty 判断数组对象中所有属性是否为空,为空则删除当前行对象
|
|
182
|
+
*/
|
|
183
|
+
const other = {
|
|
184
|
+
elSvg: (app: App) => {
|
|
185
|
+
elSvg(app);
|
|
186
|
+
},
|
|
187
|
+
useTitle: () => {
|
|
188
|
+
useTitle();
|
|
189
|
+
},
|
|
190
|
+
setTagsViewNameI18n(route: RouteToFrom) {
|
|
191
|
+
return setTagsViewNameI18n(route);
|
|
192
|
+
},
|
|
193
|
+
lazyImg: (el: string, arr: EmptyArrayType) => {
|
|
194
|
+
lazyImg(el, arr);
|
|
195
|
+
},
|
|
196
|
+
globalComponentSize: () => {
|
|
197
|
+
return globalComponentSize();
|
|
198
|
+
},
|
|
199
|
+
deepClone: (obj: EmptyObjectType) => {
|
|
200
|
+
return deepClone(obj);
|
|
201
|
+
},
|
|
202
|
+
isMobile: () => {
|
|
203
|
+
return isMobile();
|
|
204
|
+
},
|
|
205
|
+
handleEmpty: (list: EmptyArrayType) => {
|
|
206
|
+
return handleEmpty(list);
|
|
207
|
+
},
|
|
208
|
+
handleOpenLink: (val: RouteItem) => {
|
|
209
|
+
handleOpenLink(val);
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// 统一批量导出
|
|
214
|
+
export default other;
|