@pubinfo/module-rbac 2.0.0-beta.3

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 (291) hide show
  1. package/package.json +53 -0
  2. package/src/api/modules/assist/gonggaofuwu.ts +109 -0
  3. package/src/api/modules/assist/index.ts +5 -0
  4. package/src/api/modules/assist/qunzujiekou.ts +95 -0
  5. package/src/api/modules/assist/quyujiekou.ts +97 -0
  6. package/src/api/modules/assist/typings.d.ts +364 -0
  7. package/src/api/modules/configData/heibaimingdanfuwu.ts +95 -0
  8. package/src/api/modules/configData/index.ts +5 -0
  9. package/src/api/modules/configData/typings.d.ts +347 -0
  10. package/src/api/modules/configData/xitongpeizhifuwu.ts +322 -0
  11. package/src/api/modules/configData/zidianfuwu.ts +151 -0
  12. package/src/api/modules/log/caozuorizhifuwu.ts +37 -0
  13. package/src/api/modules/log/denglurizhifuwu.ts +37 -0
  14. package/src/api/modules/log/index.ts +4 -0
  15. package/src/api/modules/log/typings.d.ts +179 -0
  16. package/src/api/modules/rbac/gangweijiekou.ts +93 -0
  17. package/src/api/modules/rbac/index.ts +13 -0
  18. package/src/api/modules/rbac/jiaosejiekou.ts +124 -0
  19. package/src/api/modules/rbac/pubJiaosezukongzhiqi.ts +113 -0
  20. package/src/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.ts +186 -0
  21. package/src/api/modules/rbac/typings.d.ts +2001 -0
  22. package/src/api/modules/rbac/yonghujiekou.ts +225 -0
  23. package/src/api/modules/rbac/yonghushoucangbiaojiekou.ts +93 -0
  24. package/src/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +72 -0
  25. package/src/api/modules/rbac/ziyuanjiekou.ts +223 -0
  26. package/src/api/modules/rbac/zuhuguanlijiekou.ts +91 -0
  27. package/src/api/modules/rbac/zuzhijiaosebiaokongzhiqi.ts +76 -0
  28. package/src/api/modules/rbac/zuzhijiekou.ts +171 -0
  29. package/src/api/request.ts +3 -0
  30. package/src/assets/icons/403.svg +1 -0
  31. package/src/assets/icons/403_dark.svg +1 -0
  32. package/src/assets/icons/404.svg +1 -0
  33. package/src/assets/icons/404_dark.svg +1 -0
  34. package/src/assets/icons/add-child.svg +1 -0
  35. package/src/assets/icons/authority.svg +1 -0
  36. package/src/assets/icons/authorize.svg +1 -0
  37. package/src/assets/icons/blacklist-disable.svg +1 -0
  38. package/src/assets/icons/blacklist-enable.svg +1 -0
  39. package/src/assets/icons/browser-360.svg +1 -0
  40. package/src/assets/icons/browser-chrome.svg +1 -0
  41. package/src/assets/icons/browser-edge.svg +1 -0
  42. package/src/assets/icons/browser-ie.svg +1 -0
  43. package/src/assets/icons/browser-other.svg +1 -0
  44. package/src/assets/icons/browser-qq.svg +1 -0
  45. package/src/assets/icons/browser-safari.svg +1 -0
  46. package/src/assets/icons/browser-uc.svg +1 -0
  47. package/src/assets/icons/change-org.svg +1 -0
  48. package/src/assets/icons/edit.svg +1 -0
  49. package/src/assets/icons/empty-data.svg +1 -0
  50. package/src/assets/icons/favorites.svg +1 -0
  51. package/src/assets/icons/icard.svg +1 -0
  52. package/src/assets/icons/icon_animation.svg +1 -0
  53. package/src/assets/icons/icon_breadcrumb.svg +1 -0
  54. package/src/assets/icons/icon_copyright.svg +1 -0
  55. package/src/assets/icons/icon_jt.svg +1 -0
  56. package/src/assets/icons/icon_layout.svg +1 -0
  57. package/src/assets/icons/icon_mainpage.svg +1 -0
  58. package/src/assets/icons/icon_menu.svg +1 -0
  59. package/src/assets/icons/icon_page_size.svg +1 -0
  60. package/src/assets/icons/icon_position_type.svg +1 -0
  61. package/src/assets/icons/icon_safe_manage.svg +1 -0
  62. package/src/assets/icons/icon_screen_scale.svg +6 -0
  63. package/src/assets/icons/icon_system_manage.svg +1 -0
  64. package/src/assets/icons/icon_tabbar.svg +1 -0
  65. package/src/assets/icons/icon_toolbar.svg +1 -0
  66. package/src/assets/icons/icon_topbar.svg +1 -0
  67. package/src/assets/icons/icon_watermark.svg +1 -0
  68. package/src/assets/icons/image-load-fail.svg +1 -0
  69. package/src/assets/icons/log-center.svg +1 -0
  70. package/src/assets/icons/logo-sig.svg +1 -0
  71. package/src/assets/icons/logo.svg +1 -0
  72. package/src/assets/icons/mima.svg +1 -0
  73. package/src/assets/icons/not-data.svg +1 -0
  74. package/src/assets/icons/org-main.svg +1 -0
  75. package/src/assets/icons/org-unmain.svg +1 -0
  76. package/src/assets/icons/process-management.svg +1 -0
  77. package/src/assets/icons/project-management.svg +1 -0
  78. package/src/assets/icons/rbac.svg +1 -0
  79. package/src/assets/icons/remove.svg +1 -0
  80. package/src/assets/icons/resource-app.svg +1 -0
  81. package/src/assets/icons/resource-btn.svg +1 -0
  82. package/src/assets/icons/resource-index.svg +1 -0
  83. package/src/assets/icons/resource-menu.svg +1 -0
  84. package/src/assets/icons/resource-nonmenu.svg +1 -0
  85. package/src/assets/icons/setting-manage.svg +1 -0
  86. package/src/assets/icons/test.svg +1 -0
  87. package/src/assets/icons/theme-check-mark.svg +1 -0
  88. package/src/assets/icons/theme-title.svg +1 -0
  89. package/src/assets/icons/toolbar-collapse.svg +1 -0
  90. package/src/assets/icons/tree_icon.svg +1 -0
  91. package/src/assets/icons/tree_icon_checked.svg +1 -0
  92. package/src/assets/icons/view.svg +1 -0
  93. package/src/assets/icons/workbench.svg +1 -0
  94. package/src/assets/icons/zddata.svg +1 -0
  95. package/src/assets/icons/zy_checked.svg +1 -0
  96. package/src/assets/icons/zy_default.svg +1 -0
  97. package/src/assets/images/layout/item1.webp +0 -0
  98. package/src/assets/images/layout/item1_dark.webp +0 -0
  99. package/src/assets/images/layout/item2.webp +0 -0
  100. package/src/assets/images/layout/item2_dark.webp +0 -0
  101. package/src/assets/images/layout/item3.webp +0 -0
  102. package/src/assets/images/layout/item3_dark.webp +0 -0
  103. package/src/assets/images/layout/item4.webp +0 -0
  104. package/src/assets/images/layout/item4_dark.webp +0 -0
  105. package/src/assets/images/layout/item5.webp +0 -0
  106. package/src/assets/images/layout/item5_dark.webp +0 -0
  107. package/src/assets/images/page-width/anto_min_w_dark.webp +0 -0
  108. package/src/assets/images/page-width/auto.webp +0 -0
  109. package/src/assets/images/page-width/auto_dark.webp +0 -0
  110. package/src/assets/images/page-width/auto_min_w.webp +0 -0
  111. package/src/assets/images/page-width/auto_min_w_dark.webp +0 -0
  112. package/src/assets/images/page-width/icon_auto.webp +0 -0
  113. package/src/assets/images/page-width/icon_auto_dark.webp +0 -0
  114. package/src/assets/images/page-width/icon_auto_min_w.webp +0 -0
  115. package/src/assets/images/page-width/icon_auto_min_w_dark.webp +0 -0
  116. package/src/assets/images/page-width/icon_middle.webp +0 -0
  117. package/src/assets/images/page-width/icon_middle_dark.webp +0 -0
  118. package/src/assets/images/page-width/icon_middle_max_w.webp +0 -0
  119. package/src/assets/images/page-width/icon_middle_max_w_dark.webp +0 -0
  120. package/src/assets/images/page-width/middle.webp +0 -0
  121. package/src/assets/images/page-width/middle_dark.webp +0 -0
  122. package/src/assets/images/page-width/middle_max_w.webp +0 -0
  123. package/src/assets/images/page-width/middle_max_w_dark.webp +0 -0
  124. package/src/assets/lottie/breadcrumb/dark/enable.json +1 -0
  125. package/src/assets/lottie/breadcrumb/dark/enableMainMenu.json +1 -0
  126. package/src/assets/lottie/breadcrumb/dark/style.json +1 -0
  127. package/src/assets/lottie/breadcrumb/light/enable.json +1 -0
  128. package/src/assets/lottie/breadcrumb/light/enableMainMenu.json +1 -0
  129. package/src/assets/lottie/breadcrumb/light/style.json +1 -0
  130. package/src/assets/lottie/layout/data-test.json +1 -0
  131. package/src/assets/lottie/layout/data.json +1 -0
  132. package/src/assets/lottie/menu/dark/enableHotkeys.json +1 -0
  133. package/src/assets/lottie/menu/dark/enableSubMenuCollapseButton.json +1 -0
  134. package/src/assets/lottie/menu/dark/isRounded.json +1 -0
  135. package/src/assets/lottie/menu/dark/menuActiveStyle.json +1 -0
  136. package/src/assets/lottie/menu/dark/subMenuCollapse.json +1 -0
  137. package/src/assets/lottie/menu/dark/subMenuUniqueOpened.json +1 -0
  138. package/src/assets/lottie/menu/light/enableHotkeys.json +1 -0
  139. package/src/assets/lottie/menu/light/enableSubMenuCollapseButton.json +1 -0
  140. package/src/assets/lottie/menu/light/isRounded.json +1 -0
  141. package/src/assets/lottie/menu/light/menuActiveStyle.json +1 -0
  142. package/src/assets/lottie/menu/light/subMenuCollapse.json +1 -0
  143. package/src/assets/lottie/menu/light/subMenuUniqueOpened.json +1 -0
  144. package/src/assets/lottie/other/dark/enableCopyright.json +1 -0
  145. package/src/assets/lottie/other/dark/enableHotkeys.json +1 -0
  146. package/src/assets/lottie/other/dark/switchTabbarAndToolbar.json +1 -0
  147. package/src/assets/lottie/other/light/enableCopyright.json +1 -0
  148. package/src/assets/lottie/other/light/enableHotkeys.json +1 -0
  149. package/src/assets/lottie/other/light/switchTabbarAndToolbar.json +1 -0
  150. package/src/assets/lottie/page_animation/dark/fadeinout.json +1 -0
  151. package/src/assets/lottie/page_animation/dark/fadeinout_old.json +1 -0
  152. package/src/assets/lottie/page_animation/dark/tobottom.json +1 -0
  153. package/src/assets/lottie/page_animation/dark/tobottom_old.json +1 -0
  154. package/src/assets/lottie/page_animation/dark/toleft.json +1 -0
  155. package/src/assets/lottie/page_animation/dark/toleft_old.json +1 -0
  156. package/src/assets/lottie/page_animation/dark/toright.json +1 -0
  157. package/src/assets/lottie/page_animation/dark/toright_old.json +1 -0
  158. package/src/assets/lottie/page_animation/dark/totop.json +1 -0
  159. package/src/assets/lottie/page_animation/dark/totop_old.json +1 -0
  160. package/src/assets/lottie/page_animation/light/fadeinout.json +1 -0
  161. package/src/assets/lottie/page_animation/light/tobottom.json +1 -0
  162. package/src/assets/lottie/page_animation/light/toleft.json +1 -0
  163. package/src/assets/lottie/page_animation/light/toright.json +1 -0
  164. package/src/assets/lottie/page_animation/light/totop.json +1 -0
  165. package/src/assets/lottie/tabbar/dark/enable.json +1 -0
  166. package/src/assets/lottie/tabbar/dark/enableHotkeys.json +1 -0
  167. package/src/assets/lottie/tabbar/dark/enableIcon.json +1 -0
  168. package/src/assets/lottie/tabbar/dark/enableMemory.json +1 -0
  169. package/src/assets/lottie/tabbar/dark/style.json +1 -0
  170. package/src/assets/lottie/tabbar/light/enable.json +1 -0
  171. package/src/assets/lottie/tabbar/light/enableHotkeys.json +1 -0
  172. package/src/assets/lottie/tabbar/light/enableIcon.json +1 -0
  173. package/src/assets/lottie/tabbar/light/enableMemory.json +1 -0
  174. package/src/assets/lottie/tabbar/light/style.json +1 -0
  175. package/src/assets/lottie/toolbar/dark/enableColorScheme.json +1 -0
  176. package/src/assets/lottie/toolbar/dark/enableFullscreen.json +1 -0
  177. package/src/assets/lottie/toolbar/dark/enableI18n.json +1 -0
  178. package/src/assets/lottie/toolbar/dark/enableNotification.json +1 -0
  179. package/src/assets/lottie/toolbar/dark/enablePageReload.json +1 -0
  180. package/src/assets/lottie/toolbar/dark/enableUserPreferences.json +1 -0
  181. package/src/assets/lottie/toolbar/dark/navSearchEnable.json +1 -0
  182. package/src/assets/lottie/toolbar/dark/navSearchEnableHotkeys.json +1 -0
  183. package/src/assets/lottie/toolbar/light/enableColorScheme.json +1 -0
  184. package/src/assets/lottie/toolbar/light/enableFullscreen.json +1 -0
  185. package/src/assets/lottie/toolbar/light/enableI18n.json +1 -0
  186. package/src/assets/lottie/toolbar/light/enableNotification.json +1 -0
  187. package/src/assets/lottie/toolbar/light/enablePageReload.json +1 -0
  188. package/src/assets/lottie/toolbar/light/enableUserPreferences.json +1 -0
  189. package/src/assets/lottie/toolbar/light/navSearchEnable.json +1 -0
  190. package/src/assets/lottie/toolbar/light/navSearchEnableHotkeys.json +1 -0
  191. package/src/assets/lottie/watermark/dark/enableWatermark.json +1 -0
  192. package/src/assets/lottie/watermark/light/enableWatermark.json +1 -0
  193. package/src/assets/styles/vxe-table.css +13 -0
  194. package/src/components/GroupSelector/index.vue +311 -0
  195. package/src/components/OrgTree/index.vue +91 -0
  196. package/src/components/OrgUserSelector/OrgSelector.vue +135 -0
  197. package/src/components/OrgUserSelector/UserSelector.vue +164 -0
  198. package/src/components/OrgUserSelector/index.ts +47 -0
  199. package/src/components/OrgUserSelector/provider.ts +373 -0
  200. package/src/components/ResourceSelector/enum.ts +5 -0
  201. package/src/components/ResourceSelector/hooks/useAppAndResource.ts +96 -0
  202. package/src/components/ResourceSelector/index.vue +432 -0
  203. package/src/composables/useLottie.ts +65 -0
  204. package/src/index.ts +31 -0
  205. package/src/interface.ts +54 -0
  206. package/src/routes/index.ts +156 -0
  207. package/src/routes/modules/authority.manage.menu.ts +105 -0
  208. package/src/routes/modules/log.manage.menu.ts +45 -0
  209. package/src/routes/modules/safe.manage.menu.ts +71 -0
  210. package/src/routes/modules/stylesetting.manage.menu.ts +130 -0
  211. package/src/routes/modules/system.manage.menu.ts +92 -0
  212. package/src/stores/index.ts +1 -0
  213. package/src/views/blackWhiteList/components/drawerBlackWhiteList.vue +132 -0
  214. package/src/views/blackWhiteList/enum.ts +7 -0
  215. package/src/views/blackWhiteList/index.vue +309 -0
  216. package/src/views/blackWhiteList/types.ts +4 -0
  217. package/src/views/breadcrumb_setting/animationData.ts +15 -0
  218. package/src/views/breadcrumb_setting/index.vue +147 -0
  219. package/src/views/components/HCheckList.vue +47 -0
  220. package/src/views/components/animation_item.vue +37 -0
  221. package/src/views/components/setItem.vue +126 -0
  222. package/src/views/data-permission/components/createAndEditDataPermission.vue +354 -0
  223. package/src/views/data-permission/enum.ts +59 -0
  224. package/src/views/data-permission/index.vue +190 -0
  225. package/src/views/dictionary/components/drawerDictionary.vue +108 -0
  226. package/src/views/dictionary/components/drawerDictionaryItem.vue +115 -0
  227. package/src/views/dictionary/enum.ts +8 -0
  228. package/src/views/dictionary/index.vue +194 -0
  229. package/src/views/dictionary/itemlist.vue +164 -0
  230. package/src/views/group/components/drawerGroup.vue +177 -0
  231. package/src/views/group/enum.ts +25 -0
  232. package/src/views/group/index.vue +207 -0
  233. package/src/views/layout_setting/index.vue +306 -0
  234. package/src/views/log_center/components/browserType.vue +35 -0
  235. package/src/views/log_center/components/loginHistoryDetail.vue +71 -0
  236. package/src/views/log_center/components/operateHistoryDetail.vue +80 -0
  237. package/src/views/log_center/login_history.vue +239 -0
  238. package/src/views/log_center/operate_history.vue +233 -0
  239. package/src/views/menu_setting/animationData.ts +27 -0
  240. package/src/views/menu_setting/index.vue +207 -0
  241. package/src/views/organization/components/drawerOrganization.vue +161 -0
  242. package/src/views/organization/components/drawerRole.vue +159 -0
  243. package/src/views/organization/components/roleSelect.vue +258 -0
  244. package/src/views/organization/enum.ts +26 -0
  245. package/src/views/organization/index.vue +516 -0
  246. package/src/views/other_setting/animationData.ts +15 -0
  247. package/src/views/other_setting/index.vue +250 -0
  248. package/src/views/other_setting/interface.ts +26 -0
  249. package/src/views/page_animation_setting/animationData.ts +23 -0
  250. package/src/views/page_animation_setting/index.vue +200 -0
  251. package/src/views/page_w_setting/index.vue +238 -0
  252. package/src/views/position/components/drawerPosition.vue +131 -0
  253. package/src/views/position/enum.ts +8 -0
  254. package/src/views/position/index.vue +167 -0
  255. package/src/views/region/components/drawerRegion.vue +143 -0
  256. package/src/views/region/enum.ts +24 -0
  257. package/src/views/region/index.vue +246 -0
  258. package/src/views/resource/components/ResourceEdit.vue +209 -0
  259. package/src/views/resource/components/RoleRelation.vue +100 -0
  260. package/src/views/resource/enum.ts +35 -0
  261. package/src/views/resource/index.vue +237 -0
  262. package/src/views/resource/interface.ts +6 -0
  263. package/src/views/role/components/ResourceRelation.vue +113 -0
  264. package/src/views/role/components/drawerRole.vue +191 -0
  265. package/src/views/role/enum.ts +26 -0
  266. package/src/views/role/index.vue +183 -0
  267. package/src/views/role/interface.ts +6 -0
  268. package/src/views/role_group/components/ResourceRelation.vue +91 -0
  269. package/src/views/role_group/components/drawerRole.vue +153 -0
  270. package/src/views/role_group/components/roleSelect.vue +224 -0
  271. package/src/views/role_group/enum.ts +22 -0
  272. package/src/views/role_group/index.vue +170 -0
  273. package/src/views/role_group/interface.ts +6 -0
  274. package/src/views/safe_setting/index.vue +237 -0
  275. package/src/views/tabbar_setting/animationData.ts +23 -0
  276. package/src/views/tabbar_setting/index.vue +186 -0
  277. package/src/views/tenant/components/TenantEdit.vue +226 -0
  278. package/src/views/tenant/index.vue +192 -0
  279. package/src/views/tenant/interface.ts +4 -0
  280. package/src/views/theme_setting/index.vue +465 -0
  281. package/src/views/toolbar_setting/animationData.ts +42 -0
  282. package/src/views/toolbar_setting/index.vue +189 -0
  283. package/src/views/user/components/OrgAndPosition.vue +156 -0
  284. package/src/views/user/components/UserAuthorization.vue +260 -0
  285. package/src/views/user/components/UserEdit.vue +267 -0
  286. package/src/views/user/components/roleSelect.vue +258 -0
  287. package/src/views/user/enum.ts +13 -0
  288. package/src/views/user/index.vue +266 -0
  289. package/src/views/user/interface.ts +43 -0
  290. package/src/views/watermark_setting/animationData.ts +7 -0
  291. package/src/views/watermark_setting/index.vue +236 -0
@@ -0,0 +1,170 @@
1
+ <script setup lang="tsx">
2
+ import type { ProColumns } from '@pubinfo/pro-components';
3
+ import { deleteRbacPubRoleGroupDelete, postRbacPubRoleGroupPageQuery } from '@/api/modules/rbac';
4
+ import { ProTable } from '@pubinfo/pro-components';
5
+ import { Badge, message, Modal } from 'ant-design-vue';
6
+ import DrawerRole from './components/drawerRole.vue';
7
+ import { ACTION } from './enum';
8
+
9
+ defineOptions({
10
+ name: 'Role',
11
+ });
12
+
13
+ const { auth } = useAuth();
14
+ const tableRef = ref();
15
+ const drawerRoleRef = ref();
16
+
17
+ function getRoleData() {
18
+ tableRef.value.reload();
19
+ }
20
+
21
+ async function request(params: any) {
22
+ const { current, pageSize, ...rest } = params;
23
+ const res = await postRbacPubRoleGroupPageQuery({
24
+ currentPage: current,
25
+ pageSize,
26
+ ...rest,
27
+ });
28
+ return {
29
+ success: res.success,
30
+ data: res.data?.records ?? [],
31
+ total: res.data?.total ?? 0,
32
+ };
33
+ }
34
+ const columns: ProColumns<API.PubRole> = [
35
+ {
36
+ valueType: 'a-input',
37
+ bind: 'value',
38
+ minWidth: 200,
39
+ title: '角色组名称',
40
+ dataIndex: 'name',
41
+ ellipsis: true,
42
+ fieldProps: {
43
+ placeholder: '请输入角色组名称',
44
+ allowClear: true,
45
+ },
46
+ },
47
+ {
48
+ hideInSearch: true,
49
+ minWidth: 80,
50
+ title: '创建人',
51
+ dataIndex: 'createUserName',
52
+ },
53
+ {
54
+ hideInSearch: true,
55
+ minWidth: 100,
56
+ title: '创建部门',
57
+ dataIndex: 'createOrgName',
58
+ },
59
+ {
60
+ hideInSearch: true,
61
+ minWidth: 100,
62
+ title: '创建时间',
63
+ dataIndex: 'createTime',
64
+ },
65
+ {
66
+ hideInSearch: true,
67
+ minWidth: 100,
68
+ title: '修改时间',
69
+ dataIndex: 'updateTime',
70
+ },
71
+ {
72
+ valueType: 'a-select',
73
+ minWidth: 80,
74
+ title: '角色组状态',
75
+ dataIndex: 'enable',
76
+ customRender: ({ text }: { text: boolean }) => {
77
+ return (
78
+ text
79
+ ? <Badge status="success" text="正常" />
80
+ : <Badge status="error" text="关闭" />
81
+ );
82
+ },
83
+ fieldProps: {
84
+ placeholder: '请选择是否启用',
85
+ allowClear: true,
86
+ options: [
87
+ { value: 1, label: '正常' },
88
+ { value: 0, label: '关闭' },
89
+ ],
90
+ },
91
+ },
92
+ {
93
+ hideInSearch: true,
94
+ width: 140,
95
+ title: '操作',
96
+ dataIndex: 'action',
97
+ fixed: 'right',
98
+ hideInTable() {
99
+ return !auth([
100
+ 'role_group_edit',
101
+ 'role_group_remove',
102
+ ]);
103
+ },
104
+ },
105
+ ];
106
+ function onAction(key: string, record?: API.PubRole): void {
107
+ switch (key) {
108
+ case ACTION.EDIT:
109
+ drawerRoleRef.value.open(key, record);
110
+ break;
111
+ case ACTION.ADD:
112
+ drawerRoleRef.value.open(key);
113
+ break;
114
+ case ACTION.REMOVE:
115
+ Modal.confirm({
116
+ title: '删除',
117
+ content: '确定要删除该角色组吗?',
118
+ onOk() {
119
+ deleteRbacPubRoleGroupDelete({ id: record?.id as string }).then((res) => {
120
+ if (res.success) {
121
+ message.success('删除成功');
122
+ getRoleData();
123
+ }
124
+ });
125
+ },
126
+ });
127
+ break;
128
+ }
129
+ }
130
+ </script>
131
+
132
+ <template>
133
+ <div
134
+ py-10px
135
+ px-10px
136
+ w-full
137
+ h-full
138
+ >
139
+ <ProTable
140
+ ref="tableRef"
141
+ row-key="id"
142
+ :request="request"
143
+ :columns="columns"
144
+ auto-height
145
+ :scroll="{ x: 1100 }"
146
+ >
147
+ <template #toolbar>
148
+ <a-button v-auth="'role_group_add'" type="primary" @click="onAction(ACTION.ADD)">
149
+ <PlusCircleOutlined />
150
+ {{ ACTION.ADD }}
151
+ </a-button>
152
+ </template>
153
+ <template #bodyCell="{ column, record }">
154
+ <template v-if="column.dataIndex === 'action'">
155
+ <a-space>
156
+ <a v-auth="'role_edit'" class="flex items-center" @click="onAction(ACTION.EDIT, record)">
157
+ <PubinfoIcon name="edit" class="text-base" />
158
+ <span class="ml-4px">{{ ACTION.EDIT }}</span>
159
+ </a>
160
+ <span v-auth="'role_remove'" class="flex items-center text-red-500 hover:cursor-pointer hover:opacity-80" @click="onAction(ACTION.REMOVE, record)">
161
+ <PubinfoIcon name="remove" class="text-base" />
162
+ <span class="ml-4px">{{ ACTION.REMOVE }}</span>
163
+ </span>
164
+ </a-space>
165
+ </template>
166
+ </template>
167
+ </ProTable>
168
+ <DrawerRole ref="drawerRoleRef" @submit="getRoleData()" />
169
+ </div>
170
+ </template>
@@ -0,0 +1,6 @@
1
+ export type Form = API.PubResource;
2
+ export type AddForm = API.PubResourceAddDto;
3
+ export type EditForm = API.PubResourceUpdateDto;
4
+ export type TreeNode = Form & {
5
+ children?: TreeNode[]
6
+ };
@@ -0,0 +1,237 @@
1
+ <script setup lang="ts">
2
+ import type { Rule } from 'ant-design-vue/es/form';
3
+ import type { UnwrapRef } from 'vue';
4
+ import { getSysconfigGetSysSecurityConfig, postSysconfigEditSysSecurityConfig } from '@/api/modules/configData';
5
+ import { useToggle } from '@vueuse/core';
6
+ import { message } from 'ant-design-vue';
7
+ import { PassStrengthValidator } from 'pubinfo';
8
+ import { reactive, ref } from 'vue';
9
+
10
+ interface FormState {
11
+ blackWhiteListMode: string
12
+ // 是否开启密码错误后锁定账号: true开 false关
13
+ // 选择开的时候出现allowFailCount 和 lockMinutes 2个选项
14
+ lockEnable: boolean
15
+ allowFailCounts: number
16
+ lockMinutes: number
17
+ defaultPassword: string
18
+ expireDays: number
19
+ // 是否开启强制修改初始化密码: true开 false关
20
+ forceChangeInitPwd: boolean
21
+ }
22
+
23
+ const rules: Record<string, Rule[]> = {
24
+ blackWhiteListMode: [
25
+ { required: true, message: '请选择黑白名单模式', trigger: 'change' },
26
+ ],
27
+ lockEnable: [
28
+ { required: true, message: '请选择密码错误后是否锁定账号', trigger: 'change' },
29
+ ],
30
+ lockMinutes: [{ required: true, validator: validateLockMinutes, trigger: 'change' }],
31
+ allowFailCounts: [{ required: true, validator: validateAllowFailCount, trigger: 'change' }],
32
+ defaultPassword: [{ required: true, validator: validatePassword, trigger: 'change' }],
33
+ expireDays: [{ required: true, validator: validateExpireDays, trigger: 'change' }],
34
+ forceChangeInitPwd: [
35
+ { required: true, message: '请选择是否开启强制修改初始化密码', trigger: 'change' },
36
+ ],
37
+ };
38
+
39
+ const formRef = ref();
40
+ const labelCol = { style: { width: '240px' } };
41
+ const wrapperCol = { span: 9 };
42
+ const modeOptions = [
43
+ {
44
+ label: '无模式',
45
+ value: '0',
46
+ },
47
+ {
48
+ label: '黑名单模式',
49
+ value: '1',
50
+ },
51
+ {
52
+ label: '白名单模式',
53
+ value: '2',
54
+ },
55
+ ];
56
+
57
+ const formState: UnwrapRef<FormState> = reactive({
58
+ // 黑白名单模式:'0'.无模式, '1':黑名单模式, '2':白名单模式
59
+ blackWhiteListMode: '0',
60
+ // 密码错误后是否锁定账号, true开 false关
61
+ lockEnable: true,
62
+ // 允许密码连续错误的次数
63
+ allowFailCounts: 5,
64
+ // 锁定多少分钟
65
+ lockMinutes: 10,
66
+ // 默认密码
67
+ defaultPassword: '',
68
+ // 密码过期天数
69
+ expireDays: 30,
70
+ // 是否强制初始化密码,即登录后必须修改默认密码. 1开 0关,
71
+ forceChangeInitPwd: true,
72
+ });
73
+
74
+ const isDefaultPasswordValid = ref(false);
75
+
76
+ onMounted(getSystemSafeConfig);
77
+
78
+ async function validateLockMinutes(_rule: Rule, value: string) {
79
+ if (formState.lockEnable && !value) {
80
+ return Promise.reject(new Error('请输入锁定分钟数'));
81
+ }
82
+ if (Number.isNaN(+value) || +value < 1 || +value > 360) {
83
+ return Promise.reject(new Error('锁定分钟数应为[1~360]之间的正整数'));
84
+ }
85
+ return Promise.resolve();
86
+ };
87
+
88
+ async function validateAllowFailCount(_rule: Rule, value: string) {
89
+ if (formState.lockEnable && !value) {
90
+ return Promise.reject(new Error('请输入允许密码连续错误次数'));
91
+ }
92
+ if (Number.isNaN(+value) || +value < 1 || +value > 20) {
93
+ return Promise.reject(new Error('允许密码连续错误次数应为[1~20]之间的正整数'));
94
+ }
95
+ return Promise.resolve();
96
+ };
97
+
98
+ async function validateExpireDays(_rule: Rule, value: string) {
99
+ if (formState.lockEnable && !value) {
100
+ return Promise.reject(new Error('请输入密码过期天数'));
101
+ }
102
+ if (Number.isNaN(+value) || +value < 30 || +value > 360) {
103
+ return Promise.reject(new Error('密码过期天数应为[30~360]之间的正整数'));
104
+ }
105
+ return Promise.resolve();
106
+ };
107
+
108
+ async function validatePassword(_rule: Rule, value: string) {
109
+ if (!value) {
110
+ return Promise.reject(new Error('请输入默认密码'));
111
+ }
112
+ if (!isDefaultPasswordValid.value) {
113
+ return Promise.reject(new Error('密码规则校验不通过'));
114
+ }
115
+ return Promise.resolve();
116
+ };
117
+
118
+ function getSystemSafeConfig() {
119
+ getSysconfigGetSysSecurityConfig().then((res) => {
120
+ if (res && res.data && res.data.content && res.success) {
121
+ Object.assign(formState, JSON.parse(res.data.content));
122
+ }
123
+ });
124
+ }
125
+
126
+ const [loading, setLoading] = useToggle(false);
127
+ async function onSubmit() {
128
+ if (loading.value) {
129
+ return;
130
+ }
131
+ setLoading(true);
132
+ try {
133
+ await formRef.value?.validate();
134
+ const {
135
+ blackWhiteListMode,
136
+ lockEnable,
137
+ allowFailCounts,
138
+ lockMinutes,
139
+ defaultPassword,
140
+ expireDays,
141
+ forceChangeInitPwd,
142
+ } = formState;
143
+
144
+ const params = {
145
+ blackWhiteListMode,
146
+ lockEnable,
147
+ defaultPassword,
148
+ expireDays,
149
+ forceChangeInitPwd,
150
+ };
151
+
152
+ if (lockEnable) {
153
+ Object.assign(params, {
154
+ allowFailCounts,
155
+ lockMinutes,
156
+ });
157
+ }
158
+
159
+ await postSysconfigEditSysSecurityConfig({ content: JSON.stringify(params) });
160
+ setLoading(false);
161
+ message.success('配置更改成功');
162
+ }
163
+ catch (error) {
164
+ setLoading(false);
165
+ }
166
+ }
167
+ </script>
168
+
169
+ <template>
170
+ <div
171
+ w-full
172
+ h-full
173
+ pt-10px
174
+ px-10px
175
+ overflow-auto
176
+ >
177
+ <div h-full min-w-1130px>
178
+ <div
179
+ class="pt-20px flex flex-col box-border bg-white dark:bg-[#141414] text-[#4e5969] dark:text-[#C9CDD4]"
180
+ >
181
+ <a-form
182
+ ref="formRef"
183
+ :model="formState"
184
+ :rules="rules"
185
+ :label-col="labelCol"
186
+ :wrapper-col="wrapperCol"
187
+ class="safe-rule-form"
188
+ >
189
+ <a-form-item label="黑白名单模式" name="blackWhiteListMode">
190
+ <a-select v-model:value="formState.blackWhiteListMode" placeholder="请选择" :options="modeOptions" />
191
+ </a-form-item>
192
+ <a-form-item label="是否开启密码错误后锁定账号" name="lockEnable">
193
+ <a-switch v-model:checked="formState.lockEnable" />
194
+ </a-form-item>
195
+ <!-- 应该用formState.lockEnable 但会导致formRef.value.validate不存在 -->
196
+ <template v-if="formState.lockEnable">
197
+ <!-- v-if="formState.lockEnable" key="allowFailCounts" 或 v-show -->
198
+ <a-form-item label="允许密码连续错误次数" name="allowFailCounts">
199
+ <a-input v-model:value="formState.allowFailCounts" mr-12px />次
200
+ </a-form-item>
201
+ <!-- v-if="formState.lockEnable" key="lockMinutes" 或 v-show -->
202
+ <a-form-item label="锁定多少分钟" name="lockMinutes">
203
+ <span><a-input v-model:value="formState.lockMinutes" mr-12px />分钟</span>
204
+ </a-form-item>
205
+ </template>
206
+ <a-form-item label="默认密码设置" name="defaultPassword">
207
+ <a-input v-model:value="formState.defaultPassword" />
208
+ </a-form-item>
209
+ <a-form-item label="密码过期天数" name="expireDays">
210
+ <a-input v-model:value="formState.expireDays" mr-12px />天
211
+ </a-form-item>
212
+ <a-form-item label="是否开启强制修改初始化密码" name="forceChangeInitPwd">
213
+ <a-switch v-model:checked="formState.forceChangeInitPwd" />
214
+ </a-form-item>
215
+ <div v-auth="'change_safe_setting'" class="p-16px text-right b-t-1 b-t-style-solid b-t-color-[#e5e6eb] dark:b-t-color-[#424242]">
216
+ <a-button type="primary" @click="onSubmit">
217
+ 更改配置
218
+ </a-button>
219
+ </div>
220
+ </a-form>
221
+ </div>
222
+
223
+ <div class="mt-10px bg-white dark:bg-[#141414] text-[#4e5969] dark:text-[#C9CDD4]">
224
+ <PassStrengthValidator v-model="formState.defaultPassword" v-model:validate="isDefaultPasswordValid" vertical />
225
+ </div>
226
+ </div>
227
+ </div>
228
+ </template>
229
+
230
+ <style lang="scss">
231
+ .safe-rule-form {
232
+ .ant-input,
233
+ .ant-select {
234
+ width: 90%;
235
+ }
236
+ }
237
+ </style>
@@ -0,0 +1,23 @@
1
+ import darkEnableData from '@/assets/lottie/tabbar/dark/enable.json?url';
2
+ import darkEnableHotkeysData from '@/assets/lottie/tabbar/dark/enableHotkeys.json?url';
3
+ import darkEnableIconData from '@/assets/lottie/tabbar/dark/enableIcon.json?url';
4
+ import darkEnableMemoryData from '@/assets/lottie/tabbar/dark/enableMemory.json?url';
5
+ import darkStyleData from '@/assets/lottie/tabbar/dark/style.json?url';
6
+ import lightEnableData from '@/assets/lottie/tabbar/light/enable.json?url';
7
+ import lightEnableHotkeysData from '@/assets/lottie/tabbar/light/enableHotkeys.json?url';
8
+ import lightEnableIconData from '@/assets/lottie/tabbar/light/enableIcon.json?url';
9
+ import lightEnableMemoryData from '@/assets/lottie/tabbar/light/enableMemory.json?url';
10
+ import lightStyleData from '@/assets/lottie/tabbar/light/style.json?url';
11
+
12
+ export {
13
+ darkEnableData,
14
+ darkEnableHotkeysData,
15
+ darkEnableIconData,
16
+ darkEnableMemoryData,
17
+ darkStyleData,
18
+ lightEnableData,
19
+ lightEnableHotkeysData,
20
+ lightEnableIconData,
21
+ lightEnableMemoryData,
22
+ lightStyleData,
23
+ };
@@ -0,0 +1,186 @@
1
+ <script setup lang="ts">
2
+ import { postSysconfigAddOrEidtSysThemeStyleConfig } from '@/api/modules/configData';
3
+ import { useSettingsStore } from '@/stores';
4
+ import { message } from 'ant-design-vue';
5
+ import SetItem from '../components/setItem.vue';
6
+ import {
7
+ darkEnableData,
8
+ darkEnableHotkeysData,
9
+ darkEnableIconData,
10
+ darkEnableMemoryData,
11
+ darkStyleData,
12
+ lightEnableData,
13
+ lightEnableHotkeysData,
14
+ lightEnableIconData,
15
+ lightEnableMemoryData,
16
+ lightStyleData,
17
+ } from './animationData.ts';
18
+
19
+ defineOptions({
20
+ name: 'TabbarAnimationSetting',
21
+ });
22
+
23
+ const settingsStore = useSettingsStore();
24
+
25
+ const styleOptions = [
26
+ { label: '时尚', value: 'fashion' },
27
+ { label: '卡片', value: 'card' },
28
+ { label: '方块', value: 'square' },
29
+ ];
30
+ type RelVal = Exclude<Settings.tabbar['style'], undefined>;
31
+ type Val = RelVal | '';
32
+
33
+ const tabbarAnimationList = reactive<
34
+ {
35
+ name: string
36
+ type: string
37
+ descripe: string
38
+ open: boolean
39
+ activeStyle: Val
40
+ styleOptions?: typeof styleOptions
41
+ lightData: string
42
+ darkData: string
43
+ }[]
44
+ >([
45
+ {
46
+ name: '是否启用',
47
+ type: 'switch',
48
+ descripe: '',
49
+ open: settingsStore.globalSettings.tabbar.enable,
50
+ activeStyle: '',
51
+ lightData: lightEnableData,
52
+ darkData: darkEnableData,
53
+ },
54
+ {
55
+ name: '风格',
56
+ type: 'check',
57
+ descripe: '',
58
+ open: true,
59
+ activeStyle: settingsStore.globalSettings.tabbar.style,
60
+ styleOptions,
61
+ lightData: lightStyleData,
62
+ darkData: darkStyleData,
63
+ },
64
+ {
65
+ name: '是否显示图标',
66
+ type: 'switch',
67
+ descripe: '',
68
+ open: settingsStore.globalSettings.tabbar.enableIcon,
69
+ activeStyle: '',
70
+ lightData: lightEnableIconData,
71
+ darkData: darkEnableIconData,
72
+ },
73
+ {
74
+ name: '是否启用记忆功能',
75
+ type: 'switch',
76
+ descripe: '开启该功能后,非固定和非常驻的标签页将在本次会话窗口中始终存在,刷新浏览器或重新登录时不会丢失',
77
+ open: settingsStore.globalSettings.tabbar.enableMemory,
78
+ activeStyle: '',
79
+ lightData: lightEnableMemoryData,
80
+ darkData: darkEnableMemoryData,
81
+ },
82
+
83
+ {
84
+ name: '是否启用快捷键',
85
+ type: 'switch',
86
+ descripe: '',
87
+ open: settingsStore.globalSettings.tabbar.enableHotkeys,
88
+ activeStyle: '',
89
+ lightData: lightEnableHotkeysData,
90
+ darkData: darkEnableHotkeysData,
91
+ },
92
+ ]);
93
+
94
+ let jsonStr = '';
95
+ function onChange(index: number, ck: boolean | Val) {
96
+ switch (index) {
97
+ case 0:
98
+ settingsStore.globalSettings.tabbar.enable = ck as boolean;
99
+ jsonStr = JSON.stringify({
100
+ tabbar: {
101
+ enable: ck,
102
+ },
103
+ });
104
+ break;
105
+ case 1:
106
+ settingsStore.globalSettings.tabbar.style = ck as RelVal;
107
+ jsonStr = JSON.stringify({
108
+ tabbar: {
109
+ style: ck,
110
+ },
111
+ });
112
+ break;
113
+ case 2:
114
+ settingsStore.globalSettings.tabbar.enableIcon = ck as boolean;
115
+ jsonStr = JSON.stringify({
116
+ tabbar: {
117
+ enableIcon: ck,
118
+ },
119
+ });
120
+ break;
121
+ case 3:
122
+ settingsStore.globalSettings.tabbar.enableMemory = ck as boolean;
123
+ jsonStr = JSON.stringify({
124
+ tabbar: {
125
+ enableMemory: ck,
126
+ },
127
+ });
128
+ break;
129
+ case 4:
130
+ settingsStore.globalSettings.tabbar.enableHotkeys = ck as boolean;
131
+ jsonStr = JSON.stringify({
132
+ tabbar: {
133
+ enableHotkeys: ck,
134
+ },
135
+ });
136
+ break;
137
+ }
138
+ setStyle(jsonStr);
139
+ }
140
+
141
+ function setStyle(jsonStr: string) {
142
+ postSysconfigAddOrEidtSysThemeStyleConfig({ content: jsonStr }).then((res: API.ResponseDataBoolean) => {
143
+ if (res.success) {
144
+ message.success('设置成功');
145
+ }
146
+ });
147
+ }
148
+ </script>
149
+
150
+ <template>
151
+ <div
152
+ w-full
153
+ h-full
154
+ p-10px
155
+ >
156
+ <div class="w-full h-full bg-white overflow-y-auto p-10px flex flex-col box-border dark:bg-[#141414]">
157
+ <div class="h-[38px] pl-[16px] flex flex-row items-center bar-header">
158
+ <PubinfoIcon name="icon_tabbar" class="text-base mr-[6px]" :size="22" />
159
+ <span class="text-[16px] text-[#1d2129] dark:text-[#C9CDD4]">标签栏</span>
160
+ </div>
161
+ <div class="mt-[22px] grid grid-cols-3 gap-[20px] px-30px w-full h-0 max-w-1500px" aspect="[3/2] ">
162
+ <SetItem
163
+ v-for="(item, index) in tabbarAnimationList"
164
+ :key="item.name"
165
+ class="mb-20px"
166
+ aspect="[9/6]"
167
+ :name="item.name"
168
+ :descripe="item.descripe"
169
+ :open="item.open"
170
+ :type="item.type"
171
+ :active-style="item.activeStyle"
172
+ :style-options="item.styleOptions"
173
+ :light-animation-data="item.lightData"
174
+ :dark-animation-data="item.darkData"
175
+ @change="(val: Val) => onChange(index, val)"
176
+ />
177
+ </div>
178
+ </div>
179
+ </div>
180
+ </template>
181
+
182
+ <style lang="scss" scoped>
183
+ .bar-header {
184
+ background: var(--g-bg);
185
+ }
186
+ </style>