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
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="drawerVisible" title="布局设置" size="290px">
|
|
3
|
+
<!-- 布局样式 -->
|
|
4
|
+
<el-divider class="divider" content-position="center">
|
|
5
|
+
<el-icon><Notification /></el-icon>
|
|
6
|
+
布局样式
|
|
7
|
+
</el-divider>
|
|
8
|
+
<div class="layout-box">
|
|
9
|
+
<el-tooltip effect="dark" content="纵向" placement="top" :show-after="200">
|
|
10
|
+
<div :class="['layout-item layout-vertical', { 'is-active': layout == 'vertical' }]" @click="setLayout('vertical')">
|
|
11
|
+
<div class="layout-dark"></div>
|
|
12
|
+
<div class="layout-container">
|
|
13
|
+
<div class="layout-light"></div>
|
|
14
|
+
<div class="layout-content"></div>
|
|
15
|
+
</div>
|
|
16
|
+
<el-icon v-if="layout == 'vertical'">
|
|
17
|
+
<CircleCheckFilled />
|
|
18
|
+
</el-icon>
|
|
19
|
+
</div>
|
|
20
|
+
</el-tooltip>
|
|
21
|
+
<el-tooltip effect="dark" content="经典" placement="top" :show-after="200">
|
|
22
|
+
<div :class="['layout-item layout-classic', { 'is-active': layout == 'classic' }]" @click="setLayout('classic')">
|
|
23
|
+
<div class="layout-dark"></div>
|
|
24
|
+
<div class="layout-container">
|
|
25
|
+
<div class="layout-light"></div>
|
|
26
|
+
<div class="layout-content"></div>
|
|
27
|
+
</div>
|
|
28
|
+
<el-icon v-if="layout == 'classic'">
|
|
29
|
+
<CircleCheckFilled />
|
|
30
|
+
</el-icon>
|
|
31
|
+
</div>
|
|
32
|
+
</el-tooltip>
|
|
33
|
+
<el-tooltip effect="dark" content="横向" placement="top" :show-after="200">
|
|
34
|
+
<div :class="['layout-item layout-transverse', { 'is-active': layout == 'transverse' }]" @click="setLayout('transverse')">
|
|
35
|
+
<div class="layout-dark"></div>
|
|
36
|
+
<div class="layout-content"></div>
|
|
37
|
+
<el-icon v-if="layout == 'transverse'">
|
|
38
|
+
<CircleCheckFilled />
|
|
39
|
+
</el-icon>
|
|
40
|
+
</div>
|
|
41
|
+
</el-tooltip>
|
|
42
|
+
<el-tooltip effect="dark" content="分栏" placement="top" :show-after="200">
|
|
43
|
+
<div :class="['layout-item layout-columns', { 'is-active': layout == 'columns' }]" @click="setLayout('columns')">
|
|
44
|
+
<div class="layout-dark"></div>
|
|
45
|
+
<div class="layout-light"></div>
|
|
46
|
+
<div class="layout-content"></div>
|
|
47
|
+
<el-icon v-if="layout == 'columns'">
|
|
48
|
+
<CircleCheckFilled />
|
|
49
|
+
</el-icon>
|
|
50
|
+
</div>
|
|
51
|
+
</el-tooltip>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="theme-item">
|
|
54
|
+
<span>
|
|
55
|
+
侧边栏反转色
|
|
56
|
+
<el-tooltip effect="dark" content="侧边栏颜色变为深色模式" placement="top">
|
|
57
|
+
<el-icon><QuestionFilled /></el-icon>
|
|
58
|
+
</el-tooltip>
|
|
59
|
+
</span>
|
|
60
|
+
<el-switch v-model="asideInverted" @change="setAsideTheme" />
|
|
61
|
+
</div>
|
|
62
|
+
<div class="theme-item mb50">
|
|
63
|
+
<span>
|
|
64
|
+
头部反转色
|
|
65
|
+
<el-tooltip effect="dark" content="头部颜色变为深色模式" placement="top">
|
|
66
|
+
<el-icon><QuestionFilled /></el-icon>
|
|
67
|
+
</el-tooltip>
|
|
68
|
+
</span>
|
|
69
|
+
<el-switch v-model="headerInverted" @change="setHeaderTheme" />
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<!-- 全局主题 -->
|
|
73
|
+
<el-divider class="divider" content-position="center">
|
|
74
|
+
<el-icon><ColdDrink /></el-icon>
|
|
75
|
+
全局主题
|
|
76
|
+
</el-divider>
|
|
77
|
+
<div class="theme-item">
|
|
78
|
+
<span>主题颜色</span>
|
|
79
|
+
<el-color-picker v-model="primary" :predefine="colorList" @change="changePrimary" />
|
|
80
|
+
</div>
|
|
81
|
+
<div class="theme-item">
|
|
82
|
+
<span>暗黑模式</span>
|
|
83
|
+
<SwitchDark />
|
|
84
|
+
</div>
|
|
85
|
+
<div class="theme-item">
|
|
86
|
+
<span>灰色模式</span>
|
|
87
|
+
<el-switch v-model="isGrey" @change="changeGreyOrWeak('grey', !!$event)" />
|
|
88
|
+
</div>
|
|
89
|
+
<div class="theme-item mb40">
|
|
90
|
+
<span>色弱模式</span>
|
|
91
|
+
<el-switch v-model="isWeak" @change="changeGreyOrWeak('weak', !!$event)" />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- 界面设置 -->
|
|
95
|
+
<el-divider class="divider" content-position="center">
|
|
96
|
+
<el-icon><Setting /></el-icon>
|
|
97
|
+
界面设置
|
|
98
|
+
</el-divider>
|
|
99
|
+
<div class="theme-item">
|
|
100
|
+
<span>菜单折叠</span>
|
|
101
|
+
<el-switch v-model="isCollapse" />
|
|
102
|
+
</div>
|
|
103
|
+
<div class="theme-item">
|
|
104
|
+
<span>菜单手风琴</span>
|
|
105
|
+
<el-switch v-model="accordion" />
|
|
106
|
+
</div>
|
|
107
|
+
<div class="theme-item">
|
|
108
|
+
<span>水印</span>
|
|
109
|
+
<el-switch v-model="watermark" />
|
|
110
|
+
</div>
|
|
111
|
+
<div class="theme-item">
|
|
112
|
+
<span>面包屑</span>
|
|
113
|
+
<el-switch v-model="breadcrumb" />
|
|
114
|
+
</div>
|
|
115
|
+
<div class="theme-item">
|
|
116
|
+
<span>面包屑图标</span>
|
|
117
|
+
<el-switch v-model="breadcrumbIcon" />
|
|
118
|
+
</div>
|
|
119
|
+
<div class="theme-item">
|
|
120
|
+
<span>标签栏</span>
|
|
121
|
+
<el-switch v-model="tabs" />
|
|
122
|
+
</div>
|
|
123
|
+
<div class="theme-item">
|
|
124
|
+
<span>标签栏图标</span>
|
|
125
|
+
<el-switch v-model="tabsIcon" />
|
|
126
|
+
</div>
|
|
127
|
+
<div class="theme-item">
|
|
128
|
+
<span>页脚</span>
|
|
129
|
+
<el-switch v-model="footer" />
|
|
130
|
+
</div>
|
|
131
|
+
</el-drawer>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<script setup lang="ts">
|
|
135
|
+
import { ref } from "vue";
|
|
136
|
+
import { storeToRefs } from "pinia";
|
|
137
|
+
import { useTheme } from "@/hooks/useTheme";
|
|
138
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
139
|
+
import { LayoutType } from "@/stores/interface";
|
|
140
|
+
import { DEFAULT_PRIMARY } from "@/config";
|
|
141
|
+
import mittBus from "@/utils/mittBus";
|
|
142
|
+
import SwitchDark from "@/components/SwitchDark/index.vue";
|
|
143
|
+
|
|
144
|
+
const { changePrimary, changeGreyOrWeak, setAsideTheme, setHeaderTheme } = useTheme();
|
|
145
|
+
|
|
146
|
+
const globalStore = useGlobalStore();
|
|
147
|
+
const {
|
|
148
|
+
layout,
|
|
149
|
+
primary,
|
|
150
|
+
isGrey,
|
|
151
|
+
isWeak,
|
|
152
|
+
asideInverted,
|
|
153
|
+
headerInverted,
|
|
154
|
+
isCollapse,
|
|
155
|
+
accordion,
|
|
156
|
+
watermark,
|
|
157
|
+
breadcrumb,
|
|
158
|
+
breadcrumbIcon,
|
|
159
|
+
tabs,
|
|
160
|
+
tabsIcon,
|
|
161
|
+
footer
|
|
162
|
+
} = storeToRefs(globalStore);
|
|
163
|
+
|
|
164
|
+
// 预定义主题颜色
|
|
165
|
+
const colorList = [
|
|
166
|
+
DEFAULT_PRIMARY,
|
|
167
|
+
"#daa96e",
|
|
168
|
+
"#0c819f",
|
|
169
|
+
"#409eff",
|
|
170
|
+
"#27ae60",
|
|
171
|
+
"#ff5c93",
|
|
172
|
+
"#e74c3c",
|
|
173
|
+
"#fd726d",
|
|
174
|
+
"#f39c12",
|
|
175
|
+
"#9b59b6"
|
|
176
|
+
];
|
|
177
|
+
|
|
178
|
+
// 设置布局方式
|
|
179
|
+
const setLayout = (val: LayoutType) => {
|
|
180
|
+
globalStore.setGlobalState("layout", val);
|
|
181
|
+
setAsideTheme();
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// 打开主题设置
|
|
185
|
+
const drawerVisible = ref(false);
|
|
186
|
+
mittBus.on("openThemeDrawer", () => (drawerVisible.value = true));
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style scoped lang="scss">
|
|
190
|
+
@use "./index";
|
|
191
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- 💥 这里是一次性加载 LayoutComponents -->
|
|
2
|
+
<template>
|
|
3
|
+
<el-watermark id="watermark" :font="font" :content="watermark ? ['Geeker Admin', 'Happy Working'] : ''">
|
|
4
|
+
<component :is="LayoutComponents[layout]" />
|
|
5
|
+
<ThemeDrawer />
|
|
6
|
+
</el-watermark>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="layout">
|
|
10
|
+
import { computed, reactive, watch, type Component } from "vue";
|
|
11
|
+
import { LayoutType } from "@/stores/interface";
|
|
12
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
13
|
+
import ThemeDrawer from "./components/ThemeDrawer/index.vue";
|
|
14
|
+
import LayoutVertical from "./LayoutVertical/index.vue";
|
|
15
|
+
import LayoutClassic from "./LayoutClassic/index.vue";
|
|
16
|
+
import LayoutTransverse from "./LayoutTransverse/index.vue";
|
|
17
|
+
import LayoutColumns from "./LayoutColumns/index.vue";
|
|
18
|
+
|
|
19
|
+
const LayoutComponents: Record<LayoutType, Component> = {
|
|
20
|
+
vertical: LayoutVertical,
|
|
21
|
+
classic: LayoutClassic,
|
|
22
|
+
transverse: LayoutTransverse,
|
|
23
|
+
columns: LayoutColumns
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const globalStore = useGlobalStore();
|
|
27
|
+
|
|
28
|
+
const isDark = computed(() => globalStore.isDark);
|
|
29
|
+
const layout = computed(() => globalStore.layout);
|
|
30
|
+
const watermark = computed(() => globalStore.watermark);
|
|
31
|
+
|
|
32
|
+
const font = reactive({ color: "rgba(0, 0, 0, .15)" });
|
|
33
|
+
watch(isDark, () => (font.color = isDark.value ? "rgba(255, 255, 255, .15)" : "rgba(0, 0, 0, .15)"), {
|
|
34
|
+
immediate: true
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style scoped lang="scss">
|
|
39
|
+
.layout {
|
|
40
|
+
min-width: 600px;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- 💥 这里是异步加载 LayoutComponents -->
|
|
2
|
+
<template>
|
|
3
|
+
<el-watermark id="watermark" :font="font" :content="watermark ? ['Geeker Admin', 'Happy Working'] : ''">
|
|
4
|
+
<suspense>
|
|
5
|
+
<template #default>
|
|
6
|
+
<component :is="LayoutComponents[layout]" />
|
|
7
|
+
</template>
|
|
8
|
+
<template #fallback>
|
|
9
|
+
<Loading />
|
|
10
|
+
</template>
|
|
11
|
+
</suspense>
|
|
12
|
+
<ThemeDrawer />
|
|
13
|
+
</el-watermark>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts" name="layoutAsync">
|
|
17
|
+
import { computed, defineAsyncComponent, reactive, watch, type Component } from "vue";
|
|
18
|
+
import { LayoutType } from "@/stores/interface";
|
|
19
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
20
|
+
import Loading from "@/components/Loading/index.vue";
|
|
21
|
+
import ThemeDrawer from "./components/ThemeDrawer/index.vue";
|
|
22
|
+
|
|
23
|
+
const LayoutComponents: Record<LayoutType, Component> = {
|
|
24
|
+
vertical: defineAsyncComponent(() => import("./LayoutVertical/index.vue")),
|
|
25
|
+
classic: defineAsyncComponent(() => import("./LayoutClassic/index.vue")),
|
|
26
|
+
transverse: defineAsyncComponent(() => import("./LayoutTransverse/index.vue")),
|
|
27
|
+
columns: defineAsyncComponent(() => import("./LayoutColumns/index.vue"))
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const globalStore = useGlobalStore();
|
|
31
|
+
|
|
32
|
+
const isDark = computed(() => globalStore.isDark);
|
|
33
|
+
const layout = computed(() => globalStore.layout);
|
|
34
|
+
const watermark = computed(() => globalStore.watermark);
|
|
35
|
+
|
|
36
|
+
const font = reactive({ color: "rgba(0, 0, 0, .15)" });
|
|
37
|
+
watch(isDark, () => (font.color = isDark.value ? "rgba(255, 255, 255, .15)" : "rgba(0, 0, 0, .15)"), {
|
|
38
|
+
immediate: true
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<style scoped lang="scss">
|
|
43
|
+
.layout {
|
|
44
|
+
min-width: 600px;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createApp } from "vue";
|
|
2
|
+
import App from "./App.vue";
|
|
3
|
+
// reset style sheet
|
|
4
|
+
import "@/styles/reset.scss";
|
|
5
|
+
// CSS common style sheet
|
|
6
|
+
import "@/styles/common.scss";
|
|
7
|
+
// iconfont css
|
|
8
|
+
import "@/assets/iconfont/iconfont.scss";
|
|
9
|
+
// font css
|
|
10
|
+
import "@/assets/fonts/font.scss";
|
|
11
|
+
// element css
|
|
12
|
+
import "element-plus/dist/index.css";
|
|
13
|
+
// element dark css
|
|
14
|
+
import "element-plus/theme-chalk/dark/css-vars.css";
|
|
15
|
+
// custom element dark css
|
|
16
|
+
import "@/styles/element-dark.scss";
|
|
17
|
+
// custom element css
|
|
18
|
+
import "@/styles/element.scss";
|
|
19
|
+
// svg icons
|
|
20
|
+
import "virtual:svg-icons-register";
|
|
21
|
+
// element plus
|
|
22
|
+
import ElementPlus from "element-plus";
|
|
23
|
+
// element icons
|
|
24
|
+
import * as Icons from "@element-plus/icons-vue";
|
|
25
|
+
// custom directives
|
|
26
|
+
import directives from "@/directives/index";
|
|
27
|
+
// vue Router
|
|
28
|
+
import router from "@/routers";
|
|
29
|
+
// vue i18n
|
|
30
|
+
import I18n from "@/languages/index";
|
|
31
|
+
// pinia store
|
|
32
|
+
import pinia from "@/stores";
|
|
33
|
+
// errorHandler
|
|
34
|
+
import errorHandler from "@/utils/errorHandler";
|
|
35
|
+
|
|
36
|
+
const app = createApp(App);
|
|
37
|
+
|
|
38
|
+
app.config.errorHandler = errorHandler;
|
|
39
|
+
|
|
40
|
+
// register the element Icons component
|
|
41
|
+
Object.keys(Icons).forEach(key => {
|
|
42
|
+
app.component(key, Icons[key as keyof typeof Icons]);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
app.use(ElementPlus).use(directives).use(router).use(I18n).use(pinia).mount("#app");
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";
|
|
2
|
+
import { useUserStore } from "@/stores/modules/user";
|
|
3
|
+
import { useAuthStore } from "@/stores/modules/auth";
|
|
4
|
+
import { LOGIN_URL, ROUTER_WHITE_LIST } from "@/config";
|
|
5
|
+
import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
|
|
6
|
+
import { staticRouter, errorRouter } from "@/routers/modules/staticRouter";
|
|
7
|
+
import NProgress from "@/config/nprogress";
|
|
8
|
+
|
|
9
|
+
const mode = import.meta.env.VITE_ROUTER_MODE;
|
|
10
|
+
|
|
11
|
+
const routerMode = {
|
|
12
|
+
hash: () => createWebHashHistory(),
|
|
13
|
+
history: () => createWebHistory()
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description 📚 路由参数配置简介
|
|
18
|
+
* @param path ==> 路由菜单访问路径
|
|
19
|
+
* @param name ==> 路由 name (对应页面组件 name, 可用作 KeepAlive 缓存标识 && 按钮权限筛选)
|
|
20
|
+
* @param redirect ==> 路由重定向地址
|
|
21
|
+
* @param component ==> 视图文件路径
|
|
22
|
+
* @param meta ==> 路由菜单元信息
|
|
23
|
+
* @param meta.icon ==> 菜单和面包屑对应的图标
|
|
24
|
+
* @param meta.title ==> 路由标题 (用作 document.title || 菜单的名称)
|
|
25
|
+
* @param meta.activeMenu ==> 当前路由为详情页时,需要高亮的菜单
|
|
26
|
+
* @param meta.isLink ==> 路由外链时填写的访问地址
|
|
27
|
+
* @param meta.isHide ==> 是否在菜单中隐藏 (通常列表详情页需要隐藏)
|
|
28
|
+
* @param meta.isFull ==> 菜单是否全屏 (示例:数据大屏页面)
|
|
29
|
+
* @param meta.isAffix ==> 菜单是否固定在标签页中 (首页通常是固定项)
|
|
30
|
+
* @param meta.isKeepAlive ==> 当前路由是否缓存
|
|
31
|
+
* */
|
|
32
|
+
const router = createRouter({
|
|
33
|
+
history: routerMode[mode](),
|
|
34
|
+
routes: [...staticRouter, ...errorRouter],
|
|
35
|
+
strict: false,
|
|
36
|
+
scrollBehavior: () => ({ left: 0, top: 0 })
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description 路由拦截 beforeEach
|
|
41
|
+
* */
|
|
42
|
+
router.beforeEach(async (to, from, next) => {
|
|
43
|
+
const userStore = useUserStore();
|
|
44
|
+
const authStore = useAuthStore();
|
|
45
|
+
|
|
46
|
+
// 1.NProgress 开始
|
|
47
|
+
NProgress.start();
|
|
48
|
+
|
|
49
|
+
// 2.动态设置标题
|
|
50
|
+
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
|
51
|
+
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title;
|
|
52
|
+
|
|
53
|
+
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
|
|
54
|
+
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
|
55
|
+
if (userStore.token) return next(from.fullPath);
|
|
56
|
+
resetRouter();
|
|
57
|
+
return next();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 4.判断访问页面是否在路由白名单地址(静态路由)中,如果存在直接放行
|
|
61
|
+
if (ROUTER_WHITE_LIST.includes(to.path)) return next();
|
|
62
|
+
|
|
63
|
+
// 5.判断是否有 Token,没有重定向到 login 页面
|
|
64
|
+
if (!userStore.token) return next({ path: LOGIN_URL, replace: true });
|
|
65
|
+
|
|
66
|
+
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
|
|
67
|
+
if (!authStore.authMenuListGet.length) {
|
|
68
|
+
await initDynamicRouter();
|
|
69
|
+
return next({ ...to, replace: true });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 7.存储 routerName 和 menuName 做按钮权限筛选
|
|
73
|
+
authStore.setRouteName(to.name as string);
|
|
74
|
+
authStore.setMenuName((to.meta?.title as string) || "");
|
|
75
|
+
|
|
76
|
+
// 8.正常访问页面
|
|
77
|
+
next();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @description 重置路由
|
|
82
|
+
* */
|
|
83
|
+
export const resetRouter = () => {
|
|
84
|
+
const authStore = useAuthStore();
|
|
85
|
+
authStore.flatMenuListGet.forEach(route => {
|
|
86
|
+
const { name } = route;
|
|
87
|
+
if (name && router.hasRoute(name)) router.removeRoute(name);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @description 路由跳转错误
|
|
93
|
+
* */
|
|
94
|
+
router.onError(error => {
|
|
95
|
+
NProgress.done();
|
|
96
|
+
console.warn("路由错误", error.message);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @description 路由跳转结束
|
|
101
|
+
* */
|
|
102
|
+
router.afterEach(() => {
|
|
103
|
+
NProgress.done();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export default router;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { LOGIN_URL } from "@/config";
|
|
2
|
+
import router from "@/routers/index";
|
|
3
|
+
import { useAuthStore } from "@/stores/modules/auth";
|
|
4
|
+
import { useUserStore } from "@/stores/modules/user";
|
|
5
|
+
import { ElNotification } from "element-plus";
|
|
6
|
+
import { RouteRecordRaw } from "vue-router";
|
|
7
|
+
|
|
8
|
+
// 引入 views 文件夹下所有 vue 文件
|
|
9
|
+
const modules = import.meta.glob("@/views/**/*.vue");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description 初始化动态路由
|
|
13
|
+
*/
|
|
14
|
+
export const initDynamicRouter = async () => {
|
|
15
|
+
const userStore = useUserStore();
|
|
16
|
+
const authStore = useAuthStore();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// 1.获取菜单列表 && 按钮权限列表
|
|
20
|
+
await authStore.getAuthMenuList();
|
|
21
|
+
await authStore.getAuthButtonList();
|
|
22
|
+
|
|
23
|
+
// 2.判断当前用户有没有菜单权限
|
|
24
|
+
if (!authStore.authMenuListGet.length) {
|
|
25
|
+
ElNotification({
|
|
26
|
+
title: "无权限访问",
|
|
27
|
+
message: "当前账号无任何菜单权限,请联系系统管理员!",
|
|
28
|
+
type: "warning",
|
|
29
|
+
duration: 3000
|
|
30
|
+
});
|
|
31
|
+
userStore.setToken("");
|
|
32
|
+
router.replace(LOGIN_URL);
|
|
33
|
+
return Promise.reject("No permission");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 3.添加动态路由
|
|
37
|
+
authStore.flatMenuListGet.forEach(item => {
|
|
38
|
+
if (item.children) {
|
|
39
|
+
delete item.children;
|
|
40
|
+
}
|
|
41
|
+
if (item.component && typeof item.component == "string") {
|
|
42
|
+
item.component = modules["/src/views" + item.component + ".vue"];
|
|
43
|
+
}
|
|
44
|
+
if (item.meta.isFull) {
|
|
45
|
+
router.addRoute(item as unknown as RouteRecordRaw);
|
|
46
|
+
} else {
|
|
47
|
+
router.addRoute("layout", item as unknown as RouteRecordRaw);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// 4.手动添加模型日志页面路由(如果不存在)
|
|
52
|
+
// 检查是否已存在modelManage/log的路由
|
|
53
|
+
const hasModelLogRoute = router.hasRoute("modelManage/log");
|
|
54
|
+
if (!hasModelLogRoute) {
|
|
55
|
+
const modelLogRoute: RouteRecordRaw = {
|
|
56
|
+
path: "/modelManage/log",
|
|
57
|
+
name: "modelManage/log",
|
|
58
|
+
component: modules["/src/views/modelManage/log.vue"],
|
|
59
|
+
meta: {
|
|
60
|
+
title: "模型日志",
|
|
61
|
+
icon: "el-icon-document",
|
|
62
|
+
isLink: "",
|
|
63
|
+
isHide: false,
|
|
64
|
+
isFull: false,
|
|
65
|
+
isAffix: false,
|
|
66
|
+
isKeepAlive: true
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
router.addRoute("layout", modelLogRoute);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 5.手动添加素材图片预览页面路由(如果不存在)
|
|
73
|
+
// 检查是否已存在materialImages的路由
|
|
74
|
+
const hasMaterialImagesRoute = router.hasRoute("materialImages");
|
|
75
|
+
if (!hasMaterialImagesRoute) {
|
|
76
|
+
const materialImagesRoute: RouteRecordRaw = {
|
|
77
|
+
path: "/annotation/material-images",
|
|
78
|
+
name: "materialImages",
|
|
79
|
+
component: modules["/src/views/annotation/materialImages.vue"],
|
|
80
|
+
meta: {
|
|
81
|
+
title: "查看素材",
|
|
82
|
+
icon: "el-icon-picture",
|
|
83
|
+
isLink: "",
|
|
84
|
+
isHide: true,
|
|
85
|
+
isFull: false,
|
|
86
|
+
isAffix: false,
|
|
87
|
+
isKeepAlive: true,
|
|
88
|
+
activeMenu: "/annotation"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
router.addRoute("layout", materialImagesRoute);
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
// 当按钮 || 菜单请求出错时,重定向到登陆页
|
|
95
|
+
userStore.setToken("");
|
|
96
|
+
router.replace(LOGIN_URL);
|
|
97
|
+
return Promise.reject(error);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RouteRecordRaw } from "vue-router";
|
|
2
|
+
import { HOME_URL, LOGIN_URL } from "@/config";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* staticRouter (静态路由)
|
|
6
|
+
*/
|
|
7
|
+
export const staticRouter: RouteRecordRaw[] = [
|
|
8
|
+
{
|
|
9
|
+
path: "/",
|
|
10
|
+
redirect: HOME_URL
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
path: LOGIN_URL,
|
|
14
|
+
name: "login",
|
|
15
|
+
component: () => import("@/views/login/index.vue"),
|
|
16
|
+
meta: {
|
|
17
|
+
title: "登录"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: "/layout",
|
|
22
|
+
name: "layout",
|
|
23
|
+
component: () => import("@/layouts/index.vue"),
|
|
24
|
+
// component: () => import("@/layouts/indexAsync.vue"),
|
|
25
|
+
redirect: HOME_URL,
|
|
26
|
+
children: []
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* errorRouter (错误页面路由)
|
|
32
|
+
*/
|
|
33
|
+
export const errorRouter = [
|
|
34
|
+
{
|
|
35
|
+
path: "/403",
|
|
36
|
+
name: "403",
|
|
37
|
+
component: () => import("@/components/ErrorMessage/403.vue"),
|
|
38
|
+
meta: {
|
|
39
|
+
title: "403页面"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
path: "/404",
|
|
44
|
+
name: "404",
|
|
45
|
+
component: () => import("@/components/ErrorMessage/404.vue"),
|
|
46
|
+
meta: {
|
|
47
|
+
title: "404页面"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: "/500",
|
|
52
|
+
name: "500",
|
|
53
|
+
component: () => import("@/components/ErrorMessage/500.vue"),
|
|
54
|
+
meta: {
|
|
55
|
+
title: "500页面"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
// Resolve refresh page, route warnings
|
|
59
|
+
{
|
|
60
|
+
path: "/:pathMatch(.*)*",
|
|
61
|
+
component: () => import("@/components/ErrorMessage/404.vue")
|
|
62
|
+
}
|
|
63
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PersistedStateOptions } from "pinia-plugin-persistedstate";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description pinia 持久化参数配置
|
|
5
|
+
* @param {String} key 存储到持久化的 name
|
|
6
|
+
* @param {Array} paths 需要持久化的 state name
|
|
7
|
+
* @return persist
|
|
8
|
+
* */
|
|
9
|
+
const piniaPersistConfig = (key: string, paths?: string[]) => {
|
|
10
|
+
const persist: PersistedStateOptions = {
|
|
11
|
+
key,
|
|
12
|
+
storage: localStorage,
|
|
13
|
+
// storage: sessionStorage,
|
|
14
|
+
paths
|
|
15
|
+
};
|
|
16
|
+
return persist;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default piniaPersistConfig;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type LayoutType = "vertical" | "classic" | "transverse" | "columns";
|
|
2
|
+
|
|
3
|
+
export type AssemblySizeType = "large" | "default" | "small";
|
|
4
|
+
|
|
5
|
+
export type LanguageType = "zh" | "en" | null;
|
|
6
|
+
|
|
7
|
+
/* GlobalState */
|
|
8
|
+
export interface GlobalState {
|
|
9
|
+
layout: LayoutType;
|
|
10
|
+
assemblySize: AssemblySizeType;
|
|
11
|
+
language: LanguageType;
|
|
12
|
+
maximize: boolean;
|
|
13
|
+
primary: string;
|
|
14
|
+
isDark: boolean;
|
|
15
|
+
isGrey: boolean;
|
|
16
|
+
isWeak: boolean;
|
|
17
|
+
asideInverted: boolean;
|
|
18
|
+
headerInverted: boolean;
|
|
19
|
+
isCollapse: boolean;
|
|
20
|
+
accordion: boolean;
|
|
21
|
+
watermark: boolean;
|
|
22
|
+
breadcrumb: boolean;
|
|
23
|
+
breadcrumbIcon: boolean;
|
|
24
|
+
tabs: boolean;
|
|
25
|
+
tabsIcon: boolean;
|
|
26
|
+
footer: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* UserState */
|
|
30
|
+
export interface UserState {
|
|
31
|
+
token: string;
|
|
32
|
+
userInfo: { name: string };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* tabsMenuProps */
|
|
36
|
+
export interface TabsMenuProps {
|
|
37
|
+
icon: string;
|
|
38
|
+
title: string;
|
|
39
|
+
path: string;
|
|
40
|
+
name: string;
|
|
41
|
+
close: boolean;
|
|
42
|
+
isKeepAlive: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* TabsState */
|
|
46
|
+
export interface TabsState {
|
|
47
|
+
tabsMenuList: TabsMenuProps[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* AuthState */
|
|
51
|
+
export interface AuthState {
|
|
52
|
+
routeName: string;
|
|
53
|
+
menuName: string;
|
|
54
|
+
authButtonList: {
|
|
55
|
+
[key: string]: string[];
|
|
56
|
+
};
|
|
57
|
+
authMenuList: Menu.MenuOptions[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* KeepAliveState */
|
|
61
|
+
export interface KeepAliveState {
|
|
62
|
+
keepAliveName: string[];
|
|
63
|
+
}
|