jgy-public-component 0.0.6 → 0.0.7

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,16 +1,16 @@
1
- import { defineComponent as U, openBlock as u, createElementBlock as B, normalizeClass as q, createCommentVNode as w, renderSlot as Z, ref as E, watch as oe, resolveComponent as _, createVNode as c, unref as C, withCtx as o, createElementVNode as $, withModifiers as X, createBlock as y, Fragment as ae, toDisplayString as I, mergeProps as ie, computed as se, onMounted as re, onBeforeUnmount as ue, normalizeStyle as ce, createTextVNode as D, useModel as de, renderList as me, mergeModels as ee } from "vue";
2
- import { ElMessage as b } from "element-plus";
3
- import { Delete as G, Plus as Q, Loading as te, ZoomIn as fe, Search as pe, Refresh as ve, ArrowDown as ge } from "@element-plus/icons-vue";
4
- import ye from "vuedraggable";
5
- import { Icon as he } from "@iconify/vue";
6
- import * as T from "xlsx";
7
- const _e = ["disabled"], be = {
1
+ import { defineComponent as O, openBlock as s, createElementBlock as $, normalizeClass as X, createCommentVNode as C, renderSlot as N, ref as B, watch as oe, resolveComponent as h, createVNode as d, unref as x, withCtx as i, createElementVNode as _, withModifiers as Z, createBlock as m, Fragment as q, toDisplayString as S, mergeProps as re, computed as ie, onMounted as me, onBeforeUnmount as fe, normalizeStyle as ue, createTextVNode as A, useModel as pe, renderList as ee, mergeModels as ae } from "vue";
2
+ import { ElMessage as j } from "element-plus";
3
+ import { Delete as G, Plus as Q, Loading as ne, ZoomIn as ve, Search as ge, Refresh as he, ArrowDown as ye, Expand as be, Fold as _e } from "@element-plus/icons-vue";
4
+ import ke from "vuedraggable";
5
+ import { Icon as we } from "@iconify/vue";
6
+ import * as z from "xlsx";
7
+ const xe = ["disabled"], Ce = {
8
8
  key: 0,
9
9
  class: "j-button__loading-icon"
10
- }, we = {
10
+ }, je = {
11
11
  key: 1,
12
12
  class: "j-button__text"
13
- }, ke = /* @__PURE__ */ U({
13
+ }, $e = /* @__PURE__ */ O({
14
14
  __name: "JButton",
15
15
  props: {
16
16
  type: { default: "default" },
@@ -21,13 +21,13 @@ const _e = ["disabled"], be = {
21
21
  loading: { type: Boolean, default: !1 }
22
22
  },
23
23
  emits: ["click"],
24
- setup(e, { emit: s }) {
25
- const t = e, i = s;
26
- function a(n) {
27
- !t.disabled && !t.loading && i("click", n);
24
+ setup(e, { emit: n }) {
25
+ const l = e, u = n;
26
+ function t(o) {
27
+ !l.disabled && !l.loading && u("click", o);
28
28
  }
29
- return (n, f) => (u(), B("button", {
30
- class: q(["j-button", [
29
+ return (o, r) => (s(), $("button", {
30
+ class: X(["j-button", [
31
31
  `j-button--${e.type}`,
32
32
  `j-button--${e.size}`,
33
33
  {
@@ -38,29 +38,29 @@ const _e = ["disabled"], be = {
38
38
  }
39
39
  ]]),
40
40
  disabled: e.disabled || e.loading,
41
- onClick: a
41
+ onClick: t
42
42
  }, [
43
- e.loading ? (u(), B("span", be)) : w("", !0),
44
- n.$slots.default ? (u(), B("span", we, [
45
- Z(n.$slots, "default", {}, void 0, !0)
46
- ])) : w("", !0)
47
- ], 10, _e));
43
+ e.loading ? (s(), $("span", Ce)) : C("", !0),
44
+ o.$slots.default ? (s(), $("span", je, [
45
+ N(o.$slots, "default", {}, void 0, !0)
46
+ ])) : C("", !0)
47
+ ], 10, xe));
48
48
  }
49
- }), K = (e, s) => {
50
- const t = e.__vccOpts || e;
51
- for (const [i, a] of s)
52
- t[i] = a;
53
- return t;
54
- }, xe = /* @__PURE__ */ K(ke, [["__scopeId", "data-v-22864824"]]), Ce = { class: "j-upload-img-container" }, je = {
49
+ }), P = (e, n) => {
50
+ const l = e.__vccOpts || e;
51
+ for (const [u, t] of n)
52
+ l[u] = t;
53
+ return l;
54
+ }, Ie = /* @__PURE__ */ P($e, [["__scopeId", "data-v-22864824"]]), Be = { class: "j-upload-img-container" }, Se = {
55
55
  key: 0,
56
56
  class: "images-wrapper"
57
- }, $e = { class: "image-item" }, Ve = ["onClick"], Be = {
57
+ }, Ve = { class: "image-item" }, Ee = ["onClick"], Ae = {
58
58
  key: 0,
59
59
  class: "image-item single-image-item"
60
- }, Ee = { class: "image-actions" }, Ae = {
60
+ }, Je = { class: "image-actions" }, Me = {
61
61
  key: 2,
62
62
  class: "upload-tip"
63
- }, Ie = { key: 0 }, De = /* @__PURE__ */ U({
63
+ }, Te = { key: 0 }, De = /* @__PURE__ */ O({
64
64
  name: "JUploadImg",
65
65
  __name: "JUploadImg",
66
66
  props: {
@@ -75,200 +75,200 @@ const _e = ["disabled"], be = {
75
75
  uploadFn: { type: Function, default: void 0 }
76
76
  },
77
77
  emits: ["update:modelValue", "success", "error"],
78
- setup(e, { emit: s }) {
79
- const t = e, i = s, a = E(""), n = E(!1), f = t.showTip, v = () => {
80
- n.value = !0;
81
- }, h = () => {
82
- a.value = "", i("update:modelValue", ""), b.success("删除成功");
83
- }, k = E([]), x = E(!1), z = (d) => {
84
- k.value = d.map((r, l) => ({
85
- uid: Date.now() + l,
86
- url: r
78
+ setup(e, { emit: n }) {
79
+ const l = e, u = n, t = B(""), o = B(!1), r = l.showTip, f = () => {
80
+ o.value = !0;
81
+ }, y = () => {
82
+ t.value = "", u("update:modelValue", ""), j.success("删除成功");
83
+ }, w = B([]), v = B(!1), J = (p) => {
84
+ w.value = p.map((c, a) => ({
85
+ uid: Date.now() + a,
86
+ url: c
87
87
  }));
88
88
  };
89
- oe(() => t.modelValue, (d) => {
90
- t.multiple ? Array.isArray(d) && d.length > 0 ? z(d) : k.value = [] : typeof d == "string" ? a.value = d : a.value = "";
89
+ oe(() => l.modelValue, (p) => {
90
+ l.multiple ? Array.isArray(p) && p.length > 0 ? J(p) : w.value = [] : typeof p == "string" ? t.value = p : t.value = "";
91
91
  }, { immediate: !0 });
92
- const S = () => {
93
- F();
94
- }, g = (d) => {
95
- k.value.splice(d, 1), F(), b.success("删除成功");
96
- }, m = async (d) => {
97
- const r = d.raw;
98
- if (!r) {
99
- b.error("文件不存在,请重试");
92
+ const M = () => {
93
+ T();
94
+ }, k = (p) => {
95
+ w.value.splice(p, 1), T(), j.success("删除成功");
96
+ }, g = async (p) => {
97
+ const c = p.raw;
98
+ if (!c) {
99
+ j.error("文件不存在,请重试");
100
100
  return;
101
101
  }
102
- if (r.size > t.maxSize * 1024 * 1024) {
103
- b.error(`图片大小不能超过 ${t.maxSize}MB`);
102
+ if (c.size > l.maxSize * 1024 * 1024) {
103
+ j.error(`图片大小不能超过 ${l.maxSize}MB`);
104
104
  return;
105
105
  }
106
- if (!t.uploadFn) {
107
- b.error("未配置上传函数 (uploadFn)");
106
+ if (!l.uploadFn) {
107
+ j.error("未配置上传函数 (uploadFn)");
108
108
  return;
109
109
  }
110
110
  try {
111
- x.value = !0;
112
- const l = await t.uploadFn(r);
113
- t.multiple ? (k.value.push({ uid: Date.now(), url: l }), F()) : (a.value = l, i("update:modelValue", l)), i("success", l), b.success("上传成功");
114
- } catch (l) {
115
- console.error("上传出错:", l), b.error("上传失败,请重试"), i("error", l);
111
+ v.value = !0;
112
+ const a = await l.uploadFn(c);
113
+ l.multiple ? (w.value.push({ uid: Date.now(), url: a }), T()) : (t.value = a, u("update:modelValue", a)), u("success", a), j.success("上传成功");
114
+ } catch (a) {
115
+ console.error("上传出错:", a), j.error("上传失败,请重试"), u("error", a);
116
116
  } finally {
117
- x.value = !1;
117
+ v.value = !1;
118
118
  }
119
- }, F = () => {
120
- const d = k.value.map((r) => r.url);
121
- i("update:modelValue", d);
119
+ }, T = () => {
120
+ const p = w.value.map((c) => c.url);
121
+ u("update:modelValue", p);
122
122
  };
123
- return (d, r) => {
124
- const l = _("el-image"), p = _("el-icon"), j = _("el-upload"), O = _("el-image-viewer");
125
- return u(), B("div", Ce, [
126
- e.multiple ? (u(), B("div", je, [
127
- c(C(ye), {
128
- modelValue: k.value,
129
- "onUpdate:modelValue": r[0] || (r[0] = (R) => k.value = R),
123
+ return (p, c) => {
124
+ const a = h("el-image"), b = h("el-icon"), I = h("el-upload"), D = h("el-image-viewer");
125
+ return s(), $("div", Be, [
126
+ e.multiple ? (s(), $("div", Se, [
127
+ d(x(ke), {
128
+ modelValue: w.value,
129
+ "onUpdate:modelValue": c[0] || (c[0] = (F) => w.value = F),
130
130
  class: "images-list",
131
131
  "item-key": "uid",
132
132
  animation: 200,
133
133
  disabled: e.disabled,
134
- onEnd: S
134
+ onEnd: M
135
135
  }, {
136
- item: o(({ element: R, index: J }) => [
137
- $("div", $e, [
138
- c(l, {
139
- src: R.url,
140
- "preview-src-list": k.value.map((A) => A.url),
141
- "initial-index": J,
136
+ item: i(({ element: F, index: R }) => [
137
+ _("div", Ve, [
138
+ d(a, {
139
+ src: F.url,
140
+ "preview-src-list": w.value.map((E) => E.url),
141
+ "initial-index": R,
142
142
  fit: "cover",
143
143
  class: "image-preview",
144
144
  "preview-teleported": !0,
145
145
  "hide-on-click-modal": !0
146
146
  }, null, 8, ["src", "preview-src-list", "initial-index"]),
147
- e.disabled ? w("", !0) : (u(), B("div", {
147
+ e.disabled ? C("", !0) : (s(), $("div", {
148
148
  key: 0,
149
149
  class: "delete-btn",
150
- onClick: X((A) => g(J), ["stop"])
150
+ onClick: Z((E) => k(R), ["stop"])
151
151
  }, [
152
- c(p, { class: "icon-delete" }, {
153
- default: o(() => [
154
- c(C(G))
152
+ d(b, { class: "icon-delete" }, {
153
+ default: i(() => [
154
+ d(x(G))
155
155
  ]),
156
156
  _: 1
157
157
  })
158
- ], 8, Ve))
158
+ ], 8, Ee))
159
159
  ])
160
160
  ]),
161
161
  _: 1
162
162
  }, 8, ["modelValue", "disabled"]),
163
- !e.disabled && (!e.limit || k.value.length < e.limit) ? (u(), y(j, {
163
+ !e.disabled && (!e.limit || w.value.length < e.limit) ? (s(), m(I, {
164
164
  key: 0,
165
165
  class: "image-uploader",
166
166
  "auto-upload": !1,
167
167
  "show-file-list": !1,
168
- "on-change": m,
169
- disabled: x.value,
168
+ "on-change": g,
169
+ disabled: v.value,
170
170
  "list-type": "picture-card",
171
171
  accept: e.accept
172
172
  }, {
173
- default: o(() => [
174
- x.value ? (u(), y(p, {
173
+ default: i(() => [
174
+ v.value ? (s(), m(b, {
175
175
  key: 1,
176
176
  class: "uploader-icon is-loading"
177
177
  }, {
178
- default: o(() => [
179
- c(C(te))
178
+ default: i(() => [
179
+ d(x(ne))
180
180
  ]),
181
181
  _: 1
182
- })) : (u(), y(p, {
182
+ })) : (s(), m(b, {
183
183
  key: 0,
184
184
  class: "uploader-icon"
185
185
  }, {
186
- default: o(() => [
187
- c(C(Q))
186
+ default: i(() => [
187
+ d(x(Q))
188
188
  ]),
189
189
  _: 1
190
190
  }))
191
191
  ]),
192
192
  _: 1
193
- }, 8, ["disabled", "accept"])) : w("", !0)
194
- ])) : (u(), B(ae, { key: 1 }, [
195
- a.value ? (u(), B("div", Be, [
196
- c(l, {
197
- src: a.value,
193
+ }, 8, ["disabled", "accept"])) : C("", !0)
194
+ ])) : (s(), $(q, { key: 1 }, [
195
+ t.value ? (s(), $("div", Ae, [
196
+ d(a, {
197
+ src: t.value,
198
198
  fit: "cover",
199
199
  class: "image-preview"
200
200
  }, null, 8, ["src"]),
201
- $("div", Ee, [
202
- c(p, {
201
+ _("div", Je, [
202
+ d(b, {
203
203
  class: "action-icon",
204
- onClick: X(v, ["stop"])
204
+ onClick: Z(f, ["stop"])
205
205
  }, {
206
- default: o(() => [
207
- c(C(fe))
206
+ default: i(() => [
207
+ d(x(ve))
208
208
  ]),
209
209
  _: 1
210
210
  }),
211
- e.disabled ? w("", !0) : (u(), y(p, {
211
+ e.disabled ? C("", !0) : (s(), m(b, {
212
212
  key: 0,
213
213
  class: "action-icon",
214
- onClick: X(h, ["stop"])
214
+ onClick: Z(y, ["stop"])
215
215
  }, {
216
- default: o(() => [
217
- c(C(G))
216
+ default: i(() => [
217
+ d(x(G))
218
218
  ]),
219
219
  _: 1
220
220
  }))
221
221
  ])
222
- ])) : (u(), y(j, {
222
+ ])) : (s(), m(I, {
223
223
  key: 1,
224
224
  class: "image-uploader",
225
225
  "auto-upload": !1,
226
226
  "show-file-list": !1,
227
- "on-change": m,
228
- disabled: e.disabled || x.value,
227
+ "on-change": g,
228
+ disabled: e.disabled || v.value,
229
229
  accept: e.accept,
230
230
  "list-type": "picture-card"
231
231
  }, {
232
- default: o(() => [
233
- c(p, { class: "uploader-icon" }, {
234
- default: o(() => [
235
- x.value ? (u(), y(C(te), {
232
+ default: i(() => [
233
+ d(b, { class: "uploader-icon" }, {
234
+ default: i(() => [
235
+ v.value ? (s(), m(x(ne), {
236
236
  key: 1,
237
237
  class: "is-loading"
238
- })) : (u(), y(C(Q), { key: 0 }))
238
+ })) : (s(), m(x(Q), { key: 0 }))
239
239
  ]),
240
240
  _: 1
241
241
  })
242
242
  ]),
243
243
  _: 1
244
244
  }, 8, ["disabled", "accept"])),
245
- n.value ? (u(), y(O, {
245
+ o.value ? (s(), m(D, {
246
246
  key: 2,
247
- "url-list": [a.value],
247
+ "url-list": [t.value],
248
248
  teleported: !0,
249
- onClose: r[1] || (r[1] = (R) => n.value = !1)
250
- }, null, 8, ["url-list"])) : w("", !0)
249
+ onClose: c[1] || (c[1] = (F) => o.value = !1)
250
+ }, null, 8, ["url-list"])) : C("", !0)
251
251
  ], 64)),
252
- C(f) ? (u(), B("div", Ae, [
253
- $("span", null, I(e.tip), 1),
254
- e.multiple && e.limit ? (u(), B("span", Ie, " (最多 " + I(e.limit) + " 张)", 1)) : w("", !0)
255
- ])) : w("", !0)
252
+ x(r) ? (s(), $("div", Me, [
253
+ _("span", null, S(e.tip), 1),
254
+ e.multiple && e.limit ? (s(), $("span", Te, " (最多 " + S(e.limit) + " 张)", 1)) : C("", !0)
255
+ ])) : C("", !0)
256
256
  ]);
257
257
  };
258
258
  }
259
- }), Se = /* @__PURE__ */ K(De, [["__scopeId", "data-v-052bacda"]]), Fe = /* @__PURE__ */ U({
259
+ }), Fe = /* @__PURE__ */ P(De, [["__scopeId", "data-v-052bacda"]]), Y = /* @__PURE__ */ O({
260
260
  name: "JIconRender",
261
261
  __name: "JIconRender",
262
262
  props: {
263
263
  icon: {}
264
264
  },
265
265
  setup(e) {
266
- return (s, t) => e.icon ? (u(), y(C(he), ie({
266
+ return (n, l) => e.icon ? (s(), m(x(we), re({
267
267
  key: 0,
268
268
  icon: e.icon
269
- }, s.$attrs), null, 16, ["icon"])) : w("", !0);
269
+ }, n.$attrs), null, 16, ["icon"])) : C("", !0);
270
270
  }
271
- }), Oe = { class: "action-left" }, Re = /* @__PURE__ */ U({
271
+ }), Oe = { class: "action-left" }, Re = /* @__PURE__ */ O({
272
272
  name: "JSearchHeader",
273
273
  __name: "JSearchHeader",
274
274
  props: {
@@ -281,145 +281,145 @@ const _e = ["disabled"], be = {
281
281
  showReset: { type: Boolean, default: !0 }
282
282
  },
283
283
  emits: ["search", "reset", "add", "batchDelete"],
284
- setup(e, { emit: s }) {
285
- const t = e, i = s, a = E(), n = E(!1), f = E(!1), v = E(0), h = E(0), k = se(() => v.value > t.defaultVisible), x = () => {
286
- if (!a.value) return;
287
- const g = Array.from(a.value.children);
288
- v.value = g.length;
289
- const m = g[t.defaultVisible - 1];
290
- if (m && a.value) {
291
- const F = a.value.getBoundingClientRect(), d = m.getBoundingClientRect();
292
- h.value = d.bottom - F.top;
284
+ setup(e, { emit: n }) {
285
+ const l = e, u = n, t = B(), o = B(!1), r = B(!1), f = B(0), y = B(0), w = ie(() => f.value > l.defaultVisible), v = () => {
286
+ if (!t.value) return;
287
+ const k = Array.from(t.value.children);
288
+ f.value = k.length;
289
+ const g = k[l.defaultVisible - 1];
290
+ if (g && t.value) {
291
+ const T = t.value.getBoundingClientRect(), p = g.getBoundingClientRect();
292
+ y.value = p.bottom - T.top;
293
293
  }
294
- }, z = () => {
295
- const g = a.value;
296
- if (g)
297
- if (n.value)
298
- x(), n.value = !1, g.style.maxHeight = g.scrollHeight + "px", g.offsetHeight, g.style.maxHeight = h.value + "px";
294
+ }, J = () => {
295
+ const k = t.value;
296
+ if (k)
297
+ if (o.value)
298
+ v(), o.value = !1, k.style.maxHeight = k.scrollHeight + "px", k.offsetHeight, k.style.maxHeight = y.value + "px";
299
299
  else {
300
- n.value = !0, g.style.maxHeight = g.scrollHeight + "px";
301
- const m = () => {
302
- g.style.maxHeight = "none", g.removeEventListener("transitionend", m);
300
+ o.value = !0, k.style.maxHeight = k.scrollHeight + "px";
301
+ const g = () => {
302
+ k.style.maxHeight = "none", k.removeEventListener("transitionend", g);
303
303
  };
304
- g.addEventListener("transitionend", m);
304
+ k.addEventListener("transitionend", g);
305
305
  }
306
306
  };
307
- let S = null;
308
- return re(() => {
309
- x(), k.value && a.value && (a.value.style.maxHeight = h.value + "px"), requestAnimationFrame(() => {
307
+ let M = null;
308
+ return me(() => {
309
+ v(), w.value && t.value && (t.value.style.maxHeight = y.value + "px"), requestAnimationFrame(() => {
310
310
  requestAnimationFrame(() => {
311
- f.value = !0;
311
+ r.value = !0;
312
312
  });
313
- }), a.value && (S = new MutationObserver(() => {
314
- x(), k.value && !n.value && a.value && (a.value.style.maxHeight = h.value + "px");
315
- }), S.observe(a.value, { childList: !0 }));
316
- }), ue(() => {
317
- S == null || S.disconnect();
318
- }), (g, m) => {
319
- const F = _("el-form"), d = _("el-button"), r = _("el-icon"), l = _("el-card");
320
- return u(), y(l, {
313
+ }), t.value && (M = new MutationObserver(() => {
314
+ v(), w.value && !o.value && t.value && (t.value.style.maxHeight = y.value + "px");
315
+ }), M.observe(t.value, { childList: !0 }));
316
+ }), fe(() => {
317
+ M == null || M.disconnect();
318
+ }), (k, g) => {
319
+ const T = h("el-form"), p = h("el-button"), c = h("el-icon"), a = h("el-card");
320
+ return s(), m(a, {
321
321
  shadow: "never",
322
322
  class: "j-search-header-card"
323
323
  }, {
324
- default: o(() => [
325
- c(F, {
324
+ default: i(() => [
325
+ d(T, {
326
326
  inline: "",
327
327
  class: "search-form"
328
328
  }, {
329
- default: o(() => [
330
- $("div", {
329
+ default: i(() => [
330
+ _("div", {
331
331
  ref_key: "formItemsRef",
332
- ref: a,
333
- class: q(["form-items-wrapper", { "is-animated": f.value }])
332
+ ref: t,
333
+ class: X(["form-items-wrapper", { "is-animated": r.value }])
334
334
  }, [
335
- Z(g.$slots, "default", {}, void 0, !0)
335
+ N(k.$slots, "default", {}, void 0, !0)
336
336
  ], 2)
337
337
  ]),
338
338
  _: 3
339
339
  }),
340
- $("div", {
340
+ _("div", {
341
341
  class: "action-bar",
342
- style: ce({ marginTop: n.value ? "0px" : "10px" })
342
+ style: ue({ marginTop: o.value ? "0px" : "10px" })
343
343
  }, [
344
- $("div", Oe, [
345
- e.showAdd ? (u(), y(d, {
344
+ _("div", Oe, [
345
+ e.showAdd ? (s(), m(p, {
346
346
  key: 0,
347
347
  type: "primary",
348
- icon: C(Q),
349
- onClick: m[0] || (m[0] = (p) => i("add"))
348
+ icon: x(Q),
349
+ onClick: g[0] || (g[0] = (b) => u("add"))
350
350
  }, {
351
- default: o(() => [
352
- D(I(e.addText), 1)
351
+ default: i(() => [
352
+ A(S(e.addText), 1)
353
353
  ]),
354
354
  _: 1
355
- }, 8, ["icon"])) : w("", !0),
356
- e.showBatchDelete ? (u(), y(d, {
355
+ }, 8, ["icon"])) : C("", !0),
356
+ e.showBatchDelete ? (s(), m(p, {
357
357
  key: 1,
358
358
  type: "danger",
359
- icon: C(G),
359
+ icon: x(G),
360
360
  disabled: e.selectedCount === 0,
361
- onClick: m[1] || (m[1] = (p) => i("batchDelete"))
361
+ onClick: g[1] || (g[1] = (b) => u("batchDelete"))
362
362
  }, {
363
- default: o(() => [
364
- D(" 批量删除" + I(e.selectedCount ? `(${e.selectedCount})` : ""), 1)
363
+ default: i(() => [
364
+ A(" 批量删除" + S(e.selectedCount ? `(${e.selectedCount})` : ""), 1)
365
365
  ]),
366
366
  _: 1
367
- }, 8, ["icon", "disabled"])) : w("", !0),
368
- e.showSearch ? (u(), y(d, {
367
+ }, 8, ["icon", "disabled"])) : C("", !0),
368
+ e.showSearch ? (s(), m(p, {
369
369
  key: 2,
370
370
  type: "primary",
371
- icon: C(pe),
372
- onClick: m[2] || (m[2] = (p) => i("search"))
371
+ icon: x(ge),
372
+ onClick: g[2] || (g[2] = (b) => u("search"))
373
373
  }, {
374
- default: o(() => [...m[4] || (m[4] = [
375
- D("搜索", -1)
374
+ default: i(() => [...g[4] || (g[4] = [
375
+ A("搜索", -1)
376
376
  ])]),
377
377
  _: 1
378
- }, 8, ["icon"])) : w("", !0),
379
- e.showReset ? (u(), y(d, {
378
+ }, 8, ["icon"])) : C("", !0),
379
+ e.showReset ? (s(), m(p, {
380
380
  key: 3,
381
- icon: C(ve),
382
- onClick: m[3] || (m[3] = (p) => i("reset"))
381
+ icon: x(he),
382
+ onClick: g[3] || (g[3] = (b) => u("reset"))
383
383
  }, {
384
- default: o(() => [...m[5] || (m[5] = [
385
- D("重置", -1)
384
+ default: i(() => [...g[5] || (g[5] = [
385
+ A("重置", -1)
386
386
  ])]),
387
387
  _: 1
388
- }, 8, ["icon"])) : w("", !0),
389
- Z(g.$slots, "actions", {}, void 0, !0)
388
+ }, 8, ["icon"])) : C("", !0),
389
+ N(k.$slots, "actions", {}, void 0, !0)
390
390
  ]),
391
- k.value ? (u(), y(d, {
391
+ w.value ? (s(), m(p, {
392
392
  key: 0,
393
393
  link: "",
394
394
  type: "primary",
395
- onClick: z
395
+ onClick: J
396
396
  }, {
397
- default: o(() => [
398
- D(I(n.value ? "收起" : "展开") + " ", 1),
399
- c(r, {
400
- class: q(["toggle-icon", { "is-expanded": n.value }])
397
+ default: i(() => [
398
+ A(S(o.value ? "收起" : "展开") + " ", 1),
399
+ d(c, {
400
+ class: X(["toggle-icon", { "is-expanded": o.value }])
401
401
  }, {
402
- default: o(() => [
403
- c(C(ge))
402
+ default: i(() => [
403
+ d(x(ye))
404
404
  ]),
405
405
  _: 1
406
406
  }, 8, ["class"])
407
407
  ]),
408
408
  _: 1
409
- })) : w("", !0)
409
+ })) : C("", !0)
410
410
  ], 4)
411
411
  ]),
412
412
  _: 3
413
413
  });
414
414
  };
415
415
  }
416
- }), Je = /* @__PURE__ */ K(Re, [["__scopeId", "data-v-4488c604"]]), Te = { class: "j-import-upload-row" }, ze = { class: "j-import-stat-num" }, He = { class: "j-import-stat-num" }, Le = { class: "j-import-stat-num" }, Me = {
416
+ }), ze = /* @__PURE__ */ P(Re, [["__scopeId", "data-v-4488c604"]]), He = { class: "j-import-upload-row" }, Le = { class: "j-import-stat-num" }, Ue = { class: "j-import-stat-num" }, Ne = { class: "j-import-stat-num" }, Pe = {
417
417
  key: 0,
418
418
  class: "j-import-status-fail"
419
- }, Ue = { key: 1 }, Ne = /* @__PURE__ */ U({
419
+ }, We = { key: 1 }, Ke = /* @__PURE__ */ O({
420
420
  name: "JImportExcel",
421
421
  __name: "JImportExcel",
422
- props: /* @__PURE__ */ ee({
422
+ props: /* @__PURE__ */ ae({
423
423
  getFieldListApi: {},
424
424
  importApi: {},
425
425
  excludeFields: { default: () => ["id", "ctime", "mtime"] },
@@ -428,176 +428,176 @@ const _e = ["disabled"], be = {
428
428
  modelValue: { type: Boolean, default: !1 },
429
429
  modelModifiers: {}
430
430
  }),
431
- emits: /* @__PURE__ */ ee(["success"], ["update:modelValue"]),
432
- setup(e, { emit: s }) {
433
- const t = e, i = s, a = de(e, "modelValue"), n = E(!1), f = E({}), v = E([]), h = E({ total: 0, success: 0, fail: 0 }), k = {
431
+ emits: /* @__PURE__ */ ae(["success"], ["update:modelValue"]),
432
+ setup(e, { emit: n }) {
433
+ const l = e, u = n, t = pe(e, "modelValue"), o = B(!1), r = B({}), f = B([]), y = B({ total: 0, success: 0, fail: 0 }), w = {
434
434
  0: "待创建",
435
435
  1: "创建成功",
436
436
  2: "创建中",
437
437
  [-1]: "创建失败"
438
- }, x = se(() => Object.entries(f.value).filter(([r]) => !t.excludeFields.includes(r)).map(([r, l]) => ({ id: r, label: l, prop: r }))), z = async () => {
438
+ }, v = ie(() => Object.entries(r.value).filter(([c]) => !l.excludeFields.includes(c)).map(([c, a]) => ({ id: c, label: a, prop: c }))), J = async () => {
439
439
  try {
440
- const r = await t.getFieldListApi();
441
- f.value = r.data.tableFieldsInfo ?? {};
440
+ const c = await l.getFieldListApi();
441
+ r.value = c.data.tableFieldsInfo ?? {};
442
442
  } catch {
443
- b.error("获取字段列表失败");
443
+ j.error("获取字段列表失败");
444
444
  }
445
- }, S = (r) => {
446
- const l = r.raw;
447
- if (!l) return;
445
+ }, M = (c) => {
446
+ const a = c.raw;
447
+ if (!a) return;
448
448
  if (![
449
449
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
450
450
  "application/vnd.ms-excel"
451
- ].includes(l.type) && !l.name.match(/\.xlsx?$/i)) {
452
- b.warning("请上传 .xlsx 或 .xls 格式文件");
451
+ ].includes(a.type) && !a.name.match(/\.xlsx?$/i)) {
452
+ j.warning("请上传 .xlsx 或 .xls 格式文件");
453
453
  return;
454
454
  }
455
- const j = new FileReader();
456
- j.onload = (O) => {
455
+ const I = new FileReader();
456
+ I.onload = (D) => {
457
457
  try {
458
- const R = T.read(O.target.result, { type: "binary" }), J = R.SheetNames[0], A = R.Sheets[J], H = T.utils.sheet_to_json(A);
458
+ const F = z.read(D.target.result, { type: "binary" }), R = F.SheetNames[0], E = F.Sheets[R], H = z.utils.sheet_to_json(E);
459
459
  if (!H.length) {
460
- b.warning("文件内容为空");
460
+ j.warning("文件内容为空");
461
461
  return;
462
462
  }
463
- const L = x.value.map((M) => M.prop), N = H.map((M) => {
464
- const V = Object.values(M), P = { _status: 0, _error: "" };
465
- return L.forEach((Y, ne) => {
466
- P[Y] = V[ne];
467
- }), P;
463
+ const L = v.value.map((U) => U.prop), W = H.map((U) => {
464
+ const V = Object.values(U), K = { _status: 0, _error: "" };
465
+ return L.forEach((le, de) => {
466
+ K[le] = V[de];
467
+ }), K;
468
468
  });
469
- v.value = N, h.value = { total: N.length, success: 0, fail: 0 };
469
+ f.value = W, y.value = { total: W.length, success: 0, fail: 0 };
470
470
  } catch {
471
- b.error("解析文件失败,请检查文件格式");
471
+ j.error("解析文件失败,请检查文件格式");
472
472
  }
473
- }, j.readAsBinaryString(l);
474
- }, g = (r) => {
475
- v.value.splice(r, 1), h.value.total = v.value.length;
476
- }, m = async () => {
477
- const r = v.value.filter((l) => l._status === 0).map(({ _status: l, _error: p, ...j }) => j);
478
- if (!r.length) {
479
- b.warning("没有可导入的数据");
473
+ }, I.readAsBinaryString(a);
474
+ }, k = (c) => {
475
+ f.value.splice(c, 1), y.value.total = f.value.length;
476
+ }, g = async () => {
477
+ const c = f.value.filter((a) => a._status === 0).map(({ _status: a, _error: b, ...I }) => I);
478
+ if (!c.length) {
479
+ j.warning("没有可导入的数据");
480
480
  return;
481
481
  }
482
- n.value = !0;
482
+ o.value = !0;
483
483
  try {
484
- const l = await t.importApi(r);
485
- l.code === 1 ? (v.value.forEach((p) => {
486
- p._status === 0 && (p._status = 1);
487
- }), h.value.success = v.value.filter((p) => p._status === 1).length, b.success("导入成功"), i("success")) : b.error(l.msg || "导入失败");
484
+ const a = await l.importApi(c);
485
+ a.code === 1 ? (f.value.forEach((b) => {
486
+ b._status === 0 && (b._status = 1);
487
+ }), y.value.success = f.value.filter((b) => b._status === 1).length, j.success("导入成功"), u("success")) : j.error(a.msg || "导入失败");
488
488
  } catch {
489
- b.error("导入失败,请重试");
489
+ j.error("导入失败,请重试");
490
490
  } finally {
491
- n.value = !1;
491
+ o.value = !1;
492
492
  }
493
- }, F = () => {
493
+ }, T = () => {
494
494
  try {
495
- const r = T.utils.book_new(), l = x.value.map((O) => O.label), p = {};
496
- l.forEach((O) => p[O] = "");
497
- const j = T.utils.json_to_sheet([p]);
498
- T.utils.book_append_sheet(r, j, "模板"), T.writeFile(r, "导入模板.xlsx");
495
+ const c = z.utils.book_new(), a = v.value.map((D) => D.label), b = {};
496
+ a.forEach((D) => b[D] = "");
497
+ const I = z.utils.json_to_sheet([b]);
498
+ z.utils.book_append_sheet(c, I, "模板"), z.writeFile(c, "导入模板.xlsx");
499
499
  } catch {
500
- b.error("模板下载失败");
500
+ j.error("模板下载失败");
501
501
  }
502
- }, d = () => {
503
- n.value || (a.value = !1, v.value = [], h.value = { total: 0, success: 0, fail: 0 });
502
+ }, p = () => {
503
+ o.value || (t.value = !1, f.value = [], y.value = { total: 0, success: 0, fail: 0 });
504
504
  };
505
- return (r, l) => {
506
- const p = _("el-divider"), j = _("el-button"), O = _("el-upload"), R = _("el-link"), J = _("el-card"), A = _("el-col"), H = _("el-row"), L = _("el-table-column"), N = _("el-table"), M = _("el-dialog");
507
- return u(), y(M, {
508
- modelValue: a.value,
509
- "onUpdate:modelValue": l[0] || (l[0] = (V) => a.value = V),
510
- title: t.title,
505
+ return (c, a) => {
506
+ const b = h("el-divider"), I = h("el-button"), D = h("el-upload"), F = h("el-link"), R = h("el-card"), E = h("el-col"), H = h("el-row"), L = h("el-table-column"), W = h("el-table"), U = h("el-dialog");
507
+ return s(), m(U, {
508
+ modelValue: t.value,
509
+ "onUpdate:modelValue": a[0] || (a[0] = (V) => t.value = V),
510
+ title: l.title,
511
511
  width: "900px",
512
512
  "close-on-click-modal": !1,
513
- onOpen: z,
514
- onClose: d
513
+ onOpen: J,
514
+ onClose: p
515
515
  }, {
516
- footer: o(() => [
517
- c(j, { onClick: d }, {
518
- default: o(() => [...l[9] || (l[9] = [
519
- D("关闭", -1)
516
+ footer: i(() => [
517
+ d(I, { onClick: p }, {
518
+ default: i(() => [...a[9] || (a[9] = [
519
+ A("关闭", -1)
520
520
  ])]),
521
521
  _: 1
522
522
  })
523
523
  ]),
524
- default: o(() => [
525
- c(J, {
524
+ default: i(() => [
525
+ d(R, {
526
526
  shadow: "never",
527
527
  class: "j-import-upload-card"
528
528
  }, {
529
- default: o(() => [
530
- l[3] || (l[3] = $("div", { class: "j-import-upload-card-title" }, "导入 EXCEL", -1)),
531
- c(p, { style: { margin: "10px 0" } }),
532
- $("div", Te, [
533
- c(O, {
529
+ default: i(() => [
530
+ a[3] || (a[3] = _("div", { class: "j-import-upload-card-title" }, "导入 EXCEL", -1)),
531
+ d(b, { style: { margin: "10px 0" } }),
532
+ _("div", He, [
533
+ d(D, {
534
534
  accept: ".xlsx,.xls",
535
535
  "auto-upload": !1,
536
536
  "show-file-list": !1,
537
- "on-change": S
537
+ "on-change": M
538
538
  }, {
539
- default: o(() => [
540
- c(j, { size: "small" }, {
541
- default: o(() => [...l[1] || (l[1] = [
542
- D("点击上传", -1)
539
+ default: i(() => [
540
+ d(I, { size: "small" }, {
541
+ default: i(() => [...a[1] || (a[1] = [
542
+ A("点击上传", -1)
543
543
  ])]),
544
544
  _: 1
545
545
  })
546
546
  ]),
547
547
  _: 1
548
548
  }),
549
- x.value.length ? (u(), y(R, {
549
+ v.value.length ? (s(), m(F, {
550
550
  key: 0,
551
551
  type: "primary",
552
552
  class: "j-import-no-wrap",
553
- onClick: F
553
+ onClick: T
554
554
  }, {
555
- default: o(() => [...l[2] || (l[2] = [
556
- D(" 下载导入模板.xlsx ", -1)
555
+ default: i(() => [...a[2] || (a[2] = [
556
+ A(" 下载导入模板.xlsx ", -1)
557
557
  ])]),
558
558
  _: 1
559
- })) : w("", !0)
559
+ })) : C("", !0)
560
560
  ])
561
561
  ]),
562
562
  _: 1
563
563
  }),
564
- c(H, {
564
+ d(H, {
565
565
  class: "j-import-stats-row",
566
566
  gutter: 20,
567
567
  align: "middle"
568
568
  }, {
569
- default: o(() => [
570
- c(A, { span: 18 }, {
571
- default: o(() => [
572
- c(H, { class: "j-import-stats-cols" }, {
573
- default: o(() => [
574
- c(A, {
569
+ default: i(() => [
570
+ d(E, { span: 18 }, {
571
+ default: i(() => [
572
+ d(H, { class: "j-import-stats-cols" }, {
573
+ default: i(() => [
574
+ d(E, {
575
575
  span: 4,
576
576
  class: "j-import-stat-item"
577
577
  }, {
578
- default: o(() => [
579
- $("div", ze, I(h.value.total), 1),
580
- l[4] || (l[4] = $("div", { class: "j-import-stat-label" }, "导入数量", -1))
578
+ default: i(() => [
579
+ _("div", Le, S(y.value.total), 1),
580
+ a[4] || (a[4] = _("div", { class: "j-import-stat-label" }, "导入数量", -1))
581
581
  ]),
582
582
  _: 1
583
583
  }),
584
- c(A, {
584
+ d(E, {
585
585
  span: 4,
586
586
  class: "j-import-stat-item"
587
587
  }, {
588
- default: o(() => [
589
- $("div", He, I(h.value.fail), 1),
590
- l[5] || (l[5] = $("div", { class: "j-import-stat-label" }, "失败数量", -1))
588
+ default: i(() => [
589
+ _("div", Ue, S(y.value.fail), 1),
590
+ a[5] || (a[5] = _("div", { class: "j-import-stat-label" }, "失败数量", -1))
591
591
  ]),
592
592
  _: 1
593
593
  }),
594
- c(A, {
594
+ d(E, {
595
595
  span: 4,
596
596
  class: "j-import-stat-item"
597
597
  }, {
598
- default: o(() => [
599
- $("div", Le, I(h.value.success), 1),
600
- l[6] || (l[6] = $("div", { class: "j-import-stat-label" }, "成功数量", -1))
598
+ default: i(() => [
599
+ _("div", Ne, S(y.value.success), 1),
600
+ a[6] || (a[6] = _("div", { class: "j-import-stat-label" }, "成功数量", -1))
601
601
  ]),
602
602
  _: 1
603
603
  })
@@ -607,20 +607,20 @@ const _e = ["disabled"], be = {
607
607
  ]),
608
608
  _: 1
609
609
  }),
610
- c(A, {
610
+ d(E, {
611
611
  span: 6,
612
612
  class: "j-import-confirm-col"
613
613
  }, {
614
- default: o(() => [
615
- c(j, {
614
+ default: i(() => [
615
+ d(I, {
616
616
  type: "primary",
617
617
  size: "small",
618
- loading: n.value,
619
- disabled: !v.value.length,
620
- onClick: m
618
+ loading: o.value,
619
+ disabled: !f.value.length,
620
+ onClick: g
621
621
  }, {
622
- default: o(() => [...l[7] || (l[7] = [
623
- D(" 确认导入 ", -1)
622
+ default: i(() => [...a[7] || (a[7] = [
623
+ A(" 确认导入 ", -1)
624
624
  ])]),
625
625
  _: 1
626
626
  }, 8, ["loading", "disabled"])
@@ -630,49 +630,49 @@ const _e = ["disabled"], be = {
630
630
  ]),
631
631
  _: 1
632
632
  }),
633
- c(N, {
634
- data: v.value,
633
+ d(W, {
634
+ data: f.value,
635
635
  border: "",
636
636
  size: "small",
637
637
  "max-height": "360",
638
638
  class: "j-import-data-table"
639
639
  }, {
640
- default: o(() => [
641
- (u(!0), B(ae, null, me(x.value, (V) => (u(), y(L, {
640
+ default: i(() => [
641
+ (s(!0), $(q, null, ee(v.value, (V) => (s(), m(L, {
642
642
  key: V.prop,
643
643
  prop: V.prop,
644
644
  label: V.label,
645
645
  "min-width": 120,
646
646
  "show-overflow-tooltip": ""
647
647
  }, null, 8, ["prop", "label"]))), 128)),
648
- c(L, {
648
+ d(L, {
649
649
  label: "状态",
650
650
  width: "110",
651
651
  align: "center",
652
652
  fixed: "right"
653
653
  }, {
654
- default: o(({ row: V }) => [
655
- V._status === -1 ? (u(), B("span", Me, I(V._error || "创建失败"), 1)) : (u(), B("span", Ue, I(k[V._status]), 1))
654
+ default: i(({ row: V }) => [
655
+ V._status === -1 ? (s(), $("span", Pe, S(V._error || "创建失败"), 1)) : (s(), $("span", We, S(w[V._status]), 1))
656
656
  ]),
657
657
  _: 1
658
658
  }),
659
- c(L, {
659
+ d(L, {
660
660
  label: "操作",
661
661
  width: "80",
662
662
  align: "center",
663
663
  fixed: "right"
664
664
  }, {
665
- default: o(({ $index: V, row: P }) => [
666
- P._status === 0 ? (u(), y(j, {
665
+ default: i(({ $index: V, row: K }) => [
666
+ K._status === 0 ? (s(), m(I, {
667
667
  key: 0,
668
668
  size: "small",
669
- onClick: (Y) => g(V)
669
+ onClick: (le) => k(V)
670
670
  }, {
671
- default: o(() => [...l[8] || (l[8] = [
672
- D(" 删除 ", -1)
671
+ default: i(() => [...a[8] || (a[8] = [
672
+ A(" 删除 ", -1)
673
673
  ])]),
674
674
  _: 1
675
- }, 8, ["onClick"])) : w("", !0)
675
+ }, 8, ["onClick"])) : C("", !0)
676
676
  ]),
677
677
  _: 1
678
678
  })
@@ -684,107 +684,242 @@ const _e = ["disabled"], be = {
684
684
  }, 8, ["modelValue", "title"]);
685
685
  };
686
686
  }
687
- }), Pe = /* @__PURE__ */ K(Ne, [["__scopeId", "data-v-2ece86f5"]]);
688
- function W(e, s) {
689
- return Array.isArray(e) ? e.map((t) => W(t, s)) : e !== null && typeof e == "object" && !(e instanceof Date) ? s(e) : e;
687
+ }), Xe = /* @__PURE__ */ P(Ke, [["__scopeId", "data-v-2ece86f5"]]), ce = /* @__PURE__ */ O({
688
+ name: "JSideMenuItem",
689
+ __name: "JSideMenuItem",
690
+ props: {
691
+ menuItem: {},
692
+ isCollapse: { type: Boolean },
693
+ depth: { default: 0 }
694
+ },
695
+ emits: ["menu-click"],
696
+ setup(e, { emit: n }) {
697
+ const l = e, u = n, t = () => {
698
+ u("menu-click", l.menuItem);
699
+ };
700
+ return (o, r) => {
701
+ const f = h("JSideMenuItem", !0), y = h("el-sub-menu"), w = h("el-menu-item");
702
+ return e.menuItem.children && e.menuItem.children.length > 0 ? (s(), m(y, {
703
+ key: 0,
704
+ index: e.menuItem.path
705
+ }, {
706
+ title: i(() => [
707
+ e.menuItem.icon && e.depth === 0 ? (s(), m(x(Y), {
708
+ key: 0,
709
+ icon: e.menuItem.icon
710
+ }, null, 8, ["icon"])) : C("", !0),
711
+ _("span", null, S(e.menuItem.title || e.menuItem.name), 1)
712
+ ]),
713
+ default: i(() => [
714
+ (s(!0), $(q, null, ee(e.menuItem.children, (v) => (s(), m(f, {
715
+ key: v.path,
716
+ "menu-item": v,
717
+ "is-collapse": e.isCollapse,
718
+ depth: e.depth + 1,
719
+ onMenuClick: r[0] || (r[0] = (J) => u("menu-click", J))
720
+ }, null, 8, ["menu-item", "is-collapse", "depth"]))), 128))
721
+ ]),
722
+ _: 1
723
+ }, 8, ["index"])) : (s(), m(w, {
724
+ key: 1,
725
+ index: e.menuItem.path,
726
+ onClick: t
727
+ }, {
728
+ title: i(() => [
729
+ _("span", null, S(e.menuItem.title || e.menuItem.name), 1)
730
+ ]),
731
+ default: i(() => [
732
+ e.menuItem.icon && e.depth === 0 ? (s(), m(x(Y), {
733
+ key: 0,
734
+ icon: e.menuItem.icon
735
+ }, null, 8, ["icon"])) : C("", !0)
736
+ ]),
737
+ _: 1
738
+ }, 8, ["index"]));
739
+ };
740
+ }
741
+ }), qe = { class: "j-sidebar__logo" }, Ze = { class: "j-sidebar__title" }, Ge = { class: "j-sidebar__menu-wrapper" }, Qe = { class: "j-sidebar__footer" }, Ye = { class: "j-sidebar__collapse-text" }, et = /* @__PURE__ */ O({
742
+ name: "JSidebar",
743
+ __name: "JSidebar",
744
+ props: {
745
+ menus: {},
746
+ activeMenu: { default: "" },
747
+ title: { default: "" },
748
+ collapsedTitle: { default: "" },
749
+ collapsed: { type: Boolean, default: !1 },
750
+ collapsedWidth: { default: 64 },
751
+ expandedWidth: { default: 200 },
752
+ expandText: { default: "展开" },
753
+ collapseText: { default: "折叠" },
754
+ router: { type: Boolean, default: !0 }
755
+ },
756
+ emits: ["update:collapsed", "menu-click"],
757
+ setup(e, { emit: n }) {
758
+ const l = e, u = n, t = B(l.collapsed);
759
+ oe(() => l.collapsed, (r) => {
760
+ t.value = r;
761
+ });
762
+ const o = () => {
763
+ t.value = !t.value, u("update:collapsed", t.value);
764
+ };
765
+ return (r, f) => {
766
+ const y = h("el-menu"), w = h("el-icon");
767
+ return s(), $("div", {
768
+ class: X(["j-sidebar", t.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
769
+ style: ue({ width: t.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
770
+ }, [
771
+ _("div", qe, [
772
+ N(r.$slots, "logo", { collapsed: t.value }, () => {
773
+ var v;
774
+ return [
775
+ _("h2", Ze, S(t.value ? e.collapsedTitle || ((v = e.title) == null ? void 0 : v.charAt(0)) || "" : e.title), 1)
776
+ ];
777
+ }, !0)
778
+ ]),
779
+ _("div", Ge, [
780
+ d(y, {
781
+ "default-active": e.activeMenu,
782
+ class: "j-sidebar__menu",
783
+ router: e.router,
784
+ collapse: t.value,
785
+ "collapse-transition": !1
786
+ }, {
787
+ default: i(() => [
788
+ (s(!0), $(q, null, ee(e.menus, (v) => (s(), m(ce, {
789
+ key: v.path,
790
+ "menu-item": v,
791
+ "is-collapse": t.value,
792
+ onMenuClick: f[0] || (f[0] = (J) => u("menu-click", J))
793
+ }, null, 8, ["menu-item", "is-collapse"]))), 128))
794
+ ]),
795
+ _: 1
796
+ }, 8, ["default-active", "router", "collapse"])
797
+ ]),
798
+ _("div", Qe, [
799
+ N(r.$slots, "footer", {
800
+ collapsed: t.value,
801
+ toggle: o
802
+ }, () => [
803
+ _("button", {
804
+ class: "j-sidebar__collapse-btn",
805
+ onClick: o
806
+ }, [
807
+ d(w, { size: 18 }, {
808
+ default: i(() => [
809
+ t.value ? (s(), m(x(be), { key: 0 })) : (s(), m(x(_e), { key: 1 }))
810
+ ]),
811
+ _: 1
812
+ }),
813
+ _("span", Ye, S(t.value ? e.expandText : e.collapseText), 1)
814
+ ])
815
+ ], !0)
816
+ ])
817
+ ], 6);
818
+ };
819
+ }
820
+ }), tt = /* @__PURE__ */ P(et, [["__scopeId", "data-v-69e5b32f"]]);
821
+ function te(e, n) {
822
+ return Array.isArray(e) ? e.map((l) => te(l, n)) : e !== null && typeof e == "object" && !(e instanceof Date) ? n(e) : e;
690
823
  }
691
- function Ke(e, s = []) {
824
+ function lt(e, n = []) {
692
825
  return Object.fromEntries(
693
- Object.entries(e).map(([t, i]) => {
694
- const a = W(i, (f) => Ke(f, s));
695
- return s.includes(t) ? [t, a] : [t.replace(/([A-Z])/g, "_$1").toLowerCase(), a];
826
+ Object.entries(e).map(([l, u]) => {
827
+ const t = te(u, (r) => lt(r, n));
828
+ return n.includes(l) ? [l, t] : [l.replace(/([A-Z])/g, "_$1").toLowerCase(), t];
696
829
  })
697
830
  );
698
831
  }
699
- function Xe(e, s = []) {
832
+ function at(e, n = []) {
700
833
  return Object.fromEntries(
701
- Object.entries(e).map(([t, i]) => {
702
- const a = W(i, (f) => Xe(f, s));
703
- return s.includes(t) ? [t, a] : [t.replace(/_([a-z])/g, (f, v) => v.toUpperCase()), a];
834
+ Object.entries(e).map(([l, u]) => {
835
+ const t = te(u, (r) => at(r, n));
836
+ return n.includes(l) ? [l, t] : [l.replace(/_([a-z])/g, (r, f) => f.toUpperCase()), t];
704
837
  })
705
838
  );
706
839
  }
707
- function at(e, s) {
708
- const t = {};
709
- for (const i of s)
710
- i in e && (t[i] = e[i]);
711
- return t;
840
+ function ft(e, n) {
841
+ const l = {};
842
+ for (const u of n)
843
+ u in e && (l[u] = e[u]);
844
+ return l;
712
845
  }
713
- function st(e, s) {
714
- const t = { ...e };
715
- for (const i of s)
716
- delete t[i];
717
- return t;
846
+ function pt(e, n) {
847
+ const l = { ...e };
848
+ for (const u of n)
849
+ delete l[u];
850
+ return l;
718
851
  }
719
- function le(e) {
852
+ function se(e) {
720
853
  if (e === null || typeof e != "object") return e;
721
854
  if (e instanceof Date) return new Date(e.getTime());
722
855
  if (e instanceof RegExp) return new RegExp(e.source, e.flags);
723
- if (Array.isArray(e)) return e.map((t) => le(t));
724
- const s = {};
725
- for (const t of Object.keys(e))
726
- s[t] = le(e[t]);
727
- return s;
856
+ if (Array.isArray(e)) return e.map((l) => se(l));
857
+ const n = {};
858
+ for (const l of Object.keys(e))
859
+ n[l] = se(e[l]);
860
+ return n;
728
861
  }
729
- function qe(e, s = !1) {
730
- const t = {};
731
- for (const [i, a] of Object.entries(e))
732
- if (!(a == null || a === ""))
733
- if (s && typeof a == "object" && !Array.isArray(a) && !(a instanceof Date)) {
734
- const n = qe(a, !0);
735
- Object.keys(n).length > 0 && (t[i] = n);
862
+ function nt(e, n = !1) {
863
+ const l = {};
864
+ for (const [u, t] of Object.entries(e))
865
+ if (!(t == null || t === ""))
866
+ if (n && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date)) {
867
+ const o = nt(t, !0);
868
+ Object.keys(o).length > 0 && (l[u] = o);
736
869
  } else
737
- t[i] = a;
738
- return t;
870
+ l[u] = t;
871
+ return l;
739
872
  }
740
- function Ze(e, s = "", t = ".") {
741
- const i = {};
742
- for (const [a, n] of Object.entries(e)) {
743
- const f = s ? `${s}${t}${a}` : a;
744
- n !== null && typeof n == "object" && !Array.isArray(n) && !(n instanceof Date) ? Object.assign(i, Ze(n, f, t)) : i[f] = n;
873
+ function st(e, n = "", l = ".") {
874
+ const u = {};
875
+ for (const [t, o] of Object.entries(e)) {
876
+ const r = n ? `${n}${l}${t}` : t;
877
+ o !== null && typeof o == "object" && !Array.isArray(o) && !(o instanceof Date) ? Object.assign(u, st(o, r, l)) : u[r] = o;
745
878
  }
746
- return i;
879
+ return u;
747
880
  }
748
- function nt(e, s = ".") {
749
- const t = {};
750
- for (const [i, a] of Object.entries(e)) {
751
- const n = i.split(s);
752
- let f = t;
753
- for (let v = 0; v < n.length - 1; v++) {
754
- const h = n[v];
755
- h in f || (f[h] = {}), f = f[h];
881
+ function vt(e, n = ".") {
882
+ const l = {};
883
+ for (const [u, t] of Object.entries(e)) {
884
+ const o = u.split(n);
885
+ let r = l;
886
+ for (let f = 0; f < o.length - 1; f++) {
887
+ const y = o[f];
888
+ y in r || (r[y] = {}), r = r[y];
756
889
  }
757
- f[n[n.length - 1]] = a;
890
+ r[o[o.length - 1]] = t;
758
891
  }
759
- return t;
892
+ return l;
760
893
  }
761
- function ot(e) {
762
- return Object.entries(e).map(([s, t]) => ({
763
- id: s,
764
- label: t,
765
- prop: s
894
+ function gt(e) {
895
+ return Object.entries(e).map(([n, l]) => ({
896
+ id: n,
897
+ label: l,
898
+ prop: n
766
899
  }));
767
900
  }
768
- const Ge = [xe, Se, Fe, Je, Pe], Qe = (e) => {
769
- Ge.forEach((s) => {
770
- e.component(s.name ?? s.__name ?? "", s);
901
+ const ot = [Ie, Fe, Y, ze, Xe, tt, ce], it = (e) => {
902
+ ot.forEach((n) => {
903
+ e.component(n.name ?? n.__name ?? "", n);
771
904
  });
772
- }, it = { install: Qe };
905
+ }, ht = { install: it };
773
906
  export {
774
- xe as JButton,
775
- Fe as JIconRender,
776
- Pe as JImportExcel,
777
- Je as JSearchHeader,
778
- Se as JUploadImg,
779
- le as deepClone,
780
- it as default,
781
- qe as filterEmpty,
782
- Ze as flatten,
783
- st as omit,
784
- at as pick,
785
- Xe as toCamelCase,
786
- Ke as toSnakeCase,
787
- ot as toTableColumns,
788
- nt as unflatten
907
+ Ie as JButton,
908
+ Y as JIconRender,
909
+ Xe as JImportExcel,
910
+ ze as JSearchHeader,
911
+ ce as JSideMenuItem,
912
+ tt as JSidebar,
913
+ Fe as JUploadImg,
914
+ se as deepClone,
915
+ ht as default,
916
+ nt as filterEmpty,
917
+ st as flatten,
918
+ pt as omit,
919
+ ft as pick,
920
+ at as toCamelCase,
921
+ lt as toSnakeCase,
922
+ gt as toTableColumns,
923
+ vt as unflatten
789
924
  };
790
925
  //# sourceMappingURL=index.js.map