@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,28 +1,28 @@
|
|
|
1
|
-
import { useI18n as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useMessage as
|
|
5
|
-
import { ref as
|
|
6
|
-
function
|
|
7
|
-
const { t:
|
|
1
|
+
import { useI18n as B, useClient as M } from "@duxweb/dvha-core";
|
|
2
|
+
import x from "dayjs";
|
|
3
|
+
import C from "mime";
|
|
4
|
+
import { useMessage as k } from "naive-ui";
|
|
5
|
+
import { ref as y } from "vue";
|
|
6
|
+
function I() {
|
|
7
|
+
const { t: f } = B(), T = M(), p = y(!1), d = y({
|
|
8
8
|
loaded: 0,
|
|
9
9
|
total: 0,
|
|
10
10
|
percent: 0,
|
|
11
11
|
speed: 0,
|
|
12
12
|
speedText: "0 B/s",
|
|
13
13
|
remainingTime: 0
|
|
14
|
-
}),
|
|
15
|
-
if (
|
|
14
|
+
}), b = k(), g = (o) => {
|
|
15
|
+
if (o === 0)
|
|
16
16
|
return "0 B/s";
|
|
17
|
-
const
|
|
18
|
-
return `${(
|
|
19
|
-
},
|
|
20
|
-
const e = window.URL || window.webkitURL,
|
|
21
|
-
|
|
17
|
+
const n = ["B/s", "KB/s", "MB/s", "GB/s"], e = Math.floor(Math.log(o) / Math.log(1024));
|
|
18
|
+
return `${(o / 1024 ** e).toFixed(1)} ${n[e]}`;
|
|
19
|
+
}, l = (o, n) => {
|
|
20
|
+
const e = window.URL || window.webkitURL, a = e.createObjectURL(o), s = document.createElement("a");
|
|
21
|
+
s.href = a, s.download = n || "", document.body.appendChild(s), s.click(), document.body.removeChild(s), e.revokeObjectURL(a);
|
|
22
22
|
};
|
|
23
23
|
return {
|
|
24
|
-
file: (
|
|
25
|
-
|
|
24
|
+
file: (o, n, e, a, s) => {
|
|
25
|
+
p.value = !0, d.value = {
|
|
26
26
|
loaded: 0,
|
|
27
27
|
total: 0,
|
|
28
28
|
percent: 0,
|
|
@@ -30,71 +30,70 @@ function q() {
|
|
|
30
30
|
speedText: "0 B/s",
|
|
31
31
|
remainingTime: 0
|
|
32
32
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
path:
|
|
33
|
+
const u = Date.now();
|
|
34
|
+
T.request({
|
|
35
|
+
path: o,
|
|
36
36
|
method: "GET",
|
|
37
|
-
query:
|
|
37
|
+
query: n,
|
|
38
38
|
onDownloadProgress: (t) => {
|
|
39
|
-
const
|
|
39
|
+
const m = (Date.now() - u) / 1e3, r = m > 0 ? t.loaded / m : 0, c = (t.total || 0) - t.loaded, v = r > 0 ? c / r : 0, w = {
|
|
40
40
|
loaded: t.loaded,
|
|
41
41
|
total: t.total,
|
|
42
42
|
percent: t.percent || 0,
|
|
43
|
-
speed: Math.round(
|
|
44
|
-
speedText:
|
|
45
|
-
remainingTime: Math.round(
|
|
43
|
+
speed: Math.round(r),
|
|
44
|
+
speedText: g(r),
|
|
45
|
+
remainingTime: Math.round(v)
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
d.value = w, s?.(w);
|
|
48
48
|
}
|
|
49
49
|
}).then((t) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
s && (s == null ? void 0 : s.length) > 1 && (d = decodeURIComponent(s[1]));
|
|
50
|
+
const i = e || t.data.headers["content-type"], h = t.data.headers["content-disposition"];
|
|
51
|
+
if (a || (a = x().format("YYYY-MM-DD-HH:mm:ss"), i && (a = `${a}.${C.getExtension(i)}`)), h) {
|
|
52
|
+
const c = /filename=["']?([^"']+)/.exec(h);
|
|
53
|
+
c && c?.length > 1 && (a = decodeURIComponent(c[1]));
|
|
55
54
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
loaded:
|
|
60
|
-
total:
|
|
55
|
+
const m = t.data?.data instanceof Blob ? t.data?.data : new Blob([t.data?.data], { type: i || "application/octet-stream" });
|
|
56
|
+
l(m, a);
|
|
57
|
+
const r = {
|
|
58
|
+
loaded: d.value.total || d.value.loaded,
|
|
59
|
+
total: d.value.total || d.value.loaded,
|
|
61
60
|
percent: 100,
|
|
62
61
|
speed: 0,
|
|
63
|
-
speedText:
|
|
62
|
+
speedText: g(0),
|
|
64
63
|
remainingTime: 0
|
|
65
64
|
};
|
|
66
|
-
|
|
65
|
+
d.value = r, s?.(r);
|
|
67
66
|
}).catch((t) => {
|
|
68
|
-
|
|
67
|
+
b.error(t.error || f("hooks.download.failed"));
|
|
69
68
|
}).finally(() => {
|
|
70
|
-
|
|
69
|
+
p.value = !1;
|
|
71
70
|
});
|
|
72
71
|
},
|
|
73
|
-
url: (
|
|
72
|
+
url: (o, n) => {
|
|
74
73
|
const e = document.createElement("a");
|
|
75
|
-
e.href =
|
|
74
|
+
e.href = o, e.download = n || "", document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
76
75
|
},
|
|
77
|
-
blob:
|
|
78
|
-
base64: (
|
|
79
|
-
const e = atob(
|
|
76
|
+
blob: l,
|
|
77
|
+
base64: (o, n) => {
|
|
78
|
+
const e = atob(o.split(",")[1]), a = Array.from({ length: e.length });
|
|
80
79
|
for (let t = 0; t < e.length; t++)
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
80
|
+
a[t] = e.charCodeAt(t);
|
|
81
|
+
const s = new Uint8Array(a), u = new Blob([s], { type: "application/octet-stream" });
|
|
82
|
+
l(u, n);
|
|
84
83
|
},
|
|
85
|
-
loading:
|
|
86
|
-
progress:
|
|
87
|
-
image: (
|
|
88
|
-
fetch(
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
loading: p,
|
|
85
|
+
progress: d,
|
|
86
|
+
image: (o) => {
|
|
87
|
+
fetch(o).then((n) => {
|
|
88
|
+
n.blob().then((e) => {
|
|
89
|
+
l(e);
|
|
91
90
|
});
|
|
92
|
-
}).catch((
|
|
93
|
-
|
|
91
|
+
}).catch((n) => {
|
|
92
|
+
b.error(n.error || f("hooks.download.failed"));
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
};
|
|
97
96
|
}
|
|
98
97
|
export {
|
|
99
|
-
|
|
98
|
+
I as useDownload
|
|
100
99
|
};
|