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
|
Binary file
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as echarts from "echarts/core";
|
|
2
|
+
import { BarChart, LineChart, LinesChart, PieChart, ScatterChart, RadarChart, GaugeChart } from "echarts/charts";
|
|
3
|
+
import {
|
|
4
|
+
TitleComponent,
|
|
5
|
+
TooltipComponent,
|
|
6
|
+
GridComponent,
|
|
7
|
+
DatasetComponent,
|
|
8
|
+
TransformComponent,
|
|
9
|
+
LegendComponent,
|
|
10
|
+
PolarComponent,
|
|
11
|
+
GeoComponent,
|
|
12
|
+
ToolboxComponent,
|
|
13
|
+
DataZoomComponent
|
|
14
|
+
} from "echarts/components";
|
|
15
|
+
import { LabelLayout, UniversalTransition } from "echarts/features";
|
|
16
|
+
import { CanvasRenderer } from "echarts/renderers";
|
|
17
|
+
import type {
|
|
18
|
+
BarSeriesOption,
|
|
19
|
+
LineSeriesOption,
|
|
20
|
+
LinesSeriesOption,
|
|
21
|
+
PieSeriesOption,
|
|
22
|
+
ScatterSeriesOption,
|
|
23
|
+
RadarSeriesOption,
|
|
24
|
+
GaugeSeriesOption
|
|
25
|
+
} from "echarts/charts";
|
|
26
|
+
import type {
|
|
27
|
+
TitleComponentOption,
|
|
28
|
+
TooltipComponentOption,
|
|
29
|
+
GridComponentOption,
|
|
30
|
+
DatasetComponentOption
|
|
31
|
+
} from "echarts/components";
|
|
32
|
+
import type { ComposeOption } from "echarts/core";
|
|
33
|
+
import "echarts-liquidfill";
|
|
34
|
+
|
|
35
|
+
export type ECOption = ComposeOption<
|
|
36
|
+
| BarSeriesOption
|
|
37
|
+
| LineSeriesOption
|
|
38
|
+
| LinesSeriesOption
|
|
39
|
+
| PieSeriesOption
|
|
40
|
+
| RadarSeriesOption
|
|
41
|
+
| GaugeSeriesOption
|
|
42
|
+
| TitleComponentOption
|
|
43
|
+
| TooltipComponentOption
|
|
44
|
+
| GridComponentOption
|
|
45
|
+
| DatasetComponentOption
|
|
46
|
+
| ScatterSeriesOption
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
echarts.use([
|
|
50
|
+
TitleComponent,
|
|
51
|
+
TooltipComponent,
|
|
52
|
+
GridComponent,
|
|
53
|
+
DatasetComponent,
|
|
54
|
+
TransformComponent,
|
|
55
|
+
LegendComponent,
|
|
56
|
+
PolarComponent,
|
|
57
|
+
GeoComponent,
|
|
58
|
+
ToolboxComponent,
|
|
59
|
+
DataZoomComponent,
|
|
60
|
+
BarChart,
|
|
61
|
+
LineChart,
|
|
62
|
+
LinesChart,
|
|
63
|
+
PieChart,
|
|
64
|
+
ScatterChart,
|
|
65
|
+
RadarChart,
|
|
66
|
+
GaugeChart,
|
|
67
|
+
LabelLayout,
|
|
68
|
+
UniversalTransition,
|
|
69
|
+
CanvasRenderer
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
export default echarts;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="echarts" ref="chartRef" :style="echartsStyle" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts" name="ECharts">
|
|
6
|
+
import { ref, onMounted, onBeforeUnmount, watch, computed, markRaw, nextTick, onActivated } from "vue";
|
|
7
|
+
import { EChartsType, ECElementEvent } from "echarts/core";
|
|
8
|
+
import echarts, { ECOption } from "./config";
|
|
9
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
10
|
+
import { useGlobalStore } from "@/stores/modules/global";
|
|
11
|
+
import { storeToRefs } from "pinia";
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
option: ECOption;
|
|
15
|
+
renderer?: "canvas" | "svg";
|
|
16
|
+
resize?: boolean;
|
|
17
|
+
theme?: object | string;
|
|
18
|
+
width?: number | string;
|
|
19
|
+
height?: number | string;
|
|
20
|
+
onClick?: (event: ECElementEvent) => any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
24
|
+
renderer: "canvas",
|
|
25
|
+
resize: true
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const echartsStyle = computed(() => {
|
|
29
|
+
return props.width || props.height
|
|
30
|
+
? { height: props.height + "px", width: props.width + "px" }
|
|
31
|
+
: { height: "100%", width: "100%" };
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const chartRef = ref<HTMLDivElement | HTMLCanvasElement>();
|
|
35
|
+
const chartInstance = ref<EChartsType>();
|
|
36
|
+
|
|
37
|
+
const draw = () => {
|
|
38
|
+
if (chartInstance.value) {
|
|
39
|
+
chartInstance.value.setOption(props.option, { notMerge: true });
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
watch(props, () => {
|
|
44
|
+
draw();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const handleClick = (event: ECElementEvent) => props.onClick && props.onClick(event);
|
|
48
|
+
|
|
49
|
+
const init = () => {
|
|
50
|
+
if (!chartRef.value) return;
|
|
51
|
+
chartInstance.value = echarts.getInstanceByDom(chartRef.value);
|
|
52
|
+
|
|
53
|
+
if (!chartInstance.value) {
|
|
54
|
+
chartInstance.value = markRaw(
|
|
55
|
+
echarts.init(chartRef.value, props.theme, {
|
|
56
|
+
renderer: props.renderer
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
chartInstance.value.on("click", handleClick);
|
|
60
|
+
draw();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const resize = () => {
|
|
65
|
+
if (chartInstance.value && props.resize) {
|
|
66
|
+
chartInstance.value.resize({ animation: { duration: 300 } });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const debouncedResize = useDebounceFn(resize, 300, { maxWait: 800 });
|
|
71
|
+
|
|
72
|
+
const globalStore = useGlobalStore();
|
|
73
|
+
const { maximize, isCollapse, tabs, footer } = storeToRefs(globalStore);
|
|
74
|
+
|
|
75
|
+
watch(
|
|
76
|
+
() => [maximize, isCollapse, tabs, footer],
|
|
77
|
+
() => {
|
|
78
|
+
debouncedResize();
|
|
79
|
+
},
|
|
80
|
+
{ deep: true }
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
onMounted(() => {
|
|
84
|
+
nextTick(() => init());
|
|
85
|
+
window.addEventListener("resize", debouncedResize);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
onActivated(() => {
|
|
89
|
+
if (chartInstance.value) {
|
|
90
|
+
chartInstance.value.resize();
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
onBeforeUnmount(() => {
|
|
95
|
+
chartInstance.value?.dispose();
|
|
96
|
+
window.removeEventListener("resize", debouncedResize);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
defineExpose({
|
|
100
|
+
getInstance: () => chartInstance.value,
|
|
101
|
+
resize,
|
|
102
|
+
draw
|
|
103
|
+
});
|
|
104
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="not-container">
|
|
3
|
+
<img src="@/assets/images/403.png" class="not-img" alt="403" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<h2>403</h2>
|
|
6
|
+
<h4>抱歉,您无权访问该页面~🙅♂️🙅♀️</h4>
|
|
7
|
+
<el-button type="primary" @click="router.back"> 返回上一页 </el-button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts" name="403">
|
|
13
|
+
import { useRouter } from "vue-router";
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped lang="scss">
|
|
18
|
+
@use "./index";
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="not-container">
|
|
3
|
+
<img src="@/assets/images/404.png" class="not-img" alt="404" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<h2>404</h2>
|
|
6
|
+
<h4>抱歉,您访问的页面不存在~🤷♂️🤷♀️</h4>
|
|
7
|
+
<el-button type="primary" @click="router.back"> 返回上一页 </el-button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts" name="404">
|
|
13
|
+
import { useRouter } from "vue-router";
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped lang="scss">
|
|
18
|
+
@use "./index";
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="not-container">
|
|
3
|
+
<img src="@/assets/images/500.png" class="not-img" alt="500" />
|
|
4
|
+
<div class="not-detail">
|
|
5
|
+
<h2>500</h2>
|
|
6
|
+
<h4>抱歉,您的网络不见了~🤦♂️🤦♀️</h4>
|
|
7
|
+
<el-button type="primary" @click="router.back"> 返回上一页 </el-button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts" name="500">
|
|
13
|
+
import { useRouter } from "vue-router";
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped lang="scss">
|
|
18
|
+
@use "./index";
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.not-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
.not-img {
|
|
8
|
+
margin-right: 120px;
|
|
9
|
+
}
|
|
10
|
+
.not-detail {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
h2,
|
|
14
|
+
h4 {
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
h2 {
|
|
19
|
+
font-size: 60px;
|
|
20
|
+
color: var(--el-text-color-primary);
|
|
21
|
+
}
|
|
22
|
+
h4 {
|
|
23
|
+
margin: 30px 0 20px;
|
|
24
|
+
font-size: 19px;
|
|
25
|
+
font-weight: normal;
|
|
26
|
+
color: var(--el-text-color-regular);
|
|
27
|
+
}
|
|
28
|
+
.el-button {
|
|
29
|
+
width: 100px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-show="isShow" :style="style">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts" name="GridItem">
|
|
7
|
+
import { computed, inject, Ref, ref, useAttrs, watch } from "vue";
|
|
8
|
+
import { BreakPoint, Responsive } from "../interface/index";
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
offset?: number;
|
|
12
|
+
span?: number;
|
|
13
|
+
suffix?: boolean;
|
|
14
|
+
xs?: Responsive;
|
|
15
|
+
sm?: Responsive;
|
|
16
|
+
md?: Responsive;
|
|
17
|
+
lg?: Responsive;
|
|
18
|
+
xl?: Responsive;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
offset: 0,
|
|
23
|
+
span: 1,
|
|
24
|
+
suffix: false,
|
|
25
|
+
xs: undefined,
|
|
26
|
+
sm: undefined,
|
|
27
|
+
md: undefined,
|
|
28
|
+
lg: undefined,
|
|
29
|
+
xl: undefined
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const attrs = useAttrs() as { index: string };
|
|
33
|
+
const isShow = ref(true);
|
|
34
|
+
|
|
35
|
+
// 注入断点
|
|
36
|
+
const breakPoint = inject<Ref<BreakPoint>>("breakPoint", ref("xl"));
|
|
37
|
+
const shouldHiddenIndex = inject<Ref<number>>("shouldHiddenIndex", ref(-1));
|
|
38
|
+
watch(
|
|
39
|
+
() => [shouldHiddenIndex.value, breakPoint.value],
|
|
40
|
+
n => {
|
|
41
|
+
if (!!attrs.index) {
|
|
42
|
+
isShow.value = !(n[0] !== -1 && parseInt(attrs.index) >= Number(n[0]));
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{ immediate: true }
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const gap = inject("gap", 0);
|
|
49
|
+
const cols = inject("cols", ref(4));
|
|
50
|
+
const style = computed(() => {
|
|
51
|
+
let span = props[breakPoint.value]?.span ?? props.span;
|
|
52
|
+
let offset = props[breakPoint.value]?.offset ?? props.offset;
|
|
53
|
+
if (props.suffix) {
|
|
54
|
+
return {
|
|
55
|
+
gridColumnStart: cols.value - span - offset + 1,
|
|
56
|
+
gridColumnEnd: `span ${span + offset}`,
|
|
57
|
+
marginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : "unset"
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
return {
|
|
61
|
+
gridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${
|
|
62
|
+
span + offset > cols.value ? cols.value : span + offset
|
|
63
|
+
}`,
|
|
64
|
+
marginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : "unset"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="style">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts" name="Grid">
|
|
8
|
+
import {
|
|
9
|
+
ref,
|
|
10
|
+
watch,
|
|
11
|
+
useSlots,
|
|
12
|
+
computed,
|
|
13
|
+
provide,
|
|
14
|
+
onBeforeMount,
|
|
15
|
+
onMounted,
|
|
16
|
+
onUnmounted,
|
|
17
|
+
onDeactivated,
|
|
18
|
+
onActivated,
|
|
19
|
+
VNodeArrayChildren,
|
|
20
|
+
VNode
|
|
21
|
+
} from "vue";
|
|
22
|
+
import type { BreakPoint } from "./interface/index";
|
|
23
|
+
|
|
24
|
+
type Props = {
|
|
25
|
+
cols?: number | Record<BreakPoint, number>;
|
|
26
|
+
collapsed?: boolean;
|
|
27
|
+
collapsedRows?: number;
|
|
28
|
+
gap?: [number, number] | number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
cols: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
|
33
|
+
collapsed: false,
|
|
34
|
+
collapsedRows: 1,
|
|
35
|
+
gap: 0
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
onBeforeMount(() => props.collapsed && findIndex());
|
|
39
|
+
onMounted(() => {
|
|
40
|
+
resize({ target: { innerWidth: window.innerWidth } } as unknown as UIEvent);
|
|
41
|
+
window.addEventListener("resize", resize);
|
|
42
|
+
});
|
|
43
|
+
onActivated(() => {
|
|
44
|
+
resize({ target: { innerWidth: window.innerWidth } } as unknown as UIEvent);
|
|
45
|
+
window.addEventListener("resize", resize);
|
|
46
|
+
});
|
|
47
|
+
onUnmounted(() => {
|
|
48
|
+
window.removeEventListener("resize", resize);
|
|
49
|
+
});
|
|
50
|
+
onDeactivated(() => {
|
|
51
|
+
window.removeEventListener("resize", resize);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// 监听屏幕变化
|
|
55
|
+
const resize = (e: UIEvent) => {
|
|
56
|
+
let width = (e.target as Window).innerWidth;
|
|
57
|
+
switch (!!width) {
|
|
58
|
+
case width < 768:
|
|
59
|
+
breakPoint.value = "xs";
|
|
60
|
+
break;
|
|
61
|
+
case width >= 768 && width < 992:
|
|
62
|
+
breakPoint.value = "sm";
|
|
63
|
+
break;
|
|
64
|
+
case width >= 992 && width < 1200:
|
|
65
|
+
breakPoint.value = "md";
|
|
66
|
+
break;
|
|
67
|
+
case width >= 1200 && width < 1920:
|
|
68
|
+
breakPoint.value = "lg";
|
|
69
|
+
break;
|
|
70
|
+
case width >= 1920:
|
|
71
|
+
breakPoint.value = "xl";
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// 注入 gap 间距
|
|
77
|
+
provide("gap", Array.isArray(props.gap) ? props.gap[0] : props.gap);
|
|
78
|
+
|
|
79
|
+
// 注入响应式断点
|
|
80
|
+
let breakPoint = ref<BreakPoint>("xl");
|
|
81
|
+
provide("breakPoint", breakPoint);
|
|
82
|
+
|
|
83
|
+
// 注入要开始折叠的 index
|
|
84
|
+
const hiddenIndex = ref(-1);
|
|
85
|
+
provide("shouldHiddenIndex", hiddenIndex);
|
|
86
|
+
|
|
87
|
+
// 注入 cols
|
|
88
|
+
const gridCols = computed(() => {
|
|
89
|
+
if (typeof props.cols === "object") return props.cols[breakPoint.value] ?? props.cols;
|
|
90
|
+
return props.cols;
|
|
91
|
+
});
|
|
92
|
+
provide("cols", gridCols);
|
|
93
|
+
|
|
94
|
+
// 寻找需要开始折叠的字段 index
|
|
95
|
+
const slots = useSlots().default!();
|
|
96
|
+
|
|
97
|
+
const findIndex = () => {
|
|
98
|
+
let fields: VNodeArrayChildren = [];
|
|
99
|
+
let suffix: VNode | null = null;
|
|
100
|
+
slots.forEach((slot: any) => {
|
|
101
|
+
// suffix
|
|
102
|
+
if (typeof slot.type === "object" && slot.type.name === "GridItem" && slot.props?.suffix !== undefined) suffix = slot;
|
|
103
|
+
// slot children
|
|
104
|
+
if (typeof slot.type === "symbol" && Array.isArray(slot.children)) fields.push(...slot.children);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// 计算 suffix 所占用的列
|
|
108
|
+
let suffixCols = 0;
|
|
109
|
+
if (suffix) {
|
|
110
|
+
suffixCols =
|
|
111
|
+
((suffix as VNode).props![breakPoint.value]?.span ?? (suffix as VNode).props?.span ?? 1) +
|
|
112
|
+
((suffix as VNode).props![breakPoint.value]?.offset ?? (suffix as VNode).props?.offset ?? 0);
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
let find = false;
|
|
116
|
+
fields.reduce((prev = 0, current, index) => {
|
|
117
|
+
prev +=
|
|
118
|
+
((current as VNode)!.props![breakPoint.value]?.span ?? (current as VNode)!.props?.span ?? 1) +
|
|
119
|
+
((current as VNode)!.props![breakPoint.value]?.offset ?? (current as VNode)!.props?.offset ?? 0);
|
|
120
|
+
if (Number(prev) > props.collapsedRows * gridCols.value - suffixCols) {
|
|
121
|
+
hiddenIndex.value = index;
|
|
122
|
+
find = true;
|
|
123
|
+
throw "find it";
|
|
124
|
+
}
|
|
125
|
+
return prev;
|
|
126
|
+
}, 0);
|
|
127
|
+
if (!find) hiddenIndex.value = -1;
|
|
128
|
+
} catch {
|
|
129
|
+
// console.warn(e);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// 断点变化时执行 findIndex
|
|
134
|
+
watch(
|
|
135
|
+
() => breakPoint.value,
|
|
136
|
+
() => {
|
|
137
|
+
if (props.collapsed) findIndex();
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
// 监听 collapsed
|
|
142
|
+
watch(
|
|
143
|
+
() => props.collapsed,
|
|
144
|
+
value => {
|
|
145
|
+
if (value) return findIndex();
|
|
146
|
+
hiddenIndex.value = -1;
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// 设置间距
|
|
151
|
+
const gridGap = computed(() => {
|
|
152
|
+
if (typeof props.gap === "number") return `${props.gap}px`;
|
|
153
|
+
if (Array.isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;
|
|
154
|
+
return "unset";
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// 设置 style
|
|
158
|
+
const style = computed(() => {
|
|
159
|
+
return {
|
|
160
|
+
display: "grid",
|
|
161
|
+
gridGap: gridGap.value,
|
|
162
|
+
gridTemplateColumns: `repeat(${gridCols.value}, minmax(0, 1fr))`
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
defineExpose({ breakPoint });
|
|
167
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item prop="captcha">
|
|
3
|
+
<el-input maxlength="4" placeholder="验证码" v-model="captcha" style="width: 50%; margin-right: 20px; font-size: 14px">
|
|
4
|
+
<template #prefix>
|
|
5
|
+
<el-icon :size="14"><Picture /></el-icon>
|
|
6
|
+
</template>
|
|
7
|
+
</el-input>
|
|
8
|
+
<div class="captcha-container" style="margin-top: 12px">
|
|
9
|
+
<img :src="captchaSrc" alt="验证码" @click="refreshCaptcha" :style="{ width, height }" />
|
|
10
|
+
</div>
|
|
11
|
+
</el-form-item>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref, watch } from "vue";
|
|
16
|
+
import { getImageCaptcha } from "@/api/modules/login";
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
width: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "120px"
|
|
22
|
+
},
|
|
23
|
+
height: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "40px"
|
|
26
|
+
},
|
|
27
|
+
captchaCode: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits(["update:captcha"]); // 定义一个事件,用于传递 captcha_code
|
|
34
|
+
|
|
35
|
+
const captchaSrc = ref("");
|
|
36
|
+
const captcha = ref(props.captchaCode); // 初始化 captcha_code
|
|
37
|
+
|
|
38
|
+
// 监听 captcha_code 的变化,并通过 emit 通知父组件
|
|
39
|
+
watch(captcha, newVal => {
|
|
40
|
+
emit("update:captcha", newVal);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// 刷新验证码的方法
|
|
44
|
+
const refreshCaptcha = async () => {
|
|
45
|
+
try {
|
|
46
|
+
const res = await getImageCaptcha();
|
|
47
|
+
// 直接从响应中获取 Blob 数据
|
|
48
|
+
if (res instanceof Blob) {
|
|
49
|
+
captchaSrc.value = URL.createObjectURL(res);
|
|
50
|
+
}
|
|
51
|
+
captcha.value = ""; // 清空输入框中的验证码
|
|
52
|
+
emit("update:captcha", ""); // 同步清空父组件中的 captcha_code
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.error("获取验证码失败", err);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// 清空验证码输入框
|
|
58
|
+
const clearCaptcha = () => {
|
|
59
|
+
captcha.value = "";
|
|
60
|
+
emit("update:captcha", ""); // 更新v-model绑定的值
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// 暴露 refreshCaptcha 方法给父组件
|
|
64
|
+
defineExpose({
|
|
65
|
+
refreshCaptcha,
|
|
66
|
+
clearCaptcha
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// 初始化验证码
|
|
70
|
+
refreshCaptcha();
|
|
71
|
+
</script>
|