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