jgy-public-component 0.0.13 → 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,9 +1,9 @@
1
- import { defineComponent as N, openBlock as r, createElementBlock as B, normalizeClass as L, 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";
6
- import * as U from "xlsx";
4
+ import $e from "vuedraggable";
5
+ import { Icon as je } from "@iconify/vue";
6
+ import * as N from "xlsx";
7
7
  import ee from "nprogress";
8
8
  const xe = ["disabled"], Re = {
9
9
  key: 0,
@@ -11,7 +11,7 @@ const xe = ["disabled"], Re = {
11
11
  }, Ie = {
12
12
  key: 1,
13
13
  class: "j-button__text"
14
- }, Se = /* @__PURE__ */ N({
14
+ }, Se = /* @__PURE__ */ L({
15
15
  __name: "JButton",
16
16
  props: {
17
17
  type: { default: "default" },
@@ -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: L(["j-button", [
31
+ class: U(["j-button", [
32
32
  `j-button--${e.type}`,
33
33
  `j-button--${e.size}`,
34
34
  {
@@ -61,7 +61,7 @@ const xe = ["disabled"], Re = {
61
61
  }, Je = { class: "image-actions" }, De = {
62
62
  key: 2,
63
63
  class: "upload-tip"
64
- }, Te = { key: 0 }, ze = /* @__PURE__ */ N({
64
+ }, Te = { key: 0 }, ze = /* @__PURE__ */ L({
65
65
  name: "JUploadImg",
66
66
  __name: "JUploadImg",
67
67
  props: {
@@ -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__ */ W(ze, [["__scopeId", "data-v-052bacda"]]), X = /* @__PURE__ */ N({
260
+ }), Oe = /* @__PURE__ */ W(ze, [["__scopeId", "data-v-052bacda"]]), X = /* @__PURE__ */ L({
261
261
  name: "JIconRender",
262
262
  __name: "JIconRender",
263
263
  props: {
@@ -265,14 +265,14 @@ 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,
272
272
  height: e.size
273
273
  }, s.$attrs), null, 16, ["icon", "width", "height"])) : x("", !0);
274
274
  }
275
- }), Pe = { class: "action-left" }, He = /* @__PURE__ */ N({
275
+ }), Pe = { class: "action-left" }, He = /* @__PURE__ */ L({
276
276
  name: "JSearchHeader",
277
277
  __name: "JSearchHeader",
278
278
  props: {
@@ -334,7 +334,7 @@ const xe = ["disabled"], Re = {
334
334
  C("div", {
335
335
  ref_key: "formItemsRef",
336
336
  ref: l,
337
- class: L(["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: L(["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"])
@@ -420,7 +420,7 @@ const xe = ["disabled"], Re = {
420
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
- }, Xe = { key: 1 }, Ze = /* @__PURE__ */ N({
423
+ }, Xe = { key: 1 }, Ze = /* @__PURE__ */ L({
424
424
  name: "JImportExcel",
425
425
  __name: "JImportExcel",
426
426
  props: /* @__PURE__ */ ae({
@@ -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 = U.read(p.target.result, { type: "binary" }), E = S.SheetNames[0], V = S.Sheets[E], j = U.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];
@@ -496,10 +496,10 @@ const xe = ["disabled"], Re = {
496
496
  }
497
497
  }, D = () => {
498
498
  try {
499
- const c = U.utils.book_new(), o = h.value.map((p) => p.label), u = {};
499
+ const c = N.utils.book_new(), o = h.value.map((p) => p.label), u = {};
500
500
  o.forEach((p) => u[p] = "");
501
- const I = U.utils.json_to_sheet([u]);
502
- U.utils.book_append_sheet(c, I, "模板"), U.writeFile(c, "导入模板.xlsx");
501
+ const I = N.utils.json_to_sheet([u]);
502
+ N.utils.book_append_sheet(c, I, "模板"), N.writeFile(c, "导入模板.xlsx");
503
503
  } catch {
504
504
  R.error("模板下载失败");
505
505
  }
@@ -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__ */ W(Ze, [["__scopeId", "data-v-2ece86f5"]]), Qe = { class: "j-sidebar__menu-item-title" }, Ye = /* @__PURE__ */ N({
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: {
@@ -706,10 +706,10 @@ const xe = ["disabled"], Re = {
706
706
  return e.menuItem.children && e.menuItem.children.length > 0 ? (r(), b(_, {
707
707
  key: 0,
708
708
  index: e.menuItem.path,
709
- class: L([`j-sidebar__depth-${e.depth}`])
709
+ class: U([`j-sidebar__depth-${e.depth}`])
710
710
  }, {
711
711
  title: i(() => [
712
- e.menuItem.icon && e.depth === 0 ? (r(), b($(X), {
712
+ e.menuItem.icon && e.depth === 0 ? (r(), b(j(X), {
713
713
  key: 0,
714
714
  icon: e.menuItem.icon
715
715
  }, null, 8, ["icon"])) : x("", !0),
@@ -728,14 +728,14 @@ const xe = ["disabled"], Re = {
728
728
  }, 8, ["index", "class"])) : (r(), b(v, {
729
729
  key: 1,
730
730
  index: e.menuItem.path,
731
- class: L([`j-sidebar__depth-${e.depth}`]),
731
+ class: U([`j-sidebar__depth-${e.depth}`]),
732
732
  onClick: l
733
733
  }, {
734
734
  title: i(() => [
735
735
  C("span", null, F(e.menuItem.title || e.menuItem.name), 1)
736
736
  ]),
737
737
  default: i(() => [
738
- e.menuItem.icon && e.depth === 0 ? (r(), b($(X), {
738
+ e.menuItem.icon && e.depth === 0 ? (r(), b(j(X), {
739
739
  key: 0,
740
740
  icon: e.menuItem.icon
741
741
  }, null, 8, ["icon"])) : x("", !0)
@@ -744,7 +744,7 @@ const xe = ["disabled"], Re = {
744
744
  }, 8, ["index", "class"]));
745
745
  };
746
746
  }
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__ */ N({
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({
748
748
  name: "JSidebar",
749
749
  __name: "JSidebar",
750
750
  props: {
@@ -753,7 +753,7 @@ const xe = ["disabled"], Re = {
753
753
  title: { default: "" },
754
754
  collapsedTitle: { default: "" },
755
755
  collapsed: { type: Boolean, default: !1 },
756
- collapsedWidth: { default: 110 },
756
+ collapsedWidth: { default: 80 },
757
757
  expandedWidth: { default: 200 },
758
758
  router: { type: Boolean, default: !0 }
759
759
  },
@@ -769,7 +769,7 @@ const xe = ["disabled"], Re = {
769
769
  return (d, f) => {
770
770
  const _ = w("el-menu");
771
771
  return r(), B("div", {
772
- class: L(["j-sidebar", l.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
772
+ class: U(["j-sidebar", l.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
773
773
  style: me({ width: l.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
774
774
  }, [
775
775
  C("div", et, [
@@ -805,19 +805,19 @@ const xe = ["disabled"], Re = {
805
805
  toggle: a
806
806
  }, () => [
807
807
  C("button", {
808
- class: L(["j-sidebar__collapse-btn", l.value ? "j-sidebar__collapse-btn--center" : "j-sidebar__collapse-btn--right"]),
808
+ class: "j-sidebar__collapse-btn",
809
809
  onClick: a
810
810
  }, [
811
- m($(X), {
811
+ m(j(X), {
812
812
  icon: l.value ? "mdi:chevron-right" : "mdi:chevron-left"
813
813
  }, null, 8, ["icon"])
814
- ], 2)
814
+ ])
815
815
  ], !0)
816
816
  ])
817
817
  ], 6);
818
818
  };
819
819
  }
820
- }), st = /* @__PURE__ */ W(at, [["__scopeId", "data-v-4704586e"]]);
820
+ }), st = /* @__PURE__ */ W(at, [["__scopeId", "data-v-43855959"]]);
821
821
  function le(e, s) {
822
822
  return Array.isArray(e) ? e.map((t) => le(t, s)) : e !== null && typeof e == "object" && !(e instanceof Date) ? s(e) : e;
823
823
  }
@@ -891,7 +891,7 @@ function Ct(e, s = ".") {
891
891
  }
892
892
  return t;
893
893
  }
894
- function jt(e) {
894
+ function $t(e) {
895
895
  return Object.entries(e).map(([s, t]) => ({
896
896
  id: s,
897
897
  label: t,
@@ -945,7 +945,7 @@ const re = (...e) => {
945
945
  }, mt = (...e) => {
946
946
  console.error("[Router]", ...e);
947
947
  };
948
- function $t(e, s) {
948
+ function jt(e, s) {
949
949
  const {
950
950
  getRouteStore: t,
951
951
  getPermissionStore: n,
@@ -984,11 +984,11 @@ function $t(e, s) {
984
984
  return e.beforeEach(async (u, I, p) => {
985
985
  if (ee.start(), a() && !c)
986
986
  try {
987
- const j = t(), P = n();
988
- if (await j.initRoutes(), await P.loadUserPermissions(), j.backendRoutes.length > 0) {
989
- 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 === "") {
990
990
  const T = ie(
991
- j.backendRoutes,
991
+ $.backendRoutes,
992
992
  P.routePermissions,
993
993
  h,
994
994
  v
@@ -1004,7 +1004,7 @@ function $t(e, s) {
1004
1004
  p({ ...u, replace: !0 });
1005
1005
  return;
1006
1006
  }
1007
- const H = j.backendRoutes.find((T) => T.name === u.name);
1007
+ const H = $.backendRoutes.find((T) => T.name === u.name);
1008
1008
  if (H && !P.routePermissions.includes(H.code)) {
1009
1009
  ue("无权限访问:", u.path), p({ name: k, replace: !0 });
1010
1010
  return;
@@ -1012,8 +1012,8 @@ function $t(e, s) {
1012
1012
  p({ ...u, replace: !0 });
1013
1013
  return;
1014
1014
  }
1015
- } catch (j) {
1016
- 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 });
1017
1017
  return;
1018
1018
  }
1019
1019
  if (O.includes(u.path)) {
@@ -1034,20 +1034,20 @@ function $t(e, s) {
1034
1034
  return;
1035
1035
  }
1036
1036
  if (u.path === "/") {
1037
- const j = ie(
1037
+ const $ = ie(
1038
1038
  E.backendRoutes,
1039
1039
  S.routePermissions,
1040
1040
  h,
1041
1041
  v
1042
1042
  );
1043
- if (j && j.path !== "/") {
1044
- p({ path: j.path, replace: !0 });
1043
+ if ($ && $.path !== "/") {
1044
+ p({ path: $.path, replace: !0 });
1045
1045
  return;
1046
1046
  }
1047
1047
  p();
1048
1048
  return;
1049
1049
  }
1050
- const V = E.backendRoutes.find((j) => j.name === u.name);
1050
+ const V = E.backendRoutes.find(($) => $.name === u.name);
1051
1051
  if (V && !S.routePermissions.includes(V.code)) {
1052
1052
  ue("无权限访问:", u.path), p({ name: k, replace: !0 });
1053
1053
  return;
@@ -1073,7 +1073,7 @@ export {
1073
1073
  st as JSidebar,
1074
1074
  Oe as JUploadImg,
1075
1075
  dt as buildRouteTree,
1076
- $t as createRouterGuard,
1076
+ jt as createRouterGuard,
1077
1077
  oe as deepClone,
1078
1078
  xt as default,
1079
1079
  rt as filterEmpty,
@@ -1084,7 +1084,7 @@ export {
1084
1084
  kt as pick,
1085
1085
  it as toCamelCase,
1086
1086
  ot as toSnakeCase,
1087
- jt as toTableColumns,
1087
+ $t as toTableColumns,
1088
1088
  pe as transformBackendRoutes,
1089
1089
  Ct as unflatten
1090
1090
  };