@pubinfo/module-rbac 2.1.11 → 2.1.12

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 (246) hide show
  1. package/dist/{ComponentSelect-A7uGTuHW.js → ComponentSelect-CYmAgdm3.js} +998 -963
  2. package/dist/DynamicRoutesForm-CMF3oh8h.js +171 -0
  3. package/dist/HCheckList-CAhQwX7m.js +39 -0
  4. package/dist/HoverCard-B-uU48hF.js +46 -0
  5. package/dist/IconSelect-CvxGRN_O.js +719 -0
  6. package/dist/ImportExport-CzZssb7_.js +345 -0
  7. package/dist/ImportExport-b1SnWRLj.js +6 -0
  8. package/dist/LayoutForm-Bpdyi_2o.js +129 -0
  9. package/dist/MetaForm-ZLzLz68d.js +39037 -0
  10. package/dist/OrgAndPosition-B0RE1Vc_.js +187 -0
  11. package/dist/OrgSelector-C2rPIonI.js +4877 -0
  12. package/dist/OrgSelector.css +1 -0
  13. package/dist/ResourceEdit-9fvxbd0K.js +383 -0
  14. package/dist/ResourceEdit-BMqfJ3aQ.js +13 -0
  15. package/dist/ResourceRelation-BrluMHdX.js +81 -0
  16. package/dist/ResourceRelation-IJvXnlpo.js +95 -0
  17. package/dist/RoleRelation-DuRuQG08.js +82 -0
  18. package/dist/RoleSelector-BTNYbcC6.js +282 -0
  19. package/dist/TenantEdit-Df3gZKLA.js +249 -0
  20. package/dist/UserAuthorization-DX7jNDDe.js +237 -0
  21. package/dist/UserEdit-BLb0n7WM.js +322 -0
  22. package/dist/_baseClone-C7vkGgsW.js +138 -0
  23. package/dist/_initCloneObject-r-eWKqzl.js +531 -0
  24. package/dist/add-child-DPb_m2by.js +4 -0
  25. package/dist/{animation_item-DBOz2rcX.js → animation_item-Coe-B0jQ.js} +24 -19
  26. package/dist/assist-BRMYD-oT.js +89 -0
  27. package/dist/authority-B9wtmsQd.js +4 -0
  28. package/dist/authorize-DxrutyIG.js +4 -0
  29. package/dist/blackWhiteList-d6TVsK48.js +214 -0
  30. package/dist/blacklist-disable-BKSw91qq.js +4 -0
  31. package/dist/blacklist-enable-CIB1fOHT.js +4 -0
  32. package/dist/breadcrumb_setting-DMbvWP5t.js +111 -0
  33. package/dist/browser-chrome-CM60RcrG.js +4 -0
  34. package/dist/browser-edge-4LBRzooM.js +4 -0
  35. package/dist/browser-ie-BF-wqbf6.js +4 -0
  36. package/dist/browser-other-iXJH-9iL.js +4 -0
  37. package/dist/browser-safari-CIpt0yPc.js +4 -0
  38. package/dist/browserType-Bik20-72.js +28 -0
  39. package/dist/chunk-WQLz0Won.js +20 -0
  40. package/dist/cloneDeep-REaxTPsZ.js +8 -0
  41. package/dist/createAndEditDataPermission-OunqmBu_.js +438 -0
  42. package/dist/data-permission-2pzeFLxP.js +159 -0
  43. package/dist/{dayjs.min-Cb7gQFd4.js → dayjs.min-CJunOGCc.js} +5 -3
  44. package/dist/dictionary-DGqlAhRk.js +182 -0
  45. package/dist/dist-DxAYQq3U.js +21 -0
  46. package/dist/drawerBlackWhiteList-VxyjaBkA.js +123 -0
  47. package/dist/drawerDictionary-DhAB-LV9.js +129 -0
  48. package/dist/drawerDictionaryItem-DYsJzZ2f.js +141 -0
  49. package/dist/drawerGroup-CTO8Lmbb.js +189 -0
  50. package/dist/drawerOrganization-DWhTc1fB.js +253 -0
  51. package/dist/drawerPosition-BmM9mLlP.js +169 -0
  52. package/dist/drawerRegion-BD-xc1x2.js +189 -0
  53. package/dist/drawerRole-B348x40k.js +214 -0
  54. package/dist/drawerRole-CgAPM-0g.js +172 -0
  55. package/dist/drawerRole-Cjp9iDsa.js +157 -0
  56. package/dist/edit-Drp8yjRe.js +4 -0
  57. package/dist/enum-CG0P82pn.js +6 -0
  58. package/dist/{enum-3E_sUqRF.js → enum-CR5ztb5v2.js} +15 -14
  59. package/dist/enum-CYCebJeC.js +62 -0
  60. package/dist/enum-DS4SGhiF.js +6 -0
  61. package/dist/enum-zdKA3Jy-.js +23 -0
  62. package/dist/group-C6Rj3K5I.js +178 -0
  63. package/dist/icard-BULUUV5m.js +4 -0
  64. package/dist/icon_animation-DuEY1FMm.js +4 -0
  65. package/dist/icon_breadcrumb-Y788iP_T.js +4 -0
  66. package/dist/icon_copyright-C1BER6kq.js +4 -0
  67. package/dist/icon_jt-ICOdrIF6.js +4 -0
  68. package/dist/icon_layout-D_wV9rX3.js +4 -0
  69. package/dist/icon_mainpage-Cz6_cxpJ.js +4 -0
  70. package/dist/icon_menu-y7SblUoR.js +4 -0
  71. package/dist/icon_page_size-BjwT656E.js +4 -0
  72. package/dist/icon_position_type-CPxcDgmM.js +4 -0
  73. package/dist/icon_safe_manage-CoqVRBLl.js +4 -0
  74. package/dist/icon_screen_scale-DURlkq3C.js +4 -0
  75. package/dist/icon_system_manage-BLXs2CQg.js +4 -0
  76. package/dist/icon_tabbar-_0QWhSBV.js +4 -0
  77. package/dist/icon_toolbar-BXpfu0iq.js +4 -0
  78. package/dist/icon_topbar-DrwvB8Jw.js +4 -0
  79. package/dist/icon_watermark-DwNqjAiA.js +4 -0
  80. package/dist/index.css +1 -1
  81. package/dist/index.js +587 -6775
  82. package/dist/isEmpty-2rx9iUQv.js +14 -0
  83. package/dist/isEqual-CNeQLaCM.js +474 -0
  84. package/dist/itemlist-BGe-z1IR.js +159 -0
  85. package/dist/layout_setting-Cds3TCHc.js +71 -0
  86. package/dist/log-DOMU9MyH.js +18 -0
  87. package/dist/log-center-BrGlNhMd.js +4 -0
  88. package/dist/loginHistoryDetail-Coba_ajy.js +80 -0
  89. package/dist/{login_history-BiwaLpxA.js → login_history-CrXkEsHb.js} +38 -35
  90. package/dist/menu_setting-Br5dOEUk.js +158 -0
  91. package/dist/not-data-C-MacYF3.js +5 -0
  92. package/dist/operateHistoryDetail-DfDQL5BF.js +92 -0
  93. package/dist/{operate_history-sPd9IHMV.js → operate_history-BtHgPhmF.js} +38 -35
  94. package/dist/org-main-BRMBumDm.js +4 -0
  95. package/dist/org-unmain-0BHnrNdD.js +4 -0
  96. package/dist/organization-BbFERZ1l.js +15411 -0
  97. package/dist/other_setting-D92SlFvl.js +216 -0
  98. package/dist/page_animation_setting-Cy2R0vZy.js +111 -0
  99. package/dist/page_w_setting-DryWrqcx.js +66 -0
  100. package/dist/position-B1bqGly6.js +169 -0
  101. package/dist/rbac-B59CVHDt.js +460 -0
  102. package/dist/region-B_n1KXMG.js +182 -0
  103. package/dist/remove-BTME2Fhs.js +4 -0
  104. package/dist/request-7X2hpUru.js +5 -0
  105. package/dist/resource-CPNNd1l0.js +275 -0
  106. package/dist/resource-app-D8to3Lkn.js +4 -0
  107. package/dist/resource-btn-Cz-A_EQF.js +4 -0
  108. package/dist/resource-dynamic-BUqWxUiU.js +4 -0
  109. package/dist/resource-index-D2roT002.js +4 -0
  110. package/dist/resource-menu-BRER68rK.js +4 -0
  111. package/dist/resource-micro-Hyucl9de.js +4 -0
  112. package/dist/resource-nonmenu-7FcPEpHv.js +4 -0
  113. package/dist/role-CMd7WDRC.js +195 -0
  114. package/dist/role_group-DHh2s911.js +174 -0
  115. package/dist/safe_setting-CuTBmUve.js +225 -0
  116. package/dist/setItem-BwXZ5Uqx.js +4 -0
  117. package/dist/setItem-DlhIkIgh.js +78 -0
  118. package/dist/setting-manage-UHelpLrr.js +4 -0
  119. package/dist/stores-C-zbXsms.js +2 -0
  120. package/dist/tabbar_setting-CjW9LGPp.js +142 -0
  121. package/dist/tenant-B_vgufMG.js +180 -0
  122. package/dist/theme-check-mark-DRzx4sTs.js +4 -0
  123. package/dist/theme-title-BRvQ_qPg.js +4 -0
  124. package/dist/theme_setting-DMP0_nZ1.js +114 -0
  125. package/dist/toolbar_setting-ClxxvA7R.js +143 -0
  126. package/dist/useAppAndResource-D6WnpUPR.js +55 -0
  127. package/dist/user-BhytPqnx.js +348 -0
  128. package/dist/{vanilla-picker-Byb6q187.js → vanilla-picker-2HFham9c.js} +61 -59
  129. package/dist/view-Cridj7u2.js +4 -0
  130. package/dist/view-lBxqXfPW.js +114 -0
  131. package/dist/watermark_setting-b3vBYWwY.js +194 -0
  132. package/dist/zddata-CnvPWtIW.js +4 -0
  133. package/dist/zy_checked-C25HQlnr.js +4 -0
  134. package/dist/zy_default-B7RKtyqy.js +4 -0
  135. package/package.json +3 -3
  136. package/dist/DynamicRoutesForm-DSzy_bh5.js +0 -169
  137. package/dist/HCheckList-ODQHidN8.js +0 -37
  138. package/dist/HoverCard-CmJCoa2b.js +0 -44
  139. package/dist/IconSelect-DouEg3xY.js +0 -717
  140. package/dist/ImportExport-DisdLoY8.js +0 -342
  141. package/dist/LayoutForm-Bdfs5WeK.js +0 -125
  142. package/dist/MetaForm-CcDwS8vh.js +0 -38902
  143. package/dist/OrgAndPosition-jDX7m0HD.js +0 -184
  144. package/dist/ResourceEdit-0BYZRye_.js +0 -381
  145. package/dist/ResourceRelation-CU-QpUhP.js +0 -76
  146. package/dist/ResourceRelation-roz0a8Td.js +0 -91
  147. package/dist/RoleRelation-BQQFaum0.js +0 -79
  148. package/dist/RoleSelector-gkar_UGG.js +0 -275
  149. package/dist/TenantEdit-BsahDUlf.js +0 -246
  150. package/dist/UserAuthorization-2Fl4IGw7.js +0 -233
  151. package/dist/UserEdit-CX3Qau8T.js +0 -320
  152. package/dist/add-child-CFHHkjfg.js +0 -2
  153. package/dist/authority-L7SfiMdP.js +0 -2
  154. package/dist/authorize-qMpV_BXT.js +0 -2
  155. package/dist/blackWhiteList-DbG7JH8n.js +0 -211
  156. package/dist/blacklist-disable-BT6Xx-JG.js +0 -2
  157. package/dist/blacklist-enable-CJ6DK_V2.js +0 -2
  158. package/dist/breadcrumb_setting-DTR6CPZQ.js +0 -108
  159. package/dist/browser-chrome-DuAegVCe.js +0 -2
  160. package/dist/browser-edge-DzkWdXRd.js +0 -2
  161. package/dist/browser-ie-DZ9g_MXr.js +0 -2
  162. package/dist/browser-other-BmkifoYq.js +0 -2
  163. package/dist/browser-safari-CXrCuF2a.js +0 -2
  164. package/dist/browserType-B8A1Osvk.js +0 -26
  165. package/dist/chunk-DiMWNkAf.js +0 -18
  166. package/dist/cloneDeep-CSOSavu3.js +0 -6
  167. package/dist/createAndEditDataPermission-8_KNLzJT.js +0 -431
  168. package/dist/data-permission-LpuDLDm0.js +0 -152
  169. package/dist/dictionary-CEaxjqZe.js +0 -179
  170. package/dist/drawerBlackWhiteList-DXLdWurZ.js +0 -120
  171. package/dist/drawerDictionary-DYJTAZr6.js +0 -126
  172. package/dist/drawerDictionaryItem-BChXD2-q.js +0 -138
  173. package/dist/drawerGroup-CdnZkZxi.js +0 -185
  174. package/dist/drawerOrganization-CwtSFUj0.js +0 -247
  175. package/dist/drawerPosition-CfyfeQCN.js +0 -166
  176. package/dist/drawerRegion-DAwY_29K.js +0 -183
  177. package/dist/drawerRole-B7uCfHk-.js +0 -154
  178. package/dist/drawerRole-DK6DrinO.js +0 -209
  179. package/dist/drawerRole-DrzMHL0O.js +0 -167
  180. package/dist/edit-fZ7h_z_Z.js +0 -2
  181. package/dist/enum-3mYayxff.js +0 -61
  182. package/dist/enum-Cr7uWnB2.js +0 -23
  183. package/dist/enum-D2UEJsrC.js +0 -4
  184. package/dist/group-CaOhkh72.js +0 -172
  185. package/dist/icard-H-d9Pip-.js +0 -2
  186. package/dist/icon_animation-BCdRKkE5.js +0 -2
  187. package/dist/icon_breadcrumb-BR6LK8hP.js +0 -2
  188. package/dist/icon_copyright-BfWn1s6t.js +0 -2
  189. package/dist/icon_jt-DOMTq9De.js +0 -2
  190. package/dist/icon_layout-DKqAThpM.js +0 -2
  191. package/dist/icon_mainpage-CXB9JMGv.js +0 -2
  192. package/dist/icon_menu-BYQtWV-Q.js +0 -2
  193. package/dist/icon_page_size-r-z4oHWp.js +0 -2
  194. package/dist/icon_position_type-JDFdklRh.js +0 -2
  195. package/dist/icon_safe_manage-BDTIOduB.js +0 -2
  196. package/dist/icon_screen_scale-vEaAdr9S.js +0 -2
  197. package/dist/icon_system_manage-CkhQtieE.js +0 -2
  198. package/dist/icon_tabbar-DZNj-h-p.js +0 -2
  199. package/dist/icon_toolbar-BBYhGmEf.js +0 -2
  200. package/dist/icon_topbar-Bc379eaS.js +0 -2
  201. package/dist/icon_watermark-CTP8r-e2.js +0 -2
  202. package/dist/isEmpty-BjEzPyCa.js +0 -12
  203. package/dist/itemlist-CFwRUV2Y.js +0 -156
  204. package/dist/layout_setting-79srmFgJ.js +0 -68
  205. package/dist/log-BYris9iT.js +0 -14
  206. package/dist/log-center-CGT-BGAN.js +0 -2
  207. package/dist/loginHistoryDetail-CZnfmbbM.js +0 -78
  208. package/dist/menu_setting-C2GciMXz.js +0 -155
  209. package/dist/not-data-Bml86wdH.js +0 -3
  210. package/dist/operateHistoryDetail-HId-EZzy.js +0 -90
  211. package/dist/org-main-DnftBa38.js +0 -2
  212. package/dist/org-unmain-ByMarqFw.js +0 -2
  213. package/dist/organization-Dv3FbKke.js +0 -15316
  214. package/dist/other_setting-oVuhA70c.js +0 -213
  215. package/dist/page_animation_setting-D0CtzyOZ.js +0 -108
  216. package/dist/page_w_setting-Q--ct16C.js +0 -63
  217. package/dist/position-CCZ2MSMP.js +0 -166
  218. package/dist/region-D3mjqB8H.js +0 -179
  219. package/dist/remove-DfZZBE2T.js +0 -2
  220. package/dist/resource-DaQ7CvM_.js +0 -271
  221. package/dist/resource-app-QSLZ7Hts.js +0 -2
  222. package/dist/resource-btn-BcB4xMgR.js +0 -2
  223. package/dist/resource-dynamic-D69oEbaO.js +0 -2
  224. package/dist/resource-index-BIHr3PZY.js +0 -2
  225. package/dist/resource-menu-0JSNn7S7.js +0 -2
  226. package/dist/resource-micro-CcX_pmaJ.js +0 -2
  227. package/dist/resource-nonmenu-DFItasMT.js +0 -2
  228. package/dist/role-4UgEw3nH.js +0 -192
  229. package/dist/role_group-hkRlCnyl.js +0 -171
  230. package/dist/safe_setting-4fv3qNRZ.js +0 -221
  231. package/dist/setItem-Vkcwkj-O.js +0 -77
  232. package/dist/setting-manage-C9whamLP.js +0 -2
  233. package/dist/stores-DPQF8JRt.js +0 -2
  234. package/dist/tabbar_setting-DhrW4Jj5.js +0 -139
  235. package/dist/tenant-lWfGw2u1.js +0 -177
  236. package/dist/theme-check-mark-DG4oWCQN.js +0 -2
  237. package/dist/theme-title-BCYnl2jK.js +0 -2
  238. package/dist/theme_setting-CEb7UYQO.js +0 -111
  239. package/dist/toolbar_setting-znESrYgi.js +0 -140
  240. package/dist/useAppAndResource-B7FmNfKG.js +0 -52
  241. package/dist/user-BkUpcQC8.js +0 -339
  242. package/dist/view-Bnu34EJT.js +0 -2
  243. package/dist/watermark_setting-DYirSIAn.js +0 -191
  244. package/dist/zddata-Ceyga3_2.js +0 -2
  245. package/dist/zy_checked-DvD7k9F8.js +0 -2
  246. package/dist/zy_default-DJ2tB3Fo.js +0 -2
@@ -0,0 +1,282 @@
1
+ import { n as e } from "./dist-DxAYQq3U.js";
2
+ import { ct as t, nt as n, tt as r } from "./rbac-B59CVHDt.js";
3
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, isRef as m, mergeModels as h, mergeProps as g, normalizeProps as _, normalizeStyle as v, onMounted as y, openBlock as b, reactive as x, ref as S, renderList as C, toDisplayString as w, unref as T, useModel as E, vShow as D, withCtx as O, withDirectives as k } from "vue";
4
+ import { CloseOutlined as A, SearchOutlined as j } from "@ant-design/icons-vue";
5
+ import { Card as M, Checkbox as N, CheckboxGroup as P, Modal as F, Spin as I, Tooltip as L, theme as R } from "ant-design-vue";
6
+ import { Input as z, Select as B, SelectOption as V, Tooltip as H } from "ant-design-vue/es";
7
+ //#region src/components/RoleSelector/RoleSearch.vue?vue&type=script&setup=true&lang.ts
8
+ var U = { key: 1 }, W = /* @__PURE__ */ f({
9
+ name: "RoleSearch",
10
+ __name: "RoleSearch",
11
+ props: /* @__PURE__ */ h({ group: {
12
+ type: Boolean,
13
+ default: !1
14
+ } }, {
15
+ modelValue: {},
16
+ modelModifiers: {},
17
+ groupId: {},
18
+ groupIdModifiers: {}
19
+ }),
20
+ emits: /* @__PURE__ */ h(["select"], ["update:modelValue", "update:groupId"]),
21
+ setup(e, { emit: t }) {
22
+ let n = e, a = t, s = E(e, "modelValue"), l = E(e, "groupId"), f = S([]);
23
+ async function p() {
24
+ let e = await r({ name: "" });
25
+ e.success && (f.value = e.data ?? []);
26
+ }
27
+ return y(() => {
28
+ n.group && p();
29
+ }), (t, n) => {
30
+ let r = V, p = H, m = B, h = z;
31
+ return b(), o(h, {
32
+ value: s.value,
33
+ "onUpdate:value": n[2] ||= (e) => s.value = e,
34
+ placeholder: "请输入",
35
+ "allow-clear": ""
36
+ }, {
37
+ addonBefore: O(() => [e.group ? (b(), o(m, {
38
+ key: 0,
39
+ value: l.value,
40
+ "onUpdate:value": n[0] ||= (e) => l.value = e,
41
+ style: { width: "90px" },
42
+ onChange: n[1] ||= (e) => a("select", e)
43
+ }, {
44
+ default: O(() => [d(r, { value: "" }, {
45
+ default: O(() => [...n[3] ||= [u(" 全部 ", -1)]]),
46
+ _: 1
47
+ }), (b(!0), c(i, null, C(T(f), (e) => (b(), o(r, {
48
+ key: e.id,
49
+ value: e.id
50
+ }, {
51
+ default: O(() => [d(p, { title: e.name }, {
52
+ default: O(() => [u(w(e.name), 1)]),
53
+ _: 2
54
+ }, 1032, ["title"])]),
55
+ _: 2
56
+ }, 1032, ["value"]))), 128))]),
57
+ _: 1
58
+ }, 8, ["value"])) : (b(), c("div", U, " 全部 "))]),
59
+ suffix: O(() => [d(T(j))]),
60
+ _: 1
61
+ }, 8, ["value"]);
62
+ };
63
+ }
64
+ }), G = /* @__PURE__ */ f({
65
+ name: "TooltipLabel",
66
+ inheritAttrs: !1,
67
+ __name: "TooltipLabel",
68
+ props: {
69
+ name: {},
70
+ size: { default: 21 }
71
+ },
72
+ setup(e) {
73
+ return (t, n) => (e.name || "").length > e.size ? (b(), o(T(L), {
74
+ key: 0,
75
+ title: e.name
76
+ }, {
77
+ default: O(() => [l("span", _(p(t.$attrs)), w(`${e.name?.slice(0, e.size)}...`), 17)]),
78
+ _: 1
79
+ }, 8, ["title"])) : (b(), c("span", _(g({ key: 1 }, t.$attrs)), w(e.name), 17));
80
+ }
81
+ });
82
+ //#endregion
83
+ //#region src/components/RoleSelector/useRole.ts
84
+ function K() {
85
+ let [n, r] = e(!1), i = S([]);
86
+ async function a() {
87
+ try {
88
+ r(!0);
89
+ let e = await t();
90
+ e.success && (i.value = e.data ?? []);
91
+ } finally {
92
+ r(!1);
93
+ }
94
+ }
95
+ return {
96
+ loading: n,
97
+ setLoading: r,
98
+ roles: i,
99
+ getData: a
100
+ };
101
+ }
102
+ function q() {
103
+ let [t, r] = e(!1), i = S([]);
104
+ async function a(e) {
105
+ try {
106
+ r(!0);
107
+ let t = await n({ id: e });
108
+ t.success && (i.value = t.data?.roles ?? []);
109
+ } finally {
110
+ r(!1);
111
+ }
112
+ }
113
+ return {
114
+ loading: t,
115
+ setLoading: r,
116
+ roles: i,
117
+ getData: a
118
+ };
119
+ }
120
+ //#endregion
121
+ //#region src/components/RoleSelector/RoleSelector.vue?vue&type=script&setup=true&lang.ts
122
+ var J = { class: "h-full flex" }, Y = { class: "p-2 flex flex-col h-full gap-2" }, X = { class: "flex-1 overflow-y-auto overflow-x-hidden" }, Z = {
123
+ key: 0,
124
+ class: "flex items-center justify-center size-full"
125
+ }, Q = { class: "gap-1 p-2 h-full overflow-y-auto" }, $ = /* @__PURE__ */ f({
126
+ name: "RoleSelector",
127
+ __name: "RoleSelector",
128
+ props: /* @__PURE__ */ h({ group: {
129
+ type: Boolean,
130
+ default: !1
131
+ } }, {
132
+ open: { type: Boolean },
133
+ openModifiers: {}
134
+ }),
135
+ emits: /* @__PURE__ */ h(["select"], ["update:open"]),
136
+ setup(t, { expose: n, emit: r }) {
137
+ let u = r, { token: f } = R.useToken(), p = E(t, "open"), h = e(p), g = S([]), _ = x(K()), y = x(q()), w = S(""), j = S("");
138
+ async function L(e) {
139
+ await y.getData(e);
140
+ }
141
+ async function z(e = []) {
142
+ g.value = e, w.value = "", j.value = "", await _.getData(), h(!0);
143
+ }
144
+ let B = a(() => j.value === "" ? _.roles : y.roles);
145
+ function V(e) {
146
+ return B.value.findIndex((t) => t.id === e.id) > -1 && e.name?.includes(w.value);
147
+ }
148
+ function H(e, t) {
149
+ e.target.checked ? g.value.push({
150
+ value: t.id,
151
+ label: t.name
152
+ }) : g.value = g.value.filter((e) => e.value !== t.id);
153
+ }
154
+ function U(e) {
155
+ g.value = g.value.filter((t) => t.value !== e);
156
+ }
157
+ function $() {
158
+ u("select", g.value), h(!1);
159
+ }
160
+ function ee() {
161
+ g.value = g.value.filter((e) => !_.roles.some((t) => t.id === e.value));
162
+ }
163
+ return n({ open: z }), (e, n) => (b(), o(T(F), {
164
+ open: p.value,
165
+ "onUpdate:open": n[3] ||= (e) => p.value = e,
166
+ title: "角色选择",
167
+ "mask-closable": !1,
168
+ width: 750,
169
+ "z-index": 1001,
170
+ "ok-text": "确认",
171
+ "cancel-text": "取消",
172
+ "destroy-on-close": "",
173
+ onOk: n[4] ||= (e) => $()
174
+ }, {
175
+ default: O(() => [l("div", {
176
+ class: "border border-solid h-[400px]",
177
+ style: v({ borderColor: T(f).colorBorder })
178
+ }, [l("div", J, [
179
+ d(T(M), {
180
+ bordered: !1,
181
+ size: "small",
182
+ "head-style": {
183
+ backgroundColor: T(f).colorBgLayout,
184
+ borderRadius: 0,
185
+ borderWidth: 0,
186
+ borderBottomWidth: "1px",
187
+ padding: 0
188
+ },
189
+ "body-style": {
190
+ flex: 1,
191
+ padding: 0,
192
+ height: "calc(100% - 38px)"
193
+ },
194
+ style: v({
195
+ boxShadow: "none",
196
+ borderRadius: 0,
197
+ borderColor: T(f).colorBorder
198
+ }),
199
+ class: "flex h-full flex-col w-1/2"
200
+ }, {
201
+ default: O(() => [l("div", Y, [d(W, {
202
+ modelValue: T(w),
203
+ "onUpdate:modelValue": n[0] ||= (e) => m(w) ? w.value = e : null,
204
+ "group-id": T(j),
205
+ "onUpdate:groupId": n[1] ||= (e) => m(j) ? j.value = e : null,
206
+ group: t.group,
207
+ onSelect: L
208
+ }, null, 8, [
209
+ "modelValue",
210
+ "group-id",
211
+ "group"
212
+ ]), l("div", X, [T(_).loading || T(y).loading ? (b(), c("div", Z, [d(T(I))])) : (b(), o(T(P), {
213
+ key: 1,
214
+ value: T(g).map((e) => e.value),
215
+ class: "w-full overflow-x-hidden"
216
+ }, {
217
+ default: O(() => [(b(!0), c(i, null, C(T(B), (e) => k((b(), c("div", {
218
+ key: e.id,
219
+ class: "w-full py-2 border-0 border-b border-solid truncate",
220
+ style: v({ borderColor: T(f).colorBorder })
221
+ }, [d(T(N), {
222
+ value: e.id,
223
+ onChange: (t) => H(t, e)
224
+ }, {
225
+ default: O(() => [d(G, { name: e.name }, null, 8, ["name"])]),
226
+ _: 2
227
+ }, 1032, ["value", "onChange"])], 4)), [[D, V(e)]])), 128))]),
228
+ _: 1
229
+ }, 8, ["value"]))])])]),
230
+ _: 1
231
+ }, 8, ["head-style", "style"]),
232
+ l("div", {
233
+ style: v({ borderColor: T(f).colorBorder }),
234
+ class: "h-full border-0 border-r border-solid"
235
+ }, null, 4),
236
+ d(T(M), {
237
+ bordered: !1,
238
+ size: "small",
239
+ "head-style": {
240
+ backgroundColor: T(f).colorBgLayout,
241
+ borderRadius: 0,
242
+ borderWidth: 0,
243
+ borderBottomWidth: "1px"
244
+ },
245
+ "body-style": {
246
+ flex: 1,
247
+ padding: 0,
248
+ overflow: "hidden"
249
+ },
250
+ style: {
251
+ boxShadow: "none",
252
+ borderRadius: 0
253
+ },
254
+ class: "flex h-full flex-col flex-1"
255
+ }, {
256
+ title: O(() => [...n[5] ||= [l("span", { class: "font-normal" }, " 已选角色 ", -1)]]),
257
+ extra: O(() => [l("a", {
258
+ style: v({ color: T(f).colorPrimary }),
259
+ onClick: n[2] ||= (e) => ee()
260
+ }, " 清空 ", 4)]),
261
+ default: O(() => [l("div", Q, [(b(!0), c(i, null, C(T(g), (e) => (b(), c("div", {
262
+ key: e.value,
263
+ class: "inline-block mb-1 py-1 px-2 mx-0.5 max-w-full rounded",
264
+ style: v({ backgroundColor: T(f).colorPrimaryBg })
265
+ }, [d(G, {
266
+ name: e.label,
267
+ size: 20
268
+ }, null, 8, ["name"]), T(_).roles.some((t) => t.id === e.value) ? (b(), o(T(A), {
269
+ key: 0,
270
+ class: "ml-1 cursor-pointer text-xs",
271
+ style: v({ color: T(f).colorPrimary }),
272
+ onClick: (t) => U(e.value)
273
+ }, null, 8, ["style", "onClick"])) : s("", !0)], 4))), 128))])]),
274
+ _: 1
275
+ }, 8, ["head-style"])
276
+ ])], 4)]),
277
+ _: 1
278
+ }, 8, ["open"]));
279
+ }
280
+ });
281
+ //#endregion
282
+ export { $ as t };
@@ -0,0 +1,249 @@
1
+ import { r as e } from "./chunk-WQLz0Won.js";
2
+ import { t } from "./cloneDeep-REaxTPsZ.js";
3
+ import { n } from "./dist-DxAYQq3U.js";
4
+ import { _ as r, h as i, m as a, w as o } from "./rbac-B59CVHDt.js";
5
+ import { ResourceSelector as s } from "./index.js";
6
+ import { Fragment as c, computed as l, createBlock as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, isRef as g, onMounted as _, openBlock as v, reactive as y, ref as b, renderList as x, toDisplayString as S, unref as C, withCtx as w } from "vue";
7
+ import { message as T } from "ant-design-vue";
8
+ import { Button as E, Drawer as D, Form as O, FormItem as k, Input as A, RangePicker as j, Space as M, Switch as N, Tooltip as ee } from "ant-design-vue/es";
9
+ //#region src/views/tenant/enum.ts
10
+ var P = /* @__PURE__ */ function(e) {
11
+ return e.ADD = "新增", e.EDIT = "修改", e.REMOVE = "删除", e;
12
+ }({}), F = { class: "pt-10px" }, I = { class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]" }, L = {
13
+ key: 1,
14
+ class: "inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]"
15
+ }, R = /* @__PURE__ */ h({
16
+ name: "TenantEdit",
17
+ __name: "TenantEdit",
18
+ emits: ["submit"],
19
+ setup(e, { expose: h, emit: R }) {
20
+ let z = R, B = {
21
+ name: [{
22
+ required: !0,
23
+ message: "请输入名称",
24
+ trigger: "blur"
25
+ }, {
26
+ min: 2,
27
+ max: 32,
28
+ message: "租户名称长度不能少于2位,不能超过32位",
29
+ trigger: "change"
30
+ }],
31
+ tenantCode: [{
32
+ required: !0,
33
+ message: "请输入编码",
34
+ trigger: "blur"
35
+ }, {
36
+ min: 2,
37
+ max: 64,
38
+ message: "租户编码长度不能少于2位,不能超过64位",
39
+ trigger: "change"
40
+ }],
41
+ pubUserAdmin: [{
42
+ required: !0,
43
+ message: "请输入租户管理员",
44
+ trigger: "blur"
45
+ }, {
46
+ min: 2,
47
+ max: 32,
48
+ message: "租户管理员长度不能少于2位,不能超过32位",
49
+ trigger: "change"
50
+ }],
51
+ resourceIds: [{
52
+ type: "array",
53
+ required: !0,
54
+ message: "请选择所属资源",
55
+ trigger: "change"
56
+ }]
57
+ }, V = y({
58
+ title: "",
59
+ record: {},
60
+ initData: { enable: !0 }
61
+ }), [H, U] = n(!1), W = b(), G = b({ enable: !0 });
62
+ async function K(e, n) {
63
+ if (V.title = e, G.value = t(V.initData), e === P.EDIT) {
64
+ let e = await a({ id: n.id });
65
+ if (e.success) {
66
+ let { tenantStartTime: t, tenantEndTime: n, ...r } = e?.data ?? {};
67
+ G.value = {
68
+ ...r,
69
+ tenantTime: [t, n]
70
+ };
71
+ }
72
+ }
73
+ U(!0);
74
+ }
75
+ let [q, J] = n(!1);
76
+ function Y() {
77
+ let e = V.title === P.EDIT ? r : i;
78
+ W.value?.validate().then(() => {
79
+ let { tenantTime: t, resourceIds: n = [], ...r } = G.value, i = {
80
+ ...r,
81
+ tenantStartTime: t?.[0],
82
+ tenantEndTime: t?.[1],
83
+ pubTenantResourcelist: n.map((e) => ({ resourceId: e }))
84
+ };
85
+ J(!0), e(i).then((e) => {
86
+ e.success && (T.success(`${V.title}成功!`), U(!1), z("submit"));
87
+ }).finally(() => J(!1));
88
+ });
89
+ }
90
+ let X = b(), Z = b([]), Q = l(() => G.value.resourceIds?.map((e) => ({ name: $(Z.value).find((t) => t.id === e)?.name ?? "" })) ?? []);
91
+ function te() {
92
+ let e = G.value.resourceIds ?? [], t = Z.value, n = $(t).reduce((e, t) => (e[t.id] = t.name, e), {});
93
+ X.value.open(e, t, n);
94
+ }
95
+ function ne(e = []) {
96
+ G.value.resourceIds = e.map((e) => e.id);
97
+ }
98
+ function re() {
99
+ o().then((e) => {
100
+ e.success && (Z.value = e.data ?? []);
101
+ });
102
+ }
103
+ function $(e) {
104
+ let n = t(e);
105
+ for (let e = 0; e < n.length; e++) n[e].children && (n.splice(e + 1, 0, ...n[e].children), n[e].children = void 0);
106
+ return n;
107
+ }
108
+ return _(() => {
109
+ re();
110
+ }), h({ open: K }), (e, t) => {
111
+ let n = A, r = k, i = j, a = N, o = E, l = s, h = ee, _ = O, y = M, b = D;
112
+ return v(), u(b, {
113
+ open: C(H),
114
+ "onUpdate:open": t[9] ||= (e) => g(H) ? H.value = e : null,
115
+ title: `${C(V).title}租户`,
116
+ placement: "right",
117
+ width: 600,
118
+ "destroy-on-close": "",
119
+ "footer-style": { textAlign: "right" }
120
+ }, {
121
+ footer: w(() => [m(y, null, {
122
+ default: w(() => [m(o, { onClick: t[7] ||= (e) => C(U)(!1) }, {
123
+ default: w(() => [...t[11] ||= [p(" 取消 ", -1)]]),
124
+ _: 1
125
+ }), m(o, {
126
+ type: "primary",
127
+ loading: C(q),
128
+ onClick: t[8] ||= (e) => Y()
129
+ }, {
130
+ default: w(() => [...t[12] ||= [p(" 提交 ", -1)]]),
131
+ _: 1
132
+ }, 8, ["loading"])]),
133
+ _: 1
134
+ })]),
135
+ default: w(() => [m(_, {
136
+ ref_key: "formRef",
137
+ ref: W,
138
+ model: C(G),
139
+ rules: B,
140
+ "label-col": { span: 6 }
141
+ }, {
142
+ default: w(() => [
143
+ m(r, {
144
+ label: "租户名称",
145
+ name: "name"
146
+ }, {
147
+ default: w(() => [m(n, {
148
+ value: C(G).name,
149
+ "onUpdate:value": t[0] ||= (e) => C(G).name = e,
150
+ maxlength: 32,
151
+ placeholder: "请输入租户名称"
152
+ }, null, 8, ["value"])]),
153
+ _: 1
154
+ }),
155
+ m(r, {
156
+ label: "租户编码",
157
+ name: "tenantCode"
158
+ }, {
159
+ default: w(() => [m(n, {
160
+ value: C(G).tenantCode,
161
+ "onUpdate:value": t[1] ||= (e) => C(G).tenantCode = e,
162
+ disabled: C(V).title === C(P).EDIT,
163
+ maxlength: 64,
164
+ placeholder: "请输入租户编码"
165
+ }, null, 8, ["value", "disabled"])]),
166
+ _: 1
167
+ }),
168
+ m(r, {
169
+ label: "开始至到期时间",
170
+ name: "tenantTime"
171
+ }, {
172
+ default: w(() => [m(i, {
173
+ value: C(G).tenantTime,
174
+ "onUpdate:value": t[2] ||= (e) => C(G).tenantTime = e,
175
+ format: "YYYY-MM-DD",
176
+ "value-format": "YYYY-MM-DD"
177
+ }, null, 8, ["value"])]),
178
+ _: 1
179
+ }),
180
+ m(r, {
181
+ label: "二级域名",
182
+ name: "subDomain"
183
+ }, {
184
+ default: w(() => [m(n, {
185
+ value: C(G).subDomain,
186
+ "onUpdate:value": t[3] ||= (e) => C(G).subDomain = e,
187
+ maxlength: 64,
188
+ placeholder: "请输入二级域名"
189
+ }, null, 8, ["value"])]),
190
+ _: 1
191
+ }),
192
+ m(r, {
193
+ label: "租户管理员",
194
+ name: "pubUserAdmin"
195
+ }, {
196
+ default: w(() => [m(n, {
197
+ value: C(G).pubUserAdmin,
198
+ "onUpdate:value": t[4] ||= (e) => C(G).pubUserAdmin = e,
199
+ disabled: C(V).title === C(P).EDIT,
200
+ maxlength: 32,
201
+ placeholder: "请输入租户管理员"
202
+ }, null, 8, ["value", "disabled"])]),
203
+ _: 1
204
+ }),
205
+ m(r, { label: "是否启用" }, {
206
+ default: w(() => [m(a, {
207
+ checked: C(G).enable,
208
+ "onUpdate:checked": t[5] ||= (e) => C(G).enable = e
209
+ }, null, 8, ["checked"])]),
210
+ _: 1
211
+ }),
212
+ m(r, {
213
+ label: "所属资源",
214
+ name: "resourceIds"
215
+ }, {
216
+ default: w(() => [
217
+ m(o, {
218
+ type: "primary",
219
+ onClick: t[6] ||= (e) => te()
220
+ }, {
221
+ default: w(() => [...t[10] ||= [p(" 选择资源 ", -1)]]),
222
+ _: 1
223
+ }),
224
+ p(" (已选" + S(C(G).resourceIds?.length ?? 0) + "条数据) ", 1),
225
+ m(l, {
226
+ ref_key: "resourceRef",
227
+ ref: X,
228
+ onSelect: ne
229
+ }, null, 512),
230
+ f("div", F, [(v(!0), d(c, null, x(C(Q), (e) => (v(), d(c, { key: e }, [e.name?.length > 20 ? (v(), u(h, {
231
+ key: 0,
232
+ title: e.name
233
+ }, {
234
+ default: w(() => [f("span", I, S(`${e.name?.slice(0, 20)}...`), 1)]),
235
+ _: 2
236
+ }, 1032, ["title"])) : (v(), d("span", L, S(e.name), 1))], 64))), 128))])
237
+ ]),
238
+ _: 1
239
+ })
240
+ ]),
241
+ _: 1
242
+ }, 8, ["model"])]),
243
+ _: 1
244
+ }, 8, ["open", "title"]);
245
+ };
246
+ }
247
+ }), z = /* @__PURE__ */ e({ default: () => B }), B = R;
248
+ //#endregion
249
+ export { z as n, P as r, B as t };