@jt-home/mfe-components 1.0.41 → 1.0.43
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/JtAttachmentPreview/index.cjs +1 -1
- package/dist/JtAttachmentPreview/index.mjs +1 -1
- package/dist/{index-moF0d2Ee.js → index-DrZ9DS6y.js} +364 -309
- package/dist/{index-c8YlthVt.cjs → index-sksijs-r.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1203 -1228
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ElIcon as
|
|
3
|
-
const
|
|
1
|
+
import { ref as P, isRef as re, watch as Z, defineComponent as E, openBlock as Y, createElementBlock as I, createElementVNode as O, onBeforeUnmount as V, h as a, computed as L, onMounted as $, nextTick as fe, render as k } from "vue";
|
|
2
|
+
import { ElIcon as J } from "element-plus";
|
|
3
|
+
const he = {
|
|
4
4
|
common: {
|
|
5
5
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
|
|
6
6
|
PDF加载中___: "PDF 加载中...",
|
|
@@ -55,7 +55,7 @@ const ve = {
|
|
|
55
55
|
附件预览: "附件预览",
|
|
56
56
|
附件预览未初始化: "附件预览未初始化"
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, pe = {
|
|
59
59
|
common: {
|
|
60
60
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js cannot read the file. It has been switched to browser built-in preview",
|
|
61
61
|
PDF加载中___: "PDF loading...",
|
|
@@ -110,7 +110,7 @@ const ve = {
|
|
|
110
110
|
附件预览: "Attachment Preview",
|
|
111
111
|
附件预览未初始化: "Attachment preview not initialized"
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, ge = {
|
|
114
114
|
common: {
|
|
115
115
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในตัวเบราว์เซอร์",
|
|
116
116
|
PDF加载中___: "กําลังโหลดไฟล์ PDF ...",
|
|
@@ -165,7 +165,7 @@ const ve = {
|
|
|
165
165
|
附件预览: "เอกสารแนบตัวอย่าง",
|
|
166
166
|
附件预览未初始化: "การแสดงตัวอย่างของสิ่งที่แนบมาไม่ได้เริ่มต้น"
|
|
167
167
|
}
|
|
168
|
-
},
|
|
168
|
+
}, we = {
|
|
169
169
|
common: {
|
|
170
170
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không thể đọc tập tin, đã chuyển sang trình duyệt built-in xem trước",
|
|
171
171
|
PDF加载中___: "Đang tải PDF...",
|
|
@@ -220,7 +220,7 @@ const ve = {
|
|
|
220
220
|
附件预览: "Xem trước tệp đính kèm",
|
|
221
221
|
附件预览未初始化: "Bản xem trước đính kèm không được khởi tạo"
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, ye = {
|
|
224
224
|
common: {
|
|
225
225
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer este archivo, cambió a la vista previa integrada del navegador",
|
|
226
226
|
PDF加载中___: "Carga de PDF...",
|
|
@@ -275,7 +275,7 @@ const ve = {
|
|
|
275
275
|
附件预览: "Anexo Preview",
|
|
276
276
|
附件预览未初始化: "Anexo Preview no inicializado"
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, be = {
|
|
279
279
|
common: {
|
|
280
280
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js tidak dapat membaca file ini, telah beralih ke pratinjau built-in browser",
|
|
281
281
|
PDF加载中___: "PDF sedang memuat...",
|
|
@@ -385,7 +385,7 @@ const ve = {
|
|
|
385
385
|
附件预览: "Anhang Vorschau",
|
|
386
386
|
附件预览未初始化: "Anlage Vorschau nicht initialisiert"
|
|
387
387
|
}
|
|
388
|
-
},
|
|
388
|
+
}, ke = {
|
|
389
389
|
common: {
|
|
390
390
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não pode ler o arquivo, mudou para a visualização integrada do navegador",
|
|
391
391
|
PDF加载中___: "PDF Carregando...",
|
|
@@ -440,17 +440,17 @@ const ve = {
|
|
|
440
440
|
附件预览: "Anexo Preview",
|
|
441
441
|
附件预览未初始化: "Anexo Preview não inicializado"
|
|
442
442
|
}
|
|
443
|
-
},
|
|
444
|
-
"zh-cn":
|
|
445
|
-
en:
|
|
446
|
-
th:
|
|
447
|
-
vi:
|
|
448
|
-
es:
|
|
449
|
-
id:
|
|
443
|
+
}, Ae = {}, Pe = {
|
|
444
|
+
"zh-cn": he,
|
|
445
|
+
en: pe,
|
|
446
|
+
th: ge,
|
|
447
|
+
vi: we,
|
|
448
|
+
es: ye,
|
|
449
|
+
id: be,
|
|
450
450
|
de: _e,
|
|
451
|
-
pt:
|
|
452
|
-
km:
|
|
453
|
-
},
|
|
451
|
+
pt: ke,
|
|
452
|
+
km: Ae
|
|
453
|
+
}, De = {
|
|
454
454
|
zh: "zh-cn",
|
|
455
455
|
"zh-hans": "zh-cn",
|
|
456
456
|
"zh-cn": "zh-cn",
|
|
@@ -475,116 +475,116 @@ const ve = {
|
|
|
475
475
|
km_kh: "km",
|
|
476
476
|
"km-kh": "km"
|
|
477
477
|
};
|
|
478
|
-
function
|
|
478
|
+
function N(e) {
|
|
479
479
|
const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
|
|
480
|
-
return
|
|
480
|
+
return De[t] || t || "zh-cn";
|
|
481
481
|
}
|
|
482
|
-
const
|
|
482
|
+
const B = P("zh-cn");
|
|
483
483
|
let K;
|
|
484
|
-
function
|
|
484
|
+
function ee() {
|
|
485
485
|
K?.(), K = void 0;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return e ? typeof e == "function" ?
|
|
487
|
+
function ie(e) {
|
|
488
|
+
return e ? typeof e == "function" ? N(e()) : re(e) ? N(e.value) : N(e) : B.value;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function je(e, t) {
|
|
491
491
|
if (e)
|
|
492
|
-
return t.split(".").reduce((n,
|
|
492
|
+
return t.split(".").reduce((n, o) => {
|
|
493
493
|
if (!(!n || typeof n != "object"))
|
|
494
|
-
return n[
|
|
494
|
+
return n[o];
|
|
495
495
|
}, e);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
const n = Pe
|
|
497
|
+
function oe(e, t) {
|
|
498
|
+
const n = je(Pe[e], t);
|
|
499
499
|
return typeof n == "string" ? n : void 0;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
501
|
+
function at(e) {
|
|
502
|
+
ee(), B.value = N(e);
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
504
|
+
function it() {
|
|
505
|
+
return B.value;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
507
|
+
function ot() {
|
|
508
|
+
ee(), B.value = "zh-cn";
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
if (
|
|
512
|
-
if (typeof t.locale == "function" ||
|
|
513
|
-
K =
|
|
514
|
-
() =>
|
|
510
|
+
function rt(e, t = {}) {
|
|
511
|
+
if (ee(), t.locale) {
|
|
512
|
+
if (typeof t.locale == "function" || re(t.locale)) {
|
|
513
|
+
K = Z(
|
|
514
|
+
() => ie(t.locale),
|
|
515
515
|
(n) => {
|
|
516
|
-
|
|
516
|
+
B.value = n;
|
|
517
517
|
},
|
|
518
518
|
{ immediate: !0, flush: "sync" }
|
|
519
519
|
);
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
|
-
|
|
522
|
+
B.value = ie(t.locale);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
function s(e, t = e) {
|
|
526
|
-
const n = t || e,
|
|
527
|
-
return
|
|
526
|
+
const n = t || e, o = B.value;
|
|
527
|
+
return oe(o, e) || oe("zh-cn", e) || n || e;
|
|
528
528
|
}
|
|
529
529
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
530
|
-
var
|
|
530
|
+
var Le = /* @__PURE__ */ E({
|
|
531
531
|
name: "Download",
|
|
532
532
|
__name: "download",
|
|
533
533
|
setup(e) {
|
|
534
|
-
return (t, n) => (
|
|
534
|
+
return (t, n) => (Y(), I("svg", {
|
|
535
535
|
xmlns: "http://www.w3.org/2000/svg",
|
|
536
536
|
viewBox: "0 0 1024 1024"
|
|
537
537
|
}, [
|
|
538
|
-
|
|
538
|
+
O("path", {
|
|
539
539
|
fill: "currentColor",
|
|
540
540
|
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
|
|
541
541
|
})
|
|
542
542
|
]));
|
|
543
543
|
}
|
|
544
|
-
}),
|
|
544
|
+
}), Ee = Le, xe = /* @__PURE__ */ E({
|
|
545
545
|
name: "RefreshLeft",
|
|
546
546
|
__name: "refresh-left",
|
|
547
547
|
setup(e) {
|
|
548
|
-
return (t, n) => (
|
|
548
|
+
return (t, n) => (Y(), I("svg", {
|
|
549
549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
550
550
|
viewBox: "0 0 1024 1024"
|
|
551
551
|
}, [
|
|
552
|
-
|
|
552
|
+
O("path", {
|
|
553
553
|
fill: "currentColor",
|
|
554
554
|
d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
|
|
555
555
|
})
|
|
556
556
|
]));
|
|
557
557
|
}
|
|
558
|
-
}),
|
|
558
|
+
}), Re = xe, Ce = /* @__PURE__ */ E({
|
|
559
559
|
name: "ZoomIn",
|
|
560
560
|
__name: "zoom-in",
|
|
561
561
|
setup(e) {
|
|
562
|
-
return (t, n) => (
|
|
562
|
+
return (t, n) => (Y(), I("svg", {
|
|
563
563
|
xmlns: "http://www.w3.org/2000/svg",
|
|
564
564
|
viewBox: "0 0 1024 1024"
|
|
565
565
|
}, [
|
|
566
|
-
|
|
566
|
+
O("path", {
|
|
567
567
|
fill: "currentColor",
|
|
568
568
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
|
|
569
569
|
})
|
|
570
570
|
]));
|
|
571
571
|
}
|
|
572
|
-
}),
|
|
572
|
+
}), Be = Ce, ze = /* @__PURE__ */ E({
|
|
573
573
|
name: "ZoomOut",
|
|
574
574
|
__name: "zoom-out",
|
|
575
575
|
setup(e) {
|
|
576
|
-
return (t, n) => (
|
|
576
|
+
return (t, n) => (Y(), I("svg", {
|
|
577
577
|
xmlns: "http://www.w3.org/2000/svg",
|
|
578
578
|
viewBox: "0 0 1024 1024"
|
|
579
579
|
}, [
|
|
580
|
-
|
|
580
|
+
O("path", {
|
|
581
581
|
fill: "currentColor",
|
|
582
582
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
|
|
583
583
|
})
|
|
584
584
|
]));
|
|
585
585
|
}
|
|
586
|
-
}),
|
|
587
|
-
const
|
|
586
|
+
}), Fe = ze;
|
|
587
|
+
const Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1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HbiNYNjON8OfvIkZP2Zi9tqV7CE2V77TyxL2PdkXJ52GUuYvZbKL1IsYcfr9GPbq2WxhJ2gMIUpTGEcFKYwEgpTGAmFKYyEwhRGQmEKI+EJy3YDCeeNdgOesMH4ZTgk4zfAoxi9GR6dsctwCfRD1sNnNm7HCmtuY8wRH42dZSXCL/CW5QQcmtoax4iLIuOglQkVpIHrPlzGPqCSNE8diT4FiIiIiIjIP2/v9e/hKQXqEwAAAABJRU5ErkJggg==", Te = /* @__PURE__ */ new Set([
|
|
588
588
|
"jpg",
|
|
589
589
|
"jpeg",
|
|
590
590
|
"png",
|
|
@@ -594,7 +594,7 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
594
594
|
"svg",
|
|
595
595
|
"avif",
|
|
596
596
|
"ico"
|
|
597
|
-
]),
|
|
597
|
+
]), Je = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ne = /* @__PURE__ */ new Set([
|
|
598
598
|
"mp3",
|
|
599
599
|
"wav",
|
|
600
600
|
"ogg",
|
|
@@ -602,7 +602,7 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
602
602
|
"m4a",
|
|
603
603
|
"aac",
|
|
604
604
|
"flac"
|
|
605
|
-
]),
|
|
605
|
+
]), Ue = /* @__PURE__ */ new Set([
|
|
606
606
|
"html",
|
|
607
607
|
"htm",
|
|
608
608
|
"txt",
|
|
@@ -621,24 +621,37 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
621
621
|
"zip",
|
|
622
622
|
"rar",
|
|
623
623
|
"7z"
|
|
624
|
-
])
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
624
|
+
]), W = {
|
|
625
|
+
component: "JtAttachmentPreview",
|
|
626
|
+
marker: "2026-06-25-download-fix-recheck",
|
|
627
|
+
source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
|
|
628
|
+
pdfLoadMode: "fetch-bytes-then-pdfjs-data",
|
|
629
|
+
previewDownloadMode: "blob-only-no-raw-url-fallback"
|
|
630
|
+
};
|
|
631
|
+
function _(e, t) {
|
|
632
|
+
console.info(`[JtAttachmentPreview DEBUG ${W.marker}] ${e}`, {
|
|
633
|
+
...W,
|
|
634
|
+
...t
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = W, _("module-loaded"));
|
|
638
|
+
let A = null, G = null, U = null;
|
|
639
|
+
async function Ie() {
|
|
640
|
+
return G || (G = Promise.all([
|
|
628
641
|
import("./pdf-BmBuG7of.js"),
|
|
629
642
|
import("./pdf.worker.min-4PI-nNLo.js")
|
|
630
|
-
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))),
|
|
643
|
+
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), G;
|
|
631
644
|
}
|
|
632
|
-
function
|
|
645
|
+
function Oe(e) {
|
|
633
646
|
return typeof e == "string" ? { url: e } : e;
|
|
634
647
|
}
|
|
635
|
-
function
|
|
648
|
+
function se(e) {
|
|
636
649
|
const [t] = e.split(/[?#]/);
|
|
637
650
|
return t ?? "";
|
|
638
651
|
}
|
|
639
|
-
function
|
|
652
|
+
function te(e, t) {
|
|
640
653
|
if (t?.trim()) return t.trim();
|
|
641
|
-
const n =
|
|
654
|
+
const n = se(e).split("/").filter(Boolean).pop();
|
|
642
655
|
if (!n) return s("common.附件预览");
|
|
643
656
|
try {
|
|
644
657
|
return decodeURIComponent(n);
|
|
@@ -646,69 +659,81 @@ function $(e, t) {
|
|
|
646
659
|
return n;
|
|
647
660
|
}
|
|
648
661
|
}
|
|
649
|
-
function
|
|
650
|
-
return
|
|
662
|
+
function Q(e) {
|
|
663
|
+
return se(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
|
|
651
664
|
}
|
|
652
|
-
function
|
|
665
|
+
function Ve(e) {
|
|
653
666
|
return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
|
|
654
667
|
}
|
|
655
|
-
function
|
|
656
|
-
const t =
|
|
657
|
-
return
|
|
668
|
+
function qe(e) {
|
|
669
|
+
const t = Ve(e);
|
|
670
|
+
return Te.has(t) ? "image" : t === "pdf" ? "pdf" : Je.has(t) ? "video" : Ne.has(t) ? "audio" : Ue.has(t) ? "iframe" : Ye.has(t) ? "unsupported" : "unknown";
|
|
658
671
|
}
|
|
659
|
-
function
|
|
672
|
+
function ne(e) {
|
|
660
673
|
const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
661
674
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
|
|
662
675
|
}
|
|
663
|
-
function
|
|
676
|
+
function ce(e) {
|
|
664
677
|
if (!e.url.trim()) return "empty";
|
|
665
678
|
if (e.mode && e.mode !== "auto") return e.mode;
|
|
666
679
|
if (e.mimeType) {
|
|
667
|
-
const n =
|
|
680
|
+
const n = ne(e.mimeType);
|
|
668
681
|
if (n !== "unknown") return n;
|
|
669
682
|
}
|
|
670
|
-
const t =
|
|
671
|
-
e.extension ||
|
|
683
|
+
const t = qe(
|
|
684
|
+
e.extension || Q(e.name || "") || Q(e.url)
|
|
672
685
|
);
|
|
673
686
|
return t !== "unknown" ? t : "unknown";
|
|
674
687
|
}
|
|
675
|
-
async function
|
|
688
|
+
async function Ge(e) {
|
|
676
689
|
try {
|
|
677
690
|
const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
|
|
678
|
-
return
|
|
691
|
+
return ne(n);
|
|
679
692
|
} catch {
|
|
680
693
|
return "unknown";
|
|
681
694
|
}
|
|
682
695
|
}
|
|
683
|
-
async function
|
|
696
|
+
async function le(e) {
|
|
684
697
|
const t = await fetch(e);
|
|
685
698
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
686
699
|
return t.blob();
|
|
687
700
|
}
|
|
688
|
-
async function
|
|
701
|
+
async function He(e) {
|
|
702
|
+
_("fetch-pdf-bytes-start", {
|
|
703
|
+
url: e
|
|
704
|
+
});
|
|
689
705
|
const t = await fetch(e);
|
|
690
706
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
691
|
-
|
|
707
|
+
const n = new Uint8Array(await t.arrayBuffer());
|
|
708
|
+
return _("fetch-pdf-bytes-done", {
|
|
709
|
+
url: e,
|
|
710
|
+
byteLength: n.byteLength,
|
|
711
|
+
contentType: t.headers.get("content-type") ?? ""
|
|
712
|
+
}), n;
|
|
692
713
|
}
|
|
693
|
-
function
|
|
694
|
-
const n =
|
|
714
|
+
function Ke(e, t) {
|
|
715
|
+
const n = Q(t);
|
|
695
716
|
return n === "doc" || n === "docx" ? "W" : n === "xls" || n === "xlsx" ? "X" : n === "ppt" || n === "pptx" ? "P" : n === "zip" || n === "rar" || n === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
|
|
696
717
|
}
|
|
697
|
-
function
|
|
718
|
+
function de(e, t, n, o = !1) {
|
|
698
719
|
return a(
|
|
699
720
|
"button",
|
|
700
721
|
{
|
|
701
722
|
class: n,
|
|
702
723
|
type: "button",
|
|
703
724
|
onClick: () => {
|
|
704
|
-
|
|
725
|
+
_("download-button-click", {
|
|
726
|
+
url: e,
|
|
727
|
+
downloadName: t,
|
|
728
|
+
fallbackToRawUrl: o
|
|
729
|
+
}), me(e, t, { fallbackToRawUrl: o });
|
|
705
730
|
}
|
|
706
731
|
},
|
|
707
732
|
[
|
|
708
733
|
a(
|
|
709
|
-
|
|
734
|
+
J,
|
|
710
735
|
{ class: "jt-attachment-preview-service__download-icon" },
|
|
711
|
-
() => a(
|
|
736
|
+
() => a(Ee)
|
|
712
737
|
),
|
|
713
738
|
a(
|
|
714
739
|
"span",
|
|
@@ -718,10 +743,10 @@ function ce(e, t, n) {
|
|
|
718
743
|
]
|
|
719
744
|
);
|
|
720
745
|
}
|
|
721
|
-
function
|
|
746
|
+
function H(e) {
|
|
722
747
|
return e === "image" || e === "pdf";
|
|
723
748
|
}
|
|
724
|
-
function
|
|
749
|
+
function ue(e) {
|
|
725
750
|
return a(
|
|
726
751
|
"div",
|
|
727
752
|
{ class: "jt-attachment-preview-service__preview-fallback" },
|
|
@@ -747,19 +772,36 @@ function le(e) {
|
|
|
747
772
|
]
|
|
748
773
|
);
|
|
749
774
|
}
|
|
750
|
-
function
|
|
775
|
+
function X(e, t) {
|
|
751
776
|
const n = document.createElement("a");
|
|
752
777
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
|
|
753
778
|
}
|
|
754
|
-
async function
|
|
779
|
+
async function me(e, t, n = {}) {
|
|
780
|
+
_("download-start", {
|
|
781
|
+
url: e,
|
|
782
|
+
downloadName: t,
|
|
783
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
784
|
+
});
|
|
785
|
+
let o = "";
|
|
755
786
|
try {
|
|
756
|
-
const
|
|
757
|
-
|
|
787
|
+
const i = await le(e);
|
|
788
|
+
o = URL.createObjectURL(i), _("download-blob-ready", {
|
|
789
|
+
url: e,
|
|
790
|
+
downloadName: t,
|
|
791
|
+
blobType: i.type,
|
|
792
|
+
blobSize: i.size
|
|
793
|
+
}), X(o, t);
|
|
758
794
|
} catch {
|
|
759
|
-
|
|
795
|
+
_("download-blob-failed", {
|
|
796
|
+
url: e,
|
|
797
|
+
downloadName: t,
|
|
798
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
799
|
+
}), n.fallbackToRawUrl && X(e, t);
|
|
800
|
+
} finally {
|
|
801
|
+
o && window.setTimeout(() => URL.revokeObjectURL(o), 1e3);
|
|
760
802
|
}
|
|
761
803
|
}
|
|
762
|
-
const
|
|
804
|
+
const We = E({
|
|
763
805
|
name: "JtAttachmentPreviewPdfCanvas",
|
|
764
806
|
props: {
|
|
765
807
|
url: {
|
|
@@ -784,81 +826,83 @@ const Ke = L({
|
|
|
784
826
|
previewError: (e) => e instanceof Event
|
|
785
827
|
},
|
|
786
828
|
setup(e, { emit: t }) {
|
|
787
|
-
const n =
|
|
788
|
-
let m = null,
|
|
789
|
-
async function
|
|
790
|
-
if (!
|
|
791
|
-
const
|
|
792
|
-
return !Array.isArray(
|
|
829
|
+
const n = P("loading"), o = P([]), i = P([]), c = /* @__PURE__ */ new Map(), l = P("");
|
|
830
|
+
let m = null, b = [], v = 0;
|
|
831
|
+
async function f(r, d) {
|
|
832
|
+
if (!d) return null;
|
|
833
|
+
const g = typeof d == "string" ? await r.getDestination(d) : d;
|
|
834
|
+
return !Array.isArray(g) || !g[0] ? null : await r.getPageIndex(g[0]) + 1;
|
|
793
835
|
}
|
|
794
|
-
async function
|
|
795
|
-
if (!
|
|
796
|
-
const
|
|
797
|
-
for (const
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
title:
|
|
801
|
-
pageNumber:
|
|
802
|
-
level:
|
|
836
|
+
async function x(r, d, g = 0) {
|
|
837
|
+
if (!d?.length) return [];
|
|
838
|
+
const w = [];
|
|
839
|
+
for (const j of d) {
|
|
840
|
+
const z = await f(r, j.dest);
|
|
841
|
+
w.push({
|
|
842
|
+
title: j.title || s("common.未命名标题"),
|
|
843
|
+
pageNumber: z,
|
|
844
|
+
level: g
|
|
803
845
|
});
|
|
804
|
-
const
|
|
805
|
-
|
|
846
|
+
const R = await x(r, j.items, g + 1);
|
|
847
|
+
w.push(...R);
|
|
806
848
|
}
|
|
807
|
-
return
|
|
849
|
+
return w;
|
|
808
850
|
}
|
|
809
|
-
function
|
|
851
|
+
function p() {
|
|
810
852
|
v += 1;
|
|
811
|
-
for (const
|
|
812
|
-
|
|
813
|
-
|
|
853
|
+
for (const r of b)
|
|
854
|
+
r.cancel();
|
|
855
|
+
b = [], m?.destroy(), m = null, c.clear();
|
|
814
856
|
}
|
|
815
|
-
async function
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
n.value = "loading", l.value = "",
|
|
857
|
+
async function D() {
|
|
858
|
+
p();
|
|
859
|
+
const r = v;
|
|
860
|
+
n.value = "loading", l.value = "", o.value = [], i.value = [];
|
|
819
861
|
try {
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
862
|
+
const d = await Ie();
|
|
863
|
+
if (r !== v) return;
|
|
864
|
+
const g = await He(e.url);
|
|
865
|
+
if (r !== v) return;
|
|
866
|
+
_("render-pdf-get-document-data", {
|
|
867
|
+
byteLength: g.byteLength
|
|
868
|
+
}), m = d.getDocument({ data: g });
|
|
869
|
+
const w = await m.promise;
|
|
870
|
+
if (r !== v) return;
|
|
871
|
+
o.value = Array.from(
|
|
872
|
+
{ length: w.numPages },
|
|
873
|
+
(R, C) => C + 1
|
|
874
|
+
), i.value = await x(
|
|
875
|
+
w,
|
|
876
|
+
await w.getOutline()
|
|
877
|
+
), await fe();
|
|
878
|
+
const j = c.values().next().value, z = Math.max(
|
|
879
|
+
(j?.parentElement?.clientWidth ?? 800) - 32,
|
|
836
880
|
320
|
|
837
881
|
);
|
|
838
|
-
for (const
|
|
839
|
-
if (
|
|
840
|
-
const C = await
|
|
841
|
-
if (!
|
|
842
|
-
const q = C.getViewport({ scale: 1 }),
|
|
843
|
-
|
|
844
|
-
const
|
|
845
|
-
canvas:
|
|
882
|
+
for (const R of o.value) {
|
|
883
|
+
if (r !== v) return;
|
|
884
|
+
const C = await w.getPage(R), y = c.get(R), F = y?.getContext("2d");
|
|
885
|
+
if (!y || !F) continue;
|
|
886
|
+
const q = C.getViewport({ scale: 1 }), u = Math.min(z / q.width, 2), M = C.getViewport({ scale: u }), T = window.devicePixelRatio || 1;
|
|
887
|
+
y.width = Math.floor(M.width * T), y.height = Math.floor(M.height * T), y.style.width = `${Math.floor(M.width)}px`, y.style.height = `${Math.floor(M.height)}px`, F.setTransform(T, 0, 0, T, 0, 0);
|
|
888
|
+
const ae = C.render({
|
|
889
|
+
canvas: y,
|
|
846
890
|
canvasContext: F,
|
|
847
|
-
viewport:
|
|
891
|
+
viewport: M
|
|
848
892
|
});
|
|
849
|
-
|
|
893
|
+
b.push(ae), await ae.promise;
|
|
850
894
|
}
|
|
851
|
-
if (
|
|
895
|
+
if (r !== v) return;
|
|
852
896
|
n.value = "ready", t("previewLoad", new Event("load"));
|
|
853
|
-
} catch (
|
|
854
|
-
if (
|
|
855
|
-
n.value = "error", l.value =
|
|
897
|
+
} catch (d) {
|
|
898
|
+
if (r !== v) return;
|
|
899
|
+
n.value = "error", l.value = d instanceof Error ? d.message : s("common.PDF加载失败"), t("previewError", new Event("error"));
|
|
856
900
|
}
|
|
857
901
|
}
|
|
858
|
-
|
|
859
|
-
function
|
|
860
|
-
if (!
|
|
861
|
-
c.get(
|
|
902
|
+
Z(() => e.url, D, { immediate: !0 }), V(p);
|
|
903
|
+
function h(r) {
|
|
904
|
+
if (!r) return;
|
|
905
|
+
c.get(r)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
862
906
|
}
|
|
863
907
|
return () => a("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
864
908
|
n.value === "loading" ? a(
|
|
@@ -867,8 +911,8 @@ const Ke = L({
|
|
|
867
911
|
s("common.PDF加载中___")
|
|
868
912
|
) : null,
|
|
869
913
|
n.value === "error" ? a("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
870
|
-
|
|
871
|
-
icon:
|
|
914
|
+
ue({
|
|
915
|
+
icon: Se,
|
|
872
916
|
name: e.name
|
|
873
917
|
})
|
|
874
918
|
]) : null,
|
|
@@ -900,18 +944,18 @@ const Ke = L({
|
|
|
900
944
|
class: "jt-attachment-preview-service__pdf-outline-list"
|
|
901
945
|
},
|
|
902
946
|
i.value.map(
|
|
903
|
-
(
|
|
947
|
+
(r, d) => a(
|
|
904
948
|
"button",
|
|
905
949
|
{
|
|
906
|
-
key: `${
|
|
950
|
+
key: `${r.title}-${d}`,
|
|
907
951
|
class: "jt-attachment-preview-service__pdf-outline-item",
|
|
908
|
-
style: { paddingLeft: `${12 +
|
|
952
|
+
style: { paddingLeft: `${12 + r.level * 14}px` },
|
|
909
953
|
type: "button",
|
|
910
|
-
disabled: !
|
|
911
|
-
title:
|
|
912
|
-
onClick: () =>
|
|
954
|
+
disabled: !r.pageNumber,
|
|
955
|
+
title: r.title,
|
|
956
|
+
onClick: () => h(r.pageNumber)
|
|
913
957
|
},
|
|
914
|
-
|
|
958
|
+
r.title
|
|
915
959
|
)
|
|
916
960
|
)
|
|
917
961
|
)
|
|
@@ -920,11 +964,11 @@ const Ke = L({
|
|
|
920
964
|
a(
|
|
921
965
|
"div",
|
|
922
966
|
{ class: "jt-attachment-preview-service__pdf-pages" },
|
|
923
|
-
|
|
924
|
-
(
|
|
925
|
-
key:
|
|
926
|
-
ref: (
|
|
927
|
-
|
|
967
|
+
o.value.map(
|
|
968
|
+
(r) => a("canvas", {
|
|
969
|
+
key: r,
|
|
970
|
+
ref: (d) => {
|
|
971
|
+
d instanceof HTMLCanvasElement && c.set(r, d);
|
|
928
972
|
},
|
|
929
973
|
class: "jt-attachment-preview-service__pdf-page"
|
|
930
974
|
})
|
|
@@ -934,7 +978,7 @@ const Ke = L({
|
|
|
934
978
|
)
|
|
935
979
|
]);
|
|
936
980
|
}
|
|
937
|
-
}),
|
|
981
|
+
}), Qe = E({
|
|
938
982
|
name: "JtAttachmentPreviewImageTransform",
|
|
939
983
|
props: {
|
|
940
984
|
url: {
|
|
@@ -963,65 +1007,65 @@ const Ke = L({
|
|
|
963
1007
|
previewError: (e) => e instanceof Event
|
|
964
1008
|
},
|
|
965
1009
|
setup(e, { emit: t }) {
|
|
966
|
-
const n =
|
|
967
|
-
let l = 0, m = 0,
|
|
968
|
-
const
|
|
1010
|
+
const n = P(null), o = P("ready"), i = P(1), c = P(!1);
|
|
1011
|
+
let l = 0, m = 0, b = 0, v = 0, f = 0, x = 0, p = 0;
|
|
1012
|
+
const D = L(
|
|
969
1013
|
() => ({
|
|
970
1014
|
"--jt-attachment-preview-service-image-fit": e.fit,
|
|
971
1015
|
transform: `translate(${l}px, ${m}px) scale(${i.value})`
|
|
972
1016
|
})
|
|
973
1017
|
);
|
|
974
|
-
function
|
|
1018
|
+
function h() {
|
|
975
1019
|
n.value && (n.value.style.transform = `translate(${l}px, ${m}px) scale(${i.value})`);
|
|
976
1020
|
}
|
|
977
|
-
function
|
|
978
|
-
|
|
979
|
-
|
|
1021
|
+
function r() {
|
|
1022
|
+
p || (p = window.requestAnimationFrame(() => {
|
|
1023
|
+
p = 0, h();
|
|
980
1024
|
}));
|
|
981
1025
|
}
|
|
982
|
-
function u
|
|
983
|
-
i.value = Math.min(Math.max(Number(
|
|
984
|
-
}
|
|
985
|
-
function y() {
|
|
986
|
-
u(i.value + 0.2);
|
|
1026
|
+
function d(u) {
|
|
1027
|
+
i.value = Math.min(Math.max(Number(u.toFixed(2)), 0.2), 5), i.value <= 1 && (l = 0, m = 0), h();
|
|
987
1028
|
}
|
|
988
1029
|
function g() {
|
|
989
|
-
|
|
990
|
-
i.value = d, d <= 1 && (l = 0, m = 0), p();
|
|
1030
|
+
d(i.value + 0.2);
|
|
991
1031
|
}
|
|
992
|
-
function
|
|
993
|
-
|
|
1032
|
+
function w() {
|
|
1033
|
+
const u = Math.max(Number((i.value - 0.2).toFixed(2)), 0.2);
|
|
1034
|
+
i.value = u, u <= 1 && (l = 0, m = 0), h();
|
|
994
1035
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
1036
|
+
function j() {
|
|
1037
|
+
l = 0, m = 0, d(1);
|
|
997
1038
|
}
|
|
998
|
-
function
|
|
999
|
-
|
|
1039
|
+
function z(u) {
|
|
1040
|
+
o.value = "ready", t("previewLoad", u);
|
|
1000
1041
|
}
|
|
1001
|
-
function
|
|
1002
|
-
|
|
1042
|
+
function R(u) {
|
|
1043
|
+
o.value = "error", t("previewError", u);
|
|
1003
1044
|
}
|
|
1004
|
-
function
|
|
1005
|
-
|
|
1045
|
+
function C(u) {
|
|
1046
|
+
i.value <= 1 || (u.preventDefault(), c.value = !0, b = u.clientX, v = u.clientY, f = l, x = m, window.addEventListener("pointermove", y), window.addEventListener("pointerup", F, { once: !0 }));
|
|
1047
|
+
}
|
|
1048
|
+
function y(u) {
|
|
1049
|
+
c.value && (l = f + u.clientX - b, m = x + u.clientY - v, r());
|
|
1006
1050
|
}
|
|
1007
1051
|
function F() {
|
|
1008
|
-
c.value = !1, window.removeEventListener("pointermove",
|
|
1052
|
+
c.value = !1, window.removeEventListener("pointermove", y);
|
|
1009
1053
|
}
|
|
1010
|
-
function q(
|
|
1011
|
-
|
|
1054
|
+
function q(u) {
|
|
1055
|
+
u.preventDefault(), d(i.value + (u.deltaY < 0 ? 0.1 : -0.1));
|
|
1012
1056
|
}
|
|
1013
|
-
return
|
|
1057
|
+
return $(h), Z(
|
|
1014
1058
|
() => e.url,
|
|
1015
1059
|
() => {
|
|
1016
|
-
|
|
1060
|
+
o.value = "ready", j();
|
|
1017
1061
|
}
|
|
1018
|
-
),
|
|
1019
|
-
window.removeEventListener("pointermove",
|
|
1062
|
+
), V(() => {
|
|
1063
|
+
window.removeEventListener("pointermove", y), p && window.cancelAnimationFrame(p);
|
|
1020
1064
|
}), () => a(
|
|
1021
1065
|
"div",
|
|
1022
1066
|
{ class: "jt-attachment-preview-service__image-viewer" },
|
|
1023
|
-
|
|
1024
|
-
icon:
|
|
1067
|
+
o.value === "error" ? ue({
|
|
1068
|
+
icon: Me,
|
|
1025
1069
|
name: e.name
|
|
1026
1070
|
}) : [
|
|
1027
1071
|
a("img", {
|
|
@@ -1034,12 +1078,12 @@ const Ke = L({
|
|
|
1034
1078
|
],
|
|
1035
1079
|
src: e.url,
|
|
1036
1080
|
alt: e.name,
|
|
1037
|
-
style:
|
|
1038
|
-
onLoad:
|
|
1039
|
-
onError:
|
|
1081
|
+
style: D.value,
|
|
1082
|
+
onLoad: z,
|
|
1083
|
+
onError: R,
|
|
1040
1084
|
onPointerdown: C,
|
|
1041
1085
|
onWheel: q,
|
|
1042
|
-
onDragstart: (
|
|
1086
|
+
onDragstart: (u) => u.preventDefault(),
|
|
1043
1087
|
draggable: !1
|
|
1044
1088
|
}),
|
|
1045
1089
|
a(
|
|
@@ -1052,9 +1096,9 @@ const Ke = L({
|
|
|
1052
1096
|
class: "jt-attachment-preview-service__image-tool",
|
|
1053
1097
|
type: "button",
|
|
1054
1098
|
title: s("common.缩小"),
|
|
1055
|
-
onClick:
|
|
1099
|
+
onClick: w
|
|
1056
1100
|
},
|
|
1057
|
-
[a(
|
|
1101
|
+
[a(J, () => a(Fe))]
|
|
1058
1102
|
),
|
|
1059
1103
|
a(
|
|
1060
1104
|
"span",
|
|
@@ -1067,9 +1111,9 @@ const Ke = L({
|
|
|
1067
1111
|
class: "jt-attachment-preview-service__image-tool",
|
|
1068
1112
|
type: "button",
|
|
1069
1113
|
title: s("common.放大"),
|
|
1070
|
-
onClick:
|
|
1114
|
+
onClick: g
|
|
1071
1115
|
},
|
|
1072
|
-
[a(
|
|
1116
|
+
[a(J, () => a(Be))]
|
|
1073
1117
|
),
|
|
1074
1118
|
a(
|
|
1075
1119
|
"button",
|
|
@@ -1077,16 +1121,16 @@ const Ke = L({
|
|
|
1077
1121
|
class: "jt-attachment-preview-service__image-tool",
|
|
1078
1122
|
type: "button",
|
|
1079
1123
|
title: s("common.复位"),
|
|
1080
|
-
onClick:
|
|
1124
|
+
onClick: j
|
|
1081
1125
|
},
|
|
1082
|
-
[a(
|
|
1126
|
+
[a(J, () => a(Re))]
|
|
1083
1127
|
)
|
|
1084
1128
|
]
|
|
1085
1129
|
)
|
|
1086
1130
|
]
|
|
1087
1131
|
);
|
|
1088
1132
|
}
|
|
1089
|
-
}),
|
|
1133
|
+
}), Xe = E({
|
|
1090
1134
|
name: "JtAttachmentPreviewService",
|
|
1091
1135
|
props: {
|
|
1092
1136
|
options: {
|
|
@@ -1099,13 +1143,13 @@ const Ke = L({
|
|
|
1099
1143
|
}
|
|
1100
1144
|
},
|
|
1101
1145
|
setup(e) {
|
|
1102
|
-
const t =
|
|
1103
|
-
() =>
|
|
1104
|
-
), n =
|
|
1146
|
+
const t = L(
|
|
1147
|
+
() => te(e.options.url, e.options.name)
|
|
1148
|
+
), n = L(
|
|
1105
1149
|
() => e.options.downloadName || t.value
|
|
1106
|
-
),
|
|
1107
|
-
() =>
|
|
1108
|
-
), c =
|
|
1150
|
+
), o = L(() => ce(e.options)), i = L(
|
|
1151
|
+
() => Ke(o.value, e.options.url)
|
|
1152
|
+
), c = L(
|
|
1109
1153
|
() => ({
|
|
1110
1154
|
zIndex: e.options.zIndex ?? 3e3,
|
|
1111
1155
|
"--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
|
|
@@ -1114,22 +1158,22 @@ const Ke = L({
|
|
|
1114
1158
|
function l() {
|
|
1115
1159
|
e.options.onClose?.(), e.onDestroy();
|
|
1116
1160
|
}
|
|
1117
|
-
function m(
|
|
1118
|
-
|
|
1161
|
+
function m(f) {
|
|
1162
|
+
f.key === "Escape" && e.options.closeOnPressEscape !== !1 && l();
|
|
1119
1163
|
}
|
|
1120
|
-
function
|
|
1121
|
-
e.options.onLoad?.(
|
|
1164
|
+
function b(f) {
|
|
1165
|
+
e.options.onLoad?.(f);
|
|
1122
1166
|
}
|
|
1123
|
-
function v(
|
|
1124
|
-
e.options.onError?.(
|
|
1167
|
+
function v(f) {
|
|
1168
|
+
e.options.onError?.(f);
|
|
1125
1169
|
}
|
|
1126
|
-
return
|
|
1170
|
+
return $(() => {
|
|
1127
1171
|
document.addEventListener("keydown", m), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1128
|
-
}),
|
|
1172
|
+
}), V(() => {
|
|
1129
1173
|
document.removeEventListener("keydown", m), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1130
1174
|
}), () => {
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1175
|
+
const f = e.options.downloadable === !1 ? [] : [
|
|
1176
|
+
de(
|
|
1133
1177
|
e.options.url,
|
|
1134
1178
|
n.value,
|
|
1135
1179
|
"jt-attachment-preview-service__top-download"
|
|
@@ -1153,7 +1197,7 @@ const Ke = L({
|
|
|
1153
1197
|
"div",
|
|
1154
1198
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1155
1199
|
[
|
|
1156
|
-
...
|
|
1200
|
+
...f,
|
|
1157
1201
|
a(
|
|
1158
1202
|
"button",
|
|
1159
1203
|
{
|
|
@@ -1168,15 +1212,15 @@ const Ke = L({
|
|
|
1168
1212
|
)
|
|
1169
1213
|
]),
|
|
1170
1214
|
a("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1171
|
-
|
|
1172
|
-
type:
|
|
1215
|
+
Ze({
|
|
1216
|
+
type: o.value,
|
|
1173
1217
|
url: e.options.url,
|
|
1174
1218
|
name: t.value,
|
|
1175
1219
|
downloadName: n.value,
|
|
1176
1220
|
sandbox: e.options.sandbox,
|
|
1177
1221
|
iconText: i.value,
|
|
1178
1222
|
downloadable: e.options.downloadable !== !1,
|
|
1179
|
-
onLoad:
|
|
1223
|
+
onLoad: b,
|
|
1180
1224
|
onError: v
|
|
1181
1225
|
})
|
|
1182
1226
|
])
|
|
@@ -1185,7 +1229,7 @@ const Ke = L({
|
|
|
1185
1229
|
);
|
|
1186
1230
|
};
|
|
1187
1231
|
}
|
|
1188
|
-
}),
|
|
1232
|
+
}), S = E({
|
|
1189
1233
|
name: "JtAttachmentPreviewDetectingService",
|
|
1190
1234
|
props: {
|
|
1191
1235
|
options: {
|
|
@@ -1210,20 +1254,20 @@ const Ke = L({
|
|
|
1210
1254
|
}
|
|
1211
1255
|
},
|
|
1212
1256
|
setup(e) {
|
|
1213
|
-
const t =
|
|
1214
|
-
() =>
|
|
1215
|
-
), n =
|
|
1257
|
+
const t = L(
|
|
1258
|
+
() => te(e.options.url, e.options.name)
|
|
1259
|
+
), n = L(() => ({
|
|
1216
1260
|
zIndex: e.options.zIndex ?? 3e3
|
|
1217
1261
|
}));
|
|
1218
|
-
function
|
|
1262
|
+
function o() {
|
|
1219
1263
|
e.options.onClose?.(), e.onDestroy();
|
|
1220
1264
|
}
|
|
1221
1265
|
function i(c) {
|
|
1222
|
-
c.key === "Escape" && e.options.closeOnPressEscape !== !1 &&
|
|
1266
|
+
c.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
|
|
1223
1267
|
}
|
|
1224
|
-
return
|
|
1268
|
+
return $(() => {
|
|
1225
1269
|
document.addEventListener("keydown", i), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1226
|
-
}),
|
|
1270
|
+
}), V(() => {
|
|
1227
1271
|
document.removeEventListener("keydown", i), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1228
1272
|
}), () => a(
|
|
1229
1273
|
"div",
|
|
@@ -1249,7 +1293,7 @@ const Ke = L({
|
|
|
1249
1293
|
class: "jt-attachment-preview-service__close",
|
|
1250
1294
|
type: "button",
|
|
1251
1295
|
"aria-label": s("common.关闭"),
|
|
1252
|
-
onClick:
|
|
1296
|
+
onClick: o
|
|
1253
1297
|
},
|
|
1254
1298
|
"×"
|
|
1255
1299
|
)
|
|
@@ -1278,12 +1322,12 @@ const Ke = L({
|
|
|
1278
1322
|
);
|
|
1279
1323
|
}
|
|
1280
1324
|
});
|
|
1281
|
-
function
|
|
1325
|
+
function Ze(e) {
|
|
1282
1326
|
return e.type === "empty" ? a(
|
|
1283
1327
|
"div",
|
|
1284
1328
|
{ class: "jt-attachment-preview-service__empty" },
|
|
1285
1329
|
s("common.暂无附件")
|
|
1286
|
-
) : e.type === "image" ? a(
|
|
1330
|
+
) : e.type === "image" ? a(Qe, {
|
|
1287
1331
|
url: e.url,
|
|
1288
1332
|
name: e.name,
|
|
1289
1333
|
downloadName: e.downloadName,
|
|
@@ -1302,7 +1346,7 @@ function Qe(e) {
|
|
|
1302
1346
|
controls: !0,
|
|
1303
1347
|
onLoadeddata: e.onLoad,
|
|
1304
1348
|
onError: e.onError
|
|
1305
|
-
}) : e.type === "pdf" ? a(
|
|
1349
|
+
}) : e.type === "pdf" ? a(We, {
|
|
1306
1350
|
url: e.url,
|
|
1307
1351
|
name: e.name,
|
|
1308
1352
|
downloadName: e.downloadName,
|
|
@@ -1336,35 +1380,37 @@ function Qe(e) {
|
|
|
1336
1380
|
},
|
|
1337
1381
|
e.name
|
|
1338
1382
|
),
|
|
1339
|
-
e.downloadable ?
|
|
1383
|
+
e.downloadable ? de(
|
|
1340
1384
|
e.url,
|
|
1341
1385
|
e.downloadName,
|
|
1342
1386
|
"jt-attachment-preview-service__primary-download"
|
|
1343
1387
|
) : null
|
|
1344
1388
|
]);
|
|
1345
1389
|
}
|
|
1346
|
-
function
|
|
1390
|
+
function ve(e) {
|
|
1347
1391
|
if (typeof document > "u")
|
|
1348
1392
|
return { close: () => {
|
|
1349
1393
|
} };
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1394
|
+
_("open-called", {
|
|
1395
|
+
rawOptions: typeof e == "string" ? e : { ...e }
|
|
1396
|
+
}), A?.close();
|
|
1397
|
+
const t = Oe(e), n = t.downloadName || te(t.url, t.name);
|
|
1398
|
+
let o = !1, i = null, c = null;
|
|
1353
1399
|
const l = () => {
|
|
1354
|
-
|
|
1400
|
+
o = !0, i && (k(null, i), i.remove(), i = null), c && (URL.revokeObjectURL(c), c = null), A?.close === l && (A = null);
|
|
1355
1401
|
};
|
|
1356
1402
|
function m() {
|
|
1357
|
-
|
|
1358
|
-
a(
|
|
1403
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), k(
|
|
1404
|
+
a(Xe, {
|
|
1359
1405
|
options: t,
|
|
1360
1406
|
onDestroy: l
|
|
1361
1407
|
}),
|
|
1362
1408
|
i
|
|
1363
1409
|
));
|
|
1364
1410
|
}
|
|
1365
|
-
function
|
|
1366
|
-
|
|
1367
|
-
a(
|
|
1411
|
+
function b() {
|
|
1412
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), k(
|
|
1413
|
+
a(S, {
|
|
1368
1414
|
options: t,
|
|
1369
1415
|
onDestroy: l
|
|
1370
1416
|
}),
|
|
@@ -1374,109 +1420,118 @@ function de(e) {
|
|
|
1374
1420
|
function v() {
|
|
1375
1421
|
i && (k(null, i), i.remove(), i = null);
|
|
1376
1422
|
}
|
|
1377
|
-
function
|
|
1378
|
-
|
|
1423
|
+
function f() {
|
|
1424
|
+
o || me(t.url, n, {
|
|
1425
|
+
fallbackToRawUrl: !0
|
|
1426
|
+
});
|
|
1379
1427
|
}
|
|
1380
|
-
function
|
|
1381
|
-
if (
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1428
|
+
function x(D) {
|
|
1429
|
+
if (o) return;
|
|
1430
|
+
const h = URL.createObjectURL(D);
|
|
1431
|
+
X(h, n), URL.revokeObjectURL(h);
|
|
1384
1432
|
}
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1433
|
+
const p = ce(t);
|
|
1434
|
+
return _("type-resolved", {
|
|
1435
|
+
resolvedType: p,
|
|
1436
|
+
url: t.url,
|
|
1437
|
+
name: t.name,
|
|
1438
|
+
mode: t.mode,
|
|
1439
|
+
mimeType: t.mimeType,
|
|
1440
|
+
extension: t.extension
|
|
1441
|
+
}), H(p) ? m() : p === "unknown" ? (b(), Ge(t.url).then(async (D) => {
|
|
1442
|
+
if (!o) {
|
|
1443
|
+
if (H(D)) {
|
|
1444
|
+
t.mode = D, m();
|
|
1390
1445
|
return;
|
|
1391
1446
|
}
|
|
1392
1447
|
try {
|
|
1393
|
-
const
|
|
1394
|
-
if (
|
|
1395
|
-
c = URL.createObjectURL(
|
|
1448
|
+
const h = await le(t.url), r = ne(h.type);
|
|
1449
|
+
if (H(r)) {
|
|
1450
|
+
c = URL.createObjectURL(h), t.url = c, t.mode = r, m();
|
|
1396
1451
|
return;
|
|
1397
1452
|
}
|
|
1398
|
-
v(),
|
|
1453
|
+
v(), x(h);
|
|
1399
1454
|
} catch {
|
|
1400
|
-
v(),
|
|
1455
|
+
v(), f();
|
|
1401
1456
|
}
|
|
1402
1457
|
}
|
|
1403
|
-
})) :
|
|
1458
|
+
})) : f(), A = { close: l }, A;
|
|
1404
1459
|
}
|
|
1405
|
-
function
|
|
1406
|
-
|
|
1460
|
+
function $e(e) {
|
|
1461
|
+
U = e;
|
|
1407
1462
|
}
|
|
1408
|
-
function
|
|
1463
|
+
function et(e) {
|
|
1409
1464
|
if (typeof document > "u")
|
|
1410
1465
|
return { close: () => {
|
|
1411
1466
|
} };
|
|
1412
|
-
|
|
1467
|
+
A?.close();
|
|
1413
1468
|
let t = !1, n = document.createElement("div");
|
|
1414
1469
|
document.body.appendChild(n);
|
|
1415
|
-
const
|
|
1416
|
-
t = !0, n && (k(null, n), n.remove(), n = null),
|
|
1417
|
-
}, i = { close:
|
|
1418
|
-
return
|
|
1419
|
-
a(
|
|
1470
|
+
const o = () => {
|
|
1471
|
+
t = !0, n && (k(null, n), n.remove(), n = null), A?.close === o && (A = null);
|
|
1472
|
+
}, i = { close: o };
|
|
1473
|
+
return A = i, U ? (k(
|
|
1474
|
+
a(S, {
|
|
1420
1475
|
options: { url: "", name: s("common.附件预览") },
|
|
1421
1476
|
title: s("common.正在获取文件信息"),
|
|
1422
1477
|
desc: s("common.请稍候,获取完成后将自动预览或下载"),
|
|
1423
1478
|
spinning: !0,
|
|
1424
|
-
onDestroy:
|
|
1479
|
+
onDestroy: o
|
|
1425
1480
|
}),
|
|
1426
1481
|
n
|
|
1427
|
-
),
|
|
1482
|
+
), U.request(e).then((c) => {
|
|
1428
1483
|
if (t) return;
|
|
1429
|
-
const l =
|
|
1484
|
+
const l = U?.mapResponse(c, e);
|
|
1430
1485
|
if (!l?.url) {
|
|
1431
1486
|
k(
|
|
1432
|
-
a(
|
|
1487
|
+
a(S, {
|
|
1433
1488
|
options: { url: "", name: s("common.附件预览") },
|
|
1434
1489
|
title: s("common.文件信息缺少URL"),
|
|
1435
1490
|
desc: s("common.请检查mapResponse是否返回了url字段"),
|
|
1436
1491
|
spinning: !1,
|
|
1437
|
-
onDestroy:
|
|
1492
|
+
onDestroy: o
|
|
1438
1493
|
}),
|
|
1439
1494
|
n
|
|
1440
1495
|
);
|
|
1441
1496
|
return;
|
|
1442
1497
|
}
|
|
1443
|
-
|
|
1498
|
+
ve(l);
|
|
1444
1499
|
}).catch((c) => {
|
|
1445
1500
|
if (t) return;
|
|
1446
1501
|
const l = c instanceof Error ? c.message : s("common.接口请求失败");
|
|
1447
1502
|
k(
|
|
1448
|
-
a(
|
|
1503
|
+
a(S, {
|
|
1449
1504
|
options: { url: "", name: s("common.附件预览") },
|
|
1450
1505
|
title: s("common.文件信息获取失败"),
|
|
1451
1506
|
desc: l,
|
|
1452
1507
|
spinning: !1,
|
|
1453
|
-
onDestroy:
|
|
1508
|
+
onDestroy: o
|
|
1454
1509
|
}),
|
|
1455
1510
|
n
|
|
1456
1511
|
);
|
|
1457
1512
|
}), i) : (k(
|
|
1458
|
-
a(
|
|
1513
|
+
a(S, {
|
|
1459
1514
|
options: { url: "", name: s("common.附件预览") },
|
|
1460
1515
|
title: s("common.附件预览未初始化"),
|
|
1461
1516
|
desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
|
|
1462
1517
|
spinning: !1,
|
|
1463
|
-
onDestroy:
|
|
1518
|
+
onDestroy: o
|
|
1464
1519
|
}),
|
|
1465
1520
|
n
|
|
1466
1521
|
), i);
|
|
1467
1522
|
}
|
|
1468
|
-
const
|
|
1469
|
-
openByParams:
|
|
1470
|
-
setup:
|
|
1523
|
+
const st = Object.assign(ve, {
|
|
1524
|
+
openByParams: et,
|
|
1525
|
+
setup: $e
|
|
1471
1526
|
});
|
|
1472
1527
|
export {
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1528
|
+
st as J,
|
|
1529
|
+
et as a,
|
|
1530
|
+
$e as b,
|
|
1531
|
+
it as g,
|
|
1532
|
+
rt as i,
|
|
1533
|
+
N as n,
|
|
1534
|
+
ot as r,
|
|
1535
|
+
at as s,
|
|
1481
1536
|
s as t
|
|
1482
1537
|
};
|