btt-ui 1.0.37 → 1.0.38
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.
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Icon as
|
|
1
|
+
import { defineComponent as V, ref as b, reactive as R, watch as q, openBlock as l, createElementBlock as s, renderSlot as m, createElementVNode as c, createVNode as w, unref as f, withModifiers as x, createCommentVNode as u, createBlock as z, Fragment as k, normalizeClass as $, renderList as v, toDisplayString as d, createTextVNode as O, Teleport as U, nextTick as Z } from "vue";
|
|
2
|
+
import { Icon as y } from "../../icon/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import { uploadImg as
|
|
5
|
-
import { Dragger as
|
|
6
|
-
import { ZoomIn as
|
|
7
|
-
|
|
4
|
+
import { uploadImg as G } from "./uploadFile2.mjs";
|
|
5
|
+
import { Dragger as H } from "../../directives/drag.mjs";
|
|
6
|
+
import { ZoomIn as J } from "../../directives/zoomIn.mjs";
|
|
7
|
+
import "./uploadFile.vue?vue&type=style&index=0&lang.css";
|
|
8
|
+
const K = { class: "k-upload-file-wrapper" }, P = { key: 0 }, Q = { class: "upload-btn-section" }, W = { class: "btn-box" }, X = { class: "img-sec-box" }, Y = ["src"], _ = { class: "img-wrapper" }, ee = ["src", "title"], te = ["src", "title"], ie = ["src", "title"], le = ["onClick"], se = ["onClick"], oe = { class: "k-file-extensions-desc" }, re = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "error-tip"
|
|
10
|
-
},
|
|
11
|
+
}, ne = { key: 0 }, ue = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "upload-file-progress"
|
|
14
|
+
}, ae = V({
|
|
11
15
|
name: "k-upload-file"
|
|
12
|
-
}),
|
|
13
|
-
...
|
|
16
|
+
}), ke = V({
|
|
17
|
+
...ae,
|
|
14
18
|
props: {
|
|
15
19
|
data: {
|
|
16
20
|
type: Array,
|
|
@@ -50,88 +54,98 @@ const Z = { class: "k-upload-file-wrapper" }, G = { key: 0 }, H = { class: "uplo
|
|
|
50
54
|
successCode: {
|
|
51
55
|
type: Number,
|
|
52
56
|
default: 200
|
|
57
|
+
},
|
|
58
|
+
loadingFileMaxSize: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: 20
|
|
53
61
|
}
|
|
54
62
|
},
|
|
55
63
|
emits: ["limitError", "success", "deleteSuccess", "fileSizeError"],
|
|
56
|
-
setup(r, { expose:
|
|
64
|
+
setup(r, { expose: B, emit: N }) {
|
|
57
65
|
const A = b();
|
|
58
|
-
let
|
|
59
|
-
const a = r;
|
|
60
|
-
|
|
61
|
-
const
|
|
66
|
+
let g;
|
|
67
|
+
const F = b(!1), a = r;
|
|
68
|
+
let j = a.maxSize * 1024 * 1024;
|
|
69
|
+
const T = a.loadingFileMaxSize * 1024 * 1024, h = N, i = R({
|
|
62
70
|
fileList: new Array(),
|
|
63
71
|
errFiles: new Array()
|
|
64
72
|
});
|
|
65
|
-
i.fileList = a.data,
|
|
73
|
+
i.fileList = a.data, q(() => a.data, (e) => {
|
|
66
74
|
i.fileList = e;
|
|
67
75
|
}, { deep: !0 });
|
|
68
|
-
const
|
|
69
|
-
|
|
76
|
+
const D = (e) => {
|
|
77
|
+
for (let o = 0; o < e.length; o++)
|
|
78
|
+
e[o].size > T && (F.value = !0);
|
|
79
|
+
}, C = () => {
|
|
80
|
+
g && g.hide(), G({
|
|
70
81
|
acceptType: a.accept,
|
|
71
82
|
limit: a.limit,
|
|
72
|
-
maxSize:
|
|
83
|
+
maxSize: j,
|
|
73
84
|
success: async (e) => {
|
|
74
|
-
i.errFiles = new Array();
|
|
75
|
-
let
|
|
85
|
+
D(e), i.errFiles = new Array();
|
|
86
|
+
let o = new Array();
|
|
76
87
|
if (a.requestApi) {
|
|
77
88
|
let t = await a.requestApi(a.params, e);
|
|
78
89
|
if (t.code == a.successCode) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
F.value && (F.value = !1);
|
|
91
|
+
for (let n = 0; n < t.data.length; n++)
|
|
92
|
+
o.push(t.data[n]);
|
|
93
|
+
o.forEach((n) => {
|
|
94
|
+
n.name = n.fileOriginName, n.type = "image/" + n.fileSuffix;
|
|
95
|
+
}), S(o);
|
|
82
96
|
} else
|
|
83
97
|
console.log(t.msg);
|
|
84
98
|
} else {
|
|
85
99
|
for (let t = 0; t < e.length; t++)
|
|
86
|
-
e[t].url = window.URL.createObjectURL(e[t]),
|
|
87
|
-
|
|
100
|
+
e[t].url = window.URL.createObjectURL(e[t]), o.push(e[t]);
|
|
101
|
+
S(o);
|
|
88
102
|
}
|
|
89
103
|
},
|
|
90
104
|
limitError: (e) => {
|
|
91
|
-
|
|
105
|
+
h("limitError"), i.errFiles = new Array();
|
|
92
106
|
},
|
|
93
107
|
fileSizeError: (e) => {
|
|
94
|
-
i.errFiles = e,
|
|
108
|
+
i.errFiles = e, h("fileSizeError", e);
|
|
95
109
|
}
|
|
96
110
|
});
|
|
97
|
-
},
|
|
98
|
-
a.limit == 1 ? (i.fileList = e, a.type == "image" &&
|
|
99
|
-
|
|
100
|
-
})) : i.fileList = [...i.fileList, ...e],
|
|
111
|
+
}, S = (e) => {
|
|
112
|
+
a.limit == 1 ? (i.fileList = e, a.type == "image" && Z(() => {
|
|
113
|
+
g ? g.updateSrc(p(i.fileList[0].url)) : g = new J(A.value, { type: "margin" });
|
|
114
|
+
})) : i.fileList = [...i.fileList, ...e], h("success", i.fileList);
|
|
101
115
|
};
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
for (let t = 0; t <
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
116
|
+
function I(e) {
|
|
117
|
+
const o = document.cookie.split("; ");
|
|
118
|
+
for (let t = 0; t < o.length; t++) {
|
|
119
|
+
const n = o[t].split("=");
|
|
120
|
+
if (n[0] === e)
|
|
121
|
+
return n[1];
|
|
108
122
|
}
|
|
109
123
|
return "";
|
|
110
124
|
}
|
|
111
|
-
const
|
|
112
|
-
let
|
|
113
|
-
i.fileList.splice(e, 1),
|
|
125
|
+
const p = (e) => a.hasToken ? `${e}?token=${I("bearer")}` : e, E = (e) => {
|
|
126
|
+
let o = i.fileList[e];
|
|
127
|
+
i.fileList.splice(e, 1), h("deleteSuccess", { deleteFile: o, result: i.fileList });
|
|
114
128
|
}, L = (e) => {
|
|
115
|
-
new
|
|
129
|
+
new H(e.target, { type: "margin", list: i.fileList }).build();
|
|
116
130
|
};
|
|
117
|
-
return
|
|
131
|
+
return B({
|
|
118
132
|
clearFiles: () => {
|
|
119
133
|
i.fileList = new Array();
|
|
120
134
|
},
|
|
121
|
-
deleteFile:
|
|
122
|
-
}), (e,
|
|
123
|
-
r.isView ? u("", !0) :
|
|
124
|
-
r.type == "file" ? (l(), s("div",
|
|
125
|
-
c("span", { onClick:
|
|
126
|
-
|
|
127
|
-
c("div",
|
|
128
|
-
c("div",
|
|
129
|
-
w(y
|
|
135
|
+
deleteFile: E
|
|
136
|
+
}), (e, o) => (l(), s("div", K, [
|
|
137
|
+
r.isView ? u("", !0) : m(e.$slots, "default", { key: 0 }, () => [
|
|
138
|
+
r.type == "file" ? (l(), s("div", P, [
|
|
139
|
+
c("span", { onClick: C }, [
|
|
140
|
+
m(e.$slots, "icon", {}, () => [
|
|
141
|
+
c("div", Q, [
|
|
142
|
+
c("div", W, [
|
|
143
|
+
w(f(y), {
|
|
130
144
|
name: "download",
|
|
131
145
|
color: "#cccccc",
|
|
132
146
|
size: "20"
|
|
133
147
|
}),
|
|
134
|
-
|
|
148
|
+
o[1] || (o[1] = c("span", null, "\u4E0A\u4F20\u9644\u4EF6", -1))
|
|
135
149
|
])
|
|
136
150
|
])
|
|
137
151
|
])
|
|
@@ -139,33 +153,33 @@ const Z = { class: "k-upload-file-wrapper" }, G = { key: 0 }, H = { class: "uplo
|
|
|
139
153
|
])) : (l(), s("div", {
|
|
140
154
|
key: 1,
|
|
141
155
|
class: "btn-file-image",
|
|
142
|
-
onClick:
|
|
156
|
+
onClick: x(C, ["stop"])
|
|
143
157
|
}, [
|
|
144
|
-
c("div",
|
|
158
|
+
c("div", X, [
|
|
145
159
|
i.fileList.length > 0 && r.limit == 1 ? (l(), s("img", {
|
|
146
160
|
key: 0,
|
|
147
|
-
src:
|
|
161
|
+
src: p(i.fileList[0].url),
|
|
148
162
|
ref_key: "imgRef",
|
|
149
163
|
ref: A
|
|
150
|
-
}, null, 8,
|
|
164
|
+
}, null, 8, Y)) : u("", !0)
|
|
151
165
|
]),
|
|
152
166
|
!r.isView && i.fileList.length > 0 && r.limit == 1 ? (l(), s("span", {
|
|
153
167
|
key: 0,
|
|
154
168
|
class: "k-file-icon-close",
|
|
155
|
-
onClick:
|
|
169
|
+
onClick: o[0] || (o[0] = x((t) => E(0), ["stop"]))
|
|
156
170
|
}, [
|
|
157
|
-
w(y
|
|
171
|
+
w(f(y), {
|
|
158
172
|
name: "close",
|
|
159
173
|
size: "12"
|
|
160
174
|
})
|
|
161
175
|
])) : u("", !0),
|
|
162
|
-
|
|
163
|
-
i.fileList.length == 0 && r.limit == 1 ? (l(),
|
|
176
|
+
m(e.$slots, "icon", {}, () => [
|
|
177
|
+
i.fileList.length == 0 && r.limit == 1 ? (l(), z(f(y), {
|
|
164
178
|
key: 0,
|
|
165
179
|
name: "plus",
|
|
166
180
|
color: "#409eff"
|
|
167
181
|
})) : u("", !0),
|
|
168
|
-
r.limit > 1 ? (l(),
|
|
182
|
+
r.limit > 1 ? (l(), z(f(y), {
|
|
169
183
|
key: 1,
|
|
170
184
|
name: "plus",
|
|
171
185
|
color: "#409eff"
|
|
@@ -173,86 +187,91 @@ const Z = { class: "k-upload-file-wrapper" }, G = { key: 0 }, H = { class: "uplo
|
|
|
173
187
|
])
|
|
174
188
|
]))
|
|
175
189
|
]),
|
|
176
|
-
|
|
190
|
+
m(e.$slots, "files", {
|
|
177
191
|
data: i.fileList
|
|
178
192
|
}, () => [
|
|
179
|
-
r.type == "image" && r.limit > 1 ? (l(), s(
|
|
193
|
+
r.type == "image" && r.limit > 1 ? (l(), s(k, { key: 0 }, [
|
|
180
194
|
i.fileList.length > 0 ? (l(), s("ul", {
|
|
181
195
|
key: 0,
|
|
182
|
-
class:
|
|
196
|
+
class: $(["k-image-list", { "can-edit": !r.isView }])
|
|
183
197
|
}, [
|
|
184
|
-
(l(!0), s(
|
|
185
|
-
c("div",
|
|
198
|
+
(l(!0), s(k, null, v(i.fileList, (t, n) => (l(), s("li", { key: n }, [
|
|
199
|
+
c("div", _, [
|
|
186
200
|
t.type == "image/webp" ? (l(), s("img", {
|
|
187
201
|
key: 0,
|
|
188
|
-
src:
|
|
202
|
+
src: p(t.url),
|
|
189
203
|
onClick: L,
|
|
190
204
|
title: t.name
|
|
191
|
-
}, null, 8,
|
|
205
|
+
}, null, 8, ee)) : t.type == "image/png" ? (l(), s("img", {
|
|
192
206
|
key: 1,
|
|
193
|
-
src:
|
|
207
|
+
src: p(t.url),
|
|
194
208
|
onClick: L,
|
|
195
209
|
title: t.name
|
|
196
|
-
}, null, 8,
|
|
210
|
+
}, null, 8, te)) : t.type == "image/jpg" || t.type == "image/jpeg" ? (l(), s("img", {
|
|
197
211
|
key: 2,
|
|
198
|
-
src:
|
|
212
|
+
src: p(t.url),
|
|
199
213
|
onClick: L,
|
|
200
214
|
title: t.name
|
|
201
|
-
}, null, 8,
|
|
215
|
+
}, null, 8, ie)) : u("", !0)
|
|
202
216
|
]),
|
|
203
217
|
r.isView ? u("", !0) : (l(), s("span", {
|
|
204
218
|
key: 0,
|
|
205
219
|
class: "k-file-icon-close",
|
|
206
|
-
onClick: (
|
|
220
|
+
onClick: (M) => E(n)
|
|
207
221
|
}, [
|
|
208
|
-
w(y
|
|
222
|
+
w(f(y), {
|
|
209
223
|
name: "close",
|
|
210
224
|
size: "12"
|
|
211
225
|
})
|
|
212
|
-
], 8,
|
|
226
|
+
], 8, le))
|
|
213
227
|
]))), 128))
|
|
214
228
|
], 2)) : u("", !0)
|
|
215
229
|
], 64)) : u("", !0),
|
|
216
|
-
r.type == "file" ? (l(), s(
|
|
230
|
+
r.type == "file" ? (l(), s(k, { key: 1 }, [
|
|
217
231
|
i.fileList.length > 0 ? (l(), s("ul", {
|
|
218
232
|
key: 0,
|
|
219
|
-
class:
|
|
233
|
+
class: $(["k-file-list", { "can-edit": !r.isView }])
|
|
220
234
|
}, [
|
|
221
|
-
(l(!0), s(
|
|
222
|
-
|
|
223
|
-
c("span", null,
|
|
235
|
+
(l(!0), s(k, null, v(i.fileList, (t, n) => (l(), s("li", { key: n }, [
|
|
236
|
+
m(e.$slots, "file", { data: t }, () => [
|
|
237
|
+
c("span", null, d(t.name), 1),
|
|
224
238
|
r.isView ? u("", !0) : (l(), s("span", {
|
|
225
239
|
key: 0,
|
|
226
240
|
class: "k-file-icon-close",
|
|
227
|
-
onClick: (
|
|
241
|
+
onClick: (M) => E(n)
|
|
228
242
|
}, [
|
|
229
|
-
w(y
|
|
243
|
+
w(f(y), {
|
|
230
244
|
name: "close",
|
|
231
245
|
size: "12"
|
|
232
246
|
})
|
|
233
|
-
], 8,
|
|
247
|
+
], 8, se))
|
|
234
248
|
])
|
|
235
249
|
]))), 128))
|
|
236
250
|
], 2)) : u("", !0)
|
|
237
251
|
], 64)) : u("", !0)
|
|
238
252
|
]),
|
|
239
|
-
|
|
240
|
-
c("div",
|
|
253
|
+
m(e.$slots, "tip", {}, () => [
|
|
254
|
+
c("div", oe, "\u652F\u6301\u7684" + d(r.type == "file" ? "\u6587\u4EF6" : "\u56FE\u7247") + "\u683C\u5F0F\u6709\uFF1A" + d(r.accept.join(",")) + ",\u6700\u591A\u4E0A\u4F20" + d(r.limit) + "\u4E2A\u6587\u4EF6," + d(r.type == "file" ? "\u5355\u4E2A\u6587\u4EF6" : "\u5355\u5F20\u56FE\u7247") + "\u4E0D\u80FD\u5927\u4E8E" + d(r.maxSize) + "MB", 1)
|
|
241
255
|
]),
|
|
242
|
-
|
|
256
|
+
m(e.$slots, "sizeError", {
|
|
243
257
|
data: i.errFiles
|
|
244
258
|
}, () => [
|
|
245
|
-
i.errFiles.length > 0 ? (l(), s("div",
|
|
246
|
-
c("span", null, " \u8D85\u51FA\u5927\u5C0F\u9650\u5236\u7684" +
|
|
247
|
-
(l(!0), s(
|
|
248
|
-
|
|
249
|
-
|
|
259
|
+
i.errFiles.length > 0 ? (l(), s("div", re, [
|
|
260
|
+
c("span", null, " \u8D85\u51FA\u5927\u5C0F\u9650\u5236\u7684" + d(r.type == "file" ? "\u6587\u4EF6" : "\u56FE\u7247") + "\u6709\uFF1A", 1),
|
|
261
|
+
(l(!0), s(k, null, v(i.errFiles, (t, n) => (l(), s("span", { key: n }, [
|
|
262
|
+
n > 0 ? (l(), s("span", ne, ", ")) : u("", !0),
|
|
263
|
+
O(" " + d(t.name), 1)
|
|
250
264
|
]))), 128))
|
|
251
265
|
])) : u("", !0)
|
|
252
|
-
])
|
|
266
|
+
]),
|
|
267
|
+
(l(), z(U, { to: "body" }, [
|
|
268
|
+
F.value ? (l(), s("div", ue, [...o[2] || (o[2] = [
|
|
269
|
+
c("div", { class: "text" }, "\u6587\u4EF6\u4E0A\u4F20\u4E2D,\u8BF7\u8010\u5FC3\u7B49\u5F85...", -1)
|
|
270
|
+
])])) : u("", !0)
|
|
271
|
+
]))
|
|
253
272
|
]));
|
|
254
273
|
}
|
|
255
274
|
});
|
|
256
275
|
export {
|
|
257
|
-
|
|
276
|
+
ke as default
|
|
258
277
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("../../icon/index.js");require("./style/index.css");const h=require("./uploadFile2.js"),v=require("../../directives/drag.js"),L=require("../../directives/zoomIn.js");require("./uploadFile.vue?vue&type=style&index=0&lang.css");const w={class:"k-upload-file-wrapper"},z={key:0},A={class:"upload-btn-section"},b={class:"btn-box"},x={class:"img-sec-box"},D=["src"],$={class:"img-wrapper"},j=["src","title"],I=["src","title"],q=["src","title"],M=["onClick"],T=["onClick"],O={class:"k-file-extensions-desc"},R={key:0,class:"error-tip"},U={key:0},P={key:0,class:"upload-file-progress"},Z=e.defineComponent({name:"k-upload-file"}),G=e.defineComponent({...Z,props:{data:{type:Array,default:()=>[]},isView:{type:Boolean,default:!0},accept:{type:Array,default:[".png",".jpg",".jpeg",".webp",".xls",".pdf",".xlsx",".docx"]},requestApi:{type:Function},limit:{type:Number,default:1},type:{type:String,default:"image"},params:{type:Object,default:{}},hasToken:{type:Boolean,default:!1},maxSize:{type:Number,default:10},successCode:{type:Number,default:200},loadingFileMaxSize:{type:Number,default:20}},emits:["limitError","success","deleteSuccess","fileSizeError"],setup(n,{expose:E,emit:B}){const f=e.ref();let a;const m=e.ref(!1),c=n;let F=c.maxSize*1024*1024;const V=c.loadingFileMaxSize*1024*1024,d=B,o=e.reactive({fileList:new Array,errFiles:new Array});o.fileList=c.data,e.watch(()=>c.data,t=>{o.fileList=t},{deep:!0});const C=t=>{for(let i=0;i<t.length;i++)t[i].size>V&&(m.value=!0)},g=()=>{a&&a.hide(),h.uploadImg({acceptType:c.accept,limit:c.limit,maxSize:F,success:async t=>{C(t),o.errFiles=new Array;let i=new Array;if(c.requestApi){let l=await c.requestApi(c.params,t);if(l.code==c.successCode){m.value&&(m.value=!1);for(let r=0;r<l.data.length;r++)i.push(l.data[r]);i.forEach(r=>{r.name=r.fileOriginName,r.type="image/"+r.fileSuffix}),y(i)}else console.log(l.msg)}else{for(let l=0;l<t.length;l++)t[l].url=window.URL.createObjectURL(t[l]),i.push(t[l]);y(i)}},limitError:t=>{d("limitError"),o.errFiles=new Array},fileSizeError:t=>{o.errFiles=t,d("fileSizeError",t)}})},y=t=>{c.limit==1?(o.fileList=t,c.type=="image"&&e.nextTick(()=>{a?a.updateSrc(u(o.fileList[0].url)):a=new L.ZoomIn(f.value,{type:"margin"})})):o.fileList=[...o.fileList,...t],d("success",o.fileList)};function N(t){const i=document.cookie.split("; ");for(let l=0;l<i.length;l++){const r=i[l].split("=");if(r[0]===t)return r[1]}return""}const u=t=>c.hasToken?`${t}?token=${N("bearer")}`:t,k=t=>{let i=o.fileList[t];o.fileList.splice(t,1),d("deleteSuccess",{deleteFile:i,result:o.fileList})},p=t=>{new v.Dragger(t.target,{type:"margin",list:o.fileList}).build()};return E({clearFiles:()=>{o.fileList=new Array},deleteFile:k}),(t,i)=>(e.openBlock(),e.createElementBlock("div",w,[n.isView?e.createCommentVNode("",!0):e.renderSlot(t.$slots,"default",{key:0},()=>[n.type=="file"?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("span",{onClick:g},[e.renderSlot(t.$slots,"icon",{},()=>[e.createElementVNode("div",A,[e.createElementVNode("div",b,[e.createVNode(e.unref(s.Icon),{name:"download",color:"#cccccc",size:"20"}),i[1]||(i[1]=e.createElementVNode("span",null,"\u4E0A\u4F20\u9644\u4EF6",-1))])])])])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"btn-file-image",onClick:e.withModifiers(g,["stop"])},[e.createElementVNode("div",x,[o.fileList.length>0&&n.limit==1?(e.openBlock(),e.createElementBlock("img",{key:0,src:u(o.fileList[0].url),ref_key:"imgRef",ref:f},null,8,D)):e.createCommentVNode("",!0)]),!n.isView&&o.fileList.length>0&&n.limit==1?(e.openBlock(),e.createElementBlock("span",{key:0,class:"k-file-icon-close",onClick:i[0]||(i[0]=e.withModifiers(l=>k(0),["stop"]))},[e.createVNode(e.unref(s.Icon),{name:"close",size:"12"})])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"icon",{},()=>[o.fileList.length==0&&n.limit==1?(e.openBlock(),e.createBlock(e.unref(s.Icon),{key:0,name:"plus",color:"#409eff"})):e.createCommentVNode("",!0),n.limit>1?(e.openBlock(),e.createBlock(e.unref(s.Icon),{key:1,name:"plus",color:"#409eff"})):e.createCommentVNode("",!0)])]))]),e.renderSlot(t.$slots,"files",{data:o.fileList},()=>[n.type=="image"&&n.limit>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.fileList.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass(["k-image-list",{"can-edit":!n.isView}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.fileList,(l,r)=>(e.openBlock(),e.createElementBlock("li",{key:r},[e.createElementVNode("div",$,[l.type=="image/webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:u(l.url),onClick:p,title:l.name},null,8,j)):l.type=="image/png"?(e.openBlock(),e.createElementBlock("img",{key:1,src:u(l.url),onClick:p,title:l.name},null,8,I)):l.type=="image/jpg"||l.type=="image/jpeg"?(e.openBlock(),e.createElementBlock("img",{key:2,src:u(l.url),onClick:p,title:l.name},null,8,q)):e.createCommentVNode("",!0)]),n.isView?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"k-file-icon-close",onClick:S=>k(r)},[e.createVNode(e.unref(s.Icon),{name:"close",size:"12"})],8,M))]))),128))],2)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),n.type=="file"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.fileList.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass(["k-file-list",{"can-edit":!n.isView}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.fileList,(l,r)=>(e.openBlock(),e.createElementBlock("li",{key:r},[e.renderSlot(t.$slots,"file",{data:l},()=>[e.createElementVNode("span",null,e.toDisplayString(l.name),1),n.isView?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"k-file-icon-close",onClick:S=>k(r)},[e.createVNode(e.unref(s.Icon),{name:"close",size:"12"})],8,T))])]))),128))],2)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"tip",{},()=>[e.createElementVNode("div",O,"\u652F\u6301\u7684"+e.toDisplayString(n.type=="file"?"\u6587\u4EF6":"\u56FE\u7247")+"\u683C\u5F0F\u6709\uFF1A"+e.toDisplayString(n.accept.join(","))+",\u6700\u591A\u4E0A\u4F20"+e.toDisplayString(n.limit)+"\u4E2A\u6587\u4EF6,"+e.toDisplayString(n.type=="file"?"\u5355\u4E2A\u6587\u4EF6":"\u5355\u5F20\u56FE\u7247")+"\u4E0D\u80FD\u5927\u4E8E"+e.toDisplayString(n.maxSize)+"MB",1)]),e.renderSlot(t.$slots,"sizeError",{data:o.errFiles},()=>[o.errFiles.length>0?(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("span",null," \u8D85\u51FA\u5927\u5C0F\u9650\u5236\u7684"+e.toDisplayString(n.type=="file"?"\u6587\u4EF6":"\u56FE\u7247")+"\u6709\uFF1A",1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.errFiles,(l,r)=>(e.openBlock(),e.createElementBlock("span",{key:r},[r>0?(e.openBlock(),e.createElementBlock("span",U,", ")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.name),1)]))),128))])):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",P,[...i[2]||(i[2]=[e.createElementVNode("div",{class:"text"},"\u6587\u4EF6\u4E0A\u4F20\u4E2D,\u8BF7\u8010\u5FC3\u7B49\u5F85...",-1)])])):e.createCommentVNode("",!0)]))]))}});exports.default=G;
|