hs-admin-ui 1.0.6 → 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 -210
- package/dist/umd/index.js.gz +0 -0
- /package/{dist → public}/favicon.ico +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="system-menu-container layout-padding">
|
|
3
|
+
<!-- <div class="system-menu-padding layout-padding-auto layout-padding-view"> -->
|
|
4
|
+
<el-card shadow="hover" class="layout-padding-auto">
|
|
5
|
+
<div class="system-menu-search mb15">
|
|
6
|
+
<!-- <el-input size="default" placeholder="请输入菜单名称" style="max-width: 180px"> </el-input>
|
|
7
|
+
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
|
8
|
+
<el-icon>
|
|
9
|
+
<ele-Search />
|
|
10
|
+
</el-icon>
|
|
11
|
+
查询
|
|
12
|
+
</el-button> -->
|
|
13
|
+
<div class="flex">
|
|
14
|
+
<div class="min-w-[220px]"><bc-switch-systems @change="onChangeSystem"></bc-switch-systems></div>
|
|
15
|
+
<el-button size="default" type="success" class="ml10" @click="onOpenAddMenu('add')">
|
|
16
|
+
<el-icon>
|
|
17
|
+
<ele-FolderAdd />
|
|
18
|
+
</el-icon>
|
|
19
|
+
新增菜单
|
|
20
|
+
</el-button>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<el-table
|
|
24
|
+
:data="state.tableData.data"
|
|
25
|
+
v-loading="state.tableData.loading"
|
|
26
|
+
style="width: 100%"
|
|
27
|
+
row-key="path"
|
|
28
|
+
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
29
|
+
>
|
|
30
|
+
<el-table-column label="菜单名称" show-overflow-tooltip>
|
|
31
|
+
<template #default="scope">
|
|
32
|
+
<SvgIcon :name="scope.row.meta.icon" />
|
|
33
|
+
<span class="ml10">{{ scope.row.meta.title }}</span>
|
|
34
|
+
</template>
|
|
35
|
+
</el-table-column>
|
|
36
|
+
<el-table-column prop="path" label="路由路径" show-overflow-tooltip></el-table-column>
|
|
37
|
+
<el-table-column label="组件路径" show-overflow-tooltip>
|
|
38
|
+
<template #default="scope">
|
|
39
|
+
<span>{{ scope.row.component }}</span>
|
|
40
|
+
</template>
|
|
41
|
+
</el-table-column>
|
|
42
|
+
<!-- <el-table-column label="权限标识" show-overflow-tooltip>
|
|
43
|
+
<template #default="scope">
|
|
44
|
+
<span>{{ scope.row.meta.roles }}</span>
|
|
45
|
+
</template>
|
|
46
|
+
</el-table-column> -->
|
|
47
|
+
<el-table-column label="排序" show-overflow-tooltip width="80">
|
|
48
|
+
<template #default="scope">
|
|
49
|
+
{{ scope.row.sort }}
|
|
50
|
+
</template>
|
|
51
|
+
</el-table-column>
|
|
52
|
+
<el-table-column label="类型" show-overflow-tooltip width="80">
|
|
53
|
+
<template #default="scope">
|
|
54
|
+
<el-tag type="success" size="small">{{ scope.row.xx }}菜单</el-tag>
|
|
55
|
+
</template>
|
|
56
|
+
</el-table-column>
|
|
57
|
+
<el-table-column label="操作" show-overflow-tooltip width="140">
|
|
58
|
+
<template #default="scope">
|
|
59
|
+
<el-button size="small" text type="primary" @click="onOpenAddMenu('add', { id: scope.row.id })">新增</el-button>
|
|
60
|
+
<el-button size="small" text type="primary" @click="onOpenEditMenu('edit', scope.row)">修改</el-button>
|
|
61
|
+
<el-button size="small" text type="primary" @click="onTabelRowDel(scope.row)">删除</el-button>
|
|
62
|
+
</template>
|
|
63
|
+
</el-table-column>
|
|
64
|
+
</el-table>
|
|
65
|
+
<!-- </div> -->
|
|
66
|
+
</el-card>
|
|
67
|
+
<!-- <MenuDialog ref="menuDialogRef" @refresh="getTableData()" /> -->
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts" name="systemMenu">
|
|
72
|
+
import { defineAsyncComponent, ref, onMounted, reactive, nextTick } from 'vue';
|
|
73
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
74
|
+
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
75
|
+
import { storeToRefs } from 'pinia';
|
|
76
|
+
import { useRoutesList } from '/@/stores/routesList';
|
|
77
|
+
import { showPopup } from '/@/utils/showPopup';
|
|
78
|
+
import MenuDialog from '/@/views/system/menu/dialog.vue';
|
|
79
|
+
import { setBackEndControlRefreshRoutes } from '/@/router/backEnd';
|
|
80
|
+
import { useMenuController } from '/@/api/menuController/index';
|
|
81
|
+
const { getAllMenuList, postDelMenuInfo } = useMenuController(); // 菜单相关接口
|
|
82
|
+
|
|
83
|
+
// 引入组件
|
|
84
|
+
// const MenuDialog = defineAsyncComponent(() => import('/@/views/system/menu/dialog.vue'));
|
|
85
|
+
|
|
86
|
+
// 定义变量内容
|
|
87
|
+
const stores = useRoutesList();
|
|
88
|
+
const { routesList } = storeToRefs(stores);
|
|
89
|
+
const menuDialogRef = ref();
|
|
90
|
+
const state = reactive({
|
|
91
|
+
tableData: {
|
|
92
|
+
data: [] as RouteRecordRaw[],
|
|
93
|
+
loading: true,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// 获取路由数据,真实请从接口获取
|
|
98
|
+
const getTableData = () => {
|
|
99
|
+
let params = {
|
|
100
|
+
project_code: localStorage.getItem('project_code') as string,
|
|
101
|
+
};
|
|
102
|
+
getAllMenuList(params).then((res) => {
|
|
103
|
+
state.tableData.loading = true;
|
|
104
|
+
if (res.code === 1) {
|
|
105
|
+
state.tableData.data = res.data;
|
|
106
|
+
}
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
state.tableData.loading = false;
|
|
109
|
+
}, 500);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
// 打开新增菜单弹窗
|
|
113
|
+
const onOpenAddMenu = (type: string, row?: any) => {
|
|
114
|
+
setShowPopup(type, row);
|
|
115
|
+
};
|
|
116
|
+
// 打开编辑菜单弹窗
|
|
117
|
+
const onOpenEditMenu = (type: string, row: RouteRecordRaw) => {
|
|
118
|
+
setShowPopup(type, row);
|
|
119
|
+
};
|
|
120
|
+
// 删除当前行
|
|
121
|
+
const onTabelRowDel = (row: any) => {
|
|
122
|
+
ElMessageBox.confirm(`此操作将永久删除路由:${row.meta?.title}, 是否继续?`, '提示', {
|
|
123
|
+
confirmButtonText: '删除',
|
|
124
|
+
cancelButtonText: '取消',
|
|
125
|
+
type: 'warning',
|
|
126
|
+
})
|
|
127
|
+
.then(() => {
|
|
128
|
+
let params = {
|
|
129
|
+
project_code: localStorage.getItem('project_code') as string,
|
|
130
|
+
id: row.id,
|
|
131
|
+
};
|
|
132
|
+
postDelMenuInfo(params).then(async (res) => {
|
|
133
|
+
if (res.code === 1) {
|
|
134
|
+
ElMessage.success('删除成功');
|
|
135
|
+
getTableData();
|
|
136
|
+
await setBackEndControlRefreshRoutes();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
})
|
|
140
|
+
.catch(() => {});
|
|
141
|
+
};
|
|
142
|
+
// 页面加载时
|
|
143
|
+
onMounted(() => {
|
|
144
|
+
getTableData();
|
|
145
|
+
});
|
|
146
|
+
function setShowPopup(type?: string, row?: RouteRecordRaw) {
|
|
147
|
+
showPopup(
|
|
148
|
+
MenuDialog,
|
|
149
|
+
{ type, row },
|
|
150
|
+
{
|
|
151
|
+
title: type == 'add' ? '新增菜单' : '修改菜单',
|
|
152
|
+
showFooter: false,
|
|
153
|
+
lockView: false,
|
|
154
|
+
onConfirm() {
|
|
155
|
+
console.debug('onConfirm');
|
|
156
|
+
},
|
|
157
|
+
success(params: string) {
|
|
158
|
+
if (params === 'refresh') {
|
|
159
|
+
getTableData();
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
// 切换系统
|
|
166
|
+
const onChangeSystem = (val: any) => {
|
|
167
|
+
localStorage.setItem('project_code', val.project_code);
|
|
168
|
+
getTableData();
|
|
169
|
+
};
|
|
170
|
+
</script>
|
|
171
|
+
<style scoped lang="scss">
|
|
172
|
+
.system-menu-container {
|
|
173
|
+
.system-menu-padding {
|
|
174
|
+
padding: 15px;
|
|
175
|
+
.el-table {
|
|
176
|
+
flex: 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="system-role-dialog-container">
|
|
3
|
+
<el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" width="769px">
|
|
4
|
+
<el-form ref="roleDialogFormRef" :model="state.ruleForm" size="default" label-width="90px">
|
|
5
|
+
<el-row :gutter="35">
|
|
6
|
+
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
7
|
+
<el-form-item label="角色名称">
|
|
8
|
+
<el-input v-model="state.ruleForm.roleName" placeholder="请输入角色名称" clearable></el-input>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
</el-col>
|
|
11
|
+
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
12
|
+
<el-form-item label="角色标识">
|
|
13
|
+
<template #label>
|
|
14
|
+
<el-tooltip effect="dark" content="用于 `router/route.ts` meta.roles" placement="top-start">
|
|
15
|
+
<span>角色标识</span>
|
|
16
|
+
</el-tooltip>
|
|
17
|
+
</template>
|
|
18
|
+
<el-input v-model="state.ruleForm.roleSign" placeholder="请输入角色标识" clearable></el-input>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
22
|
+
<el-form-item label="排序">
|
|
23
|
+
<el-input-number v-model="state.ruleForm.sort" :min="0" :max="999" controls-position="right" placeholder="请输入排序" class="w100" />
|
|
24
|
+
</el-form-item>
|
|
25
|
+
</el-col>
|
|
26
|
+
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
|
27
|
+
<el-form-item label="角色状态">
|
|
28
|
+
<el-switch v-model="state.ruleForm.status" inline-prompt active-text="启" inactive-text="禁"></el-switch>
|
|
29
|
+
</el-form-item>
|
|
30
|
+
</el-col>
|
|
31
|
+
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
|
32
|
+
<el-form-item label="角色描述">
|
|
33
|
+
<el-input v-model="state.ruleForm.describe" type="textarea" placeholder="请输入角色描述" maxlength="150"></el-input>
|
|
34
|
+
</el-form-item>
|
|
35
|
+
</el-col>
|
|
36
|
+
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
|
37
|
+
<el-form-item label="菜单权限">
|
|
38
|
+
<el-tree :data="state.menuData" :props="state.menuProps" show-checkbox class="menu-data-tree" />
|
|
39
|
+
</el-form-item>
|
|
40
|
+
</el-col>
|
|
41
|
+
</el-row>
|
|
42
|
+
</el-form>
|
|
43
|
+
<template #footer>
|
|
44
|
+
<span class="dialog-footer">
|
|
45
|
+
<el-button @click="onCancel" size="default">取 消</el-button>
|
|
46
|
+
<el-button type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
|
|
47
|
+
</span>
|
|
48
|
+
</template>
|
|
49
|
+
</el-dialog>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup lang="ts" name="systemRoleDialog">
|
|
54
|
+
import { reactive, ref } from 'vue';
|
|
55
|
+
|
|
56
|
+
// 定义子组件向父组件传值/事件
|
|
57
|
+
const emit = defineEmits(['refresh']);
|
|
58
|
+
|
|
59
|
+
// 定义变量内容
|
|
60
|
+
const roleDialogFormRef = ref();
|
|
61
|
+
const state = reactive({
|
|
62
|
+
ruleForm: {
|
|
63
|
+
roleName: '', // 角色名称
|
|
64
|
+
roleSign: '', // 角色标识
|
|
65
|
+
sort: 0, // 排序
|
|
66
|
+
status: true, // 角色状态
|
|
67
|
+
describe: '', // 角色描述
|
|
68
|
+
},
|
|
69
|
+
menuData: [] as TreeType[],
|
|
70
|
+
menuProps: {
|
|
71
|
+
children: 'children',
|
|
72
|
+
label: 'label',
|
|
73
|
+
},
|
|
74
|
+
dialog: {
|
|
75
|
+
isShowDialog: false,
|
|
76
|
+
type: '',
|
|
77
|
+
title: '',
|
|
78
|
+
submitTxt: '',
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// 打开弹窗
|
|
83
|
+
const openDialog = (type: string, row: RowRoleType) => {
|
|
84
|
+
if (type === 'edit') {
|
|
85
|
+
state.ruleForm = row;
|
|
86
|
+
state.dialog.title = '修改角色';
|
|
87
|
+
state.dialog.submitTxt = '修 改';
|
|
88
|
+
} else {
|
|
89
|
+
state.dialog.title = '新增角色';
|
|
90
|
+
state.dialog.submitTxt = '新 增';
|
|
91
|
+
// 清空表单,此项需加表单验证才能使用
|
|
92
|
+
// nextTick(() => {
|
|
93
|
+
// roleDialogFormRef.value.resetFields();
|
|
94
|
+
// });
|
|
95
|
+
}
|
|
96
|
+
state.dialog.isShowDialog = true;
|
|
97
|
+
getMenuData();
|
|
98
|
+
};
|
|
99
|
+
// 关闭弹窗
|
|
100
|
+
const closeDialog = () => {
|
|
101
|
+
state.dialog.isShowDialog = false;
|
|
102
|
+
};
|
|
103
|
+
// 取消
|
|
104
|
+
const onCancel = () => {
|
|
105
|
+
closeDialog();
|
|
106
|
+
};
|
|
107
|
+
// 提交
|
|
108
|
+
const onSubmit = () => {
|
|
109
|
+
closeDialog();
|
|
110
|
+
emit('refresh');
|
|
111
|
+
// if (state.dialog.type === 'add') { }
|
|
112
|
+
};
|
|
113
|
+
// 获取菜单结构数据
|
|
114
|
+
const getMenuData = () => {
|
|
115
|
+
state.menuData = [
|
|
116
|
+
{
|
|
117
|
+
id: 1,
|
|
118
|
+
label: '系统管理',
|
|
119
|
+
children: [
|
|
120
|
+
{
|
|
121
|
+
id: 11,
|
|
122
|
+
label: '菜单管理',
|
|
123
|
+
children: [
|
|
124
|
+
{
|
|
125
|
+
id: 111,
|
|
126
|
+
label: '菜单新增',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 112,
|
|
130
|
+
label: '菜单修改',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 113,
|
|
134
|
+
label: '菜单删除',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 114,
|
|
138
|
+
label: '菜单查询',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 12,
|
|
144
|
+
label: '角色管理',
|
|
145
|
+
children: [
|
|
146
|
+
{
|
|
147
|
+
id: 121,
|
|
148
|
+
label: '角色新增',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 122,
|
|
152
|
+
label: '角色修改',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 123,
|
|
156
|
+
label: '角色删除',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 124,
|
|
160
|
+
label: '角色查询',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 13,
|
|
166
|
+
label: '用户管理',
|
|
167
|
+
children: [
|
|
168
|
+
{
|
|
169
|
+
id: 131,
|
|
170
|
+
label: '用户新增',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 132,
|
|
174
|
+
label: '用户修改',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: 133,
|
|
178
|
+
label: '用户删除',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 134,
|
|
182
|
+
label: '用户查询',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 2,
|
|
190
|
+
label: '权限管理',
|
|
191
|
+
children: [
|
|
192
|
+
{
|
|
193
|
+
id: 21,
|
|
194
|
+
label: '前端控制',
|
|
195
|
+
children: [
|
|
196
|
+
{
|
|
197
|
+
id: 211,
|
|
198
|
+
label: '页面权限',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 212,
|
|
202
|
+
label: '页面权限',
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 22,
|
|
208
|
+
label: '后端控制',
|
|
209
|
+
children: [
|
|
210
|
+
{
|
|
211
|
+
id: 221,
|
|
212
|
+
label: '页面权限',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
];
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// 暴露变量
|
|
222
|
+
defineExpose({
|
|
223
|
+
openDialog,
|
|
224
|
+
});
|
|
225
|
+
</script>
|
|
226
|
+
|
|
227
|
+
<style scoped lang="scss">
|
|
228
|
+
.system-role-dialog-container {
|
|
229
|
+
.menu-data-tree {
|
|
230
|
+
width: 100%;
|
|
231
|
+
border: 1px solid var(--el-border-color);
|
|
232
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
233
|
+
padding: 5px;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
</style>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="system-role-container layout-padding">
|
|
3
|
+
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="system-user-search mb15">
|
|
5
|
+
<el-input v-model="state.tableData.param.search" size="default" placeholder="请输入角色名称" style="max-width: 180px"> </el-input>
|
|
6
|
+
<el-button size="default" type="primary" class="ml10">
|
|
7
|
+
<el-icon>
|
|
8
|
+
<ele-Search />
|
|
9
|
+
</el-icon>
|
|
10
|
+
查询
|
|
11
|
+
</el-button>
|
|
12
|
+
<el-button size="default" type="success" class="ml10" @click="onOpenAddRole('add')">
|
|
13
|
+
<el-icon>
|
|
14
|
+
<ele-FolderAdd />
|
|
15
|
+
</el-icon>
|
|
16
|
+
新增角色
|
|
17
|
+
</el-button>
|
|
18
|
+
</div>
|
|
19
|
+
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
|
20
|
+
<el-table-column type="index" label="序号" width="60" />
|
|
21
|
+
<el-table-column prop="roleName" label="角色名称" show-overflow-tooltip></el-table-column>
|
|
22
|
+
<el-table-column prop="roleSign" label="角色标识" show-overflow-tooltip></el-table-column>
|
|
23
|
+
<el-table-column prop="sort" label="排序" show-overflow-tooltip></el-table-column>
|
|
24
|
+
<el-table-column prop="status" label="角色状态" show-overflow-tooltip>
|
|
25
|
+
<template #default="scope">
|
|
26
|
+
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
|
27
|
+
<el-tag type="info" v-else>禁用</el-tag>
|
|
28
|
+
</template>
|
|
29
|
+
</el-table-column>
|
|
30
|
+
<el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
|
|
31
|
+
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
|
|
32
|
+
<el-table-column label="操作" width="100">
|
|
33
|
+
<template #default="scope">
|
|
34
|
+
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)"
|
|
35
|
+
>修改</el-button
|
|
36
|
+
>
|
|
37
|
+
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
|
|
38
|
+
</template>
|
|
39
|
+
</el-table-column>
|
|
40
|
+
</el-table>
|
|
41
|
+
<el-pagination
|
|
42
|
+
@size-change="onHandleSizeChange"
|
|
43
|
+
@current-change="onHandleCurrentChange"
|
|
44
|
+
class="mt15"
|
|
45
|
+
:pager-count="5"
|
|
46
|
+
:page-sizes="[10, 20, 30]"
|
|
47
|
+
v-model:current-page="state.tableData.param.pageNum"
|
|
48
|
+
background
|
|
49
|
+
v-model:page-size="state.tableData.param.pageSize"
|
|
50
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
51
|
+
:total="state.tableData.total"
|
|
52
|
+
>
|
|
53
|
+
</el-pagination>
|
|
54
|
+
</div>
|
|
55
|
+
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script setup lang="ts" name="systemRole">
|
|
60
|
+
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
|
61
|
+
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
62
|
+
|
|
63
|
+
// 引入组件
|
|
64
|
+
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
|
65
|
+
|
|
66
|
+
// 定义变量内容
|
|
67
|
+
const roleDialogRef = ref();
|
|
68
|
+
const state = reactive<SysRoleState>({
|
|
69
|
+
tableData: {
|
|
70
|
+
data: [],
|
|
71
|
+
total: 0,
|
|
72
|
+
loading: false,
|
|
73
|
+
param: {
|
|
74
|
+
search: '',
|
|
75
|
+
pageNum: 1,
|
|
76
|
+
pageSize: 10,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
// 初始化表格数据
|
|
81
|
+
const getTableData = () => {
|
|
82
|
+
state.tableData.loading = true;
|
|
83
|
+
const data = [];
|
|
84
|
+
for (let i = 0; i < 20; i++) {
|
|
85
|
+
data.push({
|
|
86
|
+
roleName: i === 0 ? '超级管理员' : '普通用户',
|
|
87
|
+
roleSign: i === 0 ? 'admin' : 'common',
|
|
88
|
+
describe: `测试角色${i + 1}`,
|
|
89
|
+
sort: i,
|
|
90
|
+
status: true,
|
|
91
|
+
createTime: new Date().toLocaleString(),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
state.tableData.data = data;
|
|
95
|
+
state.tableData.total = state.tableData.data.length;
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
state.tableData.loading = false;
|
|
98
|
+
}, 500);
|
|
99
|
+
};
|
|
100
|
+
// 打开新增角色弹窗
|
|
101
|
+
const onOpenAddRole = (type: string) => {
|
|
102
|
+
roleDialogRef.value.openDialog(type);
|
|
103
|
+
};
|
|
104
|
+
// 打开修改角色弹窗
|
|
105
|
+
const onOpenEditRole = (type: string, row: Object) => {
|
|
106
|
+
roleDialogRef.value.openDialog(type, row);
|
|
107
|
+
};
|
|
108
|
+
// 删除角色
|
|
109
|
+
const onRowDel = (row: RowRoleType) => {
|
|
110
|
+
ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
|
111
|
+
confirmButtonText: '确认',
|
|
112
|
+
cancelButtonText: '取消',
|
|
113
|
+
type: 'warning',
|
|
114
|
+
})
|
|
115
|
+
.then(() => {
|
|
116
|
+
getTableData();
|
|
117
|
+
ElMessage.success('删除成功');
|
|
118
|
+
})
|
|
119
|
+
.catch(() => {});
|
|
120
|
+
};
|
|
121
|
+
// 分页改变
|
|
122
|
+
const onHandleSizeChange = (val: number) => {
|
|
123
|
+
state.tableData.param.pageSize = val;
|
|
124
|
+
getTableData();
|
|
125
|
+
};
|
|
126
|
+
// 分页改变
|
|
127
|
+
const onHandleCurrentChange = (val: number) => {
|
|
128
|
+
state.tableData.param.pageNum = val;
|
|
129
|
+
getTableData();
|
|
130
|
+
};
|
|
131
|
+
// 页面加载时
|
|
132
|
+
onMounted(() => {
|
|
133
|
+
getTableData();
|
|
134
|
+
});
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style scoped lang="scss">
|
|
138
|
+
.system-role-container {
|
|
139
|
+
.system-role-padding {
|
|
140
|
+
padding: 15px;
|
|
141
|
+
.el-table {
|
|
142
|
+
flex: 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|