hs-admin-ui 1.0.5 → 1.0.8
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/_metadata.json +8 -0
- package/.vite/deps/package.json +3 -0
- package/.vscode/extensions.json +7 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +41 -0
- package/CHANGELOG.md +1 -0
- package/directoryList.md +180 -0
- package/index.html +31 -0
- package/package.json +14 -8
- package/postcss.config.js +7 -0
- package/src/App.vue +88 -0
- package/src/api/businessController/index.ts +46 -0
- package/src/api/businessController/type.ts +24 -0
- package/src/api/fieldConfigController/index.ts +260 -0
- package/src/api/fieldConfigController/type.ts +224 -0
- package/src/api/index.ts +14 -0
- package/src/api/login/index.ts +78 -0
- package/src/api/loginController/index.ts +74 -0
- package/src/api/loginController/type.ts +1 -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/menuController/type.ts +21 -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 +32 -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 +46 -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 +29 -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 +51 -0
- package/src/components/business/bcAutoComplete/defaultData.ts +31 -0
- package/src/components/business/bcAutoComplete/useAutoComplete.ts +73 -0
- package/src/components/business/bcBtn/bcBtn.vue +38 -0
- package/src/components/business/bcForm/bcForm.vue +107 -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 +120 -0
- package/src/components/business/bcFormTable/utils/onTableKey.ts +120 -0
- package/src/components/business/bcFormTable/utils/parseTable.ts +209 -0
- package/src/components/business/bcFormTable/utils/useButon.ts +19 -0
- package/src/components/business/bcFormTable/utils/useTableHeight.ts +44 -0
- package/src/components/business/bcIcon/bcIcon.vue +11 -0
- package/src/components/business/bcPageConfig/bcPageConfig.vue +91 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsAttrBtn.vue +39 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnConfigList.vue +52 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnItemConfig.vue +67 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnPanel.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useAttrBtn.ts +73 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnConfigList.ts +67 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnItemConfig.ts +39 -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 +64 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfigList.vue +52 -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 +153 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormListConfig.ts +69 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormParse.ts +152 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/src/saveForm.vue +53 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/useSaveForm.ts +157 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsAttrTable.vue +124 -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 +53 -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 +257 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableConfigList.ts +76 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableParse.ts +92 -0
- package/src/components/business/bcPageConfig/default/apis.json +24717 -0
- package/src/components/business/bcPageConfig/default/baseBtnConfig.ts +248 -0
- package/src/components/business/bcPageConfig/default/baseFormConfig.ts +396 -0
- package/src/components/business/bcPageConfig/default/baseTableConfig.ts +2387 -0
- package/src/components/business/bcPageConfig/usePageConfig.ts +547 -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 +73 -0
- package/src/components/business/bcTable/bcTable.vue +65 -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 +50 -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 +190 -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/index.ts +2 -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 +68 -0
- package/src/plugins/index.ts +4 -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 +46 -0
- package/src/types/axios.d.ts +13 -0
- package/src/types/components.d.ts +30 -0
- package/src/types/customData.d.ts +171 -0
- package/src/types/form.d.ts +76 -0
- package/src/types/formItem/autocomplete.d.ts +43 -0
- package/src/types/formItem/button.d.ts +39 -0
- package/src/types/formItem/index.ts +6 -0
- package/src/types/formItem/input.d.ts +66 -0
- package/src/types/formItem/inputNumber.d.ts +42 -0
- package/src/types/formItem/selelct.d.ts +54 -0
- package/src/types/formItem/treeSelect.d.ts +37 -0
- package/src/types/formTable.d.ts +207 -0
- package/src/types/global.d.ts +118 -0
- package/src/types/index.ts +6 -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/system.ts +14 -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 +135 -0
- package/src/utils/getStyleSheets.ts +101 -0
- package/src/utils/index.ts +16 -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/config/index.vue +7 -0
- package/src/views/config/page/components/hsPageTree/configData.ts +3700 -0
- package/src/views/config/page/components/hsPageTree/src/hsPageTree.vue +30 -0
- package/src/views/config/page/components/hsPageTree/usePageTree.ts +49 -0
- package/src/views/config/page/index.vue +32 -0
- package/src/views/config/page/menuType.ts +10 -0
- package/src/views/config/page/usePage.ts +120 -0
- package/src/views/error/401.vue +88 -0
- package/src/views/error/404.vue +89 -0
- package/src/views/home/index.vue +63 -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 +67 -0
- package/src/views/system/auth/useAuth.ts +72 -0
- package/src/views/system/auth/utils.ts +25 -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/formSetting/components/hsBtn/src/hsAttrBtn.vue +39 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnConfigList.vue +52 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnItemConfig.vue +67 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnPanel.vue +45 -0
- package/src/views/system/formSetting/components/hsBtn/useAttrBtn.ts +73 -0
- package/src/views/system/formSetting/components/hsBtn/useBtnConfigList.ts +67 -0
- package/src/views/system/formSetting/components/hsBtn/useBtnItemConfig.ts +39 -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/contextmenu.vue +144 -0
- package/src/views/system/formSetting/components/hsForm/src/hsAttrForm.vue +100 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfigList.vue +70 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormPanel.vue +155 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormParse.vue +33 -0
- package/src/views/system/formSetting/components/hsForm/useAttrForm.ts +135 -0
- package/src/views/system/formSetting/components/hsForm/useFormListConfig.ts +89 -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 +98 -0
- package/src/views/system/formSetting/components/hsSaveForm/src/saveForm.vue +52 -0
- package/src/views/system/formSetting/components/hsSaveForm/useSaveForm.ts +190 -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 +248 -0
- package/src/views/system/formSetting/default/baseFormConfig.ts +567 -0
- package/src/views/system/formSetting/default/baseTableConfig.ts +2352 -0
- package/src/views/system/formSetting/formConfig.vue +120 -0
- package/src/views/system/formSetting/index.vue +43 -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 +136 -0
- package/src/views/system/formSetting/useFormConfig.ts +324 -0
- package/src/views/system/menu/dialog.vue +285 -0
- package/src/views/system/menu/index.vue +180 -0
- package/src/views/system/role/dialog.vue +236 -0
- package/src/views/system/role/index.vue +146 -0
- package/src/views/system/user/dialog.vue +187 -0
- package/src/views/system/user/index.vue +161 -0
- package/src/views/test/form/data.json +360 -0
- package/src/views/test/form/index.vue +24 -0
- package/src/views/test/table/data.json +747 -0
- package/src/views/test/table/formate.js +49 -0
- package/src/views/test/table/index.vue +53 -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 +130 -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 +151 -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 +69 -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 +121 -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 +55 -0
- package/src/views/test/test/components/hsTables/src/hsTableParse.vue +29 -0
- package/src/views/test/test/components/hsTables/useAttrTable.ts +124 -0
- package/src/views/test/test/components/hsTables/useTableConfigList.ts +76 -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 +566 -0
- package/src/views/test/test/default/baseTableConfig.ts +2352 -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 +108 -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 +121 -0
- package/dist/style.css +0 -1
- package/dist/style.css.gz +0 -0
- package/dist/umd/index.js +0 -229
- package/dist/umd/index.js.gz +0 -0
- /package/{dist → public}/favicon.ico +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- {{ menuData }} -->
|
|
3
|
+
<hs-tree :data="menuData" :props="defaultProps" highlight-current :show-checkbox="showCheckbox" @node-click="handleNodeClick" />
|
|
4
|
+
<el-button @click="demoMenu">使用模拟菜单</el-button>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { usePageTree } from '../usePageTree';
|
|
9
|
+
type Menu = Record<'value' | 'label' | 'name', string>;
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
// 点击节点的时候是否只触发子节点
|
|
12
|
+
onlyChild: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: true,
|
|
15
|
+
},
|
|
16
|
+
// 是否显示复选框
|
|
17
|
+
showCheckbox: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
menu: {
|
|
22
|
+
type: Array<Menu>,
|
|
23
|
+
default: () => [],
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const emits = defineEmits(['change']);
|
|
28
|
+
const { handleNodeClick, demoMenu, menuData, defaultProps } = usePageTree(emits, props);
|
|
29
|
+
</script>
|
|
30
|
+
../../usePageTree
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// 树结构接口
|
|
2
|
+
import { ref, watch } from 'vue';
|
|
3
|
+
import { PageData } from './configData';
|
|
4
|
+
import { ComponentAttr } from '/@/types';
|
|
5
|
+
import hsPageTree from './src/hsPageTree.vue';
|
|
6
|
+
import { MenuType } from '../../menuType';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
|
|
9
|
+
export function usePageTree(emits: (event: 'change', ...args: any[]) => void, props: ComponentAttr.Props<typeof hsPageTree>) {
|
|
10
|
+
/**
|
|
11
|
+
* 节点点击回调
|
|
12
|
+
* @param data
|
|
13
|
+
*/
|
|
14
|
+
const handleNodeClick = (data: MenuType) => {
|
|
15
|
+
if (props.onlyChild) {
|
|
16
|
+
// 只处理最终子节点
|
|
17
|
+
if (!data.children || (data.children && data.children.length <= 0)) {
|
|
18
|
+
emits('change', data);
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
// 处理每个节点
|
|
22
|
+
emits('change', data);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
// 树结构数据
|
|
26
|
+
const menuData = ref<MenuType[]>([]);
|
|
27
|
+
watch(
|
|
28
|
+
() => props.menu,
|
|
29
|
+
(value) => {
|
|
30
|
+
menuData.value = _.cloneDeep(value);
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
deep: true,
|
|
34
|
+
immediate: true,
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
// 树结构绑定字段
|
|
38
|
+
const defaultProps = {
|
|
39
|
+
children: 'children',
|
|
40
|
+
label: 'label',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 使用模拟菜单
|
|
44
|
+
*/
|
|
45
|
+
const demoMenu = () => {
|
|
46
|
+
menuData.value = PageData;
|
|
47
|
+
};
|
|
48
|
+
return { handleNodeClick, demoMenu, menuData, defaultProps };
|
|
49
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="system-dept-container layout-padding">
|
|
3
|
+
<el-card shadow="hover" class="layout-padding-auto">
|
|
4
|
+
<div class="bg-blue-300 py-5 w-1/5">
|
|
5
|
+
<!-- 切换系统选择器 -->
|
|
6
|
+
<bc-switch-systems @change="onChangeSystem"></bc-switch-systems>
|
|
7
|
+
<!-- 页面管理 -->
|
|
8
|
+
<component :is="hsPageTree" :menu="menuData" @change="changeNode"></component>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="flex-1" v-show="currentPage">
|
|
11
|
+
<bc-page-config @refresh="refreshConfig" ref="formTableRef" :configs="configs"></bc-page-config>
|
|
12
|
+
</div>
|
|
13
|
+
</el-card>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts" name="systemPage">
|
|
18
|
+
import { ref } from 'vue';
|
|
19
|
+
import hsPageTree from './components/hsPageTree/src/hsPageTree.vue';
|
|
20
|
+
import { useHsPage } from './usePage';
|
|
21
|
+
const formTableRef = ref();
|
|
22
|
+
|
|
23
|
+
const { changeNode, onChangeSystem, currentPage, configs, menuData, refreshConfig } = useHsPage(formTableRef);
|
|
24
|
+
</script>
|
|
25
|
+
<style scoped lang="scss">
|
|
26
|
+
.layout-padding-auto {
|
|
27
|
+
:deep(.el-card__body) {
|
|
28
|
+
height: 100% !important;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ref, Ref } from 'vue';
|
|
2
|
+
import { IFormTable } from '/@/types';
|
|
3
|
+
import { MenuType } from './menuType';
|
|
4
|
+
import { useMenuController } from '/@/api/menuController';
|
|
5
|
+
import { GetMenuList, MenuChild } from '/@/api/menuController/type';
|
|
6
|
+
const menu = useMenuController();
|
|
7
|
+
import { useFieldConfigController } from '/@/api/fieldConfigController';
|
|
8
|
+
import { GetTableByMenu } from '/@/api/fieldConfigController/type';
|
|
9
|
+
const fieldConfig = useFieldConfigController();
|
|
10
|
+
import _ from 'lodash';
|
|
11
|
+
|
|
12
|
+
interface FormRef {
|
|
13
|
+
initData: (configs: IFormTable.Data, menu: Record<string, IFormTable.Data | string>, system: Record<string, IFormTable.Data | string>) => {};
|
|
14
|
+
}
|
|
15
|
+
export function useHsPage(formTableRef: Ref<FormRef>) {
|
|
16
|
+
// 页面中的所有配置数据
|
|
17
|
+
const configs = ref({});
|
|
18
|
+
// 配置数据 <Record<'project_code', string>>
|
|
19
|
+
let sysData = ref();
|
|
20
|
+
// 当前页面
|
|
21
|
+
let currentPage = ref<string>('');
|
|
22
|
+
type Option = Record<'value' | 'label' | 'project_code', string>;
|
|
23
|
+
|
|
24
|
+
const menuData = ref<MenuChild[]>([]);
|
|
25
|
+
/**
|
|
26
|
+
* 格式化菜单数据【给每个菜单都追加label、value值】
|
|
27
|
+
* @param data
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
const formatMenuData = (data: MenuChild[]) => {
|
|
31
|
+
return data.map((item: MenuChild) => {
|
|
32
|
+
let obj = _.assign(item, {
|
|
33
|
+
label: item.meta.title,
|
|
34
|
+
value: item.name,
|
|
35
|
+
});
|
|
36
|
+
// 格式化children中的菜单数据
|
|
37
|
+
if (obj.children && obj.children.length > 0) {
|
|
38
|
+
// 递归格式化方法
|
|
39
|
+
obj.children = formatMenuData(obj.children || []);
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* 获取菜单数据【树结构】
|
|
46
|
+
* @param data
|
|
47
|
+
*/
|
|
48
|
+
const getMenuData = (systemData: Option) => {
|
|
49
|
+
menu
|
|
50
|
+
.getMenuList<GetMenuList>({ project_code: systemData.project_code })
|
|
51
|
+
.then((res) => {
|
|
52
|
+
if (res.code != 1) return;
|
|
53
|
+
// 整理返回的菜单数据
|
|
54
|
+
menuData.value = formatMenuData(res.data || []);
|
|
55
|
+
})
|
|
56
|
+
.catch((err) => {
|
|
57
|
+
console.log('err', err);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
let menuItemData = ref();
|
|
61
|
+
/**
|
|
62
|
+
* 切换node节点
|
|
63
|
+
* @param data
|
|
64
|
+
*/
|
|
65
|
+
const changeNode = (data: MenuType) => {
|
|
66
|
+
menuItemData.value = data; // 菜单
|
|
67
|
+
currentPage.value = data.value;
|
|
68
|
+
// 调接口查询
|
|
69
|
+
fieldConfig
|
|
70
|
+
.getTableByMenu<GetTableByMenu>({ menu_id: data.id, project_code: sysData.value.project_code })
|
|
71
|
+
.then((res) => {
|
|
72
|
+
if (res.code != 1) return;
|
|
73
|
+
// 调用接口查询
|
|
74
|
+
|
|
75
|
+
configs.value = res.data.map((item) => {
|
|
76
|
+
let obj = _.assign(JSON.parse(item.business_json), {
|
|
77
|
+
id: item.id,
|
|
78
|
+
update_time: item.update_time,
|
|
79
|
+
});
|
|
80
|
+
return obj;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// 根据返回的数据响应右侧配置
|
|
84
|
+
if (formTableRef.value) {
|
|
85
|
+
// 参数1: 配置数组 页面配置数据 系统配置数据
|
|
86
|
+
formTableRef.value.initData(configs.value, data, sysData.value);
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
.catch((err) => {
|
|
90
|
+
console.log('err', err);
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* 切换系统回调方法
|
|
95
|
+
* @param system
|
|
96
|
+
*/
|
|
97
|
+
const onChangeSystem = (system: Record<string, string>) => {
|
|
98
|
+
sysData.value = system;
|
|
99
|
+
// 清空配置数据
|
|
100
|
+
configs.value = {};
|
|
101
|
+
// 清空页面数据
|
|
102
|
+
currentPage.value = '';
|
|
103
|
+
// 获取菜单数据
|
|
104
|
+
getMenuData(system);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* 配置页面刷新配置
|
|
108
|
+
*/
|
|
109
|
+
const refreshConfig = () => {
|
|
110
|
+
changeNode(menuItemData.value);
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
changeNode,
|
|
114
|
+
onChangeSystem,
|
|
115
|
+
currentPage,
|
|
116
|
+
configs,
|
|
117
|
+
menuData,
|
|
118
|
+
refreshConfig,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="error layout-padding">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="error-flex">
|
|
5
|
+
<div class="left">
|
|
6
|
+
<div class="left-item">
|
|
7
|
+
<div class="left-item-animation left-item-num">401</div>
|
|
8
|
+
<div class="left-item-animation left-item-title">您未被授权,没有操作权限~</div>
|
|
9
|
+
<div class="left-item-animation left-item-msg">联系方式:加QQ群探讨 665452019</div>
|
|
10
|
+
<div class="left-item-animation left-item-btn">
|
|
11
|
+
<el-button type="primary" size="default" round @click="onSetAuth">重新授权</el-button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="right">
|
|
16
|
+
<img src="https://i.hd-r.cn/2cf0d2e192660eec23eb9d0655753e7d.png" />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts" name="noPower">
|
|
24
|
+
import { Session } from '/@/utils/storage';
|
|
25
|
+
|
|
26
|
+
const onSetAuth = () => {
|
|
27
|
+
// 清除缓存/token等
|
|
28
|
+
Session.clear();
|
|
29
|
+
// 使用 reload 时,不需要调用 resetRoute() 重置路由
|
|
30
|
+
window.location.reload();
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style scoped lang="scss">
|
|
35
|
+
.error {
|
|
36
|
+
height: 100%;
|
|
37
|
+
.error-flex {
|
|
38
|
+
margin: auto;
|
|
39
|
+
display: flex;
|
|
40
|
+
height: 350px;
|
|
41
|
+
width: 900px;
|
|
42
|
+
.left {
|
|
43
|
+
flex: 1;
|
|
44
|
+
height: 100%;
|
|
45
|
+
align-items: center;
|
|
46
|
+
display: flex;
|
|
47
|
+
.left-item {
|
|
48
|
+
.left-item-animation {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
animation-name: error-num;
|
|
51
|
+
animation-duration: 0.5s;
|
|
52
|
+
animation-fill-mode: forwards;
|
|
53
|
+
}
|
|
54
|
+
.left-item-num {
|
|
55
|
+
color: var(--el-color-info);
|
|
56
|
+
font-size: 55px;
|
|
57
|
+
}
|
|
58
|
+
.left-item-title {
|
|
59
|
+
font-size: 20px;
|
|
60
|
+
color: var(--el-text-color-primary);
|
|
61
|
+
margin: 15px 0 5px 0;
|
|
62
|
+
animation-delay: 0.1s;
|
|
63
|
+
}
|
|
64
|
+
.left-item-msg {
|
|
65
|
+
color: var(--el-text-color-secondary);
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
animation-delay: 0.2s;
|
|
69
|
+
}
|
|
70
|
+
.left-item-btn {
|
|
71
|
+
animation-delay: 0.2s;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.right {
|
|
76
|
+
flex: 1;
|
|
77
|
+
opacity: 0;
|
|
78
|
+
animation-name: error-img;
|
|
79
|
+
animation-duration: 2s;
|
|
80
|
+
animation-fill-mode: forwards;
|
|
81
|
+
img {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="error layout-padding">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="error-flex">
|
|
5
|
+
<div class="left">
|
|
6
|
+
<div class="left-item">
|
|
7
|
+
<div class="left-item-animation left-item-num">404</div>
|
|
8
|
+
<div class="left-item-animation left-item-title">页面不存在</div>
|
|
9
|
+
<div class="left-item-animation left-item-msg">您可以先检查网址,然后重新输入或给我们反馈问题。</div>
|
|
10
|
+
<div class="left-item-animation left-item-btn">
|
|
11
|
+
<el-button type="primary" size="default" round @click="onGoHome">返回首页</el-button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="right">
|
|
16
|
+
<img :src="error404" />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts" name="notFound">
|
|
24
|
+
import { useRouter } from 'vue-router';
|
|
25
|
+
import error404 from '/@/assets/404.png';
|
|
26
|
+
// 定义变量内容
|
|
27
|
+
const router = useRouter();
|
|
28
|
+
|
|
29
|
+
// 返回首页
|
|
30
|
+
const onGoHome = () => {
|
|
31
|
+
router.push('/');
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style scoped lang="scss">
|
|
36
|
+
.error {
|
|
37
|
+
height: 100%;
|
|
38
|
+
.error-flex {
|
|
39
|
+
margin: auto;
|
|
40
|
+
display: flex;
|
|
41
|
+
height: 350px;
|
|
42
|
+
width: 900px;
|
|
43
|
+
.left {
|
|
44
|
+
flex: 1;
|
|
45
|
+
height: 100%;
|
|
46
|
+
align-items: center;
|
|
47
|
+
display: flex;
|
|
48
|
+
.left-item {
|
|
49
|
+
.left-item-animation {
|
|
50
|
+
opacity: 0;
|
|
51
|
+
animation-name: error-num;
|
|
52
|
+
animation-duration: 0.5s;
|
|
53
|
+
animation-fill-mode: forwards;
|
|
54
|
+
}
|
|
55
|
+
.left-item-num {
|
|
56
|
+
color: var(--el-color-info);
|
|
57
|
+
font-size: 55px;
|
|
58
|
+
}
|
|
59
|
+
.left-item-title {
|
|
60
|
+
font-size: 20px;
|
|
61
|
+
color: var(--el-text-color-primary);
|
|
62
|
+
margin: 15px 0 5px 0;
|
|
63
|
+
animation-delay: 0.1s;
|
|
64
|
+
}
|
|
65
|
+
.left-item-msg {
|
|
66
|
+
color: var(--el-text-color-secondary);
|
|
67
|
+
font-size: 12px;
|
|
68
|
+
margin-bottom: 30px;
|
|
69
|
+
animation-delay: 0.2s;
|
|
70
|
+
}
|
|
71
|
+
.left-item-btn {
|
|
72
|
+
animation-delay: 0.2s;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.right {
|
|
77
|
+
flex: 1;
|
|
78
|
+
opacity: 0;
|
|
79
|
+
animation-name: error-img;
|
|
80
|
+
animation-duration: 2s;
|
|
81
|
+
animation-fill-mode: forwards;
|
|
82
|
+
img {
|
|
83
|
+
width: 100%;
|
|
84
|
+
height: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<hs-bc-table @row-click="onRowClick" @cell-contextmenu="onCellContextmenu">
|
|
4
|
+
<template v-slot:[state.info]="{ row, column, rowIndex, columnIndex }">
|
|
5
|
+
<span>自定义插槽</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-slot:[state.name]="{ row, column, rowIndex, columnIndex }">
|
|
8
|
+
<!-- <el-button>{{ column }}</el-button> -->
|
|
9
|
+
</template>
|
|
10
|
+
</hs-bc-table>
|
|
11
|
+
<!-- <hs-test @row-click="onRowClick" @cell-contextmenu="onCellContextmenu"></hs-test> -->
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script setup lang="ts" name="home">
|
|
15
|
+
import { reactive, onMounted, ref, watch, nextTick, onActivated } from 'vue';
|
|
16
|
+
import { storeToRefs } from 'pinia';
|
|
17
|
+
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
18
|
+
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
|
|
19
|
+
import { column } from 'element-plus/es/components/table-v2/src/common';
|
|
20
|
+
|
|
21
|
+
// 定义变量内容
|
|
22
|
+
const homeLineRef = ref();
|
|
23
|
+
const homePieRef = ref();
|
|
24
|
+
const homeBarRef = ref();
|
|
25
|
+
const storesTagsViewRoutes = useTagsViewRoutes();
|
|
26
|
+
const storesThemeConfig = useThemeConfig();
|
|
27
|
+
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
28
|
+
const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes);
|
|
29
|
+
|
|
30
|
+
const state = reactive({
|
|
31
|
+
info: 'info',
|
|
32
|
+
name: 'name',
|
|
33
|
+
});
|
|
34
|
+
// 页面加载时
|
|
35
|
+
onMounted(() => {});
|
|
36
|
+
// 由于页面缓存原因,keep-alive
|
|
37
|
+
onActivated(() => {});
|
|
38
|
+
// 单元格点击事件
|
|
39
|
+
const onRowClick = (row: Element, column: Element, event: Element) => {
|
|
40
|
+
console.debug('父页面获取子组件事件:', 'row', row, 'column:', column, 'event:', event);
|
|
41
|
+
};
|
|
42
|
+
const onCellContextmenu = (row: Element, column: Element, cell: Element, event: Element) => {
|
|
43
|
+
console.debug('鼠标右键:', 'row', row, 'column:', column, 'cell:', cell, 'event:', event);
|
|
44
|
+
};
|
|
45
|
+
// 监听 pinia 中的 tagsview 开启全屏变化,重新 resize 图表,防止不出现/大小不变等
|
|
46
|
+
watch(
|
|
47
|
+
() => isTagsViewCurrenFull.value,
|
|
48
|
+
() => {}
|
|
49
|
+
);
|
|
50
|
+
// 监听 pinia 中是否开启深色主题
|
|
51
|
+
watch(
|
|
52
|
+
() => themeConfig.value.isIsDark,
|
|
53
|
+
(isIsDark) => {
|
|
54
|
+
nextTick(() => {});
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
deep: true,
|
|
58
|
+
immediate: true,
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
</script>
|
|
62
|
+
<style scoped lang="scss"></style>
|
|
63
|
+
../../api/index2
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form size="large" class="login-content-form">
|
|
3
|
+
<el-form-item class="login-animation1">
|
|
4
|
+
<el-input text placeholder="用户名 admin 或不输均为 common" v-model="state.ruleForm.userName" clearable autocomplete="off">
|
|
5
|
+
<template #prefix>
|
|
6
|
+
<el-icon class="el-input__icon"><ele-User /></el-icon>
|
|
7
|
+
</template>
|
|
8
|
+
</el-input>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<el-form-item class="login-animation2">
|
|
11
|
+
<el-input :type="state.isShowPassword ? 'text' : 'password'" placeholder="密码:123456" v-model="state.ruleForm.password" autocomplete="off">
|
|
12
|
+
<template #prefix>
|
|
13
|
+
<el-icon class="el-input__icon"><ele-Unlock /></el-icon>
|
|
14
|
+
</template>
|
|
15
|
+
<template #suffix>
|
|
16
|
+
<i
|
|
17
|
+
class="iconfont el-input__icon login-content-password"
|
|
18
|
+
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
|
|
19
|
+
@click="state.isShowPassword = !state.isShowPassword"
|
|
20
|
+
>
|
|
21
|
+
</i>
|
|
22
|
+
</template>
|
|
23
|
+
</el-input>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item class="login-animation3">
|
|
26
|
+
<el-col :span="15">
|
|
27
|
+
<el-input text maxlength="4" placeholder="请输入验证码" v-model="state.ruleForm.code" clearable autocomplete="off" @keydown.enter="onSignIn">
|
|
28
|
+
<template #prefix>
|
|
29
|
+
<el-icon class="el-input__icon"><ele-Position /></el-icon>
|
|
30
|
+
</template>
|
|
31
|
+
</el-input>
|
|
32
|
+
</el-col>
|
|
33
|
+
<el-col :span="1"></el-col>
|
|
34
|
+
<el-col :span="8">
|
|
35
|
+
<!-- <el-text class="login-content-code">1234</el-text> -->
|
|
36
|
+
<img
|
|
37
|
+
:src="srcCod"
|
|
38
|
+
alt="加载失败"
|
|
39
|
+
style="width: 130px; height: 30px; position: relative; bottom: 0px"
|
|
40
|
+
@click="srcCodFn"
|
|
41
|
+
class="cursor-pointer"
|
|
42
|
+
/>
|
|
43
|
+
</el-col>
|
|
44
|
+
</el-form-item>
|
|
45
|
+
<el-form-item class="login-animation4">
|
|
46
|
+
<el-button type="primary" class="login-content-submit" round @click="onSignIn" :loading="state.loading.signIn">
|
|
47
|
+
<span>登 录</span>
|
|
48
|
+
</el-button>
|
|
49
|
+
</el-form-item>
|
|
50
|
+
</el-form>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup lang="ts" name="loginAccount">
|
|
54
|
+
import { reactive, computed, ref } from 'vue';
|
|
55
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
56
|
+
import { ElMessage } from 'element-plus';
|
|
57
|
+
import { formatAxis } from '/@/utils/formatTime';
|
|
58
|
+
import { NextLoading } from '/@/utils/loading';
|
|
59
|
+
import { Md5 } from 'ts-md5';
|
|
60
|
+
import { useLoginController } from '/@/api/loginController/index';
|
|
61
|
+
import { useUserInfo } from '/@/stores/userInfo';
|
|
62
|
+
|
|
63
|
+
const userInfo = useUserInfo();
|
|
64
|
+
const login = useLoginController();
|
|
65
|
+
const srcCod = ref('');
|
|
66
|
+
const srcCodFn = () => {
|
|
67
|
+
srcCod.value = '/scmp-web/validateCode?date=' + new Date().getTime();
|
|
68
|
+
};
|
|
69
|
+
srcCodFn();
|
|
70
|
+
const route = useRoute();
|
|
71
|
+
const router = useRouter();
|
|
72
|
+
const state = reactive({
|
|
73
|
+
isShowPassword: false,
|
|
74
|
+
ruleForm: {
|
|
75
|
+
userName: 'admin',
|
|
76
|
+
password: '123456',
|
|
77
|
+
code: '',
|
|
78
|
+
},
|
|
79
|
+
loading: {
|
|
80
|
+
signIn: false,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// 时间获取
|
|
85
|
+
const currentTime = computed(() => {
|
|
86
|
+
return formatAxis(new Date());
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// 登录成功后的跳转
|
|
90
|
+
const signInSuccess = (isNoPower: boolean | undefined) => {
|
|
91
|
+
if (isNoPower) {
|
|
92
|
+
ElMessage.warning('抱歉,您没有登录权限');
|
|
93
|
+
userInfo.clear();
|
|
94
|
+
} else {
|
|
95
|
+
// 初始化登录成功时间问候语
|
|
96
|
+
let currentTimeInfo = currentTime.value;
|
|
97
|
+
// 登录成功,跳到转首页
|
|
98
|
+
// 如果是复制粘贴的路径,非首页/登录页,那么登录成功后重定向到对应的路径中
|
|
99
|
+
if (route.query?.redirect) {
|
|
100
|
+
router.push({
|
|
101
|
+
path: <string>route.query?.redirect,
|
|
102
|
+
query: Object.keys(<string>route.query?.params).length > 0 ? JSON.parse(<string>route.query?.params) : '',
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
// 跳转到首页
|
|
106
|
+
router.push({ path: '/' });
|
|
107
|
+
}
|
|
108
|
+
// 登录成功提示
|
|
109
|
+
const signInText = '欢迎回来!';
|
|
110
|
+
ElMessage.success(`${currentTimeInfo},${signInText}`);
|
|
111
|
+
// 添加 loading,防止第一次进入界面时出现短暂空白
|
|
112
|
+
NextLoading.start();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
// 登录
|
|
116
|
+
const onSignIn = async () => {
|
|
117
|
+
state.loading.signIn = true;
|
|
118
|
+
login
|
|
119
|
+
.postAjaxLogin({
|
|
120
|
+
account: state.ruleForm.userName,
|
|
121
|
+
pwd: Md5.hashStr(state.ruleForm.password),
|
|
122
|
+
code: state.ruleForm.code,
|
|
123
|
+
})
|
|
124
|
+
.then(async (res) => {
|
|
125
|
+
if (res.code === 1) {
|
|
126
|
+
await userInfo.setUserInfo(res.data);
|
|
127
|
+
signInSuccess(false);
|
|
128
|
+
}
|
|
129
|
+
state.loading.signIn = false;
|
|
130
|
+
})
|
|
131
|
+
.catch(() => {
|
|
132
|
+
state.loading.signIn = false;
|
|
133
|
+
srcCodFn();
|
|
134
|
+
signInSuccess(true);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<style scoped lang="scss">
|
|
140
|
+
.login-content-form {
|
|
141
|
+
margin-top: 20px;
|
|
142
|
+
@for $i from 1 through 4 {
|
|
143
|
+
.login-animation#{$i} {
|
|
144
|
+
opacity: 0;
|
|
145
|
+
animation-name: error-num;
|
|
146
|
+
animation-duration: 0.5s;
|
|
147
|
+
animation-fill-mode: forwards;
|
|
148
|
+
animation-delay: calc($i/10) + s;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.login-content-password {
|
|
152
|
+
display: inline-block;
|
|
153
|
+
width: 20px;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
&:hover {
|
|
156
|
+
color: #909399;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
.login-content-code {
|
|
160
|
+
width: 100%;
|
|
161
|
+
padding: 0;
|
|
162
|
+
font-weight: bold;
|
|
163
|
+
letter-spacing: 5px;
|
|
164
|
+
}
|
|
165
|
+
.login-content-submit {
|
|
166
|
+
width: 100%;
|
|
167
|
+
letter-spacing: 2px;
|
|
168
|
+
font-weight: 300;
|
|
169
|
+
margin-top: 15px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
</style>
|