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