@pubinfo/module-rbac 2.0.12 → 2.0.14

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 (97) hide show
  1. package/dist/{DynamicRoutesForm-DzOGoyf3.js → DynamicRoutesForm-BU4EAISs.js} +1 -1
  2. package/dist/{DynamicRoutesForm.vue_vue_type_script_setup_true_lang-lpCaLpPL.js → DynamicRoutesForm.vue_vue_type_script_setup_true_lang-bEqJ03T_.js} +6 -6
  3. package/dist/{IconSelect-CkqLR5Dg.js → IconSelect-DtNpk3Rj.js} +1 -1
  4. package/dist/IconSelect.css +1 -1
  5. package/dist/IconSelect.vue_vue_type_script_setup_true_lang-D450SiKg.js +757 -0
  6. package/dist/{ImportExport-BD8o7IvB.js → ImportExport-DAe_Sl13.js} +1 -1
  7. package/dist/{ImportExport.vue_vue_type_script_setup_true_lang-BzdP0ADd.js → ImportExport.vue_vue_type_script_setup_true_lang-CV0DrMvw.js} +1 -1
  8. package/dist/LayoutForm-C-vNwp3q.js +173 -0
  9. package/dist/LayoutForm.css +1 -0
  10. package/dist/{MetaForm-DtlyvzoM.js → MetaForm-13JASu7v.js} +142 -105
  11. package/dist/MetaForm.css +1 -1
  12. package/dist/{ResourceEdit-WpEdbzaw.js → ResourceEdit-D2YFu-Gk.js} +1 -1
  13. package/dist/ResourceEdit.vue_vue_type_script_setup_true_lang-Cb0mKIlJ.js +429 -0
  14. package/dist/{ResourceRelation-DGiGYy6V.js → ResourceRelation-CeM9Eq39.js} +10 -11
  15. package/dist/{ResourceRelation-26FnHEfU.js → ResourceRelation-qhIdXLAy.js} +12 -13
  16. package/dist/{TenantEdit-B24X5nND.js → TenantEdit-C61O1pSu.js} +1 -1
  17. package/dist/{TenantEdit.vue_vue_type_script_setup_true_lang-Bu5HcJJv.js → TenantEdit.vue_vue_type_script_setup_true_lang-BwsA9hth.js} +39 -40
  18. package/dist/{UserAuthorization-Co6JV0py.js → UserAuthorization-rqttVub5.js} +9 -10
  19. package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +1 -1
  20. package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +1 -1
  21. package/dist/components/ResourceIcones/BoxColorPicker.vue.d.ts +3 -0
  22. package/dist/components/ResourceIcones/Select.vue.d.ts +3 -0
  23. package/dist/{createAndEditDataPermission-BhOLGGna.js → createAndEditDataPermission-DPeFulie.js} +1 -1
  24. package/dist/{createAndEditDataPermission.vue_vue_type_script_setup_true_lang-D5wInKwO.js → createAndEditDataPermission.vue_vue_type_script_setup_true_lang-DlUIYtif.js} +98 -101
  25. package/dist/{drawerRole-DHLv47_z.js → drawerRole-CXGVqxPX.js} +1 -1
  26. package/dist/{drawerRole-DUWRM43j.js → drawerRole-CfJjf3v_.js} +1 -1
  27. package/dist/{drawerRole.vue_vue_type_script_setup_true_lang-BET5ukoo.js → drawerRole.vue_vue_type_script_setup_true_lang-B-VZS3gq.js} +42 -43
  28. package/dist/{drawerRole.vue_vue_type_script_setup_true_lang-BK3zjhop.js → drawerRole.vue_vue_type_script_setup_true_lang-B1eT0e_Q.js} +1 -1
  29. package/dist/{enum-CjyX3J0o.js → enum-D5iPiZiT.js} +0 -1
  30. package/dist/{index-Csfu3kAr.js → index-B5aP0re3.js} +6 -7
  31. package/dist/{index-DwpOyfRe.js → index-BEB4liGe.js} +8 -9
  32. package/dist/{index-DfuGXjYh.js → index-BNwGLzXe.js} +21 -22
  33. package/dist/{index-DdoOaWs-.js → index-BPkJOFXE.js} +3 -3
  34. package/dist/{index-ioZh8Qom.js → index-BXvJhqJD.js} +6 -7
  35. package/dist/{index-BFx8F5lO.js → index-C2G4xRrJ.js} +8 -9
  36. package/dist/{index-x9Iim2eD.js → index-C5WD-YUu.js} +7 -8
  37. package/dist/{index-rNYtJ7Om.js → index-CbVJdR5M.js} +6 -7
  38. package/dist/{index-DECno0gv.js → index-ChWnVs6j.js} +2 -2
  39. package/dist/{index-C9hHp4Iw.js → index-CoZM8pyH.js} +1 -1
  40. package/dist/{index-B2tTTlBE.js → index-Copy5kiW.js} +276 -273
  41. package/dist/index-D3Xw_aOi.js +144 -0
  42. package/dist/{index-CCw3ZJgQ.js → index-DHVEXch0.js} +8 -9
  43. package/dist/{index-COWUocfL.js → index-Dl0hWfIE.js} +7 -8
  44. package/dist/{index-BIpmC999.js → index-En8oOf9e.js} +8 -9
  45. package/dist/{index-ZQuRR9fG.js → index-VZuizuKs.js} +1 -1
  46. package/dist/{index-BwWrE3dY.js → index-XhYtVVT9.js} +6 -7
  47. package/dist/{index-BUmMaC21.js → index-nAPHtTM7.js} +5 -6
  48. package/dist/{index-y9CQTo95.js → index-qn7U9T51.js} +9 -10
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.js +2578 -2303
  51. package/dist/index10.css +1 -1
  52. package/dist/index11.css +1 -1
  53. package/dist/index12.css +1 -1
  54. package/dist/index13.css +1 -1
  55. package/dist/index14.css +1 -1
  56. package/dist/index15.css +1 -1
  57. package/dist/index16.css +1 -1
  58. package/dist/index17.css +1 -1
  59. package/dist/index4.css +1 -1
  60. package/dist/index5.css +1 -1
  61. package/dist/index6.css +1 -1
  62. package/dist/index7.css +1 -1
  63. package/dist/index8.css +1 -1
  64. package/dist/index9.css +1 -1
  65. package/dist/{loginHistoryDetail-B6eI-TmJ.js → loginHistoryDetail-BZVwG8m2.js} +1 -1
  66. package/dist/{login_history-B4Q1NCJn.js → login_history-CMZGS2PN.js} +5 -6
  67. package/dist/{operateHistoryDetail-CLZ9lyua.js → operateHistoryDetail-Badx3zl-.js} +1 -1
  68. package/dist/{operate_history-KASZ7_JO.js → operate_history-B42WNY1u.js} +5 -6
  69. package/dist/{setItem-BwMHXOUm.js → setItem-Blb3dox4.js} +1 -1
  70. package/dist/{useAppAndResource-38HCqYKa.js → useAppAndResource-DDywX2iz.js} +11 -12
  71. package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +3 -3
  72. package/dist/views/data-permission/index.vue.d.ts +3 -3
  73. package/dist/views/resource/components/LayoutForm.vue.d.ts +10 -0
  74. package/dist/views/resource/hooks/useLayoutForm.d.ts +12 -0
  75. package/dist/views/resource/model.d.ts +13 -0
  76. package/package.json +7 -7
  77. package/src/components/ResourceIcones/BoxColorPicker.vue +64 -8
  78. package/src/components/ResourceIcones/Select.vue +13 -5
  79. package/src/index.ts +1 -0
  80. package/src/views/organization/index.vue +17 -10
  81. package/src/views/resource/components/DynamicRoutesForm.vue +1 -1
  82. package/src/views/resource/components/IconSelect.vue +7 -3
  83. package/src/views/resource/components/LayoutForm.vue +92 -0
  84. package/src/views/resource/components/MetaForm.vue +11 -0
  85. package/src/views/resource/components/ResourceEdit.vue +26 -8
  86. package/src/views/resource/enum.ts +0 -1
  87. package/src/views/resource/hooks/useLayoutForm.ts +57 -0
  88. package/src/views/resource/hooks/useMetaForm.ts +4 -0
  89. package/src/views/resource/index.vue +0 -3
  90. package/src/views/resource/model.ts +23 -1
  91. package/dist/IconSelect.vue_vue_type_script_setup_true_lang-BoGxAoNd.js +0 -703
  92. package/dist/ResourceEdit.vue_vue_type_script_setup_true_lang-id6jZAko.js +0 -392
  93. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  94. package/dist/enum-CTUzwCYG.js +0 -4
  95. package/dist/index-53oBz1jp.js +0 -299
  96. package/dist/index-DVt5k9xh.js +0 -145
  97. package/dist/index18.css +0 -1
@@ -1,703 +0,0 @@
1
- import { Input as se, InputNumber as ye, Tooltip as ke, FormItemRest as _e, Modal as he, Pagination as Ce, Empty as we, RadioGroup as Ie, RadioButton as ze, Button as Re, FormItem as Pe } from "ant-design-vue/es";
2
- import { defineComponent as le, ref as y, watch as P, createElementBlock as w, openBlock as m, createElementVNode as l, createVNode as r, withCtx as v, normalizeStyle as ee, normalizeClass as D, useModel as M, computed as I, Fragment as Y, renderSlot as $e, unref as a, createCommentVNode as L, renderList as ae, toDisplayString as K, createBlock as V, createTextVNode as X, reactive as je } from "vue";
3
- import { getAllIconModules as Ee, PubinfoIcon as _, RESOURCE_TYPE as N } from "pubinfo";
4
- import * as Me from "@ant-design/icons-vue";
5
- import { Empty as Oe } from "ant-design-vue";
6
- import { _ as Ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- import "./enum-CjyX3J0o.js";
8
- import './IconSelect.css';const Te = { class: "flex flex-col gap-3 w-full select-none" }, Ue = { class: "flex items-center gap-3" }, Ne = { class: "relative inline-flex items-center" }, Ve = ["disabled"], Be = ["value", "disabled"], Fe = { class: "flex items-center gap-3" }, Se = { class: "relative inline-flex items-center" }, De = ["disabled"], Le = ["value", "disabled"], qe = { class: "flex items-center gap-3" }, We = { class: "flex items-center gap-3" }, Ge = /* @__PURE__ */ le({
9
- name: "ResourceIconesBoxColorPicker",
10
- __name: "BoxColorPicker",
11
- props: {
12
- angle: {},
13
- background: {},
14
- radius: {},
15
- disabled: { type: Boolean }
16
- },
17
- emits: ["update:angle", "update:background", "update:radius"],
18
- setup(z, { emit: p }) {
19
- const f = z, k = p;
20
- function d(t) {
21
- if (typeof t == "number" && Number.isFinite(t))
22
- return (t % 360 + 360) % 360;
23
- if (typeof t == "string") {
24
- const n = Number.parseFloat(t);
25
- if (Number.isFinite(n))
26
- return (n % 360 + 360) % 360;
27
- }
28
- return 65;
29
- }
30
- function $(t) {
31
- return t ? typeof t == "string" ? { from: t, to: t } : { from: t.from, to: t.to } : { from: "#65E54A", to: "#35C724" };
32
- }
33
- function j(t) {
34
- if (typeof t == "number" && Number.isFinite(t))
35
- return Math.max(0, t);
36
- if (typeof t == "string") {
37
- const n = Number.parseFloat(t);
38
- if (Number.isFinite(n))
39
- return Math.max(0, n);
40
- }
41
- return 6;
42
- }
43
- const b = $(f.background), u = y(b.from), s = y(b.to), g = y(d(f.angle)), c = y(j(f.radius)), x = y(null), B = y(null);
44
- function E() {
45
- if (f.disabled)
46
- return;
47
- const t = x.value;
48
- t && (t.style.width = "16px", t.style.height = "16px", t.click());
49
- }
50
- function q() {
51
- if (f.disabled)
52
- return;
53
- const t = B.value;
54
- t && (t.style.width = "16px", t.style.height = "16px", t.click());
55
- }
56
- return P([u, s, g, c], () => {
57
- k("update:background", { from: u.value, to: s.value }), k("update:angle", g.value), k("update:radius", c.value);
58
- }, { immediate: !0 }), P(() => f.background, (t) => {
59
- if (t == null)
60
- return;
61
- const n = $(t);
62
- u.value = n.from, s.value = n.to;
63
- }), P(() => f.angle, (t) => {
64
- t != null && (g.value = d(t));
65
- }), P(() => f.radius, (t) => {
66
- t != null && (c.value = j(t));
67
- }), (t, n) => {
68
- const W = se, F = ye;
69
- return m(), w("div", Te, [
70
- l("div", Ue, [
71
- n[6] || (n[6] = l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "起始色", -1)),
72
- r(W, {
73
- value: u.value,
74
- "onUpdate:value": n[1] || (n[1] = (h) => u.value = h),
75
- disabled: f.disabled,
76
- placeholder: "#65E54A",
77
- size: "small",
78
- class: "flex-1 min-w-0"
79
- }, {
80
- prefix: v(() => [
81
- l("div", Ne, [
82
- l("button", {
83
- type: "button",
84
- disabled: f.disabled,
85
- class: D(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", f.disabled ? "opacity-50 cursor-not-allowed" : ""]),
86
- style: ee({ background: u.value }),
87
- onClick: E
88
- }, null, 14, Ve),
89
- l("input", {
90
- ref_key: "fromColorPickerRef",
91
- ref: x,
92
- type: "color",
93
- value: u.value,
94
- disabled: f.disabled,
95
- class: "absolute left-0 top-0 opacity-0 pointer-events-none",
96
- style: { width: "16px", height: "16px" },
97
- onInput: n[0] || (n[0] = (h) => u.value = h.target.value)
98
- }, null, 40, Be)
99
- ])
100
- ]),
101
- _: 1
102
- }, 8, ["value", "disabled"])
103
- ]),
104
- l("div", Fe, [
105
- n[7] || (n[7] = l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "结束色", -1)),
106
- r(W, {
107
- value: s.value,
108
- "onUpdate:value": n[3] || (n[3] = (h) => s.value = h),
109
- disabled: f.disabled,
110
- placeholder: "#35C724",
111
- size: "small",
112
- class: "flex-1 min-w-0"
113
- }, {
114
- prefix: v(() => [
115
- l("div", Se, [
116
- l("button", {
117
- type: "button",
118
- disabled: f.disabled,
119
- class: D(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", f.disabled ? "opacity-50 cursor-not-allowed" : ""]),
120
- style: ee({ background: s.value }),
121
- onClick: q
122
- }, null, 14, De),
123
- l("input", {
124
- ref_key: "toColorPickerRef",
125
- ref: B,
126
- type: "color",
127
- value: s.value,
128
- disabled: f.disabled,
129
- class: "absolute left-0 top-0 opacity-0 pointer-events-none",
130
- style: { width: "16px", height: "16px" },
131
- onInput: n[2] || (n[2] = (h) => s.value = h.target.value)
132
- }, null, 40, Le)
133
- ])
134
- ]),
135
- _: 1
136
- }, 8, ["value", "disabled"])
137
- ]),
138
- l("div", qe, [
139
- n[8] || (n[8] = l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "角度", -1)),
140
- r(F, {
141
- value: g.value,
142
- "onUpdate:value": n[4] || (n[4] = (h) => g.value = h),
143
- disabled: f.disabled,
144
- min: 0,
145
- max: 360,
146
- step: 1,
147
- size: "small",
148
- class: "w-28"
149
- }, null, 8, ["value", "disabled"]),
150
- n[9] || (n[9] = l("span", { class: "text-12px opacity-70" }, "deg", -1))
151
- ]),
152
- l("div", We, [
153
- n[10] || (n[10] = l("label", { class: "text-12px opacity-70 w-14 shrink-0" }, "圆角", -1)),
154
- r(F, {
155
- value: c.value,
156
- "onUpdate:value": n[5] || (n[5] = (h) => c.value = h),
157
- disabled: f.disabled,
158
- min: 0,
159
- max: 48,
160
- step: 1,
161
- size: "small",
162
- class: "w-28"
163
- }, null, 8, ["value", "disabled"]),
164
- n[11] || (n[11] = l("span", { class: "text-12px opacity-70" }, "px", -1))
165
- ])
166
- ]);
167
- };
168
- }
169
- }), Ye = { class: "flex gap-4 min-h-[600px]" }, Ke = { class: "w-58 flex flex-col border-r border-[#e5e7eb] dark:border-[#30363d] pr-3" }, Xe = { class: "mb-3" }, He = { class: "flex-1 overflow-auto space-y-1 pr-1" }, Je = ["onClick"], Qe = { class: "truncate max-w-[120px]" }, Ze = { class: "ml-2 inline-block min-w-6 text-center text-11px rounded bg-[#eef1f5] dark:bg-[#2d3339] px-1 text-[#5d6671] dark:text-[#9aa3ad]" }, el = { class: "flex-1 flex flex-col min-w-0" }, ll = { class: "grid grid-cols-6 gap-3 auto-rows-[96px] overflow-auto flex-1 p-1" }, ol = { class: "text-12px leading-tight space-y-1" }, tl = { class: "font-medium" }, nl = {
170
- key: 0,
171
- class: "opacity-70"
172
- }, al = ["onClick"], sl = { class: "mt-4 flex justify-center select-none" }, rl = {
173
- key: 1,
174
- class: "flex-1 flex items-center justify-center"
175
- }, ul = {
176
- key: 0,
177
- class: "relative w-60 flex flex-col border-l border-[#e5e7eb] dark:border-[#30363d] pl-4 min-h-0"
178
- }, il = { class: "flex flex-col flex-1 w-full rounded-md border border-dashed border-[#d0d7de] dark:border-[#30363d] text-12px text-[#6b7280] dark:text-[#94a3b8] p-3 overflow-hidden" }, dl = { class: "shrink-0 flex justify-center items-center pb-4 border-b border-b-dashed border-b-[#d0d7de] dark:border-b-[#30363d]" }, cl = { class: "w-8 h-8 flex justify-center items-center" }, fl = { class: "w-8 h-8 flex justify-center items-center" }, pl = { class: "w-8 h-8 flex justify-center items-center" }, vl = { class: "flex-1 w-full mt-3 px-2 overflow-auto space-y-3" }, ml = { class: "flex flex-col justify-start w-full opacity-100" }, bl = { class: "flex items-center gap-3 mb-0! w-full flex-col" }, xl = { class: "flex" }, gl = { class: "text-12px opacity-70 w-14 shrink-0 flex items-center" }, yl = { class: "flex flex-col" }, kl = { class: "relative inline-flex items-center" }, _l = ["disabled"], hl = ["value", "disabled"], Cl = { class: "w-full mt-auto flex aspect-square" }, wl = { class: "flex-1 w-full h-full py-4 rounded-md border-t border-t-dashed border-t-[#d0d7de] dark:border-t-[#30363d] flex flex-col items-center gap-2" }, Il = {
179
- key: 0,
180
- class: "w-full h-full flex items-center justify-center"
181
- }, zl = { class: "mt-4 flex justify-end gap-2" }, H = 30, Z = 24, Rl = 4, Pl = /* @__PURE__ */ le({
182
- name: "ResourceIconesSelect",
183
- __name: "Select",
184
- props: {
185
- modelValue: {},
186
- modelModifiers: {},
187
- boxType: { default: "null" },
188
- boxTypeModifiers: {},
189
- angle: { default: 65 },
190
- angleModifiers: {},
191
- background: { default: { from: "#65E54A", to: "#35C724" } },
192
- backgroundModifiers: {},
193
- radius: { default: 6 },
194
- radiusModifiers: {},
195
- iconColor: { default: "" },
196
- iconColorModifiers: {}
197
- },
198
- emits: ["update:modelValue", "update:boxType", "update:angle", "update:background", "update:radius", "update:iconColor"],
199
- setup(z) {
200
- const p = M(z, "modelValue"), f = M(z, "boxType"), k = M(z, "angle"), d = M(z, "background"), $ = M(z, "radius"), j = M(z, "iconColor"), b = y(p.value), u = y(f.value || "null"), s = y(k.value ?? 65), g = y(d.value ?? { from: "#65E54A", to: "#35C724" }), c = y($.value ?? 6), x = y(j.value ?? ""), B = y(null), E = y(!1);
201
- function q() {
202
- b.value = p.value, u.value = f.value || "null", s.value = k.value ?? 65;
203
- const e = d.value;
204
- g.value = typeof e == "string" ? e : e ? { ...e } : { from: "#65E54A", to: "#35C724" }, c.value = $.value ?? 6, x.value = j.value ?? "", E.value = !0;
205
- }
206
- function t() {
207
- E.value = !1;
208
- }
209
- function n() {
210
- p.value = b.value, f.value = u.value, k.value = s.value;
211
- const e = g.value;
212
- d.value = typeof e == "string" ? e : e && { ...e }, $.value = c.value, j.value = x.value, E.value = !1;
213
- }
214
- function W(e) {
215
- return (e.split(/[\\/]/).pop() || e).replace(/\.(svg|png|jpe?g)$/i, "");
216
- }
217
- const F = I(() => {
218
- const e = /* @__PURE__ */ new Map(), o = Ee();
219
- for (const [R, C] of o.entries()) {
220
- const J = Object.keys(C).map(W).sort();
221
- e.set(R, J);
222
- }
223
- return e;
224
- }), h = I(
225
- () => Object.keys(Me).filter((e) => /(?:Outlined|Filled|TwoTone)$/.test(e)).map((e) => `antd:${e}`).sort()
226
- ), re = I(() => {
227
- const e = Array.from(F.value.keys()), o = e.includes("local"), R = e.filter((C) => C !== "local").sort();
228
- return [
229
- { label: "全部", value: "all" },
230
- ...o ? [{ label: "本地", value: "local" }] : [],
231
- ...R.map((C) => ({ label: C, value: C })),
232
- { label: "Ant Design", value: "antd" }
233
- ];
234
- }), O = y("all"), G = y(""), A = I(() => {
235
- const e = [];
236
- for (const [o, R] of F.value.entries())
237
- R.forEach((C) => {
238
- o === "local" ? e.push({ name: C, module: o }) : e.push({ name: `${o}-[${C}]`, module: o });
239
- });
240
- return h.value.forEach((o) => e.push({ name: o, module: "antd" })), e;
241
- }), oe = I(() => O.value === "all" ? A.value : O.value === "antd" ? A.value.filter((e) => e.module === "antd") : A.value.filter((e) => e.module === O.value)), S = I(() => {
242
- const e = G.value.trim().toLowerCase();
243
- return e ? oe.value.filter((o) => o.name.toLowerCase().includes(e)) : oe.value;
244
- });
245
- function ue(e) {
246
- return e === "all" ? A.value.length : e === "antd" ? A.value.filter((o) => o.module === "antd").length : A.value.filter((o) => o.module === e).length;
247
- }
248
- const T = y(1), te = I(() => Math.max(1, Math.ceil(S.value.length / H))), ie = I(() => {
249
- const e = (T.value - 1) * H;
250
- return S.value.slice(e, e + H);
251
- });
252
- P([G, O], () => {
253
- T.value = 1;
254
- }), P(S, () => {
255
- T.value > te.value && (T.value = te.value);
256
- });
257
- function de(e) {
258
- T.value = e;
259
- }
260
- function ce(e) {
261
- b.value = e.name;
262
- }
263
- const fe = Oe.PRESENTED_IMAGE_SIMPLE;
264
- function pe() {
265
- if (!(b.value || "").startsWith("antd:"))
266
- return;
267
- const e = B.value;
268
- e && (e.style.width = "16px", e.style.height = "16px", e.click());
269
- }
270
- const U = I(() => (b.value || "").startsWith("antd:"));
271
- return P(u, (e, o) => {
272
- o === "null" && e !== "null" && !x.value && (x.value = "#ffffff");
273
- }), (e, o) => {
274
- const R = ke, C = se, J = Ce, ve = we, Q = ze, me = Ie, ne = Re, be = he, xe = _e;
275
- return m(), w(Y, null, [
276
- $e(e.$slots, "default", { open: q }, () => [
277
- r(C, {
278
- value: p.value,
279
- readonly: "",
280
- onClick: q
281
- }, {
282
- addonAfter: v(() => [
283
- r(R, null, {
284
- title: v(() => [
285
- r(a(_), {
286
- name: p.value || "",
287
- size: "40px",
288
- class: "cursor-default"
289
- }, null, 8, ["name"])
290
- ]),
291
- default: v(() => [
292
- r(a(_), {
293
- name: p.value || "",
294
- size: "20px",
295
- class: "cursor-default"
296
- }, null, 8, ["name"])
297
- ]),
298
- _: 1
299
- })
300
- ]),
301
- _: 1
302
- }, 8, ["value"])
303
- ], !0),
304
- r(xe, null, {
305
- default: v(() => [
306
- r(be, {
307
- open: E.value,
308
- "onUpdate:open": o[7] || (o[7] = (i) => E.value = i),
309
- title: "选择图标",
310
- width: "1200px",
311
- footer: null,
312
- "destroy-on-close": "",
313
- onCancel: t
314
- }, {
315
- default: v(() => [
316
- l("div", Ye, [
317
- l("div", Ke, [
318
- l("div", Xe, [
319
- r(C, {
320
- value: G.value,
321
- "onUpdate:value": o[0] || (o[0] = (i) => G.value = i),
322
- "allow-clear": "",
323
- bordered: !0,
324
- placeholder: "搜索图标",
325
- class: "h-9 text-13px"
326
- }, {
327
- prefix: v(() => [
328
- r(a(_), {
329
- name: "i-carbon-search",
330
- size: "16",
331
- class: "text-[#7a869a]"
332
- })
333
- ]),
334
- _: 1
335
- }, 8, ["value"])
336
- ]),
337
- l("div", He, [
338
- (m(!0), w(Y, null, ae(re.value, (i) => (m(), w("div", {
339
- key: i.value,
340
- class: D(["flex items-center justify-between px-3 py-2 rounded-md cursor-pointer text-13px border border-transparent hover:bg-[#f3f6fa] dark:hover:bg-[#262c33] transition", O.value === i.value ? "bg-[#eef5ff] dark:bg-[#1e2a33] border-[#1677ff] text-[#1677ff] font-medium" : "text-[#4b5563]"]),
341
- onClick: (ge) => O.value = i.value
342
- }, [
343
- l("span", Qe, K(i.label), 1),
344
- l("span", Ze, K(ue(i.value)), 1)
345
- ], 10, Je))), 128))
346
- ])
347
- ]),
348
- l("div", el, [
349
- S.value.length ? (m(), w(Y, { key: 0 }, [
350
- l("div", ll, [
351
- (m(!0), w(Y, null, ae(ie.value, (i) => (m(), V(R, {
352
- key: `${i.module || ""}:${i.name}`,
353
- "mouse-enter-delay": 0.35
354
- }, {
355
- title: v(() => [
356
- l("div", ol, [
357
- l("div", tl, K(i.name), 1),
358
- i.module ? (m(), w("div", nl, " 模块: " + K(i.module), 1)) : L("", !0)
359
- ])
360
- ]),
361
- default: v(() => [
362
- l("div", {
363
- class: D(["group relative flex flex-col items-center justify-center cursor-pointer rounded-md border", b.value === i.name ? "border-solid border-[#1677ff]" : "border-dashed border-[#e5e7eb] dark:border-[#30363d]"]),
364
- onClick: (ge) => ce(i)
365
- }, [
366
- r(a(_), {
367
- name: i.name,
368
- size: "30px"
369
- }, null, 8, ["name"])
370
- ], 10, al)
371
- ]),
372
- _: 2
373
- }, 1024))), 128))
374
- ]),
375
- l("div", sl, [
376
- r(J, {
377
- current: T.value,
378
- "page-size": H,
379
- total: S.value.length,
380
- "show-size-changer": !1,
381
- "show-quick-jumper": "",
382
- onChange: de
383
- }, null, 8, ["current", "total"])
384
- ])
385
- ], 64)) : (m(), w("div", rl, [
386
- r(ve, {
387
- image: a(fe),
388
- description: "没有匹配的图标"
389
- }, null, 8, ["image"])
390
- ]))
391
- ]),
392
- b.value ? (m(), w("div", ul, [
393
- l("div", il, [
394
- l("div", dl, [
395
- r(me, {
396
- value: u.value,
397
- "onUpdate:value": o[1] || (o[1] = (i) => u.value = i),
398
- class: "flex justify-center items-center"
399
- }, {
400
- default: v(() => [
401
- r(Q, { value: "null" }, {
402
- default: v(() => [
403
- l("div", cl, [
404
- r(a(_), {
405
- name: b.value,
406
- size: Z - Rl * 2
407
- }, null, 8, ["name", "size"])
408
- ])
409
- ]),
410
- _: 1
411
- }),
412
- r(Q, { value: "square" }, {
413
- default: v(() => [
414
- l("div", fl, [
415
- r(a(_), {
416
- name: b.value,
417
- box: "square",
418
- size: Z,
419
- radius: "6px",
420
- color: "#ffffff"
421
- }, null, 8, ["name"])
422
- ])
423
- ]),
424
- _: 1
425
- }),
426
- r(Q, { value: "prism" }, {
427
- default: v(() => [
428
- l("div", pl, [
429
- r(a(_), {
430
- name: b.value,
431
- box: "prism",
432
- size: Z,
433
- color: "#ffffff",
434
- radius: "2px"
435
- }, null, 8, ["name"])
436
- ])
437
- ]),
438
- _: 1
439
- })
440
- ]),
441
- _: 1
442
- }, 8, ["value"])
443
- ]),
444
- l("div", vl, [
445
- l("div", ml, [
446
- o[8] || (o[8] = l("div", { class: "text-12px mb-2 opacity-70" }, " 背景设置 ", -1)),
447
- r(Ge, {
448
- angle: s.value,
449
- "onUpdate:angle": o[2] || (o[2] = (i) => s.value = i),
450
- background: g.value,
451
- "onUpdate:background": o[3] || (o[3] = (i) => g.value = i),
452
- radius: c.value,
453
- "onUpdate:radius": o[4] || (o[4] = (i) => c.value = i),
454
- disabled: u.value === "null"
455
- }, null, 8, ["angle", "background", "radius", "disabled"])
456
- ]),
457
- l("div", bl, [
458
- l("div", xl, [
459
- l("label", gl, [
460
- o[10] || (o[10] = X(" 图标色 ")),
461
- r(R, null, {
462
- title: v(() => o[9] || (o[9] = [
463
- X(" 仅 Ant Design 图标有效 ")
464
- ])),
465
- default: v(() => [
466
- r(a(_), {
467
- name: "i-carbon-information",
468
- size: "12px",
469
- class: "ml-1 cursor-help"
470
- })
471
- ]),
472
- _: 1
473
- })
474
- ]),
475
- l("div", yl, [
476
- r(C, {
477
- value: x.value,
478
- "onUpdate:value": o[6] || (o[6] = (i) => x.value = i),
479
- "allow-clear": "",
480
- placeholder: u.value === "null" ? "默认" : "#ffffff",
481
- size: "small",
482
- class: "flex-1 min-w-0",
483
- disabled: !U.value
484
- }, {
485
- prefix: v(() => [
486
- l("div", kl, [
487
- l("button", {
488
- type: "button",
489
- disabled: !U.value,
490
- class: D(["w-4 h-4 rounded border border-gray-300 dark:border-gray-700", U.value ? "" : "opacity-50 cursor-not-allowed"]),
491
- style: ee({ background: x.value || "#ffffff" }),
492
- onClick: pe
493
- }, null, 14, _l),
494
- l("input", {
495
- ref_key: "iconColorPickerRef",
496
- ref: B,
497
- type: "color",
498
- value: x.value || "#ffffff",
499
- disabled: !U.value,
500
- class: "absolute left-0 top-0 opacity-0 pointer-events-none",
501
- style: { width: "16px", height: "16px" },
502
- onInput: o[5] || (o[5] = (i) => x.value = i.target.value)
503
- }, null, 40, hl)
504
- ])
505
- ]),
506
- _: 1
507
- }, 8, ["value", "placeholder", "disabled"])
508
- ])
509
- ])
510
- ]),
511
- l("div", Cl, [
512
- l("div", wl, [
513
- b.value ? (m(), w("div", Il, [
514
- u.value === "null" ? (m(), V(a(_), {
515
- key: 0,
516
- name: b.value,
517
- size: 80,
518
- color: U.value && x.value ? x.value : void 0
519
- }, null, 8, ["name", "color"])) : (m(), V(a(_), {
520
- key: 1,
521
- name: b.value,
522
- box: u.value,
523
- size: 80,
524
- angle: s.value,
525
- background: g.value,
526
- radius: c.value,
527
- color: U.value ? x.value || "#ffffff" : void 0
528
- }, null, 8, ["name", "box", "angle", "background", "radius", "color"]))
529
- ])) : L("", !0)
530
- ])
531
- ])
532
- ]),
533
- l("div", zl, [
534
- r(ne, { onClick: t }, {
535
- default: v(() => o[11] || (o[11] = [
536
- X(" 取消 ")
537
- ])),
538
- _: 1,
539
- __: [11]
540
- }),
541
- r(ne, {
542
- type: "primary",
543
- onClick: n
544
- }, {
545
- default: v(() => o[12] || (o[12] = [
546
- X(" 确定 ")
547
- ])),
548
- _: 1,
549
- __: [12]
550
- })
551
- ])
552
- ])
553
- ])) : L("", !0)
554
- ])
555
- ]),
556
- _: 1
557
- }, 8, ["open"])
558
- ]),
559
- _: 1
560
- })
561
- ], 64);
562
- };
563
- }
564
- }), $l = /* @__PURE__ */ Ae(Pl, [["__scopeId", "data-v-f63b9031"]]), jl = ["onClick"], El = ["onClick"], Ml = { class: "flex flex-col items-center justify-center" }, Bl = /* @__PURE__ */ le({
565
- name: "ResourceIconSelect",
566
- __name: "IconSelect",
567
- props: {
568
- modelValue: {
569
- default: {
570
- meta: {
571
- url: "",
572
- component: ""
573
- }
574
- }
575
- },
576
- modelModifiers: {}
577
- },
578
- emits: ["update:modelValue"],
579
- setup(z) {
580
- const p = M(z, "modelValue");
581
- function f() {
582
- return {
583
- boxType: "null",
584
- angle: 65,
585
- background: { from: "#65E54A", to: "#35C724" },
586
- radius: 6,
587
- iconColor: ""
588
- };
589
- }
590
- const k = I(() => p.value.meta || (p.value.meta = {})), d = je(f());
591
- P(
592
- () => k.value.iconOptions,
593
- (u) => {
594
- u ? Object.assign(d, f(), u) : Object.assign(d, f());
595
- },
596
- { immediate: !0 }
597
- ), P(
598
- d,
599
- (u) => {
600
- if (!p.value.icon) {
601
- k.value.iconOptions && Reflect.deleteProperty(k.value, "iconOptions");
602
- return;
603
- }
604
- const s = k.value.iconOptions;
605
- let g = !1;
606
- if (!s)
607
- g = !0;
608
- else {
609
- const c = /* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(u)]);
610
- for (const x of c)
611
- if (s[x] !== u[x]) {
612
- g = !0;
613
- break;
614
- }
615
- }
616
- g && (k.value.iconOptions = { ...u });
617
- },
618
- { deep: !0 }
619
- );
620
- const $ = I(() => {
621
- const u = p.value.type;
622
- return {
623
- icon: [N.DYNAMIC_APP, N.MICRO_APP, N.INDEX, N.MENU, N.IFRAME, N.LINK].includes(u)
624
- };
625
- }), j = I(() => !0);
626
- function b(u) {
627
- u.stopPropagation(), p.value.icon && (p.value.icon = void 0, Reflect.deleteProperty(k.value, "iconOptions"));
628
- }
629
- return (u, s) => {
630
- const g = Pe;
631
- return a(j) && a($).icon ? (m(), V(g, {
632
- key: 0,
633
- label: "资源图标"
634
- }, {
635
- default: v(() => [
636
- r($l, {
637
- modelValue: p.value.icon,
638
- "onUpdate:modelValue": s[0] || (s[0] = (c) => p.value.icon = c),
639
- "box-type": a(d).boxType,
640
- "onUpdate:boxType": s[1] || (s[1] = (c) => a(d).boxType = c),
641
- angle: a(d).angle,
642
- "onUpdate:angle": s[2] || (s[2] = (c) => a(d).angle = c),
643
- background: a(d).background,
644
- "onUpdate:background": s[3] || (s[3] = (c) => a(d).background = c),
645
- radius: a(d).radius,
646
- "onUpdate:radius": s[4] || (s[4] = (c) => a(d).radius = c),
647
- "icon-color": a(d).iconColor,
648
- "onUpdate:iconColor": s[5] || (s[5] = (c) => a(d).iconColor = c)
649
- }, {
650
- default: v(({ open: c }) => [
651
- p.value.icon ? (m(), w("div", {
652
- key: 0,
653
- class: "size-64px flex justify-center items-center cursor-pointer rounded-md border-px border-dashed relative group border-[#d9d9d9] dark:border-[#424242] hover:border-[#5794f7] dark:hover:border-[#5187e1] p-8px",
654
- onClick: c
655
- }, [
656
- a(d).boxType && a(d).boxType !== "null" ? (m(), V(a(_), {
657
- key: 0,
658
- name: p.value.icon,
659
- box: a(d).boxType,
660
- size: "48px",
661
- radius: a(d).radius,
662
- background: a(d).background,
663
- angle: a(d).angle,
664
- color: (p.value.icon || "").startsWith("antd:") ? a(d).iconColor || "#ffffff" : void 0
665
- }, null, 8, ["name", "box", "radius", "background", "angle", "color"])) : (m(), V(a(_), {
666
- key: 1,
667
- name: p.value.icon,
668
- size: "48px",
669
- color: (p.value.icon || "").startsWith("antd:") && a(d).iconColor || void 0
670
- }, null, 8, ["name", "color"])),
671
- p.value.icon ? (m(), w("button", {
672
- key: 2,
673
- class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full cursor-pointer border-none op-65 dark:op-55 hover:op-100",
674
- type: "button",
675
- onClick: b
676
- }, [
677
- r(a(_), {
678
- name: "antd:CloseOutlined",
679
- size: "10px"
680
- })
681
- ])) : L("", !0)
682
- ], 8, jl)) : (m(), w("div", {
683
- key: 1,
684
- class: "size-64px flex justify-center items-center rounded-md border-px border-dashed cursor-pointer border-[#d9d9d9] dark:border-[#424242] hover:border-[#5794f7] dark:hover:border-[#5187e1] text-[#d9d9d9] dark:text-[#424242] hover:text-[#5794f7] dark:hover:text-[#5187e1] transition",
685
- onClick: c
686
- }, [
687
- l("div", Ml, [
688
- r(a(_), { name: "antd:PlusOutlined" }),
689
- s[6] || (s[6] = l("span", { class: "text-10px mt-1" }, "选择图标", -1))
690
- ])
691
- ], 8, El))
692
- ]),
693
- _: 1
694
- }, 8, ["modelValue", "box-type", "angle", "background", "radius", "icon-color"])
695
- ]),
696
- _: 1
697
- })) : L("", !0);
698
- };
699
- }
700
- });
701
- export {
702
- Bl as _
703
- };