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