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.
Files changed (376) hide show
  1. fred_admin/__init__.py +91 -0
  2. fred_admin/common/AliyunSms.py +66 -0
  3. fred_admin/common/Blueprints.py +99 -0
  4. fred_admin/common/Email.py +23 -0
  5. fred_admin/common/Extensions.py +319 -0
  6. fred_admin/common/HandleExcetion.py +204 -0
  7. fred_admin/common/ImageVerification.py +117 -0
  8. fred_admin/common/IoTDBClient.py +698 -0
  9. fred_admin/common/PageSchema.py +65 -0
  10. fred_admin/common/Response.py +251 -0
  11. fred_admin/common/Route.py +390 -0
  12. fred_admin/common/RuntimeHook.py +111 -0
  13. fred_admin/common/SchedulerLog.py +277 -0
  14. fred_admin/common/Sqlacodegen.py +170 -0
  15. fred_admin/common/Swagger.py +77 -0
  16. fred_admin/common/SystemLog.py +80 -0
  17. fred_admin/common/Utils.py +1060 -0
  18. fred_admin/common/WechatLogin.py +97 -0
  19. fred_admin/common/__init__.py +3 -0
  20. fred_admin/config/Config.py +104 -0
  21. fred_admin/config/Logger.py +34 -0
  22. fred_admin/config/__init__.py +3 -0
  23. fred_admin/create_module.py +787 -0
  24. fred_admin/demo/app.py +6 -0
  25. fred_admin/demo/common/__init__.py +1 -0
  26. fred_admin/demo/common/config/Config.py +82 -0
  27. fred_admin/demo/common/config/README.md +8 -0
  28. fred_admin/demo/common/config/__init__.py +1 -0
  29. fred_admin/demo/common/config/__pycache__/Config.cpython-312.pyc +0 -0
  30. fred_admin/demo/common/config/__pycache__/__init__.cpython-312.pyc +0 -0
  31. fred_admin/demo/common/config/jwt_secret_key +1 -0
  32. fred_admin/demo/common/config/session_secret_key +1 -0
  33. fred_admin/demo/common/model/__pycache__/__init__.cpython-312.pyc +0 -0
  34. fred_admin/demo/common/model/__pycache__/model.cpython-312.pyc +0 -0
  35. fred_admin/demo/common/model/model.py +274 -0
  36. fred_admin/demo/demo_.gitignore +42 -0
  37. fred_admin/demo/modules/__init__.py +1 -0
  38. fred_admin/demo/modules/admin/README.md +38 -0
  39. fred_admin/demo/modules/admin/__init__.py +3 -0
  40. fred_admin/demo/modules/admin/backend/__init__.py +7 -0
  41. fred_admin/demo/modules/admin/backend/constant/RedisKey.py +10 -0
  42. fred_admin/demo/modules/admin/backend/controller/AdminAuthController.py +39 -0
  43. fred_admin/demo/modules/admin/backend/controller/AdminController.py +226 -0
  44. fred_admin/demo/modules/admin/backend/controller/ApiAuthController.py +93 -0
  45. fred_admin/demo/modules/admin/backend/controller/ButtonManageController.py +90 -0
  46. fred_admin/demo/modules/admin/backend/controller/FileController.py +28 -0
  47. fred_admin/demo/modules/admin/backend/controller/OrganizationController.py +218 -0
  48. fred_admin/demo/modules/admin/backend/controller/RoleController.py +143 -0
  49. fred_admin/demo/modules/admin/backend/controller/SystemController.py +112 -0
  50. fred_admin/demo/modules/admin/backend/controller/SystemLogController.py +63 -0
  51. fred_admin/demo/modules/admin/backend/controller/TableController.py +175 -0
  52. fred_admin/demo/modules/admin/backend/controller/__init__.py +55 -0
  53. fred_admin/demo/modules/admin/backend/schema/AdminSchema.py +356 -0
  54. fred_admin/demo/modules/admin/backend/schema/ApiAuthSchema.py +72 -0
  55. fred_admin/demo/modules/admin/backend/schema/AuthMenuSchema.py +79 -0
  56. fred_admin/demo/modules/admin/backend/schema/ButtonManageSchema.py +98 -0
  57. fred_admin/demo/modules/admin/backend/schema/OrganizationSchema.py +134 -0
  58. fred_admin/demo/modules/admin/backend/schema/RoleSchema.py +94 -0
  59. fred_admin/demo/modules/admin/backend/schema/SystemConfigSchema.py +115 -0
  60. fred_admin/demo/modules/admin/backend/schema/TableSchema.py +153 -0
  61. fred_admin/demo/modules/admin/backend/schema/UploadImg.py +35 -0
  62. fred_admin/demo/modules/admin/backend/schema/__init__.py +0 -0
  63. fred_admin/demo/modules/admin/backend/schema/__pycache__/AdminSchema.cpython-312.pyc +0 -0
  64. fred_admin/demo/modules/admin/backend/schema/__pycache__/ApiAuthSchema.cpython-312.pyc +0 -0
  65. fred_admin/demo/modules/admin/backend/schema/__pycache__/AuthMenuSchema.cpython-312.pyc +0 -0
  66. fred_admin/demo/modules/admin/backend/schema/__pycache__/ButtonManageSchema.cpython-312.pyc +0 -0
  67. fred_admin/demo/modules/admin/backend/schema/__pycache__/OrganizationSchema.cpython-312.pyc +0 -0
  68. fred_admin/demo/modules/admin/backend/schema/__pycache__/RoleSchema.cpython-312.pyc +0 -0
  69. fred_admin/demo/modules/admin/backend/schema/__pycache__/SystemConfigSchema.cpython-312.pyc +0 -0
  70. fred_admin/demo/modules/admin/backend/schema/__pycache__/TableSchema.cpython-312.pyc +0 -0
  71. fred_admin/demo/modules/admin/backend/schema/__pycache__/UploadImg.cpython-312.pyc +0 -0
  72. fred_admin/demo/modules/admin/backend/schema/__pycache__/__init__.cpython-312.pyc +0 -0
  73. fred_admin/demo/modules/admin/backend/service/AdminService.py +377 -0
  74. fred_admin/demo/modules/admin/backend/service/ApiAuthService.py +237 -0
  75. fred_admin/demo/modules/admin/backend/service/AuthButtonsService.py +155 -0
  76. fred_admin/demo/modules/admin/backend/service/AuthMenuService.py +265 -0
  77. fred_admin/demo/modules/admin/backend/service/ButtonManageService.py +386 -0
  78. fred_admin/demo/modules/admin/backend/service/ButtonManageService.py.broken +113 -0
  79. fred_admin/demo/modules/admin/backend/service/FileService.py +33 -0
  80. fred_admin/demo/modules/admin/backend/service/OrganizationService.py +465 -0
  81. fred_admin/demo/modules/admin/backend/service/RoleService.py +445 -0
  82. fred_admin/demo/modules/admin/backend/service/SystemConfigService.py +89 -0
  83. fred_admin/demo/modules/admin/backend/service/SystemLogService.py +142 -0
  84. fred_admin/demo/modules/admin/backend/service/TableService.py +978 -0
  85. fred_admin/demo/modules/admin/backend/service/__init__.py +1 -0
  86. fred_admin/demo/modules/admin/backend/sql/app.db +0 -0
  87. fred_admin/demo/modules/admin/backend/sql/fred.sql +3780 -0
  88. fred_admin/demo/modules/admin/frontend/LICENSE +21 -0
  89. fred_admin/demo/modules/admin/frontend/build/getEnv.ts +46 -0
  90. fred_admin/demo/modules/admin/frontend/build/plugins.ts +118 -0
  91. fred_admin/demo/modules/admin/frontend/build/proxy.ts +30 -0
  92. fred_admin/demo/modules/admin/frontend/commitlint.config.cjs +162 -0
  93. fred_admin/demo/modules/admin/frontend/demo_editorconfig +15 -0
  94. fred_admin/demo/modules/admin/frontend/demo_env +15 -0
  95. fred_admin/demo/modules/admin/frontend/demo_env.development +21 -0
  96. fred_admin/demo/modules/admin/frontend/demo_env.production +25 -0
  97. fred_admin/demo/modules/admin/frontend/demo_eslintignore +15 -0
  98. fred_admin/demo/modules/admin/frontend/demo_eslintrc.cjs +61 -0
  99. fred_admin/demo/modules/admin/frontend/demo_gitignore +27 -0
  100. fred_admin/demo/modules/admin/frontend/demo_prettierignore +9 -0
  101. fred_admin/demo/modules/admin/frontend/demo_prettierrc.cjs +41 -0
  102. fred_admin/demo/modules/admin/frontend/demo_stylelintignore +4 -0
  103. fred_admin/demo/modules/admin/frontend/demo_stylelintrc.cjs +40 -0
  104. fred_admin/demo/modules/admin/frontend/index.html +105 -0
  105. fred_admin/demo/modules/admin/frontend/lint-staged.config.cjs +8 -0
  106. fred_admin/demo/modules/admin/frontend/package.json +129 -0
  107. fred_admin/demo/modules/admin/frontend/pnpm-lock.yaml +11150 -0
  108. fred_admin/demo/modules/admin/frontend/postcss.config.cjs +5 -0
  109. fred_admin/demo/modules/admin/frontend/public/logo.png +0 -0
  110. fred_admin/demo/modules/admin/frontend/public/vue.svg +1 -0
  111. fred_admin/demo/modules/admin/frontend/src/App.vue +44 -0
  112. fred_admin/demo/modules/admin/frontend/src/api/config/servicePort.ts +2 -0
  113. fred_admin/demo/modules/admin/frontend/src/api/helper/axiosCancel.ts +57 -0
  114. fred_admin/demo/modules/admin/frontend/src/api/helper/checkStatus.ts +43 -0
  115. fred_admin/demo/modules/admin/frontend/src/api/index.ts +167 -0
  116. fred_admin/demo/modules/admin/frontend/src/api/interface/index.ts +179 -0
  117. fred_admin/demo/modules/admin/frontend/src/api/model/adminModel.ts +135 -0
  118. fred_admin/demo/modules/admin/frontend/src/api/model/apiAuthModel.ts +72 -0
  119. fred_admin/demo/modules/admin/frontend/src/api/model/index.ts +24 -0
  120. fred_admin/demo/modules/admin/frontend/src/api/model/loginModel.ts +79 -0
  121. fred_admin/demo/modules/admin/frontend/src/api/model/roleModel.ts +68 -0
  122. fred_admin/demo/modules/admin/frontend/src/api/model/storeModel.ts +80 -0
  123. fred_admin/demo/modules/admin/frontend/src/api/model/systemModel.ts +162 -0
  124. fred_admin/demo/modules/admin/frontend/src/api/model/uploadModel.ts +153 -0
  125. fred_admin/demo/modules/admin/frontend/src/api/modules/admin.ts +76 -0
  126. fred_admin/demo/modules/admin/frontend/src/api/modules/apiAuth.ts +53 -0
  127. fred_admin/demo/modules/admin/frontend/src/api/modules/buttonManage.ts +119 -0
  128. fred_admin/demo/modules/admin/frontend/src/api/modules/dataBase.ts +60 -0
  129. fred_admin/demo/modules/admin/frontend/src/api/modules/login.ts +54 -0
  130. fred_admin/demo/modules/admin/frontend/src/api/modules/organization.ts +123 -0
  131. fred_admin/demo/modules/admin/frontend/src/api/modules/role.ts +61 -0
  132. fred_admin/demo/modules/admin/frontend/src/api/modules/store.ts +303 -0
  133. fred_admin/demo/modules/admin/frontend/src/api/modules/system.ts +125 -0
  134. fred_admin/demo/modules/admin/frontend/src/api/modules/upload.ts +132 -0
  135. fred_admin/demo/modules/admin/frontend/src/api/modules/user.ts +63 -0
  136. fred_admin/demo/modules/admin/frontend/src/assets/fonts/DIN.otf +0 -0
  137. fred_admin/demo/modules/admin/frontend/src/assets/fonts/MetroDF.ttf +0 -0
  138. fred_admin/demo/modules/admin/frontend/src/assets/fonts/YouSheBiaoTiHei.ttf +0 -0
  139. fred_admin/demo/modules/admin/frontend/src/assets/fonts/font.scss +14 -0
  140. fred_admin/demo/modules/admin/frontend/src/assets/iconfont/iconfont.scss +51 -0
  141. fred_admin/demo/modules/admin/frontend/src/assets/iconfont/iconfont.ttf +0 -0
  142. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingdaoyu.svg +1 -0
  143. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingdiqiu.svg +1 -0
  144. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingditu.svg +1 -0
  145. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingfanchuan.svg +1 -0
  146. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingfeiji.svg +1 -0
  147. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxinglvhangriji.svg +1 -0
  148. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingtianqiyubao.svg +1 -0
  149. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingxiangjipaizhao.svg +1 -0
  150. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingxiarilengyin.svg +1 -0
  151. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingyoulun.svg +1 -0
  152. fred_admin/demo/modules/admin/frontend/src/assets/icons/xianxingzijiayou.svg +1 -0
  153. fred_admin/demo/modules/admin/frontend/src/assets/images/403.png +0 -0
  154. fred_admin/demo/modules/admin/frontend/src/assets/images/404.png +0 -0
  155. fred_admin/demo/modules/admin/frontend/src/assets/images/500.png +0 -0
  156. fred_admin/demo/modules/admin/frontend/src/assets/images/avatar.gif +0 -0
  157. fred_admin/demo/modules/admin/frontend/src/assets/images/login_bg.svg +33 -0
  158. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left.png +0 -0
  159. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left1.png +0 -0
  160. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left2.png +0 -0
  161. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left3.png +0 -0
  162. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left4.png +0 -0
  163. fred_admin/demo/modules/admin/frontend/src/assets/images/login_left5.png +0 -0
  164. fred_admin/demo/modules/admin/frontend/src/assets/images/logo.svg +1 -0
  165. fred_admin/demo/modules/admin/frontend/src/assets/images/msg01.png +0 -0
  166. fred_admin/demo/modules/admin/frontend/src/assets/images/msg02.png +0 -0
  167. fred_admin/demo/modules/admin/frontend/src/assets/images/msg03.png +0 -0
  168. fred_admin/demo/modules/admin/frontend/src/assets/images/msg04.png +0 -0
  169. fred_admin/demo/modules/admin/frontend/src/assets/images/msg05.png +0 -0
  170. fred_admin/demo/modules/admin/frontend/src/assets/images/notData.png +0 -0
  171. fred_admin/demo/modules/admin/frontend/src/assets/images/welcome.png +0 -0
  172. fred_admin/demo/modules/admin/frontend/src/assets/json/authButtonList.json +8 -0
  173. fred_admin/demo/modules/admin/frontend/src/assets/json/authMenuList.json +1075 -0
  174. fred_admin/demo/modules/admin/frontend/src/assets/mock/Easy-Mock-API.zip +0 -0
  175. fred_admin/demo/modules/admin/frontend/src/components/ECharts/config/index.ts +72 -0
  176. fred_admin/demo/modules/admin/frontend/src/components/ECharts/index.vue +104 -0
  177. fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/403.vue +19 -0
  178. fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/404.vue +19 -0
  179. fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/500.vue +19 -0
  180. fred_admin/demo/modules/admin/frontend/src/components/ErrorMessage/index.scss +32 -0
  181. fred_admin/demo/modules/admin/frontend/src/components/Grid/components/GridItem.vue +68 -0
  182. fred_admin/demo/modules/admin/frontend/src/components/Grid/index.vue +167 -0
  183. fred_admin/demo/modules/admin/frontend/src/components/Grid/interface/index.ts +6 -0
  184. fred_admin/demo/modules/admin/frontend/src/components/ImageCaptcha/index.vue +71 -0
  185. fred_admin/demo/modules/admin/frontend/src/components/ImportExcel/index.scss +3 -0
  186. fred_admin/demo/modules/admin/frontend/src/components/ImportExcel/index.vue +151 -0
  187. fred_admin/demo/modules/admin/frontend/src/components/JsonViewer/index.vue +249 -0
  188. fred_admin/demo/modules/admin/frontend/src/components/Loading/fullScreen.ts +45 -0
  189. fred_admin/demo/modules/admin/frontend/src/components/Loading/index.scss +67 -0
  190. fred_admin/demo/modules/admin/frontend/src/components/Loading/index.vue +13 -0
  191. fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/ColSetting.vue +45 -0
  192. fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/Pagination.vue +101 -0
  193. fred_admin/demo/modules/admin/frontend/src/components/ProTable/components/TableColumn.vue +58 -0
  194. fred_admin/demo/modules/admin/frontend/src/components/ProTable/index.vue +348 -0
  195. fred_admin/demo/modules/admin/frontend/src/components/ProTable/interface/index.ts +87 -0
  196. fred_admin/demo/modules/admin/frontend/src/components/SearchForm/components/SearchFormItem.vue +96 -0
  197. fred_admin/demo/modules/admin/frontend/src/components/SearchForm/index.vue +98 -0
  198. fred_admin/demo/modules/admin/frontend/src/components/SelectFilter/index.scss +63 -0
  199. fred_admin/demo/modules/admin/frontend/src/components/SelectFilter/index.vue +110 -0
  200. fred_admin/demo/modules/admin/frontend/src/components/SelectIcon/index.scss +39 -0
  201. fred_admin/demo/modules/admin/frontend/src/components/SelectIcon/index.vue +90 -0
  202. fred_admin/demo/modules/admin/frontend/src/components/StoreFilter/index.vue +356 -0
  203. fred_admin/demo/modules/admin/frontend/src/components/SvgIcon/index.vue +22 -0
  204. fred_admin/demo/modules/admin/frontend/src/components/SwitchDark/index.vue +12 -0
  205. fred_admin/demo/modules/admin/frontend/src/components/TreeFilter/index.scss +44 -0
  206. fred_admin/demo/modules/admin/frontend/src/components/TreeFilter/index.vue +165 -0
  207. fred_admin/demo/modules/admin/frontend/src/components/Upload/Img.vue +304 -0
  208. fred_admin/demo/modules/admin/frontend/src/components/Upload/Imgs.vue +316 -0
  209. fred_admin/demo/modules/admin/frontend/src/components/WangEditor/index.scss +28 -0
  210. fred_admin/demo/modules/admin/frontend/src/components/WangEditor/index.vue +154 -0
  211. fred_admin/demo/modules/admin/frontend/src/config/amapMap.ts +11 -0
  212. fred_admin/demo/modules/admin/frontend/src/config/index.ts +16 -0
  213. fred_admin/demo/modules/admin/frontend/src/config/nprogress.ts +12 -0
  214. fred_admin/demo/modules/admin/frontend/src/directives/index.ts +28 -0
  215. fred_admin/demo/modules/admin/frontend/src/directives/modules/auth.ts +26 -0
  216. fred_admin/demo/modules/admin/frontend/src/directives/modules/copy.ts +37 -0
  217. fred_admin/demo/modules/admin/frontend/src/directives/modules/debounce.ts +31 -0
  218. fred_admin/demo/modules/admin/frontend/src/directives/modules/draggable.ts +49 -0
  219. fred_admin/demo/modules/admin/frontend/src/directives/modules/longpress.ts +49 -0
  220. fred_admin/demo/modules/admin/frontend/src/directives/modules/throttle.ts +41 -0
  221. fred_admin/demo/modules/admin/frontend/src/directives/modules/waterMarker.ts +36 -0
  222. fred_admin/demo/modules/admin/frontend/src/enums/httpEnum.ts +35 -0
  223. fred_admin/demo/modules/admin/frontend/src/hooks/interface/index.ts +32 -0
  224. fred_admin/demo/modules/admin/frontend/src/hooks/useAuthButtons.ts +22 -0
  225. fred_admin/demo/modules/admin/frontend/src/hooks/useDownload.ts +42 -0
  226. fred_admin/demo/modules/admin/frontend/src/hooks/useHandleData.ts +41 -0
  227. fred_admin/demo/modules/admin/frontend/src/hooks/useI18n.ts +51 -0
  228. fred_admin/demo/modules/admin/frontend/src/hooks/useOnline.ts +31 -0
  229. fred_admin/demo/modules/admin/frontend/src/hooks/useSelection.ts +34 -0
  230. fred_admin/demo/modules/admin/frontend/src/hooks/useTable.ts +150 -0
  231. fred_admin/demo/modules/admin/frontend/src/hooks/useTheme.ts +111 -0
  232. fred_admin/demo/modules/admin/frontend/src/hooks/useTime.ts +38 -0
  233. fred_admin/demo/modules/admin/frontend/src/languages/index.ts +32 -0
  234. fred_admin/demo/modules/admin/frontend/src/languages/modules/en.ts +978 -0
  235. fred_admin/demo/modules/admin/frontend/src/languages/modules/zh.ts +996 -0
  236. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutClassic/index.scss +60 -0
  237. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutClassic/index.vue +62 -0
  238. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutColumns/index.scss +95 -0
  239. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutColumns/index.vue +103 -0
  240. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutTransverse/index.scss +60 -0
  241. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutTransverse/index.vue +61 -0
  242. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutVertical/index.scss +48 -0
  243. fred_admin/demo/modules/admin/frontend/src/layouts/LayoutVertical/index.vue +56 -0
  244. fred_admin/demo/modules/admin/frontend/src/layouts/components/Footer/index.scss +11 -0
  245. fred_admin/demo/modules/admin/frontend/src/layouts/components/Footer/index.vue +9 -0
  246. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/ToolBarLeft.vue +23 -0
  247. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/ToolBarRight.vue +51 -0
  248. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/AssemblySize.vue +37 -0
  249. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Avatar.vue +79 -0
  250. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Breadcrumb.vue +122 -0
  251. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/CollapseIcon.vue +21 -0
  252. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Fullscreen.vue +25 -0
  253. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/InfoDialog.vue +22 -0
  254. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Language.vue +38 -0
  255. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/Message.vue +109 -0
  256. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/PasswordDialog.vue +81 -0
  257. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/SearchMenu.vue +183 -0
  258. fred_admin/demo/modules/admin/frontend/src/layouts/components/Header/components/ThemeSetting.vue +12 -0
  259. fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/components/Maximize.vue +39 -0
  260. fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/index.scss +10 -0
  261. fred_admin/demo/modules/admin/frontend/src/layouts/components/Main/index.vue +88 -0
  262. fred_admin/demo/modules/admin/frontend/src/layouts/components/Menu/SubMenu.vue +85 -0
  263. fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/components/MoreButton.vue +85 -0
  264. fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/index.scss +69 -0
  265. fred_admin/demo/modules/admin/frontend/src/layouts/components/Tabs/index.vue +115 -0
  266. fred_admin/demo/modules/admin/frontend/src/layouts/components/ThemeDrawer/index.scss +137 -0
  267. fred_admin/demo/modules/admin/frontend/src/layouts/components/ThemeDrawer/index.vue +191 -0
  268. fred_admin/demo/modules/admin/frontend/src/layouts/index.vue +42 -0
  269. fred_admin/demo/modules/admin/frontend/src/layouts/indexAsync.vue +46 -0
  270. fred_admin/demo/modules/admin/frontend/src/main.ts +45 -0
  271. fred_admin/demo/modules/admin/frontend/src/routers/index.ts +106 -0
  272. fred_admin/demo/modules/admin/frontend/src/routers/modules/dynamicRouter.ts +99 -0
  273. fred_admin/demo/modules/admin/frontend/src/routers/modules/staticRouter.ts +63 -0
  274. fred_admin/demo/modules/admin/frontend/src/stores/helper/persist.ts +19 -0
  275. fred_admin/demo/modules/admin/frontend/src/stores/index.ts +8 -0
  276. fred_admin/demo/modules/admin/frontend/src/stores/interface/index.ts +63 -0
  277. fred_admin/demo/modules/admin/frontend/src/stores/modules/auth.ts +50 -0
  278. fred_admin/demo/modules/admin/frontend/src/stores/modules/global.ts +55 -0
  279. fred_admin/demo/modules/admin/frontend/src/stores/modules/keepAlive.ts +25 -0
  280. fred_admin/demo/modules/admin/frontend/src/stores/modules/tabs.ts +78 -0
  281. fred_admin/demo/modules/admin/frontend/src/stores/modules/user.ts +23 -0
  282. fred_admin/demo/modules/admin/frontend/src/styles/common.scss +129 -0
  283. fred_admin/demo/modules/admin/frontend/src/styles/element-dark.scss +28 -0
  284. fred_admin/demo/modules/admin/frontend/src/styles/element.scss +264 -0
  285. fred_admin/demo/modules/admin/frontend/src/styles/modules/annotation.scss +746 -0
  286. fred_admin/demo/modules/admin/frontend/src/styles/modules/assembly.scss +714 -0
  287. fred_admin/demo/modules/admin/frontend/src/styles/modules/device-manager.scss +659 -0
  288. fred_admin/demo/modules/admin/frontend/src/styles/modules/directives.scss +381 -0
  289. fred_admin/demo/modules/admin/frontend/src/styles/reset.scss +143 -0
  290. fred_admin/demo/modules/admin/frontend/src/styles/table-optimization.scss +242 -0
  291. fred_admin/demo/modules/admin/frontend/src/styles/theme/aside.ts +16 -0
  292. fred_admin/demo/modules/admin/frontend/src/styles/theme/header.ts +25 -0
  293. fred_admin/demo/modules/admin/frontend/src/styles/theme/menu.ts +31 -0
  294. fred_admin/demo/modules/admin/frontend/src/styles/var.scss +2 -0
  295. fred_admin/demo/modules/admin/frontend/src/typings/global.d.ts +74 -0
  296. fred_admin/demo/modules/admin/frontend/src/typings/utils.d.ts +17 -0
  297. fred_admin/demo/modules/admin/frontend/src/typings/window.d.ts +8 -0
  298. fred_admin/demo/modules/admin/frontend/src/utils/color.ts +59 -0
  299. fred_admin/demo/modules/admin/frontend/src/utils/dict.ts +17 -0
  300. fred_admin/demo/modules/admin/frontend/src/utils/eleValidate.ts +14 -0
  301. fred_admin/demo/modules/admin/frontend/src/utils/errorHandler.ts +28 -0
  302. fred_admin/demo/modules/admin/frontend/src/utils/index.ts +327 -0
  303. fred_admin/demo/modules/admin/frontend/src/utils/is/index.ts +125 -0
  304. fred_admin/demo/modules/admin/frontend/src/utils/mittBus.ts +5 -0
  305. fred_admin/demo/modules/admin/frontend/src/utils/svg.ts +13 -0
  306. fred_admin/demo/modules/admin/frontend/src/views/dataBase/fieldType/components/FieldTypeDrawer.vue +89 -0
  307. fred_admin/demo/modules/admin/frontend/src/views/dataBase/fieldType/index.vue +99 -0
  308. fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/DataBaseDrawer.vue +254 -0
  309. fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/IndexDrawer.vue +226 -0
  310. fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/components/TableDataDrawer.vue +136 -0
  311. fred_admin/demo/modules/admin/frontend/src/views/dataBase/tableManage/index.vue +234 -0
  312. fred_admin/demo/modules/admin/frontend/src/views/echarts/columnChart/index.scss +0 -0
  313. fred_admin/demo/modules/admin/frontend/src/views/echarts/columnChart/index.vue +139 -0
  314. fred_admin/demo/modules/admin/frontend/src/views/echarts/lineChart/index.scss +0 -0
  315. fred_admin/demo/modules/admin/frontend/src/views/echarts/lineChart/index.vue +123 -0
  316. fred_admin/demo/modules/admin/frontend/src/views/echarts/nestedChart/index.scss +0 -0
  317. fred_admin/demo/modules/admin/frontend/src/views/echarts/nestedChart/index.vue +97 -0
  318. fred_admin/demo/modules/admin/frontend/src/views/echarts/pieChart/index.scss +0 -0
  319. fred_admin/demo/modules/admin/frontend/src/views/echarts/pieChart/index.vue +68 -0
  320. fred_admin/demo/modules/admin/frontend/src/views/echarts/radarChart/index.scss +0 -0
  321. fred_admin/demo/modules/admin/frontend/src/views/echarts/radarChart/index.vue +56 -0
  322. fred_admin/demo/modules/admin/frontend/src/views/echarts/waterChart/index.scss +0 -0
  323. fred_admin/demo/modules/admin/frontend/src/views/echarts/waterChart/index.vue +298 -0
  324. fred_admin/demo/modules/admin/frontend/src/views/home/index.scss +12 -0
  325. fred_admin/demo/modules/admin/frontend/src/views/home/index.vue +11 -0
  326. fred_admin/demo/modules/admin/frontend/src/views/login/components/LoginForm.vue +147 -0
  327. fred_admin/demo/modules/admin/frontend/src/views/login/index.scss +83 -0
  328. fred_admin/demo/modules/admin/frontend/src/views/login/index.vue +27 -0
  329. fred_admin/demo/modules/admin/frontend/src/views/proTable/complexProTable/index.vue +176 -0
  330. fred_admin/demo/modules/admin/frontend/src/views/proTable/components/UserDrawer.vue +152 -0
  331. fred_admin/demo/modules/admin/frontend/src/views/proTable/document/index.vue +13 -0
  332. fred_admin/demo/modules/admin/frontend/src/views/proTable/treeProTable/index.vue +129 -0
  333. fred_admin/demo/modules/admin/frontend/src/views/proTable/useProTable/detail.vue +12 -0
  334. fred_admin/demo/modules/admin/frontend/src/views/proTable/useProTable/index.vue +258 -0
  335. fred_admin/demo/modules/admin/frontend/src/views/proTable/useSelectFilter/index.vue +184 -0
  336. fred_admin/demo/modules/admin/frontend/src/views/proTable/useTreeFilter/detail.vue +12 -0
  337. fred_admin/demo/modules/admin/frontend/src/views/proTable/useTreeFilter/index.vue +147 -0
  338. fred_admin/demo/modules/admin/frontend/src/views/system/accountManage/index.vue +244 -0
  339. fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/components/ApiDrawer.vue +114 -0
  340. fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/components/TokenDrawer.vue +160 -0
  341. fred_admin/demo/modules/admin/frontend/src/views/system/apiAuth/index.vue +354 -0
  342. fred_admin/demo/modules/admin/frontend/src/views/system/buttonManage/components/ButtonDrawer.vue +460 -0
  343. fred_admin/demo/modules/admin/frontend/src/views/system/buttonManage/index.vue +426 -0
  344. fred_admin/demo/modules/admin/frontend/src/views/system/configManage/components/ConfigDrawer.vue +106 -0
  345. fred_admin/demo/modules/admin/frontend/src/views/system/configManage/index.vue +116 -0
  346. fred_admin/demo/modules/admin/frontend/src/views/system/departmentManage/index.vue +7 -0
  347. fred_admin/demo/modules/admin/frontend/src/views/system/dictManage/index.vue +7 -0
  348. fred_admin/demo/modules/admin/frontend/src/views/system/menuManage/components/MenuDrawer.vue +262 -0
  349. fred_admin/demo/modules/admin/frontend/src/views/system/menuManage/index.vue +310 -0
  350. fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/CompanyDrawer.vue +72 -0
  351. fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/DepartmentDrawer.vue +120 -0
  352. fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/TeamDrawer.vue +162 -0
  353. fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/components/TeamMemberDrawer.vue +243 -0
  354. fred_admin/demo/modules/admin/frontend/src/views/system/organizationManage/index.vue +414 -0
  355. fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleButtonDrawer.vue +587 -0
  356. fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleDrawer.vue +77 -0
  357. fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleMenuDrawer.vue +236 -0
  358. fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/components/RoleUserDrawer.vue +125 -0
  359. fred_admin/demo/modules/admin/frontend/src/views/system/roleManage/index.vue +143 -0
  360. fred_admin/demo/modules/admin/frontend/src/views/system/systemLog/components/SystemLogDrawer.vue +207 -0
  361. fred_admin/demo/modules/admin/frontend/src/views/system/systemLog/index.vue +219 -0
  362. fred_admin/demo/modules/admin/frontend/src/views/system/timingTask/index.vue +7 -0
  363. fred_admin/demo/modules/admin/frontend/src/vite-env.d.ts +7 -0
  364. fred_admin/demo/modules/admin/frontend/tsconfig.json +42 -0
  365. fred_admin/demo/modules/admin/frontend/vite.config.ts +91 -0
  366. 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
  367. fred_admin/demo/requirements.txt +1 -0
  368. fred_admin/fonts/NotoSansSC-VariableFont_wght.ttf +0 -0
  369. fred_admin/install_hook.py +1633 -0
  370. fred_admin/setup.py +18 -0
  371. fred_admin-1.0.0.dist-info/METADATA +97 -0
  372. fred_admin-1.0.0.dist-info/RECORD +376 -0
  373. fred_admin-1.0.0.dist-info/WHEEL +5 -0
  374. fred_admin-1.0.0.dist-info/entry_points.txt +3 -0
  375. fred_admin-1.0.0.dist-info/licenses/LICENSE +21 -0
  376. fred_admin-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,151 @@
1
+ <template>
2
+ <el-dialog v-model="dialogVisible" :title="`批量添加${parameter.title}`" :destroy-on-close="true" width="580px" draggable>
3
+ <el-form class="drawer-multiColumn-form" label-width="100px">
4
+ <el-form-item label="模板下载 :">
5
+ <el-button type="primary" :icon="Download" @click="downloadTemp"> 点击下载 </el-button>
6
+ </el-form-item>
7
+ <el-form-item label="文件上传 :">
8
+ <el-upload
9
+ action="#"
10
+ class="upload"
11
+ :drag="true"
12
+ :limit="excelLimit"
13
+ :multiple="true"
14
+ :show-file-list="true"
15
+ :http-request="uploadExcel"
16
+ :before-upload="beforeExcelUpload"
17
+ :on-exceed="handleExceed"
18
+ :on-success="excelUploadSuccess"
19
+ :on-error="excelUploadError"
20
+ :accept="parameter.fileType!.join(',')"
21
+ >
22
+ <slot name="empty">
23
+ <el-icon class="el-icon--upload">
24
+ <upload-filled />
25
+ </el-icon>
26
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
27
+ </slot>
28
+ <template #tip>
29
+ <slot name="tip">
30
+ <div class="el-upload__tip">请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M</div>
31
+ </slot>
32
+ </template>
33
+ </el-upload>
34
+ </el-form-item>
35
+ <el-form-item label="数据覆盖 :">
36
+ <el-switch v-model="isCover" />
37
+ </el-form-item>
38
+ </el-form>
39
+ </el-dialog>
40
+ </template>
41
+
42
+ <script setup lang="ts" name="ImportExcel">
43
+ import { useDownload } from "@/hooks/useDownload";
44
+ import { Download } from "@element-plus/icons-vue";
45
+ import { ElNotification, UploadRawFile, UploadRequestOptions } from "element-plus";
46
+ import { ref } from "vue";
47
+
48
+ export interface ExcelParameterProps {
49
+ title: string; // 标题
50
+ fileSize?: number; // 上传文件的大小
51
+ fileType?: File.ExcelMimeType[]; // 上传文件的类型
52
+ tempApi?: (params: any) => Promise<any>; // 下载模板的Api
53
+ importApi?: (params: any) => Promise<any>; // 批量导入的Api
54
+ getTableList?: () => void; // 获取表格数据的Api
55
+ }
56
+
57
+ // 是否覆盖数据
58
+ const isCover = ref(false);
59
+ // 最大文件上传数
60
+ const excelLimit = ref(1);
61
+ // dialog状态
62
+ const dialogVisible = ref(false);
63
+ // 父组件传过来的参数
64
+ const parameter = ref<ExcelParameterProps>({
65
+ title: "",
66
+ fileSize: 5,
67
+ fileType: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]
68
+ });
69
+
70
+ // 接收父组件参数
71
+ const acceptParams = (params: ExcelParameterProps) => {
72
+ parameter.value = { ...parameter.value, ...params };
73
+ dialogVisible.value = true;
74
+ };
75
+
76
+ // Excel 导入模板下载
77
+ const downloadTemp = () => {
78
+ if (!parameter.value.tempApi) return;
79
+ useDownload(parameter.value.tempApi, `${parameter.value.title}模板`);
80
+ };
81
+
82
+ // 文件上传
83
+ const uploadExcel = async (param: UploadRequestOptions) => {
84
+ let excelFormData = new FormData();
85
+ excelFormData.append("file", param.file);
86
+ excelFormData.append("isCover", isCover.value as unknown as Blob);
87
+ await parameter.value.importApi!(excelFormData);
88
+ if (parameter.value.getTableList) {
89
+ parameter.value.getTableList();
90
+ }
91
+ dialogVisible.value = false;
92
+ };
93
+
94
+ /**
95
+ * @description 文件上传之前判断
96
+ * @param file 上传的文件
97
+ * */
98
+ const beforeExcelUpload = (file: UploadRawFile) => {
99
+ const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType);
100
+ const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!;
101
+ if (!isExcel)
102
+ ElNotification({
103
+ title: "温馨提示",
104
+ message: "上传文件只能是 xls / xlsx 格式!",
105
+ type: "warning"
106
+ });
107
+ if (!fileSize)
108
+ setTimeout(() => {
109
+ ElNotification({
110
+ title: "温馨提示",
111
+ message: `上传文件大小不能超过 ${parameter.value.fileSize}MB!`,
112
+ type: "warning"
113
+ });
114
+ }, 0);
115
+ return isExcel && fileSize;
116
+ };
117
+
118
+ // 文件数超出提示
119
+ const handleExceed = () => {
120
+ ElNotification({
121
+ title: "温馨提示",
122
+ message: "最多只能上传一个文件!",
123
+ type: "warning"
124
+ });
125
+ };
126
+
127
+ // 上传错误提示
128
+ const excelUploadError = () => {
129
+ ElNotification({
130
+ title: "温馨提示",
131
+ message: `批量添加${parameter.value.title}失败,请您重新上传!`,
132
+ type: "error"
133
+ });
134
+ };
135
+
136
+ // 上传成功提示
137
+ const excelUploadSuccess = () => {
138
+ ElNotification({
139
+ title: "温馨提示",
140
+ message: `批量添加${parameter.value.title}成功!`,
141
+ type: "success"
142
+ });
143
+ };
144
+
145
+ defineExpose({
146
+ acceptParams
147
+ });
148
+ </script>
149
+ <style lang="scss" scoped>
150
+ @use "./index";
151
+ </style>
@@ -0,0 +1,249 @@
1
+ <template>
2
+ <div class="json-viewer-wrapper">
3
+ <div class="content-header">
4
+ <div class="header-left">
5
+ <span class="content-title">{{ title }}</span>
6
+ <el-tag v-if="hasJsonContent && showStats" type="success" size="small">
7
+ {{ jsonStats }}
8
+ </el-tag>
9
+ </div>
10
+ <div v-if="showActions" class="content-actions">
11
+ <el-button v-if="showExpandCollapse" size="small" @click="toggleExpandCollapse" :icon="isExpanded ? 'Minus' : 'Plus'">
12
+ {{ isExpanded ? "折叠全部" : "展开全部" }}
13
+ </el-button>
14
+ <el-button v-if="showCopy" size="small" @click="copyJsonContent" :icon="'Copy'"> 复制 </el-button>
15
+ <el-button v-if="showDownload" size="small" @click="downloadJson" :icon="'Download'"> 下载 </el-button>
16
+ </div>
17
+ </div>
18
+ <div class="content-display" :style="{ height: height }">
19
+ <div v-if="hasJsonContent" class="json-viewer-container">
20
+ <vue-json-pretty
21
+ :key="`json-viewer-${deep}-${forceUpdate}`"
22
+ :data="parsedJsonData"
23
+ :show-length="true"
24
+ :show-double-quotes="false"
25
+ :show-line="true"
26
+ :deep="deep"
27
+ :path="'res'"
28
+ :show-line-number="true"
29
+ :highlight-mouseover-node="true"
30
+ :highlight-selected-node="true"
31
+ :select-on-click-node="true"
32
+ :collapsed-on-click-brackets="true"
33
+ :theme="'light'"
34
+ class="json-pretty"
35
+ />
36
+ </div>
37
+ <div v-else class="empty-json">
38
+ <el-empty :description="emptyText" :image-size="100" />
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ import { ref, computed, nextTick } from "vue";
46
+ import { ElMessage } from "element-plus";
47
+ import VueJsonPretty from "vue-json-pretty";
48
+ import "vue-json-pretty/lib/styles.css";
49
+
50
+ // 类型定义
51
+ interface Props {
52
+ content: string;
53
+ title?: string;
54
+ height?: string;
55
+ emptyText?: string;
56
+ showStats?: boolean;
57
+ showActions?: boolean;
58
+ showExpandCollapse?: boolean;
59
+ showCopy?: boolean;
60
+ showDownload?: boolean;
61
+ downloadFileName?: string;
62
+ deep?: number;
63
+ }
64
+
65
+ // Props
66
+ const props = withDefaults(defineProps<Props>(), {
67
+ content: "",
68
+ title: "配置内容",
69
+ height: "calc(100vh - 400px)",
70
+ emptyText: "暂无配置内容",
71
+ showStats: true,
72
+ showActions: true,
73
+ showExpandCollapse: true,
74
+ showCopy: true,
75
+ showDownload: true,
76
+ downloadFileName: "",
77
+ deep: 3
78
+ });
79
+
80
+ // 响应式数据
81
+ const deep = ref(props.deep);
82
+ const forceUpdate = ref(0);
83
+ const isExpanded = ref(false); // 展开状态
84
+
85
+ // 计算属性
86
+ const hasJsonContent = computed(() => !!(props.content && String(props.content).trim().length > 0));
87
+
88
+ // 解析JSON数据
89
+ const parsedJsonData = computed(() => {
90
+ if (!props.content) return {};
91
+ try {
92
+ // 首先尝试解析为JSON
93
+ return JSON.parse(props.content);
94
+ } catch {
95
+ // 如果JSON解析失败,尝试处理Python字典格式
96
+ const content = props.content.trim();
97
+ if (content.startsWith("{") && content.endsWith("}")) {
98
+ try {
99
+ // 简单的Python字典到JSON转换
100
+ const jsonStr = content
101
+ .replace(/'/g, '"') // 单引号替换为双引号
102
+ .replace(/(\w+):/g, '"$1":') // 键名加引号
103
+ .replace(/: True/g, ": true") // Python True -> JSON true
104
+ .replace(/: False/g, ": false") // Python False -> JSON false
105
+ .replace(/: None/g, ": null"); // Python None -> JSON null
106
+ return JSON.parse(jsonStr);
107
+ } catch {
108
+ return {};
109
+ }
110
+ }
111
+ return {};
112
+ }
113
+ });
114
+
115
+ const jsonStats = computed(() => {
116
+ if (!hasJsonContent.value) return "空配置";
117
+
118
+ const countKeys = (obj: any): number => {
119
+ if (typeof obj !== "object" || obj === null) return 0;
120
+ let count = Object.keys(obj).length;
121
+ for (const key in obj) {
122
+ if (typeof obj[key] === "object" && obj[key] !== null) {
123
+ count += countKeys(obj[key]);
124
+ }
125
+ }
126
+ return count;
127
+ };
128
+
129
+ const parsedData = parsedJsonData.value;
130
+ if (!parsedData || Object.keys(parsedData).length === 0) {
131
+ return "配置格式错误";
132
+ }
133
+
134
+ const totalKeys = countKeys(parsedData);
135
+ return `${totalKeys} 个配置项`;
136
+ });
137
+
138
+ // 方法
139
+ const toggleExpandCollapse = async () => {
140
+ if (isExpanded.value) {
141
+ // 当前是展开状态,执行折叠
142
+ deep.value = 1; // 设置为1来折叠所有子节点,只保留根节点
143
+ isExpanded.value = false;
144
+ } else {
145
+ // 当前是折叠状态,执行展开
146
+ deep.value = Infinity; // 设置为无穷大来展开所有
147
+ isExpanded.value = true;
148
+ }
149
+ forceUpdate.value++; // 强制重新渲染
150
+ await nextTick(); // 等待DOM更新
151
+ };
152
+
153
+ // 工具方法
154
+ const copyJsonContent = async () => {
155
+ try {
156
+ await navigator.clipboard.writeText(props.content);
157
+ ElMessage.success("配置内容已复制到剪贴板");
158
+ } catch {
159
+ ElMessage.error("复制失败");
160
+ }
161
+ };
162
+
163
+ const downloadJson = () => {
164
+ try {
165
+ const blob = new Blob([props.content], { type: "application/json" });
166
+ const url = URL.createObjectURL(blob);
167
+ const link = document.createElement("a");
168
+ link.href = url;
169
+ const fileName = props.downloadFileName || `json-config-${Date.now()}.json`;
170
+ link.download = fileName;
171
+ document.body.appendChild(link);
172
+ link.click();
173
+ document.body.removeChild(link);
174
+ URL.revokeObjectURL(url);
175
+ ElMessage.success("配置文件已下载");
176
+ } catch {
177
+ ElMessage.error("下载失败");
178
+ }
179
+ };
180
+
181
+ // 暴露方法给父组件
182
+ defineExpose({
183
+ toggleExpandCollapse,
184
+ copyJsonContent,
185
+ downloadJson
186
+ });
187
+ </script>
188
+
189
+ <style scoped lang="scss">
190
+ .json-viewer-wrapper {
191
+ .content-header {
192
+ display: flex;
193
+ justify-content: space-between;
194
+ align-items: center;
195
+ margin-bottom: 0;
196
+ padding-bottom: 4px;
197
+ border-bottom: 1px solid #e4e7ed;
198
+
199
+ .header-left {
200
+ display: flex;
201
+ align-items: center;
202
+ gap: 12px;
203
+
204
+ .content-title {
205
+ font-weight: 600;
206
+ color: #303133;
207
+ }
208
+ }
209
+
210
+ .content-actions {
211
+ display: flex;
212
+ gap: 8px;
213
+ }
214
+ }
215
+
216
+ .content-display {
217
+ border: 1px solid #e4e7ed;
218
+ border-radius: 6px;
219
+ background-color: #fafafa;
220
+ min-height: 300px;
221
+ overflow: hidden;
222
+
223
+ .json-viewer-container {
224
+ height: 100%;
225
+ background-color: #f8f9fa;
226
+ overflow: auto;
227
+ border-radius: 6px;
228
+ border: 1px solid #e4e7ed;
229
+ padding: 16px;
230
+
231
+ .json-pretty {
232
+ font-family: "JetBrains Mono", "Fira Code", "Consolas", "Monaco", "Courier New", monospace;
233
+ font-size: 13px;
234
+ line-height: 1.6;
235
+ }
236
+ }
237
+
238
+ .empty-json {
239
+ height: 100%;
240
+ display: flex;
241
+ align-items: center;
242
+ justify-content: center;
243
+ background-color: #f8f9fa;
244
+ border-radius: 6px;
245
+ border: 1px solid #e4e7ed;
246
+ }
247
+ }
248
+ }
249
+ </style>
@@ -0,0 +1,45 @@
1
+ import { ElLoading } from "element-plus";
2
+
3
+ /* 全局请求 loading */
4
+ let loadingInstance: ReturnType<typeof ElLoading.service>;
5
+
6
+ /**
7
+ * @description 开启 Loading
8
+ * */
9
+ const startLoading = () => {
10
+ loadingInstance = ElLoading.service({
11
+ fullscreen: true,
12
+ lock: true,
13
+ text: "Loading",
14
+ background: "rgba(0, 0, 0, 0.7)"
15
+ });
16
+ };
17
+
18
+ /**
19
+ * @description 结束 Loading
20
+ * */
21
+ const endLoading = () => {
22
+ loadingInstance.close();
23
+ };
24
+
25
+ /**
26
+ * @description 显示全屏加载
27
+ * */
28
+ let needLoadingRequestCount = 0;
29
+ export const showFullScreenLoading = () => {
30
+ if (needLoadingRequestCount === 0) {
31
+ startLoading();
32
+ }
33
+ needLoadingRequestCount++;
34
+ };
35
+
36
+ /**
37
+ * @description 隐藏全屏加载
38
+ * */
39
+ export const tryHideFullScreenLoading = () => {
40
+ if (needLoadingRequestCount <= 0) return;
41
+ needLoadingRequestCount--;
42
+ if (needLoadingRequestCount === 0) {
43
+ endLoading();
44
+ }
45
+ };
@@ -0,0 +1,67 @@
1
+ .loading-box {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: 100%;
7
+ height: 100%;
8
+ .loading-wrap {
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ padding: 98px;
13
+ }
14
+ }
15
+ .dot {
16
+ position: relative;
17
+ box-sizing: border-box;
18
+ display: inline-block;
19
+ width: 32px;
20
+ height: 32px;
21
+ font-size: 32px;
22
+ transform: rotate(45deg);
23
+ animation: ant-rotate 1.2s infinite linear;
24
+ }
25
+ .dot i {
26
+ position: absolute;
27
+ display: block;
28
+ width: 14px;
29
+ height: 14px;
30
+ background-color: var(--el-color-primary);
31
+ border-radius: 100%;
32
+ opacity: 0.3;
33
+ transform: scale(0.75);
34
+ transform-origin: 50% 50%;
35
+ animation: ant-spin-move 1s infinite linear alternate;
36
+ }
37
+ .dot i:nth-child(1) {
38
+ top: 0;
39
+ left: 0;
40
+ }
41
+ .dot i:nth-child(2) {
42
+ top: 0;
43
+ right: 0;
44
+ animation-delay: 0.4s;
45
+ }
46
+ .dot i:nth-child(3) {
47
+ right: 0;
48
+ bottom: 0;
49
+ animation-delay: 0.8s;
50
+ }
51
+ .dot i:nth-child(4) {
52
+ bottom: 0;
53
+ left: 0;
54
+ animation-delay: 1.2s;
55
+ }
56
+
57
+ @keyframes ant-rotate {
58
+ to {
59
+ transform: rotate(405deg);
60
+ }
61
+ }
62
+
63
+ @keyframes ant-spin-move {
64
+ to {
65
+ opacity: 1;
66
+ }
67
+ }
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="loading-box">
3
+ <div class="loading-wrap">
4
+ <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup lang="ts" name="Loading"></script>
10
+
11
+ <style scoped lang="scss">
12
+ @use "./index";
13
+ </style>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <!-- 列设置 -->
3
+ <el-drawer v-model="drawerVisible" title="列设置" size="450px">
4
+ <div class="table-main">
5
+ <el-table :data="colSetting" :border="true" row-key="prop" default-expand-all :tree-props="{ children: '_children' }">
6
+ <el-table-column prop="label" align="center" label="列名" />
7
+ <el-table-column v-slot="scope" prop="isShow" align="center" label="显示">
8
+ <el-switch v-model="scope.row.isShow"></el-switch>
9
+ </el-table-column>
10
+ <el-table-column v-slot="scope" prop="sortable" align="center" label="排序">
11
+ <el-switch v-model="scope.row.sortable"></el-switch>
12
+ </el-table-column>
13
+ <template #empty>
14
+ <div class="table-empty">
15
+ <img src="@/assets/images/notData.png" alt="notData" />
16
+ <div>暂无可配置列</div>
17
+ </div>
18
+ </template>
19
+ </el-table>
20
+ </div>
21
+ </el-drawer>
22
+ </template>
23
+
24
+ <script setup lang="ts" name="ColSetting">
25
+ import { ref } from "vue";
26
+ import { ColumnProps } from "@/components/ProTable/interface";
27
+
28
+ defineProps<{ colSetting: ColumnProps[] }>();
29
+
30
+ const drawerVisible = ref<boolean>(false);
31
+
32
+ const openColSetting = () => {
33
+ drawerVisible.value = true;
34
+ };
35
+
36
+ defineExpose({
37
+ openColSetting
38
+ });
39
+ </script>
40
+
41
+ <style scoped lang="scss">
42
+ .cursor-move {
43
+ cursor: move;
44
+ }
45
+ </style>
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <!-- 分页组件 -->
3
+ <div class="pagination-wrapper">
4
+ <el-pagination
5
+ :background="true"
6
+ :current-page="pageable.pageNum"
7
+ :page-size="pageable.pageSize"
8
+ :page-sizes="[10, 25, 50, 100]"
9
+ :total="computedTotal"
10
+ :size="globalStore?.assemblySize ?? 'default'"
11
+ :layout="paginationLayout"
12
+ @size-change="handleSizeChange"
13
+ @current-change="handleCurrentChange"
14
+ ></el-pagination>
15
+ </div>
16
+ </template>
17
+
18
+ <script setup lang="ts" name="Pagination">
19
+ import { useGlobalStore } from "@/stores/modules/global";
20
+ import { computed } from "vue";
21
+ const globalStore = useGlobalStore();
22
+
23
+ interface Pageable {
24
+ pageNum: number;
25
+ pageSize: number;
26
+ total: number;
27
+ }
28
+
29
+ interface PaginationProps {
30
+ pageable: Pageable;
31
+ handleSizeChange: (size: number) => void;
32
+ handleCurrentChange: (currentPage: number) => void;
33
+ useComputedTotal?: boolean; // 是否使用计算后的 total(默认为 true,用于处理后端不返回总记录数的情况)
34
+ tableData?: any[]; // 当前页的表格数据,用于判断是否可以翻页
35
+ }
36
+
37
+ const props = withDefaults(defineProps<PaginationProps>(), {
38
+ useComputedTotal: true
39
+ });
40
+
41
+ // 根据 useComputedTotal 决定分页组件的 layout
42
+ // 如果 useComputedTotal 为 false,使用简化 layout(不显示 total、pager,但显示 jumper)
43
+ // 如果 useComputedTotal 为 true,使用完整 layout(显示所有功能)
44
+ const paginationLayout = computed(() => {
45
+ if (!props.useComputedTotal) {
46
+ // 简化 layout:显示 sizes、prev、next、jumper(不显示 total 和 pager)
47
+ return "sizes, prev, next, jumper";
48
+ }
49
+ // 完整 layout:显示 total、sizes、prev、pager、next、jumper
50
+ return "total, sizes, prev, pager, next, jumper";
51
+ });
52
+
53
+ // 计算 total 值:如果 useComputedTotal 为 false,设置一个足够大的值以支持跳转功能,不限制 total 值
54
+ // 如果 useComputedTotal 为 true,根据当前页数据量判断是否可以翻页
55
+ const computedTotal = computed(() => {
56
+ // 如果不需要计算(useComputedTotal 为 false),设置一个足够大的值以支持跳转功能
57
+ // 不限制 total 值,让用户可以跳转到任意页面
58
+ if (!props.useComputedTotal) {
59
+ // 如果没有数据,返回 0,下一页按钮不可用
60
+ if (!props.tableData || props.tableData.length === 0) {
61
+ return 0;
62
+ }
63
+
64
+ // 设置一个非常大的值(999999999),不限制 total 值,让用户可以跳转到任意页面
65
+ // 这样即使用户输入 1000000 或更大的页码,也能正常跳转
66
+ // 999999999 / 10 = 99999999 页,足够支持大部分场景
67
+ return 999999999;
68
+ }
69
+
70
+ // 如果需要计算(useComputedTotal 为 true),根据当前页数据量判断是否可以翻页
71
+ // 如果有真实的 total 值且大于 0,直接使用
72
+ if (props.pageable.total > 0) {
73
+ return props.pageable.total;
74
+ }
75
+
76
+ // 如果没有 total,根据当前页数据量判断
77
+ if (props.tableData && props.tableData.length > 0) {
78
+ // 如果当前页数据量等于 pageSize,说明可能还有下一页
79
+ if (props.tableData.length >= props.pageable.pageSize) {
80
+ // 设置一个足够大的值,确保 next 按钮可用
81
+ return (props.pageable.pageNum + 1) * props.pageable.pageSize;
82
+ } else {
83
+ // 当前页数据量小于 pageSize,说明可能是最后一页
84
+ // 设置一个刚好能显示当前页的值
85
+ return (props.pageable.pageNum - 1) * props.pageable.pageSize + props.tableData.length;
86
+ }
87
+ }
88
+
89
+ // 如果没有数据,返回 0
90
+ return 0;
91
+ });
92
+ </script>
93
+
94
+ <style scoped>
95
+ .pagination-wrapper {
96
+ padding: 20px 0;
97
+ text-align: center;
98
+ background: #fff;
99
+ border-top: 1px solid #ebeef5;
100
+ }
101
+ </style>