@lemon30_npm/csit-vue3 1.0.63 → 1.0.65
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/csit-vue3.js +631 -619
- package/dist/index.css +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.css +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.vue.js +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.vue2.js +1 -1
- package/dist/lib/ci-upload/index.css +1 -1
- package/dist/lib/ci-upload/index.vue.js +3 -3
- package/dist/lib/ci-upload/index.vue2.js +197 -189
- package/dist/lib/ci-upload/props/index.js +5 -1
- package/dist/lib/styles/reset-elementPlus/index.css +1 -1
- package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/type.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ElUpload as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { ElMessageBox as
|
|
11
|
-
import { useUpload as
|
|
12
|
-
import { useUploadRetry as
|
|
13
|
-
import { downloadFileWithAxios as
|
|
14
|
-
import { getFileIconByName as
|
|
15
|
-
import { useExposeMethods as
|
|
16
|
-
import { useCiUploadComputed as
|
|
17
|
-
import { defaultProps as
|
|
18
|
-
import { useFileSize as
|
|
19
|
-
const
|
|
1
|
+
import { ElUpload as re, ElButton as de, ElLink as ue, ElTooltip as me, ElDivider as ce } from "element-plus/es";
|
|
2
|
+
import { defineComponent as pe, mergeDefaults as fe, useSlots as ge, ref as V, watch as ye, createElementBlock as l, openBlock as s, createBlock as L, createCommentVNode as n, mergeProps as ve, unref as y, createSlots as ke, withCtx as m, renderSlot as P, Fragment as v, createElementVNode as a, toDisplayString as b, renderList as M, normalizeProps as we, guardReactiveProps as he, normalizeClass as $, createTextVNode as _, createVNode as N, normalizeStyle as q, nextTick as D } from "vue";
|
|
3
|
+
import A from "./icons/icon-upload-btn.svg.js";
|
|
4
|
+
import H from "./icons/icon-upload-btn-hover.svg.js";
|
|
5
|
+
import O from "./icons/icon-upload-btn-disabled.svg.js";
|
|
6
|
+
import be from "./icons/icon-loading-blue.svg.js";
|
|
7
|
+
import Be from "./icons/icon-upload-success.svg.js";
|
|
8
|
+
import Se from "./icons/icon-upload-retry.svg.js";
|
|
9
|
+
import Ce from "./icons/icon-upload-fail.svg.js";
|
|
10
|
+
import { ElMessageBox as Le, ElMessage as z } from "element-plus";
|
|
11
|
+
import { useUpload as _e } from "./hooks/useUpload.js";
|
|
12
|
+
import { useUploadRetry as Ne } from "./hooks/useUploadRetry.js";
|
|
13
|
+
import { downloadFileWithAxios as ze } from "./utils/file.js";
|
|
14
|
+
import { getFileIconByName as $e } from "./utils/file-icon-maps.js";
|
|
15
|
+
import { useExposeMethods as De } from "./expose/index.js";
|
|
16
|
+
import { useCiUploadComputed as Ee } from "./computed/index.js";
|
|
17
|
+
import { defaultProps as Te } from "./props/index.js";
|
|
18
|
+
import { useFileSize as Pe } from "./hooks/useFileSize.js";
|
|
19
|
+
const Ue = { class: "CiUpload" }, Ie = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "tip-slot-textInfo"
|
|
22
|
-
},
|
|
22
|
+
}, Re = {
|
|
23
23
|
key: 1,
|
|
24
24
|
class: "default-tip-slot-textInfo"
|
|
25
|
-
},
|
|
25
|
+
}, Ve = { class: "upload-btn-text" }, Fe = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "tip-slot-textInfo"
|
|
28
|
-
},
|
|
28
|
+
}, Ke = {
|
|
29
29
|
key: 1,
|
|
30
30
|
class: "default-tip-slot-textInfo"
|
|
31
|
-
},
|
|
31
|
+
}, Me = { class: "file-item-top" }, qe = { class: "file-name-file-icon" }, Ae = ["src"], He = { class: "top-right" }, Oe = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "file-size"
|
|
34
|
-
},
|
|
34
|
+
}, We = {
|
|
35
35
|
key: 1,
|
|
36
36
|
class: "file-operate-btn"
|
|
37
|
-
},
|
|
37
|
+
}, je = { class: "file-status-icon-wrapper" }, Ge = { class: "uploading-percentage" }, Je = ["onClick"], Qe = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "file-item-bottom file-progress-bar"
|
|
40
|
-
},
|
|
40
|
+
}, Xe = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "file-item-bottom file-progress-bar download-progress-bar"
|
|
43
|
-
},
|
|
43
|
+
}, Ye = {
|
|
44
44
|
name: "CiUpload"
|
|
45
|
-
},
|
|
46
|
-
...
|
|
47
|
-
props: /* @__PURE__ */
|
|
45
|
+
}, kt = /* @__PURE__ */ pe({
|
|
46
|
+
...Ye,
|
|
47
|
+
props: /* @__PURE__ */ fe({
|
|
48
48
|
action: {},
|
|
49
49
|
downloadUrl: {},
|
|
50
50
|
data: {},
|
|
@@ -69,58 +69,66 @@ const Ne = { class: "CiUpload" }, $e = {
|
|
|
69
69
|
readonly: { type: Boolean },
|
|
70
70
|
axiosInstance: {},
|
|
71
71
|
minSize: {},
|
|
72
|
-
showFileNameEllipsisTooltip: { type: Boolean }
|
|
73
|
-
|
|
72
|
+
showFileNameEllipsisTooltip: { type: Boolean },
|
|
73
|
+
maxFileNameLength: {},
|
|
74
|
+
minFileNameLength: {}
|
|
75
|
+
}, Te),
|
|
74
76
|
emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
|
|
75
|
-
setup(
|
|
76
|
-
const { formatFileSize:
|
|
77
|
-
|
|
78
|
-
checkUploadStatus:
|
|
77
|
+
setup(W, { expose: j, emit: G }) {
|
|
78
|
+
const { formatFileSize: U } = Pe(), J = ge(), F = V(), f = V(!1), S = V([]), { checkUploadStatus: Q } = De(S), i = W, { customHttpRequest: X } = _e(i.axiosInstance), r = G;
|
|
79
|
+
j({
|
|
80
|
+
checkUploadStatus: Q
|
|
79
81
|
});
|
|
80
|
-
const { retryUpload:
|
|
81
|
-
|
|
82
|
-
() =>
|
|
82
|
+
const { retryUpload: Y } = Ne(S, r, i);
|
|
83
|
+
ye(
|
|
84
|
+
() => i.fileList,
|
|
83
85
|
(e) => {
|
|
84
|
-
|
|
86
|
+
S.value = e.map((t) => ({ ...t }));
|
|
85
87
|
},
|
|
86
88
|
{ immediate: !0 }
|
|
87
89
|
);
|
|
88
|
-
const
|
|
90
|
+
const I = (e) => {
|
|
89
91
|
var t;
|
|
90
|
-
(t =
|
|
91
|
-
},
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
(t = F.value) == null || t.handleRemove(e);
|
|
93
|
+
}, R = (e) => {
|
|
94
|
+
if (i.customDownload) {
|
|
95
|
+
r("onCustomDownload", e);
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
|
-
e.downloadPercentage = 0, e.status = "downloading",
|
|
98
|
+
e.downloadPercentage = 0, e.status = "downloading", ze(
|
|
97
99
|
{
|
|
98
100
|
fileKey: e.fileKey || "当前此条数据没有fileKey字段",
|
|
99
101
|
fileName: e.fileName || "当前此条数据没有fileName字段"
|
|
100
102
|
},
|
|
101
|
-
|
|
103
|
+
i.downloadUrl,
|
|
102
104
|
(t) => {
|
|
103
105
|
e.downloadPercentage = t, t === 100 && (e.status = "success");
|
|
104
106
|
},
|
|
105
107
|
(t) => {
|
|
106
108
|
e.status = "success";
|
|
107
109
|
},
|
|
108
|
-
|
|
110
|
+
i.axiosInstance
|
|
109
111
|
);
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
112
|
+
}, Z = (e) => {
|
|
113
|
+
const t = i.accept.split(",").map((u) => u.trim().toLowerCase()), c = e.type.toLowerCase(), k = e.name.toLowerCase();
|
|
114
|
+
if (!t.some((u) => c === u || k.endsWith(u)))
|
|
115
|
+
return z.error("不支持上传该类型文件"), f.value = !0, D(() => {
|
|
116
|
+
const u = i.fileList.filter((B) => B.uid !== e.uid);
|
|
117
|
+
r("update:fileList", u), f.value = !1;
|
|
118
|
+
}), !1;
|
|
119
|
+
const g = e.name || "", w = g.lastIndexOf("."), d = (w > 0 ? g.slice(0, w) : g).length, h = i.maxFileNameLength, C = i.minFileNameLength;
|
|
120
|
+
let E = !0, T = "";
|
|
121
|
+
return h > 0 && C > 0 ? (d > h || d < C) && (E = !1, T = `文件名长度需在 ${C} 到 ${h} 个字符之间`) : h > 0 ? d > h && (E = !1, T = `文件名长度不能超过 ${h} 个字符`) : C > 0 && d < C && (E = !1, T = `文件名长度不能小于 ${C} 个字符`), E ? e.size < i.minSize || e.size === 0 ? (e.size === 0 ? z.error("文件大小不能为空") : z.error(`文件大小不能小于 ${U(i.minSize)}`), f.value = !0, D(() => {
|
|
122
|
+
const u = i.fileList.filter((B) => B.uid !== e.uid);
|
|
123
|
+
r("update:fileList", u), f.value = !1;
|
|
124
|
+
}), !1) : e.size <= i.maxSize ? !0 : (z.error(`文件大小超出限制,最大文件大小为${U(i.maxSize)}`), f.value = !0, D(() => {
|
|
125
|
+
const u = i.fileList.filter((B) => B.uid !== e.uid);
|
|
126
|
+
r("update:fileList", u), f.value = !1;
|
|
127
|
+
}), !1) : (z.error(T), f.value = !0, D(() => {
|
|
128
|
+
const u = i.fileList.filter((B) => B.uid !== e.uid);
|
|
129
|
+
r("update:fileList", u), f.value = !1;
|
|
122
130
|
}), !1);
|
|
123
|
-
},
|
|
131
|
+
}, x = (e, t) => f.value ? !0 : Le.confirm(
|
|
124
132
|
`确定删除 ${e.fileName || e.name} 文件?`,
|
|
125
133
|
"确定删除",
|
|
126
134
|
{
|
|
@@ -133,96 +141,96 @@ const Ne = { class: "CiUpload" }, $e = {
|
|
|
133
141
|
// 用户点击“确定”按钮,允许删除
|
|
134
142
|
() => !1
|
|
135
143
|
// 用户点击“取消”按钮,取消删除
|
|
136
|
-
),
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
t.status = "fail", t.percentage = 0,
|
|
140
|
-
|
|
144
|
+
), ee = (e, t) => {
|
|
145
|
+
z.error(`文件数量超出限制,最大文件数量为${i.limit}个`);
|
|
146
|
+
}, te = (e, t, c) => {
|
|
147
|
+
t.status = "fail", t.percentage = 0, D(() => {
|
|
148
|
+
r("update:fileList", [...c, t]), r("onError", t, c);
|
|
141
149
|
});
|
|
142
|
-
},
|
|
143
|
-
var p,
|
|
150
|
+
}, oe = (e, t, c) => {
|
|
151
|
+
var p, g, w;
|
|
144
152
|
if (!e) return;
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
e.status === "success" && !e.response || (
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
}, { hasRealDefaultSlot:
|
|
153
|
+
const k = c.find((o) => o.uid === t.uid);
|
|
154
|
+
k && (k.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, k.fileKey = ((g = e == null ? void 0 : e.data) == null ? void 0 : g.fileKey) || "当前接口没有返回fileKey字段", k.fileSize = ((w = e == null ? void 0 : e.data) == null ? void 0 : w.fileSize) || t.size), r("update:fileList", c), r("onSuccess", t, c);
|
|
155
|
+
}, se = (e, t) => {
|
|
156
|
+
e.status === "success" && !e.response || (r("update:fileList", t), r("onChange", e, t));
|
|
157
|
+
}, le = (e, t) => {
|
|
158
|
+
r("update:fileList", t), r("onRemove", e, t);
|
|
159
|
+
}, { hasRealDefaultSlot: ae, finalBeforeUpload: ie, defaultTipSlotTextInfo: K, otherSlots: ne } = Ee(i, J, Z);
|
|
152
160
|
return (e, t) => {
|
|
153
|
-
const
|
|
154
|
-
return s(), l("div",
|
|
155
|
-
e.readonly ?
|
|
161
|
+
const c = de, k = re, p = ue, g = me, w = ce;
|
|
162
|
+
return s(), l("div", Ue, [
|
|
163
|
+
e.readonly ? n("", !0) : (s(), L(k, ve({
|
|
156
164
|
key: 0,
|
|
157
165
|
class: ["ci-el-upload-component", { "is-disabled": e.disabled }],
|
|
158
166
|
ref_key: "uploadRef",
|
|
159
|
-
ref:
|
|
167
|
+
ref: F,
|
|
160
168
|
action: e.action,
|
|
161
169
|
data: e.data,
|
|
162
170
|
headers: e.headers,
|
|
163
|
-
"file-list":
|
|
171
|
+
"file-list": S.value,
|
|
164
172
|
accept: e.accept,
|
|
165
173
|
limit: e.limit,
|
|
166
174
|
multiple: e.multiple,
|
|
167
175
|
drag: e.drag,
|
|
168
176
|
disabled: e.disabled,
|
|
169
|
-
"before-upload":
|
|
170
|
-
"before-remove":
|
|
171
|
-
"on-success":
|
|
172
|
-
"on-change":
|
|
173
|
-
"on-remove":
|
|
174
|
-
"on-exceed":
|
|
175
|
-
"on-error":
|
|
176
|
-
"http-request":
|
|
177
|
+
"before-upload": y(ie),
|
|
178
|
+
"before-remove": x,
|
|
179
|
+
"on-success": oe,
|
|
180
|
+
"on-change": se,
|
|
181
|
+
"on-remove": le,
|
|
182
|
+
"on-exceed": ee,
|
|
183
|
+
"on-error": te,
|
|
184
|
+
"http-request": y(X),
|
|
177
185
|
"show-file-list": !1
|
|
178
|
-
}, e.$attrs),
|
|
179
|
-
default:
|
|
180
|
-
|
|
181
|
-
e.drag ? (s(), l(
|
|
186
|
+
}, e.$attrs), ke({
|
|
187
|
+
default: m(() => [
|
|
188
|
+
y(ae) ? P(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(v, { key: 1 }, [
|
|
189
|
+
e.drag ? (s(), l(v, { key: 0 }, [
|
|
182
190
|
t[0] || (t[0] = a("img", {
|
|
183
191
|
class: "upload-btn-icon",
|
|
184
|
-
src:
|
|
192
|
+
src: A,
|
|
185
193
|
alt: ""
|
|
186
194
|
}, null, -1)),
|
|
187
195
|
t[1] || (t[1] = a("img", {
|
|
188
196
|
class: "upload-btn-icon-hover",
|
|
189
|
-
src:
|
|
197
|
+
src: H,
|
|
190
198
|
alt: ""
|
|
191
199
|
}, null, -1)),
|
|
192
200
|
t[2] || (t[2] = a("img", {
|
|
193
201
|
class: "upload-btn-icon-disabled",
|
|
194
|
-
src:
|
|
202
|
+
src: O,
|
|
195
203
|
alt: ""
|
|
196
204
|
}, null, -1)),
|
|
197
205
|
t[3] || (t[3] = a("div", { class: "drag-text-info" }, [
|
|
198
206
|
a("span", { class: "drag-text-info-click" }, "点击上传"),
|
|
199
207
|
a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
|
|
200
208
|
], -1)),
|
|
201
|
-
e.$slots.tip ? (s(), l("div",
|
|
202
|
-
|
|
203
|
-
])) : (s(), l("div",
|
|
204
|
-
], 64)) : (s(),
|
|
209
|
+
e.$slots.tip ? (s(), l("div", Ie, [
|
|
210
|
+
P(e.$slots, "tip", {}, void 0, !0)
|
|
211
|
+
])) : (s(), l("div", Re, b(y(K)), 1))
|
|
212
|
+
], 64)) : (s(), L(c, {
|
|
205
213
|
key: 1,
|
|
206
214
|
class: "upload-btn",
|
|
207
215
|
disabled: e.disabled
|
|
208
216
|
}, {
|
|
209
|
-
default:
|
|
217
|
+
default: m(() => [
|
|
210
218
|
t[4] || (t[4] = a("img", {
|
|
211
219
|
class: "upload-btn-icon",
|
|
212
|
-
src:
|
|
220
|
+
src: A,
|
|
213
221
|
alt: ""
|
|
214
222
|
}, null, -1)),
|
|
215
223
|
t[5] || (t[5] = a("img", {
|
|
216
224
|
class: "upload-btn-icon-hover",
|
|
217
|
-
src:
|
|
225
|
+
src: H,
|
|
218
226
|
alt: ""
|
|
219
227
|
}, null, -1)),
|
|
220
228
|
t[6] || (t[6] = a("img", {
|
|
221
229
|
class: "upload-btn-icon-disabled",
|
|
222
|
-
src:
|
|
230
|
+
src: O,
|
|
223
231
|
alt: ""
|
|
224
232
|
}, null, -1)),
|
|
225
|
-
a("span",
|
|
233
|
+
a("span", Ve, b(e.uploadBtnText), 1)
|
|
226
234
|
]),
|
|
227
235
|
_: 1,
|
|
228
236
|
__: [4, 5, 6]
|
|
@@ -233,188 +241,188 @@ const Ne = { class: "CiUpload" }, $e = {
|
|
|
233
241
|
}, [
|
|
234
242
|
e.drag ? void 0 : {
|
|
235
243
|
name: "tip",
|
|
236
|
-
fn:
|
|
237
|
-
e.$slots.tip ? (s(), l("div",
|
|
238
|
-
|
|
239
|
-
])) : (s(), l("div",
|
|
244
|
+
fn: m(() => [
|
|
245
|
+
e.$slots.tip ? (s(), l("div", Fe, [
|
|
246
|
+
P(e.$slots, "tip", {}, void 0, !0)
|
|
247
|
+
])) : (s(), l("div", Ke, b(y(K)), 1))
|
|
240
248
|
]),
|
|
241
249
|
key: "0"
|
|
242
250
|
},
|
|
243
|
-
|
|
244
|
-
name:
|
|
245
|
-
fn:
|
|
246
|
-
|
|
251
|
+
M(y(ne), (o, d) => ({
|
|
252
|
+
name: d,
|
|
253
|
+
fn: m((h) => [
|
|
254
|
+
P(e.$slots, d, we(he(h || {})), void 0, !0)
|
|
247
255
|
])
|
|
248
256
|
}))
|
|
249
257
|
]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
|
|
250
|
-
|
|
258
|
+
S.value.length ? (s(), l("div", {
|
|
251
259
|
key: 1,
|
|
252
|
-
class:
|
|
260
|
+
class: $(["custom-file-list-default", { "is-readonly": e.readonly }])
|
|
253
261
|
}, [
|
|
254
|
-
(s(!0), l(
|
|
262
|
+
(s(!0), l(v, null, M(S.value, (o) => (s(), l("div", {
|
|
255
263
|
class: "file-item-wrapper",
|
|
256
264
|
key: o.uid
|
|
257
265
|
}, [
|
|
258
|
-
a("div",
|
|
259
|
-
a("div",
|
|
266
|
+
a("div", Me, [
|
|
267
|
+
a("div", qe, [
|
|
260
268
|
e.showFileExtIcon ? (s(), l("img", {
|
|
261
269
|
key: 0,
|
|
262
270
|
class: "file-icon",
|
|
263
|
-
src:
|
|
264
|
-
}, null, 8,
|
|
265
|
-
e.showFileNameEllipsisTooltip ? (s(),
|
|
271
|
+
src: y($e)(o.fileName || o.name)
|
|
272
|
+
}, null, 8, Ae)) : n("", !0),
|
|
273
|
+
e.showFileNameEllipsisTooltip ? (s(), L(g, {
|
|
266
274
|
key: 2,
|
|
267
275
|
effect: "dark",
|
|
268
276
|
content: o.fileName || o.name,
|
|
269
277
|
placement: "right"
|
|
270
278
|
}, {
|
|
271
|
-
default:
|
|
272
|
-
|
|
273
|
-
class:
|
|
279
|
+
default: m(() => [
|
|
280
|
+
N(p, {
|
|
281
|
+
class: $(["top-left file-name", { "is-show-file-name-ellipsis-tooltip": e.showFileNameEllipsisTooltip }]),
|
|
274
282
|
disabled: o.status === "downloading" || o.status === "uploading",
|
|
275
|
-
onClick: (
|
|
283
|
+
onClick: (d) => R(o)
|
|
276
284
|
}, {
|
|
277
|
-
default:
|
|
278
|
-
|
|
285
|
+
default: m(() => [
|
|
286
|
+
_(b(o.fileName || o.name), 1)
|
|
279
287
|
]),
|
|
280
288
|
_: 2
|
|
281
289
|
}, 1032, ["class", "disabled", "onClick"])
|
|
282
290
|
]),
|
|
283
291
|
_: 2
|
|
284
|
-
}, 1032, ["content"])) : (s(),
|
|
292
|
+
}, 1032, ["content"])) : (s(), L(p, {
|
|
285
293
|
key: 1,
|
|
286
294
|
class: "top-left file-name",
|
|
287
295
|
disabled: o.status === "downloading" || o.status === "uploading",
|
|
288
|
-
onClick: (
|
|
296
|
+
onClick: (d) => R(o)
|
|
289
297
|
}, {
|
|
290
|
-
default:
|
|
291
|
-
|
|
298
|
+
default: m(() => [
|
|
299
|
+
_(b(o.fileName || o.name), 1)
|
|
292
300
|
]),
|
|
293
301
|
_: 2
|
|
294
302
|
}, 1032, ["disabled", "onClick"]))
|
|
295
303
|
]),
|
|
296
|
-
a("div",
|
|
297
|
-
e.showFileSize ? (s(), l("span",
|
|
298
|
-
o.status !== "fail" ? (s(), l("div",
|
|
299
|
-
o.status !== "uploading" ? (s(), l(
|
|
300
|
-
e.showPreviewBtn ? (s(), l(
|
|
301
|
-
|
|
302
|
-
onClick: (
|
|
304
|
+
a("div", He, [
|
|
305
|
+
e.showFileSize ? (s(), l("span", Oe, b(y(U)(o.fileSize || o.size)), 1)) : n("", !0),
|
|
306
|
+
o.status !== "fail" ? (s(), l("div", We, [
|
|
307
|
+
o.status !== "uploading" ? (s(), l(v, { key: 0 }, [
|
|
308
|
+
e.showPreviewBtn ? (s(), l(v, { key: 0 }, [
|
|
309
|
+
N(p, {
|
|
310
|
+
onClick: (d) => I(o)
|
|
303
311
|
}, {
|
|
304
|
-
default:
|
|
305
|
-
|
|
312
|
+
default: m(() => t[7] || (t[7] = [
|
|
313
|
+
_(" 在线预览 ")
|
|
306
314
|
])),
|
|
307
315
|
_: 2,
|
|
308
316
|
__: [7]
|
|
309
317
|
}, 1032, ["onClick"]),
|
|
310
|
-
|
|
311
|
-
], 64)) :
|
|
312
|
-
e.showDownloadBtn ? (s(), l(
|
|
313
|
-
|
|
318
|
+
N(w, { direction: "vertical" })
|
|
319
|
+
], 64)) : n("", !0),
|
|
320
|
+
e.showDownloadBtn ? (s(), l(v, { key: 1 }, [
|
|
321
|
+
N(p, {
|
|
314
322
|
disabled: o.status === "downloading",
|
|
315
|
-
onClick: (
|
|
323
|
+
onClick: (d) => R(o)
|
|
316
324
|
}, {
|
|
317
|
-
default:
|
|
318
|
-
|
|
325
|
+
default: m(() => [
|
|
326
|
+
_(b(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
|
|
319
327
|
]),
|
|
320
328
|
_: 2
|
|
321
329
|
}, 1032, ["disabled", "onClick"]),
|
|
322
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
330
|
+
e.showDeleteBtn && !e.readonly ? (s(), L(w, {
|
|
323
331
|
key: 0,
|
|
324
332
|
direction: "vertical"
|
|
325
|
-
})) :
|
|
326
|
-
], 64)) :
|
|
327
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
333
|
+
})) : n("", !0)
|
|
334
|
+
], 64)) : n("", !0),
|
|
335
|
+
e.showDeleteBtn && !e.readonly ? (s(), L(p, {
|
|
328
336
|
key: 2,
|
|
329
|
-
onClick: (
|
|
337
|
+
onClick: (d) => I(o)
|
|
330
338
|
}, {
|
|
331
|
-
default:
|
|
332
|
-
|
|
339
|
+
default: m(() => t[8] || (t[8] = [
|
|
340
|
+
_("删除")
|
|
333
341
|
])),
|
|
334
342
|
_: 2,
|
|
335
343
|
__: [8]
|
|
336
|
-
}, 1032, ["onClick"])) :
|
|
337
|
-
], 64)) :
|
|
338
|
-
])) :
|
|
339
|
-
a("div",
|
|
344
|
+
}, 1032, ["onClick"])) : n("", !0)
|
|
345
|
+
], 64)) : n("", !0)
|
|
346
|
+
])) : n("", !0),
|
|
347
|
+
a("div", je, [
|
|
340
348
|
o.status === "uploading" ? (s(), l("div", {
|
|
341
349
|
key: 0,
|
|
342
|
-
class:
|
|
350
|
+
class: $(o.status)
|
|
343
351
|
}, [
|
|
344
352
|
t[9] || (t[9] = a("img", {
|
|
345
353
|
class: "uploading-icon",
|
|
346
|
-
src:
|
|
354
|
+
src: be
|
|
347
355
|
}, null, -1)),
|
|
348
|
-
a("span",
|
|
349
|
-
], 2)) :
|
|
350
|
-
e.readonly ?
|
|
356
|
+
a("span", Ge, b(o.percentage) + "%", 1)
|
|
357
|
+
], 2)) : n("", !0),
|
|
358
|
+
e.readonly ? n("", !0) : (s(), l(v, { key: 1 }, [
|
|
351
359
|
o.status === "success" || o.status === "downloading" ? (s(), l("span", {
|
|
352
360
|
key: 0,
|
|
353
|
-
class:
|
|
361
|
+
class: $(o.status)
|
|
354
362
|
}, t[10] || (t[10] = [
|
|
355
363
|
a("img", {
|
|
356
364
|
class: "success-icon",
|
|
357
|
-
src:
|
|
365
|
+
src: Be
|
|
358
366
|
}, null, -1)
|
|
359
|
-
]), 2)) :
|
|
367
|
+
]), 2)) : n("", !0)
|
|
360
368
|
], 64)),
|
|
361
369
|
o.status === "fail" ? (s(), l("div", {
|
|
362
370
|
key: 2,
|
|
363
|
-
class:
|
|
371
|
+
class: $(["fail-icon-wrapper", o.status])
|
|
364
372
|
}, [
|
|
365
|
-
|
|
366
|
-
onClick: (
|
|
373
|
+
N(p, {
|
|
374
|
+
onClick: (d) => I(o)
|
|
367
375
|
}, {
|
|
368
|
-
default:
|
|
369
|
-
|
|
376
|
+
default: m(() => t[11] || (t[11] = [
|
|
377
|
+
_(" 删除 ")
|
|
370
378
|
])),
|
|
371
379
|
_: 2,
|
|
372
380
|
__: [11]
|
|
373
381
|
}, 1032, ["onClick"]),
|
|
374
|
-
|
|
382
|
+
N(g, {
|
|
375
383
|
effect: "dark",
|
|
376
384
|
content: "点击重新上传",
|
|
377
385
|
placement: "bottom"
|
|
378
386
|
}, {
|
|
379
|
-
default:
|
|
387
|
+
default: m(() => [
|
|
380
388
|
a("img", {
|
|
381
389
|
class: "retry-icon",
|
|
382
|
-
src:
|
|
383
|
-
onClick: (
|
|
384
|
-
}, null, 8,
|
|
390
|
+
src: Se,
|
|
391
|
+
onClick: (d) => y(Y)(o)
|
|
392
|
+
}, null, 8, Je)
|
|
385
393
|
]),
|
|
386
394
|
_: 2
|
|
387
395
|
}, 1024),
|
|
388
396
|
t[12] || (t[12] = a("img", {
|
|
389
397
|
class: "fail-icon",
|
|
390
|
-
src:
|
|
398
|
+
src: Ce
|
|
391
399
|
}, null, -1))
|
|
392
|
-
], 2)) :
|
|
400
|
+
], 2)) : n("", !0)
|
|
393
401
|
])
|
|
394
402
|
])
|
|
395
403
|
]),
|
|
396
|
-
e.showUploadProgress ? (s(), l(
|
|
397
|
-
o.status === "uploading" ? (s(), l("div",
|
|
404
|
+
e.showUploadProgress ? (s(), l(v, { key: 0 }, [
|
|
405
|
+
o.status === "uploading" ? (s(), l("div", Qe, [
|
|
398
406
|
a("div", {
|
|
399
407
|
class: "file-progress-inner",
|
|
400
|
-
style:
|
|
408
|
+
style: q({ width: (o.percentage || 0) + "%" })
|
|
401
409
|
}, null, 4)
|
|
402
|
-
])) :
|
|
403
|
-
], 64)) :
|
|
404
|
-
e.showDownloadProgress ? (s(), l(
|
|
405
|
-
o.status === "downloading" ? (s(), l("div",
|
|
410
|
+
])) : n("", !0)
|
|
411
|
+
], 64)) : n("", !0),
|
|
412
|
+
e.showDownloadProgress ? (s(), l(v, { key: 1 }, [
|
|
413
|
+
o.status === "downloading" ? (s(), l("div", Xe, [
|
|
406
414
|
a("div", {
|
|
407
415
|
class: "file-progress-inner",
|
|
408
|
-
style:
|
|
416
|
+
style: q({ width: (o.downloadPercentage || 0) + "%" })
|
|
409
417
|
}, null, 4)
|
|
410
|
-
])) :
|
|
411
|
-
], 64)) :
|
|
418
|
+
])) : n("", !0)
|
|
419
|
+
], 64)) : n("", !0)
|
|
412
420
|
]))), 128))
|
|
413
|
-
], 2)) :
|
|
421
|
+
], 2)) : n("", !0)
|
|
414
422
|
]);
|
|
415
423
|
};
|
|
416
424
|
}
|
|
417
425
|
});
|
|
418
426
|
export {
|
|
419
|
-
|
|
427
|
+
kt as default
|
|
420
428
|
};
|
|
@@ -52,7 +52,11 @@ const e = {
|
|
|
52
52
|
minSize: 0,
|
|
53
53
|
// 0 代表: 不支持上传空文件, 则就是必须大于 0; 如果开发者配置的值大于0, 则就是: 大于等于minSize即可.
|
|
54
54
|
// 文件名区域超过最大宽度时是否省略号 和 Tooltip 展示
|
|
55
|
-
showFileNameEllipsisTooltip: !1
|
|
55
|
+
showFileNameEllipsisTooltip: !1,
|
|
56
|
+
// 限制上传的文件名最大长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须小于等于maxFileNameLength即可.
|
|
57
|
+
maxFileNameLength: 0,
|
|
58
|
+
// 限制上传的文件名最小长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须大于等于minFileNameLength即可.
|
|
59
|
+
minFileNameLength: 0
|
|
56
60
|
};
|
|
57
61
|
export {
|
|
58
62
|
e as defaultProps
|