ss-component-new 1.1.612 → 1.1.613

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 (83) hide show
  1. package/dist/{array-mnEYd91h.cjs → array-Bq7cMxbK.cjs} +1 -1
  2. package/dist/{array-wJSGLzMi.js → array-D4dLF1xj.js} +1 -1
  3. package/dist/icons/svg/query.svg +1 -0
  4. package/dist/{index-NHRmQhXb.js → index-5cKa20gg.js} +5 -5
  5. package/dist/index-6DTZ5srt.cjs +1 -0
  6. package/dist/{index-dMsdBhZR.cjs → index-8Juw-vHr.cjs} +1 -1
  7. package/dist/{index-n0r1Sh2B.js → index-A885uuFC.js} +4 -4
  8. package/dist/{index-ndIyfzUk.cjs → index-B4CjnKtd.cjs} +12 -12
  9. package/dist/{index-DNzcAMFb.cjs → index-B4gAKBoa.cjs} +1 -1
  10. package/dist/{index-BjleSQq1.js → index-B7MJ84rl.js} +4 -4
  11. package/dist/{index-DmBrXru-.js → index-B7STLPQk.js} +3 -3
  12. package/dist/index-B8Kd-FiX.cjs +1 -0
  13. package/dist/{index-CJ_rdkr8.js → index-BFELXxoC.js} +1 -1
  14. package/dist/{index-R68OOqlG.cjs → index-BTcprbvh.cjs} +1 -1
  15. package/dist/{index-l4jhtgPJ.js → index-B_jcwz8h.js} +5 -5
  16. package/dist/{index-Cm0AWbmH.js → index-BefuyAwv.js} +36 -31
  17. package/dist/{index-FztSyrOr.js → index-Bh3pY3Jj.js} +5 -5
  18. package/dist/index-BnolyTQo.cjs +1 -0
  19. package/dist/{index-Bk6AgbX9.cjs → index-BscVxcWg.cjs} +1 -1
  20. package/dist/{index-Buf4TmEA.js → index-ByqiusUf.js} +5 -5
  21. package/dist/{index-Dm8EQvZF.cjs → index-C-AfxANM.cjs} +1 -1
  22. package/dist/{index-DSZ-dJfB.js → index-C2gWLtuP.js} +1182 -1165
  23. package/dist/{index-Co7qMp6d.cjs → index-C2oTEiOz.cjs} +1 -1
  24. package/dist/{index-CZnxVxT-.js → index-C8IGgf80.js} +3 -3
  25. package/dist/{index-BTE5_xGG.js → index-C8JbYV9i.js} +4 -4
  26. package/dist/{index-tjZvKw6H.js → index-CIk03V2m.js} +8 -8
  27. package/dist/{index-CWaBQ1DX.cjs → index-CPq1CV6b.cjs} +1 -1
  28. package/dist/{index-l52VRsV3.cjs → index-Cbht3RG4.cjs} +1 -1
  29. package/dist/{index-BOb-2bQ6.js → index-CfpRAxJB.js} +2 -2
  30. package/dist/{index-CVbQPh0w.cjs → index-Chwdv_Xm.cjs} +1 -1
  31. package/dist/index-CjbW-TOF.js +785 -0
  32. package/dist/{index-chfPU5Di.cjs → index-CjfSFVch.cjs} +1 -1
  33. package/dist/{index-DgfctgnZ.cjs → index-CoQ5q08W.cjs} +1 -1
  34. package/dist/{index-RFCzxTjm.cjs → index-CsCDreKP.cjs} +1 -1
  35. package/dist/{index-B7zu-Th4.cjs → index-CtxOJNHA.cjs} +1 -1
  36. package/dist/{index-DSQNVSnX.js → index-DCT9raO7.js} +14 -14
  37. package/dist/{index-BG4IF9YQ.cjs → index-DDffuw8C.cjs} +20 -20
  38. package/dist/{index-BWzFnNAa.js → index-DHXlo9Tk.js} +6 -6
  39. package/dist/{index-BY7b1jSA.js → index-DVNL8B38.js} +3 -3
  40. package/dist/{index-BJi_ECqJ.cjs → index-DXkSDTRj.cjs} +1 -1
  41. package/dist/{index-DR3WrhKH.cjs → index-DXmRodF3.cjs} +1 -1
  42. package/dist/{index-DUiCPNl4.cjs → index-DY7U0ulO.cjs} +1 -1
  43. package/dist/{index-qqxCHR1f.cjs → index-DYxoBbtJ.cjs} +1 -1
  44. package/dist/{index-YOGc-Trd.js → index-D_HszcpC.js} +3 -3
  45. package/dist/{index-Bkm9CeI0.js → index-DaBCF0Nd.js} +1 -1
  46. package/dist/{index-CmXpvujN.js → index-DaOakrcL.js} +1 -1
  47. package/dist/{index-B0e7C08n.js → index-DaljBanN.js} +1 -1
  48. package/dist/{index-Co3FWnWC.js → index-DnS2Ulaz.js} +1 -1
  49. package/dist/{index-pnJ2ytKe.cjs → index-DuYtDUrA.cjs} +1 -1
  50. package/dist/index-j-V6cmGh.js +4577 -0
  51. package/dist/{index-BpEem65c.cjs → index-u76SwcjA.cjs} +1 -1
  52. package/dist/{index-B3bcujKn.js → index-uOFoDGfr.js} +1295 -1289
  53. package/dist/{index-DjeKotP5.cjs → index-z9FzE2kG.cjs} +1 -1
  54. package/dist/{index.vue_vue_type_script_setup_true_lang-F5FbVKlu.js → index.vue_vue_type_script_setup_true_lang-BBjmwIHl.js} +2 -2
  55. package/dist/{index.vue_vue_type_script_setup_true_lang-DO-iPkrT.cjs → index.vue_vue_type_script_setup_true_lang-C0WdqAD3.cjs} +1 -1
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3cBVkstL.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-8sKf69T7.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BppZaMnT.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BBtXjJyn.js} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DVuPwJAn.js → index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DIyem6Zd.js} +210 -210
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-XVgpv0vK.cjs → index.vue_vue_type_style_index_0_scoped_1ee6cc73_lang-DfW-NcWK.cjs} +7 -7
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_57a7854d_lang-Bg3wWt9Z.js → index.vue_vue_type_style_index_0_scoped_57a7854d_lang-Bj6wXs-K.js} +8 -8
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_57a7854d_lang-DhLSvSWi.cjs → index.vue_vue_type_style_index_0_scoped_57a7854d_lang-CoP3t1MS.cjs} +1 -1
  62. package/dist/{login-BBvcYktp.cjs → login--G67Cn_f.cjs} +1 -1
  63. package/dist/{login-afGmER0u.js → login-C8DAyy2e.js} +1 -1
  64. package/dist/{main-D9vTlRj4.cjs → main-DEB71tXS.cjs} +1 -1
  65. package/dist/{main-CXZ6xrQe.js → main-DSnZpabn.js} +5 -5
  66. package/dist/{menu-DYsWoy6Z.cjs → menu-B98fDP-p.cjs} +10 -10
  67. package/dist/{menu-Qw1eGtzq.js → menu-DArqZlON.js} +1 -2
  68. package/dist/{modelComp-y7HaQuVQ.js → modelComp-6AqovLWA.js} +1 -1
  69. package/dist/{modelComp-8s0tWZDU.cjs → modelComp-RmvEs7pM.cjs} +1 -1
  70. package/dist/ss-component.cjs +1 -1
  71. package/dist/ss-component.css +2 -2
  72. package/dist/ss-component.js +9 -9
  73. package/dist/ss-component2.cjs +1 -1
  74. package/dist/ss-component2.js +9 -9
  75. package/dist/{threeModel-DC6PX3wY.js → threeModel-BuK8iClH.js} +2 -2
  76. package/dist/{threeModel-DCA3CEkQ.cjs → threeModel-j-ksghdx.cjs} +1 -1
  77. package/package.json +1 -1
  78. package/public/icons/svg/query.svg +1 -0
  79. package/dist/index-B3kkcHGw.cjs +0 -1
  80. package/dist/index-Boa-o-ZU.js +0 -4492
  81. package/dist/index-BzsEjGyJ.cjs +0 -1
  82. package/dist/index-CQHMPLLG.js +0 -771
  83. package/dist/index-CYS-zlSw.cjs +0 -1
@@ -0,0 +1,785 @@
1
+ import { ref as u, computed as O, reactive as Z, nextTick as m, watch as ee } from "vue";
2
+ import { bR as we, g as L, s as B, E as y, c as j, bO as te, bM as se, bP as re, p as k, u as ne } from "./menu-DArqZlON.js";
3
+ import { u as ae } from "./login-C8DAyy2e.js";
4
+ import { u as Ie } from "./modelComp-6AqovLWA.js";
5
+ import { d as ce, i as Ee, e as H } from "./crypto-BRyGpjGR.js";
6
+ import { E as Re } from "./index-DaOakrcL.js";
7
+ const le = we("authorityState", {
8
+ state: () => ({
9
+ routerPageStructures: []
10
+ }),
11
+ actions: {
12
+ setRouterPageStructure(e) {
13
+ this.routerPageStructures = e;
14
+ }
15
+ }
16
+ }), Oe = ne(k), { activeMenuPath: b } = B(Oe), ue = ae(k), { structureData: je } = B(ue), Ne = le(k), { routerPageStructures: xe } = B(Ne), oe = Ie(k), Fe = u([
17
+ {
18
+ label: "角色名称",
19
+ value: "",
20
+ name: "roleName"
21
+ }
22
+ ]), We = u([
23
+ {
24
+ label: "查询"
25
+ },
26
+ {
27
+ label: "重置"
28
+ }
29
+ ]), X = Z({
30
+ isFilter: !1,
31
+ filterForm: {}
32
+ }), Le = u(!1), _e = (e) => {
33
+ X.isFilter = !0, X.filterForm = e;
34
+ }, _ = u([
35
+ // {
36
+ // key: "extraButton",
37
+ // contents: [
38
+ // {
39
+ // label: "新增"
40
+ // }
41
+ // ]
42
+ // },
43
+ // {
44
+ // key: "rowButton",
45
+ // contents: [
46
+ // {
47
+ // label: "授权",
48
+ // textColor: `blue`
49
+ // }, {
50
+ // label: "编辑"
51
+ // },
52
+ // {
53
+ // label: "删除",
54
+ // textColor: 'red'
55
+ // }
56
+ // ]
57
+ // },
58
+ // // {
59
+ // // key: "tableIndex",
60
+ // // contents: []
61
+ // // },
62
+ // {
63
+ // key: "header",
64
+ // contents: [
65
+ // {
66
+ // label: "角色名称",
67
+ // prop: 'roleName'
68
+ // },
69
+ // {
70
+ // label: "角色状态",
71
+ // formType: 'Radio',
72
+ // prop: 'roleStatus',
73
+ // options: [
74
+ // {
75
+ // label: "启用",
76
+ // value: "启用"
77
+ // },
78
+ // {
79
+ // label: "禁用",
80
+ // value: "禁用"
81
+ // }
82
+ // ]
83
+ // },
84
+ // {
85
+ // label: "角色排序",
86
+ // prop: 'roleOrder',
87
+ // formType: 'Number',
88
+ // }, {
89
+ // label: "备注",
90
+ // prop: 'remark',
91
+ // formType: 'TextArea',
92
+ // }, {
93
+ // label: "权限",
94
+ // prop: 'roleAuthority',
95
+ // isTableColHidden: true,
96
+ // isFormColHidden: true,
97
+ // },
98
+ // {
99
+ // label: "操作"
100
+ // }
101
+ // ]
102
+ // },
103
+ // {
104
+ // key: "tableContents",
105
+ // contents: []
106
+ // // contents: [
107
+ // // [
108
+ // // "超级管理员",
109
+ // // "启动",
110
+ // // 1,
111
+ // // []
112
+ // // // ['元元模型/系统/查询', '元元模型/系统/新增', '元元模型/系统/编辑']
113
+ // // ], [
114
+ // // "普通管理员",
115
+ // // "启动",
116
+ // // 2,
117
+ // // []
118
+ // // // ['元元模型/系统/查询', '元元模型/系统/新增', '元元模型/系统/编辑']
119
+ // // ],
120
+ // // ]
121
+ // }
122
+ ]), N = u([]), he = u(""), Ue = O(() => {
123
+ var r, s, t, n, a;
124
+ const e = (r = xe.value) == null ? void 0 : r.find((l) => {
125
+ var c;
126
+ return ((c = l == null ? void 0 : l.comp) == null ? void 0 : c.toUpperCase()) === "TABLE";
127
+ });
128
+ if (e) {
129
+ he.value = e.name, N.value = (n = (t = (s = e == null ? void 0 : e.compData) == null ? void 0 : s.find((c) => (c == null ? void 0 : c.key) === "header")) == null ? void 0 : t.contents) == null ? void 0 : n.filter((c) => (c == null ? void 0 : c.label) !== "操作");
130
+ const l = (a = e == null ? void 0 : e.compData) == null ? void 0 : a.map((c) => {
131
+ if ((c == null ? void 0 : c.key) === "rowButton") {
132
+ let o = [];
133
+ return $.value ? o = [...c == null ? void 0 : c.contents, { label: "授权" }] : o = c == null ? void 0 : c.contents, {
134
+ ...c,
135
+ contents: o
136
+ };
137
+ }
138
+ return c;
139
+ });
140
+ return ke(l), l;
141
+ }
142
+ return [];
143
+ }), Ve = (e) => {
144
+ z(e.singleContent, e.buttonName, M.value);
145
+ }, S = u({}), ie = u(), P = async (e, r, s) => {
146
+ var t, n;
147
+ try {
148
+ const a = await e(r);
149
+ return ((t = a == null ? void 0 : a.data) == null ? void 0 : t.code) === 200 ? (s !== "查询" && await ue.setLogRecordAsync({
150
+ type: s,
151
+ data: r
152
+ }, b.value), a.data.result || ((n = a == null ? void 0 : a.data) == null ? void 0 : n.code) === 200) : null;
153
+ } catch (a) {
154
+ y.error(a);
155
+ }
156
+ }, fe = (e, r) => {
157
+ r == null || r.forEach((s) => {
158
+ e == null || e.forEach((t) => {
159
+ var a, l, c;
160
+ ((a = t == null ? void 0 : t.path) != null && a.startsWith("/") ? (l = t == null ? void 0 : t.path) == null ? void 0 : l.substring(1) : t == null ? void 0 : t.path) === s.path && (t.checkedButtons = s.checkedButtons), t.children && ((c = t.children) == null ? void 0 : c.length) > 0 && fe(t.children, r);
161
+ });
162
+ });
163
+ }, ye = (e) => e == null ? void 0 : e.map((r) => {
164
+ var t;
165
+ const s = {
166
+ ...r,
167
+ checkedButtons: []
168
+ };
169
+ return s.children && ((t = s.children) == null ? void 0 : t.length) > 0 && (s.children = ye(s.children)), s;
170
+ }), ge = (e) => {
171
+ for (const r in e)
172
+ if (Array.isArray(e[r]))
173
+ return r;
174
+ return "";
175
+ }, pe = (e) => {
176
+ const r = [];
177
+ let s = 0;
178
+ for (; s < e.length; )
179
+ if (typeof e[s] == "string") {
180
+ const t = { title: e[s] };
181
+ s + 1 < e.length && Array.isArray(e[s + 1]) ? (t.children = pe(e[s + 1]), s += 2) : s += 1, r.push(t);
182
+ }
183
+ return r;
184
+ }, ve = (e) => {
185
+ const r = [];
186
+ let s = 0;
187
+ for (; s < (e == null ? void 0 : e.length); ) {
188
+ const t = { title: e == null ? void 0 : e[s] };
189
+ s + 1 < (e == null ? void 0 : e.length) && Array.isArray(e == null ? void 0 : e[s + 1]) ? (t.children = pe(e == null ? void 0 : e[s + 1]), s += 2) : s += 1, r.push(t);
190
+ }
191
+ return r;
192
+ }, U = (e, r = "") => e == null ? void 0 : e.map((s) => {
193
+ const t = r ? `${r}/${s.title}` : s.title, n = {
194
+ ...s,
195
+ path: t
196
+ };
197
+ return s.children && s.children.length > 0 && (n.children = U(s.children, t)), n;
198
+ }), be = (e, r) => e.reduce((s, t) => {
199
+ const n = t[r];
200
+ return s[n] || (s[n] = []), s[n].push(t), s;
201
+ }, {}), de = (e) => {
202
+ const r = [];
203
+ function s(n) {
204
+ !n.children || n.children.length === 0 ? r.push(n) : n.children.forEach((a) => s(a));
205
+ }
206
+ return e.forEach((n) => s(n)), r == null ? void 0 : r.map((n) => {
207
+ var a, l, c;
208
+ return {
209
+ ...n,
210
+ parentPath: (c = (l = (a = n.path) == null ? void 0 : a.split("/")) == null ? void 0 : l.slice(0, -1)) == null ? void 0 : c.join("/")
211
+ };
212
+ });
213
+ }, Ae = (e) => Object.entries(e).map(([s, t]) => ({
214
+ path: s,
215
+ checkedButtons: t == null ? void 0 : t.map((n) => n == null ? void 0 : n.path)
216
+ })), ze = (e) => Object.prototype.toString.call(e) === "[object Object]" && e !== null, Qe = (e) => {
217
+ const r = {}, s = Array.isArray(e) ? e == null ? void 0 : e.filter((t) => {
218
+ var n;
219
+ return !(ze(t) && ((n = Object.keys(t)) != null && n.includes("id")));
220
+ }) : null;
221
+ return s && (s == null || s.forEach((t, n) => {
222
+ if (n <= 0) return;
223
+ const a = `a${n}`;
224
+ r[a] = t;
225
+ })), r;
226
+ }, d = u(""), ke = (e) => {
227
+ var n;
228
+ const r = e == null ? void 0 : e.find((a) => (a == null ? void 0 : a.key) === "tableContents");
229
+ if (!r) return "";
230
+ const s = (n = r == null ? void 0 : r.contents) == null ? void 0 : n[0], t = Qe(s);
231
+ d.value = ge(t);
232
+ }, qe = (e) => {
233
+ if (!Array.isArray(e))
234
+ return !1;
235
+ for (let r of e) {
236
+ if (typeof r != "object" || r === null || typeof r.path != "string" || !Array.isArray(r.checkedButtons))
237
+ return !1;
238
+ for (let s of r.checkedButtons)
239
+ if (typeof s != "string")
240
+ return !1;
241
+ }
242
+ return !0;
243
+ }, Ge = (e) => {
244
+ const r = [];
245
+ for (const s in e)
246
+ e[s].forEach((n) => {
247
+ var o, h;
248
+ const a = (o = n.path) != null && o.startsWith("/") ? (h = n.path) == null ? void 0 : h.substring(1) : n.path, l = a == null ? void 0 : a.split("/");
249
+ let c = r;
250
+ l.forEach((g) => {
251
+ let f = c.find((v) => v.title === g);
252
+ f || (f = { title: g, path: n.path, children: [] }, c.push(f)), c = f.children;
253
+ });
254
+ });
255
+ return r;
256
+ }, Je = (e) => {
257
+ const r = {};
258
+ return e.forEach((s) => {
259
+ const { path: t, checkedButtons: n } = s, a = t, l = n.map((c) => ({
260
+ title: c.split("/").pop() || "",
261
+ path: c,
262
+ parentPath: a
263
+ }));
264
+ r[a] = l;
265
+ }), r;
266
+ }, Se = (e) => {
267
+ let r = [];
268
+ for (const s of e) {
269
+ let t = [s.title];
270
+ if (s.children && Array.isArray(s.children)) {
271
+ let n = Se(s.children);
272
+ n.length > 0 && t.push(n);
273
+ }
274
+ r.push(t);
275
+ }
276
+ return r;
277
+ }, He = (e) => {
278
+ const r = [];
279
+ for (const s of e) {
280
+ if (!Array.isArray(s) || s.length !== 2) continue;
281
+ const [t, n] = s, a = Be(n), l = r.indexOf(t);
282
+ l === -1 ? r.push(t, a) : r[l + 1] = Ce(r[l + 1], a);
283
+ }
284
+ return r;
285
+ }, Be = (e) => {
286
+ const r = [];
287
+ for (const s of e)
288
+ if (Array.isArray(s)) {
289
+ if (s.length === 1 && typeof s[0] == "string")
290
+ r.push(s[0]);
291
+ else if (s.length === 2 && typeof s[0] == "string") {
292
+ const [t, n] = s;
293
+ r.push(t, Be(n));
294
+ }
295
+ }
296
+ return r;
297
+ }, Ce = (e, r) => {
298
+ const s = [...e];
299
+ let t = 0;
300
+ for (; t < r.length; ) {
301
+ const n = r[t];
302
+ if (typeof n == "string") {
303
+ const a = s.indexOf(n);
304
+ a === -1 ? s.push(n, r[t + 1]) : s[a + 1] = Ce(s[a + 1], r[t + 1]), t += 2;
305
+ } else
306
+ s.push(n), t += 1;
307
+ }
308
+ return s;
309
+ }, x = u(!1), Xe = async (e, r) => {
310
+ if (S.value = j(r), oe.setRefreshCurStructure(!1), e === "授权") {
311
+ if (x.value = !0, !d.value) {
312
+ y.error("请正确定义角色权限");
313
+ return;
314
+ }
315
+ const s = qe(S.value[d.value]);
316
+ let t;
317
+ if (s)
318
+ t = S.value[d.value];
319
+ else {
320
+ const n = ve(S.value[d.value]), a = U(n), l = de(a), c = be(l, "parentPath");
321
+ t = Ae(c);
322
+ }
323
+ await m(), A.title = `【${r.a0}】授权`, A.show = !0, t && Array.isArray(t) && fe(w.value, t), x.value = !1;
324
+ }
325
+ }, Ye = () => {
326
+ A.show = !1;
327
+ }, K = u(), Ze = async (e) => {
328
+ const r = await P(L, {
329
+ key: {
330
+ systemKey: sessionStorage.getItem("systemKey"),
331
+ type: "data",
332
+ pageKey: e
333
+ }
334
+ }, "查询"), s = r == null ? void 0 : r.map((t) => {
335
+ var n;
336
+ return {
337
+ id: t.id,
338
+ tableData: (n = t == null ? void 0 : t.value) == null ? void 0 : n.tableData
339
+ };
340
+ });
341
+ return s == null ? void 0 : s.map((t) => {
342
+ var n;
343
+ if (Array.isArray(t == null ? void 0 : t.tableData)) {
344
+ let a = { id: t.id };
345
+ return (n = t == null ? void 0 : t.tableData) == null || n.forEach((l, c) => {
346
+ a[`a${c}`] = l;
347
+ }), a;
348
+ } else
349
+ return {
350
+ ...t.tableData,
351
+ id: t.id
352
+ };
353
+ });
354
+ }, V = (e, r) => {
355
+ let s = {};
356
+ return r == null || r.forEach((t, n) => {
357
+ t.label && e && (s[t.label] = (e == null ? void 0 : e[`a${n}`]) ?? null);
358
+ }), s;
359
+ }, z = (e, r, s) => {
360
+ var a, l, c, o;
361
+ const t = j(e);
362
+ t != null && t.id && delete t.id;
363
+ const n = V(t, N.value);
364
+ console.log("submitTableAsyncByVerify", n, t, N.value, d.value), r === "新增" ? P(te, {
365
+ key: {
366
+ type: "data",
367
+ systemKey: sessionStorage.getItem("systemKey"),
368
+ pageKey: (a = b.value) != null && a.startsWith("/") ? (l = b.value) == null ? void 0 : l.substring(1) : b.value,
369
+ tableId: s
370
+ },
371
+ value: {
372
+ tableData: n
373
+ }
374
+ }, r).then((h) => {
375
+ K.value = {
376
+ ...e,
377
+ newId: h
378
+ }, r && h && y.success(r + "成功");
379
+ }) : r === "编辑" ? (console.log("编辑角色", n), P(se, {
380
+ id: e.id,
381
+ key: {
382
+ type: "data",
383
+ systemKey: sessionStorage.getItem("systemKey"),
384
+ pageKey: (c = b.value) != null && c.startsWith("/") ? (o = b.value) == null ? void 0 : o.substring(1) : b.value,
385
+ tableId: s
386
+ },
387
+ value: {
388
+ tableData: n
389
+ }
390
+ }, r).then((h) => {
391
+ r && h && y.success(r + "成功"), A.show = !1;
392
+ })) : r === "删除" && P(re, {
393
+ id: e.id
394
+ }, r).then((h) => {
395
+ r && h && y.success(r + "成功");
396
+ }), oe.setRefreshCurStructure(!0);
397
+ }, Pe = (e) => {
398
+ let r = [];
399
+ return e == null || e.forEach((s) => {
400
+ var t;
401
+ if (s.checkedButtons && ((t = s.checkedButtons) == null ? void 0 : t.length) > 0) {
402
+ const n = {
403
+ path: s.path,
404
+ checkedButtons: s.checkedButtons
405
+ // isCheckedAll: node.checkedButtons?.length === node.renderButtons?.length
406
+ };
407
+ r = r.concat(n);
408
+ }
409
+ s.children && (r = r.concat(Pe(s.children)));
410
+ }), r;
411
+ }, me = () => {
412
+ const e = Pe(w.value), r = Je(e), s = Ge(r), t = Se(s), n = He(t);
413
+ K.value = {
414
+ ...S.value,
415
+ // roleAuthority: extractCheckedButtonPaths(menuData.value)
416
+ // ['a' + authorityIndex]: checkedKeys
417
+ // todo 模型驱动
418
+ [d.value]: n
419
+ }, m(() => {
420
+ console.log("clickSubmitAuthority", K.value, _.value, M.value), z(K.value, "编辑", M.value);
421
+ });
422
+ }, A = Z({
423
+ show: !1,
424
+ title: "角色授权",
425
+ width: "35%",
426
+ draggable: !0
427
+ }), et = ({ isPenultimate: e }, r) => {
428
+ var s, t;
429
+ return console.log("isPenultimate", e, r), ((t = (s = r == null ? void 0 : r.data) == null ? void 0 : s.renderButtons) == null ? void 0 : t.length) > 0 ? "is-penultimate" : "";
430
+ }, M = u(0), tt = async (e) => {
431
+ var t, n, a, l, c;
432
+ let r;
433
+ const s = await L({
434
+ key: {
435
+ systemKey: sessionStorage.getItem("systemKey"),
436
+ type: "structure",
437
+ // 路由页面路径前缀会有/,但存储数据或获取数据时是要过滤掉/
438
+ pageKey: e != null && e.startsWith("/") ? e == null ? void 0 : e.substring(1) : e
439
+ }
440
+ });
441
+ return ((t = s == null ? void 0 : s.data) == null ? void 0 : t.code) === 200 && (n = s == null ? void 0 : s.data) != null && n.result && ((a = s == null ? void 0 : s.data) == null ? void 0 : a.result.length) > 0 && (r = (c = (l = s == null ? void 0 : s.data.result) == null ? void 0 : l[0]) == null ? void 0 : c.id, M.value = r), r;
442
+ }, w = u([]), st = u([
443
+ {
444
+ path: "资源管理",
445
+ buttons: ["查询", "新增", "编辑", "删除"]
446
+ },
447
+ {
448
+ path: "资源管理/人员",
449
+ buttons: ["查询", "新增", "编辑", "删除"]
450
+ }
451
+ ]), rt = (e, r) => {
452
+ var s;
453
+ e.checkedButtons = r ? (s = e.renderButtons) == null ? void 0 : s.map((t) => t.path) : [], console.log("handleNodeCheckChange", e, r);
454
+ }, T = u([]), nt = (e, r) => {
455
+ var s, t, n;
456
+ r.checkedButtons = e, ((s = r.checkedButtons) == null ? void 0 : s.length) === ((t = r.renderButtons) == null ? void 0 : t.length) ? T.value.push(r.path) : (e == null ? void 0 : e.length) === 0 && (T.value = (n = T.value) == null ? void 0 : n.filter((a) => a !== r.path));
457
+ };
458
+ ee(() => T.value.length, () => {
459
+ var e;
460
+ (e = ie.value) == null || e.setCheckedKeys([...T.value]);
461
+ });
462
+ ee(() => A.show, (e) => {
463
+ e || (w.value = ye(w.value));
464
+ });
465
+ const F = O(() => {
466
+ var s;
467
+ const e = (s = j(je.value)) == null ? void 0 : s.filter((t) => {
468
+ var n, a;
469
+ return ((a = (n = t == null ? void 0 : t.key) == null ? void 0 : n.pageKey) == null ? void 0 : a.toUpperCase()) !== "MENU";
470
+ });
471
+ return e == null ? void 0 : e.map((t) => {
472
+ var l, c, o, h, g, f, v, J;
473
+ const n = /button/i;
474
+ let a = (o = (c = (l = t == null ? void 0 : t.value) == null ? void 0 : l.pageData) == null ? void 0 : c.compData) == null ? void 0 : o.filter((C) => n.test(C == null ? void 0 : C.key));
475
+ return a = Array.from(
476
+ new Set(a == null ? void 0 : a.flatMap((C) => C.contents.map((Me) => Me.label)))
477
+ ), {
478
+ path: (g = (h = t == null ? void 0 : t.key) == null ? void 0 : h.pageKey) != null && g.startsWith("/") ? (v = (f = t == null ? void 0 : t.key) == null ? void 0 : f.pageKey) == null ? void 0 : v.substring(1) : (J = t == null ? void 0 : t.key) == null ? void 0 : J.pageKey,
479
+ buttons: a
480
+ };
481
+ });
482
+ }), at = u([]), ct = (e) => {
483
+ const s = [e == null ? void 0 : e.find((t) => (t == null ? void 0 : t.title) === "平台管理")].flatMap((t) => t == null ? void 0 : t.childMenus);
484
+ return s == null ? void 0 : s.map((t) => {
485
+ var n, a;
486
+ return {
487
+ path: (n = t == null ? void 0 : t.path) != null && n.startsWith("/") ? (a = t == null ? void 0 : t.path) == null ? void 0 : a.substring(1) : t.path,
488
+ // buttons: item?.path === '/系统管理/个人中心' ? ['基本信息', '上传头像', '签名', '修改密码'] : ['新增', '查看', '编辑', '删除']
489
+ buttons: ["新增", "查看", "编辑", "删除"]
490
+ };
491
+ });
492
+ }, Y = (e, r) => {
493
+ var s;
494
+ if (e.carryData) {
495
+ if (e.path === "系统管理/个人中心") {
496
+ const t = ["基本信息", "上传头像", "签名", "修改密码"];
497
+ return t == null ? void 0 : t.map((n) => {
498
+ var a, l;
499
+ return {
500
+ title: n,
501
+ path: (a = e == null ? void 0 : e.path) != null && a.startsWith("/") ? ((l = e == null ? void 0 : e.path) == null ? void 0 : l.substring(1)) + "/" + n : e.path + "/" + n
502
+ };
503
+ });
504
+ }
505
+ return (s = r == null ? void 0 : r.buttons) == null ? void 0 : s.map((t) => {
506
+ var n, a;
507
+ return {
508
+ title: t,
509
+ // path: node.path + '/' + button
510
+ path: (n = e == null ? void 0 : e.path) != null && n.startsWith("/") ? ((a = e == null ? void 0 : e.path) == null ? void 0 : a.substring(1)) + "/" + t : e.path + "/" + t
511
+ };
512
+ });
513
+ }
514
+ return [];
515
+ }, W = (e, r) => {
516
+ if (Array.isArray(e))
517
+ return e == null ? void 0 : e.map((s) => {
518
+ var a, l;
519
+ const t = (a = s == null ? void 0 : s.path) != null && a.startsWith("/") ? (l = s == null ? void 0 : s.path) == null ? void 0 : l.substring(1) : s == null ? void 0 : s.path, n = r == null ? void 0 : r.find((c) => (c == null ? void 0 : c.path) === t);
520
+ return s.childMenus && s.childMenus.length > 0 ? {
521
+ ...s,
522
+ renderButtons: Y(s, n),
523
+ checkedButtons: [],
524
+ children: W(s.childMenus, F.value),
525
+ childMenus: W(s.childMenus, F.value)
526
+ } : {
527
+ ...s,
528
+ renderButtons: Y(s, n),
529
+ checkedButtons: []
530
+ };
531
+ });
532
+ }, lt = {
533
+ comp: "Group",
534
+ name: "/系统管理/角色管理",
535
+ compData: [
536
+ {
537
+ key: "groupContents",
538
+ contents: [
539
+ {
540
+ comp: "Table",
541
+ compData: _.value,
542
+ name: ""
543
+ }
544
+ ]
545
+ }
546
+ ]
547
+ }, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
548
+ __proto__: null,
549
+ addButtonsToTree: W,
550
+ addPathToTree: U,
551
+ authorizeDialog: A,
552
+ buttonValue: We,
553
+ changedRow: K,
554
+ clickRow: S,
555
+ clickRowButton: Xe,
556
+ clickSubmitAuthority: me,
557
+ closeAuthorizeDialog: Ye,
558
+ compName: he,
559
+ convertArrayToTree: ve,
560
+ convertIndexToLabel: V,
561
+ customNodeClass: et,
562
+ getActivePageStructureId: tt,
563
+ getAuthorityKey: ke,
564
+ getFirstArrayProperty: ge,
565
+ getLeafNodesRecursive: de,
566
+ getPageDataAsync: Ze,
567
+ groupByField: be,
568
+ handleAddSysMenusButtons: ct,
569
+ handleItemDataChange: Ve,
570
+ handleLoading: x,
571
+ handleNodeBtnChange: nt,
572
+ handleNodeCheckChange: rt,
573
+ handleQueryChange: _e,
574
+ handleRowAuthorityRender: Ae,
575
+ handleSubmitAsync: P,
576
+ isPageDataExist: Le,
577
+ menuData: w,
578
+ menusButtons: st,
579
+ pageData: _,
580
+ pageDataFiltered: Ue,
581
+ queryFormData: Fe,
582
+ structureButtons: F,
583
+ structureId: M,
584
+ submitTableAsyncByVerify: z,
585
+ tempRolePageData: lt,
586
+ tempSysMenus: at,
587
+ treeRef: ie
588
+ }, Symbol.toStringTag, { value: "Module" })), Ke = ae(k), { superAdminInfo: ut, cryptoInfo: i } = B(Ke), ot = ne(k), { activeMenuPath: p } = B(ot), I = "123456", ht = le(k), { routerPageStructures: it } = B(ht), Q = u(0), ft = u([
589
+ {
590
+ label: "用户名称",
591
+ value: "",
592
+ name: "userName"
593
+ }
594
+ ]), $ = O(() => {
595
+ const e = sessionStorage.getItem("isSuperAdmin");
596
+ return e ? JSON.parse(e) : !1;
597
+ }), yt = (e) => {
598
+ console.log("handleQueryChange", e);
599
+ }, q = u([]), Te = u(""), E = O(() => {
600
+ var r, s, t, n, a;
601
+ const e = (r = it.value) == null ? void 0 : r.find((l) => {
602
+ var c;
603
+ return ((c = l == null ? void 0 : l.comp) == null ? void 0 : c.toUpperCase()) === "TABLE";
604
+ });
605
+ if (e) {
606
+ Te.value = e.name, q.value = (n = (t = (s = e == null ? void 0 : e.compData) == null ? void 0 : s.find((c) => (c == null ? void 0 : c.key) === "header")) == null ? void 0 : t.contents) == null ? void 0 : n.filter((c) => (c == null ? void 0 : c.label) !== "操作");
607
+ const l = (a = e == null ? void 0 : e.compData) == null ? void 0 : a.map((c) => {
608
+ if ((c == null ? void 0 : c.key) === "rowButton") {
609
+ const o = [...c == null ? void 0 : c.contents, { label: "重置密码" }];
610
+ return {
611
+ ...c,
612
+ contents: o
613
+ };
614
+ }
615
+ return c;
616
+ });
617
+ return console.log(245, l), l;
618
+ }
619
+ return [];
620
+ }), gt = (e) => {
621
+ G(e.singleContent, e.buttonName, Q.value);
622
+ }, R = u(), pt = (e) => {
623
+ console.log("onDoubleClick", e);
624
+ }, vt = (e, r) => {
625
+ e === "重置密码" && Re.confirm(
626
+ `该操作将会重置【${r == null ? void 0 : r.account}】的密码,确认重置?`,
627
+ "警告",
628
+ {
629
+ confirmButtonText: "确认",
630
+ cancelButtonText: "取消",
631
+ type: "warning"
632
+ }
633
+ ).then(() => {
634
+ R.value = {
635
+ ...r,
636
+ password: I
637
+ }, G(R.value, e, Q.value);
638
+ }).catch(() => {
639
+ y.info("取消重置");
640
+ });
641
+ }, $e = () => {
642
+ De(p.value).then((e) => {
643
+ var s;
644
+ const r = Array.isArray(e) && (e == null ? void 0 : e.filter((t) => (t == null ? void 0 : t.account) !== ut.value.account));
645
+ E.value = (s = E.value) == null ? void 0 : s.map((t) => t.key === "tableContents" ? {
646
+ ...t,
647
+ // 不显示超管
648
+ contents: r == null ? void 0 : r.map((n) => {
649
+ var a;
650
+ return {
651
+ ...n,
652
+ // 登录用户是超管才给解密
653
+ // password: loginUserIsSuper.value ? decryptData(d?.password, cryptoInfo?.value?.privateKey) : d?.password
654
+ password: ce(n == null ? void 0 : n.password, (a = i == null ? void 0 : i.value) == null ? void 0 : a.privateKey)
655
+ };
656
+ })
657
+ } : t);
658
+ });
659
+ }, D = async (e, r, s) => {
660
+ var t, n;
661
+ try {
662
+ const a = await e(r);
663
+ return ((t = a == null ? void 0 : a.data) == null ? void 0 : t.code) === 200 ? (s !== "查询" && await Ke.setLogRecordAsync({
664
+ type: s,
665
+ data: r
666
+ }, p.value), a.data.result || ((n = a == null ? void 0 : a.data) == null ? void 0 : n.code) === 200) : null;
667
+ } catch (a) {
668
+ y.error(a);
669
+ }
670
+ }, G = (e, r, s) => {
671
+ var a, l, c, o, h, g;
672
+ const t = j(e);
673
+ t != null && t.id && delete t.id;
674
+ const n = V(t, q.value);
675
+ Ee() && n && (!n.password && $.value ? n.password = H(I, (a = i == null ? void 0 : i.value) == null ? void 0 : a.publicKey) : n.password && $.value && (n.password = H(n == null ? void 0 : n.password, (l = i == null ? void 0 : i.value) == null ? void 0 : l.publicKey))), r === "新增" ? D(te, {
676
+ key: {
677
+ type: "data",
678
+ layer: n == null ? void 0 : n.layer,
679
+ systemKey: sessionStorage.getItem("systemKey"),
680
+ pageKey: (c = p.value) != null && c.startsWith("/") ? (o = p.value) == null ? void 0 : o.substring(1) : p.value,
681
+ tableId: s
682
+ },
683
+ value: {
684
+ tableData: n
685
+ }
686
+ }, r).then((f) => {
687
+ var v;
688
+ R.value = {
689
+ ...e,
690
+ newId: f,
691
+ password: $.value ? ce((e == null ? void 0 : e.password) ?? I, (v = i == null ? void 0 : i.value) == null ? void 0 : v.privateKey) : e == null ? void 0 : e.password
692
+ }, r && f && y.success(r + "成功");
693
+ }) : r === "编辑" || r === "重置密码" ? D(se, {
694
+ id: e.id,
695
+ key: {
696
+ type: "data",
697
+ layer: n == null ? void 0 : n.layer,
698
+ systemKey: sessionStorage.getItem("systemKey"),
699
+ pageKey: (h = p.value) != null && h.startsWith("/") ? (g = p.value) == null ? void 0 : g.substring(1) : p.value,
700
+ tableId: s
701
+ },
702
+ value: {
703
+ tableData: n
704
+ }
705
+ }, r).then(() => {
706
+ r === "重置密码" && $e(), r && y.success(r + "成功"), A.show = !1;
707
+ }) : r === "删除" && D(re, {
708
+ id: e.id
709
+ }, r).then(() => {
710
+ r && y.success(r + "成功");
711
+ });
712
+ }, De = async (e) => {
713
+ const r = await D(L, {
714
+ key: {
715
+ systemKey: sessionStorage.getItem("systemKey"),
716
+ type: "data",
717
+ pageKey: e
718
+ }
719
+ }, "查询"), s = r == null ? void 0 : r.map((t) => {
720
+ var n, a;
721
+ return {
722
+ id: t.id,
723
+ layer: (n = t.key) == null ? void 0 : n.layer,
724
+ tableData: (a = t == null ? void 0 : t.value) == null ? void 0 : a.tableData
725
+ };
726
+ });
727
+ return s == null ? void 0 : s.map((t) => {
728
+ var n;
729
+ if (!Array.isArray(t == null ? void 0 : t.tableData)) return {
730
+ ...t.tableData,
731
+ layer: (n = t.key) == null ? void 0 : n.layer,
732
+ id: t.id
733
+ };
734
+ });
735
+ }, bt = {
736
+ comp: "Group",
737
+ name: "/系统管理/用户管理",
738
+ compData: [
739
+ {
740
+ key: "groupContents",
741
+ contents: [
742
+ {
743
+ comp: "Table",
744
+ compData: E.value,
745
+ name: ""
746
+ }
747
+ ]
748
+ }
749
+ ]
750
+ }, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
751
+ __proto__: null,
752
+ changedRow: R,
753
+ clickRowButton: vt,
754
+ columns: q,
755
+ compName: Te,
756
+ getPageDataAsync: De,
757
+ handleItemDataChange: gt,
758
+ handleQueryChange: yt,
759
+ handleSubmitAsync: D,
760
+ loginUserIsSuper: $,
761
+ onDoubleClick: pt,
762
+ pageData: E,
763
+ queryFormData: ft,
764
+ refreshUserTableData: $e,
765
+ resetPassword: I,
766
+ structureId: Q,
767
+ submitTableAsyncByVerify: G,
768
+ tempUserPageData: bt
769
+ }, Symbol.toStringTag, { value: "Module" }));
770
+ export {
771
+ Kt as S,
772
+ U as a,
773
+ de as b,
774
+ ve as c,
775
+ be as d,
776
+ De as e,
777
+ D as f,
778
+ ge as g,
779
+ Ae as h,
780
+ tt as i,
781
+ Pt as j,
782
+ I as r,
783
+ G as s,
784
+ le as u
785
+ };