@pubinfo/module-rbac 2.0.0-beta.31 → 2.0.0-beta.32

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 (228) hide show
  1. package/dist/OrgSelector-DWT1w1h-.js +27 -0
  2. package/dist/OrgUserSelector-VjiKyUET.js +1 -0
  3. package/dist/ResourceSelector-D1mJz7F1.js +1 -0
  4. package/dist/_baseClone-CBD6n26E.js +1 -0
  5. package/dist/_initCloneObject-CzZMvAGd.js +1 -0
  6. package/dist/_plugin-vue_export-helper-BP6J6hmQ.js +1 -0
  7. package/dist/animation_item-D4pH5y91.js +2 -0
  8. package/dist/assist-D6hXeP0y.js +1 -0
  9. package/dist/blackWhiteList-C0vzrSes.js +1 -0
  10. package/dist/breadcrumb_setting-105xA0or.js +1 -0
  11. package/dist/browserType-WCrQysPD.js +1 -0
  12. package/dist/chunk-oLkGOndT.js +1 -0
  13. package/dist/cloneDeep-B4mZx_tg.js +1 -0
  14. package/dist/components/GroupSelector/index.vue.d.ts +4 -4
  15. package/dist/components/OrgTree/index.vue.d.ts +1 -1
  16. package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +4 -4
  17. package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +4 -4
  18. package/dist/components/ResourceSelector/index.vue.d.ts +5 -5
  19. package/dist/composables/useLottie.d.ts +1 -1
  20. package/dist/configData-C-XgieQd.js +1 -0
  21. package/dist/data-permission-DcXUZZ1G.js +1 -0
  22. package/dist/dictionary-BafvPpvf.js +1 -0
  23. package/dist/enum-C0pwhwh3.js +1 -0
  24. package/dist/enum-CEWFYwLa.js +1 -0
  25. package/dist/enum-CFY_YSvf.js +1 -0
  26. package/dist/enum-G-OAfo9d.js +1 -0
  27. package/dist/group-C1e_vupc.js +1 -0
  28. package/dist/index.js +1 -9
  29. package/dist/interface.d.ts +1 -1
  30. package/dist/itemlist-Dy9O9k6h.js +1 -0
  31. package/dist/layout_setting-BzYjnHvF.js +1 -0
  32. package/dist/login_history-DXixU5An.js +1 -0
  33. package/dist/menu_setting-DWM1r6js.js +1 -0
  34. package/dist/not-data-D8CCqeCi.js +1 -0
  35. package/dist/operate_history-DaDVex6q.js +1 -0
  36. package/dist/organization-CsSd1lr2.js +10 -0
  37. package/dist/other_setting-Dq67iG6v.js +1 -0
  38. package/dist/page_animation_setting-Cj6N5TJq.js +1 -0
  39. package/dist/page_w_setting-Dmik-Xi7.js +1 -0
  40. package/dist/position-CzxbbVOL.js +1 -0
  41. package/dist/rbac-DJC95w7l.js +1 -0
  42. package/dist/region-DGxnlpyo.js +1 -0
  43. package/dist/request-C2x7wP-H.js +1 -0
  44. package/dist/resource-BFe47BKW.js +1 -0
  45. package/dist/role-Bo47PnSD.js +1 -0
  46. package/dist/role_group-BVPoRr1q.js +1 -0
  47. package/dist/routes/index.d.ts +1 -1
  48. package/dist/routes/modules/authority.manage.menu.d.ts +1 -1
  49. package/dist/routes/modules/log.manage.menu.d.ts +1 -1
  50. package/dist/routes/modules/safe.manage.menu.d.ts +1 -1
  51. package/dist/routes/modules/stylesetting.manage.menu.d.ts +1 -1
  52. package/dist/routes/modules/system.manage.menu.d.ts +1 -1
  53. package/dist/safe_setting-kBJgSjzd.js +1 -0
  54. package/dist/setItem-DXsVoKM_.js +1 -0
  55. package/dist/shared-DcMP4Woj.js +1 -0
  56. package/dist/stores-pP-UCq1z.js +1 -0
  57. package/dist/style.css +2 -1
  58. package/dist/tabbar_setting-C9uHCbA0.js +1 -0
  59. package/dist/tenant-BA6IO7wP.js +1 -0
  60. package/dist/theme_setting-CxoaGtjk.js +1 -0
  61. package/dist/toolbar_setting-DyiZvqwf.js +1 -0
  62. package/dist/useAppAndResource-D5u0TDHS.js +1 -0
  63. package/dist/user-B5W5JRXl.js +1 -0
  64. package/dist/views/blackWhiteList/components/drawerBlackWhiteList.vue.d.ts +4 -4
  65. package/dist/views/blackWhiteList/index.vue.d.ts +319 -319
  66. package/dist/views/breadcrumb_setting/index.vue.d.ts +1 -1
  67. package/dist/views/components/HCheckList.vue.d.ts +3 -3
  68. package/dist/views/components/animation_item.vue.d.ts +5 -5
  69. package/dist/views/components/setItem.vue.d.ts +17 -17
  70. package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +28 -28
  71. package/dist/views/data-permission/index.vue.d.ts +343 -343
  72. package/dist/views/dictionary/components/drawerDictionary.vue.d.ts +4 -4
  73. package/dist/views/dictionary/components/drawerDictionaryItem.vue.d.ts +4 -4
  74. package/dist/views/dictionary/index.vue.d.ts +319 -319
  75. package/dist/views/dictionary/itemlist.vue.d.ts +319 -319
  76. package/dist/views/group/components/drawerGroup.vue.d.ts +4 -4
  77. package/dist/views/group/index.vue.d.ts +319 -319
  78. package/dist/views/layout_setting/index.vue.d.ts +1 -1
  79. package/dist/views/log_center/components/browserType.vue.d.ts +3 -3
  80. package/dist/views/log_center/components/loginHistoryDetail.vue.d.ts +4 -4
  81. package/dist/views/log_center/components/operateHistoryDetail.vue.d.ts +4 -4
  82. package/dist/views/log_center/login_history.vue.d.ts +315 -315
  83. package/dist/views/log_center/operate_history.vue.d.ts +315 -315
  84. package/dist/views/menu_setting/index.vue.d.ts +1 -1
  85. package/dist/views/organization/components/drawerOrganization.vue.d.ts +4 -4
  86. package/dist/views/organization/components/drawerRole.vue.d.ts +7 -7
  87. package/dist/views/organization/components/roleSelect.vue.d.ts +4 -4
  88. package/dist/views/organization/index.vue.d.ts +14 -14
  89. package/dist/views/other_setting/index.vue.d.ts +1 -1
  90. package/dist/views/page_animation_setting/index.vue.d.ts +1 -1
  91. package/dist/views/page_w_setting/index.vue.d.ts +1 -1
  92. package/dist/views/position/components/drawerPosition.vue.d.ts +4 -4
  93. package/dist/views/position/index.vue.d.ts +319 -319
  94. package/dist/views/region/components/drawerRegion.vue.d.ts +4 -4
  95. package/dist/views/region/index.vue.d.ts +319 -319
  96. package/dist/views/resource/components/ResourceEdit.vue.d.ts +4 -4
  97. package/dist/views/resource/components/RoleRelation.vue.d.ts +2 -2
  98. package/dist/views/resource/index.vue.d.ts +321 -321
  99. package/dist/views/role/components/ResourceRelation.vue.d.ts +316 -316
  100. package/dist/views/role/components/drawerRole.vue.d.ts +10 -10
  101. package/dist/views/role/index.vue.d.ts +642 -642
  102. package/dist/views/role_group/components/drawerRole.vue.d.ts +7 -7
  103. package/dist/views/role_group/components/roleSelect.vue.d.ts +4 -4
  104. package/dist/views/role_group/index.vue.d.ts +322 -322
  105. package/dist/views/safe_setting/index.vue.d.ts +1 -1
  106. package/dist/views/tabbar_setting/index.vue.d.ts +1 -1
  107. package/dist/views/tenant/components/TenantEdit.vue.d.ts +10 -10
  108. package/dist/views/tenant/index.vue.d.ts +325 -325
  109. package/dist/views/theme_setting/index.vue.d.ts +1 -1
  110. package/dist/views/toolbar_setting/index.vue.d.ts +1 -1
  111. package/dist/views/user/components/OrgAndPosition.vue.d.ts +3 -3
  112. package/dist/views/user/components/UserAuthorization.vue.d.ts +7 -7
  113. package/dist/views/user/components/UserEdit.vue.d.ts +4 -4
  114. package/dist/views/user/components/roleSelect.vue.d.ts +4 -4
  115. package/dist/views/user/index.vue.d.ts +326 -326
  116. package/dist/views/watermark_setting/index.vue.d.ts +9 -9
  117. package/dist/watermark_setting-ChDfJ5of.js +1 -0
  118. package/package.json +7 -7
  119. package/src/assets/icons/browser-chrome.svg +1 -0
  120. package/src/assets/icons/browser-edge.svg +1 -0
  121. package/src/assets/icons/browser-ie.svg +1 -0
  122. package/src/assets/icons/browser-other.svg +1 -0
  123. package/src/assets/icons/browser-safari.svg +1 -0
  124. package/src/components/GroupSelector/index.vue +64 -89
  125. package/src/components/OrgTree/index.vue +2 -2
  126. package/src/components/OrgUserSelector/provider.ts +1 -1
  127. package/src/components/ResourceSelector/index.vue +33 -50
  128. package/src/routes/index.ts +1 -1
  129. package/src/views/blackWhiteList/components/drawerBlackWhiteList.vue +1 -1
  130. package/src/views/blackWhiteList/index.vue +10 -18
  131. package/src/views/breadcrumb_setting/index.vue +3 -3
  132. package/src/views/components/animation_item.vue +2 -2
  133. package/src/views/components/setItem.vue +13 -20
  134. package/src/views/data-permission/components/createAndEditDataPermission.vue +4 -4
  135. package/src/views/data-permission/enum.ts +7 -7
  136. package/src/views/data-permission/index.vue +7 -10
  137. package/src/views/dictionary/components/drawerDictionary.vue +1 -1
  138. package/src/views/dictionary/components/drawerDictionaryItem.vue +1 -1
  139. package/src/views/dictionary/index.vue +3 -3
  140. package/src/views/dictionary/itemlist.vue +1 -1
  141. package/src/views/group/components/drawerGroup.vue +2 -2
  142. package/src/views/group/index.vue +10 -16
  143. package/src/views/layout_setting/index.vue +154 -164
  144. package/src/views/log_center/components/loginHistoryDetail.vue +6 -8
  145. package/src/views/log_center/components/operateHistoryDetail.vue +6 -8
  146. package/src/views/log_center/login_history.vue +6 -11
  147. package/src/views/log_center/operate_history.vue +6 -11
  148. package/src/views/menu_setting/index.vue +3 -3
  149. package/src/views/organization/components/drawerOrganization.vue +3 -3
  150. package/src/views/organization/components/drawerRole.vue +2 -2
  151. package/src/views/organization/components/roleSelect.vue +37 -58
  152. package/src/views/organization/index.vue +23 -49
  153. package/src/views/other_setting/index.vue +2 -2
  154. package/src/views/page_animation_setting/index.vue +10 -18
  155. package/src/views/page_w_setting/index.vue +133 -116
  156. package/src/views/position/components/drawerPosition.vue +2 -2
  157. package/src/views/position/index.vue +1 -1
  158. package/src/views/region/components/drawerRegion.vue +2 -2
  159. package/src/views/region/index.vue +1 -1
  160. package/src/views/resource/components/ResourceEdit.vue +2 -2
  161. package/src/views/resource/components/RoleRelation.vue +1 -1
  162. package/src/views/resource/index.vue +1 -1
  163. package/src/views/role/components/ResourceRelation.vue +3 -4
  164. package/src/views/role/components/drawerRole.vue +3 -3
  165. package/src/views/role/index.vue +1 -1
  166. package/src/views/role_group/components/ResourceRelation.vue +3 -4
  167. package/src/views/role_group/components/drawerRole.vue +1 -1
  168. package/src/views/role_group/components/roleSelect.vue +36 -60
  169. package/src/views/role_group/index.vue +1 -1
  170. package/src/views/safe_setting/index.vue +5 -7
  171. package/src/views/tabbar_setting/index.vue +2 -2
  172. package/src/views/tenant/components/TenantEdit.vue +1 -1
  173. package/src/views/tenant/index.vue +1 -1
  174. package/src/views/theme_setting/index.vue +200 -230
  175. package/src/views/toolbar_setting/index.vue +3 -3
  176. package/src/views/user/components/OrgAndPosition.vue +1 -1
  177. package/src/views/user/components/UserAuthorization.vue +6 -6
  178. package/src/views/user/components/UserEdit.vue +1 -1
  179. package/src/views/user/components/roleSelect.vue +36 -68
  180. package/src/views/user/index.vue +1 -1
  181. package/src/views/watermark_setting/index.vue +8 -15
  182. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  183. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  184. package/dist/animation_item.vue_vue_type_script_setup_true_lang-efL_vjfY.js +0 -4864
  185. package/dist/browserType.vue_vue_type_script_setup_true_lang-Cv8wph6G.js +0 -38
  186. package/dist/cloneDeep-B4Rj61s4.js +0 -8
  187. package/dist/enum-BEHz_Q18.js +0 -74
  188. package/dist/enum-C9ihxJe7.js +0 -4
  189. package/dist/enum-CTUzwCYG.js +0 -4
  190. package/dist/enum-DDKThkSw.js +0 -24
  191. package/dist/gangweijiekou-CV7cIo_W.js +0 -46
  192. package/dist/index-B6A3qFeU.js +0 -18585
  193. package/dist/index-BChMrCkZ.js +0 -399
  194. package/dist/index-BIUkDwk2.js +0 -465
  195. package/dist/index-BOEO9CRp.js +0 -7084
  196. package/dist/index-BgdW__IO.js +0 -125
  197. package/dist/index-Bi0fucZj.js +0 -871
  198. package/dist/index-Bj3Ee1l-.js +0 -177
  199. package/dist/index-Bzjxdd-F.js +0 -702
  200. package/dist/index-CF4XGkrK.js +0 -454
  201. package/dist/index-CGAa6YPO.js +0 -273
  202. package/dist/index-CK582XAz.js +0 -317
  203. package/dist/index-Ce9x4LEV.js +0 -633
  204. package/dist/index-CkVgkVvC.js +0 -461
  205. package/dist/index-D4uw6wJ9.js +0 -181
  206. package/dist/index-DFrT08M4.js +0 -388
  207. package/dist/index-Dju21Cnm.js +0 -140
  208. package/dist/index-Dmg39liA.js +0 -168
  209. package/dist/index-DvE43Xkt.js +0 -408
  210. package/dist/index-Dx3ZDeWT.js +0 -684
  211. package/dist/index-MmfEJgmm.js +0 -860
  212. package/dist/index-RBHLCaQ9.js +0 -1626
  213. package/dist/index-Y2jyqjVz.js +0 -303
  214. package/dist/index-b_92Syzh.js +0 -131
  215. package/dist/index-g5Fyla0r.js +0 -164
  216. package/dist/index-qdAiA-PA.js +0 -286
  217. package/dist/itemlist-Og2t8W5R.js +0 -368
  218. package/dist/jiaosejiekou-0xZkLzL_.js +0 -58
  219. package/dist/login_history-BJWFChQ3.js +0 -430
  220. package/dist/operate_history-C1NKnoB5.js +0 -468
  221. package/dist/pubJiaosezukongzhiqi-BlLcThHi.js +0 -57
  222. package/dist/setItem-BRseSui6.js +0 -152
  223. package/dist/shujuquanxianzhubiaokongzhiqi-3CpYi1Zo.js +0 -65
  224. package/dist/useAppAndResource-BF7jQTCi.js +0 -55
  225. package/dist/xitongpeizhifuwu-BIR2CVXp.js +0 -23
  226. package/dist/zidianfuwu-B137v_q7.js +0 -65
  227. package/dist/ziyuanjiekou-j9nd-oaF.js +0 -69
  228. package/dist/zuzhijiaosebiaokongzhiqi-DPbRg7Qd.js +0 -28
@@ -1,702 +0,0 @@
1
- import { Drawer as Q, Form as ie, FormItem as ue, Input as ce, RadioGroup as de, InputNumber as pe, Switch as me, Textarea as fe, Select as _e, Space as W, Button as Z, Table as ve, Avatar as be } from "ant-design-vue/es";
2
- import { DatabaseOutlined as ge, PlusCircleOutlined as ye } from "@ant-design/icons-vue";
3
- import { defineComponent as G, ref as B, reactive as xe, computed as q, createBlock as N, openBlock as v, unref as e, isRef as Y, withCtx as s, createVNode as n, createCommentVNode as A, createTextVNode as E, toDisplayString as I, createElementBlock as O, createElementVNode as $, normalizeStyle as he, nextTick as J, resolveDirective as De, withDirectives as L } from "vue";
4
- import { u as z } from "./index-BOEO9CRp.js";
5
- import { g as Re, p as Ie, a as ke, b as Te, c as we, d as Ne } from "./ziyuanjiekou-j9nd-oaF.js";
6
- import { ProTable as Pe } from "@pubinfo/pro-components";
7
- import { message as F, theme as Ce, Badge as K, Modal as Oe } from "ant-design-vue";
8
- import { useAuth as Ee, PubinfoIcon as M } from "pubinfo";
9
- import { D as Ae, d as Ue } from "./enum-BEHz_Q18.js";
10
- import { c as ee } from "./cloneDeep-B4Rj61s4.js";
11
- import { useRequest as Se } from "alova/client";
12
- var d = /* @__PURE__ */ ((p) => (p.ROLE_RELATION = "分配查看", p.ADD = "新建", p.ADD_CHILD = "新建下级", p.EDIT = "修改", p.REMOVE = "删除", p))(d || {}), _ = /* @__PURE__ */ ((p) => (p.APP = "1", p.INDEX = "2", p.MENU = "3", p.BUTTON = "4", p.NON_MENU = "5", p))(_ || {});
13
- const H = [
14
- {
15
- label: "应用",
16
- value: "1"
17
- /* APP */
18
- },
19
- {
20
- label: "目录",
21
- value: "2"
22
- /* INDEX */
23
- },
24
- {
25
- label: "菜单",
26
- value: "3"
27
- /* MENU */
28
- },
29
- {
30
- label: "按钮",
31
- value: "4"
32
- /* BUTTON */
33
- },
34
- {
35
- label: "非菜单页",
36
- value: "5"
37
- /* NON_MENU */
38
- }
39
- ], Le = /* @__PURE__ */ G({
40
- name: "ResourceEdit",
41
- __name: "ResourceEdit",
42
- props: {
43
- dataSource: {}
44
- },
45
- emits: ["submit"],
46
- setup(p, { expose: U, emit: S }) {
47
- const h = p, k = S, [T, D] = z(!1), P = B(), a = B({}), g = xe({
48
- title: "",
49
- record: {},
50
- initData: {
51
- type: _.APP,
52
- sort: 0,
53
- enable: !0,
54
- enableDataPermission: !1,
55
- dataPermissionType: Ae.ALL
56
- }
57
- }), y = {
58
- name: [{ required: !0, message: "请输入资源名称", trigger: "blur" }],
59
- type: [{ required: !0, message: "请选择资源类型", trigger: "change" }],
60
- code: [{ required: !0, message: "请输入资源编码", trigger: "blur" }],
61
- sort: [{ type: "number", required: !0, message: "请输入排序", trigger: "blur" }],
62
- enable: [{ type: "boolean", required: !0, message: "请选择是否启用", trigger: "change" }]
63
- }, l = q(() => i(h.dataSource, (o) => o.id === a.value.parentId));
64
- function i(o, t) {
65
- const x = [...o];
66
- for (const c of x) {
67
- if (t(c))
68
- return c;
69
- c.children && x.push(...c.children);
70
- }
71
- return null;
72
- }
73
- const r = q(() => {
74
- var o;
75
- switch ((o = l.value) == null ? void 0 : o.type) {
76
- case _.APP:
77
- case _.INDEX:
78
- return H.filter((t) => t.value !== _.APP);
79
- case _.MENU:
80
- case _.NON_MENU:
81
- return H.filter((t) => t.value === _.BUTTON || t.value === _.NON_MENU);
82
- case _.BUTTON:
83
- return [];
84
- default:
85
- return H.filter((t) => t.value === _.APP);
86
- }
87
- }), m = q(() => a.value.type === _.BUTTON || a.value.type === _.MENU || a.value.type === _.NON_MENU);
88
- async function w(o, t) {
89
- if (g.title = o, a.value = ee(g.initData), D(!0), o === d.ADD_CHILD && (a.value.parentId = t == null ? void 0 : t.id, a.value.type = r.value[0].value), o === d.EDIT) {
90
- const x = await Re({ id: t == null ? void 0 : t.id });
91
- x.success && (a.value = x.data ?? {});
92
- }
93
- }
94
- const [b, R] = z(!1);
95
- function f() {
96
- var o;
97
- (o = P.value) == null || o.validate().then(() => {
98
- const t = {
99
- ...a.value
100
- };
101
- m.value || (t.enableDataPermission = !1);
102
- const x = g.title === d.EDIT ? Ie(t) : ke({ parentId: "", ...t });
103
- R(!0), x.then((c) => {
104
- c != null && c.success && (F.success(`${g.title}成功!`), D(!1), k("submit"));
105
- }).finally(() => R(!1));
106
- });
107
- }
108
- return U({
109
- open: w
110
- }), (o, t) => {
111
- const x = ge, c = ue, V = ce, te = de, ae = pe, X = me, ne = fe, le = _e, oe = ie, j = Z, se = W, re = Q;
112
- return v(), N(re, {
113
- open: e(T),
114
- "onUpdate:open": t[11] || (t[11] = (C) => Y(T) ? T.value = C : null),
115
- title: e(g).title,
116
- placement: "right",
117
- width: 520,
118
- "destroy-on-close": "",
119
- "footer-style": { textAlign: "right" }
120
- }, {
121
- footer: s(() => [
122
- n(se, null, {
123
- default: s(() => [
124
- n(j, {
125
- onClick: t[9] || (t[9] = (C) => e(D)(!1))
126
- }, {
127
- default: s(() => t[13] || (t[13] = [
128
- E(" 取消 ")
129
- ])),
130
- _: 1,
131
- __: [13]
132
- }),
133
- n(j, {
134
- type: "primary",
135
- loading: e(b),
136
- onClick: t[10] || (t[10] = (C) => f())
137
- }, {
138
- default: s(() => t[14] || (t[14] = [
139
- E(" 提交 ")
140
- ])),
141
- _: 1,
142
- __: [14]
143
- }, 8, ["loading"])
144
- ]),
145
- _: 1
146
- /* STABLE */
147
- })
148
- ]),
149
- default: s(() => [
150
- n(oe, {
151
- ref_key: "formRef",
152
- ref: P,
153
- model: e(a),
154
- rules: y,
155
- "label-col": { span: 6 }
156
- }, {
157
- default: s(() => {
158
- var C;
159
- return [
160
- (C = e(l)) != null && C.name ? (v(), N(c, {
161
- key: 0,
162
- name: "parentId"
163
- }, {
164
- label: s(() => [
165
- n(x, { class: "mr-1" }),
166
- t[12] || (t[12] = E(" 父资源 "))
167
- ]),
168
- default: s(() => {
169
- var u;
170
- return [
171
- E(
172
- " " + I((u = e(l)) == null ? void 0 : u.name),
173
- 1
174
- /* TEXT */
175
- )
176
- ];
177
- }),
178
- _: 1
179
- /* STABLE */
180
- })) : A("v-if", !0),
181
- n(c, {
182
- label: "资源名称",
183
- name: "name"
184
- }, {
185
- default: s(() => [
186
- n(V, {
187
- value: e(a).name,
188
- "onUpdate:value": t[0] || (t[0] = (u) => e(a).name = u),
189
- placeholder: "请输入资源名称",
190
- maxlength: 128
191
- }, null, 8, ["value"])
192
- ]),
193
- _: 1
194
- /* STABLE */
195
- }),
196
- n(c, {
197
- label: "资源类型",
198
- name: "type"
199
- }, {
200
- default: s(() => [
201
- n(te, {
202
- value: e(a).type,
203
- "onUpdate:value": t[1] || (t[1] = (u) => e(a).type = u),
204
- options: e(r),
205
- "option-type": "button",
206
- "button-style": "solid"
207
- }, null, 8, ["value", "options"])
208
- ]),
209
- _: 1
210
- /* STABLE */
211
- }),
212
- n(c, {
213
- label: "资源编码",
214
- name: "code"
215
- }, {
216
- default: s(() => [
217
- n(V, {
218
- value: e(a).code,
219
- "onUpdate:value": t[2] || (t[2] = (u) => e(a).code = u),
220
- placeholder: "请输入资源编码",
221
- maxlength: 50
222
- }, null, 8, ["value"])
223
- ]),
224
- _: 1
225
- /* STABLE */
226
- }),
227
- n(c, {
228
- label: "显示顺序",
229
- name: "sort"
230
- }, {
231
- default: s(() => [
232
- n(ae, {
233
- value: e(a).sort,
234
- "onUpdate:value": t[3] || (t[3] = (u) => e(a).sort = u),
235
- max: 999
236
- }, null, 8, ["value"])
237
- ]),
238
- _: 1
239
- /* STABLE */
240
- }),
241
- n(c, {
242
- label: "是否启用",
243
- name: "enable"
244
- }, {
245
- default: s(() => [
246
- n(X, {
247
- checked: e(a).enable,
248
- "onUpdate:checked": t[4] || (t[4] = (u) => e(a).enable = u)
249
- }, null, 8, ["checked"])
250
- ]),
251
- _: 1
252
- /* STABLE */
253
- }),
254
- n(c, {
255
- label: "权限标识",
256
- name: "permissionCode"
257
- }, {
258
- default: s(() => [
259
- n(V, {
260
- value: e(a).permissionCode,
261
- "onUpdate:value": t[5] || (t[5] = (u) => e(a).permissionCode = u),
262
- placeholder: "请输入权限标识",
263
- maxlength: 128
264
- }, null, 8, ["value"])
265
- ]),
266
- _: 1
267
- /* STABLE */
268
- }),
269
- n(c, {
270
- label: "描述",
271
- name: "description"
272
- }, {
273
- default: s(() => [
274
- n(ne, {
275
- value: e(a).description,
276
- "onUpdate:value": t[6] || (t[6] = (u) => e(a).description = u),
277
- placeholder: "请输入描述",
278
- maxlength: 255,
279
- "auto-size": { minRows: 2 },
280
- "show-count": ""
281
- }, null, 8, ["value"])
282
- ]),
283
- _: 1
284
- /* STABLE */
285
- }),
286
- e(m) ? (v(), N(c, {
287
- key: 1,
288
- label: "启用数据权限",
289
- name: "enableDataPermission"
290
- }, {
291
- default: s(() => [
292
- n(X, {
293
- checked: e(a).enableDataPermission,
294
- "onUpdate:checked": t[7] || (t[7] = (u) => e(a).enableDataPermission = u)
295
- }, null, 8, ["checked"])
296
- ]),
297
- _: 1
298
- /* STABLE */
299
- })) : A("v-if", !0),
300
- e(m) && e(a).enableDataPermission ? (v(), N(c, {
301
- key: 2,
302
- label: "数据权限规则",
303
- name: "dataPermissionType"
304
- }, {
305
- default: s(() => [
306
- n(le, {
307
- value: e(a).dataPermissionType,
308
- "onUpdate:value": t[8] || (t[8] = (u) => e(a).dataPermissionType = u),
309
- options: e(Ue)
310
- }, null, 8, ["value", "options"])
311
- ]),
312
- _: 1
313
- /* STABLE */
314
- })) : A("v-if", !0)
315
- ];
316
- }),
317
- _: 1
318
- /* STABLE */
319
- }, 8, ["model"])
320
- ]),
321
- _: 1
322
- /* STABLE */
323
- }, 8, ["open", "title"]);
324
- };
325
- }
326
- }), Me = {
327
- key: 0,
328
- class: "w-full truncate space-x-2"
329
- }, $e = /* @__PURE__ */ G({
330
- name: "RoleRelation",
331
- __name: "RoleRelation",
332
- setup(p, { expose: U }) {
333
- const { token: S } = Ce.useToken(), [h, k] = z(!1), { loading: T, data: D, send: P } = Se(
334
- (r) => Te(r, {
335
- transform(m) {
336
- return m.data ?? [];
337
- }
338
- }),
339
- { immediate: !1 }
340
- ), a = [
341
- {
342
- title: "角色名称",
343
- dataIndex: "name",
344
- ellipsis: !0
345
- },
346
- {
347
- title: "创建人",
348
- dataIndex: "createUserName",
349
- width: 180,
350
- ellipsis: !0
351
- }
352
- ];
353
- function g(r) {
354
- k(!0), P({ id: r.id }), i();
355
- }
356
- const y = q(() => window.innerHeight - 57 - 48 - 55 - 64);
357
- function l() {
358
- J(() => {
359
- var m;
360
- const r = (m = document.querySelector(".role-relation")) == null ? void 0 : m.querySelector(".ant-table-body");
361
- r && (r.style.height = `${y.value}px`);
362
- });
363
- }
364
- function i() {
365
- J(l);
366
- }
367
- return U({
368
- open: g
369
- }), (r, m) => {
370
- const w = be, b = ve, R = Q;
371
- return v(), N(R, {
372
- open: e(h),
373
- "onUpdate:open": m[0] || (m[0] = (f) => Y(h) ? h.value = f : null),
374
- title: "分配查看",
375
- placement: "right",
376
- width: 520,
377
- "footer-style": { textAlign: "right" }
378
- }, {
379
- default: s(() => [
380
- n(b, {
381
- "row-key": "id",
382
- loading: e(T),
383
- columns: a,
384
- "data-source": e(D),
385
- scroll: { y: `${e(y)}px` },
386
- pagination: { defaultPageSize: 20, showSizeChanger: !0 },
387
- class: "role-relation"
388
- }, {
389
- bodyCell: s(({ column: f, text: o }) => [
390
- f.dataIndex === "name" ? (v(), O("div", Me, [
391
- n(w, {
392
- size: "small",
393
- style: he({ backgroundColor: e(S).colorPrimary })
394
- }, {
395
- default: s(() => [
396
- E(
397
- I(o[0]),
398
- 1
399
- /* TEXT */
400
- )
401
- ]),
402
- _: 2
403
- /* DYNAMIC */
404
- }, 1032, ["style"]),
405
- $(
406
- "span",
407
- null,
408
- I(o),
409
- 1
410
- /* TEXT */
411
- )
412
- ])) : A("v-if", !0)
413
- ]),
414
- _: 1
415
- /* STABLE */
416
- }, 8, ["loading", "data-source", "scroll"])
417
- ]),
418
- _: 1
419
- /* STABLE */
420
- }, 8, ["open"]);
421
- };
422
- }
423
- }), Be = {
424
- "w-full": "",
425
- "h-full": "",
426
- "py-10px": "",
427
- "px-10px": ""
428
- }, qe = ["onClick"], He = ["onClick"], Ve = ["onClick"], ze = ["onClick"], tt = /* @__PURE__ */ G({
429
- name: "Resource",
430
- __name: "index",
431
- setup(p) {
432
- const {
433
- auth: U
434
- } = Ee(), S = [{
435
- valueType: "a-input",
436
- width: 200,
437
- title: "资源名称",
438
- dataIndex: "name",
439
- ellipsis: !0,
440
- fieldProps: {
441
- placeholder: "请输入资源名称",
442
- allowClear: !0
443
- }
444
- }, {
445
- valueType: "a-input",
446
- title: "资源编码",
447
- dataIndex: "code",
448
- ellipsis: !0,
449
- fieldProps: {
450
- placeholder: "请输入资源编码",
451
- allowClear: !0
452
- }
453
- }, {
454
- valueType: "a-select",
455
- title: "资源类型",
456
- dataIndex: "type",
457
- fieldProps: {
458
- placeholder: "请选择资源类型",
459
- allowClear: !0,
460
- options: H
461
- },
462
- customRender({
463
- text: l
464
- }) {
465
- var r;
466
- return n("div", {
467
- class: "flex items-center space-x-1"
468
- }, [n(M, {
469
- name: `resource-${["", "app", "index", "menu", "btn", "nonmenu"][l]}`,
470
- class: "text-xl"
471
- }, null), n("span", null, [(r = H.find((m) => m.value === l)) == null ? void 0 : r.label])]);
472
- }
473
- }, {
474
- valueType: "a-select",
475
- title: "是否启用",
476
- dataIndex: "enable",
477
- width: 100,
478
- fieldProps: {
479
- placeholder: "请选择是否启用",
480
- allowClear: !0,
481
- options: [{
482
- value: 1,
483
- label: "是"
484
- }, {
485
- value: 0,
486
- label: "否"
487
- }]
488
- },
489
- customRender({
490
- text: l
491
- }) {
492
- return l ? n(K, {
493
- status: "success",
494
- text: "是"
495
- }, null) : n(K, {
496
- status: "error",
497
- text: "否"
498
- }, null);
499
- }
500
- }, {
501
- title: "权限标识",
502
- dataIndex: "permissionCode",
503
- ellipsis: !0,
504
- hideInSearch: !0
505
- }, {
506
- title: "排序",
507
- dataIndex: "sort",
508
- hideInSearch: !0
509
- }, {
510
- title: "操作",
511
- dataIndex: "action",
512
- fixed: "right",
513
- width: 320,
514
- hideInSearch: !0,
515
- hideInTable() {
516
- return !U(["resource_role_relation", "resource_add_child", "resource_edit", "resource_remove"]);
517
- }
518
- }];
519
- function h(l, i) {
520
- return (l == null ? void 0 : l.map((r) => (r.children = r.children && h(r.children, i), i(r)))) ?? [];
521
- }
522
- const k = B(), T = q(() => {
523
- var l;
524
- return ((l = k.value) == null ? void 0 : l.dataSource) ?? [];
525
- });
526
- function D() {
527
- k.value.reload();
528
- }
529
- async function P(l) {
530
- const {
531
- pageSize: i,
532
- current: r,
533
- enabled: m,
534
- ...w
535
- } = ee(l), b = {
536
- ...w,
537
- enabled: !!m
538
- };
539
- return {
540
- success: !0,
541
- data: await we(b, {
542
- transform(f) {
543
- return h((f == null ? void 0 : f.data) ?? [], (o) => o.leaf ? {
544
- ...o,
545
- children: void 0
546
- } : o);
547
- }
548
- })
549
- };
550
- }
551
- const a = B(), g = B();
552
- function y(l, i) {
553
- switch (l) {
554
- case d.ROLE_RELATION:
555
- g.value.open(i);
556
- break;
557
- case d.ADD:
558
- a.value.open(l);
559
- break;
560
- case d.ADD_CHILD:
561
- a.value.open(l, i);
562
- break;
563
- case d.EDIT:
564
- a.value.open(l, i);
565
- break;
566
- case d.REMOVE:
567
- if (!(i != null && i.leaf)) {
568
- F.info("非叶子节点不能删除");
569
- return;
570
- }
571
- Oe.confirm({
572
- title: "删除",
573
- content: "确定要删除该资源吗?",
574
- async onOk() {
575
- (await Ne({
576
- id: i == null ? void 0 : i.id
577
- })).success && (F.success("删除成功"), D());
578
- }
579
- });
580
- break;
581
- }
582
- }
583
- return (l, i) => {
584
- const r = ye, m = Z, w = W, b = De("auth");
585
- return v(), O("div", Be, [n(
586
- e(Pe),
587
- {
588
- ref_key: "tableRef",
589
- ref: k,
590
- "row-key": "id",
591
- columns: S,
592
- request: P,
593
- pagination: !1,
594
- scroll: {
595
- x: 1024
596
- },
597
- "auto-height": ""
598
- },
599
- {
600
- toolbar: s(() => [L((v(), N(m, {
601
- type: "primary",
602
- onClick: i[0] || (i[0] = (R) => y(e(d).ADD))
603
- }, {
604
- default: s(() => [n(r), E(
605
- " " + I(e(d).ADD),
606
- 1
607
- /* TEXT */
608
- )]),
609
- _: 1
610
- /* STABLE */
611
- })), [[b, "resource_app_add"]])]),
612
- bodyCell: s(({
613
- column: R,
614
- record: f
615
- }) => [R.dataIndex === "action" ? (v(), N(
616
- w,
617
- {
618
- key: 0
619
- },
620
- {
621
- default: s(() => [L((v(), O("a", {
622
- class: "flex items-center",
623
- onClick: (o) => y(e(d).ROLE_RELATION, f)
624
- }, [n(e(M), {
625
- name: "view",
626
- class: "mr-1 text-base"
627
- }), $(
628
- "span",
629
- null,
630
- I(e(d).ROLE_RELATION),
631
- 1
632
- /* TEXT */
633
- )], 8, qe)), [[b, "resource_role_relation"]]), f.type !== e(_).BUTTON ? L((v(), O("a", {
634
- key: 0,
635
- class: "flex items-center",
636
- onClick: (o) => y(e(d).ADD_CHILD, f)
637
- }, [n(e(M), {
638
- name: "add-child",
639
- class: "mr-1 text-base"
640
- }), $(
641
- "span",
642
- null,
643
- I(e(d).ADD_CHILD),
644
- 1
645
- /* TEXT */
646
- )], 8, He)), [[b, "resource_add_child"]]) : A("v-if", !0), L((v(), O("a", {
647
- class: "flex items-center",
648
- onClick: (o) => y(e(d).EDIT, f)
649
- }, [n(e(M), {
650
- name: "edit",
651
- class: "mr-1 text-base"
652
- }), $(
653
- "span",
654
- null,
655
- I(e(d).EDIT),
656
- 1
657
- /* TEXT */
658
- )], 8, Ve)), [[b, "resource_edit"]]), L((v(), O("span", {
659
- class: "flex items-center text-red-500 hover:cursor-pointer hover:opacity-80",
660
- onClick: (o) => y(e(d).REMOVE, f)
661
- }, [n(e(M), {
662
- name: "remove",
663
- class: "mr-1 text-base"
664
- }), $(
665
- "span",
666
- null,
667
- I(e(d).REMOVE),
668
- 1
669
- /* TEXT */
670
- )], 8, ze)), [[b, "resource_remove"]])]),
671
- _: 2
672
- /* DYNAMIC */
673
- },
674
- 1024
675
- /* DYNAMIC_SLOTS */
676
- )) : A("v-if", !0)]),
677
- _: 1
678
- /* STABLE */
679
- },
680
- 512
681
- /* NEED_PATCH */
682
- ), n(Le, {
683
- ref_key: "editRef",
684
- ref: a,
685
- "data-source": e(T),
686
- onSubmit: D
687
- }, null, 8, ["data-source"]), n(
688
- $e,
689
- {
690
- ref_key: "relationRef",
691
- ref: g
692
- },
693
- null,
694
- 512
695
- /* NEED_PATCH */
696
- )]);
697
- };
698
- }
699
- });
700
- export {
701
- tt as default
702
- };