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,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="drawerVisible" :destroy-on-close="true" size="450px" :title="`${drawerProps.title}部门`">
|
|
3
|
+
<el-form
|
|
4
|
+
ref="ruleFormRef"
|
|
5
|
+
label-width="100px"
|
|
6
|
+
label-suffix=" :"
|
|
7
|
+
:rules="rules"
|
|
8
|
+
:disabled="drawerProps.isView"
|
|
9
|
+
:model="drawerProps.row"
|
|
10
|
+
:hide-required-asterisk="drawerProps.isView"
|
|
11
|
+
>
|
|
12
|
+
<el-form-item label="部门名称" prop="name">
|
|
13
|
+
<el-input v-model="drawerProps.row.name" placeholder="请填写部门名称" clearable></el-input>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="所属公司" prop="company_id">
|
|
16
|
+
<el-select
|
|
17
|
+
v-model="drawerProps.row.company_id"
|
|
18
|
+
placeholder="请选择所属公司"
|
|
19
|
+
clearable
|
|
20
|
+
filterable
|
|
21
|
+
:disabled="drawerProps.isView"
|
|
22
|
+
style="width: 100%"
|
|
23
|
+
@change="handleCompanyChange"
|
|
24
|
+
>
|
|
25
|
+
<el-option v-for="company in companyOptions" :key="company.id" :label="company.name" :value="company.id" />
|
|
26
|
+
</el-select>
|
|
27
|
+
</el-form-item>
|
|
28
|
+
</el-form>
|
|
29
|
+
<template #footer>
|
|
30
|
+
<el-button @click="drawerVisible = false">取消</el-button>
|
|
31
|
+
<el-button v-show="!drawerProps.isView" type="primary" @click="handleSubmit">确定</el-button>
|
|
32
|
+
</template>
|
|
33
|
+
</el-drawer>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import { ref, reactive, onMounted } from "vue";
|
|
38
|
+
import { ElMessage, FormInstance } from "element-plus";
|
|
39
|
+
import type { DepartmentInfo, CompanyInfo } from "@/api/modules/organization";
|
|
40
|
+
import { getAllCompanies } from "@/api/modules/organization";
|
|
41
|
+
|
|
42
|
+
const rules = reactive({
|
|
43
|
+
name: [{ required: true, message: "请填写部门名称", trigger: "blur" }],
|
|
44
|
+
company_id: [{ required: true, message: "请选择所属公司", trigger: "change" }]
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
interface DrawerProps {
|
|
48
|
+
title: string;
|
|
49
|
+
isView: boolean;
|
|
50
|
+
row: DepartmentInfo;
|
|
51
|
+
api?: (params: any) => Promise<any>;
|
|
52
|
+
getTableList?: () => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const drawerVisible = ref(false);
|
|
56
|
+
const drawerProps = ref<DrawerProps>({
|
|
57
|
+
isView: false,
|
|
58
|
+
title: "",
|
|
59
|
+
row: { name: "", company_id: undefined }
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const companyOptions = ref<CompanyInfo[]>([]);
|
|
63
|
+
|
|
64
|
+
const fetchCompanies = async () => {
|
|
65
|
+
try {
|
|
66
|
+
const response = await getAllCompanies();
|
|
67
|
+
companyOptions.value = response.data || [];
|
|
68
|
+
} catch {
|
|
69
|
+
companyOptions.value = [];
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleCompanyChange = () => {
|
|
74
|
+
// 公司变更时的处理逻辑
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const acceptParams = (params: DrawerProps) => {
|
|
78
|
+
drawerProps.value = params;
|
|
79
|
+
// 新增时,确保company_id为undefined,不显示0
|
|
80
|
+
if (params.title === "新增" && !drawerProps.value.row.company_id) {
|
|
81
|
+
drawerProps.value.row.company_id = undefined;
|
|
82
|
+
}
|
|
83
|
+
// 编辑时,如果company_id为0,也设置为undefined
|
|
84
|
+
if (drawerProps.value.row.company_id === 0) {
|
|
85
|
+
drawerProps.value.row.company_id = undefined;
|
|
86
|
+
}
|
|
87
|
+
drawerVisible.value = true;
|
|
88
|
+
fetchCompanies();
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const ruleFormRef = ref<FormInstance>();
|
|
92
|
+
const handleSubmit = () => {
|
|
93
|
+
ruleFormRef.value!.validate(async valid => {
|
|
94
|
+
if (!valid) return;
|
|
95
|
+
try {
|
|
96
|
+
// 确保提交的数据中company_id是有效的数字
|
|
97
|
+
const submitData = {
|
|
98
|
+
...drawerProps.value.row,
|
|
99
|
+
company_id: drawerProps.value.row.company_id
|
|
100
|
+
};
|
|
101
|
+
await drawerProps.value.api!(submitData);
|
|
102
|
+
ElMessage.success({ message: `${drawerProps.value.title}部门成功!` });
|
|
103
|
+
if (drawerProps.value.getTableList) {
|
|
104
|
+
drawerProps.value.getTableList();
|
|
105
|
+
}
|
|
106
|
+
drawerVisible.value = false;
|
|
107
|
+
} catch {
|
|
108
|
+
// 静默处理错误
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
onMounted(() => {
|
|
114
|
+
fetchCompanies();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
defineExpose({
|
|
118
|
+
acceptParams
|
|
119
|
+
});
|
|
120
|
+
</script>
|
fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/TeamDrawer.vue
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="drawerVisible" :destroy-on-close="true" size="450px" :title="`${drawerProps.title}团队`">
|
|
3
|
+
<el-form
|
|
4
|
+
ref="ruleFormRef"
|
|
5
|
+
label-width="100px"
|
|
6
|
+
label-suffix=" :"
|
|
7
|
+
:rules="rules"
|
|
8
|
+
:disabled="drawerProps.isView"
|
|
9
|
+
:model="drawerProps.row"
|
|
10
|
+
:hide-required-asterisk="drawerProps.isView"
|
|
11
|
+
>
|
|
12
|
+
<el-form-item label="团队名称" prop="name">
|
|
13
|
+
<el-input v-model="drawerProps.row.name" placeholder="请填写团队名称" clearable></el-input>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="所属公司" prop="company_id">
|
|
16
|
+
<el-select
|
|
17
|
+
v-model="selectedCompanyId"
|
|
18
|
+
placeholder="请选择所属公司"
|
|
19
|
+
clearable
|
|
20
|
+
filterable
|
|
21
|
+
:disabled="drawerProps.isView"
|
|
22
|
+
style="width: 100%"
|
|
23
|
+
@change="handleCompanyChange"
|
|
24
|
+
>
|
|
25
|
+
<el-option v-for="company in companyOptions" :key="company.id" :label="company.name" :value="company.id" />
|
|
26
|
+
</el-select>
|
|
27
|
+
</el-form-item>
|
|
28
|
+
<el-form-item label="所属部门" prop="department_id">
|
|
29
|
+
<el-select
|
|
30
|
+
v-model="drawerProps.row.department_id"
|
|
31
|
+
placeholder="请先选择公司,再选择部门"
|
|
32
|
+
clearable
|
|
33
|
+
filterable
|
|
34
|
+
:disabled="drawerProps.isView || !selectedCompanyId"
|
|
35
|
+
style="width: 100%"
|
|
36
|
+
>
|
|
37
|
+
<el-option
|
|
38
|
+
v-for="department in departmentOptions"
|
|
39
|
+
:key="department.id"
|
|
40
|
+
:label="department.name"
|
|
41
|
+
:value="department.id"
|
|
42
|
+
/>
|
|
43
|
+
</el-select>
|
|
44
|
+
</el-form-item>
|
|
45
|
+
</el-form>
|
|
46
|
+
<template #footer>
|
|
47
|
+
<el-button @click="drawerVisible = false">取消</el-button>
|
|
48
|
+
<el-button v-show="!drawerProps.isView" type="primary" @click="handleSubmit">确定</el-button>
|
|
49
|
+
</template>
|
|
50
|
+
</el-drawer>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup lang="ts">
|
|
54
|
+
import { ref, reactive, onMounted } from "vue";
|
|
55
|
+
import { ElMessage, FormInstance } from "element-plus";
|
|
56
|
+
import type { TeamInfo, CompanyInfo, DepartmentInfo } from "@/api/modules/organization";
|
|
57
|
+
import { getAllCompanies, getDepartmentsByCompany } from "@/api/modules/organization";
|
|
58
|
+
|
|
59
|
+
const rules = reactive({
|
|
60
|
+
name: [{ required: true, message: "请填写团队名称", trigger: "blur" }],
|
|
61
|
+
department_id: [{ required: true, message: "请选择所属部门", trigger: "change" }]
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
interface DrawerProps {
|
|
65
|
+
title: string;
|
|
66
|
+
isView: boolean;
|
|
67
|
+
row: TeamInfo;
|
|
68
|
+
api?: (params: any) => Promise<any>;
|
|
69
|
+
getTableList?: () => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const drawerVisible = ref(false);
|
|
73
|
+
const drawerProps = ref<DrawerProps>({
|
|
74
|
+
isView: false,
|
|
75
|
+
title: "",
|
|
76
|
+
row: { name: "", department_id: undefined }
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const companyOptions = ref<CompanyInfo[]>([]);
|
|
80
|
+
const departmentOptions = ref<DepartmentInfo[]>([]);
|
|
81
|
+
const selectedCompanyId = ref<number | undefined>(undefined);
|
|
82
|
+
|
|
83
|
+
const fetchCompanies = async () => {
|
|
84
|
+
try {
|
|
85
|
+
const response = await getAllCompanies();
|
|
86
|
+
companyOptions.value = response.data || [];
|
|
87
|
+
} catch {
|
|
88
|
+
companyOptions.value = [];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const fetchDepartments = async (companyId: number) => {
|
|
93
|
+
try {
|
|
94
|
+
const response = await getDepartmentsByCompany({ company_id: companyId });
|
|
95
|
+
departmentOptions.value = response.data || [];
|
|
96
|
+
} catch {
|
|
97
|
+
departmentOptions.value = [];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const handleCompanyChange = (companyId: number | undefined) => {
|
|
102
|
+
if (companyId) {
|
|
103
|
+
fetchDepartments(companyId);
|
|
104
|
+
// 清空部门选择
|
|
105
|
+
drawerProps.value.row.department_id = undefined;
|
|
106
|
+
} else {
|
|
107
|
+
departmentOptions.value = [];
|
|
108
|
+
drawerProps.value.row.department_id = undefined;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const acceptParams = (params: DrawerProps) => {
|
|
113
|
+
drawerProps.value = params;
|
|
114
|
+
// 新增时,确保department_id为undefined,不显示0
|
|
115
|
+
if (params.title === "新增") {
|
|
116
|
+
drawerProps.value.row.department_id = undefined;
|
|
117
|
+
selectedCompanyId.value = undefined;
|
|
118
|
+
departmentOptions.value = [];
|
|
119
|
+
} else {
|
|
120
|
+
// 编辑时,如果department_id为0,也设置为undefined
|
|
121
|
+
if (drawerProps.value.row.department_id === 0) {
|
|
122
|
+
drawerProps.value.row.department_id = undefined;
|
|
123
|
+
}
|
|
124
|
+
// 如果是编辑模式,根据部门ID反查公司ID
|
|
125
|
+
if (drawerProps.value.row.department_id && drawerProps.value.row.company_id) {
|
|
126
|
+
selectedCompanyId.value = drawerProps.value.row.company_id;
|
|
127
|
+
fetchDepartments(drawerProps.value.row.company_id);
|
|
128
|
+
} else {
|
|
129
|
+
selectedCompanyId.value = undefined;
|
|
130
|
+
departmentOptions.value = [];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
drawerVisible.value = true;
|
|
135
|
+
fetchCompanies();
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const ruleFormRef = ref<FormInstance>();
|
|
139
|
+
const handleSubmit = () => {
|
|
140
|
+
ruleFormRef.value!.validate(async valid => {
|
|
141
|
+
if (!valid) return;
|
|
142
|
+
try {
|
|
143
|
+
await drawerProps.value.api!(drawerProps.value.row);
|
|
144
|
+
ElMessage.success({ message: `${drawerProps.value.title}团队成功!` });
|
|
145
|
+
if (drawerProps.value.getTableList) {
|
|
146
|
+
drawerProps.value.getTableList();
|
|
147
|
+
}
|
|
148
|
+
drawerVisible.value = false;
|
|
149
|
+
} catch {
|
|
150
|
+
// 静默处理错误
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
onMounted(() => {
|
|
156
|
+
fetchCompanies();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
defineExpose({
|
|
160
|
+
acceptParams
|
|
161
|
+
});
|
|
162
|
+
</script>
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="drawerVisible" :destroy-on-close="true" size="50%" :title="`${teamName} - 人员管理`">
|
|
3
|
+
<div class="team-member-drawer">
|
|
4
|
+
<!-- 添加人员区域 -->
|
|
5
|
+
<div class="add-member-section">
|
|
6
|
+
<el-form :inline="true" class="add-member-form">
|
|
7
|
+
<el-form-item label="选择人员">
|
|
8
|
+
<el-select
|
|
9
|
+
v-model="selectedAdminIds"
|
|
10
|
+
placeholder="请选择要添加的管理员"
|
|
11
|
+
clearable
|
|
12
|
+
filterable
|
|
13
|
+
multiple
|
|
14
|
+
style="width: 400px"
|
|
15
|
+
@change="handleAdminSelectChange"
|
|
16
|
+
>
|
|
17
|
+
<el-option v-for="admin in availableAdmins" :key="admin.id" :label="admin.username" :value="admin.id" />
|
|
18
|
+
</el-select>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
<el-form-item>
|
|
21
|
+
<el-button type="primary" :disabled="!selectedAdminIds.length" @click="addMembers">添加人员</el-button>
|
|
22
|
+
</el-form-item>
|
|
23
|
+
</el-form>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<!-- 人员列表 -->
|
|
27
|
+
<ProTable
|
|
28
|
+
ref="proTable"
|
|
29
|
+
:columns="columns"
|
|
30
|
+
:request-api="getTableList"
|
|
31
|
+
:init-param="initParam"
|
|
32
|
+
:data-callback="dataCallback"
|
|
33
|
+
row-key="id"
|
|
34
|
+
:tool-button="false"
|
|
35
|
+
:pagination="true"
|
|
36
|
+
>
|
|
37
|
+
<template #tableHeader>
|
|
38
|
+
<div class="member-count">当前团队人员:{{ memberCount }} 人</div>
|
|
39
|
+
</template>
|
|
40
|
+
<!-- 头像 -->
|
|
41
|
+
<template #avatar="scope">
|
|
42
|
+
<el-avatar v-if="scope.row.avatar" :src="scope.row.avatar" :size="40" />
|
|
43
|
+
<el-avatar v-else :size="40">
|
|
44
|
+
<span>{{ scope.row.username?.charAt(0)?.toUpperCase() || "U" }}</span>
|
|
45
|
+
</el-avatar>
|
|
46
|
+
</template>
|
|
47
|
+
<!-- 角色 -->
|
|
48
|
+
<template #is_manager="scope">
|
|
49
|
+
<el-select
|
|
50
|
+
:model-value="scope.row.is_manager"
|
|
51
|
+
size="small"
|
|
52
|
+
style="width: 120px"
|
|
53
|
+
@change="val => handleManagerChange(scope.row, val)"
|
|
54
|
+
>
|
|
55
|
+
<el-option label="普通成员" :value="0" />
|
|
56
|
+
<el-option label="公司管理员" :value="1" />
|
|
57
|
+
<el-option label="部门管理" :value="2" />
|
|
58
|
+
<el-option label="团队管理" :value="3" />
|
|
59
|
+
</el-select>
|
|
60
|
+
</template>
|
|
61
|
+
<!-- 操作 -->
|
|
62
|
+
<template #operation="scope">
|
|
63
|
+
<el-button type="danger" link :icon="Delete" @click="removeMember(scope.row)">移除</el-button>
|
|
64
|
+
</template>
|
|
65
|
+
</ProTable>
|
|
66
|
+
</div>
|
|
67
|
+
</el-drawer>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts" name="TeamMemberDrawer">
|
|
71
|
+
import { reactive, ref, computed } from "vue";
|
|
72
|
+
import { ElMessage } from "element-plus";
|
|
73
|
+
import { Delete } from "@element-plus/icons-vue";
|
|
74
|
+
import { useHandleData } from "@/hooks/useHandleData";
|
|
75
|
+
import ProTable from "@/components/ProTable/index.vue";
|
|
76
|
+
import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
|
77
|
+
import {
|
|
78
|
+
getTeamMemberList,
|
|
79
|
+
addTeamMembers,
|
|
80
|
+
deleteTeamMember,
|
|
81
|
+
getAvailableAdmins,
|
|
82
|
+
updateTeamMemberManager,
|
|
83
|
+
type TeamMemberInfo,
|
|
84
|
+
type AvailableAdminInfo
|
|
85
|
+
} from "@/api/modules/organization";
|
|
86
|
+
import { useI18n } from "vue-i18n";
|
|
87
|
+
|
|
88
|
+
const { t } = useI18n();
|
|
89
|
+
|
|
90
|
+
interface DrawerProps {
|
|
91
|
+
teamId: number;
|
|
92
|
+
teamName: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const drawerVisible = ref(false);
|
|
96
|
+
const drawerProps = ref<DrawerProps>({
|
|
97
|
+
teamId: 0,
|
|
98
|
+
teamName: ""
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const proTable = ref<ProTableInstance>();
|
|
102
|
+
const initParam = reactive({ team_id: 0 });
|
|
103
|
+
const selectedAdminIds = ref<number[]>([]);
|
|
104
|
+
const availableAdmins = ref<AvailableAdminInfo[]>([]);
|
|
105
|
+
const memberCount = ref(0);
|
|
106
|
+
|
|
107
|
+
const dataCallback = (data: any) => {
|
|
108
|
+
const result = {
|
|
109
|
+
records: data.records || [],
|
|
110
|
+
total: data.total || 0
|
|
111
|
+
};
|
|
112
|
+
memberCount.value = result.total;
|
|
113
|
+
return result;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const getTableList = (params: any) => {
|
|
117
|
+
return getTeamMemberList({ ...params, team_id: initParam.team_id });
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// 获取可用管理员列表
|
|
121
|
+
const fetchAvailableAdmins = async () => {
|
|
122
|
+
if (!initParam.team_id) return;
|
|
123
|
+
try {
|
|
124
|
+
const response = await getAvailableAdmins({ team_id: initParam.team_id });
|
|
125
|
+
availableAdmins.value = response.data || [];
|
|
126
|
+
} catch {
|
|
127
|
+
availableAdmins.value = [];
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const handleAdminSelectChange = () => {
|
|
132
|
+
// 选择变化时的处理
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const addMembers = async () => {
|
|
136
|
+
if (!selectedAdminIds.value.length) {
|
|
137
|
+
ElMessage.warning("请选择要添加的管理员");
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
await addTeamMembers({
|
|
143
|
+
team_id: initParam.team_id,
|
|
144
|
+
admin_ids: selectedAdminIds.value
|
|
145
|
+
});
|
|
146
|
+
ElMessage.success("添加成功");
|
|
147
|
+
selectedAdminIds.value = [];
|
|
148
|
+
proTable.value?.getTableList();
|
|
149
|
+
fetchAvailableAdmins();
|
|
150
|
+
} catch {
|
|
151
|
+
// 静默处理错误
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const removeMember = async (row: TeamMemberInfo) => {
|
|
156
|
+
await useHandleData(
|
|
157
|
+
deleteTeamMember,
|
|
158
|
+
{ team_id: initParam.team_id, admin_id: row.admin_id },
|
|
159
|
+
`确定移除"${row.username}"吗?`,
|
|
160
|
+
"warning",
|
|
161
|
+
t
|
|
162
|
+
);
|
|
163
|
+
proTable.value?.getTableList();
|
|
164
|
+
fetchAvailableAdmins();
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const handleManagerChange = async (row: TeamMemberInfo, isManager: number) => {
|
|
168
|
+
try {
|
|
169
|
+
await updateTeamMemberManager({
|
|
170
|
+
team_id: initParam.team_id,
|
|
171
|
+
admin_id: row.admin_id,
|
|
172
|
+
is_manager: isManager
|
|
173
|
+
});
|
|
174
|
+
const managerLabels: Record<number, string> = {
|
|
175
|
+
0: "普通成员",
|
|
176
|
+
1: "公司管理员",
|
|
177
|
+
2: "部门管理",
|
|
178
|
+
3: "团队管理"
|
|
179
|
+
};
|
|
180
|
+
ElMessage.success(`已设置为${managerLabels[isManager] || "普通成员"}`);
|
|
181
|
+
proTable.value?.getTableList();
|
|
182
|
+
} catch {
|
|
183
|
+
// 恢复原值
|
|
184
|
+
proTable.value?.getTableList();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const columns = computed<ColumnProps<TeamMemberInfo>[]>(() => [
|
|
189
|
+
{ prop: "id", label: "ID", width: 80 },
|
|
190
|
+
{
|
|
191
|
+
prop: "avatar",
|
|
192
|
+
label: "头像",
|
|
193
|
+
width: 100
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
prop: "username",
|
|
197
|
+
label: "用户名"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
prop: "is_manager",
|
|
201
|
+
label: "角色",
|
|
202
|
+
width: 150
|
|
203
|
+
},
|
|
204
|
+
{ prop: "operation", label: "操作", fixed: "right", width: 120 }
|
|
205
|
+
]);
|
|
206
|
+
|
|
207
|
+
const acceptParams = (params: DrawerProps) => {
|
|
208
|
+
drawerProps.value = params;
|
|
209
|
+
initParam.team_id = params.teamId;
|
|
210
|
+
drawerVisible.value = true;
|
|
211
|
+
selectedAdminIds.value = [];
|
|
212
|
+
fetchAvailableAdmins();
|
|
213
|
+
// 延迟刷新表格,确保initParam已更新
|
|
214
|
+
setTimeout(() => {
|
|
215
|
+
proTable.value?.getTableList();
|
|
216
|
+
}, 100);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
defineExpose({
|
|
220
|
+
acceptParams
|
|
221
|
+
});
|
|
222
|
+
</script>
|
|
223
|
+
|
|
224
|
+
<style scoped lang="scss">
|
|
225
|
+
.team-member-drawer {
|
|
226
|
+
.add-member-section {
|
|
227
|
+
margin-bottom: 20px;
|
|
228
|
+
padding: 16px;
|
|
229
|
+
background: #f5f7fa;
|
|
230
|
+
border-radius: 4px;
|
|
231
|
+
|
|
232
|
+
.add-member-form {
|
|
233
|
+
margin: 0;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.member-count {
|
|
238
|
+
font-size: 14px;
|
|
239
|
+
color: #606266;
|
|
240
|
+
font-weight: 500;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
</style>
|