jgy-public-component 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { defineComponent as L, openBlock as r, createElementBlock as B, normalizeClass as W, createCommentVNode as x, renderSlot as q, ref as A, watch as ce, resolveComponent as w, createVNode as m, unref as $, withCtx as i, createElementVNode as C, withModifiers as G, createBlock as b, Fragment as Z, toDisplayString as F, mergeProps as ve, computed as de, onMounted as ge, onBeforeUnmount as ye, normalizeStyle as me, createTextVNode as z, useModel as be, renderList as te, mergeModels as ae } from "vue";
1
+ import { defineComponent as L, openBlock as r, createElementBlock as B, normalizeClass as U, createCommentVNode as x, renderSlot as q, ref as A, watch as ce, resolveComponent as w, createVNode as m, unref as j, withCtx as i, createElementVNode as C, withModifiers as G, createBlock as b, Fragment as Z, toDisplayString as F, mergeProps as ve, computed as de, onMounted as ge, onBeforeUnmount as ye, normalizeStyle as me, createTextVNode as z, useModel as be, renderList as te, mergeModels as ae } from "vue";
2
2
  import { ElMessage as R } from "element-plus";
3
3
  import { Delete as Q, Plus as Y, Loading as se, ZoomIn as _e, Search as ke, Refresh as we, ArrowDown as Ce } from "@element-plus/icons-vue";
4
- import je from "vuedraggable";
5
- import { Icon as $e } from "@iconify/vue";
4
+ import $e from "vuedraggable";
5
+ import { Icon as je } from "@iconify/vue";
6
6
  import * as N from "xlsx";
7
7
  import ee from "nprogress";
8
8
  const xe = ["disabled"], Re = {
@@ -28,7 +28,7 @@ const xe = ["disabled"], Re = {
28
28
  !t.disabled && !t.loading && n("click", a);
29
29
  }
30
30
  return (a, d) => (r(), B("button", {
31
- class: W(["j-button", [
31
+ class: U(["j-button", [
32
32
  `j-button--${e.type}`,
33
33
  `j-button--${e.size}`,
34
34
  {
@@ -47,12 +47,12 @@ const xe = ["disabled"], Re = {
47
47
  ])) : x("", !0)
48
48
  ], 10, xe));
49
49
  }
50
- }), U = (e, s) => {
50
+ }), W = (e, s) => {
51
51
  const t = e.__vccOpts || e;
52
52
  for (const [n, l] of s)
53
53
  t[n] = l;
54
54
  return t;
55
- }, Be = /* @__PURE__ */ U(Se, [["__scopeId", "data-v-22864824"]]), Ee = { class: "j-upload-img-container" }, Ae = {
55
+ }, Be = /* @__PURE__ */ W(Se, [["__scopeId", "data-v-22864824"]]), Ee = { class: "j-upload-img-container" }, Ae = {
56
56
  key: 0,
57
57
  class: "images-wrapper"
58
58
  }, Ve = { class: "image-item" }, Me = ["onClick"], Fe = {
@@ -125,7 +125,7 @@ const xe = ["disabled"], Re = {
125
125
  const o = w("el-image"), u = w("el-icon"), I = w("el-upload"), p = w("el-image-viewer");
126
126
  return r(), B("div", Ee, [
127
127
  e.multiple ? (r(), B("div", Ae, [
128
- m($(je), {
128
+ m(j($e), {
129
129
  modelValue: v.value,
130
130
  "onUpdate:modelValue": c[0] || (c[0] = (S) => v.value = S),
131
131
  class: "images-list",
@@ -152,7 +152,7 @@ const xe = ["disabled"], Re = {
152
152
  }, [
153
153
  m(u, { class: "icon-delete" }, {
154
154
  default: i(() => [
155
- m($(Q))
155
+ m(j(Q))
156
156
  ]),
157
157
  _: 1
158
158
  })
@@ -177,7 +177,7 @@ const xe = ["disabled"], Re = {
177
177
  class: "uploader-icon is-loading"
178
178
  }, {
179
179
  default: i(() => [
180
- m($(se))
180
+ m(j(se))
181
181
  ]),
182
182
  _: 1
183
183
  })) : (r(), b(u, {
@@ -185,7 +185,7 @@ const xe = ["disabled"], Re = {
185
185
  class: "uploader-icon"
186
186
  }, {
187
187
  default: i(() => [
188
- m($(Y))
188
+ m(j(Y))
189
189
  ]),
190
190
  _: 1
191
191
  }))
@@ -205,7 +205,7 @@ const xe = ["disabled"], Re = {
205
205
  onClick: G(f, ["stop"])
206
206
  }, {
207
207
  default: i(() => [
208
- m($(_e))
208
+ m(j(_e))
209
209
  ]),
210
210
  _: 1
211
211
  }),
@@ -215,7 +215,7 @@ const xe = ["disabled"], Re = {
215
215
  onClick: G(_, ["stop"])
216
216
  }, {
217
217
  default: i(() => [
218
- m($(Q))
218
+ m(j(Q))
219
219
  ]),
220
220
  _: 1
221
221
  }))
@@ -233,10 +233,10 @@ const xe = ["disabled"], Re = {
233
233
  default: i(() => [
234
234
  m(u, { class: "uploader-icon" }, {
235
235
  default: i(() => [
236
- h.value ? (r(), b($(se), {
236
+ h.value ? (r(), b(j(se), {
237
237
  key: 1,
238
238
  class: "is-loading"
239
- })) : (r(), b($(Y), { key: 0 }))
239
+ })) : (r(), b(j(Y), { key: 0 }))
240
240
  ]),
241
241
  _: 1
242
242
  })
@@ -250,14 +250,14 @@ const xe = ["disabled"], Re = {
250
250
  onClose: c[1] || (c[1] = (S) => a.value = !1)
251
251
  }, null, 8, ["url-list"])) : x("", !0)
252
252
  ], 64)),
253
- $(d) ? (r(), B("div", De, [
253
+ j(d) ? (r(), B("div", De, [
254
254
  C("span", null, F(e.tip), 1),
255
255
  e.multiple && e.limit ? (r(), B("span", Te, " (最多 " + F(e.limit) + " 张)", 1)) : x("", !0)
256
256
  ])) : x("", !0)
257
257
  ]);
258
258
  };
259
259
  }
260
- }), Oe = /* @__PURE__ */ U(ze, [["__scopeId", "data-v-052bacda"]]), X = /* @__PURE__ */ L({
260
+ }), Oe = /* @__PURE__ */ W(ze, [["__scopeId", "data-v-052bacda"]]), X = /* @__PURE__ */ L({
261
261
  name: "JIconRender",
262
262
  __name: "JIconRender",
263
263
  props: {
@@ -265,7 +265,7 @@ const xe = ["disabled"], Re = {
265
265
  size: { default: 24 }
266
266
  },
267
267
  setup(e) {
268
- return (s, t) => e.icon ? (r(), b($($e), ve({
268
+ return (s, t) => e.icon ? (r(), b(j(je), ve({
269
269
  key: 0,
270
270
  icon: e.icon,
271
271
  width: e.size,
@@ -334,7 +334,7 @@ const xe = ["disabled"], Re = {
334
334
  C("div", {
335
335
  ref_key: "formItemsRef",
336
336
  ref: l,
337
- class: W(["form-items-wrapper", { "is-animated": d.value }])
337
+ class: U(["form-items-wrapper", { "is-animated": d.value }])
338
338
  }, [
339
339
  q(k.$slots, "default", {}, void 0, !0)
340
340
  ], 2)
@@ -349,7 +349,7 @@ const xe = ["disabled"], Re = {
349
349
  e.showAdd ? (r(), b(g, {
350
350
  key: 0,
351
351
  type: "primary",
352
- icon: $(Y),
352
+ icon: j(Y),
353
353
  onClick: y[0] || (y[0] = (u) => n("add"))
354
354
  }, {
355
355
  default: i(() => [
@@ -360,7 +360,7 @@ const xe = ["disabled"], Re = {
360
360
  e.showBatchDelete ? (r(), b(g, {
361
361
  key: 1,
362
362
  type: "danger",
363
- icon: $(Q),
363
+ icon: j(Q),
364
364
  disabled: e.selectedCount === 0,
365
365
  onClick: y[1] || (y[1] = (u) => n("batchDelete"))
366
366
  }, {
@@ -372,7 +372,7 @@ const xe = ["disabled"], Re = {
372
372
  e.showSearch ? (r(), b(g, {
373
373
  key: 2,
374
374
  type: "primary",
375
- icon: $(ke),
375
+ icon: j(ke),
376
376
  onClick: y[2] || (y[2] = (u) => n("search"))
377
377
  }, {
378
378
  default: i(() => [...y[4] || (y[4] = [
@@ -382,7 +382,7 @@ const xe = ["disabled"], Re = {
382
382
  }, 8, ["icon"])) : x("", !0),
383
383
  e.showReset ? (r(), b(g, {
384
384
  key: 3,
385
- icon: $(we),
385
+ icon: j(we),
386
386
  onClick: y[3] || (y[3] = (u) => n("reset"))
387
387
  }, {
388
388
  default: i(() => [...y[5] || (y[5] = [
@@ -401,10 +401,10 @@ const xe = ["disabled"], Re = {
401
401
  default: i(() => [
402
402
  z(F(a.value ? "收起" : "展开") + " ", 1),
403
403
  m(c, {
404
- class: W(["toggle-icon", { "is-expanded": a.value }])
404
+ class: U(["toggle-icon", { "is-expanded": a.value }])
405
405
  }, {
406
406
  default: i(() => [
407
- m($(Ce))
407
+ m(j(Ce))
408
408
  ]),
409
409
  _: 1
410
410
  }, 8, ["class"])
@@ -417,7 +417,7 @@ const xe = ["disabled"], Re = {
417
417
  });
418
418
  };
419
419
  }
420
- }), Le = /* @__PURE__ */ U(He, [["__scopeId", "data-v-4488c604"]]), 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 = {
420
+ }), Le = /* @__PURE__ */ W(He, [["__scopeId", "data-v-4488c604"]]), 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 = {
421
421
  key: 0,
422
422
  class: "j-import-status-fail"
423
423
  }, Xe = { key: 1 }, Ze = /* @__PURE__ */ L({
@@ -459,12 +459,12 @@ const xe = ["disabled"], Re = {
459
459
  const I = new FileReader();
460
460
  I.onload = (p) => {
461
461
  try {
462
- const S = N.read(p.target.result, { type: "binary" }), E = S.SheetNames[0], V = S.Sheets[E], j = N.utils.sheet_to_json(V);
463
- if (!j.length) {
462
+ const S = N.read(p.target.result, { type: "binary" }), E = S.SheetNames[0], V = S.Sheets[E], $ = N.utils.sheet_to_json(V);
463
+ if (!$.length) {
464
464
  R.warning("文件内容为空");
465
465
  return;
466
466
  }
467
- const P = h.value.map((T) => T.prop), H = j.map((T) => {
467
+ const P = h.value.map((T) => T.prop), H = $.map((T) => {
468
468
  const M = Object.values(T), K = { _status: 0, _error: "" };
469
469
  return P.forEach((ne, he) => {
470
470
  K[ne] = M[he];
@@ -507,7 +507,7 @@ const xe = ["disabled"], Re = {
507
507
  a.value || (l.value = !1, f.value = [], _.value = { total: 0, success: 0, fail: 0 });
508
508
  };
509
509
  return (c, o) => {
510
- const u = w("el-divider"), I = w("el-button"), p = w("el-upload"), S = w("el-link"), E = w("el-card"), V = w("el-col"), j = w("el-row"), P = w("el-table-column"), H = w("el-table"), T = w("el-dialog");
510
+ const u = w("el-divider"), I = w("el-button"), p = w("el-upload"), S = w("el-link"), E = w("el-card"), V = w("el-col"), $ = w("el-row"), P = w("el-table-column"), H = w("el-table"), T = w("el-dialog");
511
511
  return r(), b(T, {
512
512
  modelValue: l.value,
513
513
  "onUpdate:modelValue": o[0] || (o[0] = (M) => l.value = M),
@@ -565,7 +565,7 @@ const xe = ["disabled"], Re = {
565
565
  ]),
566
566
  _: 1
567
567
  }),
568
- m(j, {
568
+ m($, {
569
569
  class: "j-import-stats-row",
570
570
  gutter: 20,
571
571
  align: "middle"
@@ -573,7 +573,7 @@ const xe = ["disabled"], Re = {
573
573
  default: i(() => [
574
574
  m(V, { span: 18 }, {
575
575
  default: i(() => [
576
- m(j, { class: "j-import-stats-cols" }, {
576
+ m($, { class: "j-import-stats-cols" }, {
577
577
  default: i(() => [
578
578
  m(V, {
579
579
  span: 4,
@@ -688,7 +688,7 @@ const xe = ["disabled"], Re = {
688
688
  }, 8, ["modelValue", "title"]);
689
689
  };
690
690
  }
691
- }), Ge = /* @__PURE__ */ U(Ze, [["__scopeId", "data-v-2ece86f5"]]), Qe = { class: "j-sidebar__menu-item-title" }, Ye = /* @__PURE__ */ L({
691
+ }), Ge = /* @__PURE__ */ W(Ze, [["__scopeId", "data-v-2ece86f5"]]), Qe = { class: "j-sidebar__menu-item-title" }, Ye = /* @__PURE__ */ L({
692
692
  name: "JSideMenuItem",
693
693
  __name: "JSideMenuItem",
694
694
  props: {
@@ -705,10 +705,11 @@ const xe = ["disabled"], Re = {
705
705
  const f = w("JSideMenuItem", !0), _ = w("el-sub-menu"), v = w("el-menu-item");
706
706
  return e.menuItem.children && e.menuItem.children.length > 0 ? (r(), b(_, {
707
707
  key: 0,
708
- index: e.menuItem.path
708
+ index: e.menuItem.path,
709
+ class: U([`j-sidebar__depth-${e.depth}`])
709
710
  }, {
710
711
  title: i(() => [
711
- e.menuItem.icon && e.depth === 0 ? (r(), b($(X), {
712
+ e.menuItem.icon && e.depth === 0 ? (r(), b(j(X), {
712
713
  key: 0,
713
714
  icon: e.menuItem.icon
714
715
  }, null, 8, ["icon"])) : x("", !0),
@@ -724,25 +725,26 @@ const xe = ["disabled"], Re = {
724
725
  }, null, 8, ["menu-item", "is-collapse", "depth"]))), 128))
725
726
  ]),
726
727
  _: 1
727
- }, 8, ["index"])) : (r(), b(v, {
728
+ }, 8, ["index", "class"])) : (r(), b(v, {
728
729
  key: 1,
729
730
  index: e.menuItem.path,
731
+ class: U([`j-sidebar__depth-${e.depth}`]),
730
732
  onClick: l
731
733
  }, {
732
734
  title: i(() => [
733
735
  C("span", null, F(e.menuItem.title || e.menuItem.name), 1)
734
736
  ]),
735
737
  default: i(() => [
736
- e.menuItem.icon && e.depth === 0 ? (r(), b($(X), {
738
+ e.menuItem.icon && e.depth === 0 ? (r(), b(j(X), {
737
739
  key: 0,
738
740
  icon: e.menuItem.icon
739
741
  }, null, 8, ["icon"])) : x("", !0)
740
742
  ]),
741
743
  _: 1
742
- }, 8, ["index"]));
744
+ }, 8, ["index", "class"]));
743
745
  };
744
746
  }
745
- }), fe = /* @__PURE__ */ U(Ye, [["__scopeId", "data-v-c83c4ba1"]]), et = { class: "j-sidebar__logo" }, tt = { class: "j-sidebar__title" }, lt = { class: "j-sidebar__menu-wrapper" }, nt = { class: "j-sidebar__footer" }, at = /* @__PURE__ */ L({
747
+ }), fe = /* @__PURE__ */ W(Ye, [["__scopeId", "data-v-eb6f5fc5"]]), et = { class: "j-sidebar__logo" }, tt = { class: "j-sidebar__title" }, lt = { class: "j-sidebar__menu-wrapper" }, nt = { class: "j-sidebar__footer" }, at = /* @__PURE__ */ L({
746
748
  name: "JSidebar",
747
749
  __name: "JSidebar",
748
750
  props: {
@@ -751,7 +753,7 @@ const xe = ["disabled"], Re = {
751
753
  title: { default: "" },
752
754
  collapsedTitle: { default: "" },
753
755
  collapsed: { type: Boolean, default: !1 },
754
- collapsedWidth: { default: 110 },
756
+ collapsedWidth: { default: 80 },
755
757
  expandedWidth: { default: 200 },
756
758
  router: { type: Boolean, default: !0 }
757
759
  },
@@ -767,7 +769,7 @@ const xe = ["disabled"], Re = {
767
769
  return (d, f) => {
768
770
  const _ = w("el-menu");
769
771
  return r(), B("div", {
770
- class: W(["j-sidebar", l.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
772
+ class: U(["j-sidebar", l.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
771
773
  style: me({ width: l.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
772
774
  }, [
773
775
  C("div", et, [
@@ -803,19 +805,19 @@ const xe = ["disabled"], Re = {
803
805
  toggle: a
804
806
  }, () => [
805
807
  C("button", {
806
- class: W(["j-sidebar__collapse-btn", l.value ? "j-sidebar__collapse-btn--center" : "j-sidebar__collapse-btn--right"]),
808
+ class: "j-sidebar__collapse-btn",
807
809
  onClick: a
808
810
  }, [
809
- m($(X), {
811
+ m(j(X), {
810
812
  icon: l.value ? "mdi:chevron-right" : "mdi:chevron-left"
811
813
  }, null, 8, ["icon"])
812
- ], 2)
814
+ ])
813
815
  ], !0)
814
816
  ])
815
817
  ], 6);
816
818
  };
817
819
  }
818
- }), st = /* @__PURE__ */ U(at, [["__scopeId", "data-v-4704586e"]]);
820
+ }), st = /* @__PURE__ */ W(at, [["__scopeId", "data-v-43855959"]]);
819
821
  function le(e, s) {
820
822
  return Array.isArray(e) ? e.map((t) => le(t, s)) : e !== null && typeof e == "object" && !(e instanceof Date) ? s(e) : e;
821
823
  }
@@ -889,7 +891,7 @@ function Ct(e, s = ".") {
889
891
  }
890
892
  return t;
891
893
  }
892
- function jt(e) {
894
+ function $t(e) {
893
895
  return Object.entries(e).map(([s, t]) => ({
894
896
  id: s,
895
897
  label: t,
@@ -943,7 +945,7 @@ const re = (...e) => {
943
945
  }, mt = (...e) => {
944
946
  console.error("[Router]", ...e);
945
947
  };
946
- function $t(e, s) {
948
+ function jt(e, s) {
947
949
  const {
948
950
  getRouteStore: t,
949
951
  getPermissionStore: n,
@@ -982,11 +984,11 @@ function $t(e, s) {
982
984
  return e.beforeEach(async (u, I, p) => {
983
985
  if (ee.start(), a() && !c)
984
986
  try {
985
- const j = t(), P = n();
986
- if (await j.initRoutes(), await P.loadUserPermissions(), j.backendRoutes.length > 0) {
987
- if (o(j.backendRoutes), c = !0, u.path === "/" || u.path === "") {
987
+ const $ = t(), P = n();
988
+ if (await $.initRoutes(), await P.loadUserPermissions(), $.backendRoutes.length > 0) {
989
+ if (o($.backendRoutes), c = !0, u.path === "/" || u.path === "") {
988
990
  const T = ie(
989
- j.backendRoutes,
991
+ $.backendRoutes,
990
992
  P.routePermissions,
991
993
  h,
992
994
  v
@@ -1002,7 +1004,7 @@ function $t(e, s) {
1002
1004
  p({ ...u, replace: !0 });
1003
1005
  return;
1004
1006
  }
1005
- const H = j.backendRoutes.find((T) => T.name === u.name);
1007
+ const H = $.backendRoutes.find((T) => T.name === u.name);
1006
1008
  if (H && !P.routePermissions.includes(H.code)) {
1007
1009
  ue("无权限访问:", u.path), p({ name: k, replace: !0 });
1008
1010
  return;
@@ -1010,8 +1012,8 @@ function $t(e, s) {
1010
1012
  p({ ...u, replace: !0 });
1011
1013
  return;
1012
1014
  }
1013
- } catch (j) {
1014
- mt("获取权限失败:", j), c = !1, await l().logout(), p({ name: J, replace: !0 });
1015
+ } catch ($) {
1016
+ mt("获取权限失败:", $), c = !1, await l().logout(), p({ name: J, replace: !0 });
1015
1017
  return;
1016
1018
  }
1017
1019
  if (O.includes(u.path)) {
@@ -1032,20 +1034,20 @@ function $t(e, s) {
1032
1034
  return;
1033
1035
  }
1034
1036
  if (u.path === "/") {
1035
- const j = ie(
1037
+ const $ = ie(
1036
1038
  E.backendRoutes,
1037
1039
  S.routePermissions,
1038
1040
  h,
1039
1041
  v
1040
1042
  );
1041
- if (j && j.path !== "/") {
1042
- p({ path: j.path, replace: !0 });
1043
+ if ($ && $.path !== "/") {
1044
+ p({ path: $.path, replace: !0 });
1043
1045
  return;
1044
1046
  }
1045
1047
  p();
1046
1048
  return;
1047
1049
  }
1048
- const V = E.backendRoutes.find((j) => j.name === u.name);
1050
+ const V = E.backendRoutes.find(($) => $.name === u.name);
1049
1051
  if (V && !S.routePermissions.includes(V.code)) {
1050
1052
  ue("无权限访问:", u.path), p({ name: k, replace: !0 });
1051
1053
  return;
@@ -1071,7 +1073,7 @@ export {
1071
1073
  st as JSidebar,
1072
1074
  Oe as JUploadImg,
1073
1075
  dt as buildRouteTree,
1074
- $t as createRouterGuard,
1076
+ jt as createRouterGuard,
1075
1077
  oe as deepClone,
1076
1078
  xt as default,
1077
1079
  rt as filterEmpty,
@@ -1082,7 +1084,7 @@ export {
1082
1084
  kt as pick,
1083
1085
  it as toCamelCase,
1084
1086
  ot as toSnakeCase,
1085
- jt as toTableColumns,
1087
+ $t as toTableColumns,
1086
1088
  pe as transformBackendRoutes,
1087
1089
  Ct as unflatten
1088
1090
  };