geekplus-digital-ui 0.1.17 → 0.1.18
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 +1 @@
|
|
|
1
|
-
.d-upload[data-v-
|
|
1
|
+
.d-upload[data-v-4214bfeb]{line-height:normal}.d-upload.is-list[data-v-4214bfeb],.d-upload.is-list .list[data-v-4214bfeb]{display:flex;flex-direction:column;gap:8px}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb]{position:relative;display:flex;align-items:center;gap:10px}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb] .el-link{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb] .el-link .el-link__inner{display:inline}.d-upload.is-list .list .list-item .file-row .remove-icon[data-v-4214bfeb]{cursor:pointer;display:none;color:var(--el-text-color-secondary)}.d-upload.is-list .list .list-item .file-row:hover .remove-icon[data-v-4214bfeb]{display:block}.d-upload.is-card[data-v-4214bfeb],.d-upload.is-card .card[data-v-4214bfeb]{display:flex;flex-wrap:wrap;gap:8px}.d-upload.is-card .card .card-item[data-v-4214bfeb]{display:flex;justify-content:center;align-items:center;font-size:16px;border:1px solid var(--el-border-color);border-radius:4px;overflow:hidden;position:relative;cursor:pointer}.d-upload.is-card .card .card-item .card-cover[data-v-4214bfeb]{display:flex;justify-content:center;align-items:center;gap:10px;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--el-overlay-color);opacity:0}.d-upload.is-card .card .card-item .card-cover .d-icon[data-v-4214bfeb]{color:var(--el-color-white)}.d-upload.is-card .card .card-item .card-cover[data-v-4214bfeb]:hover{opacity:1}.d-upload.is-card .card .el-image[data-v-4214bfeb]{width:100%;height:100%}.d-upload .expand-toggle[data-v-4214bfeb] .el-link__inner{gap:5px}.d-upload .tip[data-v-4214bfeb]{width:100%;font-size:12px;margin:0;color:var(--el-text-color-regular)}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useModel as ve, ref as y, computed as v,
|
|
1
|
+
import { useModel as ve, ref as y, computed as v, reactive as Ee, watch as Ve, onMounted as Ie, onBeforeUnmount as Ne, openBlock as o, createElementBlock as f, normalizeClass as Be, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as i, createElementVNode as _, createTextVNode as C, toDisplayString as k, normalizeStyle as F, Fragment as q, renderList as ye, withModifiers as he, mergeModels as ge } from "vue";
|
|
2
2
|
import "../../../hooks/index.js";
|
|
3
|
-
import { useFormItem as
|
|
3
|
+
import { useFormItem as $e, ElMessageBox as Pe, ElMessage as O, ElUpload as je, ElImageViewer as Re, ElDialog as He, ElButton as M, ElImage as qe, ElProgress as ke, ElLink as K } from "element-plus";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
import { cloneDeep as
|
|
6
|
-
import { saveAs as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
5
|
+
import { cloneDeep as b, isFunction as we } from "lodash-es";
|
|
6
|
+
import { saveAs as Oe } from "file-saver";
|
|
7
|
+
import Ke from "../../icons/angle-down-light.vue.js";
|
|
8
|
+
import Xe from "../../icons/angle-up-light.vue.js";
|
|
9
|
+
import Ge from "../../icons/circle-play-light.vue.js";
|
|
10
|
+
import Je from "../../icons/circle-xmark-light.vue.js";
|
|
11
|
+
import Qe from "../../icons/download-light.vue.js";
|
|
12
|
+
import We from "../../icons/eye-light.vue.js";
|
|
13
|
+
import Ye from "../../icons/file-light.vue.js";
|
|
14
|
+
import Ze from "../../icons/plus-light.vue.js";
|
|
15
|
+
import et from "../../icons/trash-light.vue.js";
|
|
16
16
|
import './upload2.css';import './upload.css';/* empty css */
|
|
17
17
|
/* empty css */
|
|
18
|
-
import
|
|
19
|
-
import { useLocale as
|
|
20
|
-
import { useActivated as
|
|
18
|
+
import tt from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
19
|
+
import { useLocale as lt } from "../../../hooks/use-locale/index.js";
|
|
20
|
+
import { useActivated as at } from "../../../hooks/use-activated/index.js";
|
|
21
21
|
import { DIcon as h } from "../../icon/index.js";
|
|
22
|
-
const
|
|
22
|
+
const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
23
23
|
key: 0,
|
|
24
24
|
style: { width: "100%" }
|
|
25
|
-
},
|
|
25
|
+
}, rt = ["onClick"], ut = { class: "card-cover" }, dt = ["innerHTML"], ct = { class: "file-row" }, pt = {
|
|
26
26
|
key: 6,
|
|
27
27
|
class: "expand-toggle"
|
|
28
|
-
},
|
|
28
|
+
}, ft = /* @__PURE__ */ Object.assign({
|
|
29
29
|
name: "DUpload"
|
|
30
30
|
}, {
|
|
31
31
|
__name: "upload",
|
|
@@ -108,13 +108,13 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
108
108
|
}),
|
|
109
109
|
emits: /* @__PURE__ */ ge(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
|
|
110
110
|
setup(g, { emit: xe }) {
|
|
111
|
-
const l = g, z = xe, D = ve(g, "modelValue"), X = ve(g, "uploadingCount"), G = ["jpg", "jpeg", "png", "gif"], Se = ["mp4"], s = y([]), E = y(!1), w = y(!1), V = y(0), I = y([]),
|
|
111
|
+
const l = g, z = xe, D = ve(g, "modelValue"), X = ve(g, "uploadingCount"), G = ["jpg", "jpeg", "png", "gif"], Se = ["mp4"], s = y([]), E = y(!1), w = y(!1), V = y(0), I = y([]), L = y(""), x = y(!1), J = y(null), Q = y(null), { t: r } = lt(), _e = at(), { formItem: W } = $e(), N = v(() => x.value ? s.value : s.value.slice(0, l.maxShow)), B = v(() => s.value.length > 0), $ = v(() => !l.disabled && !Y.value), T = v(() => l.showType === "list"), Y = v(() => s.value.length >= l.maxNumber), Ce = v(() => T.value ? "is-list" : "is-card"), Z = v(() => l.format.length ? l.format.map((t) => t.toUpperCase()) : []), ee = v(() => ({
|
|
112
112
|
width: l.size,
|
|
113
113
|
height: l.size
|
|
114
|
-
})),
|
|
114
|
+
})), be = v(() => l.format.map((t) => `.${t}`).join(",")), te = v(() => ({
|
|
115
115
|
maxHeight: l.scrollHeight,
|
|
116
116
|
overflow: "auto"
|
|
117
|
-
})),
|
|
117
|
+
})), Le = v(() => {
|
|
118
118
|
const t = l.format.length && l.format.every((e) => G.includes(e)), a = [];
|
|
119
119
|
return l.maxSize && !t && a.push(r("d.upload.lessThan", { size: l.maxSize })), l.format.length && a.push(r("d.upload.format", { format: l.format.join("/") })), l.pasteable && a.push(r("d.upload.pasteable")), a.join(r("d.upload.comma"));
|
|
120
120
|
}), Te = (t) => {
|
|
@@ -137,17 +137,17 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
137
137
|
}, S = (t) => G.includes(P(t.name)), U = (t) => Se.includes(P(t.name)), A = (t) => t?.uploadStatus === "finished", le = (t) => !l.disabled && A(t), ae = () => {
|
|
138
138
|
J.value?.$el.querySelector("input")?.click();
|
|
139
139
|
}, Ue = (t) => {
|
|
140
|
-
if (V.value = 0, I.value = [],
|
|
140
|
+
if (V.value = 0, I.value = [], L.value = "", S(t)) {
|
|
141
141
|
const a = s.value.filter((e) => S(e));
|
|
142
142
|
V.value = a.findIndex((e) => e.url === t.url), I.value = a.map((e) => e.url), E.value = !0;
|
|
143
143
|
}
|
|
144
|
-
U(t) && (
|
|
144
|
+
U(t) && (L.value = t.url, w.value = !0);
|
|
145
145
|
}, oe = () => {
|
|
146
146
|
Q.value?.pause(), w.value = !1;
|
|
147
147
|
}, ne = (t) => {
|
|
148
148
|
const a = () => {
|
|
149
149
|
const u = s.value.indexOf(t);
|
|
150
|
-
u !== -1 && (s.value.splice(u, 1), D.value =
|
|
150
|
+
u !== -1 && (s.value.splice(u, 1), D.value = b(s.value), z("change", u, b(s.value)), W?.validate("change"));
|
|
151
151
|
}, e = async () => {
|
|
152
152
|
if (!A(t)) {
|
|
153
153
|
a();
|
|
@@ -155,7 +155,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
155
155
|
}
|
|
156
156
|
a();
|
|
157
157
|
};
|
|
158
|
-
|
|
158
|
+
Pe.confirm(r("d.upload.deleteConfirm"), r("d.upload.tip"), {
|
|
159
159
|
type: "warning"
|
|
160
160
|
}).then(async () => {
|
|
161
161
|
await e();
|
|
@@ -184,11 +184,11 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
184
184
|
x.value || j();
|
|
185
185
|
const a = new FormData();
|
|
186
186
|
a.append("file", t), we(l.beforeUpload) && l.beforeUpload(t, a);
|
|
187
|
-
const e = {
|
|
187
|
+
const e = Ee({
|
|
188
188
|
uploadStatus: "processing",
|
|
189
189
|
percentage: 0,
|
|
190
190
|
name: t.name
|
|
191
|
-
};
|
|
191
|
+
});
|
|
192
192
|
s.value.push(e);
|
|
193
193
|
const u = s.value.length - 1;
|
|
194
194
|
X.value++;
|
|
@@ -221,10 +221,10 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
221
221
|
} catch {
|
|
222
222
|
m() !== -1 && s.value.splice(m(), 1);
|
|
223
223
|
} finally {
|
|
224
|
-
X.value--, D.value =
|
|
224
|
+
X.value--, D.value = b(s.value), z("change", u, b(s.value)), W?.validate("change");
|
|
225
225
|
}
|
|
226
226
|
}, ie = (t) => {
|
|
227
|
-
t?.url &&
|
|
227
|
+
t?.url && Oe(t.url, t.name);
|
|
228
228
|
}, j = () => {
|
|
229
229
|
x.value = !x.value;
|
|
230
230
|
}, re = (t) => {
|
|
@@ -238,36 +238,36 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
238
238
|
}, ue = (t) => {
|
|
239
239
|
!B.value || !t?.url || (S(t) || U(t) ? Ue(t) : ie(t));
|
|
240
240
|
}, de = () => {
|
|
241
|
-
we(l.downloadAllMethod) ? l.downloadAllMethod(
|
|
241
|
+
we(l.downloadAllMethod) ? l.downloadAllMethod(b(s.value)) : s.value.forEach((t) => {
|
|
242
242
|
ie(t);
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
|
-
return
|
|
245
|
+
return Ve(
|
|
246
246
|
D,
|
|
247
247
|
(t) => {
|
|
248
248
|
Te(t);
|
|
249
249
|
},
|
|
250
250
|
{ immediate: !0 }
|
|
251
|
-
),
|
|
251
|
+
), Ie(() => {
|
|
252
252
|
document.addEventListener("paste", re);
|
|
253
|
-
}),
|
|
253
|
+
}), Ne(() => {
|
|
254
254
|
document.removeEventListener("paste", re);
|
|
255
255
|
}), (t, a) => (o(), f("div", {
|
|
256
|
-
class:
|
|
256
|
+
class: Be(["d-upload", Ce.value])
|
|
257
257
|
}, [
|
|
258
|
-
d(n(
|
|
258
|
+
d(n(je), {
|
|
259
259
|
ref_key: "uploadRef",
|
|
260
260
|
ref: J,
|
|
261
261
|
style: { display: "none" },
|
|
262
262
|
"show-file-list": !1,
|
|
263
263
|
"file-list": s.value,
|
|
264
|
-
accept:
|
|
264
|
+
accept: be.value,
|
|
265
265
|
"before-upload": se,
|
|
266
266
|
"with-credentials": "",
|
|
267
267
|
multiple: "",
|
|
268
268
|
action: "/"
|
|
269
269
|
}, null, 8, ["file-list", "accept"]),
|
|
270
|
-
E.value ? (o(), c(n(
|
|
270
|
+
E.value ? (o(), c(n(Re), {
|
|
271
271
|
key: 0,
|
|
272
272
|
"url-list": I.value,
|
|
273
273
|
"initial-index": V.value,
|
|
@@ -275,7 +275,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
275
275
|
teleported: "",
|
|
276
276
|
onClose: a[0] || (a[0] = (e) => E.value = !1)
|
|
277
277
|
}, null, 8, ["url-list", "initial-index"])) : p("", !0),
|
|
278
|
-
w.value ? (o(), c(n(
|
|
278
|
+
w.value ? (o(), c(n(He), {
|
|
279
279
|
key: 1,
|
|
280
280
|
modelValue: w.value,
|
|
281
281
|
"onUpdate:modelValue": a[1] || (a[1] = (e) => w.value = e),
|
|
@@ -294,20 +294,20 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
294
294
|
})
|
|
295
295
|
]),
|
|
296
296
|
default: i(() => [
|
|
297
|
-
_("div",
|
|
298
|
-
|
|
297
|
+
_("div", ot, [
|
|
298
|
+
L.value ? (o(), f("video", {
|
|
299
299
|
key: 0,
|
|
300
300
|
ref_key: "videoRef",
|
|
301
301
|
ref: Q,
|
|
302
|
-
src:
|
|
302
|
+
src: L.value,
|
|
303
303
|
controls: "",
|
|
304
304
|
class: "preview-video"
|
|
305
|
-
}, null, 8,
|
|
305
|
+
}, null, 8, nt)) : p("", !0)
|
|
306
306
|
])
|
|
307
307
|
]),
|
|
308
308
|
_: 1
|
|
309
309
|
}, 8, ["modelValue", "title"])) : p("", !0),
|
|
310
|
-
T.value ? (o(), f("div",
|
|
310
|
+
T.value ? (o(), f("div", st, [
|
|
311
311
|
$.value ? (o(), c(n(M), {
|
|
312
312
|
key: 0,
|
|
313
313
|
onClick: ae
|
|
@@ -334,7 +334,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
334
334
|
class: "card",
|
|
335
335
|
style: F(te.value)
|
|
336
336
|
}, [
|
|
337
|
-
g.showDownloadAll && B.value ? (o(), f("div",
|
|
337
|
+
g.showDownloadAll && B.value ? (o(), f("div", it, [
|
|
338
338
|
d(n(M), {
|
|
339
339
|
type: "primary",
|
|
340
340
|
link: "",
|
|
@@ -353,30 +353,30 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
353
353
|
onClick: (m) => ue(e)
|
|
354
354
|
}, [
|
|
355
355
|
A(e) ? (o(), f(q, { key: 0 }, [
|
|
356
|
-
S(e) ? (o(), c(n(
|
|
356
|
+
S(e) ? (o(), c(n(qe), {
|
|
357
357
|
key: 0,
|
|
358
358
|
src: e.url,
|
|
359
359
|
fit: "cover"
|
|
360
360
|
}, null, 8, ["src"])) : U(e) ? (o(), c(n(h), { key: 1 }, {
|
|
361
361
|
default: i(() => [
|
|
362
|
-
d(
|
|
362
|
+
d(Ge)
|
|
363
363
|
]),
|
|
364
364
|
_: 1
|
|
365
365
|
})) : (o(), c(n(h), { key: 2 }, {
|
|
366
366
|
default: i(() => [
|
|
367
|
-
d(
|
|
367
|
+
d(Ye)
|
|
368
368
|
]),
|
|
369
369
|
_: 1
|
|
370
370
|
})),
|
|
371
|
-
_("div",
|
|
371
|
+
_("div", ut, [
|
|
372
372
|
S(e) || U(e) ? (o(), c(n(h), { key: 0 }, {
|
|
373
373
|
default: i(() => [
|
|
374
|
-
d(
|
|
374
|
+
d(We)
|
|
375
375
|
]),
|
|
376
376
|
_: 1
|
|
377
377
|
})) : (o(), c(n(h), { key: 1 }, {
|
|
378
378
|
default: i(() => [
|
|
379
|
-
d(
|
|
379
|
+
d(Qe)
|
|
380
380
|
]),
|
|
381
381
|
_: 1
|
|
382
382
|
})),
|
|
@@ -385,7 +385,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
385
385
|
onClick: he((m) => ne(e), ["stop"])
|
|
386
386
|
}, {
|
|
387
387
|
default: i(() => [
|
|
388
|
-
d(
|
|
388
|
+
d(et)
|
|
389
389
|
]),
|
|
390
390
|
_: 1
|
|
391
391
|
}, 8, ["onClick"])) : p("", !0)
|
|
@@ -397,7 +397,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
397
397
|
"stroke-width": 5,
|
|
398
398
|
"show-text": !1
|
|
399
399
|
}, null, 8, ["percentage"]))
|
|
400
|
-
], 12,
|
|
400
|
+
], 12, rt))), 128)),
|
|
401
401
|
$.value ? (o(), f("div", {
|
|
402
402
|
key: 1,
|
|
403
403
|
class: "card-item",
|
|
@@ -406,7 +406,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
406
406
|
}, [
|
|
407
407
|
d(n(h), null, {
|
|
408
408
|
default: i(() => [
|
|
409
|
-
d(
|
|
409
|
+
d(Ze)
|
|
410
410
|
]),
|
|
411
411
|
_: 1
|
|
412
412
|
})
|
|
@@ -415,8 +415,8 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
415
415
|
$.value && g.showTip ? (o(), f("p", {
|
|
416
416
|
key: 4,
|
|
417
417
|
class: "tip",
|
|
418
|
-
innerHTML:
|
|
419
|
-
}, null, 8,
|
|
418
|
+
innerHTML: Le.value
|
|
419
|
+
}, null, 8, dt)) : p("", !0),
|
|
420
420
|
T.value && N.value.length ? (o(), f("div", {
|
|
421
421
|
key: 5,
|
|
422
422
|
style: F(te.value),
|
|
@@ -426,7 +426,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
426
426
|
key: e.id || `${e.name}-${u}`,
|
|
427
427
|
class: "list-item"
|
|
428
428
|
}, [
|
|
429
|
-
_("div",
|
|
429
|
+
_("div", ct, [
|
|
430
430
|
d(n(K), {
|
|
431
431
|
type: "primary",
|
|
432
432
|
underline: "never",
|
|
@@ -443,7 +443,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
443
443
|
onClick: he((m) => ne(e), ["stop"])
|
|
444
444
|
}, {
|
|
445
445
|
default: i(() => [
|
|
446
|
-
d(
|
|
446
|
+
d(Je)
|
|
447
447
|
]),
|
|
448
448
|
_: 1
|
|
449
449
|
}, 8, ["onClick"])) : p("", !0)
|
|
@@ -455,7 +455,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
455
455
|
}, null, 8, ["percentage"]))
|
|
456
456
|
]))), 128))
|
|
457
457
|
], 4)) : p("", !0),
|
|
458
|
-
s.value.length > g.maxShow ? (o(), f("div",
|
|
458
|
+
s.value.length > g.maxShow ? (o(), f("div", pt, [
|
|
459
459
|
x.value ? (o(), c(n(K), {
|
|
460
460
|
key: 0,
|
|
461
461
|
type: "primary",
|
|
@@ -466,7 +466,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
466
466
|
_("span", null, k(n(r)("d.upload.collapse")), 1),
|
|
467
467
|
d(n(h), null, {
|
|
468
468
|
default: i(() => [
|
|
469
|
-
d(
|
|
469
|
+
d(Xe)
|
|
470
470
|
]),
|
|
471
471
|
_: 1
|
|
472
472
|
})
|
|
@@ -482,7 +482,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
482
482
|
_("span", null, k(n(r)("d.upload.expand")), 1),
|
|
483
483
|
d(n(h), null, {
|
|
484
484
|
default: i(() => [
|
|
485
|
-
d(
|
|
485
|
+
d(Ke)
|
|
486
486
|
]),
|
|
487
487
|
_: 1
|
|
488
488
|
})
|
|
@@ -492,7 +492,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
492
492
|
])) : p("", !0)
|
|
493
493
|
], 2));
|
|
494
494
|
}
|
|
495
|
-
}),
|
|
495
|
+
}), Vt = /* @__PURE__ */ tt(ft, [["__scopeId", "data-v-4214bfeb"]]);
|
|
496
496
|
export {
|
|
497
|
-
|
|
497
|
+
Vt as default
|
|
498
498
|
};
|