jgy-public-component 0.0.20 → 0.0.21

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.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- import { defineComponent as N, openBlock as d, createElementBlock as S, normalizeClass as U, createCommentVNode as C, renderSlot as z, ref as V, watch as ce, resolveComponent as w, createVNode as p, unref as x, withCtx as u, createElementVNode as b, withModifiers as ee, createBlock as y, Fragment as Z, toDisplayString as B, mergeProps as ve, computed as G, onMounted as ge, onBeforeUnmount as ye, normalizeStyle as ae, createTextVNode as D, useModel as be, renderList as Q, mergeModels as se, createSlots as _e } from "vue";
2
- import { ElMessage as M } from "element-plus";
3
- import { Delete as te, Plus as le, Loading as ie, ZoomIn as we, Search as ke, Refresh as $e, ArrowDown as me } from "@element-plus/icons-vue";
4
- import je from "vuedraggable";
5
- import { Icon as Ce } from "@iconify/vue";
1
+ import { defineComponent as z, openBlock as r, createElementBlock as x, normalizeClass as U, createCommentVNode as C, renderSlot as D, ref as M, watch as ye, createVNode as f, unref as n, withCtx as d, createElementVNode as k, withModifiers as te, createBlock as y, Fragment as G, toDisplayString as I, mergeProps as xe, computed as Q, onMounted as Ie, onBeforeUnmount as Re, normalizeStyle as oe, createTextVNode as A, useModel as Se, renderList as Y, mergeModels as re, resolveComponent as Me, createSlots as Be } from "vue";
2
+ import { ElImage as ce, ElIcon as P, ElUpload as le, ElImageViewer as Ae, ElMessage as S, ElCard as be, ElForm as Te, ElButton as _, ElDialog as Ve, ElDivider as Fe, ElLink as De, ElRow as me, ElCol as X, ElTable as Je, ElTableColumn as ae, ElSubMenu as _e, ElMenuItem as ke, ElMenu as we, ElDropdown as Le, ElDropdownMenu as Pe, ElDropdownItem as fe } from "element-plus";
3
+ import { Delete as ne, Plus as se, Loading as pe, ZoomIn as ze, Search as Oe, Refresh as He, ArrowDown as Ce } from "@element-plus/icons-vue";
4
+ import Ne from "vuedraggable";
5
+ import { Icon as Ue } from "@iconify/vue";
6
6
  import * as q from "xlsx";
7
- import ne from "nprogress";
8
- const xe = ["disabled"], Re = {
7
+ import ie from "nprogress";
8
+ const We = ["disabled"], qe = {
9
9
  key: 0,
10
10
  class: "j-button__loading-icon"
11
- }, Ie = {
11
+ }, Ke = {
12
12
  key: 1,
13
13
  class: "j-button__text"
14
- }, Se = /* @__PURE__ */ N({
14
+ }, Xe = /* @__PURE__ */ z({
15
15
  __name: "JButton",
16
16
  props: {
17
17
  type: { default: "default" },
@@ -22,12 +22,12 @@ const xe = ["disabled"], Re = {
22
22
  loading: { type: Boolean, default: !1 }
23
23
  },
24
24
  emits: ["click"],
25
- setup(e, { emit: a }) {
26
- const t = e, n = a;
27
- function l(o) {
28
- !t.disabled && !t.loading && n("click", o);
25
+ setup(e, { emit: s }) {
26
+ const t = e, l = s;
27
+ function a(i) {
28
+ !t.disabled && !t.loading && l("click", i);
29
29
  }
30
- return (o, i) => (d(), S("button", {
30
+ return (i, u) => (r(), x("button", {
31
31
  class: U(["j-button", [
32
32
  `j-button--${e.type}`,
33
33
  `j-button--${e.size}`,
@@ -39,29 +39,29 @@ const xe = ["disabled"], Re = {
39
39
  }
40
40
  ]]),
41
41
  disabled: e.disabled || e.loading,
42
- onClick: l
42
+ onClick: a
43
43
  }, [
44
- e.loading ? (d(), S("span", Re)) : C("", !0),
45
- o.$slots.default ? (d(), S("span", Ie, [
46
- z(o.$slots, "default", {}, void 0, !0)
44
+ e.loading ? (r(), x("span", qe)) : C("", !0),
45
+ i.$slots.default ? (r(), x("span", Ke, [
46
+ D(i.$slots, "default", {}, void 0, !0)
47
47
  ])) : C("", !0)
48
- ], 10, xe));
48
+ ], 10, We));
49
49
  }
50
- }), W = (e, a) => {
50
+ }), W = (e, s) => {
51
51
  const t = e.__vccOpts || e;
52
- for (const [n, l] of a)
53
- t[n] = l;
52
+ for (const [l, a] of s)
53
+ t[l] = a;
54
54
  return t;
55
- }, Be = /* @__PURE__ */ W(Se, [["__scopeId", "data-v-22864824"]]), Me = { class: "j-upload-img-container" }, Ae = {
55
+ }, Ze = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-22864824"]]), Ge = { class: "j-upload-img-container" }, Qe = {
56
56
  key: 0,
57
57
  class: "images-wrapper"
58
- }, Ee = { class: "image-item" }, Te = ["onClick"], Ve = {
58
+ }, Ye = { class: "image-item" }, et = ["onClick"], tt = {
59
59
  key: 0,
60
60
  class: "image-item single-image-item"
61
- }, Fe = { class: "image-actions" }, Je = {
61
+ }, at = { class: "image-actions" }, lt = {
62
62
  key: 2,
63
63
  class: "upload-tip"
64
- }, De = { key: 0 }, Le = /* @__PURE__ */ N({
64
+ }, nt = { key: 0 }, st = /* @__PURE__ */ z({
65
65
  name: "JUploadImg",
66
66
  __name: "JUploadImg",
67
67
  props: {
@@ -76,188 +76,185 @@ const xe = ["disabled"], Re = {
76
76
  uploadFn: { type: Function, default: void 0 }
77
77
  },
78
78
  emits: ["update:modelValue", "success", "error"],
79
- setup(e, { emit: a }) {
80
- const t = e, n = a, l = V(""), o = V(!1), i = t.showTip, r = () => {
81
- o.value = !0;
79
+ setup(e, { emit: s }) {
80
+ const t = e, l = s, a = M(""), i = M(!1), u = t.showTip, m = () => {
81
+ i.value = !0;
82
82
  }, c = () => {
83
- l.value = "", n("update:modelValue", ""), M.success("删除成功");
84
- }, h = V([]), _ = V(!1), P = (m) => {
85
- h.value = m.map((f, s) => ({
86
- uid: Date.now() + s,
87
- url: f
83
+ a.value = "", l("update:modelValue", ""), S.success("删除成功");
84
+ }, v = M([]), p = M(!1), J = (E) => {
85
+ v.value = E.map((h, o) => ({
86
+ uid: Date.now() + o,
87
+ url: h
88
88
  }));
89
89
  };
90
- ce(() => t.modelValue, (m) => {
91
- t.multiple ? Array.isArray(m) && m.length > 0 ? P(m) : h.value = [] : typeof m == "string" ? l.value = m : l.value = "";
90
+ ye(() => t.modelValue, (E) => {
91
+ t.multiple ? Array.isArray(E) && E.length > 0 ? J(E) : v.value = [] : typeof E == "string" ? a.value = E : a.value = "";
92
92
  }, { immediate: !0 });
93
93
  const T = () => {
94
- F();
95
- }, $ = (m) => {
96
- h.value.splice(m, 1), F(), M.success("删除成功");
97
- }, g = async (m) => {
98
- const f = m.raw;
99
- if (!f) {
100
- M.error("文件不存在,请重试");
94
+ B();
95
+ }, $ = (E) => {
96
+ v.value.splice(E, 1), B(), S.success("删除成功");
97
+ }, b = async (E) => {
98
+ const h = E.raw;
99
+ if (!h) {
100
+ S.error("文件不存在,请重试");
101
101
  return;
102
102
  }
103
- if (f.size > t.maxSize * 1024 * 1024) {
104
- M.error(`图片大小不能超过 ${t.maxSize}MB`);
103
+ if (h.size > t.maxSize * 1024 * 1024) {
104
+ S.error(`图片大小不能超过 ${t.maxSize}MB`);
105
105
  return;
106
106
  }
107
107
  if (!t.uploadFn) {
108
- M.error("未配置上传函数 (uploadFn)");
108
+ S.error("未配置上传函数 (uploadFn)");
109
109
  return;
110
110
  }
111
111
  try {
112
- _.value = !0;
113
- const s = await t.uploadFn(f);
114
- t.multiple ? (h.value.push({ uid: Date.now(), url: s }), F()) : (l.value = s, n("update:modelValue", s)), n("success", s), M.success("上传成功");
115
- } catch (s) {
116
- console.error("上传出错:", s), M.error("上传失败,请重试"), n("error", s);
112
+ p.value = !0;
113
+ const o = await t.uploadFn(h);
114
+ t.multiple ? (v.value.push({ uid: Date.now(), url: o }), B()) : (a.value = o, l("update:modelValue", o)), l("success", o), S.success("上传成功");
115
+ } catch (o) {
116
+ console.error("上传出错:", o), S.error("上传失败,请重试"), l("error", o);
117
117
  } finally {
118
- _.value = !1;
118
+ p.value = !1;
119
119
  }
120
- }, F = () => {
121
- const m = h.value.map((f) => f.url);
122
- n("update:modelValue", m);
120
+ }, B = () => {
121
+ const E = v.value.map((h) => h.url);
122
+ l("update:modelValue", E);
123
123
  };
124
- return (m, f) => {
125
- const s = w("el-image"), j = w("el-icon"), R = w("el-upload"), v = w("el-image-viewer");
126
- return d(), S("div", Me, [
127
- e.multiple ? (d(), S("div", Ae, [
128
- p(x(je), {
129
- modelValue: h.value,
130
- "onUpdate:modelValue": f[0] || (f[0] = (E) => h.value = E),
131
- class: "images-list",
132
- "item-key": "uid",
133
- animation: 200,
134
- disabled: e.disabled,
135
- onEnd: T
136
- }, {
137
- item: u(({ element: E, index: k }) => [
138
- b("div", Ee, [
139
- p(s, {
140
- src: E.url,
141
- "preview-src-list": h.value.map((A) => A.url),
142
- "initial-index": k,
143
- fit: "cover",
144
- class: "image-preview",
145
- "preview-teleported": !0,
146
- "hide-on-click-modal": !0
147
- }, null, 8, ["src", "preview-src-list", "initial-index"]),
148
- e.disabled ? C("", !0) : (d(), S("div", {
149
- key: 0,
150
- class: "delete-btn",
151
- onClick: ee((A) => $(k), ["stop"])
152
- }, [
153
- p(j, { class: "icon-delete" }, {
154
- default: u(() => [
155
- p(x(te))
156
- ]),
157
- _: 1
158
- })
159
- ], 8, Te))
160
- ])
161
- ]),
162
- _: 1
163
- }, 8, ["modelValue", "disabled"]),
164
- !e.disabled && (!e.limit || h.value.length < e.limit) ? (d(), y(R, {
165
- key: 0,
166
- class: "image-uploader",
167
- "auto-upload": !1,
168
- "show-file-list": !1,
169
- "on-change": g,
170
- disabled: _.value,
171
- "list-type": "picture-card",
172
- accept: e.accept
173
- }, {
174
- default: u(() => [
175
- _.value ? (d(), y(j, {
176
- key: 1,
177
- class: "uploader-icon is-loading"
178
- }, {
179
- default: u(() => [
180
- p(x(ie))
181
- ]),
182
- _: 1
183
- })) : (d(), y(j, {
184
- key: 0,
185
- class: "uploader-icon"
186
- }, {
187
- default: u(() => [
188
- p(x(le))
189
- ]),
190
- _: 1
191
- }))
192
- ]),
193
- _: 1
194
- }, 8, ["disabled", "accept"])) : C("", !0)
195
- ])) : (d(), S(Z, { key: 1 }, [
196
- l.value ? (d(), S("div", Ve, [
197
- p(s, {
198
- src: l.value,
199
- fit: "cover",
200
- class: "image-preview"
201
- }, null, 8, ["src"]),
202
- b("div", Fe, [
203
- p(j, {
204
- class: "action-icon",
205
- onClick: ee(r, ["stop"])
206
- }, {
207
- default: u(() => [
208
- p(x(we))
209
- ]),
210
- _: 1
211
- }),
212
- e.disabled ? C("", !0) : (d(), y(j, {
124
+ return (E, h) => (r(), x("div", Ge, [
125
+ e.multiple ? (r(), x("div", Qe, [
126
+ f(n(Ne), {
127
+ modelValue: v.value,
128
+ "onUpdate:modelValue": h[0] || (h[0] = (o) => v.value = o),
129
+ class: "images-list",
130
+ "item-key": "uid",
131
+ animation: 200,
132
+ disabled: e.disabled,
133
+ onEnd: T
134
+ }, {
135
+ item: d(({ element: o, index: w }) => [
136
+ k("div", Ye, [
137
+ f(n(ce), {
138
+ src: o.url,
139
+ "preview-src-list": v.value.map((R) => R.url),
140
+ "initial-index": w,
141
+ fit: "cover",
142
+ class: "image-preview",
143
+ "preview-teleported": !0,
144
+ "hide-on-click-modal": !0
145
+ }, null, 8, ["src", "preview-src-list", "initial-index"]),
146
+ e.disabled ? C("", !0) : (r(), x("div", {
213
147
  key: 0,
214
- class: "action-icon",
215
- onClick: ee(c, ["stop"])
216
- }, {
217
- default: u(() => [
218
- p(x(te))
219
- ]),
220
- _: 1
221
- }))
148
+ class: "delete-btn",
149
+ onClick: te((R) => $(w), ["stop"])
150
+ }, [
151
+ f(n(P), { class: "icon-delete" }, {
152
+ default: d(() => [
153
+ f(n(ne))
154
+ ]),
155
+ _: 1
156
+ })
157
+ ], 8, et))
222
158
  ])
223
- ])) : (d(), y(R, {
224
- key: 1,
225
- class: "image-uploader",
226
- "auto-upload": !1,
227
- "show-file-list": !1,
228
- "on-change": g,
229
- disabled: e.disabled || _.value,
230
- accept: e.accept,
231
- "list-type": "picture-card"
232
- }, {
233
- default: u(() => [
234
- p(j, { class: "uploader-icon" }, {
235
- default: u(() => [
236
- _.value ? (d(), y(x(ie), {
237
- key: 1,
238
- class: "is-loading"
239
- })) : (d(), y(x(le), { key: 0 }))
240
- ]),
241
- _: 1
242
- })
243
- ]),
244
- _: 1
245
- }, 8, ["disabled", "accept"])),
246
- o.value ? (d(), y(v, {
247
- key: 2,
248
- "url-list": [l.value],
249
- teleported: !0,
250
- onClose: f[1] || (f[1] = (E) => o.value = !1)
251
- }, null, 8, ["url-list"])) : C("", !0)
252
- ], 64)),
253
- x(i) ? (d(), S("div", Je, [
254
- b("span", null, B(e.tip), 1),
255
- e.multiple && e.limit ? (d(), S("span", De, " (最多 " + B(e.limit) + " 张)", 1)) : C("", !0)
256
- ])) : C("", !0)
257
- ]);
258
- };
159
+ ]),
160
+ _: 1
161
+ }, 8, ["modelValue", "disabled"]),
162
+ !e.disabled && (!e.limit || v.value.length < e.limit) ? (r(), y(n(le), {
163
+ key: 0,
164
+ class: "image-uploader",
165
+ "auto-upload": !1,
166
+ "show-file-list": !1,
167
+ "on-change": b,
168
+ disabled: p.value,
169
+ "list-type": "picture-card",
170
+ accept: e.accept
171
+ }, {
172
+ default: d(() => [
173
+ p.value ? (r(), y(n(P), {
174
+ key: 1,
175
+ class: "uploader-icon is-loading"
176
+ }, {
177
+ default: d(() => [
178
+ f(n(pe))
179
+ ]),
180
+ _: 1
181
+ })) : (r(), y(n(P), {
182
+ key: 0,
183
+ class: "uploader-icon"
184
+ }, {
185
+ default: d(() => [
186
+ f(n(se))
187
+ ]),
188
+ _: 1
189
+ }))
190
+ ]),
191
+ _: 1
192
+ }, 8, ["disabled", "accept"])) : C("", !0)
193
+ ])) : (r(), x(G, { key: 1 }, [
194
+ a.value ? (r(), x("div", tt, [
195
+ f(n(ce), {
196
+ src: a.value,
197
+ fit: "cover",
198
+ class: "image-preview"
199
+ }, null, 8, ["src"]),
200
+ k("div", at, [
201
+ f(n(P), {
202
+ class: "action-icon",
203
+ onClick: te(m, ["stop"])
204
+ }, {
205
+ default: d(() => [
206
+ f(n(ze))
207
+ ]),
208
+ _: 1
209
+ }),
210
+ e.disabled ? C("", !0) : (r(), y(n(P), {
211
+ key: 0,
212
+ class: "action-icon",
213
+ onClick: te(c, ["stop"])
214
+ }, {
215
+ default: d(() => [
216
+ f(n(ne))
217
+ ]),
218
+ _: 1
219
+ }))
220
+ ])
221
+ ])) : (r(), y(n(le), {
222
+ key: 1,
223
+ class: "image-uploader",
224
+ "auto-upload": !1,
225
+ "show-file-list": !1,
226
+ "on-change": b,
227
+ disabled: e.disabled || p.value,
228
+ accept: e.accept,
229
+ "list-type": "picture-card"
230
+ }, {
231
+ default: d(() => [
232
+ f(n(P), { class: "uploader-icon" }, {
233
+ default: d(() => [
234
+ p.value ? (r(), y(n(pe), {
235
+ key: 1,
236
+ class: "is-loading"
237
+ })) : (r(), y(n(se), { key: 0 }))
238
+ ]),
239
+ _: 1
240
+ })
241
+ ]),
242
+ _: 1
243
+ }, 8, ["disabled", "accept"])),
244
+ i.value ? (r(), y(n(Ae), {
245
+ key: 2,
246
+ "url-list": [a.value],
247
+ teleported: !0,
248
+ onClose: h[1] || (h[1] = (o) => i.value = !1)
249
+ }, null, 8, ["url-list"])) : C("", !0)
250
+ ], 64)),
251
+ n(u) ? (r(), x("div", lt, [
252
+ k("span", null, I(e.tip), 1),
253
+ e.multiple && e.limit ? (r(), x("span", nt, " (最多 " + I(e.limit) + " 张)", 1)) : C("", !0)
254
+ ])) : C("", !0)
255
+ ]));
259
256
  }
260
- }), Pe = /* @__PURE__ */ W(Le, [["__scopeId", "data-v-94fad0af"]]), X = /* @__PURE__ */ N({
257
+ }), it = /* @__PURE__ */ W(st, [["__scopeId", "data-v-7dc4f798"]]), Z = /* @__PURE__ */ z({
261
258
  name: "JIconRender",
262
259
  __name: "JIconRender",
263
260
  props: {
@@ -265,14 +262,14 @@ const xe = ["disabled"], Re = {
265
262
  size: { default: 24 }
266
263
  },
267
264
  setup(e) {
268
- return (a, t) => e.icon ? (d(), y(x(Ce), ve({
265
+ return (s, t) => e.icon ? (r(), y(n(Ue), xe({
269
266
  key: 0,
270
267
  icon: e.icon,
271
268
  width: e.size,
272
269
  height: e.size
273
- }, a.$attrs), null, 16, ["icon", "width", "height"])) : C("", !0);
270
+ }, s.$attrs), null, 16, ["icon", "width", "height"])) : C("", !0);
274
271
  }
275
- }), ze = { class: "action-left" }, Oe = /* @__PURE__ */ N({
272
+ }), ot = { class: "action-left" }, ut = /* @__PURE__ */ z({
276
273
  name: "JSearchHeader",
277
274
  __name: "JSearchHeader",
278
275
  props: {
@@ -285,145 +282,142 @@ const xe = ["disabled"], Re = {
285
282
  showReset: { type: Boolean, default: !0 }
286
283
  },
287
284
  emits: ["search", "reset", "add", "batchDelete"],
288
- setup(e, { emit: a }) {
289
- const t = e, n = a, l = V(), o = V(!1), i = V(!1), r = V(0), c = V(0), h = G(() => r.value > t.defaultVisible), _ = () => {
290
- if (!l.value) return;
291
- const $ = Array.from(l.value.children);
292
- r.value = $.length;
293
- const g = $[t.defaultVisible - 1];
294
- if (g && l.value) {
295
- const F = l.value.getBoundingClientRect(), m = g.getBoundingClientRect();
296
- c.value = m.bottom - F.top;
285
+ setup(e, { emit: s }) {
286
+ const t = e, l = s, a = M(), i = M(!1), u = M(!1), m = M(0), c = M(0), v = Q(() => m.value > t.defaultVisible), p = () => {
287
+ if (!a.value) return;
288
+ const $ = Array.from(a.value.children);
289
+ m.value = $.length;
290
+ const b = $[t.defaultVisible - 1];
291
+ if (b && a.value) {
292
+ const B = a.value.getBoundingClientRect(), E = b.getBoundingClientRect();
293
+ c.value = E.bottom - B.top;
297
294
  }
298
- }, P = () => {
299
- const $ = l.value;
295
+ }, J = () => {
296
+ const $ = a.value;
300
297
  if ($)
301
- if (o.value)
302
- _(), o.value = !1, $.style.maxHeight = $.scrollHeight + "px", $.offsetHeight, $.style.maxHeight = c.value + "px";
298
+ if (i.value)
299
+ p(), i.value = !1, $.style.maxHeight = $.scrollHeight + "px", $.offsetHeight, $.style.maxHeight = c.value + "px";
303
300
  else {
304
- o.value = !0, $.style.maxHeight = $.scrollHeight + "px";
305
- const g = () => {
306
- $.style.maxHeight = "none", $.removeEventListener("transitionend", g);
301
+ i.value = !0, $.style.maxHeight = $.scrollHeight + "px";
302
+ const b = () => {
303
+ $.style.maxHeight = "none", $.removeEventListener("transitionend", b);
307
304
  };
308
- $.addEventListener("transitionend", g);
305
+ $.addEventListener("transitionend", b);
309
306
  }
310
307
  };
311
308
  let T = null;
312
- return ge(() => {
313
- _(), h.value && l.value && (l.value.style.maxHeight = c.value + "px"), requestAnimationFrame(() => {
309
+ return Ie(() => {
310
+ p(), v.value && a.value && (a.value.style.maxHeight = c.value + "px"), requestAnimationFrame(() => {
314
311
  requestAnimationFrame(() => {
315
- i.value = !0;
312
+ u.value = !0;
316
313
  });
317
- }), l.value && (T = new MutationObserver(() => {
318
- _(), h.value && !o.value && l.value && (l.value.style.maxHeight = c.value + "px");
319
- }), T.observe(l.value, { childList: !0 }));
320
- }), ye(() => {
314
+ }), a.value && (T = new MutationObserver(() => {
315
+ p(), v.value && !i.value && a.value && (a.value.style.maxHeight = c.value + "px");
316
+ }), T.observe(a.value, { childList: !0 }));
317
+ }), Re(() => {
321
318
  T == null || T.disconnect();
322
- }), ($, g) => {
323
- const F = w("el-form"), m = w("el-button"), f = w("el-icon"), s = w("el-card");
324
- return d(), y(s, {
325
- shadow: "never",
326
- class: "j-search-header-card"
327
- }, {
328
- default: u(() => [
329
- p(F, {
330
- inline: "",
331
- class: "search-form"
332
- }, {
333
- default: u(() => [
334
- b("div", {
335
- ref_key: "formItemsRef",
336
- ref: l,
337
- class: U(["form-items-wrapper", { "is-animated": i.value }])
338
- }, [
339
- z($.$slots, "default", {}, void 0, !0)
340
- ], 2)
341
- ]),
342
- _: 3
343
- }),
344
- b("div", {
345
- class: "action-bar",
346
- style: ae({ marginTop: o.value ? "0px" : "10px" })
347
- }, [
348
- b("div", ze, [
349
- e.showAdd ? (d(), y(m, {
350
- key: 0,
351
- type: "primary",
352
- icon: x(le),
353
- onClick: g[0] || (g[0] = (j) => n("add"))
354
- }, {
355
- default: u(() => [
356
- D(B(e.addText), 1)
357
- ]),
358
- _: 1
359
- }, 8, ["icon"])) : C("", !0),
360
- e.showBatchDelete ? (d(), y(m, {
361
- key: 1,
362
- type: "danger",
363
- icon: x(te),
364
- disabled: e.selectedCount === 0,
365
- onClick: g[1] || (g[1] = (j) => n("batchDelete"))
366
- }, {
367
- default: u(() => [
368
- D(" 批量删除" + B(e.selectedCount ? `(${e.selectedCount})` : ""), 1)
369
- ]),
370
- _: 1
371
- }, 8, ["icon", "disabled"])) : C("", !0),
372
- e.showSearch ? (d(), y(m, {
373
- key: 2,
374
- type: "primary",
375
- icon: x(ke),
376
- onClick: g[2] || (g[2] = (j) => n("search"))
377
- }, {
378
- default: u(() => [...g[4] || (g[4] = [
379
- D("搜索", -1)
380
- ])]),
381
- _: 1
382
- }, 8, ["icon"])) : C("", !0),
383
- e.showReset ? (d(), y(m, {
384
- key: 3,
385
- icon: x($e),
386
- onClick: g[3] || (g[3] = (j) => n("reset"))
387
- }, {
388
- default: u(() => [...g[5] || (g[5] = [
389
- D("重置", -1)
390
- ])]),
391
- _: 1
392
- }, 8, ["icon"])) : C("", !0),
393
- z($.$slots, "actions", {}, void 0, !0)
394
- ]),
395
- h.value ? (d(), y(m, {
319
+ }), ($, b) => (r(), y(n(be), {
320
+ shadow: "never",
321
+ class: "j-search-header-card"
322
+ }, {
323
+ default: d(() => [
324
+ f(n(Te), {
325
+ inline: "",
326
+ class: "search-form"
327
+ }, {
328
+ default: d(() => [
329
+ k("div", {
330
+ ref_key: "formItemsRef",
331
+ ref: a,
332
+ class: U(["form-items-wrapper", { "is-animated": u.value }])
333
+ }, [
334
+ D($.$slots, "default", {}, void 0, !0)
335
+ ], 2)
336
+ ]),
337
+ _: 3
338
+ }),
339
+ k("div", {
340
+ class: "action-bar",
341
+ style: oe({ marginTop: i.value ? "0px" : "10px" })
342
+ }, [
343
+ k("div", ot, [
344
+ e.showAdd ? (r(), y(n(_), {
396
345
  key: 0,
397
- link: "",
398
346
  type: "primary",
399
- onClick: P
347
+ icon: n(se),
348
+ onClick: b[0] || (b[0] = (B) => l("add"))
400
349
  }, {
401
- default: u(() => [
402
- D(B(o.value ? "收起" : "展开") + " ", 1),
403
- p(f, {
404
- class: U(["toggle-icon", { "is-expanded": o.value }])
405
- }, {
406
- default: u(() => [
407
- p(x(me))
408
- ]),
409
- _: 1
410
- }, 8, ["class"])
350
+ default: d(() => [
351
+ A(I(e.addText), 1)
411
352
  ]),
412
353
  _: 1
413
- })) : C("", !0)
414
- ], 4)
415
- ]),
416
- _: 3
417
- });
418
- };
354
+ }, 8, ["icon"])) : C("", !0),
355
+ e.showBatchDelete ? (r(), y(n(_), {
356
+ key: 1,
357
+ type: "danger",
358
+ icon: n(ne),
359
+ disabled: e.selectedCount === 0,
360
+ onClick: b[1] || (b[1] = (B) => l("batchDelete"))
361
+ }, {
362
+ default: d(() => [
363
+ A(" 批量删除" + I(e.selectedCount ? `(${e.selectedCount})` : ""), 1)
364
+ ]),
365
+ _: 1
366
+ }, 8, ["icon", "disabled"])) : C("", !0),
367
+ e.showSearch ? (r(), y(n(_), {
368
+ key: 2,
369
+ type: "primary",
370
+ icon: n(Oe),
371
+ onClick: b[2] || (b[2] = (B) => l("search"))
372
+ }, {
373
+ default: d(() => [...b[4] || (b[4] = [
374
+ A("搜索", -1)
375
+ ])]),
376
+ _: 1
377
+ }, 8, ["icon"])) : C("", !0),
378
+ e.showReset ? (r(), y(n(_), {
379
+ key: 3,
380
+ icon: n(He),
381
+ onClick: b[3] || (b[3] = (B) => l("reset"))
382
+ }, {
383
+ default: d(() => [...b[5] || (b[5] = [
384
+ A("重置", -1)
385
+ ])]),
386
+ _: 1
387
+ }, 8, ["icon"])) : C("", !0),
388
+ D($.$slots, "actions", {}, void 0, !0)
389
+ ]),
390
+ v.value ? (r(), y(n(_), {
391
+ key: 0,
392
+ link: "",
393
+ type: "primary",
394
+ onClick: J
395
+ }, {
396
+ default: d(() => [
397
+ A(I(i.value ? "收起" : "展开") + " ", 1),
398
+ f(n(P), {
399
+ class: U(["toggle-icon", { "is-expanded": i.value }])
400
+ }, {
401
+ default: d(() => [
402
+ f(n(Ce))
403
+ ]),
404
+ _: 1
405
+ }, 8, ["class"])
406
+ ]),
407
+ _: 1
408
+ })) : C("", !0)
409
+ ], 4)
410
+ ]),
411
+ _: 3
412
+ }));
419
413
  }
420
- }), He = /* @__PURE__ */ W(Oe, [["__scopeId", "data-v-d3f83c3f"]]), Ne = { class: "j-import-upload-row" }, Ue = { class: "j-import-stat-num" }, We = { class: "j-import-stat-num" }, qe = { class: "j-import-stat-num" }, Ke = {
414
+ }), dt = /* @__PURE__ */ W(ut, [["__scopeId", "data-v-c1f4bf4c"]]), rt = { class: "j-import-upload-row" }, ct = { class: "j-import-stat-num" }, mt = { class: "j-import-stat-num" }, ft = { class: "j-import-stat-num" }, pt = {
421
415
  key: 0,
422
416
  class: "j-import-status-fail"
423
- }, Xe = { key: 1 }, Ze = /* @__PURE__ */ N({
417
+ }, ht = { key: 1 }, vt = /* @__PURE__ */ z({
424
418
  name: "JImportExcel",
425
419
  __name: "JImportExcel",
426
- props: /* @__PURE__ */ se({
420
+ props: /* @__PURE__ */ re({
427
421
  getFieldListApi: {},
428
422
  importApi: {},
429
423
  excludeFields: { default: () => ["id", "ctime", "mtime"] },
@@ -432,266 +426,263 @@ const xe = ["disabled"], Re = {
432
426
  modelValue: { type: Boolean, default: !1 },
433
427
  modelModifiers: {}
434
428
  }),
435
- emits: /* @__PURE__ */ se(["success"], ["update:modelValue"]),
436
- setup(e, { emit: a }) {
437
- const t = e, n = a, l = be(e, "modelValue"), o = V(!1), i = V({}), r = V([]), c = V({ total: 0, success: 0, fail: 0 }), h = {
429
+ emits: /* @__PURE__ */ re(["success"], ["update:modelValue"]),
430
+ setup(e, { emit: s }) {
431
+ const t = e, l = s, a = Se(e, "modelValue"), i = M(!1), u = M({}), m = M([]), c = M({ total: 0, success: 0, fail: 0 }), v = {
438
432
  0: "待创建",
439
433
  1: "创建成功",
440
434
  2: "创建中",
441
435
  [-1]: "创建失败"
442
- }, _ = G(() => Object.entries(i.value).filter(([f]) => !t.excludeFields.includes(f)).map(([f, s]) => ({ id: f, label: s, prop: f }))), P = async () => {
436
+ }, p = Q(() => Object.entries(u.value).filter(([h]) => !t.excludeFields.includes(h)).map(([h, o]) => ({ id: h, label: o, prop: h }))), J = async () => {
443
437
  try {
444
- const f = await t.getFieldListApi();
445
- i.value = f.data.tableFieldsInfo ?? {};
438
+ const h = await t.getFieldListApi();
439
+ u.value = h.data.tableFieldsInfo ?? {};
446
440
  } catch {
447
- M.error("获取字段列表失败");
441
+ S.error("获取字段列表失败");
448
442
  }
449
- }, T = (f) => {
450
- const s = f.raw;
451
- if (!s) return;
443
+ }, T = (h) => {
444
+ const o = h.raw;
445
+ if (!o) return;
452
446
  if (![
453
447
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
454
448
  "application/vnd.ms-excel"
455
- ].includes(s.type) && !s.name.match(/\.xlsx?$/i)) {
456
- M.warning("请上传 .xlsx 或 .xls 格式文件");
449
+ ].includes(o.type) && !o.name.match(/\.xlsx?$/i)) {
450
+ S.warning("请上传 .xlsx 或 .xls 格式文件");
457
451
  return;
458
452
  }
459
453
  const R = new FileReader();
460
- R.onload = (v) => {
454
+ R.onload = (g) => {
461
455
  try {
462
- const E = q.read(v.target.result, { type: "binary" }), k = E.SheetNames[0], A = E.Sheets[k], O = q.utils.sheet_to_json(A, {
456
+ const L = q.read(g.target.result, { type: "binary" }), j = L.SheetNames[0], O = L.Sheets[j], K = q.utils.sheet_to_json(O, {
463
457
  header: 1,
464
458
  defval: ""
465
- }).slice(1).filter((H) => H.some((I) => I !== ""));
466
- if (!O.length) {
467
- M.warning("文件内容为空");
459
+ }).slice(1).filter((H) => H.some((N) => N !== ""));
460
+ if (!K.length) {
461
+ S.warning("文件内容为空");
468
462
  return;
469
463
  }
470
- const L = O.map((H) => {
471
- const I = { _status: 0, _error: "" };
472
- return _.value.forEach((K, Y) => {
473
- I[K.prop] = H[Y] !== void 0 ? H[Y] : "";
474
- }), I;
464
+ const F = K.map((H) => {
465
+ const N = { _status: 0, _error: "" };
466
+ return p.value.forEach((ee, de) => {
467
+ N[ee.prop] = H[de] !== void 0 ? H[de] : "";
468
+ }), N;
475
469
  });
476
- r.value = L, c.value = { total: L.length, success: 0, fail: 0 };
470
+ m.value = F, c.value = { total: F.length, success: 0, fail: 0 };
477
471
  } catch {
478
- M.error("解析文件失败,请检查文件格式");
472
+ S.error("解析文件失败,请检查文件格式");
479
473
  }
480
- }, R.readAsBinaryString(s);
481
- }, $ = (f) => {
482
- r.value.splice(f, 1), c.value.total = r.value.length;
483
- }, g = async () => {
484
- const f = r.value.filter((s) => s._status === 0).map(({ _status: s, _error: j, ...R }) => R);
485
- if (!f.length) {
486
- M.warning("没有可导入的数据");
474
+ }, R.readAsBinaryString(o);
475
+ }, $ = (h) => {
476
+ m.value.splice(h, 1), c.value.total = m.value.length;
477
+ }, b = async () => {
478
+ const h = m.value.filter((o) => o._status === 0).map(({ _status: o, _error: w, ...R }) => R);
479
+ if (!h.length) {
480
+ S.warning("没有可导入的数据");
487
481
  return;
488
482
  }
489
- o.value = !0;
483
+ i.value = !0;
490
484
  try {
491
- const s = await t.importApi(f);
492
- s.code === 1 ? (r.value.forEach((j) => {
493
- j._status === 0 && (j._status = 1);
494
- }), c.value.success = r.value.filter((j) => j._status === 1).length, M.success("导入成功"), n("success")) : M.error(s.msg || "导入失败");
485
+ const o = await t.importApi(h);
486
+ o.code === 1 ? (m.value.forEach((w) => {
487
+ w._status === 0 && (w._status = 1);
488
+ }), c.value.success = m.value.filter((w) => w._status === 1).length, S.success("导入成功"), l("success")) : S.error(o.msg || "导入失败");
495
489
  } catch {
496
- M.error("导入失败,请重试");
490
+ S.error("导入失败,请重试");
497
491
  } finally {
498
- o.value = !1;
492
+ i.value = !1;
499
493
  }
500
- }, F = () => {
494
+ }, B = () => {
501
495
  try {
502
- const f = q.utils.book_new(), s = _.value.map((v) => v.label), j = {};
503
- s.forEach((v) => j[v] = "");
504
- const R = q.utils.json_to_sheet([j]);
505
- q.utils.book_append_sheet(f, R, "模板"), q.writeFile(f, "导入模板.xlsx");
496
+ const h = q.utils.book_new(), o = p.value.map((g) => g.label), w = {};
497
+ o.forEach((g) => w[g] = "");
498
+ const R = q.utils.json_to_sheet([w]);
499
+ q.utils.book_append_sheet(h, R, "模板"), q.writeFile(h, "导入模板.xlsx");
506
500
  } catch {
507
- M.error("模板下载失败");
501
+ S.error("模板下载失败");
508
502
  }
509
- }, m = () => {
510
- o.value || (l.value = !1, r.value = [], c.value = { total: 0, success: 0, fail: 0 });
503
+ }, E = () => {
504
+ i.value || (a.value = !1, m.value = [], c.value = { total: 0, success: 0, fail: 0 });
511
505
  };
512
- return (f, s) => {
513
- const j = w("el-divider"), R = w("el-button"), v = w("el-upload"), E = w("el-link"), k = w("el-card"), A = w("el-col"), J = w("el-row"), O = w("el-table-column"), L = w("el-table"), H = w("el-dialog");
514
- return d(), y(H, {
515
- modelValue: l.value,
516
- "onUpdate:modelValue": s[0] || (s[0] = (I) => l.value = I),
517
- title: t.title,
518
- width: "900px",
519
- "close-on-click-modal": !1,
520
- onOpen: P,
521
- onClose: m
522
- }, {
523
- footer: u(() => [
524
- p(R, { onClick: m }, {
525
- default: u(() => [...s[9] || (s[9] = [
526
- D("关闭", -1)
527
- ])]),
528
- _: 1
529
- })
530
- ]),
531
- default: u(() => [
532
- p(k, {
533
- shadow: "never",
534
- class: "j-import-upload-card"
535
- }, {
536
- default: u(() => [
537
- s[3] || (s[3] = b("div", { class: "j-import-upload-card-title" }, "导入 EXCEL", -1)),
538
- p(j, { style: { margin: "10px 0" } }),
539
- b("div", Ne, [
540
- p(v, {
541
- accept: ".xlsx,.xls",
542
- "auto-upload": !1,
543
- "show-file-list": !1,
544
- "on-change": T
545
- }, {
546
- default: u(() => [
547
- p(R, { size: "small" }, {
548
- default: u(() => [...s[1] || (s[1] = [
549
- D("点击上传", -1)
550
- ])]),
551
- _: 1
552
- })
553
- ]),
554
- _: 1
555
- }),
556
- _.value.length ? (d(), y(E, {
557
- key: 0,
558
- type: "primary",
559
- class: "j-import-no-wrap",
560
- onClick: F
561
- }, {
562
- default: u(() => [...s[2] || (s[2] = [
563
- D(" 下载导入模板.xlsx ", -1)
564
- ])]),
565
- _: 1
566
- })) : C("", !0)
567
- ])
568
- ]),
569
- _: 1
570
- }),
571
- p(J, {
572
- class: "j-import-stats-row",
573
- gutter: 20,
574
- align: "middle"
575
- }, {
576
- default: u(() => [
577
- p(A, { span: 18 }, {
578
- default: u(() => [
579
- p(J, { class: "j-import-stats-cols" }, {
580
- default: u(() => [
581
- p(A, {
582
- span: 4,
583
- class: "j-import-stat-item"
584
- }, {
585
- default: u(() => [
586
- b("div", Ue, B(c.value.total), 1),
587
- s[4] || (s[4] = b("div", { class: "j-import-stat-label" }, "导入数量", -1))
588
- ]),
589
- _: 1
590
- }),
591
- p(A, {
592
- span: 4,
593
- class: "j-import-stat-item"
594
- }, {
595
- default: u(() => [
596
- b("div", We, B(c.value.fail), 1),
597
- s[5] || (s[5] = b("div", { class: "j-import-stat-label" }, "失败数量", -1))
598
- ]),
599
- _: 1
600
- }),
601
- p(A, {
602
- span: 4,
603
- class: "j-import-stat-item"
604
- }, {
605
- default: u(() => [
606
- b("div", qe, B(c.value.success), 1),
607
- s[6] || (s[6] = b("div", { class: "j-import-stat-label" }, "成功数量", -1))
608
- ]),
609
- _: 1
610
- })
611
- ]),
612
- _: 1
613
- })
614
- ]),
615
- _: 1
616
- }),
617
- p(A, {
618
- span: 6,
619
- class: "j-import-confirm-col"
506
+ return (h, o) => (r(), y(n(Ve), {
507
+ modelValue: a.value,
508
+ "onUpdate:modelValue": o[0] || (o[0] = (w) => a.value = w),
509
+ title: t.title,
510
+ width: "900px",
511
+ "close-on-click-modal": !1,
512
+ onOpen: J,
513
+ onClose: E
514
+ }, {
515
+ footer: d(() => [
516
+ f(n(_), { onClick: E }, {
517
+ default: d(() => [...o[9] || (o[9] = [
518
+ A("关闭", -1)
519
+ ])]),
520
+ _: 1
521
+ })
522
+ ]),
523
+ default: d(() => [
524
+ f(n(be), {
525
+ shadow: "never",
526
+ class: "j-import-upload-card"
527
+ }, {
528
+ default: d(() => [
529
+ o[3] || (o[3] = k("div", { class: "j-import-upload-card-title" }, "导入 EXCEL", -1)),
530
+ f(n(Fe), { style: { margin: "10px 0" } }),
531
+ k("div", rt, [
532
+ f(n(le), {
533
+ accept: ".xlsx,.xls",
534
+ "auto-upload": !1,
535
+ "show-file-list": !1,
536
+ "on-change": T
620
537
  }, {
621
- default: u(() => [
622
- p(R, {
623
- type: "primary",
624
- size: "small",
625
- loading: o.value,
626
- disabled: !r.value.length,
627
- onClick: g
628
- }, {
629
- default: u(() => [...s[7] || (s[7] = [
630
- D(" 确认导入 ", -1)
538
+ default: d(() => [
539
+ f(n(_), { size: "small" }, {
540
+ default: d(() => [...o[1] || (o[1] = [
541
+ A("点击上传", -1)
631
542
  ])]),
632
543
  _: 1
633
- }, 8, ["loading", "disabled"])
634
- ]),
635
- _: 1
636
- })
637
- ]),
638
- _: 1
639
- }),
640
- p(L, {
641
- data: r.value,
642
- border: "",
643
- size: "small",
644
- "max-height": "360",
645
- class: "j-import-data-table"
646
- }, {
647
- default: u(() => [
648
- (d(!0), S(Z, null, Q(_.value, (I) => (d(), y(O, {
649
- key: I.prop,
650
- prop: I.prop,
651
- label: I.label,
652
- "min-width": 120,
653
- "show-overflow-tooltip": ""
654
- }, null, 8, ["prop", "label"]))), 128)),
655
- p(O, {
656
- label: "状态",
657
- width: "110",
658
- align: "center",
659
- fixed: "right"
660
- }, {
661
- default: u(({ row: I }) => [
662
- I._status === -1 ? (d(), S("span", Ke, B(I._error || "创建失败"), 1)) : (d(), S("span", Xe, B(h[I._status]), 1))
544
+ })
663
545
  ]),
664
546
  _: 1
665
547
  }),
666
- p(O, {
667
- label: "操作",
668
- width: "80",
669
- align: "center",
670
- fixed: "right"
548
+ p.value.length ? (r(), y(n(De), {
549
+ key: 0,
550
+ type: "primary",
551
+ class: "j-import-no-wrap",
552
+ onClick: B
671
553
  }, {
672
- default: u(({ $index: I, row: K }) => [
673
- K._status === 0 ? (d(), y(R, {
674
- key: 0,
675
- size: "small",
676
- onClick: (Y) => $(I)
677
- }, {
678
- default: u(() => [...s[8] || (s[8] = [
679
- D(" 删除 ", -1)
680
- ])]),
681
- _: 1
682
- }, 8, ["onClick"])) : C("", !0)
683
- ]),
554
+ default: d(() => [...o[2] || (o[2] = [
555
+ A(" 下载导入模板.xlsx ", -1)
556
+ ])]),
684
557
  _: 1
685
- })
686
- ]),
687
- _: 1
688
- }, 8, ["data"])
689
- ]),
690
- _: 1
691
- }, 8, ["modelValue", "title"]);
692
- };
558
+ })) : C("", !0)
559
+ ])
560
+ ]),
561
+ _: 1
562
+ }),
563
+ f(n(me), {
564
+ class: "j-import-stats-row",
565
+ gutter: 20,
566
+ align: "middle"
567
+ }, {
568
+ default: d(() => [
569
+ f(n(X), { span: 18 }, {
570
+ default: d(() => [
571
+ f(n(me), { class: "j-import-stats-cols" }, {
572
+ default: d(() => [
573
+ f(n(X), {
574
+ span: 4,
575
+ class: "j-import-stat-item"
576
+ }, {
577
+ default: d(() => [
578
+ k("div", ct, I(c.value.total), 1),
579
+ o[4] || (o[4] = k("div", { class: "j-import-stat-label" }, "导入数量", -1))
580
+ ]),
581
+ _: 1
582
+ }),
583
+ f(n(X), {
584
+ span: 4,
585
+ class: "j-import-stat-item"
586
+ }, {
587
+ default: d(() => [
588
+ k("div", mt, I(c.value.fail), 1),
589
+ o[5] || (o[5] = k("div", { class: "j-import-stat-label" }, "失败数量", -1))
590
+ ]),
591
+ _: 1
592
+ }),
593
+ f(n(X), {
594
+ span: 4,
595
+ class: "j-import-stat-item"
596
+ }, {
597
+ default: d(() => [
598
+ k("div", ft, I(c.value.success), 1),
599
+ o[6] || (o[6] = k("div", { class: "j-import-stat-label" }, "成功数量", -1))
600
+ ]),
601
+ _: 1
602
+ })
603
+ ]),
604
+ _: 1
605
+ })
606
+ ]),
607
+ _: 1
608
+ }),
609
+ f(n(X), {
610
+ span: 6,
611
+ class: "j-import-confirm-col"
612
+ }, {
613
+ default: d(() => [
614
+ f(n(_), {
615
+ type: "primary",
616
+ size: "small",
617
+ loading: i.value,
618
+ disabled: !m.value.length,
619
+ onClick: b
620
+ }, {
621
+ default: d(() => [...o[7] || (o[7] = [
622
+ A(" 确认导入 ", -1)
623
+ ])]),
624
+ _: 1
625
+ }, 8, ["loading", "disabled"])
626
+ ]),
627
+ _: 1
628
+ })
629
+ ]),
630
+ _: 1
631
+ }),
632
+ f(n(Je), {
633
+ data: m.value,
634
+ border: "",
635
+ size: "small",
636
+ "max-height": "360",
637
+ class: "j-import-data-table"
638
+ }, {
639
+ default: d(() => [
640
+ (r(!0), x(G, null, Y(p.value, (w) => (r(), y(n(ae), {
641
+ key: w.prop,
642
+ prop: w.prop,
643
+ label: w.label,
644
+ "min-width": 120,
645
+ "show-overflow-tooltip": ""
646
+ }, null, 8, ["prop", "label"]))), 128)),
647
+ f(n(ae), {
648
+ label: "状态",
649
+ width: "110",
650
+ align: "center",
651
+ fixed: "right"
652
+ }, {
653
+ default: d(({ row: w }) => [
654
+ w._status === -1 ? (r(), x("span", pt, I(w._error || "创建失败"), 1)) : (r(), x("span", ht, I(v[w._status]), 1))
655
+ ]),
656
+ _: 1
657
+ }),
658
+ f(n(ae), {
659
+ label: "操作",
660
+ width: "80",
661
+ align: "center",
662
+ fixed: "right"
663
+ }, {
664
+ default: d(({ $index: w, row: R }) => [
665
+ R._status === 0 ? (r(), y(n(_), {
666
+ key: 0,
667
+ size: "small",
668
+ onClick: (g) => $(w)
669
+ }, {
670
+ default: d(() => [...o[8] || (o[8] = [
671
+ A(" 删除 ", -1)
672
+ ])]),
673
+ _: 1
674
+ }, 8, ["onClick"])) : C("", !0)
675
+ ]),
676
+ _: 1
677
+ })
678
+ ]),
679
+ _: 1
680
+ }, 8, ["data"])
681
+ ]),
682
+ _: 1
683
+ }, 8, ["modelValue", "title"]));
693
684
  }
694
- }), Ge = /* @__PURE__ */ W(Ze, [["__scopeId", "data-v-c7bcbb68"]]), Qe = { class: "j-sidebar__menu-item-title" }, Ye = /* @__PURE__ */ N({
685
+ }), gt = /* @__PURE__ */ W(vt, [["__scopeId", "data-v-74dcefaa"]]), yt = { class: "j-sidebar__menu-item-title" }, bt = /* @__PURE__ */ z({
695
686
  name: "JSideMenuItem",
696
687
  __name: "JSideMenuItem",
697
688
  props: {
@@ -700,45 +691,45 @@ const xe = ["disabled"], Re = {
700
691
  depth: { default: 0 }
701
692
  },
702
693
  emits: ["menu-click"],
703
- setup(e, { emit: a }) {
704
- const t = e, n = a, l = () => {
705
- n("menu-click", t.menuItem);
694
+ setup(e, { emit: s }) {
695
+ const t = e, l = s, a = () => {
696
+ l("menu-click", t.menuItem);
706
697
  };
707
- return (o, i) => {
708
- const r = w("JSideMenuItem", !0), c = w("el-sub-menu"), h = w("el-menu-item");
709
- return e.menuItem.children && e.menuItem.children.length > 0 ? (d(), y(c, {
698
+ return (i, u) => {
699
+ const m = Me("JSideMenuItem", !0);
700
+ return e.menuItem.children && e.menuItem.children.length > 0 ? (r(), y(n(_e), {
710
701
  key: 0,
711
702
  index: e.menuItem.path,
712
703
  class: U([`j-sidebar__depth-${e.depth}`])
713
704
  }, {
714
- title: u(() => [
715
- e.menuItem.icon && e.depth === 0 ? (d(), y(x(X), {
705
+ title: d(() => [
706
+ e.menuItem.icon && e.depth === 0 ? (r(), y(n(Z), {
716
707
  key: 0,
717
708
  icon: e.menuItem.icon
718
709
  }, null, 8, ["icon"])) : C("", !0),
719
- b("span", Qe, B(e.menuItem.title || e.menuItem.name), 1)
710
+ k("span", yt, I(e.menuItem.title || e.menuItem.name), 1)
720
711
  ]),
721
- default: u(() => [
722
- (d(!0), S(Z, null, Q(e.menuItem.children, (_) => (d(), y(r, {
723
- key: _.path,
724
- "menu-item": _,
712
+ default: d(() => [
713
+ (r(!0), x(G, null, Y(e.menuItem.children, (c) => (r(), y(m, {
714
+ key: c.path,
715
+ "menu-item": c,
725
716
  "is-collapse": e.isCollapse,
726
717
  depth: e.depth + 1,
727
- onMenuClick: i[0] || (i[0] = (P) => n("menu-click", P))
718
+ onMenuClick: u[0] || (u[0] = (v) => l("menu-click", v))
728
719
  }, null, 8, ["menu-item", "is-collapse", "depth"]))), 128))
729
720
  ]),
730
721
  _: 1
731
- }, 8, ["index", "class"])) : (d(), y(h, {
722
+ }, 8, ["index", "class"])) : (r(), y(n(ke), {
732
723
  key: 1,
733
724
  index: e.menuItem.path,
734
725
  class: U([`j-sidebar__depth-${e.depth}`]),
735
- onClick: l
726
+ onClick: a
736
727
  }, {
737
- title: u(() => [
738
- b("span", null, B(e.menuItem.title || e.menuItem.name), 1)
728
+ title: d(() => [
729
+ k("span", null, I(e.menuItem.title || e.menuItem.name), 1)
739
730
  ]),
740
- default: u(() => [
741
- e.menuItem.icon && e.depth === 0 ? (d(), y(x(X), {
731
+ default: d(() => [
732
+ e.menuItem.icon && e.depth === 0 ? (r(), y(n(Z), {
742
733
  key: 0,
743
734
  icon: e.menuItem.icon
744
735
  }, null, 8, ["icon"])) : C("", !0)
@@ -747,7 +738,7 @@ const xe = ["disabled"], Re = {
747
738
  }, 8, ["index", "class"]));
748
739
  };
749
740
  }
750
- }), fe = /* @__PURE__ */ W(Ye, [["__scopeId", "data-v-3787a646"]]), et = { class: "j-sidebar__logo" }, tt = { class: "j-sidebar__title" }, lt = { class: "j-sidebar__menu-wrapper" }, nt = { class: "j-sidebar__footer" }, at = /* @__PURE__ */ N({
741
+ }), $e = /* @__PURE__ */ W(bt, [["__scopeId", "data-v-3a990426"]]), kt = { class: "j-sidebar__logo" }, wt = { class: "j-sidebar__title" }, Ct = { class: "j-sidebar__menu-wrapper" }, $t = { class: "j-sidebar__footer" }, jt = /* @__PURE__ */ z({
751
742
  name: "JSidebar",
752
743
  __name: "JSidebar",
753
744
  props: {
@@ -761,69 +752,66 @@ const xe = ["disabled"], Re = {
761
752
  router: { type: Boolean, default: !0 }
762
753
  },
763
754
  emits: ["update:collapsed", "menu-click"],
764
- setup(e, { emit: a }) {
765
- const t = e, n = a, l = V(t.collapsed);
766
- ce(() => t.collapsed, (i) => {
767
- l.value = i;
755
+ setup(e, { emit: s }) {
756
+ const t = e, l = s, a = M(t.collapsed);
757
+ ye(() => t.collapsed, (u) => {
758
+ a.value = u;
768
759
  });
769
- const o = () => {
770
- l.value = !l.value, n("update:collapsed", l.value);
771
- };
772
- return (i, r) => {
773
- const c = w("el-menu");
774
- return d(), S("div", {
775
- class: U(["j-sidebar", l.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
776
- style: ae({ width: l.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
777
- }, [
778
- b("div", et, [
779
- z(i.$slots, "logo", { collapsed: l.value }, () => {
780
- var h;
781
- return [
782
- b("h2", tt, B(l.value ? e.collapsedTitle || ((h = e.title) == null ? void 0 : h.charAt(0)) || "" : e.title), 1)
783
- ];
784
- }, !0)
785
- ]),
786
- b("div", lt, [
787
- p(c, {
788
- "default-active": e.activeMenu,
789
- class: "j-sidebar__menu",
790
- router: e.router,
791
- collapse: l.value,
792
- "collapse-transition": !1
793
- }, {
794
- default: u(() => [
795
- (d(!0), S(Z, null, Q(e.menus, (h) => (d(), y(fe, {
796
- key: h.path,
797
- "menu-item": h,
798
- "is-collapse": l.value,
799
- onMenuClick: r[0] || (r[0] = (_) => n("menu-click", _))
800
- }, null, 8, ["menu-item", "is-collapse"]))), 128))
801
- ]),
802
- _: 1
803
- }, 8, ["default-active", "router", "collapse"])
804
- ]),
805
- b("div", nt, [
806
- z(i.$slots, "footer", {
807
- collapsed: l.value,
808
- toggle: o
809
- }, () => [
810
- b("button", {
811
- class: "j-sidebar__collapse-btn",
812
- onClick: o
813
- }, [
814
- p(x(X), {
815
- icon: l.value ? "mdi:chevron-right" : "mdi:chevron-left"
816
- }, null, 8, ["icon"])
817
- ])
818
- ], !0)
819
- ])
820
- ], 6);
760
+ const i = () => {
761
+ a.value = !a.value, l("update:collapsed", a.value);
821
762
  };
763
+ return (u, m) => (r(), x("div", {
764
+ class: U(["j-sidebar", a.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
765
+ style: oe({ width: a.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
766
+ }, [
767
+ k("div", kt, [
768
+ D(u.$slots, "logo", { collapsed: a.value }, () => {
769
+ var c;
770
+ return [
771
+ k("h2", wt, I(a.value ? e.collapsedTitle || ((c = e.title) == null ? void 0 : c.charAt(0)) || "" : e.title), 1)
772
+ ];
773
+ }, !0)
774
+ ]),
775
+ k("div", Ct, [
776
+ f(n(we), {
777
+ "default-active": e.activeMenu,
778
+ class: "j-sidebar__menu",
779
+ router: e.router,
780
+ collapse: a.value,
781
+ "collapse-transition": !1
782
+ }, {
783
+ default: d(() => [
784
+ (r(!0), x(G, null, Y(e.menus, (c) => (r(), y($e, {
785
+ key: c.path,
786
+ "menu-item": c,
787
+ "is-collapse": a.value,
788
+ onMenuClick: m[0] || (m[0] = (v) => l("menu-click", v))
789
+ }, null, 8, ["menu-item", "is-collapse"]))), 128))
790
+ ]),
791
+ _: 1
792
+ }, 8, ["default-active", "router", "collapse"])
793
+ ]),
794
+ k("div", $t, [
795
+ D(u.$slots, "footer", {
796
+ collapsed: a.value,
797
+ toggle: i
798
+ }, () => [
799
+ k("button", {
800
+ class: "j-sidebar__collapse-btn",
801
+ onClick: i
802
+ }, [
803
+ f(n(Z), {
804
+ icon: a.value ? "mdi:chevron-right" : "mdi:chevron-left"
805
+ }, null, 8, ["icon"])
806
+ ])
807
+ ], !0)
808
+ ])
809
+ ], 6));
822
810
  }
823
- }), pe = /* @__PURE__ */ W(at, [["__scopeId", "data-v-2e746199"]]), ot = { class: "j-admin-layout__right-panel" }, st = { class: "j-admin-layout__header" }, it = { class: "j-admin-layout__header-left" }, ut = {
811
+ }), je = /* @__PURE__ */ W(jt, [["__scopeId", "data-v-a3fac9de"]]), Et = { class: "j-admin-layout__right-panel" }, xt = { class: "j-admin-layout__header" }, It = { class: "j-admin-layout__header-left" }, Rt = {
824
812
  key: 0,
825
813
  class: "j-admin-layout__logo"
826
- }, dt = { class: "j-admin-layout__header-right" }, rt = { class: "j-admin-layout__user" }, ct = { class: "j-admin-layout__content-container" }, mt = /* @__PURE__ */ N({
814
+ }, St = { class: "j-admin-layout__header-right" }, Mt = { class: "j-admin-layout__user" }, Bt = { class: "j-admin-layout__content-container" }, At = /* @__PURE__ */ z({
827
815
  name: "JAdminLayout",
828
816
  __name: "JAdminLayout",
829
817
  props: {
@@ -849,418 +837,415 @@ const xe = ["disabled"], Re = {
849
837
  hideContentScrollbar: { type: Boolean, default: !1 }
850
838
  },
851
839
  emits: ["update:collapsed", "top-menu-select", "side-menu-click", "profile", "logout"],
852
- setup(e, { emit: a }) {
853
- const t = e, n = a, l = G({
840
+ setup(e, { emit: s }) {
841
+ const t = e, l = s, a = Q({
854
842
  get: () => t.collapsed,
855
- set: (c) => n("update:collapsed", c)
856
- }), o = G(() => ({
843
+ set: (c) => l("update:collapsed", c)
844
+ }), i = Q(() => ({
857
845
  "--j-admin-layout-header-height": t.headerHeight,
858
846
  "--j-admin-layout-content-padding": t.contentPadding,
859
847
  "--j-admin-layout-content-bg": t.contentBackground,
860
848
  "--j-admin-layout-header-bg": t.headerBackground
861
- })), i = (c) => {
862
- n("top-menu-select", c);
863
- }, r = (c) => {
864
- n("side-menu-click", c);
849
+ })), u = (c) => {
850
+ l("top-menu-select", c);
851
+ }, m = (c) => {
852
+ l("side-menu-click", c);
865
853
  };
866
- return (c, h) => {
867
- const _ = w("el-menu-item"), P = w("el-menu"), T = w("el-icon"), $ = w("el-dropdown-item"), g = w("el-dropdown-menu"), F = w("el-dropdown");
868
- return d(), S("div", {
869
- class: "j-admin-layout",
870
- style: ae(o.value)
871
- }, [
872
- e.sideMenus.length > 0 ? (d(), y(x(pe), {
873
- key: 0,
874
- collapsed: l.value,
875
- "onUpdate:collapsed": h[0] || (h[0] = (m) => l.value = m),
876
- menus: e.sideMenus,
877
- "active-menu": e.activeMenu,
878
- title: e.title,
879
- "collapsed-title": e.collapsedTitle,
880
- "collapsed-width": e.sidebarCollapsedWidth,
881
- "expanded-width": e.sidebarExpandedWidth,
882
- onMenuClick: r
883
- }, _e({ _: 2 }, [
884
- c.$slots.sidebarFooter ? {
885
- name: "footer",
886
- fn: u(({ collapsed: m, toggle: f }) => [
887
- z(c.$slots, "sidebarFooter", {
888
- collapsed: m,
889
- toggle: f
890
- }, void 0, !0)
891
- ]),
892
- key: "0"
893
- } : void 0
894
- ]), 1032, ["collapsed", "menus", "active-menu", "title", "collapsed-title", "collapsed-width", "expanded-width"])) : C("", !0),
895
- b("div", ot, [
896
- b("div", st, [
897
- b("div", it, [
898
- e.sideMenus.length === 0 ? (d(), S("div", ut, [
899
- z(c.$slots, "logo", {}, () => [
900
- b("h2", null, B(e.logoTitle || e.title), 1)
901
- ], !0)
902
- ])) : C("", !0),
903
- p(P, {
904
- mode: "horizontal",
905
- "default-active": e.activeTopMenu,
906
- class: "j-admin-layout__top-menu",
907
- onSelect: i
908
- }, {
909
- default: u(() => [
910
- (d(!0), S(Z, null, Q(e.topMenus, (m) => (d(), y(_, {
911
- key: m.path,
912
- index: m.path
913
- }, {
914
- default: u(() => [
915
- m.icon ? (d(), y(x(X), {
854
+ return (c, v) => (r(), x("div", {
855
+ class: "j-admin-layout",
856
+ style: oe(i.value)
857
+ }, [
858
+ e.sideMenus.length > 0 ? (r(), y(n(je), {
859
+ key: 0,
860
+ collapsed: a.value,
861
+ "onUpdate:collapsed": v[0] || (v[0] = (p) => a.value = p),
862
+ menus: e.sideMenus,
863
+ "active-menu": e.activeMenu,
864
+ title: e.title,
865
+ "collapsed-title": e.collapsedTitle,
866
+ "collapsed-width": e.sidebarCollapsedWidth,
867
+ "expanded-width": e.sidebarExpandedWidth,
868
+ onMenuClick: m
869
+ }, Be({ _: 2 }, [
870
+ c.$slots.sidebarFooter ? {
871
+ name: "footer",
872
+ fn: d(({ collapsed: p, toggle: J }) => [
873
+ D(c.$slots, "sidebarFooter", {
874
+ collapsed: p,
875
+ toggle: J
876
+ }, void 0, !0)
877
+ ]),
878
+ key: "0"
879
+ } : void 0
880
+ ]), 1032, ["collapsed", "menus", "active-menu", "title", "collapsed-title", "collapsed-width", "expanded-width"])) : C("", !0),
881
+ k("div", Et, [
882
+ k("div", xt, [
883
+ k("div", It, [
884
+ e.sideMenus.length === 0 ? (r(), x("div", Rt, [
885
+ D(c.$slots, "logo", {}, () => [
886
+ k("h2", null, I(e.logoTitle || e.title), 1)
887
+ ], !0)
888
+ ])) : C("", !0),
889
+ f(n(we), {
890
+ mode: "horizontal",
891
+ "default-active": e.activeTopMenu,
892
+ class: "j-admin-layout__top-menu",
893
+ onSelect: u
894
+ }, {
895
+ default: d(() => [
896
+ (r(!0), x(G, null, Y(e.topMenus, (p) => (r(), y(n(ke), {
897
+ key: p.path,
898
+ index: p.path
899
+ }, {
900
+ default: d(() => [
901
+ p.icon ? (r(), y(n(Z), {
902
+ key: 0,
903
+ icon: p.icon,
904
+ class: "j-admin-layout__top-menu-icon"
905
+ }, null, 8, ["icon"])) : C("", !0),
906
+ k("span", null, I(p.title || p.name), 1)
907
+ ]),
908
+ _: 2
909
+ }, 1032, ["index"]))), 128))
910
+ ]),
911
+ _: 1
912
+ }, 8, ["default-active"])
913
+ ]),
914
+ k("div", St, [
915
+ D(c.$slots, "headerRight", { username: e.username }, () => [
916
+ e.showProfile || e.showLogout ? (r(), y(n(Le), { key: 0 }, {
917
+ dropdown: d(() => [
918
+ f(n(Pe), null, {
919
+ default: d(() => [
920
+ e.showProfile ? (r(), y(n(fe), {
916
921
  key: 0,
917
- icon: m.icon,
918
- class: "j-admin-layout__top-menu-icon"
919
- }, null, 8, ["icon"])) : C("", !0),
920
- b("span", null, B(m.title || m.name), 1)
922
+ onClick: v[1] || (v[1] = (p) => l("profile"))
923
+ }, {
924
+ default: d(() => [
925
+ A(I(e.profileText), 1)
926
+ ]),
927
+ _: 1
928
+ })) : C("", !0),
929
+ e.showLogout ? (r(), y(n(fe), {
930
+ key: 1,
931
+ onClick: v[2] || (v[2] = (p) => l("logout"))
932
+ }, {
933
+ default: d(() => [
934
+ A(I(e.logoutText), 1)
935
+ ]),
936
+ _: 1
937
+ })) : C("", !0)
921
938
  ]),
922
- _: 2
923
- }, 1032, ["index"]))), 128))
939
+ _: 1
940
+ })
924
941
  ]),
925
- _: 1
926
- }, 8, ["default-active"])
927
- ]),
928
- b("div", dt, [
929
- z(c.$slots, "headerRight", { username: e.username }, () => [
930
- e.showProfile || e.showLogout ? (d(), y(F, { key: 0 }, {
931
- dropdown: u(() => [
932
- p(g, null, {
933
- default: u(() => [
934
- e.showProfile ? (d(), y($, {
935
- key: 0,
936
- onClick: h[1] || (h[1] = (m) => n("profile"))
937
- }, {
938
- default: u(() => [
939
- D(B(e.profileText), 1)
940
- ]),
941
- _: 1
942
- })) : C("", !0),
943
- e.showLogout ? (d(), y($, {
944
- key: 1,
945
- onClick: h[2] || (h[2] = (m) => n("logout"))
946
- }, {
947
- default: u(() => [
948
- D(B(e.logoutText), 1)
949
- ]),
950
- _: 1
951
- })) : C("", !0)
942
+ default: d(() => [
943
+ k("span", Mt, [
944
+ A(I(e.username) + " ", 1),
945
+ f(n(P), null, {
946
+ default: d(() => [
947
+ f(n(Ce))
952
948
  ]),
953
949
  _: 1
954
950
  })
955
- ]),
956
- default: u(() => [
957
- b("span", rt, [
958
- D(B(e.username) + " ", 1),
959
- p(T, null, {
960
- default: u(() => [
961
- p(x(me))
962
- ]),
963
- _: 1
964
- })
965
- ])
966
- ]),
967
- _: 1
968
- })) : C("", !0)
969
- ], !0)
970
- ])
971
- ]),
972
- b("div", ct, [
973
- z(c.$slots, "tabs", {}, void 0, !0),
974
- b("div", {
975
- class: U([
976
- "j-admin-layout__content",
977
- { "j-admin-layout__content--scrollbar-hidden": e.hideContentScrollbar }
978
- ])
979
- }, [
980
- z(c.$slots, "default", {}, void 0, !0)
981
- ], 2)
951
+ ])
952
+ ]),
953
+ _: 1
954
+ })) : C("", !0)
955
+ ], !0)
982
956
  ])
957
+ ]),
958
+ k("div", Bt, [
959
+ D(c.$slots, "tabs", {}, void 0, !0),
960
+ k("div", {
961
+ class: U([
962
+ "j-admin-layout__content",
963
+ { "j-admin-layout__content--scrollbar-hidden": e.hideContentScrollbar }
964
+ ])
965
+ }, [
966
+ D(c.$slots, "default", {}, void 0, !0)
967
+ ], 2)
983
968
  ])
984
- ], 4);
985
- };
969
+ ])
970
+ ], 4));
986
971
  }
987
- }), ft = /* @__PURE__ */ W(mt, [["__scopeId", "data-v-d1b0f182"]]);
988
- function oe(e, a) {
989
- return Array.isArray(e) ? e.map((t) => oe(t, a)) : e !== null && typeof e == "object" && !(e instanceof Date) ? a(e) : e;
972
+ }), Tt = /* @__PURE__ */ W(At, [["__scopeId", "data-v-51b44ebf"]]);
973
+ function ue(e, s) {
974
+ return Array.isArray(e) ? e.map((t) => ue(t, s)) : e !== null && typeof e == "object" && !(e instanceof Date) ? s(e) : e;
990
975
  }
991
- function pt(e, a = []) {
976
+ function Vt(e, s = []) {
992
977
  return Object.fromEntries(
993
- Object.entries(e).map(([t, n]) => {
994
- const l = oe(n, (i) => pt(i, a));
995
- return a.includes(t) ? [t, l] : [t.replace(/([A-Z])/g, "_$1").toLowerCase(), l];
978
+ Object.entries(e).map(([t, l]) => {
979
+ const a = ue(l, (u) => Vt(u, s));
980
+ return s.includes(t) ? [t, a] : [t.replace(/([A-Z])/g, "_$1").toLowerCase(), a];
996
981
  })
997
982
  );
998
983
  }
999
- function ht(e, a = []) {
984
+ function Ft(e, s = []) {
1000
985
  return Object.fromEntries(
1001
- Object.entries(e).map(([t, n]) => {
1002
- const l = oe(n, (i) => ht(i, a));
1003
- return a.includes(t) ? [t, l] : [t.replace(/_([a-z])/g, (i, r) => r.toUpperCase()), l];
986
+ Object.entries(e).map(([t, l]) => {
987
+ const a = ue(l, (u) => Ft(u, s));
988
+ return s.includes(t) ? [t, a] : [t.replace(/_([a-z])/g, (u, m) => m.toUpperCase()), a];
1004
989
  })
1005
990
  );
1006
991
  }
1007
- function St(e, a) {
992
+ function Xt(e, s) {
1008
993
  const t = {};
1009
- for (const n of a)
1010
- n in e && (t[n] = e[n]);
994
+ for (const l of s)
995
+ l in e && (t[l] = e[l]);
1011
996
  return t;
1012
997
  }
1013
- function Bt(e, a) {
998
+ function Zt(e, s) {
1014
999
  const t = { ...e };
1015
- for (const n of a)
1016
- delete t[n];
1000
+ for (const l of s)
1001
+ delete t[l];
1017
1002
  return t;
1018
1003
  }
1019
- function ue(e) {
1004
+ function he(e) {
1020
1005
  if (e === null || typeof e != "object") return e;
1021
1006
  if (e instanceof Date) return new Date(e.getTime());
1022
1007
  if (e instanceof RegExp) return new RegExp(e.source, e.flags);
1023
- if (Array.isArray(e)) return e.map((t) => ue(t));
1024
- const a = {};
1008
+ if (Array.isArray(e)) return e.map((t) => he(t));
1009
+ const s = {};
1025
1010
  for (const t of Object.keys(e))
1026
- a[t] = ue(e[t]);
1027
- return a;
1011
+ s[t] = he(e[t]);
1012
+ return s;
1028
1013
  }
1029
- function vt(e, a = !1) {
1014
+ function Dt(e, s = !1) {
1030
1015
  const t = {};
1031
- for (const [n, l] of Object.entries(e))
1032
- if (!(l == null || l === ""))
1033
- if (a && typeof l == "object" && !Array.isArray(l) && !(l instanceof Date)) {
1034
- const o = vt(l, !0);
1035
- Object.keys(o).length > 0 && (t[n] = o);
1016
+ for (const [l, a] of Object.entries(e))
1017
+ if (!(a == null || a === ""))
1018
+ if (s && typeof a == "object" && !Array.isArray(a) && !(a instanceof Date)) {
1019
+ const i = Dt(a, !0);
1020
+ Object.keys(i).length > 0 && (t[l] = i);
1036
1021
  } else
1037
- t[n] = l;
1022
+ t[l] = a;
1038
1023
  return t;
1039
1024
  }
1040
- function gt(e, a = "", t = ".") {
1041
- const n = {};
1042
- for (const [l, o] of Object.entries(e)) {
1043
- const i = a ? `${a}${t}${l}` : l;
1044
- o !== null && typeof o == "object" && !Array.isArray(o) && !(o instanceof Date) ? Object.assign(n, gt(o, i, t)) : n[i] = o;
1025
+ function Jt(e, s = "", t = ".") {
1026
+ const l = {};
1027
+ for (const [a, i] of Object.entries(e)) {
1028
+ const u = s ? `${s}${t}${a}` : a;
1029
+ i !== null && typeof i == "object" && !Array.isArray(i) && !(i instanceof Date) ? Object.assign(l, Jt(i, u, t)) : l[u] = i;
1045
1030
  }
1046
- return n;
1031
+ return l;
1047
1032
  }
1048
- function Mt(e, a = ".") {
1033
+ function Gt(e, s = ".") {
1049
1034
  const t = {};
1050
- for (const [n, l] of Object.entries(e)) {
1051
- const o = n.split(a);
1052
- let i = t;
1053
- for (let r = 0; r < o.length - 1; r++) {
1054
- const c = o[r];
1055
- c in i || (i[c] = {}), i = i[c];
1035
+ for (const [l, a] of Object.entries(e)) {
1036
+ const i = l.split(s);
1037
+ let u = t;
1038
+ for (let m = 0; m < i.length - 1; m++) {
1039
+ const c = i[m];
1040
+ c in u || (u[c] = {}), u = u[c];
1056
1041
  }
1057
- i[o[o.length - 1]] = l;
1042
+ u[i[i.length - 1]] = a;
1058
1043
  }
1059
1044
  return t;
1060
1045
  }
1061
- function At(e) {
1062
- return Object.entries(e).map(([a, t]) => ({
1063
- id: a,
1046
+ function Qt(e) {
1047
+ return Object.entries(e).map(([s, t]) => ({
1048
+ id: s,
1064
1049
  label: t,
1065
- prop: a
1050
+ prop: s
1066
1051
  }));
1067
1052
  }
1068
- function yt(e, a) {
1053
+ function _t(e, s) {
1069
1054
  if (!e) return null;
1070
1055
  let t = e.replace(/^@\//, "");
1071
1056
  t.startsWith("views/") || (t = `views/${t}`), t.endsWith(".vue") || (t = `${t}.vue`);
1072
- const n = `/src/${t}`;
1073
- return a[n] ?? a["/src/views/common/NotFound.vue"] ?? null;
1057
+ const l = `/src/${t}`;
1058
+ return s[l] ?? s["/src/views/common/NotFound.vue"] ?? null;
1074
1059
  }
1075
- function bt(e) {
1076
- const a = /* @__PURE__ */ new Map(), t = [];
1077
- return e.forEach((n) => a.set(n.name, { ...n, children: [] })), e.forEach((n) => {
1078
- const l = a.get(n.name);
1079
- if (!n.parent_name)
1080
- t.push(l);
1060
+ function Lt(e) {
1061
+ const s = /* @__PURE__ */ new Map(), t = [];
1062
+ return e.forEach((l) => s.set(l.name, { ...l, children: [] })), e.forEach((l) => {
1063
+ const a = s.get(l.name);
1064
+ if (!l.parent_name)
1065
+ t.push(a);
1081
1066
  else {
1082
- const o = a.get(n.parent_name);
1083
- o ? (o.children ?? (o.children = []), o.children.push(l)) : t.push(l);
1067
+ const i = s.get(l.parent_name);
1068
+ i ? (i.children ?? (i.children = []), i.children.push(a)) : t.push(a);
1084
1069
  }
1085
1070
  }), t;
1086
1071
  }
1087
- function he(e, a, t) {
1088
- return e.filter((n) => !t || !n.project || n.project === t).map((n) => {
1089
- var i;
1090
- const l = {
1091
- path: n.path,
1092
- name: n.name,
1072
+ function Ee(e, s, t) {
1073
+ return e.filter((l) => !t || !l.project || l.project === t).map((l) => {
1074
+ var u;
1075
+ const a = {
1076
+ path: l.path,
1077
+ name: l.name,
1093
1078
  meta: {
1094
- requiresAuth: n.requiresAuth === 1,
1095
- title: n.title,
1096
- permissions: n.permissions ? n.permissions.split(",").map((r) => r.trim()).filter(Boolean) : [],
1097
- params: n.params ? n.params.split("&").map((r) => r.trim()).filter(Boolean) : []
1079
+ requiresAuth: l.requiresAuth === 1,
1080
+ title: l.title,
1081
+ permissions: l.permissions ? l.permissions.split(",").map((m) => m.trim()).filter(Boolean) : [],
1082
+ params: l.params ? l.params.split("&").map((m) => m.trim()).filter(Boolean) : []
1098
1083
  }
1099
- }, o = yt(n.component, a);
1100
- return o && (l.component = o), n.redirect && (l.redirect = n.redirect), (i = n.children) != null && i.length && (l.children = he(n.children, a, t)), l;
1084
+ }, i = _t(l.component, s);
1085
+ return i && (a.component = i), l.redirect && (a.redirect = l.redirect), (u = l.children) != null && u.length && (a.children = Ee(l.children, s, t)), a;
1101
1086
  });
1102
1087
  }
1103
- function Et(e, a, t, n) {
1104
- const l = /* @__PURE__ */ new Map();
1105
- e.forEach((i) => l.set(i.name, i));
1106
- const o = (i) => {
1107
- let r = i.parent_name;
1088
+ function Yt(e, s, t, l) {
1089
+ const a = /* @__PURE__ */ new Map();
1090
+ e.forEach((u) => a.set(u.name, u));
1091
+ const i = (u) => {
1092
+ let m = u.parent_name;
1108
1093
  const c = /* @__PURE__ */ new Set();
1109
- for (; r; ) {
1110
- if (r === t) return !0;
1111
- if (c.has(r)) return !1;
1112
- c.add(r);
1113
- const h = l.get(r);
1114
- if (!h) return !1;
1115
- r = h.parent_name;
1094
+ for (; m; ) {
1095
+ if (m === t) return !0;
1096
+ if (c.has(m)) return !1;
1097
+ c.add(m);
1098
+ const v = a.get(m);
1099
+ if (!v) return !1;
1100
+ m = v.parent_name;
1116
1101
  }
1117
1102
  return !1;
1118
1103
  };
1119
1104
  return e.filter(
1120
- (i) => i.name !== t && i.is_show === 1 && i.component && a.includes(i.code) && o(i) && (!n || !i.project || i.project === n)
1121
- ).sort((i, r) => i.sorts - r.sorts)[0];
1105
+ (u) => u.name !== t && u.is_show === 1 && u.component && s.includes(u.code) && i(u) && (!l || !u.project || u.project === l)
1106
+ ).sort((u, m) => u.sorts - m.sorts)[0];
1122
1107
  }
1123
- ne.configure({ showSpinner: !1 });
1124
- const de = (...e) => {
1125
- }, re = (...e) => {
1126
- }, _t = (...e) => {
1108
+ ie.configure({ showSpinner: !1 });
1109
+ const ve = (...e) => {
1110
+ }, ge = (...e) => {
1111
+ }, Pt = (...e) => {
1127
1112
  console.error("[Router]", ...e);
1128
1113
  };
1129
- function Tt(e, a) {
1114
+ function ea(e, s) {
1130
1115
  const {
1131
1116
  getRouteStore: t,
1132
- getPermissionStore: n,
1133
- getUserStore: l,
1134
- isAuthenticated: o,
1135
- viewModules: i,
1136
- homeComponent: r,
1117
+ getPermissionStore: l,
1118
+ getUserStore: a,
1119
+ isAuthenticated: i,
1120
+ viewModules: u,
1121
+ homeComponent: m,
1137
1122
  notFoundComponent: c,
1138
- projectName: h,
1139
- layoutRouteName: _ = "Layout",
1140
- publicPaths: P = ["/login", "/register"],
1123
+ projectName: v,
1124
+ layoutRouteName: p = "Layout",
1125
+ publicPaths: J = ["/login", "/register"],
1141
1126
  loginRouteName: T = "login",
1142
1127
  forbiddenRouteName: $ = "Forbidden",
1143
- homeRouteName: g = "Home",
1144
- homeRoutePath: F = "home",
1145
- homeTitle: m = "首页",
1146
- noPermissionMessage: f = "暂无权限"
1147
- } = a;
1148
- let s = !1;
1149
- function j(v) {
1150
- const k = bt(v).find((J) => J.name === _), A = k != null && k.children ? he(k.children, i, h) : [];
1151
- A.forEach((J) => {
1152
- J.name && e.hasRoute(J.name) || (e.addRoute(_, J), de(`Add route: ${String(J.name)} -> ${J.path}`));
1153
- }), e.hasRoute(g) || e.addRoute(_, {
1154
- path: F,
1155
- name: g,
1156
- component: r,
1157
- meta: { title: m }
1128
+ homeRouteName: b = "Home",
1129
+ homeRoutePath: B = "home",
1130
+ homeTitle: E = "首页",
1131
+ noPermissionMessage: h = "暂无权限"
1132
+ } = s;
1133
+ let o = !1;
1134
+ function w(g) {
1135
+ const j = Lt(g).find((V) => V.name === p), O = j != null && j.children ? Ee(j.children, u, v) : [];
1136
+ O.forEach((V) => {
1137
+ V.name && e.hasRoute(V.name) || (e.addRoute(p, V), ve(`Add route: ${String(V.name)} -> ${V.path}`));
1138
+ }), e.hasRoute(b) || e.addRoute(p, {
1139
+ path: B,
1140
+ name: b,
1141
+ component: m,
1142
+ meta: { title: E }
1158
1143
  }), e.hasRoute("NotFound") || e.addRoute({
1159
1144
  path: "/:pathMatch(.*)*",
1160
1145
  name: "NotFound",
1161
1146
  component: c
1162
- }), de(`Dynamic routes added: ${A.length}`);
1147
+ }), ve(`Dynamic routes added: ${O.length}`);
1163
1148
  }
1164
- function R(v, E) {
1165
- if (v === g) {
1166
- E();
1149
+ function R(g, L) {
1150
+ if (g === b) {
1151
+ L();
1167
1152
  return;
1168
1153
  }
1169
- e.hasRoute(g) ? E({ name: g, replace: !0 }) : E();
1154
+ e.hasRoute(b) ? L({ name: b, replace: !0 }) : L();
1170
1155
  }
1171
- return e.beforeEach(async (v, E, k) => {
1172
- if (ne.start(), o() && !s)
1156
+ return e.beforeEach(async (g, L, j) => {
1157
+ if (ie.start(), i() && !o)
1173
1158
  try {
1174
- const L = t(), H = n();
1175
- if (await L.initRoutes(), await H.loadUserPermissions(), j(L.backendRoutes), s = !0, v.path === "/" || v.path === "") {
1176
- R(v.name, k);
1159
+ const F = t(), H = l();
1160
+ if (await F.initRoutes(), await H.loadUserPermissions(), w(F.backendRoutes), o = !0, g.path === "/" || g.path === "") {
1161
+ R(g.name, j);
1177
1162
  return;
1178
1163
  }
1179
- if (v.name === _) {
1180
- R(v.name, k);
1164
+ if (g.name === p) {
1165
+ R(g.name, j);
1181
1166
  return;
1182
1167
  }
1183
- const I = L.backendRoutes.find((K) => K.name === v.name);
1184
- if (I && !H.routePermissions.includes(I.code)) {
1185
- re("No route permission:", v.path), k({ name: $, replace: !0 });
1168
+ const N = F.backendRoutes.find((ee) => ee.name === g.name);
1169
+ if (N && !H.routePermissions.includes(N.code)) {
1170
+ ge("No route permission:", g.path), j({ name: $, replace: !0 });
1186
1171
  return;
1187
1172
  }
1188
- k({
1189
- path: v.path,
1190
- query: v.query,
1191
- hash: v.hash,
1173
+ j({
1174
+ path: g.path,
1175
+ query: g.query,
1176
+ hash: g.hash,
1192
1177
  replace: !0
1193
1178
  });
1194
1179
  return;
1195
- } catch (L) {
1196
- _t("Failed to load route permissions:", L), s = !1, await l().logout(), k({ name: T, replace: !0 });
1180
+ } catch (F) {
1181
+ Pt("Failed to load route permissions:", F), o = !1, await a().logout(), j({ name: T, replace: !0 });
1197
1182
  return;
1198
1183
  }
1199
- if (P.includes(v.path)) {
1200
- o() ? k({ path: "/", replace: !0 }) : k();
1184
+ if (J.includes(g.path)) {
1185
+ i() ? j({ path: "/", replace: !0 }) : j();
1201
1186
  return;
1202
1187
  }
1203
- if (!o()) {
1204
- k({ name: T, replace: !0 });
1188
+ if (!i()) {
1189
+ j({ name: T, replace: !0 });
1205
1190
  return;
1206
1191
  }
1207
- const A = n(), J = t();
1208
- if (v.name === g) {
1209
- k();
1192
+ const O = l(), V = t();
1193
+ if (g.name === b) {
1194
+ j();
1210
1195
  return;
1211
1196
  }
1212
- if (A.routePermissions.length === 0) {
1213
- v.path !== "/" ? (M.warning(f), k({ path: "/", replace: !0 })) : R(v.name, k);
1197
+ if (O.routePermissions.length === 0) {
1198
+ g.path !== "/" ? (S.warning(h), j({ path: "/", replace: !0 })) : R(g.name, j);
1214
1199
  return;
1215
1200
  }
1216
- if (v.path === "/") {
1217
- R(v.name, k);
1201
+ if (g.path === "/") {
1202
+ R(g.name, j);
1218
1203
  return;
1219
1204
  }
1220
- if (v.name === _) {
1221
- R(v.name, k);
1205
+ if (g.name === p) {
1206
+ R(g.name, j);
1222
1207
  return;
1223
1208
  }
1224
- const O = J.backendRoutes.find((L) => L.name === v.name);
1225
- if (O && !A.routePermissions.includes(O.code)) {
1226
- re("No route permission:", v.path), k({ name: $, replace: !0 });
1209
+ const K = V.backendRoutes.find((F) => F.name === g.name);
1210
+ if (K && !O.routePermissions.includes(K.code)) {
1211
+ ge("No route permission:", g.path), j({ name: $, replace: !0 });
1227
1212
  return;
1228
1213
  }
1229
- k();
1230
- }), e.afterEach(() => ne.done()), {
1214
+ j();
1215
+ }), e.afterEach(() => ie.done()), {
1231
1216
  resetRouterState: () => {
1232
- s = !1;
1217
+ o = !1;
1233
1218
  }
1234
1219
  };
1235
1220
  }
1236
- const wt = [Be, Pe, X, He, Ge, pe, fe, ft], kt = (e) => {
1237
- wt.forEach((a) => {
1238
- e.component(a.name ?? a.__name ?? "", a);
1221
+ const zt = [Ze, it, Z, dt, gt, je, $e, Tt], Ot = (e) => {
1222
+ zt.forEach((s) => {
1223
+ e.component(s.name ?? s.__name ?? "", s);
1239
1224
  });
1240
- }, Vt = { install: kt };
1225
+ }, ta = { install: Ot };
1241
1226
  export {
1242
- ft as JAdminLayout,
1243
- Be as JButton,
1244
- X as JIconRender,
1245
- Ge as JImportExcel,
1246
- He as JSearchHeader,
1247
- fe as JSideMenuItem,
1248
- pe as JSidebar,
1249
- Pe as JUploadImg,
1250
- bt as buildRouteTree,
1251
- Tt as createRouterGuard,
1252
- ue as deepClone,
1253
- Vt as default,
1254
- vt as filterEmpty,
1255
- Et as findFirstAllowedRoute,
1256
- gt as flatten,
1257
- yt as getComponentImport,
1258
- Bt as omit,
1259
- St as pick,
1260
- ht as toCamelCase,
1261
- pt as toSnakeCase,
1262
- At as toTableColumns,
1263
- he as transformBackendRoutes,
1264
- Mt as unflatten
1227
+ Tt as JAdminLayout,
1228
+ Ze as JButton,
1229
+ Z as JIconRender,
1230
+ gt as JImportExcel,
1231
+ dt as JSearchHeader,
1232
+ $e as JSideMenuItem,
1233
+ je as JSidebar,
1234
+ it as JUploadImg,
1235
+ Lt as buildRouteTree,
1236
+ ea as createRouterGuard,
1237
+ he as deepClone,
1238
+ ta as default,
1239
+ Dt as filterEmpty,
1240
+ Yt as findFirstAllowedRoute,
1241
+ Jt as flatten,
1242
+ _t as getComponentImport,
1243
+ Zt as omit,
1244
+ Xt as pick,
1245
+ Ft as toCamelCase,
1246
+ Vt as toSnakeCase,
1247
+ Qt as toTableColumns,
1248
+ Ee as transformBackendRoutes,
1249
+ Gt as unflatten
1265
1250
  };
1266
1251
  //# sourceMappingURL=index.js.map