@duxweb/dvha-pro 1.0.18 → 1.0.19
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/component.cjs +1 -1
- package/dist/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/code/code.cjs +1 -0
- package/dist/cjs/components/crop/imageCrop.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/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/drawer/drawerPage.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/icon.cjs +1 -1
- package/dist/cjs/components/layout/filter.cjs +1 -1
- package/dist/cjs/components/layout/filterLayout.cjs +1 -0
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/level/level.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/panel/collapse.cjs +1 -0
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/status/listEmpty.cjs +1 -0
- package/dist/cjs/components/table/table.cjs +1 -0
- 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 -0
- 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/dvha-pro.css +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/hooks/table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.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/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/naiveTheme.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +23 -7
- package/dist/esm/component.js +36 -34
- package/dist/esm/components/card/card.js +6 -6
- package/dist/esm/components/chart/echart.js +17 -6
- package/dist/esm/components/code/code.js +53 -0
- package/dist/esm/components/crop/imageCrop.js +37 -26
- package/dist/esm/components/data/dynamicSelect.js +29 -18
- package/dist/esm/components/data/selectModal.js +49 -38
- package/dist/esm/components/drawer/drawer.js +17 -28
- package/dist/esm/components/drawer/drawerPage.js +54 -17
- package/dist/esm/components/form/formItem.js +17 -17
- package/dist/esm/components/form/formLayout.js +8 -8
- package/dist/esm/components/form/modalForm.js +44 -35
- package/dist/esm/components/form/pageForm.js +81 -43
- package/dist/esm/components/form/settingForm.js +28 -17
- package/dist/esm/components/icon/icon.js +23 -12
- package/dist/esm/components/layout/filter.js +15 -11
- package/dist/esm/components/layout/filterLayout.js +34 -0
- package/dist/esm/components/layout/list.js +206 -160
- package/dist/esm/components/layout/table.js +212 -185
- package/dist/esm/components/level/level.js +28 -17
- package/dist/esm/components/modal/modal.js +9 -9
- package/dist/esm/components/modal/modalPage.js +2 -2
- package/dist/esm/components/panel/collapse.js +49 -0
- package/dist/esm/components/panel/setting.js +3 -3
- package/dist/esm/components/status/listEmpty.js +26 -0
- package/dist/esm/components/table/table.js +110 -0
- package/dist/esm/components/table/tablePage.js +24 -18
- package/dist/esm/components/tree/treeFilter.js +44 -39
- package/dist/esm/components/upload/config.js +32 -0
- package/dist/esm/components/upload/file.js +142 -116
- package/dist/esm/components/upload/image.js +95 -66
- package/dist/esm/components/upload/manage/item.js +17 -6
- package/dist/esm/components/upload/manager.js +202 -164
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/action.js +77 -75
- package/dist/esm/hooks/dialog.js +13 -2
- package/dist/esm/hooks/drawer.js +13 -2
- package/dist/esm/hooks/modal.js +13 -2
- package/dist/esm/hooks/table/image.js +21 -10
- package/dist/esm/hooks/table/media.js +20 -9
- package/dist/esm/hooks/table.js +16 -13
- package/dist/esm/index.js +174 -164
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +1 -1
- package/dist/esm/pages/authLayout.js +19 -8
- package/dist/esm/pages/layout/page.js +17 -6
- package/dist/esm/pages/login.js +40 -29
- package/dist/esm/pages/menu/avatar.js +45 -34
- package/dist/esm/pages/menu/button.js +23 -12
- package/dist/esm/pages/menu/cmd.js +45 -34
- package/dist/esm/pages/menu/main.js +40 -27
- package/dist/esm/pages/menu/mobile.js +13 -2
- package/dist/esm/pages/page.js +1 -1
- package/dist/esm/pages/page404.js +20 -9
- package/dist/esm/pages/pageStatus.js +31 -15
- package/dist/esm/theme/naiveTheme.js +6 -6
- package/dist/esm/theme/uno.css.js +23 -7
- package/dist/types/components/code/code.d.ts +44 -0
- package/dist/types/components/code/index.d.ts +1 -0
- package/dist/types/components/drawer/drawer.d.ts +2 -0
- package/dist/types/components/drawer/drawerPage.d.ts +20 -1
- package/dist/types/components/form/formItem.d.ts +2 -2
- package/dist/types/components/form/formLayout.d.ts +3 -3
- package/dist/types/components/form/modalForm.d.ts +3 -3
- package/dist/types/components/form/pageForm.d.ts +12 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/layout/filterLayout.d.ts +32 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/layout/table.d.ts +3 -0
- package/dist/types/components/panel/collapse.d.ts +14 -0
- package/dist/types/components/panel/index.d.ts +1 -0
- package/dist/types/components/select/cardSelect.d.ts +1 -1
- package/dist/types/components/status/index.d.ts +1 -0
- package/dist/types/components/status/listEmpty.d.ts +11 -0
- package/dist/types/components/table/index.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +6552 -0
- package/dist/types/components/table/tablePage.d.ts +3 -0
- package/dist/types/components/tree/treeFilter.d.ts +13 -12
- package/dist/types/components/upload/config.d.ts +13 -0
- package/dist/types/components/upload/file.d.ts +4 -0
- package/dist/types/components/upload/image.d.ts +30 -2
- package/dist/types/components/upload/manager.d.ts +4 -0
- package/dist/types/hooks/drawer.d.ts +1 -0
- package/dist/types/hooks/table/types.d.ts +1 -0
- package/dist/types/main.d.ts +6 -0
- package/dist/types/pages/pageStatus.d.ts +11 -1
- package/package.json +6 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as c, createVNode as t } from "vue";
|
|
2
2
|
import { useI18n as s } from "@duxweb/dvha-core";
|
|
3
3
|
import a from "clsx";
|
|
4
|
-
import { NCheckbox as u, NImage as
|
|
4
|
+
import { NCheckbox as u, NImage as p } from "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
6
|
-
import { useDialog as
|
|
6
|
+
import { useDialog as d } from "../../../hooks/dialog.js";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "vue-echarts";
|
|
9
9
|
import "@vueuse/core";
|
|
@@ -35,10 +35,21 @@ import h from "../../../static/images/icon/pdf.svg.js";
|
|
|
35
35
|
import x from "../../../static/images/icon/ppt.svg.js";
|
|
36
36
|
import k from "../../../static/images/icon/video.svg.js";
|
|
37
37
|
import w from "../../../static/images/icon/word.svg.js";
|
|
38
|
+
import "vue3-ace-editor";
|
|
39
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
40
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
41
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
42
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
43
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
44
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
45
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
46
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
47
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
48
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
38
49
|
import "dayjs";
|
|
39
50
|
import "@tanstack/vue-query";
|
|
40
51
|
import "pinia";
|
|
41
|
-
const
|
|
52
|
+
const xe = /* @__PURE__ */ c({
|
|
42
53
|
name: "DuxFileManageItem",
|
|
43
54
|
props: {
|
|
44
55
|
name: String,
|
|
@@ -51,7 +62,7 @@ const le = /* @__PURE__ */ c({
|
|
|
51
62
|
onSelect: Function
|
|
52
63
|
},
|
|
53
64
|
setup(i) {
|
|
54
|
-
const o =
|
|
65
|
+
const o = d(), {
|
|
55
66
|
t: r
|
|
56
67
|
} = s(), m = {
|
|
57
68
|
image: {
|
|
@@ -59,7 +70,7 @@ const le = /* @__PURE__ */ c({
|
|
|
59
70
|
render: () => t("div", {
|
|
60
71
|
class: "size-12 flex items-center justify-center",
|
|
61
72
|
onClick: (e) => e.stopPropagation()
|
|
62
|
-
}, [t(
|
|
73
|
+
}, [t(p, {
|
|
63
74
|
src: i.url,
|
|
64
75
|
width: 48,
|
|
65
76
|
height: 48
|
|
@@ -175,5 +186,5 @@ const le = /* @__PURE__ */ c({
|
|
|
175
186
|
}
|
|
176
187
|
});
|
|
177
188
|
export {
|
|
178
|
-
|
|
189
|
+
xe as DuxFileManageItem
|
|
179
190
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { cloneDeep as
|
|
4
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as fe, ref as m, computed as te, createVNode as e, nextTick as ve, createTextVNode as oe, isVNode as ge } from "vue";
|
|
2
|
+
import { useI18n as he, useClient as be, useInfiniteList as ye, useUpload as xe } from "@duxweb/dvha-core";
|
|
3
|
+
import { cloneDeep as Me } from "lodash-es";
|
|
4
|
+
import { useMessage as Pe, NTabs as ke, NTab as w, NButton as h, NInput as ne, NInfiniteScroll as Ce, NTooltip as we, NSpin as Se, NDropdown as Ne } from "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
6
|
-
import { useDialog as
|
|
6
|
+
import { useDialog as Te } from "../../hooks/dialog.js";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "vue-echarts";
|
|
@@ -11,7 +11,7 @@ import "@vueuse/core";
|
|
|
11
11
|
import "vue-cropper";
|
|
12
12
|
import "jinrishici";
|
|
13
13
|
import "vue-draggable-plus";
|
|
14
|
-
import { DuxDrawEmpty as
|
|
14
|
+
import { DuxDrawEmpty as Ee } from "../draw/drawEmpty.js";
|
|
15
15
|
import "aieditor";
|
|
16
16
|
import "vee-validate";
|
|
17
17
|
import "@vee-validate/i18n";
|
|
@@ -28,14 +28,26 @@ import "@duxweb/dvha-naiveui";
|
|
|
28
28
|
import "../../pages/page404.js";
|
|
29
29
|
import "@iconify-json/tabler/icons.json";
|
|
30
30
|
import "mime";
|
|
31
|
-
import {
|
|
31
|
+
import { useUploadConfig as je } from "./config.js";
|
|
32
|
+
import "vue3-ace-editor";
|
|
33
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
34
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
35
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
36
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
37
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
38
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
39
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
40
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
41
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
42
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
43
|
+
import { useDownload as Fe } from "../../hooks/download.js";
|
|
32
44
|
import "@tanstack/vue-query";
|
|
33
45
|
import "pinia";
|
|
34
|
-
import { DuxFileManageItem as
|
|
35
|
-
function N(
|
|
36
|
-
return typeof
|
|
46
|
+
import { DuxFileManageItem as re } from "./manage/item.js";
|
|
47
|
+
function N(t) {
|
|
48
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !ge(t);
|
|
37
49
|
}
|
|
38
|
-
const
|
|
50
|
+
const Ca = /* @__PURE__ */ fe({
|
|
39
51
|
name: "DuxFileManage",
|
|
40
52
|
props: {
|
|
41
53
|
path: String,
|
|
@@ -45,243 +57,269 @@ const ta = /* @__PURE__ */ ne({
|
|
|
45
57
|
multiple: Boolean,
|
|
46
58
|
page: {
|
|
47
59
|
type: Boolean,
|
|
48
|
-
default: !
|
|
60
|
+
default: !1
|
|
49
61
|
},
|
|
50
62
|
handle: String,
|
|
51
63
|
uploadParams: Object
|
|
52
64
|
},
|
|
53
|
-
setup(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
setup(t) {
|
|
66
|
+
var F, I, U, V;
|
|
67
|
+
const y = m(!1), T = m(0), E = m(0), {
|
|
68
|
+
t: o
|
|
69
|
+
} = he(), n = m([]), x = Te(), S = be(), f = Pe(), ue = Fe(), i = m({
|
|
70
|
+
type: t.type || "all",
|
|
71
|
+
folder: null
|
|
72
|
+
}), M = m(), {
|
|
73
|
+
uploadPath: de,
|
|
74
|
+
managePath: P,
|
|
75
|
+
driver: ie
|
|
76
|
+
} = je({
|
|
77
|
+
driver: (F = t.uploadParams) == null ? void 0 : F.driver,
|
|
78
|
+
signPath: (I = t.uploadParams) == null ? void 0 : I.signPath,
|
|
79
|
+
signCallback: (U = t.uploadParams) == null ? void 0 : U.signCallback,
|
|
80
|
+
uploadPath: (V = t.uploadParams) == null ? void 0 : V.path,
|
|
81
|
+
managePath: t.path
|
|
82
|
+
}), se = m({
|
|
69
83
|
page: 1,
|
|
70
84
|
pageSize: 20
|
|
71
|
-
}),
|
|
72
|
-
path:
|
|
73
|
-
pagination:
|
|
74
|
-
filters:
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
}), u = ye({
|
|
86
|
+
path: P.value,
|
|
87
|
+
pagination: se.value,
|
|
88
|
+
filters: i.value
|
|
89
|
+
}), ce = te(() => {
|
|
90
|
+
const {
|
|
91
|
+
driver: d,
|
|
92
|
+
signPath: s,
|
|
93
|
+
signCallback: v,
|
|
94
|
+
...C
|
|
95
|
+
} = t.uploadParams || {};
|
|
96
|
+
return C;
|
|
97
|
+
}), k = xe({
|
|
98
|
+
...ce.value,
|
|
99
|
+
path: de.value,
|
|
100
|
+
autoUpload: !0,
|
|
101
|
+
driver: ie.value,
|
|
102
|
+
onSuccess: () => {
|
|
103
|
+
n.value = [], u.refetch();
|
|
104
|
+
},
|
|
105
|
+
onError: (d) => {
|
|
106
|
+
f.error((d == null ? void 0 : d.message) || o("components.uploadManage.uploadError") || "");
|
|
107
|
+
}
|
|
108
|
+
}), pe = (d) => {
|
|
109
|
+
if (!d) {
|
|
110
|
+
f.error(o("components.uploadManage.namePlaceholder") || "");
|
|
78
111
|
return;
|
|
79
112
|
}
|
|
80
|
-
|
|
81
|
-
path:
|
|
113
|
+
S.request({
|
|
114
|
+
path: P.value,
|
|
82
115
|
method: "POST",
|
|
83
116
|
payload: {
|
|
84
|
-
name:
|
|
85
|
-
folder:
|
|
117
|
+
name: d,
|
|
118
|
+
folder: i.value.folder
|
|
86
119
|
}
|
|
87
120
|
}).then(() => {
|
|
88
|
-
|
|
121
|
+
u.refetch(), n.value = [];
|
|
89
122
|
}).catch(() => {
|
|
90
|
-
|
|
123
|
+
f.error(o("components.uploadManage.createError") || "");
|
|
91
124
|
});
|
|
92
|
-
},
|
|
93
|
-
if (!
|
|
94
|
-
|
|
125
|
+
}, me = (d, s, v) => {
|
|
126
|
+
if (!s) {
|
|
127
|
+
f.error(o("components.uploadManage.namePlaceholder") || "");
|
|
95
128
|
return;
|
|
96
129
|
}
|
|
97
|
-
|
|
98
|
-
path:
|
|
130
|
+
S.request({
|
|
131
|
+
path: P.value,
|
|
99
132
|
method: "PUT",
|
|
100
133
|
payload: {
|
|
101
|
-
name:
|
|
102
|
-
id:
|
|
103
|
-
type:
|
|
134
|
+
name: s,
|
|
135
|
+
id: v,
|
|
136
|
+
type: d
|
|
104
137
|
}
|
|
105
138
|
}).then(() => {
|
|
106
|
-
|
|
139
|
+
u.refetch(), n.value = [];
|
|
107
140
|
}).catch(() => {
|
|
108
|
-
|
|
141
|
+
f.error(o("components.uploadManage.editError") || "");
|
|
109
142
|
});
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
path: `${
|
|
143
|
+
}, j = (d, s) => {
|
|
144
|
+
S.request({
|
|
145
|
+
path: `${P.value}/batch`,
|
|
113
146
|
method: "DELETE",
|
|
114
147
|
payload: {
|
|
115
|
-
|
|
116
|
-
type:
|
|
148
|
+
data: Array.isArray(s) ? s : [s],
|
|
149
|
+
type: d
|
|
117
150
|
}
|
|
118
151
|
}).then(() => {
|
|
119
|
-
|
|
152
|
+
u.refetch(), n.value = [];
|
|
120
153
|
}).catch(() => {
|
|
121
|
-
|
|
154
|
+
f.error(o("components.uploadManage.delError") || "");
|
|
122
155
|
});
|
|
123
|
-
}, b =
|
|
156
|
+
}, b = te(() => !!(t.type && t.type !== "all"));
|
|
124
157
|
return () => {
|
|
125
|
-
var
|
|
126
|
-
let
|
|
158
|
+
var C, L, O, $, z, D, _, q, B, A, R, X;
|
|
159
|
+
let d, s, v;
|
|
127
160
|
return e("div", {
|
|
128
|
-
class: "flex flex-col gap-2 h-500px max-h-500px"
|
|
161
|
+
class: ["flex flex-col gap-2", t.page ? "h-full" : "h-500px max-h-500px"]
|
|
129
162
|
}, [e("div", {
|
|
130
|
-
class: ["flex-none flex justify-between items-center border-b border-muted p-3",
|
|
163
|
+
class: ["flex-none flex justify-between items-center border-b border-muted p-3", t.handle]
|
|
131
164
|
}, [e("div", {
|
|
132
165
|
class: "flex-none"
|
|
133
|
-
}, [e(
|
|
166
|
+
}, [e(ke, {
|
|
134
167
|
type: "segment",
|
|
135
168
|
animated: !0,
|
|
136
169
|
size: "small",
|
|
137
170
|
tabClass: "!px-4",
|
|
138
171
|
defaultValue: "all",
|
|
139
|
-
value:
|
|
172
|
+
value: i.value.type,
|
|
140
173
|
onUpdateValue: (a) => {
|
|
141
|
-
b.value || (
|
|
174
|
+
b.value || (i.value.type = a, n.value = []);
|
|
142
175
|
}
|
|
143
176
|
}, {
|
|
144
|
-
default: () => [e(
|
|
145
|
-
tab:
|
|
177
|
+
default: () => [e(w, {
|
|
178
|
+
tab: o("components.uploadManage.all"),
|
|
146
179
|
name: "all",
|
|
147
180
|
disabled: b.value
|
|
148
|
-
}, null), e(
|
|
149
|
-
tab:
|
|
181
|
+
}, null), e(w, {
|
|
182
|
+
tab: o("components.uploadManage.image"),
|
|
150
183
|
name: "image",
|
|
151
184
|
disabled: b.value
|
|
152
|
-
}, null), e(
|
|
153
|
-
tab:
|
|
185
|
+
}, null), e(w, {
|
|
186
|
+
tab: o("components.uploadManage.media"),
|
|
154
187
|
name: "media",
|
|
155
188
|
disabled: b.value
|
|
156
|
-
}, null), e(
|
|
157
|
-
tab:
|
|
189
|
+
}, null), e(w, {
|
|
190
|
+
tab: o("components.uploadManage.docs"),
|
|
158
191
|
name: "docs",
|
|
159
192
|
disabled: b.value
|
|
160
193
|
}, null)]
|
|
161
194
|
})]), e("div", {
|
|
162
195
|
class: "flex gap-2"
|
|
163
|
-
}, [e(
|
|
196
|
+
}, [e(h, {
|
|
164
197
|
type: "default",
|
|
165
198
|
ghost: !0,
|
|
166
199
|
onClick: () => {
|
|
167
200
|
x.prompt({
|
|
168
|
-
title:
|
|
201
|
+
title: o("components.uploadManage.namePlaceholder") || "",
|
|
169
202
|
formSchema: [{
|
|
170
|
-
tag:
|
|
203
|
+
tag: ne,
|
|
171
204
|
attrs: {
|
|
172
205
|
"v-model:value": "form.name"
|
|
173
206
|
}
|
|
174
207
|
}]
|
|
175
208
|
}).then((a) => {
|
|
176
|
-
|
|
209
|
+
pe(a == null ? void 0 : a.name);
|
|
210
|
+
}).catch(() => {
|
|
177
211
|
});
|
|
178
212
|
},
|
|
179
213
|
renderIcon: () => e("div", {
|
|
180
214
|
class: "i-tabler:plus"
|
|
181
215
|
}, null)
|
|
182
|
-
}, N(
|
|
183
|
-
default: () => [
|
|
184
|
-
}), e(
|
|
216
|
+
}, N(d = o("components.button.create")) ? d : {
|
|
217
|
+
default: () => [d]
|
|
218
|
+
}), e(h, {
|
|
185
219
|
type: "primary",
|
|
186
220
|
ghost: !0,
|
|
187
221
|
onClick: () => {
|
|
188
|
-
|
|
222
|
+
k.open();
|
|
189
223
|
},
|
|
190
|
-
loading:
|
|
224
|
+
loading: k.isUploading.value,
|
|
191
225
|
renderIcon: () => e("div", {
|
|
192
226
|
class: "i-tabler:upload"
|
|
193
227
|
}, null)
|
|
194
228
|
}, {
|
|
195
229
|
default: () => [e("div", {
|
|
196
230
|
class: "flex gap-2"
|
|
197
|
-
}, [
|
|
198
|
-
}),
|
|
231
|
+
}, [o("components.uploadManage.upload"), k.progress.value.totalPercent > 0 && `(${k.progress.value.totalPercent}%)`])]
|
|
232
|
+
}), !t.page && e(h, {
|
|
199
233
|
type: "default",
|
|
200
234
|
ghost: !0,
|
|
201
235
|
onClick: () => {
|
|
202
236
|
var a;
|
|
203
|
-
(a =
|
|
237
|
+
(a = t.onClose) == null || a.call(t);
|
|
204
238
|
},
|
|
205
239
|
renderIcon: () => e("div", {
|
|
206
240
|
class: "i-tabler:x"
|
|
207
241
|
}, null)
|
|
208
242
|
}, null)])]), e("div", {
|
|
209
243
|
class: "flex-1 min-h-1"
|
|
210
|
-
}, [e(
|
|
244
|
+
}, [((O = (L = (C = u.data) == null ? void 0 : C.value) == null ? void 0 : L.data) == null ? void 0 : O.length) > 0 && e(Ce, {
|
|
211
245
|
distance: 10,
|
|
212
246
|
onLoad: () => {
|
|
213
|
-
|
|
247
|
+
u.hasNextPage.value && u.fetchNextPage();
|
|
214
248
|
},
|
|
215
249
|
scrollbarProps: {
|
|
216
250
|
contentClass: "p-4"
|
|
217
251
|
}
|
|
218
252
|
}, {
|
|
219
253
|
default: () => {
|
|
220
|
-
var a, l,
|
|
221
|
-
return [
|
|
222
|
-
class: "
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
}, [((L = s.value) == null ? void 0 : L.folder) && ((O = s.value) == null ? void 0 : O.folder) !== (($ = (_ = i.data.value) == null ? void 0 : _.meta) == null ? void 0 : $.folder) && e(Z, {
|
|
226
|
-
key: `parent-${(z = (q = i.data.value) == null ? void 0 : q.meta) == null ? void 0 : z.folder}`,
|
|
254
|
+
var a, l, g, Y, G, H, J, K, Q, W;
|
|
255
|
+
return [e("div", {
|
|
256
|
+
class: ["grid grid-cols-3 md:grid-cols-4 text-sm items-start justify-start", ((l = (a = u.data.value) == null ? void 0 : a.data) == null ? void 0 : l.length) >= 4 && !t.page ? " lg:grid-cols-[repeat(auto-fit,minmax(150px,1fr))]" : "lg:grid-cols-[repeat(auto-fit,minmax(150px,150px))]"]
|
|
257
|
+
}, [((g = i.value) == null ? void 0 : g.folder) && ((Y = i.value) == null ? void 0 : Y.folder) !== ((H = (G = u.data.value) == null ? void 0 : G.meta) == null ? void 0 : H.folder) && e(re, {
|
|
258
|
+
key: `parent-${(K = (J = u.data.value) == null ? void 0 : J.meta) == null ? void 0 : K.folder}`,
|
|
227
259
|
type: "folder",
|
|
228
|
-
name:
|
|
260
|
+
name: o("components.uploadManage.parentLevel"),
|
|
229
261
|
onSelect: () => {
|
|
230
|
-
var
|
|
231
|
-
|
|
262
|
+
var r, c;
|
|
263
|
+
n.value = [], i.value.folder = (c = (r = u.data.value) == null ? void 0 : r.meta) == null ? void 0 : c.folder;
|
|
232
264
|
}
|
|
233
|
-
}, null), (
|
|
265
|
+
}, null), (W = (Q = u.data.value) == null ? void 0 : Q.data) == null ? void 0 : W.map((r) => e(we, {
|
|
234
266
|
placement: "bottom",
|
|
235
|
-
key: `${
|
|
236
|
-
trigger:
|
|
267
|
+
key: `${r.url ? "file" : "folder"}-${r.id}`,
|
|
268
|
+
trigger: r.url ? "hover" : "manual"
|
|
237
269
|
}, {
|
|
238
|
-
default: () =>
|
|
270
|
+
default: () => r.filesize,
|
|
239
271
|
trigger: () => {
|
|
240
|
-
var c,
|
|
241
|
-
return e(
|
|
242
|
-
onContextmenu: (
|
|
243
|
-
M.value =
|
|
244
|
-
y.value = !0, T.value =
|
|
245
|
-
}),
|
|
272
|
+
var c, Z;
|
|
273
|
+
return e(re, {
|
|
274
|
+
onContextmenu: (p) => {
|
|
275
|
+
M.value = r, y.value = !1, ve().then(() => {
|
|
276
|
+
y.value = !0, T.value = p.clientX, E.value = p.clientY;
|
|
277
|
+
}), p.preventDefault();
|
|
246
278
|
},
|
|
247
|
-
value:
|
|
248
|
-
type:
|
|
249
|
-
mime:
|
|
250
|
-
name:
|
|
251
|
-
url:
|
|
252
|
-
time:
|
|
253
|
-
onSelect: (
|
|
254
|
-
var
|
|
255
|
-
if (!
|
|
256
|
-
|
|
279
|
+
value: t.page ? !1 : !!((Z = (c = n.value) == null ? void 0 : c.find) != null && Z.call(c, (p) => p.id === r.id)),
|
|
280
|
+
type: r.url ? "file" : "folder",
|
|
281
|
+
mime: r.filetype,
|
|
282
|
+
name: r.filename,
|
|
283
|
+
url: r.url,
|
|
284
|
+
time: r.time,
|
|
285
|
+
onSelect: (p) => {
|
|
286
|
+
var ee, ae, le;
|
|
287
|
+
if (!r.url) {
|
|
288
|
+
n.value = [], u.data.value = void 0, i.value.folder = r.id;
|
|
257
289
|
return;
|
|
258
290
|
}
|
|
259
|
-
|
|
291
|
+
t.page || (p ? t.multiple ? (ee = n.value) == null || ee.push(r) : n.value = [r] : t.multiple ? (le = n.value) == null || le.splice((ae = n.value) == null ? void 0 : ae.indexOf(r), 1) : n.value = []);
|
|
260
292
|
}
|
|
261
293
|
}, null);
|
|
262
294
|
}
|
|
263
|
-
}))])
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
}))])];
|
|
296
|
+
}
|
|
297
|
+
}), u.isLoading.value ? e(Se, {
|
|
298
|
+
class: "h-full absolute w-full bg-gray-1/50"
|
|
299
|
+
}, null) : !((z = ($ = u.data.value) == null ? void 0 : $.data) != null && z.length) && e("div", {
|
|
300
|
+
class: "size-full flex justify-center items-center text-sm text-gray-6"
|
|
301
|
+
}, [e("div", {
|
|
302
|
+
class: "flex flex-col items-center"
|
|
303
|
+
}, [e("div", {
|
|
304
|
+
class: "w-26 mb-2"
|
|
305
|
+
}, [e(Ee, null, null)]), e("div", {
|
|
306
|
+
class: "text-base"
|
|
307
|
+
}, [o("components.uploadManage.empty")]), e("div", {
|
|
308
|
+
class: "text-sm text-muted"
|
|
309
|
+
}, [o("components.uploadManage.emptyDesc")]), ((D = i.value) == null ? void 0 : D.folder) && ((_ = i.value) == null ? void 0 : _.folder) !== ((B = (q = u.data.value) == null ? void 0 : q.meta) == null ? void 0 : B.folder) && e("div", {
|
|
310
|
+
class: "text-xs text-gray-6"
|
|
311
|
+
}, [e(h, {
|
|
312
|
+
type: "default",
|
|
313
|
+
ghost: !0,
|
|
314
|
+
onClick: () => {
|
|
315
|
+
var a, l;
|
|
316
|
+
n.value = [], i.value.folder = (l = (a = u.data.value) == null ? void 0 : a.meta) == null ? void 0 : l.folder;
|
|
281
317
|
}
|
|
282
|
-
}
|
|
318
|
+
}, N(s = o("components.uploadManage.back")) ? s : {
|
|
319
|
+
default: () => [s]
|
|
320
|
+
})])])])]), e(Ne, {
|
|
283
321
|
x: T.value,
|
|
284
|
-
y:
|
|
322
|
+
y: E.value,
|
|
285
323
|
placement: "bottom-start",
|
|
286
324
|
trigger: "manual",
|
|
287
325
|
show: y.value,
|
|
@@ -292,16 +330,16 @@ const ta = /* @__PURE__ */ ne({
|
|
|
292
330
|
a || (M.value = void 0);
|
|
293
331
|
},
|
|
294
332
|
onSelect: (a) => {
|
|
295
|
-
const l =
|
|
333
|
+
const l = Me(M.value);
|
|
296
334
|
switch (a) {
|
|
297
335
|
case "download":
|
|
298
|
-
|
|
336
|
+
ue.url(l == null ? void 0 : l.url);
|
|
299
337
|
break;
|
|
300
338
|
case "rename":
|
|
301
339
|
x.prompt({
|
|
302
|
-
title:
|
|
340
|
+
title: o("components.uploadManage.namePlaceholder"),
|
|
303
341
|
formSchema: [{
|
|
304
|
-
tag:
|
|
342
|
+
tag: ne,
|
|
305
343
|
attrs: {
|
|
306
344
|
"v-model:value": "form.name"
|
|
307
345
|
}
|
|
@@ -309,71 +347,71 @@ const ta = /* @__PURE__ */ ne({
|
|
|
309
347
|
defaultValue: {
|
|
310
348
|
name: (l == null ? void 0 : l.filename) || (l == null ? void 0 : l.name)
|
|
311
349
|
}
|
|
312
|
-
}).then((
|
|
313
|
-
|
|
350
|
+
}).then((g) => {
|
|
351
|
+
me(l == null ? void 0 : l.type, g == null ? void 0 : g.name, l == null ? void 0 : l.id);
|
|
314
352
|
});
|
|
315
353
|
break;
|
|
316
354
|
case "delete":
|
|
317
355
|
x.confirm({
|
|
318
|
-
title:
|
|
319
|
-
content:
|
|
356
|
+
title: o("components.uploadManage.delTitle"),
|
|
357
|
+
content: o("components.uploadManage.delDesc")
|
|
320
358
|
}).then(() => {
|
|
321
|
-
|
|
359
|
+
j(l == null ? void 0 : l.type, l == null ? void 0 : l.id);
|
|
322
360
|
});
|
|
323
361
|
break;
|
|
324
362
|
}
|
|
325
363
|
},
|
|
326
|
-
options: [((
|
|
327
|
-
label:
|
|
364
|
+
options: [((A = M.value) == null ? void 0 : A.url) && {
|
|
365
|
+
label: o("components.button.download"),
|
|
328
366
|
key: "download",
|
|
329
367
|
icon: () => e("div", {
|
|
330
368
|
class: "i-tabler:download"
|
|
331
369
|
}, null)
|
|
332
370
|
}, {
|
|
333
|
-
label:
|
|
371
|
+
label: o("components.button.rename"),
|
|
334
372
|
key: "rename",
|
|
335
373
|
icon: () => e("div", {
|
|
336
374
|
class: "i-tabler:cursor-text"
|
|
337
375
|
}, null)
|
|
338
376
|
}, {
|
|
339
|
-
label:
|
|
377
|
+
label: o("components.button.delete"),
|
|
340
378
|
key: "delete",
|
|
341
379
|
icon: () => e("div", {
|
|
342
380
|
class: "i-tabler:trash"
|
|
343
381
|
}, null)
|
|
344
382
|
}].filter((a) => a)
|
|
345
|
-
}, null),
|
|
383
|
+
}, null), !t.page && e("div", {
|
|
346
384
|
class: "flex justify-end gap-2 border-t border-muted p-3"
|
|
347
|
-
}, [e("div", null, [((
|
|
385
|
+
}, [e("div", null, [((R = n.value) == null ? void 0 : R.length) > 0 && e(h, {
|
|
348
386
|
type: "error",
|
|
349
387
|
secondary: !0,
|
|
350
388
|
onClick: () => {
|
|
351
389
|
x.confirm({
|
|
352
|
-
title:
|
|
353
|
-
content:
|
|
390
|
+
title: o("components.uploadManage.delTitle"),
|
|
391
|
+
content: o("components.uploadManage.delDesc")
|
|
354
392
|
}).then(() => {
|
|
355
393
|
var a;
|
|
356
|
-
|
|
394
|
+
j("file", (a = n.value) == null ? void 0 : a.map((l) => l.id));
|
|
357
395
|
});
|
|
358
396
|
}
|
|
359
|
-
}, N(
|
|
360
|
-
default: () => [
|
|
361
|
-
})]), e("div", null, [e(
|
|
397
|
+
}, N(v = o("components.button.delete")) ? v : {
|
|
398
|
+
default: () => [v]
|
|
399
|
+
})]), e("div", null, [e(h, {
|
|
362
400
|
type: "primary",
|
|
363
|
-
disabled: !((
|
|
401
|
+
disabled: !((X = n.value) != null && X.length),
|
|
364
402
|
onClick: () => {
|
|
365
403
|
var a;
|
|
366
|
-
(a =
|
|
404
|
+
(a = t.onConfirm) == null || a.call(t, n.value);
|
|
367
405
|
}
|
|
368
406
|
}, {
|
|
369
407
|
default: () => {
|
|
370
408
|
var a;
|
|
371
|
-
return [
|
|
409
|
+
return [o("components.button.select"), oe("("), ((a = n.value) == null ? void 0 : a.length) || 0, oe(")")];
|
|
372
410
|
}
|
|
373
411
|
})])])]);
|
|
374
412
|
};
|
|
375
413
|
}
|
|
376
414
|
});
|
|
377
415
|
export {
|
|
378
|
-
|
|
416
|
+
Ca as default
|
|
379
417
|
};
|