sand-components-vben 2.7.171 → 2.7.172
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/sand-components-vben.js
CHANGED
|
@@ -49328,87 +49328,89 @@ const rit = /* @__PURE__ */ d4(nit), iit = { class: "group-box" }, oit = {
|
|
|
49328
49328
|
}
|
|
49329
49329
|
},
|
|
49330
49330
|
emits: ["update:value", "update:previewPath"],
|
|
49331
|
-
setup(e, {
|
|
49332
|
-
const
|
|
49331
|
+
setup(e, { expose: t, emit: n }) {
|
|
49332
|
+
const r = $n("handleGetExtraData"), i = n, o = e, a = Ct({
|
|
49333
49333
|
imageList: []
|
|
49334
49334
|
// 删除 flag
|
|
49335
49335
|
});
|
|
49336
|
-
let { imageList:
|
|
49337
|
-
const
|
|
49338
|
-
var
|
|
49339
|
-
return ((
|
|
49340
|
-
}),
|
|
49341
|
-
|
|
49342
|
-
const
|
|
49343
|
-
|
|
49344
|
-
},
|
|
49345
|
-
let
|
|
49346
|
-
name:
|
|
49347
|
-
url:
|
|
49336
|
+
let { imageList: s } = ln(a);
|
|
49337
|
+
const l = ge(), u = z(() => {
|
|
49338
|
+
var p;
|
|
49339
|
+
return ((p = l.value) == null ? void 0 : p.isUploading) ?? !1;
|
|
49340
|
+
}), c = (p) => {
|
|
49341
|
+
s.value.splice(p, 1);
|
|
49342
|
+
const f = s.value.length === 0 ? void 0 : JSON.stringify(s.value);
|
|
49343
|
+
i("update:value", f);
|
|
49344
|
+
}, d = (p) => {
|
|
49345
|
+
let f = p.map((m) => ({
|
|
49346
|
+
name: m.originalName,
|
|
49347
|
+
url: m.downloadPath
|
|
49348
49348
|
}));
|
|
49349
|
-
const
|
|
49350
|
-
|
|
49349
|
+
const g = [...s.value, ...f];
|
|
49350
|
+
s.value = g, i("update:value", JSON.stringify(g)), r && r(p);
|
|
49351
49351
|
};
|
|
49352
49352
|
return Be(
|
|
49353
|
-
() =>
|
|
49353
|
+
() => o.value,
|
|
49354
49354
|
// 直接监听 props.value
|
|
49355
|
-
(
|
|
49356
|
-
if (!
|
|
49357
|
-
|
|
49355
|
+
(p) => {
|
|
49356
|
+
if (!p) {
|
|
49357
|
+
s.value = [];
|
|
49358
49358
|
return;
|
|
49359
49359
|
}
|
|
49360
|
-
console.log(
|
|
49361
|
-
let
|
|
49362
|
-
if (typeof
|
|
49360
|
+
console.log(o.value);
|
|
49361
|
+
let f = [];
|
|
49362
|
+
if (typeof p == "string")
|
|
49363
49363
|
try {
|
|
49364
|
-
|
|
49365
|
-
} catch (
|
|
49366
|
-
console.warn("UploadImageV3 JSON parse error",
|
|
49364
|
+
f = JSON.parse(p);
|
|
49365
|
+
} catch (m) {
|
|
49366
|
+
console.warn("UploadImageV3 JSON parse error", m);
|
|
49367
49367
|
return;
|
|
49368
49368
|
}
|
|
49369
|
-
else Array.isArray(
|
|
49370
|
-
const
|
|
49371
|
-
name:
|
|
49372
|
-
url:
|
|
49369
|
+
else Array.isArray(p) && (f = p);
|
|
49370
|
+
const g = f.map((m) => ({
|
|
49371
|
+
name: m.name || m.originalName,
|
|
49372
|
+
url: m.url || m.previewPath || m.downloadPath
|
|
49373
49373
|
}));
|
|
49374
|
-
JSON.stringify(
|
|
49374
|
+
JSON.stringify(g) !== JSON.stringify(s.value) && (s.value = g);
|
|
49375
49375
|
},
|
|
49376
49376
|
{
|
|
49377
49377
|
immediate: !0
|
|
49378
49378
|
}
|
|
49379
|
-
), (
|
|
49380
|
-
|
|
49379
|
+
), t({
|
|
49380
|
+
uploading: u
|
|
49381
|
+
}), (p, f) => {
|
|
49382
|
+
const g = ve("a-image");
|
|
49381
49383
|
return q(), ne("div", Lit, [
|
|
49382
|
-
(q(!0), ne(Ve, null, rn(j(
|
|
49384
|
+
(q(!0), ne(Ve, null, rn(j(s), (m, h) => (q(), ne("div", {
|
|
49383
49385
|
class: "image-item",
|
|
49384
|
-
key:
|
|
49386
|
+
key: h,
|
|
49385
49387
|
style: vt(`height:${parseInt(e.imageWidth + "")}px;width:${parseInt(
|
|
49386
49388
|
e.imageWidth + ""
|
|
49387
49389
|
)}px`)
|
|
49388
49390
|
}, [
|
|
49389
|
-
M(
|
|
49391
|
+
M(g, {
|
|
49390
49392
|
width: e.imageWidth,
|
|
49391
49393
|
height: e.imageWidth,
|
|
49392
|
-
src:
|
|
49394
|
+
src: m.url
|
|
49393
49395
|
}, null, 8, ["width", "height", "src"]),
|
|
49394
49396
|
e.disabled ? De("", !0) : (q(), ne("div", {
|
|
49395
49397
|
key: 0,
|
|
49396
49398
|
class: "delete-image",
|
|
49397
|
-
onClick: (
|
|
49399
|
+
onClick: (v) => c(h)
|
|
49398
49400
|
}, [
|
|
49399
49401
|
M(j(eo))
|
|
49400
49402
|
], 8, Uit))
|
|
49401
49403
|
], 4))), 128)),
|
|
49402
|
-
j(
|
|
49404
|
+
j(s).length < e.limit && !e.disabled ? (q(), Ge(bg, {
|
|
49403
49405
|
key: 0,
|
|
49404
49406
|
type: "image",
|
|
49405
49407
|
size: e.size,
|
|
49406
49408
|
fileType: e.fileType,
|
|
49407
49409
|
url: e.url,
|
|
49408
|
-
onChange:
|
|
49410
|
+
onChange: d,
|
|
49409
49411
|
disabled: e.disabled,
|
|
49410
49412
|
ref_key: "baseUploadRef",
|
|
49411
|
-
ref:
|
|
49413
|
+
ref: l
|
|
49412
49414
|
}, {
|
|
49413
49415
|
default: se(() => [
|
|
49414
49416
|
K("div", {
|
|
@@ -49422,7 +49424,7 @@ const rit = /* @__PURE__ */ d4(nit), iit = { class: "group-box" }, oit = {
|
|
|
49422
49424
|
Re(" " + Ae(e.buttonTitle), 1)
|
|
49423
49425
|
]),
|
|
49424
49426
|
K("div", Git, Ae(e.placeholder), 1),
|
|
49425
|
-
|
|
49427
|
+
u.value ? (q(), ne("div", Yit, [
|
|
49426
49428
|
M(j(wa), { spin: "" })
|
|
49427
49429
|
])) : De("", !0)
|
|
49428
49430
|
], 4)
|
|
@@ -49432,7 +49434,7 @@ const rit = /* @__PURE__ */ d4(nit), iit = { class: "group-box" }, oit = {
|
|
|
49432
49434
|
]);
|
|
49433
49435
|
};
|
|
49434
49436
|
}
|
|
49435
|
-
}), Vit = /* @__PURE__ */ Tt(Kit, [["__scopeId", "data-v-
|
|
49437
|
+
}), Vit = /* @__PURE__ */ Tt(Kit, [["__scopeId", "data-v-8964d036"]]), qit = { class: "file-content" }, Hit = { class: "file-name-text" }, Jit = { class: "h-full" }, jit = {
|
|
49436
49438
|
key: 0,
|
|
49437
49439
|
class: "uploaded-files-section"
|
|
49438
49440
|
}, zit = { class: "file-name" }, Wit = /* @__PURE__ */ ye({
|