yc-vep-ui 0.4.5 → 0.4.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.
@@ -2605,18 +2605,16 @@ function useDefaultTable(e, n) {
2605
2605
  onSuccess: (e) => {
2606
2606
  n?.onSuccess?.(e), o.total = e[i.total] || 0, a.value = e[i.table] || [];
2607
2607
  }
2608
- });
2608
+ }), u = !1;
2609
2609
  watchEffect(() => {
2610
+ if (u) return;
2610
2611
  let e = toValue(n.ready) ?? !0, r = toValue(n.defaultParams || {});
2611
- (o.page !== 1 || o.pageSize !== 10) && (o.page = 1, o.pageSize = 10);
2612
- let i = {};
2613
- for (let e in r) e !== "page" && e !== "pageSize" && (i[e] = r[e], c[e] = r[e]);
2614
- e && l.execute({
2615
- ...c,
2616
- ...i
2617
- });
2612
+ if (!(!e || !r)) {
2613
+ for (let e in r) c[e] = r[e];
2614
+ l.execute({ ...c }), u = !0;
2615
+ }
2618
2616
  }, { flush: "sync" });
2619
- function u(e = {}) {
2617
+ function d(e = {}) {
2620
2618
  let { page: n, pageSize: i, ...a } = e;
2621
2619
  o.page = n || 1, o.pageSize = i || 10;
2622
2620
  let s = [];
@@ -2627,10 +2625,10 @@ function useDefaultTable(e, n) {
2627
2625
  pageSize: o.pageSize
2628
2626
  });
2629
2627
  }
2630
- function d({ page: e, pageSize: n }) {
2628
+ function f({ page: e, pageSize: n }) {
2631
2629
  o.page = e, o.pageSize = n, c.page = e, c.pageSize = n;
2632
2630
  }
2633
- function f(e) {
2631
+ function p(e) {
2634
2632
  s.value = e;
2635
2633
  }
2636
2634
  return reactive({
@@ -2638,22 +2636,21 @@ function useDefaultTable(e, n) {
2638
2636
  data: a,
2639
2637
  pagination: o,
2640
2638
  selection: s,
2641
- reset: u,
2642
- updatePagination: d,
2643
- selectionChange: f
2639
+ reset: d,
2640
+ updatePagination: f,
2641
+ selectionChange: p
2644
2642
  });
2645
2643
  }
2646
2644
  //#endregion
2647
2645
  //#region src/hooks/useTable/common.ts
2648
2646
  function useComTable(e, n) {
2649
- let { defaultParams: r, ...i } = n, a = isRef(r) ? r : isReactive(r) ? toRef(r) : ref(r || {}), o = ["sort", ...n?.ignoreAttrs || []], s = ref(!1), c = useDefaultTable(e, {
2647
+ let { defaultParams: r, ...i } = n, a = isRef(r) ? r : isReactive(r) ? toRef(r) : ref(r || {}), o = ["sort", ...n?.ignoreAttrs || []], s = useDefaultTable(e, {
2650
2648
  ...i,
2651
2649
  ready: computed(() => {
2652
2650
  let e = isRef(n.ready) ? n.ready.value : n.ready, r = !!a.value?.tableId;
2653
2651
  return (e === void 0 || e) && r;
2654
2652
  }),
2655
2653
  defaultParams: computed(() => {
2656
- if (s.value) return null;
2657
2654
  let { tableId: e, page: n, pageSize: r, ...i } = toValue(a) || {};
2658
2655
  return {
2659
2656
  tableId: e,
@@ -2664,7 +2661,7 @@ function useComTable(e, n) {
2664
2661
  }),
2665
2662
  ignoreAttrs: o
2666
2663
  });
2667
- function l(e = {}) {
2664
+ function c(e = {}) {
2668
2665
  let { tableId: n, ...r } = toValue(a), i = {};
2669
2666
  o.forEach((e) => {
2670
2667
  r[e] !== void 0 && (i[e] = r[e]);
@@ -2674,62 +2671,57 @@ function useComTable(e, n) {
2674
2671
  pageSize: 10,
2675
2672
  ...i,
2676
2673
  ...e
2677
- }, c.reset();
2674
+ }, s.reset();
2678
2675
  }
2679
- function u(e) {
2676
+ function l(e) {
2680
2677
  let n = [
2681
2678
  "tableId",
2682
2679
  "page",
2683
2680
  "pageSize"
2684
2681
  ], r = {}, i = {}, o = toValue(a) || {};
2685
- Object.keys(e || {}).forEach((a) => {
2682
+ return Object.keys(e || {}).forEach((a) => {
2686
2683
  n.includes(a) ? r[a] = e[a] : i[a] = e[a];
2687
- }), r.tableId ||= o.tableId, r.page ||= o.page || 1, r.pageSize ||= o.pageSize || 10, Object.keys(i).length > 0 && (r.params = i), s.value = !0;
2688
- let l = c.execute(r);
2689
- return a.value = {
2690
- ...o,
2691
- ...e
2692
- }, s.value = !1, l;
2684
+ }), r.tableId ||= o.tableId, r.page ||= o.page || 1, r.pageSize ||= o.pageSize || 10, Object.keys(i).length > 0 && (r.params = i), s.execute(r);
2693
2685
  }
2694
- let d = () => toValue(a)?.tableId;
2695
- async function f(e) {
2686
+ let u = () => toValue(a)?.tableId;
2687
+ async function d(e) {
2696
2688
  return request_default.post("/common/insert", {
2697
2689
  params: { ...e },
2698
- tableId: d()
2690
+ tableId: u()
2699
2691
  });
2700
2692
  }
2701
- async function p(e) {
2693
+ async function f(e) {
2702
2694
  return request_default.post("/common/update", {
2703
2695
  params: { ...e },
2704
- tableId: d()
2696
+ tableId: u()
2705
2697
  });
2706
2698
  }
2707
- async function m(e) {
2699
+ async function p(e) {
2708
2700
  return request_default.post("/common/delete", {
2709
2701
  idList: e,
2710
- tableId: d()
2702
+ tableId: u()
2711
2703
  });
2712
2704
  }
2713
- async function g({ title: e = "export", url: n } = {}) {
2705
+ async function m({ title: e = "export", url: n } = {}) {
2714
2706
  let r = await request_default.blob(n ?? "/common/exportExcel", {
2715
- tableId: d(),
2707
+ tableId: u(),
2716
2708
  type: "all"
2717
2709
  }), i = new Blob([r]), a = document.createElement("a");
2718
2710
  a.href = window.URL.createObjectURL(i), a.download = `${e}.xlsx`, a.click(), VepMessage.success("导出成功"), window.URL.revokeObjectURL(a.href);
2719
2711
  }
2720
- let _ = reactive({
2721
- insert: f,
2722
- update: p,
2723
- remove: m,
2724
- delete: m,
2725
- exportData: g
2712
+ let g = reactive({
2713
+ insert: d,
2714
+ update: f,
2715
+ remove: p,
2716
+ delete: p,
2717
+ exportData: m
2726
2718
  });
2727
2719
  return watchEffect(() => {
2728
- Object.assign(_, c, {
2729
- reset: l,
2730
- execute: u
2720
+ Object.assign(g, s, {
2721
+ reset: c,
2722
+ execute: l
2731
2723
  });
2732
- }, { flush: "sync" }), _;
2724
+ }, { flush: "sync" }), g;
2733
2725
  }
2734
2726
  //#endregion
2735
2727
  //#region src/hooks/useTable/index.ts
@@ -1,2 +1,2 @@
1
- import { c as e, d as t, f as n, l as r, s as i, u as a } from "../entry-CzsmZrlW.js";
1
+ import { c as e, d as t, f as n, l as r, s as i, u as a } from "../entry-CT7-Be8v.js";
2
2
  export { e as useDictionary, n as useFetch, r as useRoute, a as useRouter, t as useTable, i as useUser };
@@ -1,2 +1,2 @@
1
- import { O as e, _ as t, b as n, v as r, y as i } from "../entry-CzsmZrlW.js";
1
+ import { O as e, _ as t, b as n, v as r, y as i } from "../entry-CT7-Be8v.js";
2
2
  export { t as baseUrl, n as request, e as tempToRender, r as uniq, i as uniqBy };
package/dist/vep-ui.js CHANGED
@@ -1,2 +1,2 @@
1
- import { A as e, C as t, D as n, E as r, S as i, T as a, a as o, g as s, h as c, i as l, k as u, m as d, n as f, o as p, p as m, r as h, t as g, w as _, x as v } from "./entry-CzsmZrlW.js";
1
+ import { A as e, C as t, D as n, E as r, S as i, T as a, a as o, g as s, h as c, i as l, k as u, m as d, n as f, o as p, p as m, r as h, t as g, w as _, x as v } from "./entry-CT7-Be8v.js";
2
2
  export { e as UiCard, i as UiDescriptions, v as UiDialog, a as UiEditor, n as UiFilter, r as UiForm, t as UiInfiniteScroll, d as UiStaffSelect, u as UiTable, _ as UiTree, m as UiUpload, s as WcUtils, o as YcApproval, c as YcMessage, l as YcPageAgent, h as default, h as ycPlugin, g as getHostVue, p as hooks, f as setHostVue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-vep-ui",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 + Element Plus 的企业级 UI 组件库",
6
6
  "keywords": [