@skyfox2000/webui 1.4.21 → 1.4.22
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/lib/assets/modules/{baseLayout-Da4Ox7Lj.js → baseLayout-BcSEYvus.js} +3 -3
- package/lib/assets/modules/{file-upload-Bu6FkNjZ.js → file-upload-D11e2io7.js} +1 -1
- package/lib/assets/modules/{index-BYVerdEw.js → index-CO9_YadW.js} +2 -2
- package/lib/assets/modules/{index-Ch3meKe4.js → index-ClMWx3tg.js} +1 -1
- package/lib/assets/modules/{index-BysCt107.js → index-voAmrZ30.js} +2 -2
- package/lib/assets/modules/{menuTabs-BqLT-YbD.js → menuTabs-C9wkt-m9.js} +2 -2
- package/lib/assets/modules/{toolIcon-Dd58W0UM.js → toolIcon-9zQ4jiFD.js} +1 -1
- package/lib/assets/modules/{upload-template-Csccple9.js → upload-template-CM0O990W.js} +386 -369
- package/lib/assets/modules/uploadList-DhkFSkqE.js +466 -0
- package/lib/components/content/index.d.ts +4 -0
- package/lib/components/content/list/index.vue.d.ts +126 -0
- package/lib/components/content/list/listOperate.vue.d.ts +18 -0
- package/lib/components/form/switch/index.vue.d.ts +11 -1
- package/lib/components/form/upload/uploadList.vue.d.ts +448 -0
- package/lib/components/index.d.ts +1 -1
- package/lib/const/options.d.ts +4 -2
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +5 -5
- package/lib/es/MenuLayout/index.js +2 -2
- package/lib/es/TemplateFile/index.js +4 -4
- package/lib/es/UploadForm/index.js +70 -56
- package/lib/index.d.ts +1 -1
- package/lib/typings/upload.d.ts +10 -0
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +1418 -1167
- package/package.json +1 -1
- package/src/components/content/dialog/uploadForm.vue +96 -13
- package/src/components/content/index.ts +5 -0
- package/src/components/content/list/index.vue +198 -0
- package/src/components/content/list/listOperate.vue +122 -0
- package/src/components/content/table/index.vue +1 -1
- package/src/components/content/table/tableOperate.vue +19 -37
- package/src/components/form/switch/index.vue +27 -14
- package/src/components/form/upload/uploadList.vue +46 -3
- package/src/components/index.ts +2 -0
- package/src/const/options.ts +11 -1
- package/src/index.ts +2 -0
- package/src/typings/upload.d.ts +10 -0
- package/lib/assets/modules/uploadList-D8scq04c.js +0 -423
|
@@ -79,6 +79,10 @@ export interface UploadListProps {
|
|
|
79
79
|
* 是否显示删除
|
|
80
80
|
*/
|
|
81
81
|
showDelete?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 是否显示目录上传按钮
|
|
84
|
+
*/
|
|
85
|
+
showFolderUpload?: boolean;
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
const props = withDefaults(defineProps<UploadListProps>(), {
|
|
@@ -93,6 +97,7 @@ const props = withDefaults(defineProps<UploadListProps>(), {
|
|
|
93
97
|
showActionText: true,
|
|
94
98
|
showOnlineSwitch: false,
|
|
95
99
|
showDelete: true,
|
|
100
|
+
showFolderUpload: false,
|
|
96
101
|
});
|
|
97
102
|
|
|
98
103
|
const inputFactory = useInputFactory();
|
|
@@ -105,6 +110,7 @@ const displayList = ref<UploadFile[]>(props.fileList);
|
|
|
105
110
|
const uploadList = ref<UploadFile[]>([]);
|
|
106
111
|
|
|
107
112
|
const fileUploader = ref();
|
|
113
|
+
const fileFolderUploader = ref();
|
|
108
114
|
const emit = defineEmits(['update:file-list']);
|
|
109
115
|
const acceptString = computed(() => (props.fileExt?.length ? props.fileExt.map((ext) => `.${ext}`).join(',') : ''));
|
|
110
116
|
|
|
@@ -137,11 +143,30 @@ const isMaxCountReached = (): boolean => {
|
|
|
137
143
|
const prepareFileInfo = (file: any): UploadFile<any> => {
|
|
138
144
|
const fileInfo = file as UploadFile<any>;
|
|
139
145
|
if (!fileInfo.params) fileInfo.params = {};
|
|
146
|
+
|
|
147
|
+
// 获取相对路径(只有目录上传时才有)
|
|
148
|
+
let relativePath = fileInfo.name;
|
|
149
|
+
if (fileInfo.webkitRelativePath) {
|
|
150
|
+
relativePath = fileInfo.webkitRelativePath;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// 对于目录上传,使用相对路径作为文件名,保持目录结构
|
|
154
|
+
if (fileInfo.webkitRelativePath) {
|
|
155
|
+
fileInfo.name = fileInfo.webkitRelativePath;
|
|
156
|
+
fileInfo.fileName = fileInfo.webkitRelativePath.split('/').pop(); // 只取文件名部分
|
|
157
|
+
}
|
|
158
|
+
|
|
140
159
|
fileInfo.params.FileKey = fileInfo.name;
|
|
141
160
|
if (props.parentPath) {
|
|
142
161
|
fileInfo.params.FileKey = path.join('/', props.parentPath, fileInfo.name);
|
|
143
162
|
}
|
|
144
163
|
fileInfo.status = UploadStatus.Pending;
|
|
164
|
+
|
|
165
|
+
// 保存相对路径用于显示(只有目录上传时才使用)
|
|
166
|
+
if (fileInfo.webkitRelativePath) {
|
|
167
|
+
fileInfo.relativePath = relativePath;
|
|
168
|
+
}
|
|
169
|
+
|
|
145
170
|
return fileInfo;
|
|
146
171
|
};
|
|
147
172
|
|
|
@@ -231,6 +256,19 @@ const uploadProps = computed<UploadProps>(() => ({
|
|
|
231
256
|
},
|
|
232
257
|
}));
|
|
233
258
|
|
|
259
|
+
const folderUploadProps = computed<UploadProps>(() => ({
|
|
260
|
+
accept: acceptString.value,
|
|
261
|
+
multiple: true,
|
|
262
|
+
directory: true, // 添加标准属性
|
|
263
|
+
webkitdirectory: true, // Webkit属性
|
|
264
|
+
fileList: [] as UploadProps['fileList'],
|
|
265
|
+
'onUpdate:fileList': (newFiles) => handleFileSelect(newFiles),
|
|
266
|
+
beforeUpload: () => false,
|
|
267
|
+
listType: 'text',
|
|
268
|
+
showUploadList: false,
|
|
269
|
+
customRequest: () => {},
|
|
270
|
+
}));
|
|
271
|
+
|
|
234
272
|
watch(
|
|
235
273
|
() => props.fileList,
|
|
236
274
|
(newVal) => {
|
|
@@ -375,11 +413,15 @@ const getStatus = (status?: UploadStatus) => {
|
|
|
375
413
|
<template>
|
|
376
414
|
<div class="w-full border border-solid border-gray-100 mt-1 rounded-md py-5" :class="[errInfo?.errClass]">
|
|
377
415
|
<div class="flex items-center justify-between w-full">
|
|
378
|
-
<div class="w-35 mx-3">
|
|
416
|
+
<div class="w-35 mx-3 flex gap-2">
|
|
379
417
|
<Upload ref="fileUploader" v-bind="uploadProps"
|
|
380
418
|
v-auth="{ role: ['Super', 'Admin'], permit: ':uploadlist:upload' }">
|
|
381
419
|
<Button :class="[errInfo?.errClass + '-text']">选择文件</Button>
|
|
382
420
|
</Upload>
|
|
421
|
+
<Upload v-if="showFolderUpload" ref="fileFolderUploader" :webkitdirectory="true" :directory="true" v-bind="folderUploadProps"
|
|
422
|
+
v-auth="{ role: ['Super', 'Admin'], permit: ':uploadlist:upload' }">
|
|
423
|
+
<Button :class="[errInfo?.errClass + '-text']">选择目录</Button>
|
|
424
|
+
</Upload>
|
|
383
425
|
</div>
|
|
384
426
|
<div class="flex-1 text-sm text-gray-500" :class="[errInfo?.errClass + '-text']">
|
|
385
427
|
{{ getPlaceholder() }}
|
|
@@ -387,11 +429,12 @@ const getStatus = (status?: UploadStatus) => {
|
|
|
387
429
|
</div>
|
|
388
430
|
|
|
389
431
|
<div class="mt-4 px-3">
|
|
390
|
-
<div v-for="(file, index) in displayList" :key="index" class="mb-2 pb-1">
|
|
432
|
+
<div v-for="(file, index) in displayList" :key="(props.parentPath || '') + (file.relativePath || file.name || index)" class="mb-2 pb-1">
|
|
391
433
|
<div class="flex items-center justify-between">
|
|
392
434
|
<div class="flex items-center">
|
|
393
435
|
<span class="text-gray-700 mr-2"
|
|
394
|
-
:class="[file.status == UploadStatus.Offline ? 'line-through' : '']"
|
|
436
|
+
:class="[file.status == UploadStatus.Offline ? 'line-through' : '']"
|
|
437
|
+
:title="file.relativePath || file.fileName || file.name">{{ file.fileName ?? file.name
|
|
395
438
|
}}</span>
|
|
396
439
|
<span>
|
|
397
440
|
<Tag :color="getStatusColor(file.status)">{{ getStatus(file.status) }}</Tag>
|
package/src/components/index.ts
CHANGED
package/src/const/options.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { OptionItemProps } from '@/typings/option';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* 静态选项
|
|
3
5
|
*/
|
|
4
6
|
export class OPTIONS {
|
|
5
|
-
private static dict: Record<string, Record<string, any>[]> = {};
|
|
7
|
+
private static dict: Record<string, (Record<string, any> | OptionItemProps)[]> = {};
|
|
6
8
|
static Keys = {
|
|
7
9
|
EnableDisable: 'EnableDisable',
|
|
8
10
|
SuccessResult: 'SuccessResult',
|
|
@@ -18,6 +20,14 @@ export class OPTIONS {
|
|
|
18
20
|
static getOptions = (key: string) => {
|
|
19
21
|
return OPTIONS.dict[key];
|
|
20
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* 静态选择项列表
|
|
25
|
+
* @param key 名称
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
static getOptionItems = (key: string) => {
|
|
29
|
+
return OPTIONS.dict[key] as OptionItemProps[];
|
|
30
|
+
};
|
|
21
31
|
/**
|
|
22
32
|
* 静态选择项对象
|
|
23
33
|
* @param key 名称
|
package/src/index.ts
CHANGED
package/src/typings/upload.d.ts
CHANGED
|
@@ -137,6 +137,16 @@ export interface UploadFile<T = AjaxResponse> {
|
|
|
137
137
|
* minio文件信息
|
|
138
138
|
*/
|
|
139
139
|
minioFile?: MinioFile;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 相对路径(目录上传时使用)
|
|
143
|
+
*/
|
|
144
|
+
relativePath?: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 文件的相对路径(浏览器原生属性)
|
|
148
|
+
*/
|
|
149
|
+
webkitRelativePath?: string;
|
|
140
150
|
}
|
|
141
151
|
|
|
142
152
|
/**
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ae, ref as P, computed as D, watch as B, resolveDirective as ie, createElementBlock as d, openBlock as u, normalizeClass as $, unref as n, createElementVNode as h, withDirectives as y, createBlock as re, mergeProps as le, withCtx as w, createVNode as p, createTextVNode as z, toDisplayString as T, Fragment as ce, renderList as ue, createCommentVNode as C } from "vue";
|
|
2
|
-
import { _ as pe } from "./index-Ch3meKe4.js";
|
|
3
|
-
import { a as A, _ as I } from "./toolIcon-Dd58W0UM.js";
|
|
4
|
-
import { httpPost as K, ResStatus as j } from "@skyfox2000/fapi";
|
|
5
|
-
import { L as V, u as q, v as de, _ as me } from "./upload-template-Csccple9.js";
|
|
6
|
-
import { U as i, f as fe, p as Q } from "./file-upload-Bu6FkNjZ.js";
|
|
7
|
-
import { combineParams as G } from "@skyfox2000/microbase";
|
|
8
|
-
import _ from "vue-m-message";
|
|
9
|
-
import "async-validator";
|
|
10
|
-
import "dayjs";
|
|
11
|
-
import { Upload as he, Tag as ve, Popconfirm as xe, Progress as ye } from "ant-design-vue";
|
|
12
|
-
import "vue-draggable-next";
|
|
13
|
-
import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
const Ce = (l, U) => {
|
|
15
|
-
const t = document.createElement("a"), m = URL.createObjectURL(l);
|
|
16
|
-
t.href = m, t.download = U, t.style.display = "none", document.body.appendChild(t), t.click(), URL.revokeObjectURL(m), document.body.removeChild(t);
|
|
17
|
-
}, _e = (l, U, t) => {
|
|
18
|
-
try {
|
|
19
|
-
t && (l.api || (l.api = t.api), l.authorize === void 0 && (l.authorize = t.authorize));
|
|
20
|
-
const m = G(l.params, U);
|
|
21
|
-
return K(l, m).then((c) => {
|
|
22
|
-
if ((c == null ? void 0 : c.status) === j.SUCCESS && c.data) {
|
|
23
|
-
const s = c.data, S = s.Content, F = s.Key.split("/").pop(), g = atob(S), k = [];
|
|
24
|
-
for (let E = 0; E < g.length; E++)
|
|
25
|
-
k.push(g.charCodeAt(E));
|
|
26
|
-
const x = new Blob([new Uint8Array(k)], {
|
|
27
|
-
type: s.Type
|
|
28
|
-
});
|
|
29
|
-
Ce(x, F);
|
|
30
|
-
} else if ((c == null ? void 0 : c.errno) == V) {
|
|
31
|
-
q().logout(!1);
|
|
32
|
-
return;
|
|
33
|
-
} else
|
|
34
|
-
_.error("下载文件失败!");
|
|
35
|
-
});
|
|
36
|
-
} catch (m) {
|
|
37
|
-
console.error("下载失败:", m), _.error("文件下载失败,请稍后重试");
|
|
38
|
-
}
|
|
39
|
-
}, Ue = ["xlsx", "xls", "csv", "txt"], Se = (l, U, t) => {
|
|
40
|
-
const m = U.split(".").pop();
|
|
41
|
-
if (Ue.includes(m))
|
|
42
|
-
console.log(l);
|
|
43
|
-
else
|
|
44
|
-
return _.error("文件类型不支持预览"), !1;
|
|
45
|
-
const c = G(l.params, t);
|
|
46
|
-
return K(l, c).then((s) => {
|
|
47
|
-
if ((s == null ? void 0 : s.status) === j.SUCCESS && s.data) {
|
|
48
|
-
const F = s.data.Content, g = atob(F), k = [];
|
|
49
|
-
for (let x = 0; x < g.length; x++)
|
|
50
|
-
k.push(g.charCodeAt(x));
|
|
51
|
-
} else if ((s == null ? void 0 : s.errno) == V) {
|
|
52
|
-
q().logout(!1);
|
|
53
|
-
return;
|
|
54
|
-
} else
|
|
55
|
-
_.error("文件预览失败!");
|
|
56
|
-
});
|
|
57
|
-
}, ge = { class: "flex items-center justify-between w-full" }, be = { class: "w-35 mx-3" }, ke = { class: "mt-4 px-3" }, Fe = { class: "flex items-center justify-between" }, Ee = { class: "flex items-center" }, Oe = { class: "flex items-center" }, ze = {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "mr-2"
|
|
60
|
-
}, Le = {
|
|
61
|
-
key: 1,
|
|
62
|
-
class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer"
|
|
63
|
-
}, Pe = ["onClick"], $e = {
|
|
64
|
-
key: 2,
|
|
65
|
-
class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer"
|
|
66
|
-
}, Ae = ["onClick"], Be = {
|
|
67
|
-
key: 3,
|
|
68
|
-
class: "flex items-center text-red-500 hover:text-red-700 cursor-pointer"
|
|
69
|
-
}, Te = ["onClick"], Ie = {
|
|
70
|
-
key: 0,
|
|
71
|
-
class: "text-sm text-nowrap"
|
|
72
|
-
}, Ke = { key: 0 }, je = /* @__PURE__ */ ae({
|
|
73
|
-
__name: "uploadList",
|
|
74
|
-
props: {
|
|
75
|
-
autoUpload: { type: Boolean, default: !1 },
|
|
76
|
-
uploadUrl: {},
|
|
77
|
-
downloadUrl: {},
|
|
78
|
-
previewUrl: {},
|
|
79
|
-
deleteUrl: {},
|
|
80
|
-
fileList: { default: () => [] },
|
|
81
|
-
placeholder: { default: "" },
|
|
82
|
-
fileExt: {},
|
|
83
|
-
maxFileSize: { default: 20 },
|
|
84
|
-
maxCount: { default: 5 },
|
|
85
|
-
maxCountTip: { type: Boolean, default: !1 },
|
|
86
|
-
maxFileSizeTip: { type: Boolean, default: !0 },
|
|
87
|
-
fileExtTip: { type: Boolean, default: !0 },
|
|
88
|
-
parentPath: {},
|
|
89
|
-
showActionText: { type: Boolean, default: !0 },
|
|
90
|
-
showOnlineSwitch: { type: Boolean, default: !1 },
|
|
91
|
-
showDelete: { type: Boolean, default: !0 }
|
|
92
|
-
},
|
|
93
|
-
emits: ["update:file-list"],
|
|
94
|
-
setup(l, { emit: U }) {
|
|
95
|
-
const t = l, m = de(), { errInfo: c } = m, s = P(t.fileList), S = P([]), F = P(), g = U, k = D(() => {
|
|
96
|
-
var e;
|
|
97
|
-
return (e = t.fileExt) != null && e.length ? t.fileExt.map((o) => `.${o}`).join(",") : "";
|
|
98
|
-
}), x = (e) => {
|
|
99
|
-
var o;
|
|
100
|
-
if (t.fileExt && t.fileExt.length > 0) {
|
|
101
|
-
const r = ((o = e.name.split(".").pop()) == null ? void 0 : o.toLowerCase()) || "";
|
|
102
|
-
if (!t.fileExt.includes(r))
|
|
103
|
-
return _.error("文件类型不支持"), !1;
|
|
104
|
-
}
|
|
105
|
-
return e.size / 1024 / 1024 > t.maxFileSize ? (_.error(`文件大小超过 ${t.maxFileSize}MB 限制`), !1) : !0;
|
|
106
|
-
}, E = () => t.maxCount > 1 && s.value.length >= t.maxCount, H = (e) => {
|
|
107
|
-
const o = e;
|
|
108
|
-
return o.params || (o.params = {}), o.params.FileKey = o.name, t.parentPath && (o.params.FileKey = Q.join("/", t.parentPath, o.name)), o.status = i.Pending, o;
|
|
109
|
-
}, J = (e) => x(e) && t.autoUpload, W = async (e) => {
|
|
110
|
-
if (e.length === 0) return;
|
|
111
|
-
const o = [...s.value];
|
|
112
|
-
let r = !1;
|
|
113
|
-
for (const O of e) {
|
|
114
|
-
if (!x(O)) {
|
|
115
|
-
r = !0;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
const b = H(O);
|
|
119
|
-
if (t.maxCount === 1) {
|
|
120
|
-
o.length = 0, o.push(b);
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
if (E()) {
|
|
124
|
-
_.error(`最多上传 ${t.maxCount} 个文件`), r = !0;
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
const a = o.findIndex(
|
|
128
|
-
(f) => f.name === b.name
|
|
129
|
-
);
|
|
130
|
-
a > -1 ? o[a] = b : o.push(b);
|
|
131
|
-
}
|
|
132
|
-
(!r || o.length > 0) && (s.value = o), S.value = [];
|
|
133
|
-
}, X = (e) => {
|
|
134
|
-
S.value = e, W(e);
|
|
135
|
-
}, Y = D(() => ({
|
|
136
|
-
accept: k.value,
|
|
137
|
-
multiple: t.maxCount !== 1,
|
|
138
|
-
fileList: S.value,
|
|
139
|
-
"onUpdate:fileList": X,
|
|
140
|
-
beforeUpload: J,
|
|
141
|
-
listType: "text",
|
|
142
|
-
showUploadList: !1,
|
|
143
|
-
customRequest: async () => {
|
|
144
|
-
if (t.autoUpload && t.uploadUrl)
|
|
145
|
-
for (const e of s.value)
|
|
146
|
-
e.percent === 0 && e.status === i.Pending && await fe(t.uploadUrl, e);
|
|
147
|
-
}
|
|
148
|
-
}));
|
|
149
|
-
B(
|
|
150
|
-
() => t.fileList,
|
|
151
|
-
(e) => {
|
|
152
|
-
s.value = e;
|
|
153
|
-
},
|
|
154
|
-
{ deep: !0, immediate: !0 }
|
|
155
|
-
), B(
|
|
156
|
-
() => s.value,
|
|
157
|
-
(e) => {
|
|
158
|
-
g("update:file-list", e);
|
|
159
|
-
},
|
|
160
|
-
{ deep: !0 }
|
|
161
|
-
), B(
|
|
162
|
-
() => t.parentPath,
|
|
163
|
-
(e) => {
|
|
164
|
-
e && s.value.forEach((o) => {
|
|
165
|
-
o.params.FileKey = Q.join("/", e, o.fileName);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
const M = (e) => {
|
|
170
|
-
const o = s.value[e].minioFile, r = {
|
|
171
|
-
api: t.downloadUrl.api,
|
|
172
|
-
authorize: t.downloadUrl.authorize,
|
|
173
|
-
url: t.downloadUrl.url,
|
|
174
|
-
params: {
|
|
175
|
-
Query: {
|
|
176
|
-
FileKey: o.Key
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
_e(r);
|
|
181
|
-
}, Z = (e) => {
|
|
182
|
-
e.minioFile && (e.minioFile.Status = e.status);
|
|
183
|
-
}, N = (e) => {
|
|
184
|
-
const o = s.value[e].minioFile, r = {
|
|
185
|
-
api: t.previewUrl.api,
|
|
186
|
-
authorize: t.previewUrl.authorize,
|
|
187
|
-
url: t.previewUrl.url,
|
|
188
|
-
params: {
|
|
189
|
-
Query: {
|
|
190
|
-
FileKey: o.Key
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
Se(r, o.FileName);
|
|
195
|
-
}, R = (e) => {
|
|
196
|
-
const o = s.value[e];
|
|
197
|
-
t.deleteUrl && o.minioFile && o.minioFile.Key ? K(t.deleteUrl, {
|
|
198
|
-
Query: {
|
|
199
|
-
FileKey: o.minioFile.Key
|
|
200
|
-
}
|
|
201
|
-
}).then((r) => {
|
|
202
|
-
r && r.status === j.SUCCESS && (_.success("删除文件成功!"), s.value.splice(e, 1));
|
|
203
|
-
}) : s.value.splice(e, 1), L.value = -1;
|
|
204
|
-
}, L = P(-1), ee = (e, o) => {
|
|
205
|
-
if (L.value = e, o === i.Pending) {
|
|
206
|
-
R(e);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
}, te = (e) => e === L.value, oe = () => {
|
|
210
|
-
const e = t.fileExt && t.fileExt.length && t.fileExtTip ? `文件必须为 ${t.fileExt.join("/")}` : "", o = t.maxFileSize !== 0 && t.maxFileSizeTip ? `单文件最大 ${t.maxFileSize}MB` : "", r = t.maxCount !== 0 && t.maxCountTip ? `最多 ${t.maxCount} 个文件` : "";
|
|
211
|
-
return [o, e, r].filter(Boolean).join(",");
|
|
212
|
-
}, ne = (e) => {
|
|
213
|
-
switch (e) {
|
|
214
|
-
case i.Uploading:
|
|
215
|
-
return "blue";
|
|
216
|
-
case i.Success:
|
|
217
|
-
return "green";
|
|
218
|
-
case i.Error:
|
|
219
|
-
return "red";
|
|
220
|
-
case i.Online:
|
|
221
|
-
return "green";
|
|
222
|
-
case i.Offline:
|
|
223
|
-
return "pink";
|
|
224
|
-
default:
|
|
225
|
-
return "cyan";
|
|
226
|
-
}
|
|
227
|
-
}, se = (e) => {
|
|
228
|
-
switch (e) {
|
|
229
|
-
case i.Uploading:
|
|
230
|
-
return "上传中";
|
|
231
|
-
case i.Success:
|
|
232
|
-
return "上传完成";
|
|
233
|
-
case i.Error:
|
|
234
|
-
return "上传失败";
|
|
235
|
-
case i.Online:
|
|
236
|
-
return "在线";
|
|
237
|
-
case i.Offline:
|
|
238
|
-
return "已下线";
|
|
239
|
-
default:
|
|
240
|
-
return "待上传";
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
return (e, o) => {
|
|
244
|
-
var O, b;
|
|
245
|
-
const r = ie("auth");
|
|
246
|
-
return u(), d("div", {
|
|
247
|
-
class: $(["w-full border border-solid border-gray-100 mt-1 rounded-md py-5", [(O = n(c)) == null ? void 0 : O.errClass]])
|
|
248
|
-
}, [
|
|
249
|
-
h("div", ge, [
|
|
250
|
-
h("div", be, [
|
|
251
|
-
y((u(), re(n(he), le({
|
|
252
|
-
ref_key: "fileUploader",
|
|
253
|
-
ref: F
|
|
254
|
-
}, Y.value), {
|
|
255
|
-
default: w(() => {
|
|
256
|
-
var a;
|
|
257
|
-
return [
|
|
258
|
-
p(n(pe), {
|
|
259
|
-
class: $([((a = n(c)) == null ? void 0 : a.errClass) + "-text"])
|
|
260
|
-
}, {
|
|
261
|
-
default: w(() => o[1] || (o[1] = [
|
|
262
|
-
z("选择文件")
|
|
263
|
-
])),
|
|
264
|
-
_: 1,
|
|
265
|
-
__: [1]
|
|
266
|
-
}, 8, ["class"])
|
|
267
|
-
];
|
|
268
|
-
}),
|
|
269
|
-
_: 1
|
|
270
|
-
}, 16)), [
|
|
271
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:upload" }]
|
|
272
|
-
])
|
|
273
|
-
]),
|
|
274
|
-
h("div", {
|
|
275
|
-
class: $(["flex-1 text-sm text-gray-500", [((b = n(c)) == null ? void 0 : b.errClass) + "-text"]])
|
|
276
|
-
}, T(oe()), 3)
|
|
277
|
-
]),
|
|
278
|
-
h("div", ke, [
|
|
279
|
-
(u(!0), d(ce, null, ue(s.value, (a, f) => (u(), d("div", {
|
|
280
|
-
key: f,
|
|
281
|
-
class: "mb-2 pb-1"
|
|
282
|
-
}, [
|
|
283
|
-
h("div", Fe, [
|
|
284
|
-
h("div", Ee, [
|
|
285
|
-
h("span", {
|
|
286
|
-
class: $(["text-gray-700 mr-2", [a.status == n(i).Offline ? "line-through" : ""]])
|
|
287
|
-
}, T(a.fileName ?? a.name), 3),
|
|
288
|
-
h("span", null, [
|
|
289
|
-
p(n(ve), {
|
|
290
|
-
color: ne(a.status)
|
|
291
|
-
}, {
|
|
292
|
-
default: w(() => [
|
|
293
|
-
z(T(se(a.status)), 1)
|
|
294
|
-
]),
|
|
295
|
-
_: 2
|
|
296
|
-
}, 1032, ["color"])
|
|
297
|
-
])
|
|
298
|
-
]),
|
|
299
|
-
h("div", Oe, [
|
|
300
|
-
e.showOnlineSwitch && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", ze, [
|
|
301
|
-
p(n(A), { title: "上线或下线" }, {
|
|
302
|
-
default: w(() => [
|
|
303
|
-
y(p(n(me), {
|
|
304
|
-
checked: a.status,
|
|
305
|
-
"onUpdate:checked": (v) => a.status = v,
|
|
306
|
-
data: [
|
|
307
|
-
{ label: "上线", value: n(i).Online },
|
|
308
|
-
{ label: "下线", value: n(i).Offline }
|
|
309
|
-
],
|
|
310
|
-
onChange: (v) => Z(a)
|
|
311
|
-
}, null, 8, ["checked", "onUpdate:checked", "data", "onChange"]), [
|
|
312
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:online" }]
|
|
313
|
-
])
|
|
314
|
-
]),
|
|
315
|
-
_: 2
|
|
316
|
-
}, 1024)
|
|
317
|
-
])) : C("", !0),
|
|
318
|
-
e.downloadUrl && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", Le, [
|
|
319
|
-
p(n(A), { title: "下载" }, {
|
|
320
|
-
default: w(() => [
|
|
321
|
-
y(p(n(I), {
|
|
322
|
-
icon: "icon-download",
|
|
323
|
-
clickable: "",
|
|
324
|
-
onClick: (v) => M(f)
|
|
325
|
-
}, null, 8, ["onClick"]), [
|
|
326
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
|
|
327
|
-
]),
|
|
328
|
-
e.showActionText ? y((u(), d("span", {
|
|
329
|
-
key: 0,
|
|
330
|
-
class: "mr-2 text-sm text-nowrap",
|
|
331
|
-
onClick: (v) => M(f)
|
|
332
|
-
}, o[2] || (o[2] = [
|
|
333
|
-
z("下载")
|
|
334
|
-
]), 8, Pe)), [
|
|
335
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
|
|
336
|
-
]) : C("", !0)
|
|
337
|
-
]),
|
|
338
|
-
_: 2
|
|
339
|
-
}, 1024)
|
|
340
|
-
])) : C("", !0),
|
|
341
|
-
e.previewUrl && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", $e, [
|
|
342
|
-
p(n(A), { title: "预览" }, {
|
|
343
|
-
default: w(() => [
|
|
344
|
-
y(p(n(I), {
|
|
345
|
-
icon: "icon-eye",
|
|
346
|
-
clickable: "",
|
|
347
|
-
onClick: (v) => N(f)
|
|
348
|
-
}, null, 8, ["onClick"]), [
|
|
349
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:preview" }]
|
|
350
|
-
]),
|
|
351
|
-
e.showActionText ? y((u(), d("span", {
|
|
352
|
-
key: 0,
|
|
353
|
-
class: "mr-2 text-sm text-nowrap",
|
|
354
|
-
onClick: (v) => N(f)
|
|
355
|
-
}, o[3] || (o[3] = [
|
|
356
|
-
z("预览")
|
|
357
|
-
]), 8, Ae)), [
|
|
358
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:preview" }]
|
|
359
|
-
]) : C("", !0)
|
|
360
|
-
]),
|
|
361
|
-
_: 2
|
|
362
|
-
}, 1024)
|
|
363
|
-
])) : C("", !0),
|
|
364
|
-
e.showDelete !== !1 ? (u(), d("div", Be, [
|
|
365
|
-
p(n(xe), {
|
|
366
|
-
open: te(f),
|
|
367
|
-
cancelText: "否",
|
|
368
|
-
okText: "是",
|
|
369
|
-
title: "确定删除该文件吗?",
|
|
370
|
-
okButtonProps: { size: "small" },
|
|
371
|
-
cancelButtonProps: { size: "small" },
|
|
372
|
-
onConfirm: (v) => R(f),
|
|
373
|
-
onCancel: o[0] || (o[0] = (v) => L.value = -1)
|
|
374
|
-
}, {
|
|
375
|
-
default: w(() => [
|
|
376
|
-
p(n(A), { title: "删除" }, {
|
|
377
|
-
default: w(() => [
|
|
378
|
-
h("div", {
|
|
379
|
-
onClick: (v) => ee(f, a.status)
|
|
380
|
-
}, [
|
|
381
|
-
y(p(n(I), {
|
|
382
|
-
icon: "icon-new",
|
|
383
|
-
angle: 45,
|
|
384
|
-
clickable: ""
|
|
385
|
-
}, null, 512), [
|
|
386
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
|
|
387
|
-
]),
|
|
388
|
-
e.showActionText ? y((u(), d("span", Ie, o[4] || (o[4] = [
|
|
389
|
-
z("删除")
|
|
390
|
-
]))), [
|
|
391
|
-
[r, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
|
|
392
|
-
]) : C("", !0)
|
|
393
|
-
], 8, Te)
|
|
394
|
-
]),
|
|
395
|
-
_: 2
|
|
396
|
-
}, 1024)
|
|
397
|
-
]),
|
|
398
|
-
_: 2
|
|
399
|
-
}, 1032, ["open", "onConfirm"])
|
|
400
|
-
])) : C("", !0)
|
|
401
|
-
])
|
|
402
|
-
]),
|
|
403
|
-
a.status !== n(i).Online && a.status !== n(i).Offline && a.status !== n(i).Success ? (u(), d("div", Ke, [
|
|
404
|
-
p(n(ye), {
|
|
405
|
-
percent: a.percent,
|
|
406
|
-
"stroke-width": 2,
|
|
407
|
-
"show-info": !1,
|
|
408
|
-
style: { height: "2px" }
|
|
409
|
-
}, null, 8, ["percent"])
|
|
410
|
-
])) : C("", !0)
|
|
411
|
-
]))), 128))
|
|
412
|
-
])
|
|
413
|
-
], 2);
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
}), Ze = /* @__PURE__ */ we(je, [["__scopeId", "data-v-063bdf08"]]);
|
|
417
|
-
export {
|
|
418
|
-
Ue as C,
|
|
419
|
-
Ze as U,
|
|
420
|
-
_e as a,
|
|
421
|
-
Ce as d,
|
|
422
|
-
Se as p
|
|
423
|
-
};
|