jgy-public-component 0.0.8 → 0.0.9

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