@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,860 @@
1
+ import { Modal as De, Tabs as Ce, TabPane as Oe, CheckboxGroup as Pe, Tooltip as fe, Tag as Se, Button as pe, Drawer as Ee, Form as Fe, FormItem as Te, Input as $e, Select as Ge, Space as _e } from "ant-design-vue/es";
2
+ import { PubinfoIcon as Ae } from "pubinfo";
3
+ import { PlusCircleOutlined as Me } from "@ant-design/icons-vue";
4
+ import { defineComponent as de, mergeModels as Ue, ref as v, computed as te, useModel as Ne, createBlock as R, openBlock as r, withCtx as n, createElementVNode as g, createVNode as l, unref as a, isRef as Z, createElementBlock as _, Fragment as B, renderList as ee, createTextVNode as P, toDisplayString as I, createCommentVNode as ae, resolveDirective as Le, withDirectives as re } from "vue";
5
+ import { u as oe, p as Ve, _ as qe } from "./index-BOEO9CRp.js";
6
+ import { g as Be, p as Ke, a as Ye, b as je, d as ze } from "./shujuquanxianzhubiaokongzhiqi-3CpYi1Zo.js";
7
+ import { ProTable as Qe } from "@pubinfo/pro-components";
8
+ import { message as ve, Modal as He } from "ant-design-vue";
9
+ import { G as ue } from "./enum-DDKThkSw.js";
10
+ import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
+ import { R as We } from "./enum-CTUzwCYG.js";
12
+ import { u as Xe } from "./useAppAndResource-BF7jQTCi.js";
13
+ import { _ as Ze } from "./index-BChMrCkZ.js";
14
+ import { D as ie, a as ge, b as et, A as G } from "./enum-BEHz_Q18.js";
15
+ const tt = { class: "h-340px border-1px border-solid flex flex-row border_color" }, at = { class: "w-360px" }, ot = { class: "flex-1 flex flex-col border-solid border-0px border-l-1px border_color" }, nt = { class: "flex-1 p-10px overflow-auto" }, st = /* @__PURE__ */ de({
16
+ name: "GroupSelector",
17
+ __name: "index",
18
+ props: {
19
+ open: { type: Boolean },
20
+ openModifiers: {}
21
+ },
22
+ emits: /* @__PURE__ */ Ue(["select"], ["update:open"]),
23
+ setup(ne, { expose: K, emit: L }) {
24
+ const Y = L, S = v("OrgGroup"), w = te(() => S.value === "OrgGroup"), V = v([]), E = v([]), b = v([]), p = v([]), x = te(() => {
25
+ const d = w.value ? V : E, o = w.value ? b : p;
26
+ return d.value.filter((c) => o.value.includes(c.value));
27
+ }), h = Ne(ne, "open"), F = oe(h);
28
+ A();
29
+ function A() {
30
+ T(ue.ORG), T(ue.PER);
31
+ }
32
+ function T(d) {
33
+ Ve({ type: d }).then((o) => {
34
+ if (o && o.data && o.data.length) {
35
+ const c = o.data.map((C) => {
36
+ const { name: k = "", id: $ = "" } = C;
37
+ return {
38
+ label: k.length > 20 ? `${k.substring(0, 20)}...` : k,
39
+ value: $,
40
+ name: k,
41
+ id: $
42
+ };
43
+ });
44
+ d === ue.ORG ? V.value = c : E.value = c;
45
+ }
46
+ });
47
+ }
48
+ function y(d) {
49
+ if (d && d.length) {
50
+ const o = d.map((c) => c.value);
51
+ w.value ? b.value = o : p.value = o;
52
+ } else
53
+ b.value = [], p.value = [];
54
+ F(!0);
55
+ }
56
+ function m() {
57
+ w.value ? D() : s();
58
+ }
59
+ function D() {
60
+ b.value = [];
61
+ }
62
+ function s() {
63
+ p.value = [];
64
+ }
65
+ function j(d) {
66
+ const o = w.value ? b : p, c = o.value.findIndex((C) => C === d);
67
+ c !== -1 && o.value.splice(c, 1);
68
+ }
69
+ function J() {
70
+ Y("select", x.value), F(!1);
71
+ }
72
+ return K({
73
+ open: y
74
+ }), (d, o) => {
75
+ const c = Pe, C = Oe, k = Ce, $ = Se, M = fe, W = pe, se = De;
76
+ return r(), R(se, {
77
+ open: h.value,
78
+ "onUpdate:open": o[4] || (o[4] = (i) => h.value = i),
79
+ class: "group-modal",
80
+ title: "编辑群组",
81
+ "mask-closable": !1,
82
+ width: 750
83
+ }, {
84
+ footer: n(() => [
85
+ l(W, {
86
+ onClick: o[3] || (o[3] = (i) => a(F)(!1))
87
+ }, {
88
+ default: n(() => o[6] || (o[6] = [
89
+ P(" 取消 ")
90
+ ])),
91
+ _: 1,
92
+ __: [6]
93
+ }),
94
+ l(W, {
95
+ type: "primary",
96
+ onClick: J
97
+ }, {
98
+ default: n(() => o[7] || (o[7] = [
99
+ P(" 确定 ")
100
+ ])),
101
+ _: 1,
102
+ __: [7]
103
+ })
104
+ ]),
105
+ default: n(() => [
106
+ g("div", tt, [
107
+ g("div", at, [
108
+ l(k, {
109
+ "active-key": a(S),
110
+ "onUpdate:activeKey": o[2] || (o[2] = (i) => Z(S) ? S.value = i : null),
111
+ class: "h-full overflow-hidden"
112
+ }, {
113
+ default: n(() => [
114
+ l(C, {
115
+ key: "OrgGroup",
116
+ tab: "组织群组"
117
+ }, {
118
+ default: n(() => [
119
+ l(c, {
120
+ value: a(b),
121
+ "onUpdate:value": o[0] || (o[0] = (i) => Z(b) ? b.value = i : null),
122
+ options: a(V)
123
+ }, null, 8, ["value", "options"])
124
+ ]),
125
+ _: 1
126
+ /* STABLE */
127
+ }),
128
+ l(C, {
129
+ key: "UserGroup",
130
+ tab: "用户群组",
131
+ "force-render": ""
132
+ }, {
133
+ default: n(() => [
134
+ l(c, {
135
+ value: a(p),
136
+ "onUpdate:value": o[1] || (o[1] = (i) => Z(p) ? p.value = i : null),
137
+ options: a(E)
138
+ }, null, 8, ["value", "options"])
139
+ ]),
140
+ _: 1
141
+ /* STABLE */
142
+ })
143
+ ]),
144
+ _: 1
145
+ /* STABLE */
146
+ }, 8, ["active-key"])
147
+ ]),
148
+ g("div", ot, [
149
+ g("div", { class: "w-full h-38px bg-[rgb(245,245,245)] flex px-15px items-center justify-between text-[#1D2129] dark:bg-[#000] dark:text-[#F2F3F5]" }, [
150
+ o[5] || (o[5] = g(
151
+ "div",
152
+ { class: "" },
153
+ " 已选群组 ",
154
+ -1
155
+ /* HOISTED */
156
+ )),
157
+ g("div", {
158
+ class: "cursor-pointer text-[#165DFF]",
159
+ onClick: m
160
+ }, " 清空 ")
161
+ ]),
162
+ g("div", nt, [
163
+ (r(!0), _(
164
+ B,
165
+ null,
166
+ ee(a(x), (i) => (r(), _("div", {
167
+ key: i.value,
168
+ class: "inline-block mb-6px max-w-300px"
169
+ }, [
170
+ i.name && i.name.length > 20 ? (r(), R(M, {
171
+ key: 0,
172
+ title: i.name
173
+ }, {
174
+ default: n(() => [
175
+ l($, {
176
+ class: "custom_tag bg-[#e8f3ff] dark:bg-[#141414]",
177
+ closable: "",
178
+ onClose: (le) => j(i.value)
179
+ }, {
180
+ default: n(() => [
181
+ P(
182
+ I(i.label),
183
+ 1
184
+ /* TEXT */
185
+ )
186
+ ]),
187
+ _: 2
188
+ /* DYNAMIC */
189
+ }, 1032, ["onClose"])
190
+ ]),
191
+ _: 2
192
+ /* DYNAMIC */
193
+ }, 1032, ["title"])) : (r(), R($, {
194
+ key: 1,
195
+ class: "custom_tag bg-[#e8f3ff] dark:bg-[#141414]",
196
+ closable: "",
197
+ onClose: (le) => j(i.value)
198
+ }, {
199
+ default: n(() => [
200
+ P(
201
+ I(i.label),
202
+ 1
203
+ /* TEXT */
204
+ )
205
+ ]),
206
+ _: 2
207
+ /* DYNAMIC */
208
+ }, 1032, ["onClose"]))
209
+ ]))),
210
+ 128
211
+ /* KEYED_FRAGMENT */
212
+ ))
213
+ ])
214
+ ])
215
+ ])
216
+ ]),
217
+ _: 1
218
+ /* STABLE */
219
+ }, 8, ["open"]);
220
+ };
221
+ }
222
+ }), lt = /* @__PURE__ */ Je(st, [["__scopeId", "data-v-a9b7a52b"]]), rt = { class: "pt-10px" }, ut = { class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]" }, it = {
223
+ key: 1,
224
+ class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]"
225
+ }, pt = { class: "pt-10px" }, dt = { class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]" }, ct = {
226
+ key: 1,
227
+ class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]"
228
+ }, mt = { class: "pt-10px" }, ft = { class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]" }, _t = {
229
+ key: 1,
230
+ class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]"
231
+ }, vt = /* @__PURE__ */ de({
232
+ name: "CreateAndEditDataPermission",
233
+ __name: "createAndEditDataPermission",
234
+ emits: ["submit"],
235
+ setup(ne, { expose: K, emit: L }) {
236
+ const Y = L, S = We.DATA_PERMISSION, {
237
+ appList: w,
238
+ resourceModelRef: V,
239
+ selectedResources: E,
240
+ getAppList: b,
241
+ updateTreeDataAndResourceMap: p,
242
+ setSelectedResources: x,
243
+ updateSelectedResources: h,
244
+ clearSelectedResources: F,
245
+ openResourceModel: A
246
+ } = Xe(S), T = v(""), y = {
247
+ name: "",
248
+ type: "",
249
+ appId: "",
250
+ orgIds: [],
251
+ resourceIds: []
252
+ }, m = v(), D = {
253
+ name: [
254
+ {
255
+ required: !0,
256
+ message: "请输入数据权限名称",
257
+ trigger: ["blur", "change"]
258
+ }
259
+ ],
260
+ type: [
261
+ {
262
+ required: !0,
263
+ message: "请选择数据权限规则",
264
+ trigger: ["blur", "change"]
265
+ }
266
+ ],
267
+ appId: [{ required: !0, message: "请选择所属应用", trigger: ["blur", "change"] }],
268
+ resourceIds: [{ type: "array", required: !0, message: "请选择资源", trigger: ["blur", "change"] }],
269
+ orgIds: [{ type: "array", required: !0, message: "请选择部门", trigger: ["blur", "change"] }],
270
+ groupIds: [{ type: "array", required: !0, message: "请选择群组", trigger: ["blur", "change"] }]
271
+ }, s = v({
272
+ ...y
273
+ }), j = te(() => s.value.type === ie.CUSTOM_DEPT_AND_SUB || s.value.type === ie.CUSTOM_DEPT_ONLY), J = te(() => s.value.type === ie.CUSTOM_GROUP), d = v(!1), [o, c] = oe(!1), C = v(), k = v([]), $ = v(), M = v([]);
274
+ b();
275
+ async function W(u, t) {
276
+ if (T.value = u, d.value = !1, s.value = { ...y }, F(), ye(), ke(), t) {
277
+ d.value = !0;
278
+ const f = await Be({ id: t == null ? void 0 : t.id });
279
+ if (f.success && f.data) {
280
+ const { id: O, type: X, name: q, appId: z, orgs: U, resources: Q, groups: N } = f.data;
281
+ s.value = {
282
+ id: O,
283
+ type: X,
284
+ appId: z,
285
+ name: q || "",
286
+ orgIds: U == null ? void 0 : U.map((e) => e.id || ""),
287
+ resourceIds: Q == null ? void 0 : Q.map((e) => e.id || ""),
288
+ groupIds: N == null ? void 0 : N.map((e) => e.id || "")
289
+ }, U && U.length && (k.value = U.map((e) => ({
290
+ orgId: e.id,
291
+ orgName: e.name
292
+ }))), N && N.length && (M.value = N.map((e) => ({
293
+ id: e.id,
294
+ name: e.name,
295
+ value: e.id,
296
+ label: e.name && e.name.length > 20 ? e.name.slice(0, 20) : e.name
297
+ }))), await p(s.value.appId), s.value.resourceIds && h(s.value.resourceIds);
298
+ }
299
+ }
300
+ c(!0);
301
+ }
302
+ function se(u) {
303
+ s.value.resourceIds = [], E.value = [], u && p(u);
304
+ }
305
+ function i() {
306
+ var u;
307
+ (u = m.value) == null || u.validateFields(["appId"]).then(() => {
308
+ s.value.appId && s.value.resourceIds && A(s.value.resourceIds);
309
+ }).catch(() => {
310
+ });
311
+ }
312
+ function le(u) {
313
+ var t;
314
+ x(u), u && u.length ? (s.value.resourceIds = u.map((f) => f.id), (t = m.value) == null || t.clearValidate(["resourceIds"])) : s.value.resourceIds = [];
315
+ }
316
+ function be() {
317
+ C.value && C.value.open();
318
+ }
319
+ function xe() {
320
+ $.value && $.value.open(M.value);
321
+ }
322
+ function ye() {
323
+ k.value = [];
324
+ }
325
+ function ke() {
326
+ M.value = [];
327
+ }
328
+ function Ie(u) {
329
+ var t;
330
+ k.value = u, u.length ? (s.value.orgIds = u.map((f) => f.orgId || ""), (t = m.value) == null || t.clearValidate(["orgIds"])) : s.value.orgIds = [];
331
+ }
332
+ function he(u) {
333
+ var t;
334
+ M.value = u, u.length ? (s.value.groupIds = u.map((f) => f.id || ""), (t = m.value) == null || t.clearValidate(["groupIds"])) : s.value.groupIds = [];
335
+ }
336
+ const [Re, ce] = oe(!1);
337
+ function we() {
338
+ var u;
339
+ (u = m.value) == null || u.validate().then(() => {
340
+ ce(!0);
341
+ const t = d.value ? Ke : Ye, f = {
342
+ ...s.value
343
+ };
344
+ j.value || delete f.orgIds, J.value || delete f.groupIds, t(f).then((O) => {
345
+ O.success && (ve.success(`${T.value}成功!`), c(!1), Y("submit"));
346
+ }).finally(() => ce(!1));
347
+ });
348
+ }
349
+ function me() {
350
+ c(!1);
351
+ }
352
+ return K({
353
+ open: W
354
+ }), (u, t) => {
355
+ const f = $e, O = Te, X = Ge, q = pe, z = fe, U = Fe, Q = _e, N = Ee;
356
+ return r(), R(N, {
357
+ open: a(o),
358
+ "onUpdate:open": t[4] || (t[4] = (e) => Z(o) ? o.value = e : null),
359
+ title: `${a(T)}数据权限`,
360
+ placement: "right",
361
+ width: 600,
362
+ "destroy-on-close": "",
363
+ "footer-style": { textAlign: "right" },
364
+ onClose: me
365
+ }, {
366
+ footer: n(() => [
367
+ l(Q, null, {
368
+ default: n(() => [
369
+ l(q, { onClick: me }, {
370
+ default: n(() => t[8] || (t[8] = [
371
+ P(" 取消 ")
372
+ ])),
373
+ _: 1,
374
+ __: [8]
375
+ }),
376
+ l(q, {
377
+ type: "primary",
378
+ loading: a(Re),
379
+ onClick: t[3] || (t[3] = (e) => we())
380
+ }, {
381
+ default: n(() => t[9] || (t[9] = [
382
+ P(" 提交 ")
383
+ ])),
384
+ _: 1,
385
+ __: [9]
386
+ }, 8, ["loading"])
387
+ ]),
388
+ _: 1
389
+ /* STABLE */
390
+ })
391
+ ]),
392
+ default: n(() => [
393
+ l(U, {
394
+ ref_key: "formRef",
395
+ ref: m,
396
+ model: a(s),
397
+ rules: D,
398
+ "label-col": { span: 6 }
399
+ }, {
400
+ default: n(() => [
401
+ l(O, {
402
+ label: "数据权限名称",
403
+ name: "name"
404
+ }, {
405
+ default: n(() => [
406
+ l(f, {
407
+ value: a(s).name,
408
+ "onUpdate:value": t[0] || (t[0] = (e) => a(s).name = e),
409
+ maxlength: 20
410
+ }, null, 8, ["value"])
411
+ ]),
412
+ _: 1
413
+ /* STABLE */
414
+ }),
415
+ l(O, {
416
+ label: "数据权限规则",
417
+ name: "type"
418
+ }, {
419
+ default: n(() => [
420
+ l(X, {
421
+ value: a(s).type,
422
+ "onUpdate:value": t[1] || (t[1] = (e) => a(s).type = e),
423
+ options: a(ge),
424
+ placeholder: "请选择"
425
+ }, null, 8, ["value", "options"])
426
+ ]),
427
+ _: 1
428
+ /* STABLE */
429
+ }),
430
+ l(O, {
431
+ label: "所属应用",
432
+ name: "appId"
433
+ }, {
434
+ default: n(() => [
435
+ l(X, {
436
+ value: a(s).appId,
437
+ "onUpdate:value": t[2] || (t[2] = (e) => a(s).appId = e),
438
+ disabled: a(d),
439
+ options: a(w),
440
+ onChange: se
441
+ }, null, 8, ["value", "disabled", "options"])
442
+ ]),
443
+ _: 1
444
+ /* STABLE */
445
+ }),
446
+ l(O, {
447
+ label: "所属资源",
448
+ name: "resourceIds"
449
+ }, {
450
+ default: n(() => [
451
+ l(q, {
452
+ type: "primary",
453
+ onClick: i
454
+ }, {
455
+ default: n(() => t[5] || (t[5] = [
456
+ P(" 编辑资源 ")
457
+ ])),
458
+ _: 1,
459
+ __: [5]
460
+ }),
461
+ g("div", rt, [
462
+ (r(!0), _(
463
+ B,
464
+ null,
465
+ ee(a(E), (e) => (r(), _(
466
+ B,
467
+ { key: e },
468
+ [
469
+ e.name.length > 20 ? (r(), R(z, {
470
+ key: 0,
471
+ title: e.name
472
+ }, {
473
+ default: n(() => [
474
+ g(
475
+ "span",
476
+ ut,
477
+ I(`${e.name.slice(0, 20)}...`),
478
+ 1
479
+ /* TEXT */
480
+ )
481
+ ]),
482
+ _: 2
483
+ /* DYNAMIC */
484
+ }, 1032, ["title"])) : (r(), _(
485
+ "span",
486
+ it,
487
+ I(e.name),
488
+ 1
489
+ /* TEXT */
490
+ ))
491
+ ],
492
+ 64
493
+ /* STABLE_FRAGMENT */
494
+ ))),
495
+ 128
496
+ /* KEYED_FRAGMENT */
497
+ ))
498
+ ])
499
+ ]),
500
+ _: 1
501
+ /* STABLE */
502
+ }),
503
+ a(j) ? (r(), R(O, {
504
+ key: 0,
505
+ label: "所属部门",
506
+ name: "orgIds"
507
+ }, {
508
+ default: n(() => [
509
+ l(q, {
510
+ type: "primary",
511
+ onClick: be
512
+ }, {
513
+ default: n(() => t[6] || (t[6] = [
514
+ P(" 编辑部门 ")
515
+ ])),
516
+ _: 1,
517
+ __: [6]
518
+ }),
519
+ g("div", pt, [
520
+ (r(!0), _(
521
+ B,
522
+ null,
523
+ ee(a(k), (e) => (r(), _(
524
+ B,
525
+ { key: e },
526
+ [
527
+ e.orgName && e.orgName.length > 20 ? (r(), R(z, {
528
+ key: 0,
529
+ title: e.orgName
530
+ }, {
531
+ default: n(() => {
532
+ var H;
533
+ return [
534
+ g(
535
+ "span",
536
+ dt,
537
+ I(`${(H = e.orgName) == null ? void 0 : H.slice(0, 20)}...`),
538
+ 1
539
+ /* TEXT */
540
+ )
541
+ ];
542
+ }),
543
+ _: 2
544
+ /* DYNAMIC */
545
+ }, 1032, ["title"])) : (r(), _(
546
+ "span",
547
+ ct,
548
+ I(e.orgName),
549
+ 1
550
+ /* TEXT */
551
+ ))
552
+ ],
553
+ 64
554
+ /* STABLE_FRAGMENT */
555
+ ))),
556
+ 128
557
+ /* KEYED_FRAGMENT */
558
+ ))
559
+ ])
560
+ ]),
561
+ _: 1
562
+ /* STABLE */
563
+ })) : ae("v-if", !0),
564
+ a(J) ? (r(), R(O, {
565
+ key: 1,
566
+ label: "所属群组",
567
+ name: "groupIds"
568
+ }, {
569
+ default: n(() => [
570
+ l(q, {
571
+ type: "primary",
572
+ onClick: xe
573
+ }, {
574
+ default: n(() => t[7] || (t[7] = [
575
+ P(" 编辑群组 ")
576
+ ])),
577
+ _: 1,
578
+ __: [7]
579
+ }),
580
+ g("div", mt, [
581
+ (r(!0), _(
582
+ B,
583
+ null,
584
+ ee(a(M), (e) => (r(), _(
585
+ B,
586
+ { key: e },
587
+ [
588
+ e.name && e.name.length > 20 ? (r(), R(z, {
589
+ key: 0,
590
+ title: e.name
591
+ }, {
592
+ default: n(() => {
593
+ var H;
594
+ return [
595
+ g(
596
+ "span",
597
+ ft,
598
+ I(`${(H = e.name) == null ? void 0 : H.slice(0, 20)}...`),
599
+ 1
600
+ /* TEXT */
601
+ )
602
+ ];
603
+ }),
604
+ _: 2
605
+ /* DYNAMIC */
606
+ }, 1032, ["title"])) : (r(), _(
607
+ "span",
608
+ _t,
609
+ I(e.name),
610
+ 1
611
+ /* TEXT */
612
+ ))
613
+ ],
614
+ 64
615
+ /* STABLE_FRAGMENT */
616
+ ))),
617
+ 128
618
+ /* KEYED_FRAGMENT */
619
+ ))
620
+ ])
621
+ ]),
622
+ _: 1
623
+ /* STABLE */
624
+ })) : ae("v-if", !0)
625
+ ]),
626
+ _: 1
627
+ /* STABLE */
628
+ }, 8, ["model"]),
629
+ l(qe, {
630
+ ref_key: "orgRef",
631
+ ref: C,
632
+ "model-value": a(k),
633
+ multiple: "",
634
+ onSubmit: Ie
635
+ }, null, 8, ["model-value"]),
636
+ l(Ze, {
637
+ ref_key: "resourceModelRef",
638
+ ref: V,
639
+ mode: a(S),
640
+ onSelect: le
641
+ }, null, 8, ["mode"]),
642
+ l(
643
+ lt,
644
+ {
645
+ ref_key: "groupRef",
646
+ ref: $,
647
+ onSelect: he
648
+ },
649
+ null,
650
+ 512
651
+ /* NEED_PATCH */
652
+ )
653
+ ]),
654
+ _: 1
655
+ /* STABLE */
656
+ }, 8, ["open", "title"]);
657
+ };
658
+ }
659
+ }), gt = {
660
+ "w-full": "",
661
+ "h-full": "",
662
+ "py-10px": "",
663
+ "px-10px": "",
664
+ flex: "",
665
+ "flex-col": "",
666
+ class: "page-data-permission"
667
+ }, bt = {
668
+ key: 0
669
+ }, xt = ["onClick"], yt = {
670
+ class: "ml-4px"
671
+ }, kt = ["onClick"], It = {
672
+ class: "ml-4px"
673
+ }, Mt = /* @__PURE__ */ de({
674
+ name: "DataPermission",
675
+ __name: "index",
676
+ setup(ne) {
677
+ const K = v(), L = v(), Y = [{
678
+ valueType: "a-input",
679
+ title: "数据权限名称",
680
+ dataIndex: "name",
681
+ fieldProps: {
682
+ placeholder: "请输入",
683
+ allowClear: !0
684
+ }
685
+ }, {
686
+ valueType: "a-select",
687
+ title: "数据权限规则",
688
+ dataIndex: "type",
689
+ fieldProps: {
690
+ placeholder: "请选择",
691
+ allowClear: !0,
692
+ options: ge
693
+ },
694
+ ellipsis: !0
695
+ }, {
696
+ hideInSearch: !0,
697
+ title: "创建时间",
698
+ dataIndex: "createTime",
699
+ ellipsis: !0
700
+ }, {
701
+ hideInSearch: !0,
702
+ title: "更新时间",
703
+ dataIndex: "updateTime",
704
+ ellipsis: !0
705
+ }, {
706
+ hideInSearch: !0,
707
+ title: "操作",
708
+ dataIndex: "action",
709
+ width: 200,
710
+ fixed: "right"
711
+ }];
712
+ async function S(p) {
713
+ var m, D;
714
+ const {
715
+ current: x,
716
+ pageSize: h,
717
+ type: F,
718
+ name: A
719
+ } = p, y = await je({
720
+ pageSize: h,
721
+ currentPage: x,
722
+ doSearchTotal: !0,
723
+ type: F,
724
+ name: A
725
+ });
726
+ return {
727
+ success: y.success,
728
+ data: ((m = y.data) == null ? void 0 : m.records) ?? [],
729
+ total: ((D = y.data) == null ? void 0 : D.total) ?? 0
730
+ };
731
+ }
732
+ function w() {
733
+ K.value.reload();
734
+ }
735
+ const [V, E] = oe(!1);
736
+ function b(p, x) {
737
+ if (!V.value)
738
+ switch (p) {
739
+ case G.ADD:
740
+ L.value.open(p);
741
+ break;
742
+ case G.EDIT:
743
+ L.value.open(p, x);
744
+ break;
745
+ case G.REMOVE:
746
+ He.confirm({
747
+ title: "删除",
748
+ content: "确定要删除该权限吗?",
749
+ async onOk() {
750
+ E(!0), ze({
751
+ id: x == null ? void 0 : x.id
752
+ }).then((h) => {
753
+ h.success && (ve.success("删除成功"), w());
754
+ }).finally(() => E(!1));
755
+ }
756
+ });
757
+ break;
758
+ }
759
+ }
760
+ return (p, x) => {
761
+ const h = Me, F = pe, A = Ae, T = _e, y = Le("auth");
762
+ return r(), _("div", gt, [l(
763
+ a(Qe),
764
+ {
765
+ ref_key: "tableRef",
766
+ ref: K,
767
+ "row-key": "id",
768
+ request: S,
769
+ columns: Y,
770
+ "auto-height": "",
771
+ scroll: {
772
+ x: 1e3
773
+ }
774
+ },
775
+ {
776
+ toolbar: n(() => [re((r(), R(F, {
777
+ type: "primary",
778
+ onClick: x[0] || (x[0] = (m) => b(a(G).ADD))
779
+ }, {
780
+ default: n(() => [l(h), P(
781
+ " " + I(a(G).ADD),
782
+ 1
783
+ /* TEXT */
784
+ )]),
785
+ _: 1
786
+ /* STABLE */
787
+ })), [[y, "data_permission_create"]])]),
788
+ bodyCell: n(({
789
+ column: m,
790
+ record: D
791
+ }) => [m.dataIndex === "type" ? (r(), _(
792
+ "span",
793
+ bt,
794
+ I(a(et)[D.type]),
795
+ 1
796
+ /* TEXT */
797
+ )) : ae("v-if", !0), m.dataIndex === "action" ? (r(), R(
798
+ T,
799
+ {
800
+ key: 1
801
+ },
802
+ {
803
+ default: n(() => [re((r(), _("a", {
804
+ class: "flex items-center hover:opacity-80",
805
+ onClick: (s) => b(a(G).EDIT, D)
806
+ }, [l(A, {
807
+ name: "edit",
808
+ class: "text-base"
809
+ }), g(
810
+ "span",
811
+ yt,
812
+ I(a(G).EDIT),
813
+ 1
814
+ /* TEXT */
815
+ )], 8, xt)), [[y, "data_permission_edit"]]), re((r(), _("a", {
816
+ flex: "",
817
+ "items-center": "",
818
+ "text-red-500": "",
819
+ "hover:cursor-pointer": "",
820
+ "hover:text-red-500": "",
821
+ "hover:opacity-80": "",
822
+ onClick: (s) => b(a(G).REMOVE, D)
823
+ }, [l(A, {
824
+ name: "remove",
825
+ class: "text-base"
826
+ }), g(
827
+ "span",
828
+ It,
829
+ I(a(G).REMOVE),
830
+ 1
831
+ /* TEXT */
832
+ )], 8, kt)), [[y, "data_permission_delete"]])]),
833
+ _: 2
834
+ /* DYNAMIC */
835
+ },
836
+ 1024
837
+ /* DYNAMIC_SLOTS */
838
+ )) : ae("v-if", !0)]),
839
+ _: 1
840
+ /* STABLE */
841
+ },
842
+ 512
843
+ /* NEED_PATCH */
844
+ ), l(
845
+ vt,
846
+ {
847
+ ref_key: "drawerRef",
848
+ ref: L,
849
+ onSubmit: w
850
+ },
851
+ null,
852
+ 512
853
+ /* NEED_PATCH */
854
+ )]);
855
+ };
856
+ }
857
+ });
858
+ export {
859
+ Mt as default
860
+ };