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