@pubinfo/module-rbac 2.0.0-beta.3 → 2.0.0-beta.30

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 (212) hide show
  1. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  2. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  3. package/dist/animation_item.vue_vue_type_script_setup_true_lang-efL_vjfY.js +4864 -0
  4. package/dist/api/modules/assist/gonggaofuwu.d.ts +43 -0
  5. package/dist/api/modules/assist/index.d.ts +3 -0
  6. package/dist/api/modules/assist/qunzujiekou.d.ts +36 -0
  7. package/dist/api/modules/assist/quyujiekou.d.ts +36 -0
  8. package/dist/api/modules/configData/heibaimingdanfuwu.d.ts +36 -0
  9. package/dist/api/modules/configData/index.d.ts +3 -0
  10. package/dist/api/modules/configData/xitongpeizhifuwu.d.ts +99 -0
  11. package/dist/api/modules/configData/zidianfuwu.d.ts +57 -0
  12. package/dist/api/modules/log/caozuorizhifuwu.d.ts +15 -0
  13. package/dist/api/modules/log/denglurizhifuwu.d.ts +15 -0
  14. package/dist/api/modules/log/index.d.ts +2 -0
  15. package/dist/api/modules/rbac/gangweijiekou.d.ts +36 -0
  16. package/dist/api/modules/rbac/index.d.ts +11 -0
  17. package/dist/api/modules/rbac/jiaosejiekou.d.ts +50 -0
  18. package/dist/api/modules/rbac/pubJiaosezukongzhiqi.d.ts +43 -0
  19. package/dist/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.d.ts +64 -0
  20. package/dist/api/modules/rbac/yonghujiekou.d.ts +85 -0
  21. package/dist/api/modules/rbac/yonghushoucangbiaojiekou.d.ts +36 -0
  22. package/dist/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.d.ts +29 -0
  23. package/dist/api/modules/rbac/ziyuanjiekou.d.ts +85 -0
  24. package/dist/api/modules/rbac/zuhuguanlijiekou.d.ts +36 -0
  25. package/dist/api/modules/rbac/zuzhijiaosebiaokongzhiqi.d.ts +29 -0
  26. package/dist/api/modules/rbac/zuzhijiekou.d.ts +64 -0
  27. package/dist/api/request.d.ts +1 -0
  28. package/dist/browserType.vue_vue_type_script_setup_true_lang-Cv8wph6G.js +38 -0
  29. package/dist/cloneDeep-B4Rj61s4.js +8 -0
  30. package/dist/components/GroupSelector/index.vue.d.ts +15 -0
  31. package/dist/components/GroupSelector/interface.d.ts +6 -0
  32. package/dist/components/OrgTree/index.vue.d.ts +5 -0
  33. package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +68 -0
  34. package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +72 -0
  35. package/dist/components/OrgUserSelector/index.d.ts +9 -0
  36. package/dist/components/OrgUserSelector/provider.d.ts +24 -0
  37. package/dist/components/ResourceSelector/enum.d.ts +5 -0
  38. package/dist/components/ResourceSelector/hooks/useAppAndResource.d.ts +29 -0
  39. package/dist/components/ResourceSelector/index.vue.d.ts +24 -0
  40. package/dist/composables/useLottie.d.ts +11 -0
  41. package/dist/enum-BEHz_Q18.js +74 -0
  42. package/dist/enum-C9ihxJe7.js +4 -0
  43. package/dist/enum-CTUzwCYG.js +4 -0
  44. package/dist/enum-DDKThkSw.js +24 -0
  45. package/dist/gangweijiekou-CV7cIo_W.js +46 -0
  46. package/dist/index-B6A3qFeU.js +18585 -0
  47. package/dist/index-BChMrCkZ.js +399 -0
  48. package/dist/index-BIUkDwk2.js +465 -0
  49. package/dist/index-BOEO9CRp.js +7084 -0
  50. package/dist/index-BgdW__IO.js +125 -0
  51. package/dist/index-Bi0fucZj.js +871 -0
  52. package/dist/index-Bj3Ee1l-.js +177 -0
  53. package/dist/index-Bzjxdd-F.js +702 -0
  54. package/dist/index-CF4XGkrK.js +454 -0
  55. package/dist/index-CGAa6YPO.js +273 -0
  56. package/dist/index-CK582XAz.js +317 -0
  57. package/dist/index-Ce9x4LEV.js +633 -0
  58. package/dist/index-CkVgkVvC.js +461 -0
  59. package/dist/index-D4uw6wJ9.js +181 -0
  60. package/dist/index-DFrT08M4.js +388 -0
  61. package/dist/index-Dju21Cnm.js +140 -0
  62. package/dist/index-Dmg39liA.js +168 -0
  63. package/dist/index-DvE43Xkt.js +408 -0
  64. package/dist/index-Dx3ZDeWT.js +684 -0
  65. package/dist/index-MmfEJgmm.js +860 -0
  66. package/dist/index-RBHLCaQ9.js +1626 -0
  67. package/dist/index-Y2jyqjVz.js +303 -0
  68. package/dist/index-b_92Syzh.js +131 -0
  69. package/dist/index-g5Fyla0r.js +164 -0
  70. package/dist/index-qdAiA-PA.js +286 -0
  71. package/dist/index.d.ts +7 -0
  72. package/dist/index.js +9 -0
  73. package/dist/interface.d.ts +49 -0
  74. package/dist/itemlist-Og2t8W5R.js +368 -0
  75. package/dist/jiaosejiekou-0xZkLzL_.js +58 -0
  76. package/dist/login_history-BJWFChQ3.js +430 -0
  77. package/dist/operate_history-C1NKnoB5.js +468 -0
  78. package/dist/pubJiaosezukongzhiqi-BlLcThHi.js +57 -0
  79. package/dist/routes/index.d.ts +14 -0
  80. package/dist/routes/modules/authority.manage.menu.d.ts +3 -0
  81. package/dist/routes/modules/log.manage.menu.d.ts +3 -0
  82. package/dist/routes/modules/safe.manage.menu.d.ts +3 -0
  83. package/dist/routes/modules/stylesetting.manage.menu.d.ts +3 -0
  84. package/dist/routes/modules/system.manage.menu.d.ts +3 -0
  85. package/dist/setItem-BRseSui6.js +152 -0
  86. package/dist/shujuquanxianzhubiaokongzhiqi-3CpYi1Zo.js +65 -0
  87. package/dist/stores/index.d.ts +1 -0
  88. package/dist/style.css +1 -0
  89. package/dist/useAppAndResource-BF7jQTCi.js +55 -0
  90. package/dist/views/blackWhiteList/components/drawerBlackWhiteList.vue.d.ts +14 -0
  91. package/dist/views/blackWhiteList/enum.d.ts +7 -0
  92. package/dist/views/blackWhiteList/index.vue.d.ts +1535 -0
  93. package/dist/views/blackWhiteList/types.d.ts +4 -0
  94. package/dist/views/breadcrumb_setting/animationData.d.ts +7 -0
  95. package/dist/views/breadcrumb_setting/index.vue.d.ts +2 -0
  96. package/dist/views/components/HCheckList.vue.d.ts +20 -0
  97. package/dist/views/components/animation_item.vue.d.ts +14 -0
  98. package/dist/views/components/setItem.vue.d.ts +61 -0
  99. package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +172 -0
  100. package/dist/views/data-permission/enum.d.ts +34 -0
  101. package/dist/views/data-permission/index.vue.d.ts +1691 -0
  102. package/dist/views/dictionary/components/drawerDictionary.vue.d.ts +12 -0
  103. package/dist/views/dictionary/components/drawerDictionaryItem.vue.d.ts +12 -0
  104. package/dist/views/dictionary/enum.d.ts +8 -0
  105. package/dist/views/dictionary/index.vue.d.ts +1532 -0
  106. package/dist/views/dictionary/itemlist.vue.d.ts +1532 -0
  107. package/dist/views/group/components/drawerGroup.vue.d.ts +12 -0
  108. package/dist/views/group/enum.d.ts +21 -0
  109. package/dist/views/group/index.vue.d.ts +1532 -0
  110. package/dist/views/layout_setting/index.vue.d.ts +2 -0
  111. package/dist/views/log_center/components/browserType.vue.d.ts +12 -0
  112. package/dist/views/log_center/components/loginHistoryDetail.vue.d.ts +14 -0
  113. package/dist/views/log_center/components/operateHistoryDetail.vue.d.ts +14 -0
  114. package/dist/views/log_center/login_history.vue.d.ts +1511 -0
  115. package/dist/views/log_center/operate_history.vue.d.ts +1511 -0
  116. package/dist/views/menu_setting/animationData.d.ts +13 -0
  117. package/dist/views/menu_setting/index.vue.d.ts +2 -0
  118. package/dist/views/organization/components/drawerOrganization.vue.d.ts +12 -0
  119. package/dist/views/organization/components/drawerRole.vue.d.ts +36 -0
  120. package/dist/views/organization/components/roleSelect.vue.d.ts +14 -0
  121. package/dist/views/organization/enum.d.ts +25 -0
  122. package/dist/views/organization/index.vue.d.ts +73 -0
  123. package/dist/views/other_setting/animationData.d.ts +7 -0
  124. package/dist/views/other_setting/index.vue.d.ts +2 -0
  125. package/dist/views/other_setting/interface.d.ts +23 -0
  126. package/dist/views/page_animation_setting/animationData.d.ts +11 -0
  127. package/dist/views/page_animation_setting/index.vue.d.ts +2 -0
  128. package/dist/views/page_w_setting/index.vue.d.ts +2 -0
  129. package/dist/views/position/components/drawerPosition.vue.d.ts +12 -0
  130. package/dist/views/position/enum.d.ts +8 -0
  131. package/dist/views/position/index.vue.d.ts +1532 -0
  132. package/dist/views/region/components/drawerRegion.vue.d.ts +12 -0
  133. package/dist/views/region/enum.d.ts +22 -0
  134. package/dist/views/region/index.vue.d.ts +1533 -0
  135. package/dist/views/resource/components/ResourceEdit.vue.d.ts +16 -0
  136. package/dist/views/resource/components/RoleRelation.vue.d.ts +6 -0
  137. package/dist/views/resource/enum.d.ts +30 -0
  138. package/dist/views/resource/index.vue.d.ts +1549 -0
  139. package/dist/views/resource/interface.d.ts +6 -0
  140. package/dist/views/role/components/ResourceRelation.vue.d.ts +1515 -0
  141. package/dist/views/role/components/drawerRole.vue.d.ts +49 -0
  142. package/dist/views/role/enum.d.ts +25 -0
  143. package/dist/views/role/index.vue.d.ts +3090 -0
  144. package/dist/views/role/interface.d.ts +6 -0
  145. package/dist/views/role_group/components/drawerRole.vue.d.ts +37 -0
  146. package/dist/views/role_group/components/roleSelect.vue.d.ts +14 -0
  147. package/dist/views/role_group/enum.d.ts +21 -0
  148. package/dist/views/role_group/index.vue.d.ts +1557 -0
  149. package/dist/views/role_group/interface.d.ts +6 -0
  150. package/dist/views/safe_setting/index.vue.d.ts +4 -0
  151. package/dist/views/tabbar_setting/animationData.d.ts +11 -0
  152. package/dist/views/tabbar_setting/index.vue.d.ts +2 -0
  153. package/dist/views/tenant/components/TenantEdit.vue.d.ts +50 -0
  154. package/dist/views/tenant/enum.d.ts +7 -0
  155. package/dist/views/tenant/index.vue.d.ts +1570 -0
  156. package/dist/views/tenant/interface.d.ts +6 -0
  157. package/dist/views/theme_setting/index.vue.d.ts +2 -0
  158. package/dist/views/toolbar_setting/animationData.d.ts +17 -0
  159. package/dist/views/toolbar_setting/index.vue.d.ts +2 -0
  160. package/dist/views/user/components/OrgAndPosition.vue.d.ts +14 -0
  161. package/dist/views/user/components/UserAuthorization.vue.d.ts +39 -0
  162. package/dist/views/user/components/UserEdit.vue.d.ts +16 -0
  163. package/dist/views/user/components/roleSelect.vue.d.ts +14 -0
  164. package/dist/views/user/enum.d.ts +13 -0
  165. package/dist/views/user/index.vue.d.ts +1586 -0
  166. package/dist/views/user/interface.d.ts +39 -0
  167. package/dist/views/watermark_setting/animationData.d.ts +3 -0
  168. package/dist/views/watermark_setting/index.vue.d.ts +31 -0
  169. package/dist/xitongpeizhifuwu-BIR2CVXp.js +23 -0
  170. package/dist/zidianfuwu-B137v_q7.js +65 -0
  171. package/dist/ziyuanjiekou-j9nd-oaF.js +69 -0
  172. package/dist/zuzhijiaosebiaokongzhiqi-DPbRg7Qd.js +28 -0
  173. package/package.json +18 -20
  174. package/src/components/GroupSelector/index.vue +1 -7
  175. package/src/components/GroupSelector/interface.ts +6 -0
  176. package/src/components/OrgUserSelector/index.ts +5 -0
  177. package/src/components/ResourceSelector/index.vue +1 -2
  178. package/src/index.ts +8 -14
  179. package/src/interface.ts +3 -0
  180. package/src/routes/index.ts +1 -1
  181. package/src/views/tenant/components/TenantEdit.vue +1 -8
  182. package/src/views/tenant/enum.ts +7 -0
  183. package/src/views/tenant/index.vue +1 -8
  184. package/src/views/theme_setting/index.vue +2 -1
  185. package/src/views/user/interface.ts +1 -1
  186. package/src/assets/icons/403.svg +0 -1
  187. package/src/assets/icons/403_dark.svg +0 -1
  188. package/src/assets/icons/404.svg +0 -1
  189. package/src/assets/icons/404_dark.svg +0 -1
  190. package/src/assets/icons/browser-360.svg +0 -1
  191. package/src/assets/icons/browser-chrome.svg +0 -1
  192. package/src/assets/icons/browser-edge.svg +0 -1
  193. package/src/assets/icons/browser-ie.svg +0 -1
  194. package/src/assets/icons/browser-other.svg +0 -1
  195. package/src/assets/icons/browser-qq.svg +0 -1
  196. package/src/assets/icons/browser-safari.svg +0 -1
  197. package/src/assets/icons/browser-uc.svg +0 -1
  198. package/src/assets/icons/change-org.svg +0 -1
  199. package/src/assets/icons/empty-data.svg +0 -1
  200. package/src/assets/icons/favorites.svg +0 -1
  201. package/src/assets/icons/image-load-fail.svg +0 -1
  202. package/src/assets/icons/logo-sig.svg +0 -1
  203. package/src/assets/icons/logo.svg +0 -1
  204. package/src/assets/icons/mima.svg +0 -1
  205. package/src/assets/icons/process-management.svg +0 -1
  206. package/src/assets/icons/project-management.svg +0 -1
  207. package/src/assets/icons/rbac.svg +0 -1
  208. package/src/assets/icons/test.svg +0 -1
  209. package/src/assets/icons/toolbar-collapse.svg +0 -1
  210. package/src/assets/icons/tree_icon.svg +0 -1
  211. package/src/assets/icons/tree_icon_checked.svg +0 -1
  212. package/src/assets/icons/workbench.svg +0 -1
@@ -0,0 +1,702 @@
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
+ };