@duxweb/dvha-pro 1.0.23 → 1.0.24
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/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/card/store.cjs +1 -1
- package/dist/cjs/components/carousel/carousel.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/crop/imageCropModal.cjs +1 -1
- package/dist/cjs/components/dashboard/hello.cjs +1 -1
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
- package/dist/cjs/components/dashboard/quick.cjs +1 -1
- package/dist/cjs/components/data/dynamicData.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/dialog/dialog.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
- package/dist/cjs/components/editor/aiEditor.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/formLayout.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/icon/iconPicker.cjs +1 -1
- package/dist/cjs/components/layout/filter.cjs +1 -1
- package/dist/cjs/components/layout/filterLayout.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/layout/tools.cjs +1 -1
- package/dist/cjs/components/list/card.cjs +1 -1
- package/dist/cjs/components/list/list.cjs +1 -1
- package/dist/cjs/components/media/media.cjs +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -1
- package/dist/cjs/components/modal/modalPage.cjs +1 -1
- package/dist/cjs/components/modal/modalTab.cjs +1 -1
- package/dist/cjs/components/panel/alert.cjs +1 -1
- package/dist/cjs/components/panel/collapse.cjs +1 -1
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/select/cardSelect.cjs +1 -1
- package/dist/cjs/components/status/listEmpty.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/components/upload/config.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/components/widget/connect.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/download.cjs +1 -1
- package/dist/cjs/hooks/echart.cjs +1 -1
- package/dist/cjs/hooks/image.cjs +1 -1
- package/dist/cjs/hooks/level.cjs +1 -1
- package/dist/cjs/hooks/table/color.cjs +1 -0
- package/dist/cjs/hooks/table/column.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/input.cjs +1 -1
- package/dist/cjs/hooks/table/map.cjs +1 -1
- package/dist/cjs/hooks/table/status.cjs +1 -1
- package/dist/cjs/hooks/table/switch.cjs +1 -1
- package/dist/cjs/hooks/table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pages/layout/global.cjs +1 -1
- package/dist/cjs/pages/layout/tab.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/stores/ui.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/components/card/card.js +24 -27
- package/dist/esm/components/card/store.js +33 -39
- package/dist/esm/components/carousel/carousel.js +16 -19
- package/dist/esm/components/crop/imageCrop.js +32 -35
- package/dist/esm/components/crop/imageCropModal.js +36 -37
- package/dist/esm/components/dashboard/hello.js +27 -30
- package/dist/esm/components/dashboard/helloBig.js +328 -331
- package/dist/esm/components/dashboard/quick.js +30 -33
- package/dist/esm/components/data/dynamicData.js +86 -98
- package/dist/esm/components/data/dynamicSelect.js +29 -31
- package/dist/esm/components/data/selectModal.js +45 -49
- package/dist/esm/components/dialog/dialog.js +54 -55
- package/dist/esm/components/drawer/drawer.js +23 -23
- package/dist/esm/components/drawer/drawerPage.js +39 -49
- package/dist/esm/components/editor/aiEditor.js +64 -70
- package/dist/esm/components/form/drawerForm.js +48 -48
- package/dist/esm/components/form/formItem.js +45 -51
- package/dist/esm/components/form/formLayout.js +7 -10
- package/dist/esm/components/form/modalForm.js +50 -50
- package/dist/esm/components/form/pageForm.js +47 -50
- package/dist/esm/components/form/settingForm.js +34 -37
- package/dist/esm/components/icon/iconPicker.js +54 -58
- package/dist/esm/components/layout/filter.js +13 -16
- package/dist/esm/components/layout/filterLayout.js +7 -10
- package/dist/esm/components/layout/list.js +299 -326
- package/dist/esm/components/layout/table.js +268 -283
- package/dist/esm/components/layout/tools.js +38 -41
- package/dist/esm/components/list/card.js +35 -38
- package/dist/esm/components/list/list.js +15 -18
- package/dist/esm/components/media/media.js +35 -36
- package/dist/esm/components/modal/modal.js +10 -10
- package/dist/esm/components/modal/modalPage.js +32 -36
- package/dist/esm/components/modal/modalTab.js +39 -45
- package/dist/esm/components/panel/alert.js +19 -22
- package/dist/esm/components/panel/collapse.js +33 -36
- package/dist/esm/components/panel/setting.js +25 -31
- package/dist/esm/components/select/cardSelect.js +27 -28
- package/dist/esm/components/status/listEmpty.js +13 -13
- package/dist/esm/components/table/tablePage.js +25 -25
- package/dist/esm/components/tree/treeFilter.js +137 -147
- package/dist/esm/components/upload/config.js +15 -27
- package/dist/esm/components/upload/file.js +90 -94
- package/dist/esm/components/upload/image.js +116 -123
- package/dist/esm/components/upload/manage/item.js +44 -47
- package/dist/esm/components/upload/manager.js +190 -207
- package/dist/esm/components/widget/connect.js +103 -106
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/action.js +115 -131
- package/dist/esm/hooks/download.js +55 -56
- package/dist/esm/hooks/echart.js +156 -179
- package/dist/esm/hooks/image.js +14 -15
- package/dist/esm/hooks/level.js +7 -7
- package/dist/esm/hooks/table/color.js +19 -0
- package/dist/esm/hooks/table/column.js +25 -23
- package/dist/esm/hooks/table/image.js +2 -2
- package/dist/esm/hooks/table/input.js +28 -28
- package/dist/esm/hooks/table/map.js +7 -7
- package/dist/esm/hooks/table/status.js +8 -9
- package/dist/esm/hooks/table/switch.js +19 -19
- package/dist/esm/hooks/table.js +27 -31
- package/dist/esm/index.js +167 -165
- package/dist/esm/pages/layout/global.js +12 -15
- package/dist/esm/pages/layout/tab.js +58 -71
- package/dist/esm/pages/login.js +81 -85
- package/dist/esm/pages/menu/avatar.js +136 -149
- package/dist/esm/pages/menu/button.js +16 -20
- package/dist/esm/pages/menu/cmd.js +68 -74
- package/dist/esm/pages/page.js +21 -25
- package/dist/esm/pages/pageStatus.js +21 -24
- package/dist/esm/stores/ui.js +15 -15
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/form/drawerForm.d.ts +6 -0
- package/dist/types/components/form/modalForm.d.ts +6 -0
- package/dist/types/components/form/pageForm.d.ts +6 -0
- package/dist/types/components/form/settingForm.d.ts +6 -0
- package/dist/types/components/layout/table.d.ts +9 -0
- package/dist/types/components/table/tablePage.d.ts +9 -0
- package/dist/types/hooks/table/color.d.ts +13 -0
- package/dist/types/hooks/table/column.d.ts +1 -0
- package/dist/types/hooks/table/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { useManage as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { useManage as p } from "@duxweb/dvha-core";
|
|
2
|
+
import { useTableColumnColor as C } from "./color.js";
|
|
3
|
+
import { useTableColumnCopy as f } from "./copy.js";
|
|
4
|
+
import { useTableColumnHidden as b } from "./hidden.js";
|
|
5
|
+
import { useTableColumnImage as T } from "./image.js";
|
|
6
|
+
import { useTableColumnInput as M } from "./input.js";
|
|
7
|
+
import { useTableColumnMap as h } from "./map.js";
|
|
8
|
+
import { useTableColumnMedia as I } from "./media.js";
|
|
9
|
+
import { useTableColumnStatus as S } from "./status.js";
|
|
10
|
+
import { useTableColumnSwitch as g } from "./switch.js";
|
|
11
|
+
function z(e) {
|
|
12
|
+
const { getPath: n } = p(), o = e?.path || n(), r = e?.rowKey || "id", m = I(), t = T(), u = g({
|
|
13
|
+
path: o,
|
|
13
14
|
rowKey: r
|
|
14
|
-
}),
|
|
15
|
-
path:
|
|
15
|
+
}), l = S(), d = C(), a = h(), c = M({
|
|
16
|
+
path: o,
|
|
16
17
|
rowKey: r
|
|
17
|
-
}),
|
|
18
|
+
}), s = f(), i = b();
|
|
18
19
|
return {
|
|
19
|
-
renderMedia:
|
|
20
|
-
renderImage:
|
|
20
|
+
renderMedia: m.render,
|
|
21
|
+
renderImage: t.render,
|
|
21
22
|
renderSwitch: u.render,
|
|
22
|
-
renderStatus:
|
|
23
|
-
renderMap:
|
|
24
|
-
renderInput:
|
|
25
|
-
renderCopy:
|
|
26
|
-
renderHidden: i.render
|
|
23
|
+
renderStatus: l.render,
|
|
24
|
+
renderMap: a.render,
|
|
25
|
+
renderInput: c.render,
|
|
26
|
+
renderCopy: s.render,
|
|
27
|
+
renderHidden: i.render,
|
|
28
|
+
renderColor: d.render
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
z as useTableColumn
|
|
31
33
|
};
|
|
@@ -50,8 +50,8 @@ function it() {
|
|
|
50
50
|
}, [i.length > 0 ? i.map((p, a) => r(g, {
|
|
51
51
|
key: a,
|
|
52
52
|
src: p,
|
|
53
|
-
width: t.imageWidth,
|
|
54
|
-
height: t.imageHeight,
|
|
53
|
+
width: t.imageWidth || 40,
|
|
54
|
+
height: t.imageHeight || 40,
|
|
55
55
|
objectFit: "cover",
|
|
56
56
|
fallbackSrc: "data:image/svg+xml;base64,"
|
|
57
57
|
}, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createVNode as a, defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { get as
|
|
4
|
-
import { useMessage as
|
|
5
|
-
const
|
|
1
|
+
import { createVNode as a, defineComponent as f, ref as r, h as o } from "vue";
|
|
2
|
+
import { useI18n as v, useCustomMutation as m } from "@duxweb/dvha-core";
|
|
3
|
+
import { get as h } from "lodash-es";
|
|
4
|
+
import { useMessage as g, NInput as y, NButton as b } from "naive-ui";
|
|
5
|
+
const C = /* @__PURE__ */ f({
|
|
6
6
|
name: "TableColumnInput",
|
|
7
7
|
props: {
|
|
8
8
|
data: {
|
|
@@ -23,32 +23,32 @@ const I = /* @__PURE__ */ v({
|
|
|
23
23
|
},
|
|
24
24
|
setup(e) {
|
|
25
25
|
const {
|
|
26
|
-
t:
|
|
27
|
-
} =
|
|
28
|
-
mutateAsync:
|
|
29
|
-
} =
|
|
30
|
-
|
|
26
|
+
t: i
|
|
27
|
+
} = v(), l = r(!1), t = r(""), {
|
|
28
|
+
mutateAsync: d
|
|
29
|
+
} = m(), n = g(), s = (u) => {
|
|
30
|
+
d({
|
|
31
31
|
path: e.path,
|
|
32
32
|
method: "PATCH",
|
|
33
33
|
payload: {
|
|
34
|
-
[e.field]:
|
|
34
|
+
[e.field]: u
|
|
35
35
|
}
|
|
36
36
|
}).then(() => {
|
|
37
|
-
|
|
38
|
-
}).catch((
|
|
39
|
-
|
|
37
|
+
n.success(i("hooks.table.saveSuccess"));
|
|
38
|
+
}).catch((c) => {
|
|
39
|
+
n.error(c.message);
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
-
return () =>
|
|
42
|
+
return () => l.value ? a("div", {
|
|
43
43
|
class: "flex gap-2"
|
|
44
|
-
}, [a("div", null, [
|
|
44
|
+
}, [a("div", null, [o(e.tag || y, {
|
|
45
45
|
value: t.value,
|
|
46
|
-
"onUpdate:value": (
|
|
46
|
+
"onUpdate:value": (u) => t.value = u,
|
|
47
47
|
autofocus: !0
|
|
48
|
-
})]), a(
|
|
48
|
+
})]), a(b, {
|
|
49
49
|
type: "primary",
|
|
50
50
|
onClick: () => {
|
|
51
|
-
t.value !== e.data[e.field] ?
|
|
51
|
+
t.value !== e.data[e.field] ? s(t.value) : l.value = !1;
|
|
52
52
|
},
|
|
53
53
|
renderIcon: () => a("div", {
|
|
54
54
|
class: "size-4 i-tabler:check"
|
|
@@ -60,24 +60,24 @@ const I = /* @__PURE__ */ v({
|
|
|
60
60
|
}, [a("div", null, [e.data[e.field] === void 0 || e.data[e.field] === "" ? "-" : e.data[e.field]]), a("div", {
|
|
61
61
|
class: "cursor-pointer i-tabler:pencil size-4 text-muted hover:text-primary",
|
|
62
62
|
onClick: () => {
|
|
63
|
-
t.value = e.data[e.field],
|
|
63
|
+
t.value = e.data[e.field], l.value = !0;
|
|
64
64
|
}
|
|
65
65
|
}, null)])]);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
function
|
|
68
|
+
function T(e) {
|
|
69
69
|
return {
|
|
70
|
-
render: (
|
|
71
|
-
const
|
|
72
|
-
return a(
|
|
70
|
+
render: (l) => (t, d) => {
|
|
71
|
+
const n = typeof e?.path == "function" ? e?.path(t) : `${e?.path}/${h(t, e?.rowKey || "id")}`;
|
|
72
|
+
return a(C, {
|
|
73
73
|
data: t,
|
|
74
|
-
field:
|
|
75
|
-
path:
|
|
76
|
-
tag:
|
|
74
|
+
field: l.key,
|
|
75
|
+
path: n,
|
|
76
|
+
tag: l.tag
|
|
77
77
|
}, null);
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
T as useTableColumnInput
|
|
83
83
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createVNode as n } from "vue";
|
|
2
|
-
import { get as
|
|
3
|
-
function
|
|
2
|
+
import { get as a } from "lodash-es";
|
|
3
|
+
function p() {
|
|
4
4
|
return {
|
|
5
|
-
render: (r) => (l,
|
|
6
|
-
const
|
|
5
|
+
render: (r) => (l, o) => {
|
|
6
|
+
const s = typeof r.maps == "function" ? r.maps(l) : r.maps;
|
|
7
7
|
return n("div", {
|
|
8
8
|
class: "flex flex-col gap-1"
|
|
9
|
-
}, [
|
|
9
|
+
}, [s?.map((e) => n("div", {
|
|
10
10
|
class: "flex gap-2 "
|
|
11
11
|
}, [n("div", {
|
|
12
12
|
class: "flex text-muted items-center gap-1 whitespace-nowrap"
|
|
13
13
|
}, [e.icon && n("div", {
|
|
14
14
|
class: ["size-4", e.icon]
|
|
15
|
-
}, null), e.label]), n("div", null, [e
|
|
15
|
+
}, null), e.label]), n("div", null, [e?.render ? e.render(a(l, e.key || "")) : a(l, e.key || "") || "-"])]))]);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
p as useTableColumnMap
|
|
21
21
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { createVNode as l, Fragment as
|
|
2
|
-
import { findKey as
|
|
1
|
+
import { createVNode as l, Fragment as a } from "vue";
|
|
2
|
+
import { findKey as u, get as o } from "lodash-es";
|
|
3
3
|
import { NTag as s } from "naive-ui";
|
|
4
|
-
function
|
|
4
|
+
function x() {
|
|
5
5
|
return {
|
|
6
|
-
render: (n) => (
|
|
7
|
-
|
|
8
|
-
const a = (n == null ? void 0 : n.key) || "status", e = d(n.maps, (t) => t ? (t == null ? void 0 : t.value) === o(c, a) : !1), r = e ? (i = n.maps) == null ? void 0 : i[e] : void 0;
|
|
6
|
+
render: (n) => (i, f) => {
|
|
7
|
+
const c = n?.key || "status", e = u(n.maps, (t) => t ? t?.value === o(i, c) : !1), r = e ? n.maps?.[e] : void 0;
|
|
9
8
|
return r ? l(s, {
|
|
10
9
|
round: !0,
|
|
11
10
|
bordered: !0,
|
|
12
11
|
type: e
|
|
13
12
|
}, {
|
|
14
|
-
icon: () => l(
|
|
13
|
+
icon: () => l(a, null, [e === "success" && l("div", {
|
|
15
14
|
class: "n-icon i-tabler:circle-check-filled"
|
|
16
15
|
}, null), e === "error" && l("div", {
|
|
17
16
|
class: "n-icon i-tabler:circle-x-filled"
|
|
@@ -22,11 +21,11 @@ function g() {
|
|
|
22
21
|
}, null)]),
|
|
23
22
|
default: () => l("span", {
|
|
24
23
|
class: "text-sm"
|
|
25
|
-
}, [r
|
|
24
|
+
}, [r?.label])
|
|
26
25
|
}) : null;
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
x as useTableColumnStatus
|
|
32
31
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { useCustomMutation as
|
|
3
|
-
import { get as
|
|
4
|
-
import { useMessage as
|
|
5
|
-
function
|
|
1
|
+
import { createVNode as i } from "vue";
|
|
2
|
+
import { useCustomMutation as h } from "@duxweb/dvha-core";
|
|
3
|
+
import { get as p } from "lodash-es";
|
|
4
|
+
import { useMessage as a, NSwitch as d } from "naive-ui";
|
|
5
|
+
function A(n) {
|
|
6
6
|
const {
|
|
7
|
-
mutateAsync:
|
|
8
|
-
} =
|
|
7
|
+
mutateAsync: o
|
|
8
|
+
} = h(), s = a();
|
|
9
9
|
return {
|
|
10
|
-
render: (
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
value: !!t
|
|
14
|
-
onUpdateValue: (
|
|
15
|
-
t
|
|
16
|
-
path:
|
|
10
|
+
render: (u) => (e, y) => {
|
|
11
|
+
const t = u.key || "status", m = typeof n?.path == "function" ? n?.path(e) : `${n?.path}/${p(e, n?.rowKey || "id")}`;
|
|
12
|
+
return i(d, {
|
|
13
|
+
value: !!e[t],
|
|
14
|
+
onUpdateValue: (r) => {
|
|
15
|
+
e[t] = r, o({
|
|
16
|
+
path: m,
|
|
17
17
|
method: "PATCH",
|
|
18
18
|
payload: {
|
|
19
|
-
[
|
|
19
|
+
[t]: r
|
|
20
20
|
}
|
|
21
21
|
}).then(() => {
|
|
22
|
-
t
|
|
23
|
-
}).catch((
|
|
24
|
-
t
|
|
22
|
+
e[t] = r;
|
|
23
|
+
}).catch((c) => {
|
|
24
|
+
e[t] = !r, s.error(c.message);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}, null);
|
|
@@ -29,5 +29,5 @@ function $(e) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
A as useTableColumnSwitch
|
|
33
33
|
};
|
package/dist/esm/hooks/table.js
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useNaiveTable as
|
|
4
|
-
import { useMessage as
|
|
5
|
-
function
|
|
1
|
+
import { ref as c, createVNode as r, createTextVNode as u } from "vue";
|
|
2
|
+
import { useI18n as i } from "@duxweb/dvha-core";
|
|
3
|
+
import { useNaiveTable as p } from "@duxweb/dvha-naiveui";
|
|
4
|
+
import { useMessage as m, useNotification as g, NProgress as a } from "naive-ui";
|
|
5
|
+
function k(l) {
|
|
6
6
|
const {
|
|
7
7
|
t: o
|
|
8
|
-
} =
|
|
9
|
-
return
|
|
10
|
-
...
|
|
8
|
+
} = i(), n = m(), s = g(), t = c(null);
|
|
9
|
+
return p({
|
|
10
|
+
...l,
|
|
11
11
|
// 传递导出回调
|
|
12
12
|
onExportSuccess: (e) => {
|
|
13
|
-
|
|
14
|
-
(s = t.value) == null || s.destroy(), t.value = null, n.success({
|
|
13
|
+
t.value?.destroy(), t.value = null, s.success({
|
|
15
14
|
title: o("hooks.table.exportSuccess"),
|
|
16
15
|
content: o("hooks.table.exportSuccessContent", {
|
|
17
|
-
count:
|
|
16
|
+
count: e?.data?.length || 0
|
|
18
17
|
}),
|
|
19
18
|
duration: 6e3
|
|
20
19
|
});
|
|
21
20
|
},
|
|
22
21
|
onExportProgress: (e) => {
|
|
23
|
-
!t.value && e && (t.value =
|
|
22
|
+
!t.value && e && (t.value = s.create({
|
|
24
23
|
title: o("hooks.table.exportProgress"),
|
|
25
24
|
content: () => o("hooks.table.exportProgressContent", {
|
|
26
25
|
page: e.page || 1
|
|
27
26
|
}),
|
|
28
|
-
avatar: () =>
|
|
27
|
+
avatar: () => r(a, {
|
|
29
28
|
class: "size-10 text-sm",
|
|
30
29
|
type: "circle",
|
|
31
30
|
percentage: 50
|
|
32
31
|
}, {
|
|
33
|
-
default: () => [
|
|
32
|
+
default: () => [r("div", {
|
|
34
33
|
class: "text-xs"
|
|
35
34
|
}, [e.page || 1])]
|
|
36
35
|
}),
|
|
@@ -40,37 +39,35 @@ function E(u) {
|
|
|
40
39
|
}));
|
|
41
40
|
},
|
|
42
41
|
onExportError: (e) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
error: (e == null ? void 0 : e.message) || o("common.unknownError")
|
|
42
|
+
t.value?.destroy(), t.value = null, n.error(o("hooks.table.exportFailedContent", {
|
|
43
|
+
error: e?.message || o("common.unknownError")
|
|
46
44
|
}));
|
|
47
45
|
},
|
|
48
46
|
// 传递导入回调
|
|
49
47
|
onImportSuccess: (e) => {
|
|
50
|
-
|
|
51
|
-
(s = t.value) == null || s.destroy(), t.value = null, n.success({
|
|
48
|
+
t.value?.destroy(), t.value = null, s.success({
|
|
52
49
|
title: o("hooks.table.importSuccess"),
|
|
53
50
|
content: o("hooks.table.importSuccessContent", {
|
|
54
|
-
count:
|
|
51
|
+
count: e?.processedItems || 0
|
|
55
52
|
}),
|
|
56
53
|
duration: 6e3
|
|
57
54
|
});
|
|
58
55
|
},
|
|
59
56
|
onImportProgress: (e) => {
|
|
60
|
-
t.value || (t.value =
|
|
57
|
+
t.value || (t.value = s.create({
|
|
61
58
|
title: o("hooks.table.importProgress"),
|
|
62
59
|
content: () => o("hooks.table.importProgressContent", {
|
|
63
|
-
processed:
|
|
64
|
-
total:
|
|
60
|
+
processed: e?.processedItems || 0,
|
|
61
|
+
total: e?.totalItems || 0
|
|
65
62
|
}),
|
|
66
|
-
avatar: () =>
|
|
63
|
+
avatar: () => r(a, {
|
|
67
64
|
class: "size-10 text-sm",
|
|
68
65
|
type: "circle",
|
|
69
|
-
percentage:
|
|
66
|
+
percentage: e?.percentage || 0
|
|
70
67
|
}, {
|
|
71
|
-
default: () => [
|
|
68
|
+
default: () => [r("div", {
|
|
72
69
|
class: "text-xs"
|
|
73
|
-
}, [
|
|
70
|
+
}, [e?.percentage || 0, u("%")])]
|
|
74
71
|
}),
|
|
75
72
|
onClose: () => {
|
|
76
73
|
t.value = null;
|
|
@@ -78,13 +75,12 @@ function E(u) {
|
|
|
78
75
|
}));
|
|
79
76
|
},
|
|
80
77
|
onImportError: (e) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
error: (e == null ? void 0 : e.message) || o("common.unknownError")
|
|
78
|
+
t.value?.destroy(), t.value = null, n.error(o("hooks.table.importFailedContent", {
|
|
79
|
+
error: e?.message || o("common.unknownError")
|
|
84
80
|
}));
|
|
85
81
|
}
|
|
86
82
|
});
|
|
87
83
|
}
|
|
88
84
|
export {
|
|
89
|
-
|
|
85
|
+
k as useTable
|
|
90
86
|
};
|