yc-vep-ui 0.4.6 → 0.4.8
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.
|
@@ -2573,89 +2573,84 @@ function useFetch(e, n = {}) {
|
|
|
2573
2573
|
//#endregion
|
|
2574
2574
|
//#region src/hooks/useTable/default.ts
|
|
2575
2575
|
function useDefaultTable(e, n) {
|
|
2576
|
-
let
|
|
2576
|
+
let r = [
|
|
2577
2577
|
"tableName",
|
|
2578
2578
|
"sort",
|
|
2579
|
-
...
|
|
2580
|
-
],
|
|
2579
|
+
...n?.ignoreAttrs || []
|
|
2580
|
+
], i = n?.replaceAttrs || {
|
|
2581
2581
|
table: "table",
|
|
2582
2582
|
total: "total"
|
|
2583
|
-
},
|
|
2583
|
+
}, a = shallowRef([]), o = reactive({
|
|
2584
2584
|
total: 0,
|
|
2585
2585
|
page: 1,
|
|
2586
2586
|
pageSize: 10
|
|
2587
|
-
}),
|
|
2587
|
+
}), s = ref([]), c = reactive({
|
|
2588
2588
|
page: 1,
|
|
2589
2589
|
pageSize: 10
|
|
2590
2590
|
});
|
|
2591
|
-
if (n?.onBefore?.(
|
|
2591
|
+
if (n?.onBefore?.(c) === !1) return reactive({
|
|
2592
2592
|
loading: ref(!1),
|
|
2593
|
-
data:
|
|
2594
|
-
pagination:
|
|
2595
|
-
selection:
|
|
2593
|
+
data: a,
|
|
2594
|
+
pagination: o,
|
|
2595
|
+
selection: s,
|
|
2596
2596
|
execute: () => {},
|
|
2597
2597
|
reset: () => {},
|
|
2598
2598
|
updatePagination: () => {},
|
|
2599
2599
|
selectionChange: () => {}
|
|
2600
2600
|
});
|
|
2601
|
-
let
|
|
2601
|
+
let l = useFetch(e, {
|
|
2602
2602
|
...n,
|
|
2603
|
-
defaultParams:
|
|
2603
|
+
defaultParams: c,
|
|
2604
2604
|
immediate: !1,
|
|
2605
2605
|
onSuccess: (e) => {
|
|
2606
|
-
n?.onSuccess?.(e),
|
|
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
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
f.execute({
|
|
2617
|
-
...d,
|
|
2618
|
-
...o
|
|
2619
|
-
});
|
|
2610
|
+
if (u) return;
|
|
2611
|
+
let e = toValue(n.ready) ?? !0, r = toValue(n.defaultParams || {});
|
|
2612
|
+
if (!(!e || !r)) {
|
|
2613
|
+
for (let e in r) c[e] = r[e];
|
|
2614
|
+
l.execute({ ...c }), u = !0;
|
|
2615
|
+
}
|
|
2620
2616
|
}, { flush: "sync" });
|
|
2621
|
-
function
|
|
2622
|
-
let { page: n, pageSize:
|
|
2623
|
-
|
|
2624
|
-
let
|
|
2625
|
-
Object.keys(
|
|
2626
|
-
!
|
|
2627
|
-
}),
|
|
2628
|
-
page:
|
|
2629
|
-
pageSize:
|
|
2617
|
+
function d(e = {}) {
|
|
2618
|
+
let { page: n, pageSize: i, ...a } = e;
|
|
2619
|
+
o.page = n || 1, o.pageSize = i || 10;
|
|
2620
|
+
let s = [];
|
|
2621
|
+
Object.keys(c).forEach((e) => {
|
|
2622
|
+
!r.includes(e) && !(e in a) && s.push(e);
|
|
2623
|
+
}), s.forEach((e) => delete c[e]), Object.assign(c, a, {
|
|
2624
|
+
page: o.page,
|
|
2625
|
+
pageSize: o.pageSize
|
|
2630
2626
|
});
|
|
2631
2627
|
}
|
|
2632
|
-
function
|
|
2633
|
-
|
|
2628
|
+
function f({ page: e, pageSize: n }) {
|
|
2629
|
+
o.page = e, o.pageSize = n, c.page = e, c.pageSize = n;
|
|
2634
2630
|
}
|
|
2635
|
-
function
|
|
2636
|
-
|
|
2631
|
+
function p(e) {
|
|
2632
|
+
s.value = e;
|
|
2637
2633
|
}
|
|
2638
2634
|
return reactive({
|
|
2639
|
-
...
|
|
2640
|
-
data:
|
|
2641
|
-
pagination:
|
|
2642
|
-
selection:
|
|
2643
|
-
reset:
|
|
2644
|
-
updatePagination:
|
|
2645
|
-
selectionChange:
|
|
2635
|
+
...l,
|
|
2636
|
+
data: a,
|
|
2637
|
+
pagination: o,
|
|
2638
|
+
selection: s,
|
|
2639
|
+
reset: d,
|
|
2640
|
+
updatePagination: f,
|
|
2641
|
+
selectionChange: p
|
|
2646
2642
|
});
|
|
2647
2643
|
}
|
|
2648
2644
|
//#endregion
|
|
2649
2645
|
//#region src/hooks/useTable/common.ts
|
|
2650
2646
|
function useComTable(e, n) {
|
|
2651
|
-
let { defaultParams: r, ...i } = n, a = isRef(r) ? r : isReactive(r) ? toRef(r) : ref(r || {}), o = ["sort", ...n?.ignoreAttrs || []], s =
|
|
2647
|
+
let { defaultParams: r, ...i } = n, a = isRef(r) ? r : isReactive(r) ? toRef(r) : ref(r || {}), o = ["sort", ...n?.ignoreAttrs || []], s = useDefaultTable(e, {
|
|
2652
2648
|
...i,
|
|
2653
2649
|
ready: computed(() => {
|
|
2654
2650
|
let e = isRef(n.ready) ? n.ready.value : n.ready, r = !!a.value?.tableId;
|
|
2655
2651
|
return (e === void 0 || e) && r;
|
|
2656
2652
|
}),
|
|
2657
2653
|
defaultParams: computed(() => {
|
|
2658
|
-
if (s.value) return null;
|
|
2659
2654
|
let { tableId: e, page: n, pageSize: r, ...i } = toValue(a) || {};
|
|
2660
2655
|
return {
|
|
2661
2656
|
tableId: e,
|
|
@@ -2664,10 +2659,9 @@ function useComTable(e, n) {
|
|
|
2664
2659
|
params: i
|
|
2665
2660
|
};
|
|
2666
2661
|
}),
|
|
2667
|
-
ignoreAttrs: o
|
|
2668
|
-
isManualExecuting: s
|
|
2662
|
+
ignoreAttrs: o
|
|
2669
2663
|
});
|
|
2670
|
-
function
|
|
2664
|
+
function c(e = {}) {
|
|
2671
2665
|
let { tableId: n, ...r } = toValue(a), i = {};
|
|
2672
2666
|
o.forEach((e) => {
|
|
2673
2667
|
r[e] !== void 0 && (i[e] = r[e]);
|
|
@@ -2677,62 +2671,63 @@ function useComTable(e, n) {
|
|
|
2677
2671
|
pageSize: 10,
|
|
2678
2672
|
...i,
|
|
2679
2673
|
...e
|
|
2680
|
-
},
|
|
2674
|
+
}, s.reset();
|
|
2675
|
+
let { tableId: c, page: l, pageSize: u, ...d } = a.value, f = {
|
|
2676
|
+
tableId: c,
|
|
2677
|
+
page: l,
|
|
2678
|
+
pageSize: u
|
|
2679
|
+
};
|
|
2680
|
+
Object.keys(d).length > 0 && (f.params = d), s.execute(f);
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2682
|
+
function l(e) {
|
|
2683
2683
|
let n = [
|
|
2684
2684
|
"tableId",
|
|
2685
2685
|
"page",
|
|
2686
2686
|
"pageSize"
|
|
2687
2687
|
], r = {}, i = {}, o = toValue(a) || {};
|
|
2688
|
-
Object.keys(e || {}).forEach((a) => {
|
|
2688
|
+
return Object.keys(e || {}).forEach((a) => {
|
|
2689
2689
|
n.includes(a) ? r[a] = e[a] : i[a] = e[a];
|
|
2690
|
-
}), r.tableId ||= o.tableId, r.page ||= o.page || 1, r.pageSize ||= o.pageSize || 10, Object.keys(i).length > 0 && (r.params = i), s.
|
|
2691
|
-
let l = c.execute(r);
|
|
2692
|
-
return a.value = {
|
|
2693
|
-
...o,
|
|
2694
|
-
...e
|
|
2695
|
-
}, s.value = !1, l;
|
|
2690
|
+
}), 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);
|
|
2696
2691
|
}
|
|
2697
|
-
let
|
|
2698
|
-
async function
|
|
2692
|
+
let u = () => toValue(a)?.tableId;
|
|
2693
|
+
async function d(e) {
|
|
2699
2694
|
return request_default.post("/common/insert", {
|
|
2700
2695
|
params: { ...e },
|
|
2701
|
-
tableId:
|
|
2696
|
+
tableId: u()
|
|
2702
2697
|
});
|
|
2703
2698
|
}
|
|
2704
|
-
async function
|
|
2699
|
+
async function f(e) {
|
|
2705
2700
|
return request_default.post("/common/update", {
|
|
2706
2701
|
params: { ...e },
|
|
2707
|
-
tableId:
|
|
2702
|
+
tableId: u()
|
|
2708
2703
|
});
|
|
2709
2704
|
}
|
|
2710
|
-
async function
|
|
2705
|
+
async function p(e) {
|
|
2711
2706
|
return request_default.post("/common/delete", {
|
|
2712
2707
|
idList: e,
|
|
2713
|
-
tableId:
|
|
2708
|
+
tableId: u()
|
|
2714
2709
|
});
|
|
2715
2710
|
}
|
|
2716
|
-
async function
|
|
2711
|
+
async function m({ title: e = "export", url: n } = {}) {
|
|
2717
2712
|
let r = await request_default.blob(n ?? "/common/exportExcel", {
|
|
2718
|
-
tableId:
|
|
2713
|
+
tableId: u(),
|
|
2719
2714
|
type: "all"
|
|
2720
2715
|
}), i = new Blob([r]), a = document.createElement("a");
|
|
2721
2716
|
a.href = window.URL.createObjectURL(i), a.download = `${e}.xlsx`, a.click(), VepMessage.success("导出成功"), window.URL.revokeObjectURL(a.href);
|
|
2722
2717
|
}
|
|
2723
|
-
let
|
|
2724
|
-
insert:
|
|
2725
|
-
update:
|
|
2726
|
-
remove:
|
|
2727
|
-
delete:
|
|
2728
|
-
exportData:
|
|
2718
|
+
let g = reactive({
|
|
2719
|
+
insert: d,
|
|
2720
|
+
update: f,
|
|
2721
|
+
remove: p,
|
|
2722
|
+
delete: p,
|
|
2723
|
+
exportData: m
|
|
2729
2724
|
});
|
|
2730
2725
|
return watchEffect(() => {
|
|
2731
|
-
Object.assign(
|
|
2732
|
-
reset:
|
|
2733
|
-
execute:
|
|
2726
|
+
Object.assign(g, s, {
|
|
2727
|
+
reset: c,
|
|
2728
|
+
execute: l
|
|
2734
2729
|
});
|
|
2735
|
-
}, { flush: "sync" }),
|
|
2730
|
+
}, { flush: "sync" }), g;
|
|
2736
2731
|
}
|
|
2737
2732
|
//#endregion
|
|
2738
2733
|
//#region src/hooks/useTable/index.ts
|
package/dist/hooks/index.js
CHANGED
|
@@ -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-
|
|
1
|
+
import { c as e, d as t, f as n, l as r, s as i, u as a } from "../entry-D40zjrJF.js";
|
|
2
2
|
export { e as useDictionary, n as useFetch, r as useRoute, a as useRouter, t as useTable, i as useUser };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { O as e, _ as t, b as n, v as r, y as i } from "../entry-
|
|
1
|
+
import { O as e, _ as t, b as n, v as r, y as i } from "../entry-D40zjrJF.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-
|
|
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-D40zjrJF.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 };
|