fred-admin 1.0.0__py3-none-any.whl
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.
- fred_admin/__init__.py +91 -0
- fred_admin/common/AliyunSms.py +66 -0
- fred_admin/common/Blueprints.py +99 -0
- fred_admin/common/Email.py +23 -0
- fred_admin/common/Extensions.py +319 -0
- fred_admin/common/HandleExcetion.py +204 -0
- fred_admin/common/ImageVerification.py +117 -0
- fred_admin/common/IoTDBClient.py +698 -0
- fred_admin/common/PageSchema.py +65 -0
- fred_admin/common/Response.py +251 -0
- fred_admin/common/Route.py +390 -0
- fred_admin/common/RuntimeHook.py +111 -0
- fred_admin/common/SchedulerLog.py +277 -0
- fred_admin/common/Sqlacodegen.py +170 -0
- fred_admin/common/Swagger.py +77 -0
- fred_admin/common/SystemLog.py +80 -0
- fred_admin/common/Utils.py +1060 -0
- fred_admin/common/WechatLogin.py +97 -0
- fred_admin/common/__init__.py +3 -0
- fred_admin/config/Config.py +104 -0
- fred_admin/config/Logger.py +34 -0
- fred_admin/config/__init__.py +3 -0
- fred_admin/create_module.py +787 -0
- fred_admin/demo/app.py +6 -0
- fred_admin/demo/common/__init__.py +1 -0
- fred_admin/demo/common/config/Config.py +82 -0
- fred_admin/demo/common/config/README.md +8 -0
- fred_admin/demo/common/config/__init__.py +1 -0
- fred_admin/demo/common/config/__pycache__/Config.cpython-312.pyc +0 -0
- fred_admin/demo/common/config/__pycache__/__init__.cpython-312.pyc +0 -0
- fred_admin/demo/common/config/jwt_secret_key +1 -0
- fred_admin/demo/common/config/session_secret_key +1 -0
- fred_admin/demo/common/model/__pycache__/__init__.cpython-312.pyc +0 -0
- fred_admin/demo/common/model/__pycache__/model.cpython-312.pyc +0 -0
- fred_admin/demo/common/model/model.py +274 -0
- fred_admin/demo/demo_.gitignore +42 -0
- fred_admin/demo/modules/__init__.py +1 -0
- fred_admin/demo/modules/admin/README.md +38 -0
- fred_admin/demo/modules/admin/__init__.py +3 -0
- fred_admin/demo/modules/admin/backend/__init__.py +7 -0
- fred_admin/demo/modules/admin/backend/constant/RedisKey.py +10 -0
- fred_admin/demo/modules/admin/backend/controller/AdminAuthController.py +39 -0
- fred_admin/demo/modules/admin/backend/controller/AdminController.py +226 -0
- fred_admin/demo/modules/admin/backend/controller/ApiAuthController.py +93 -0
- fred_admin/demo/modules/admin/backend/controller/ButtonManageController.py +90 -0
- fred_admin/demo/modules/admin/backend/controller/FileController.py +28 -0
- fred_admin/demo/modules/admin/backend/controller/OrganizationController.py +218 -0
- fred_admin/demo/modules/admin/backend/controller/RoleController.py +143 -0
- fred_admin/demo/modules/admin/backend/controller/SystemController.py +112 -0
- fred_admin/demo/modules/admin/backend/controller/SystemLogController.py +63 -0
- fred_admin/demo/modules/admin/backend/controller/TableController.py +175 -0
- fred_admin/demo/modules/admin/backend/controller/__init__.py +55 -0
- fred_admin/demo/modules/admin/backend/schema/AdminSchema.py +356 -0
- fred_admin/demo/modules/admin/backend/schema/ApiAuthSchema.py +72 -0
- fred_admin/demo/modules/admin/backend/schema/AuthMenuSchema.py +79 -0
- fred_admin/demo/modules/admin/backend/schema/ButtonManageSchema.py +98 -0
- fred_admin/demo/modules/admin/backend/schema/OrganizationSchema.py +134 -0
- fred_admin/demo/modules/admin/backend/schema/RoleSchema.py +94 -0
- fred_admin/demo/modules/admin/backend/schema/SystemConfigSchema.py +115 -0
- fred_admin/demo/modules/admin/backend/schema/TableSchema.py +153 -0
- fred_admin/demo/modules/admin/backend/schema/UploadImg.py +35 -0
- fred_admin/demo/modules/admin/backend/schema/__init__.py +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/AdminSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/ApiAuthSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/AuthMenuSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/ButtonManageSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/OrganizationSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/RoleSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/SystemConfigSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/TableSchema.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/UploadImg.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/schema/__pycache__/__init__.cpython-312.pyc +0 -0
- fred_admin/demo/modules/admin/backend/service/AdminService.py +377 -0
- fred_admin/demo/modules/admin/backend/service/ApiAuthService.py +237 -0
- fred_admin/demo/modules/admin/backend/service/AuthButtonsService.py +155 -0
- fred_admin/demo/modules/admin/backend/service/AuthMenuService.py +265 -0
- fred_admin/demo/modules/admin/backend/service/ButtonManageService.py +386 -0
- fred_admin/demo/modules/admin/backend/service/ButtonManageService.py.broken +113 -0
- fred_admin/demo/modules/admin/backend/service/FileService.py +33 -0
- fred_admin/demo/modules/admin/backend/service/OrganizationService.py +465 -0
- fred_admin/demo/modules/admin/backend/service/RoleService.py +445 -0
- fred_admin/demo/modules/admin/backend/service/SystemConfigService.py +89 -0
- fred_admin/demo/modules/admin/backend/service/SystemLogService.py +142 -0
- fred_admin/demo/modules/admin/backend/service/TableService.py +978 -0
- fred_admin/demo/modules/admin/backend/service/__init__.py +1 -0
- fred_admin/demo/modules/admin/backend/sql/app.db +0 -0
- fred_admin/demo/modules/admin/backend/sql/fred.sql +3780 -0
- fred_admin/demo/modules/admin/frontend/LICENSE +21 -0
- fred_admin/demo/modules/admin/frontend/build/getEnv.ts +46 -0
- fred_admin/demo/modules/admin/frontend/build/plugins.ts +118 -0
- fred_admin/demo/modules/admin/frontend/build/proxy.ts +30 -0
- fred_admin/demo/modules/admin/frontend/commitlint.config.cjs +162 -0
- fred_admin/demo/modules/admin/frontend/demo_editorconfig +15 -0
- fred_admin/demo/modules/admin/frontend/demo_env +15 -0
- fred_admin/demo/modules/admin/frontend/demo_env.development +21 -0
- fred_admin/demo/modules/admin/frontend/demo_env.production +25 -0
- fred_admin/demo/modules/admin/frontend/demo_eslintignore +15 -0
- fred_admin/demo/modules/admin/frontend/demo_eslintrc.cjs +61 -0
- fred_admin/demo/modules/admin/frontend/demo_gitignore +27 -0
- fred_admin/demo/modules/admin/frontend/demo_prettierignore +9 -0
- fred_admin/demo/modules/admin/frontend/demo_prettierrc.cjs +41 -0
- fred_admin/demo/modules/admin/frontend/demo_stylelintignore +4 -0
- fred_admin/demo/modules/admin/frontend/demo_stylelintrc.cjs +40 -0
- fred_admin/demo/modules/admin/frontend/index.html +105 -0
- fred_admin/demo/modules/admin/frontend/lint-staged.config.cjs +8 -0
- fred_admin/demo/modules/admin/frontend/package.json +129 -0
- fred_admin/demo/modules/admin/frontend/pnpm-lock.yaml +11150 -0
- fred_admin/demo/modules/admin/frontend/postcss.config.cjs +5 -0
- fred_admin/demo/modules/admin/frontend/public/logo.png +0 -0
- fred_admin/demo/modules/admin/frontend/public/vue.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/App.vue +44 -0
- fred_admin/demo/modules/admin/frontend/src/api/config/servicePort.ts +2 -0
- fred_admin/demo/modules/admin/frontend/src/api/helper/axiosCancel.ts +57 -0
- fred_admin/demo/modules/admin/frontend/src/api/helper/checkStatus.ts +43 -0
- fred_admin/demo/modules/admin/frontend/src/api/index.ts +167 -0
- fred_admin/demo/modules/admin/frontend/src/api/interface/index.ts +179 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/adminModel.ts +135 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/apiAuthModel.ts +72 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/index.ts +24 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/loginModel.ts +79 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/roleModel.ts +68 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/storeModel.ts +80 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/systemModel.ts +162 -0
- fred_admin/demo/modules/admin/frontend/src/api/model/uploadModel.ts +153 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/admin.ts +76 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/apiAuth.ts +53 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/buttonManage.ts +119 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/dataBase.ts +60 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/login.ts +54 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/organization.ts +123 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/role.ts +61 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/store.ts +303 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/system.ts +125 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/upload.ts +132 -0
- fred_admin/demo/modules/admin/frontend/src/api/modules/user.ts +63 -0
- fred_admin/demo/modules/admin/frontend/src/assets/fonts/DIN.otf +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/fonts/MetroDF.ttf +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/fonts/YouSheBiaoTiHei.ttf +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/fonts/font.scss +14 -0
- fred_admin/demo/modules/admin/frontend/src/assets/iconfont/iconfont.scss +51 -0
- fred_admin/demo/modules/admin/frontend/src/assets/iconfont/iconfont.ttf +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingdaoyu.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingdiqiu.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingditu.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingfanchuan.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingfeiji.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxinglvhangriji.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingtianqiyubao.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingxiangjipaizhao.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingxiarilengyin.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingyoulun.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingzijiayou.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/403.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/404.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/500.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/avatar.gif +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_bg.svg +33 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left1.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left2.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left3.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left4.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/login_left5.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/logo.svg +1 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/msg01.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/msg02.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/msg03.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/msg04.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/msg05.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/notData.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/images/welcome.png +0 -0
- fred_admin/demo/modules/admin/frontend/src/assets/json/authButtonList.json +8 -0
- fred_admin/demo/modules/admin/frontend/src/assets/json/authMenuList.json +1075 -0
- fred_admin/demo/modules/admin/frontend/src/assets/mock/Easy-Mock-API.zip +0 -0
- fred_admin/demo/modules/admin/frontend/src/components/ECharts/config/index.ts +72 -0
- fred_admin/demo/modules/admin/frontend/src/components/ECharts/index.vue +104 -0
- fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/403.vue +19 -0
- fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/404.vue +19 -0
- fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/500.vue +19 -0
- fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/index.scss +32 -0
- fred_admin/demo/modules/admin/frontend/src/components/Grid/components/GridItem.vue +68 -0
- fred_admin/demo/modules/admin/frontend/src/components/Grid/index.vue +167 -0
- fred_admin/demo/modules/admin/frontend/src/components/Grid/interface/index.ts +6 -0
- fred_admin/demo/modules/admin/frontend/src/components/ImageCaptcha/index.vue +71 -0
- fred_admin/demo/modules/admin/frontend/src/components/ImportExcel/index.scss +3 -0
- fred_admin/demo/modules/admin/frontend/src/components/ImportExcel/index.vue +151 -0
- fred_admin/demo/modules/admin/frontend/src/components/JsonViewer/index.vue +249 -0
- fred_admin/demo/modules/admin/frontend/src/components/Loading/fullScreen.ts +45 -0
- fred_admin/demo/modules/admin/frontend/src/components/Loading/index.scss +67 -0
- fred_admin/demo/modules/admin/frontend/src/components/Loading/index.vue +13 -0
- fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/ColSetting.vue +45 -0
- fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/Pagination.vue +101 -0
- fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/TableColumn.vue +58 -0
- fred_admin/demo/modules/admin/frontend/src/components/ProTable/index.vue +348 -0
- fred_admin/demo/modules/admin/frontend/src/components/ProTable/interface/index.ts +87 -0
- fred_admin/demo/modules/admin/frontend/src/components/SearchForm/components/SearchFormItem.vue +96 -0
- fred_admin/demo/modules/admin/frontend/src/components/SearchForm/index.vue +98 -0
- fred_admin/demo/modules/admin/frontend/src/components/SelectFilter/index.scss +63 -0
- fred_admin/demo/modules/admin/frontend/src/components/SelectFilter/index.vue +110 -0
- fred_admin/demo/modules/admin/frontend/src/components/SelectIcon/index.scss +39 -0
- fred_admin/demo/modules/admin/frontend/src/components/SelectIcon/index.vue +90 -0
- fred_admin/demo/modules/admin/frontend/src/components/StoreFilter/index.vue +356 -0
- fred_admin/demo/modules/admin/frontend/src/components/SvgIcon/index.vue +22 -0
- fred_admin/demo/modules/admin/frontend/src/components/SwitchDark/index.vue +12 -0
- fred_admin/demo/modules/admin/frontend/src/components/TreeFilter/index.scss +44 -0
- fred_admin/demo/modules/admin/frontend/src/components/TreeFilter/index.vue +165 -0
- fred_admin/demo/modules/admin/frontend/src/components/Upload/Img.vue +304 -0
- fred_admin/demo/modules/admin/frontend/src/components/Upload/Imgs.vue +316 -0
- fred_admin/demo/modules/admin/frontend/src/components/WangEditor/index.scss +28 -0
- fred_admin/demo/modules/admin/frontend/src/components/WangEditor/index.vue +154 -0
- fred_admin/demo/modules/admin/frontend/src/config/amapMap.ts +11 -0
- fred_admin/demo/modules/admin/frontend/src/config/index.ts +16 -0
- fred_admin/demo/modules/admin/frontend/src/config/nprogress.ts +12 -0
- fred_admin/demo/modules/admin/frontend/src/directives/index.ts +28 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/auth.ts +26 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/copy.ts +37 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/debounce.ts +31 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/draggable.ts +49 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/longpress.ts +49 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/throttle.ts +41 -0
- fred_admin/demo/modules/admin/frontend/src/directives/modules/waterMarker.ts +36 -0
- fred_admin/demo/modules/admin/frontend/src/enums/httpEnum.ts +35 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/interface/index.ts +32 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useAuthButtons.ts +22 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useDownload.ts +42 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useHandleData.ts +41 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useI18n.ts +51 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useOnline.ts +31 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useSelection.ts +34 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useTable.ts +150 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useTheme.ts +111 -0
- fred_admin/demo/modules/admin/frontend/src/hooks/useTime.ts +38 -0
- fred_admin/demo/modules/admin/frontend/src/languages/index.ts +32 -0
- fred_admin/demo/modules/admin/frontend/src/languages/modules/en.ts +978 -0
- fred_admin/demo/modules/admin/frontend/src/languages/modules/zh.ts +996 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutClassic/index.scss +60 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutClassic/index.vue +62 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutColumns/index.scss +95 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutColumns/index.vue +103 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutTransverse/index.scss +60 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutTransverse/index.vue +61 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutVertical/index.scss +48 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/LayoutVertical/index.vue +56 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Footer/index.scss +11 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Footer/index.vue +9 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/ToolBarLeft.vue +23 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/ToolBarRight.vue +51 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/AssemblySize.vue +37 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Avatar.vue +79 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Breadcrumb.vue +122 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/CollapseIcon.vue +21 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Fullscreen.vue +25 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/InfoDialog.vue +22 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Language.vue +38 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Message.vue +109 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/PasswordDialog.vue +81 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/SearchMenu.vue +183 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/ThemeSetting.vue +12 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/components/Maximize.vue +39 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/index.scss +10 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/index.vue +88 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Menu/SubMenu.vue +85 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/components/MoreButton.vue +85 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/index.scss +69 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/index.vue +115 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/ThemeDrawer/index.scss +137 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/components/ThemeDrawer/index.vue +191 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/index.vue +42 -0
- fred_admin/demo/modules/admin/frontend/src/layouts/indexAsync.vue +46 -0
- fred_admin/demo/modules/admin/frontend/src/main.ts +45 -0
- fred_admin/demo/modules/admin/frontend/src/routers/index.ts +106 -0
- fred_admin/demo/modules/admin/frontend/src/routers/modules/dynamicRouter.ts +99 -0
- fred_admin/demo/modules/admin/frontend/src/routers/modules/staticRouter.ts +63 -0
- fred_admin/demo/modules/admin/frontend/src/stores/helper/persist.ts +19 -0
- fred_admin/demo/modules/admin/frontend/src/stores/index.ts +8 -0
- fred_admin/demo/modules/admin/frontend/src/stores/interface/index.ts +63 -0
- fred_admin/demo/modules/admin/frontend/src/stores/modules/auth.ts +50 -0
- fred_admin/demo/modules/admin/frontend/src/stores/modules/global.ts +55 -0
- fred_admin/demo/modules/admin/frontend/src/stores/modules/keepAlive.ts +25 -0
- fred_admin/demo/modules/admin/frontend/src/stores/modules/tabs.ts +78 -0
- fred_admin/demo/modules/admin/frontend/src/stores/modules/user.ts +23 -0
- fred_admin/demo/modules/admin/frontend/src/styles/common.scss +129 -0
- fred_admin/demo/modules/admin/frontend/src/styles/element-dark.scss +28 -0
- fred_admin/demo/modules/admin/frontend/src/styles/element.scss +264 -0
- fred_admin/demo/modules/admin/frontend/src/styles/modules/annotation.scss +746 -0
- fred_admin/demo/modules/admin/frontend/src/styles/modules/assembly.scss +714 -0
- fred_admin/demo/modules/admin/frontend/src/styles/modules/device-manager.scss +659 -0
- fred_admin/demo/modules/admin/frontend/src/styles/modules/directives.scss +381 -0
- fred_admin/demo/modules/admin/frontend/src/styles/reset.scss +143 -0
- fred_admin/demo/modules/admin/frontend/src/styles/table-optimization.scss +242 -0
- fred_admin/demo/modules/admin/frontend/src/styles/theme/aside.ts +16 -0
- fred_admin/demo/modules/admin/frontend/src/styles/theme/header.ts +25 -0
- fred_admin/demo/modules/admin/frontend/src/styles/theme/menu.ts +31 -0
- fred_admin/demo/modules/admin/frontend/src/styles/var.scss +2 -0
- fred_admin/demo/modules/admin/frontend/src/typings/global.d.ts +74 -0
- fred_admin/demo/modules/admin/frontend/src/typings/utils.d.ts +17 -0
- fred_admin/demo/modules/admin/frontend/src/typings/window.d.ts +8 -0
- fred_admin/demo/modules/admin/frontend/src/utils/color.ts +59 -0
- fred_admin/demo/modules/admin/frontend/src/utils/dict.ts +17 -0
- fred_admin/demo/modules/admin/frontend/src/utils/eleValidate.ts +14 -0
- fred_admin/demo/modules/admin/frontend/src/utils/errorHandler.ts +28 -0
- fred_admin/demo/modules/admin/frontend/src/utils/index.ts +327 -0
- fred_admin/demo/modules/admin/frontend/src/utils/is/index.ts +125 -0
- fred_admin/demo/modules/admin/frontend/src/utils/mittBus.ts +5 -0
- fred_admin/demo/modules/admin/frontend/src/utils/svg.ts +13 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/fieldType/components/FieldTypeDrawer.vue +89 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/fieldType/index.vue +99 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/DataBaseDrawer.vue +254 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/IndexDrawer.vue +226 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/TableDataDrawer.vue +136 -0
- fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/index.vue +234 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/columnChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/columnChart/index.vue +139 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/lineChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/lineChart/index.vue +123 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/nestedChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/nestedChart/index.vue +97 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/pieChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/pieChart/index.vue +68 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/radarChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/radarChart/index.vue +56 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/waterChart/index.scss +0 -0
- fred_admin/demo/modules/admin/frontend/src/views/echarts/waterChart/index.vue +298 -0
- fred_admin/demo/modules/admin/frontend/src/views/home/index.scss +12 -0
- fred_admin/demo/modules/admin/frontend/src/views/home/index.vue +11 -0
- fred_admin/demo/modules/admin/frontend/src/views/login/components/LoginForm.vue +147 -0
- fred_admin/demo/modules/admin/frontend/src/views/login/index.scss +83 -0
- fred_admin/demo/modules/admin/frontend/src/views/login/index.vue +27 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/complexProTable/index.vue +176 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/components/UserDrawer.vue +152 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/document/index.vue +13 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/treeProTable/index.vue +129 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/useProTable/detail.vue +12 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/useProTable/index.vue +258 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/useSelectFilter/index.vue +184 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/useTreeFilter/detail.vue +12 -0
- fred_admin/demo/modules/admin/frontend/src/views/proTable/useTreeFilter/index.vue +147 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/accountManage/index.vue +244 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/components/ApiDrawer.vue +114 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/components/TokenDrawer.vue +160 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/index.vue +354 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/buttonManage/components/ButtonDrawer.vue +460 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/buttonManage/index.vue +426 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/configManage/components/ConfigDrawer.vue +106 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/configManage/index.vue +116 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/departmentManage/index.vue +7 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/dictManage/index.vue +7 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/menuManage/components/MenuDrawer.vue +262 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/menuManage/index.vue +310 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/CompanyDrawer.vue +72 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/DepartmentDrawer.vue +120 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/TeamDrawer.vue +162 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/TeamMemberDrawer.vue +243 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/index.vue +414 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleButtonDrawer.vue +587 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleDrawer.vue +77 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleMenuDrawer.vue +236 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleUserDrawer.vue +125 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/index.vue +143 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/systemLog/components/SystemLogDrawer.vue +207 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/systemLog/index.vue +219 -0
- fred_admin/demo/modules/admin/frontend/src/views/system/timingTask/index.vue +7 -0
- fred_admin/demo/modules/admin/frontend/src/vite-env.d.ts +7 -0
- fred_admin/demo/modules/admin/frontend/tsconfig.json +42 -0
- fred_admin/demo/modules/admin/frontend/vite.config.ts +91 -0
- fred_admin/demo/modules/admin/frontend//321/205/320/231/320/235/321/207/320/273/320/277/321/204/342/225/227/320/263/321/207/320/260/320/221/321/210/320/277/342/224/244/321/206/320/250/320/236.md +100 -0
- fred_admin/demo/requirements.txt +1 -0
- fred_admin/fonts/NotoSansSC-VariableFont_wght.ttf +0 -0
- fred_admin/install_hook.py +1633 -0
- fred_admin/setup.py +18 -0
- fred_admin-1.0.0.dist-info/METADATA +97 -0
- fred_admin-1.0.0.dist-info/RECORD +376 -0
- fred_admin-1.0.0.dist-info/WHEEL +5 -0
- fred_admin-1.0.0.dist-info/entry_points.txt +3 -0
- fred_admin-1.0.0.dist-info/licenses/LICENSE +21 -0
- fred_admin-1.0.0.dist-info/top_level.txt +1 -0
fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/ThemeSetting.vue
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="theme-setting">
|
|
3
|
+
<i :class="'iconfont icon-zhuti'" class="toolBar-icon" @click="openDrawer"></i>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import mittBus from "@/utils/mittBus";
|
|
9
|
+
const openDrawer = () => {
|
|
10
|
+
mittBus.emit("openThemeDrawer");
|
|
11
|
+
};
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="maximize" @click="exitMaximize">
|
|
3
|
+
<i :class="'iconfont icon-tuichu'"></i>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
9
|
+
|
|
10
|
+
const globalStore = useGlobalStore();
|
|
11
|
+
const exitMaximize = () => {
|
|
12
|
+
globalStore.setGlobalState("maximize", false);
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped lang="scss">
|
|
17
|
+
.maximize {
|
|
18
|
+
position: fixed;
|
|
19
|
+
top: -25px;
|
|
20
|
+
right: -25px;
|
|
21
|
+
z-index: 999;
|
|
22
|
+
width: 55px;
|
|
23
|
+
height: 55px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
background-color: var(--el-color-info);
|
|
26
|
+
border-radius: 50%;
|
|
27
|
+
opacity: 0.9;
|
|
28
|
+
&:hover {
|
|
29
|
+
background-color: var(--el-color-info-dark-2);
|
|
30
|
+
}
|
|
31
|
+
.iconfont {
|
|
32
|
+
position: relative;
|
|
33
|
+
top: 46%;
|
|
34
|
+
left: 19%;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
color: #ffffff;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Maximize v-show="maximize" />
|
|
3
|
+
<Tabs v-show="tabs" />
|
|
4
|
+
<el-main>
|
|
5
|
+
<router-view v-slot="{ Component, route }">
|
|
6
|
+
<transition appear name="fade-transform" mode="out-in">
|
|
7
|
+
<keep-alive :include="keepAliveName">
|
|
8
|
+
<component :is="createComponentWrapper(Component, route)" v-if="isRouterShow" :key="route.fullPath" />
|
|
9
|
+
</keep-alive>
|
|
10
|
+
</transition>
|
|
11
|
+
</router-view>
|
|
12
|
+
</el-main>
|
|
13
|
+
<el-footer v-show="footer">
|
|
14
|
+
<Footer />
|
|
15
|
+
</el-footer>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { ref, onBeforeUnmount, provide, watch, h } from "vue";
|
|
20
|
+
import { storeToRefs } from "pinia";
|
|
21
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
22
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
23
|
+
import { useKeepAliveStore } from "@/stores/modules/keepAlive";
|
|
24
|
+
import Maximize from "./components/Maximize.vue";
|
|
25
|
+
import Tabs from "@/layouts/components/Tabs/index.vue";
|
|
26
|
+
import Footer from "@/layouts/components/Footer/index.vue";
|
|
27
|
+
|
|
28
|
+
const globalStore = useGlobalStore();
|
|
29
|
+
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
|
|
30
|
+
|
|
31
|
+
const keepAliveStore = useKeepAliveStore();
|
|
32
|
+
const { keepAliveName } = storeToRefs(keepAliveStore);
|
|
33
|
+
|
|
34
|
+
// 注入刷新页面方法
|
|
35
|
+
const isRouterShow = ref(true);
|
|
36
|
+
const refreshCurrentPage = (val: boolean) => (isRouterShow.value = val);
|
|
37
|
+
provide("refresh", refreshCurrentPage);
|
|
38
|
+
|
|
39
|
+
// 解决详情页 keep-alive 问题
|
|
40
|
+
const wrapperMap = new Map();
|
|
41
|
+
function createComponentWrapper(component, route) {
|
|
42
|
+
if (!component) return;
|
|
43
|
+
const wrapperName = route.fullPath;
|
|
44
|
+
let wrapper = wrapperMap.get(wrapperName);
|
|
45
|
+
if (!wrapper) {
|
|
46
|
+
wrapper = { name: wrapperName, render: () => h(component) };
|
|
47
|
+
wrapperMap.set(wrapperName, wrapper);
|
|
48
|
+
}
|
|
49
|
+
return h(wrapper);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 监听当前页面是否最大化,动态添加 class
|
|
53
|
+
watch(
|
|
54
|
+
() => maximize.value,
|
|
55
|
+
() => {
|
|
56
|
+
const app = document.getElementById("app") as HTMLElement;
|
|
57
|
+
if (maximize.value) app.classList.add("main-maximize");
|
|
58
|
+
else app.classList.remove("main-maximize");
|
|
59
|
+
},
|
|
60
|
+
{ immediate: true }
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// 监听布局变化,在 body 上添加相对应的 layout class
|
|
64
|
+
watch(
|
|
65
|
+
() => layout.value,
|
|
66
|
+
() => {
|
|
67
|
+
const body = document.body as HTMLElement;
|
|
68
|
+
body.setAttribute("class", layout.value);
|
|
69
|
+
},
|
|
70
|
+
{ immediate: true }
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// 监听窗口大小变化,折叠侧边栏
|
|
74
|
+
const screenWidth = ref(0);
|
|
75
|
+
const listeningWindow = useDebounceFn(() => {
|
|
76
|
+
screenWidth.value = document.body.clientWidth;
|
|
77
|
+
if (!isCollapse.value && screenWidth.value < 1200) globalStore.setGlobalState("isCollapse", true);
|
|
78
|
+
if (isCollapse.value && screenWidth.value > 1200) globalStore.setGlobalState("isCollapse", false);
|
|
79
|
+
}, 100);
|
|
80
|
+
window.addEventListener("resize", listeningWindow, false);
|
|
81
|
+
onBeforeUnmount(() => {
|
|
82
|
+
window.removeEventListener("resize", listeningWindow);
|
|
83
|
+
});
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style scoped lang="scss">
|
|
87
|
+
@use "./index";
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-for="subItem in menuList" :key="subItem.path">
|
|
3
|
+
<el-sub-menu v-if="subItem.children?.length" :index="subItem.path">
|
|
4
|
+
<template #title>
|
|
5
|
+
<el-icon v-if="subItem.meta.icon">
|
|
6
|
+
<component :is="subItem.meta.icon"></component>
|
|
7
|
+
</el-icon>
|
|
8
|
+
<span class="sle">{{ subItem.meta.title }}</span>
|
|
9
|
+
</template>
|
|
10
|
+
<SubMenu :menu-list="subItem.children" />
|
|
11
|
+
</el-sub-menu>
|
|
12
|
+
<el-menu-item v-else :index="subItem.path" @click="handleClickMenu(subItem)">
|
|
13
|
+
<el-icon v-if="subItem.meta.icon">
|
|
14
|
+
<component :is="subItem.meta.icon"></component>
|
|
15
|
+
</el-icon>
|
|
16
|
+
<template #title>
|
|
17
|
+
<span class="sle">{{ subItem.meta.title }}</span>
|
|
18
|
+
</template>
|
|
19
|
+
</el-menu-item>
|
|
20
|
+
</template>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { useRouter } from "vue-router";
|
|
25
|
+
|
|
26
|
+
defineProps<{ menuList: Menu.MenuOptions[] }>();
|
|
27
|
+
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
|
30
|
+
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, "_blank");
|
|
31
|
+
router.push(subItem.path);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss">
|
|
36
|
+
.el-sub-menu .el-sub-menu__title:hover {
|
|
37
|
+
color: var(--el-menu-hover-text-color) !important;
|
|
38
|
+
background-color: transparent !important;
|
|
39
|
+
}
|
|
40
|
+
.el-menu--collapse {
|
|
41
|
+
.is-active {
|
|
42
|
+
.el-sub-menu__title {
|
|
43
|
+
color: #ffffff !important;
|
|
44
|
+
background-color: var(--el-color-primary) !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.el-menu-item {
|
|
49
|
+
&:hover {
|
|
50
|
+
color: var(--el-menu-hover-text-color);
|
|
51
|
+
}
|
|
52
|
+
&.is-active {
|
|
53
|
+
color: var(--el-menu-active-color) !important;
|
|
54
|
+
background-color: var(--el-menu-active-bg-color) !important;
|
|
55
|
+
&::before {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
width: 4px;
|
|
60
|
+
content: "";
|
|
61
|
+
background-color: var(--el-color-primary);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
.vertical,
|
|
66
|
+
.classic,
|
|
67
|
+
.transverse {
|
|
68
|
+
.el-menu-item {
|
|
69
|
+
&.is-active {
|
|
70
|
+
&::before {
|
|
71
|
+
left: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.columns {
|
|
77
|
+
.el-menu-item {
|
|
78
|
+
&.is-active {
|
|
79
|
+
&::before {
|
|
80
|
+
right: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dropdown trigger="click" :teleported="false">
|
|
3
|
+
<div class="more-button">
|
|
4
|
+
<i :class="'iconfont icon-xiala'"></i>
|
|
5
|
+
</div>
|
|
6
|
+
<template #dropdown>
|
|
7
|
+
<el-dropdown-menu>
|
|
8
|
+
<el-dropdown-item @click="refresh">
|
|
9
|
+
<el-icon><Refresh /></el-icon>{{ $t("tabs.refresh") }}
|
|
10
|
+
</el-dropdown-item>
|
|
11
|
+
<el-dropdown-item @click="maximize">
|
|
12
|
+
<el-icon><FullScreen /></el-icon>{{ $t("tabs.maximize") }}
|
|
13
|
+
</el-dropdown-item>
|
|
14
|
+
<el-dropdown-item divided @click="closeCurrentTab">
|
|
15
|
+
<el-icon><Remove /></el-icon>{{ $t("tabs.closeCurrent") }}
|
|
16
|
+
</el-dropdown-item>
|
|
17
|
+
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'left')">
|
|
18
|
+
<el-icon><DArrowLeft /></el-icon>{{ $t("tabs.closeLeft") }}
|
|
19
|
+
</el-dropdown-item>
|
|
20
|
+
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'right')">
|
|
21
|
+
<el-icon><DArrowRight /></el-icon>{{ $t("tabs.closeRight") }}
|
|
22
|
+
</el-dropdown-item>
|
|
23
|
+
<el-dropdown-item divided @click="tabStore.closeMultipleTab(route.fullPath)">
|
|
24
|
+
<el-icon><CircleClose /></el-icon>{{ $t("tabs.closeOther") }}
|
|
25
|
+
</el-dropdown-item>
|
|
26
|
+
<el-dropdown-item @click="closeAllTab">
|
|
27
|
+
<el-icon><FolderDelete /></el-icon>{{ $t("tabs.closeAll") }}
|
|
28
|
+
</el-dropdown-item>
|
|
29
|
+
</el-dropdown-menu>
|
|
30
|
+
</template>
|
|
31
|
+
</el-dropdown>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { inject, nextTick } from "vue";
|
|
36
|
+
import { HOME_URL } from "@/config";
|
|
37
|
+
import { useTabsStore } from "@/stores/modules/tabs";
|
|
38
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
39
|
+
import { useKeepAliveStore } from "@/stores/modules/keepAlive";
|
|
40
|
+
import { useRoute, useRouter } from "vue-router";
|
|
41
|
+
|
|
42
|
+
const route = useRoute();
|
|
43
|
+
const router = useRouter();
|
|
44
|
+
const tabStore = useTabsStore();
|
|
45
|
+
const globalStore = useGlobalStore();
|
|
46
|
+
const keepAliveStore = useKeepAliveStore();
|
|
47
|
+
|
|
48
|
+
// refresh current page
|
|
49
|
+
const refreshCurrentPage = inject<(val: boolean) => void>("refresh");
|
|
50
|
+
const refresh = () => {
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
if (route.meta.isKeepAlive) {
|
|
53
|
+
keepAliveStore.removeKeepAliveName(route.fullPath as string);
|
|
54
|
+
}
|
|
55
|
+
refreshCurrentPage?.(false);
|
|
56
|
+
nextTick(() => {
|
|
57
|
+
if (route.meta.isKeepAlive) {
|
|
58
|
+
keepAliveStore.addKeepAliveName(route.fullPath as string);
|
|
59
|
+
}
|
|
60
|
+
refreshCurrentPage(true);
|
|
61
|
+
});
|
|
62
|
+
}, 0);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// maximize current page
|
|
66
|
+
const maximize = () => {
|
|
67
|
+
globalStore.setGlobalState("maximize", true);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Close Current
|
|
71
|
+
const closeCurrentTab = () => {
|
|
72
|
+
if (route.meta.isAffix) return;
|
|
73
|
+
tabStore.removeTabs(route.fullPath);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Close All
|
|
77
|
+
const closeAllTab = () => {
|
|
78
|
+
tabStore.closeMultipleTab();
|
|
79
|
+
router.push(HOME_URL);
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style scoped lang="scss">
|
|
84
|
+
@use "../index";
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.tabs-box {
|
|
2
|
+
background-color: var(--el-bg-color);
|
|
3
|
+
.tabs-menu {
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
.el-dropdown {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
.more-button {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
width: 43px;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
border-left: 1px solid var(--el-border-color-light);
|
|
18
|
+
transition: all 0.3s;
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: var(--el-color-info-light-9);
|
|
21
|
+
}
|
|
22
|
+
.iconfont {
|
|
23
|
+
font-size: 12.5px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
:deep(.el-tabs) {
|
|
28
|
+
.el-tabs__header {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: 40px;
|
|
31
|
+
padding: 0 10px;
|
|
32
|
+
margin: 0;
|
|
33
|
+
.el-tabs__nav-wrap {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: calc(100% - 70px);
|
|
36
|
+
.el-tabs__nav {
|
|
37
|
+
display: flex;
|
|
38
|
+
border: none;
|
|
39
|
+
.el-tabs__item {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
color: #afafaf;
|
|
44
|
+
border: none;
|
|
45
|
+
.tabs-icon {
|
|
46
|
+
margin: 1.5px 4px 0 0;
|
|
47
|
+
font-size: 15px;
|
|
48
|
+
}
|
|
49
|
+
.is-icon-close {
|
|
50
|
+
margin-top: 1px;
|
|
51
|
+
}
|
|
52
|
+
&.is-active {
|
|
53
|
+
color: var(--el-color-primary);
|
|
54
|
+
&::before {
|
|
55
|
+
position: absolute;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 0;
|
|
59
|
+
content: "";
|
|
60
|
+
border-bottom: 2px solid var(--el-color-primary) !important;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tabs-box">
|
|
3
|
+
<div class="tabs-menu">
|
|
4
|
+
<el-tabs v-model="tabsMenuValue" type="card" @tab-click="tabClick" @tab-remove="tabRemove">
|
|
5
|
+
<el-tab-pane v-for="item in tabsMenuList" :key="item.path" :label="item.title" :name="item.path" :closable="item.close">
|
|
6
|
+
<template #label>
|
|
7
|
+
<el-icon v-if="item.icon && tabsIcon" class="tabs-icon">
|
|
8
|
+
<component :is="item.icon"></component>
|
|
9
|
+
</el-icon>
|
|
10
|
+
{{ item.title }}
|
|
11
|
+
</template>
|
|
12
|
+
</el-tab-pane>
|
|
13
|
+
</el-tabs>
|
|
14
|
+
<MoreButton />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import Sortable from "sortablejs";
|
|
21
|
+
import { ref, computed, watch, onMounted, nextTick } from "vue";
|
|
22
|
+
import { useRoute, useRouter } from "vue-router";
|
|
23
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
24
|
+
import { useTabsStore } from "@/stores/modules/tabs";
|
|
25
|
+
import { useAuthStore } from "@/stores/modules/auth";
|
|
26
|
+
import { TabsPaneContext, TabPaneName } from "element-plus";
|
|
27
|
+
import MoreButton from "./components/MoreButton.vue";
|
|
28
|
+
|
|
29
|
+
const route = useRoute();
|
|
30
|
+
const router = useRouter();
|
|
31
|
+
const tabStore = useTabsStore();
|
|
32
|
+
const authStore = useAuthStore();
|
|
33
|
+
const globalStore = useGlobalStore();
|
|
34
|
+
|
|
35
|
+
const tabsMenuValue = ref(route.fullPath);
|
|
36
|
+
const tabsMenuList = computed(() => tabStore.tabsMenuList);
|
|
37
|
+
const tabsIcon = computed(() => globalStore.tabsIcon);
|
|
38
|
+
|
|
39
|
+
onMounted(() => {
|
|
40
|
+
tabsDrop();
|
|
41
|
+
initTabs();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// 监听路由的变化(防止浏览器后退/前进不变化 tabsMenuValue)
|
|
45
|
+
watch(
|
|
46
|
+
() => route.fullPath,
|
|
47
|
+
() => {
|
|
48
|
+
if (route.meta.isFull) return;
|
|
49
|
+
tabsMenuValue.value = route.fullPath;
|
|
50
|
+
const tabsParams = {
|
|
51
|
+
icon: route.meta.icon as string,
|
|
52
|
+
title: route.meta.title as string,
|
|
53
|
+
path: route.fullPath,
|
|
54
|
+
name: route.name as string,
|
|
55
|
+
close: !route.meta.isAffix,
|
|
56
|
+
isKeepAlive: route.meta.isKeepAlive as boolean
|
|
57
|
+
};
|
|
58
|
+
tabStore.addTabs(tabsParams);
|
|
59
|
+
},
|
|
60
|
+
{ immediate: true }
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// 初始化需要固定的 tabs
|
|
64
|
+
const initTabs = () => {
|
|
65
|
+
authStore.flatMenuListGet.forEach(item => {
|
|
66
|
+
if (item.meta.isAffix && !item.meta.isHide && !item.meta.isFull) {
|
|
67
|
+
const tabsParams = {
|
|
68
|
+
icon: item.meta.icon,
|
|
69
|
+
title: item.meta.title,
|
|
70
|
+
path: item.path,
|
|
71
|
+
name: item.name,
|
|
72
|
+
close: !item.meta.isAffix,
|
|
73
|
+
isKeepAlive: item.meta.isKeepAlive
|
|
74
|
+
};
|
|
75
|
+
tabStore.addTabs(tabsParams);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// tabs 拖拽排序
|
|
81
|
+
const tabsDrop = () => {
|
|
82
|
+
nextTick(() => {
|
|
83
|
+
const tabsNav = document.querySelector(".el-tabs__nav") as HTMLElement;
|
|
84
|
+
if (!tabsNav) {
|
|
85
|
+
console.warn("Tabs: .el-tabs__nav element not found");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
Sortable.create(tabsNav, {
|
|
89
|
+
draggable: ".el-tabs__item",
|
|
90
|
+
animation: 300,
|
|
91
|
+
onEnd({ newIndex, oldIndex }) {
|
|
92
|
+
const tabsList = [...tabStore.tabsMenuList];
|
|
93
|
+
const currRow = tabsList.splice(oldIndex as number, 1)[0];
|
|
94
|
+
tabsList.splice(newIndex as number, 0, currRow);
|
|
95
|
+
tabStore.setTabs(tabsList);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Tab Click
|
|
102
|
+
const tabClick = (tabItem: TabsPaneContext) => {
|
|
103
|
+
const fullPath = tabItem.props.name as string;
|
|
104
|
+
router.push(fullPath);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Remove Tab
|
|
108
|
+
const tabRemove = (fullPath: TabPaneName) => {
|
|
109
|
+
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath);
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style scoped lang="scss">
|
|
114
|
+
@use "./index";
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
.divider {
|
|
2
|
+
margin-top: 15px;
|
|
3
|
+
.el-icon {
|
|
4
|
+
position: relative;
|
|
5
|
+
top: 2px;
|
|
6
|
+
right: 5px;
|
|
7
|
+
font-size: 15px;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.theme-item {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
padding: 0 5px;
|
|
15
|
+
margin: 14px 0;
|
|
16
|
+
span {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
.el-icon {
|
|
21
|
+
margin-left: 3px;
|
|
22
|
+
font-size: 15px;
|
|
23
|
+
color: var(--el-text-color-regular);
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.layout-box {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
padding: 15px 7px 0;
|
|
34
|
+
.layout-item {
|
|
35
|
+
position: relative;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
width: 100px;
|
|
38
|
+
height: 70px;
|
|
39
|
+
padding: 6px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
border-radius: 5px;
|
|
42
|
+
box-shadow: 0 0 5px 1px var(--el-border-color-dark);
|
|
43
|
+
transition: all 0.2s;
|
|
44
|
+
.layout-dark {
|
|
45
|
+
background-color: var(--el-color-primary);
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
}
|
|
48
|
+
.layout-light {
|
|
49
|
+
background-color: var(--el-color-primary-light-5);
|
|
50
|
+
border-radius: 3px;
|
|
51
|
+
}
|
|
52
|
+
.layout-content {
|
|
53
|
+
background-color: var(--el-color-primary-light-8);
|
|
54
|
+
border: 1px dashed var(--el-color-primary);
|
|
55
|
+
border-radius: 3px;
|
|
56
|
+
}
|
|
57
|
+
.el-icon {
|
|
58
|
+
position: absolute;
|
|
59
|
+
right: 10px;
|
|
60
|
+
bottom: 10px;
|
|
61
|
+
color: var(--el-color-primary);
|
|
62
|
+
transition: all 0.2s;
|
|
63
|
+
}
|
|
64
|
+
&:hover {
|
|
65
|
+
box-shadow: 0 0 5px 1px var(--el-text-color-secondary);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.is-active {
|
|
69
|
+
box-shadow: 0 0 0 2px var(--el-color-primary) !important;
|
|
70
|
+
}
|
|
71
|
+
.layout-vertical {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
margin-bottom: 20px;
|
|
75
|
+
.layout-dark {
|
|
76
|
+
width: 20%;
|
|
77
|
+
}
|
|
78
|
+
.layout-container {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
width: 72%;
|
|
83
|
+
.layout-light {
|
|
84
|
+
height: 20%;
|
|
85
|
+
}
|
|
86
|
+
.layout-content {
|
|
87
|
+
height: 67%;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.layout-classic {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
justify-content: space-between;
|
|
95
|
+
margin-bottom: 20px;
|
|
96
|
+
.layout-dark {
|
|
97
|
+
height: 22%;
|
|
98
|
+
}
|
|
99
|
+
.layout-container {
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
height: 70%;
|
|
103
|
+
.layout-light {
|
|
104
|
+
width: 20%;
|
|
105
|
+
}
|
|
106
|
+
.layout-content {
|
|
107
|
+
width: 70%;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
.layout-transverse {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
margin-bottom: 15px;
|
|
116
|
+
.layout-dark {
|
|
117
|
+
height: 20%;
|
|
118
|
+
}
|
|
119
|
+
.layout-content {
|
|
120
|
+
height: 67%;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
.layout-columns {
|
|
124
|
+
display: flex;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
margin-bottom: 15px;
|
|
127
|
+
.layout-dark {
|
|
128
|
+
width: 14%;
|
|
129
|
+
}
|
|
130
|
+
.layout-light {
|
|
131
|
+
width: 17%;
|
|
132
|
+
}
|
|
133
|
+
.layout-content {
|
|
134
|
+
width: 55%;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|