@jt-home/mfe-components 1.0.61 → 1.0.62-beta.0
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 +2 -1
- package/dist/JtAttachmentPreview/index.mjs +6 -4
- package/dist/{index-D67nILVt.js → index-BdgCXrMw.js} +453 -667
- package/dist/index-DtqPcdZG.cjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1718 -1717
- package/dist/style.css +1 -1
- package/dist/types/components/JtAttachmentPreview/index.d.ts +3 -3
- package/dist/types/components/JtAttachmentPreview/types.d.ts +6 -4
- package/dist/types/components/form/types.d.ts +1 -4
- package/dist/types/components/globalInfo/model/slotIdentity.d.ts +1 -1
- package/dist/types/components/globalInfo/model/types.d.ts +1 -1
- package/dist/types/main.d.ts +1 -0
- package/package.json +6 -5
- package/readme.md +694 -694
- package/dist/JtAttachmentPreview/style.css +0 -1
- package/dist/index-DEbU13vV.cjs +0 -1
- package/dist/pdf-BmBuG7of.js +0 -18058
- package/dist/pdf-Da0bm_Ya.cjs +0 -55
- package/dist/pdf.worker.min-4PI-nNLo.js +0 -4
- package/dist/pdf.worker.min-BAJUPwg6.cjs +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ElIcon as
|
|
3
|
-
|
|
1
|
+
import { ref as D, isRef as Q, watch as I, defineAsyncComponent as me, defineComponent as T, h as o, computed as b, onMounted as z, onBeforeUnmount as J, render as p } from "vue";
|
|
2
|
+
import { ElIcon as _ } from "element-plus";
|
|
3
|
+
import { ZoomOut as fe, ZoomIn as pe, RefreshLeft as ve, Download as he } from "@element-plus/icons-vue";
|
|
4
|
+
const we = {
|
|
4
5
|
common: {
|
|
5
6
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
|
|
6
7
|
PDF加载中___: "PDF 加载中...",
|
|
@@ -56,7 +57,7 @@ const be = {
|
|
|
56
57
|
附件预览: "附件预览",
|
|
57
58
|
附件预览未初始化: "附件预览未初始化"
|
|
58
59
|
}
|
|
59
|
-
},
|
|
60
|
+
}, ge = {
|
|
60
61
|
common: {
|
|
61
62
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "Cannot read file via PDF.js; switched to browser preview",
|
|
62
63
|
PDF加载中___: "Loading PDF...",
|
|
@@ -112,7 +113,7 @@ const be = {
|
|
|
112
113
|
附件预览: "Attachment Preview",
|
|
113
114
|
附件预览未初始化: "Attachment preview not initialized"
|
|
114
115
|
}
|
|
115
|
-
},
|
|
116
|
+
}, be = {
|
|
116
117
|
common: {
|
|
117
118
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในเบราว์เซอร์แล้ว",
|
|
118
119
|
PDF加载中___: "กำลังโหลด PDF...",
|
|
@@ -168,7 +169,7 @@ const be = {
|
|
|
168
169
|
附件预览: "ตัวอย่างไฟล์แนบ",
|
|
169
170
|
附件预览未初始化: "ยังไม่ได้เริ่มต้นการแสดงตัวอย่างไฟล์แนบ"
|
|
170
171
|
}
|
|
171
|
-
},
|
|
172
|
+
}, ye = {
|
|
172
173
|
common: {
|
|
173
174
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không đọc được tệp, đã chuyển sang xem trước bằng trình duyệt",
|
|
174
175
|
PDF加载中___: "Đang tải PDF...",
|
|
@@ -224,7 +225,7 @@ const be = {
|
|
|
224
225
|
附件预览: "Xem trước tệp đính kèm",
|
|
225
226
|
附件预览未初始化: "Chưa khởi tạo xem trước tệp đính kèm"
|
|
226
227
|
}
|
|
227
|
-
},
|
|
228
|
+
}, Ae = {
|
|
228
229
|
common: {
|
|
229
230
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer el archivo; se cambió a vista previa del navegador",
|
|
230
231
|
PDF加载中___: "Cargando PDF...",
|
|
@@ -336,7 +337,7 @@ const be = {
|
|
|
336
337
|
附件预览: "Pratinjau Lampiran",
|
|
337
338
|
附件预览未初始化: "Pratinjau lampiran belum diinisialisasi"
|
|
338
339
|
}
|
|
339
|
-
},
|
|
340
|
+
}, Pe = {
|
|
340
341
|
common: {
|
|
341
342
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "Datei kann nicht mit PDF.js gelesen werden; Browser-Vorschau aktiviert",
|
|
342
343
|
PDF加载中___: "PDF wird geladen...",
|
|
@@ -392,7 +393,7 @@ const be = {
|
|
|
392
393
|
附件预览: "Anhangsvorschau",
|
|
393
394
|
附件预览未初始化: "Anhangsvorschau nicht initialisiert"
|
|
394
395
|
}
|
|
395
|
-
},
|
|
396
|
+
}, ke = {
|
|
396
397
|
common: {
|
|
397
398
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não consegue ler o arquivo; alterado para visualização do navegador",
|
|
398
399
|
PDF加载中___: "Carregando PDF...",
|
|
@@ -448,7 +449,7 @@ const be = {
|
|
|
448
449
|
附件预览: "Visualização de anexo",
|
|
449
450
|
附件预览未初始化: "Visualização de anexo não inicializada"
|
|
450
451
|
}
|
|
451
|
-
},
|
|
452
|
+
}, je = {
|
|
452
453
|
common: {
|
|
453
454
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js មិនអាចអានឯកសារបានទេ បានប្តូរទៅជាមើលជាមុនក្នុងកម្មវិធីរុករក",
|
|
454
455
|
PDF加载中___: "កំពុងផ្ទុក PDF...",
|
|
@@ -504,17 +505,17 @@ const be = {
|
|
|
504
505
|
附件预览: "មើលឯកសារភ្ជាប់ជាមុន",
|
|
505
506
|
附件预览未初始化: "ការមើលឯកសារភ្ជាប់ជាមុនមិនទាន់ត្រូវបានចាប់ផ្តើមទេ"
|
|
506
507
|
}
|
|
507
|
-
},
|
|
508
|
-
"zh-cn":
|
|
509
|
-
en:
|
|
510
|
-
th:
|
|
511
|
-
vi:
|
|
512
|
-
es:
|
|
508
|
+
}, Ee = {
|
|
509
|
+
"zh-cn": we,
|
|
510
|
+
en: ge,
|
|
511
|
+
th: be,
|
|
512
|
+
vi: ye,
|
|
513
|
+
es: Ae,
|
|
513
514
|
id: De,
|
|
514
|
-
de:
|
|
515
|
-
pt:
|
|
516
|
-
km:
|
|
517
|
-
},
|
|
515
|
+
de: Pe,
|
|
516
|
+
pt: ke,
|
|
517
|
+
km: je
|
|
518
|
+
}, E = [
|
|
518
519
|
{ key: "zh", label: "简体中文", displayLabel: "简体中文", elementPlusLocale: "zh-cn" },
|
|
519
520
|
{ key: "en", label: "英语", displayLabel: "English", elementPlusLocale: "en" },
|
|
520
521
|
{ key: "th", label: "泰语", displayLabel: "ไทย", elementPlusLocale: "th" },
|
|
@@ -526,9 +527,9 @@ const be = {
|
|
|
526
527
|
{ key: "km", label: "柬埔寨语", displayLabel: "ភាសាខ្មែរ", elementPlusLocale: "km" }
|
|
527
528
|
];
|
|
528
529
|
Object.freeze(
|
|
529
|
-
Object.fromEntries(
|
|
530
|
+
Object.fromEntries(E.map((e) => [e.key, e.elementPlusLocale]))
|
|
530
531
|
);
|
|
531
|
-
const
|
|
532
|
+
const _e = Object.freeze({
|
|
532
533
|
zh: "ZHS",
|
|
533
534
|
en: "ENG",
|
|
534
535
|
id: "IDN",
|
|
@@ -540,27 +541,27 @@ const Re = Object.freeze({
|
|
|
540
541
|
km: "CAM"
|
|
541
542
|
});
|
|
542
543
|
Object.freeze(
|
|
543
|
-
Object.fromEntries(Object.entries(
|
|
544
|
+
Object.fromEntries(Object.entries(_e).map(([e, t]) => [t, e]))
|
|
544
545
|
);
|
|
545
|
-
function
|
|
546
|
-
const
|
|
547
|
-
return
|
|
546
|
+
function Le(e, t = {}) {
|
|
547
|
+
const n = t.fallback ?? "zh", r = Ce(t.languageList), a = e.toLowerCase();
|
|
548
|
+
return r.find((i) => i.key === a) ?? r.find((i) => i.key === n) ?? E[0];
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
-
return
|
|
550
|
+
function Re(e, t = {}) {
|
|
551
|
+
return Le(e, t).elementPlusLocale;
|
|
551
552
|
}
|
|
552
553
|
function Ce(e) {
|
|
553
554
|
return e != null && e.length ? e.map((t) => {
|
|
554
|
-
const
|
|
555
|
+
const n = t.key ?? t.value, r = E.find((a) => a.key === n) ?? E[0];
|
|
555
556
|
return {
|
|
556
|
-
...
|
|
557
|
+
...r,
|
|
557
558
|
...t,
|
|
558
|
-
key:
|
|
559
|
-
elementPlusLocale: t.elementPlusLocale ??
|
|
559
|
+
key: r.key,
|
|
560
|
+
elementPlusLocale: t.elementPlusLocale ?? r.elementPlusLocale
|
|
560
561
|
};
|
|
561
|
-
}) :
|
|
562
|
+
}) : E;
|
|
562
563
|
}
|
|
563
|
-
const
|
|
564
|
+
const Te = {
|
|
564
565
|
"zh-hans": "zh",
|
|
565
566
|
"zh-cn": "zh",
|
|
566
567
|
cn: "zh",
|
|
@@ -574,122 +575,64 @@ const Be = {
|
|
|
574
575
|
"pt-br": "pt",
|
|
575
576
|
"km-kh": "km"
|
|
576
577
|
};
|
|
577
|
-
function
|
|
578
|
+
function L(e) {
|
|
578
579
|
const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
|
|
579
|
-
return Te
|
|
580
|
+
return Re(Te[t] || t) || "zh-cn";
|
|
580
581
|
}
|
|
581
|
-
const
|
|
582
|
-
let
|
|
583
|
-
function
|
|
584
|
-
|
|
582
|
+
const y = D("zh-cn");
|
|
583
|
+
let U;
|
|
584
|
+
function M() {
|
|
585
|
+
U?.(), U = void 0;
|
|
585
586
|
}
|
|
586
|
-
function
|
|
587
|
-
return e ? typeof e == "function" ?
|
|
587
|
+
function V(e) {
|
|
588
|
+
return e ? typeof e == "function" ? L(e()) : Q(e) ? L(e.value) : L(e) : y.value;
|
|
588
589
|
}
|
|
589
|
-
function
|
|
590
|
+
function Be(e, t) {
|
|
590
591
|
if (e)
|
|
591
|
-
return t.split(".").reduce((
|
|
592
|
-
if (!(!
|
|
593
|
-
return
|
|
592
|
+
return t.split(".").reduce((n, r) => {
|
|
593
|
+
if (!(!n || typeof n != "object"))
|
|
594
|
+
return n[r];
|
|
594
595
|
}, e);
|
|
595
596
|
}
|
|
596
|
-
function
|
|
597
|
-
const
|
|
598
|
-
return typeof
|
|
597
|
+
function K(e, t) {
|
|
598
|
+
const n = Be(Ee[e], t);
|
|
599
|
+
return typeof n == "string" ? n : void 0;
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
-
return t ? e.replace(/\{(\w+)\}/g, (
|
|
602
|
-
const
|
|
603
|
-
return
|
|
601
|
+
function Fe(e, t) {
|
|
602
|
+
return t ? e.replace(/\{(\w+)\}/g, (n, r) => {
|
|
603
|
+
const a = t[r];
|
|
604
|
+
return a == null ? n : String(a);
|
|
604
605
|
}) : e;
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
607
|
+
function at(e) {
|
|
608
|
+
M(), y.value = L(e);
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
-
return
|
|
610
|
+
function ot() {
|
|
611
|
+
return y.value;
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
-
|
|
613
|
+
function rt() {
|
|
614
|
+
M(), y.value = "zh-cn";
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
-
if (
|
|
617
|
-
if (typeof t.locale == "function" ||
|
|
618
|
-
|
|
619
|
-
() =>
|
|
620
|
-
(
|
|
621
|
-
|
|
616
|
+
function it(e, t = {}) {
|
|
617
|
+
if (M(), t.locale) {
|
|
618
|
+
if (typeof t.locale == "function" || Q(t.locale)) {
|
|
619
|
+
U = I(
|
|
620
|
+
() => V(t.locale),
|
|
621
|
+
(n) => {
|
|
622
|
+
y.value = n;
|
|
622
623
|
},
|
|
623
624
|
{ immediate: !0, flush: "sync" }
|
|
624
625
|
);
|
|
625
626
|
return;
|
|
626
627
|
}
|
|
627
|
-
|
|
628
|
+
y.value = V(t.locale);
|
|
628
629
|
}
|
|
629
630
|
}
|
|
630
|
-
function
|
|
631
|
-
const
|
|
632
|
-
return
|
|
631
|
+
function s(e, t = e, n) {
|
|
632
|
+
const r = t || e, a = y.value, i = K(a, e) || K("zh-cn", e) || r || e;
|
|
633
|
+
return Fe(i, n);
|
|
633
634
|
}
|
|
634
|
-
|
|
635
|
-
var Ie = /* @__PURE__ */ R({
|
|
636
|
-
name: "Download",
|
|
637
|
-
__name: "download",
|
|
638
|
-
setup(e) {
|
|
639
|
-
return (t, a) => (N(), q("svg", {
|
|
640
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
641
|
-
viewBox: "0 0 1024 1024"
|
|
642
|
-
}, [
|
|
643
|
-
V("path", {
|
|
644
|
-
fill: "currentColor",
|
|
645
|
-
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"
|
|
646
|
-
})
|
|
647
|
-
]));
|
|
648
|
-
}
|
|
649
|
-
}), Me = Ie, ze = /* @__PURE__ */ R({
|
|
650
|
-
name: "RefreshLeft",
|
|
651
|
-
__name: "refresh-left",
|
|
652
|
-
setup(e) {
|
|
653
|
-
return (t, a) => (N(), q("svg", {
|
|
654
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
655
|
-
viewBox: "0 0 1024 1024"
|
|
656
|
-
}, [
|
|
657
|
-
V("path", {
|
|
658
|
-
fill: "currentColor",
|
|
659
|
-
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"
|
|
660
|
-
})
|
|
661
|
-
]));
|
|
662
|
-
}
|
|
663
|
-
}), Ue = ze, Je = /* @__PURE__ */ R({
|
|
664
|
-
name: "ZoomIn",
|
|
665
|
-
__name: "zoom-in",
|
|
666
|
-
setup(e) {
|
|
667
|
-
return (t, a) => (N(), q("svg", {
|
|
668
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
669
|
-
viewBox: "0 0 1024 1024"
|
|
670
|
-
}, [
|
|
671
|
-
V("path", {
|
|
672
|
-
fill: "currentColor",
|
|
673
|
-
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"
|
|
674
|
-
})
|
|
675
|
-
]));
|
|
676
|
-
}
|
|
677
|
-
}), Oe = Je, Ye = /* @__PURE__ */ R({
|
|
678
|
-
name: "ZoomOut",
|
|
679
|
-
__name: "zoom-out",
|
|
680
|
-
setup(e) {
|
|
681
|
-
return (t, a) => (N(), q("svg", {
|
|
682
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
683
|
-
viewBox: "0 0 1024 1024"
|
|
684
|
-
}, [
|
|
685
|
-
V("path", {
|
|
686
|
-
fill: "currentColor",
|
|
687
|
-
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"
|
|
688
|
-
})
|
|
689
|
-
]));
|
|
690
|
-
}
|
|
691
|
-
}), Ne = Ye;
|
|
692
|
-
const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoY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onPCG5ugnCLBoN6qUmXQ0Ta/5MWAx+wuVjv1L+K/xHgNmspxSqbAuMcL0DAaMxRopCn2UWPJj+3/NJutXiYGAWaxUI/0qkbndKQhYXJTK50j9wYDF7Me+LQKBVWc2of5gwNis1kzdAYGt3nIJdQcDFpM9DTF1BgQ2u1fja2dAYMHbLqHOgMDCsW352w8iCKweWDHffhBBYOyba2Nabz+IKDB3eFk+36+IILDQXPlQRnpdKLC0d+W9sjMoMN8kJY04woEC+6kbJY05dIMC86OPSaHA0ugREQWWR7tQYP/atZcUBmEoCsNHA4FEBxHvyKJQ7P7X2EGdlHbiNYNjON8OfvIkZP2Zi9tqV7CE2V77TyxL2PdkXJ52GUuYvZbKL1IsYcfr9GPbq2WxhJ2gMIUpTGEcFKYwEgpTGAmFKYyEwhRGQmEKI+EJy3YDCeeNdgOesMH4ZTgk4zfAoxi9GR6dsctwCfRD1sNnNm7HCmtuY8wRH42dZSXCL/CW5QQcmtoax4iLIuOglQkVpIHrPlzGPqCSNE8diT4FiIiIiIjIP2/v9e/hKQXqEwAAAABJRU5ErkJggg==", xe = /* @__PURE__ */ new Set([
|
|
693
636
|
"jpg",
|
|
694
637
|
"jpeg",
|
|
695
638
|
"png",
|
|
@@ -699,7 +642,7 @@ const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
699
642
|
"svg",
|
|
700
643
|
"avif",
|
|
701
644
|
"ico"
|
|
702
|
-
]),
|
|
645
|
+
]), Ie = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), ze = /* @__PURE__ */ new Set([
|
|
703
646
|
"mp3",
|
|
704
647
|
"wav",
|
|
705
648
|
"ogg",
|
|
@@ -707,7 +650,7 @@ const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
707
650
|
"m4a",
|
|
708
651
|
"aac",
|
|
709
652
|
"flac"
|
|
710
|
-
]),
|
|
653
|
+
]), Je = /* @__PURE__ */ new Set([
|
|
711
654
|
"html",
|
|
712
655
|
"htm",
|
|
713
656
|
"txt",
|
|
@@ -716,7 +659,7 @@ const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
716
659
|
"csv",
|
|
717
660
|
"md",
|
|
718
661
|
"log"
|
|
719
|
-
]),
|
|
662
|
+
]), Me = /* @__PURE__ */ new Set([
|
|
720
663
|
"doc",
|
|
721
664
|
"docx",
|
|
722
665
|
"xls",
|
|
@@ -726,150 +669,133 @@ const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
726
669
|
"zip",
|
|
727
670
|
"rar",
|
|
728
671
|
"7z"
|
|
729
|
-
]),
|
|
672
|
+
]), x = {
|
|
730
673
|
component: "JtAttachmentPreview",
|
|
731
674
|
marker: "2026-06-25-download-error-detail",
|
|
732
675
|
source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
|
|
733
|
-
pdfLoadMode: "
|
|
676
|
+
pdfLoadMode: "vue-office-pdf-src",
|
|
734
677
|
previewDownloadMode: "openByParams-uses-registered-downloadRequest",
|
|
735
678
|
downloadResponseMode: "supports-blob-and-axios-response-data-blob"
|
|
736
679
|
};
|
|
737
|
-
function
|
|
738
|
-
console.info(`[JtAttachmentPreview DEBUG ${
|
|
739
|
-
...
|
|
680
|
+
function m(e, t) {
|
|
681
|
+
console.info(`[JtAttachmentPreview DEBUG ${x.marker}] ${e}`, {
|
|
682
|
+
...x,
|
|
740
683
|
...t
|
|
741
684
|
});
|
|
742
685
|
}
|
|
743
|
-
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ =
|
|
744
|
-
let
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
import("
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
function
|
|
686
|
+
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = x);
|
|
687
|
+
let v = null, h = null, R = null;
|
|
688
|
+
const Ye = me(
|
|
689
|
+
() => (
|
|
690
|
+
// PDF 渲染依赖体积较大,只在 PDF 预览时加载,避免图片预览静态带入。
|
|
691
|
+
import("@vue-office/pdf").then((e) => e.default)
|
|
692
|
+
)
|
|
693
|
+
);
|
|
694
|
+
function Oe(e) {
|
|
752
695
|
return typeof e == "string" ? { url: e } : e;
|
|
753
696
|
}
|
|
754
|
-
function
|
|
697
|
+
function Z(e) {
|
|
755
698
|
const [t] = e.split(/[?#]/);
|
|
756
699
|
return t ?? "";
|
|
757
700
|
}
|
|
758
|
-
function
|
|
701
|
+
function Y(e, t) {
|
|
759
702
|
if (t?.trim()) return t.trim();
|
|
760
|
-
const
|
|
761
|
-
if (!
|
|
703
|
+
const n = Z(e).split("/").filter(Boolean).pop();
|
|
704
|
+
if (!n) return s("common.附件预览");
|
|
762
705
|
try {
|
|
763
|
-
return decodeURIComponent(
|
|
706
|
+
return decodeURIComponent(n);
|
|
764
707
|
} catch {
|
|
765
|
-
return
|
|
708
|
+
return n;
|
|
766
709
|
}
|
|
767
710
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
711
|
+
function H(e) {
|
|
712
|
+
return Z(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
|
|
770
713
|
}
|
|
771
|
-
function
|
|
714
|
+
function qe(e) {
|
|
772
715
|
return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
|
|
773
716
|
}
|
|
774
|
-
function
|
|
775
|
-
const t =
|
|
776
|
-
return
|
|
717
|
+
function Ne(e) {
|
|
718
|
+
const t = qe(e);
|
|
719
|
+
return xe.has(t) ? "image" : t === "pdf" ? "pdf" : Ie.has(t) ? "video" : ze.has(t) ? "audio" : Je.has(t) ? "iframe" : Me.has(t) ? "unsupported" : "unknown";
|
|
777
720
|
}
|
|
778
|
-
function
|
|
721
|
+
function O(e) {
|
|
779
722
|
const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
780
723
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
|
|
781
724
|
}
|
|
782
|
-
function
|
|
725
|
+
function X(e) {
|
|
783
726
|
if (!e.url.trim()) return "empty";
|
|
784
727
|
if (e.mode && e.mode !== "auto") return e.mode;
|
|
785
728
|
if (e.mimeType) {
|
|
786
|
-
const
|
|
787
|
-
if (
|
|
729
|
+
const n = O(e.mimeType);
|
|
730
|
+
if (n !== "unknown") return n;
|
|
788
731
|
}
|
|
789
|
-
const t =
|
|
790
|
-
e.extension ||
|
|
732
|
+
const t = Ne(
|
|
733
|
+
e.extension || H(e.name || "") || H(e.url)
|
|
791
734
|
);
|
|
792
735
|
return t !== "unknown" ? t : "unknown";
|
|
793
736
|
}
|
|
794
|
-
async function
|
|
737
|
+
async function Ge(e) {
|
|
795
738
|
try {
|
|
796
|
-
const
|
|
797
|
-
return
|
|
739
|
+
const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
|
|
740
|
+
return O(n);
|
|
798
741
|
} catch {
|
|
799
742
|
return "unknown";
|
|
800
743
|
}
|
|
801
744
|
}
|
|
802
|
-
async function
|
|
803
|
-
const
|
|
804
|
-
if (!
|
|
805
|
-
return
|
|
806
|
-
}
|
|
807
|
-
async function at(e) {
|
|
808
|
-
p("fetch-pdf-bytes-start", {
|
|
809
|
-
url: e
|
|
810
|
-
});
|
|
811
|
-
const t = await fetch(e);
|
|
812
|
-
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
813
|
-
const a = new Uint8Array(await t.arrayBuffer());
|
|
814
|
-
return p("fetch-pdf-bytes-done", {
|
|
815
|
-
url: e,
|
|
816
|
-
byteLength: a.byteLength,
|
|
817
|
-
contentType: t.headers.get("content-type") ?? ""
|
|
818
|
-
}), a;
|
|
819
|
-
}
|
|
820
|
-
function nt(e, t) {
|
|
821
|
-
const a = X(t);
|
|
822
|
-
return a === "doc" || a === "docx" ? "W" : a === "xls" || a === "xlsx" ? "X" : a === "ppt" || a === "pptx" ? "P" : a === "zip" || a === "rar" || a === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
|
|
745
|
+
async function $(e, t) {
|
|
746
|
+
const n = await fetch(e, t);
|
|
747
|
+
if (!n.ok) throw new Error(`fetch failed: ${n.status}`);
|
|
748
|
+
return n.blob();
|
|
823
749
|
}
|
|
824
|
-
function
|
|
825
|
-
return
|
|
750
|
+
function ee(e, t, n, r = !1) {
|
|
751
|
+
return o(
|
|
826
752
|
"button",
|
|
827
753
|
{
|
|
828
|
-
class:
|
|
754
|
+
class: n,
|
|
829
755
|
type: "button",
|
|
830
756
|
onClick: () => {
|
|
831
|
-
|
|
757
|
+
m("download-button-click", {
|
|
832
758
|
url: e.url,
|
|
833
759
|
downloadName: t,
|
|
834
|
-
fallbackToRawUrl:
|
|
835
|
-
}),
|
|
836
|
-
fallbackToRawUrl:
|
|
760
|
+
fallbackToRawUrl: r
|
|
761
|
+
}), ne(e, t, {
|
|
762
|
+
fallbackToRawUrl: r
|
|
837
763
|
});
|
|
838
764
|
}
|
|
839
765
|
},
|
|
840
766
|
[
|
|
841
|
-
|
|
842
|
-
|
|
767
|
+
o(
|
|
768
|
+
_,
|
|
843
769
|
{ class: "jt-attachment-preview-service__download-icon" },
|
|
844
|
-
() =>
|
|
770
|
+
() => o(he)
|
|
845
771
|
),
|
|
846
|
-
|
|
772
|
+
o(
|
|
847
773
|
"span",
|
|
848
774
|
{ class: "jt-attachment-preview-service__download-text" },
|
|
849
|
-
|
|
775
|
+
s("common.下载")
|
|
850
776
|
)
|
|
851
777
|
]
|
|
852
778
|
);
|
|
853
779
|
}
|
|
854
|
-
function
|
|
780
|
+
function S(e) {
|
|
855
781
|
return e === "image" || e === "pdf";
|
|
856
782
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
783
|
+
function te(e) {
|
|
784
|
+
return o(
|
|
859
785
|
"div",
|
|
860
786
|
{ class: "jt-attachment-preview-service__preview-fallback" },
|
|
861
787
|
[
|
|
862
|
-
|
|
788
|
+
o("img", {
|
|
863
789
|
class: "jt-attachment-preview-service__preview-fallback-icon",
|
|
864
790
|
src: e.icon,
|
|
865
791
|
alt: ""
|
|
866
792
|
}),
|
|
867
|
-
|
|
793
|
+
o(
|
|
868
794
|
"div",
|
|
869
795
|
{ class: "jt-attachment-preview-service__unsupported-text" },
|
|
870
|
-
|
|
796
|
+
s("common.暂不支持预览此类型的文件")
|
|
871
797
|
),
|
|
872
|
-
|
|
798
|
+
o(
|
|
873
799
|
"div",
|
|
874
800
|
{
|
|
875
801
|
class: "jt-attachment-preview-service__file-name",
|
|
@@ -880,56 +806,56 @@ function ve(e) {
|
|
|
880
806
|
]
|
|
881
807
|
);
|
|
882
808
|
}
|
|
883
|
-
function
|
|
884
|
-
const
|
|
885
|
-
|
|
809
|
+
function q(e, t) {
|
|
810
|
+
const n = document.createElement("a");
|
|
811
|
+
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
|
|
886
812
|
}
|
|
887
|
-
function
|
|
888
|
-
const
|
|
889
|
-
|
|
813
|
+
function N(e, t) {
|
|
814
|
+
const n = URL.createObjectURL(e);
|
|
815
|
+
q(n, t), window.setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
890
816
|
}
|
|
891
|
-
function
|
|
817
|
+
function C(e) {
|
|
892
818
|
return e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
|
|
893
819
|
}
|
|
894
|
-
function
|
|
895
|
-
if (
|
|
820
|
+
function Ve(e, t) {
|
|
821
|
+
if (C(e))
|
|
896
822
|
return e;
|
|
897
823
|
if (e && typeof e == "object") {
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
900
|
-
const
|
|
824
|
+
const n = e;
|
|
825
|
+
if (C(n.data)) {
|
|
826
|
+
const r = n.data;
|
|
901
827
|
return {
|
|
902
|
-
blob:
|
|
903
|
-
name:
|
|
828
|
+
blob: n.data,
|
|
829
|
+
name: n.fileName || n.name || r.name || t
|
|
904
830
|
};
|
|
905
831
|
}
|
|
906
832
|
}
|
|
907
833
|
return null;
|
|
908
834
|
}
|
|
909
|
-
async function
|
|
910
|
-
|
|
835
|
+
async function Ke(e, t, n = {}) {
|
|
836
|
+
m("download-start", {
|
|
911
837
|
url: e,
|
|
912
838
|
downloadName: t,
|
|
913
|
-
fallbackToRawUrl: !!
|
|
914
|
-
hasRequestInit: !!
|
|
839
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl,
|
|
840
|
+
hasRequestInit: !!n.requestInit
|
|
915
841
|
});
|
|
916
842
|
try {
|
|
917
|
-
const
|
|
918
|
-
|
|
843
|
+
const r = await $(e, n.requestInit);
|
|
844
|
+
m("download-blob-ready", {
|
|
919
845
|
url: e,
|
|
920
846
|
downloadName: t,
|
|
921
|
-
blobType:
|
|
922
|
-
blobSize:
|
|
923
|
-
}),
|
|
847
|
+
blobType: r.type,
|
|
848
|
+
blobSize: r.size
|
|
849
|
+
}), N(r, t);
|
|
924
850
|
} catch {
|
|
925
|
-
|
|
851
|
+
m("download-blob-failed", {
|
|
926
852
|
url: e,
|
|
927
853
|
downloadName: t,
|
|
928
|
-
fallbackToRawUrl: !!
|
|
929
|
-
}),
|
|
854
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
855
|
+
}), n.fallbackToRawUrl && q(e, t);
|
|
930
856
|
}
|
|
931
857
|
}
|
|
932
|
-
function
|
|
858
|
+
function W(e, t) {
|
|
933
859
|
return e instanceof Blob ? { blob: e, name: t } : e ? {
|
|
934
860
|
url: e.url,
|
|
935
861
|
blob: e.blob,
|
|
@@ -938,88 +864,88 @@ function ce(e, t) {
|
|
|
938
864
|
fallbackToRawUrl: e.fallbackToRawUrl
|
|
939
865
|
} : null;
|
|
940
866
|
}
|
|
941
|
-
async function
|
|
942
|
-
const
|
|
867
|
+
async function ne(e, t, n = {}) {
|
|
868
|
+
const r = {
|
|
943
869
|
url: e.url,
|
|
944
870
|
name: t,
|
|
945
871
|
params: e.requestParams,
|
|
946
872
|
options: e
|
|
947
873
|
};
|
|
948
874
|
try {
|
|
949
|
-
let
|
|
950
|
-
if (
|
|
875
|
+
let a = null;
|
|
876
|
+
if (m("download-resolve-start", {
|
|
951
877
|
url: e.url,
|
|
952
878
|
downloadName: t,
|
|
953
879
|
hasCustomDownload: !!e.download,
|
|
954
|
-
hasRegisteredDownload: !!
|
|
880
|
+
hasRegisteredDownload: !!h?.downloadRequest,
|
|
955
881
|
useRegisteredDownload: !!e.useRegisteredDownload,
|
|
956
882
|
hasRequestParams: Object.prototype.hasOwnProperty.call(
|
|
957
883
|
e,
|
|
958
884
|
"requestParams"
|
|
959
885
|
)
|
|
960
886
|
}), e.download) {
|
|
961
|
-
|
|
887
|
+
m("download-custom-handler-start", {
|
|
962
888
|
url: e.url,
|
|
963
889
|
downloadName: t
|
|
964
890
|
});
|
|
965
|
-
const l = await e.download(
|
|
966
|
-
if (
|
|
967
|
-
|
|
891
|
+
const l = await e.download(r);
|
|
892
|
+
if (a = W(l, t), !a) {
|
|
893
|
+
m("download-custom-handler-done", {
|
|
968
894
|
url: e.url,
|
|
969
895
|
downloadName: t
|
|
970
896
|
});
|
|
971
897
|
return;
|
|
972
898
|
}
|
|
973
|
-
} else if (e.useRegisteredDownload &&
|
|
974
|
-
|
|
899
|
+
} else if (e.useRegisteredDownload && h?.downloadRequest) {
|
|
900
|
+
m("download-setup-request-start", {
|
|
975
901
|
url: e.url,
|
|
976
902
|
downloadName: t,
|
|
977
903
|
params: e.requestParams
|
|
978
904
|
});
|
|
979
|
-
const l = await
|
|
905
|
+
const l = await h.downloadRequest(
|
|
980
906
|
e.requestParams
|
|
981
907
|
);
|
|
982
|
-
|
|
983
|
-
isBlob:
|
|
984
|
-
isDataBlob: !!l && typeof l == "object" &&
|
|
908
|
+
m("download-request-response", {
|
|
909
|
+
isBlob: C(l),
|
|
910
|
+
isDataBlob: !!l && typeof l == "object" && C(l.data),
|
|
985
911
|
responseType: Object.prototype.toString.call(l)
|
|
986
912
|
});
|
|
987
|
-
const
|
|
913
|
+
const f = Ve(l, t), d = f || (h.mapDownloadResponse ? h.mapDownloadResponse(
|
|
988
914
|
l,
|
|
989
915
|
e.requestParams
|
|
990
916
|
) : l);
|
|
991
|
-
|
|
917
|
+
a = W(d, t);
|
|
992
918
|
}
|
|
993
|
-
if (
|
|
994
|
-
|
|
995
|
-
downloadName:
|
|
996
|
-
blobType:
|
|
997
|
-
blobSize:
|
|
998
|
-
}),
|
|
919
|
+
if (a?.blob) {
|
|
920
|
+
m("download-result-blob", {
|
|
921
|
+
downloadName: a.name,
|
|
922
|
+
blobType: a.blob.type,
|
|
923
|
+
blobSize: a.blob.size
|
|
924
|
+
}), N(a.blob, a.name);
|
|
999
925
|
return;
|
|
1000
926
|
}
|
|
1001
|
-
const i =
|
|
1002
|
-
await
|
|
1003
|
-
requestInit:
|
|
1004
|
-
fallbackToRawUrl:
|
|
927
|
+
const i = a?.url || e.downloadUrl || e.url, u = a?.name || t;
|
|
928
|
+
await Ke(i, u, {
|
|
929
|
+
requestInit: a?.requestInit || e.downloadRequestInit,
|
|
930
|
+
fallbackToRawUrl: a?.fallbackToRawUrl ?? e.downloadFallbackToRawUrl ?? n.fallbackToRawUrl
|
|
1005
931
|
});
|
|
1006
|
-
} catch (
|
|
1007
|
-
|
|
932
|
+
} catch (a) {
|
|
933
|
+
m("download-handler-failed", {
|
|
1008
934
|
url: e.url,
|
|
1009
935
|
downloadName: t,
|
|
1010
|
-
errorName:
|
|
1011
|
-
errorMessage:
|
|
1012
|
-
errorStack:
|
|
1013
|
-
errorResponseStatus:
|
|
1014
|
-
errorResponseType:
|
|
1015
|
-
|
|
936
|
+
errorName: a instanceof Error ? a.name : "",
|
|
937
|
+
errorMessage: a instanceof Error ? a.message : String(a),
|
|
938
|
+
errorStack: a instanceof Error ? a.stack : "",
|
|
939
|
+
errorResponseStatus: a && typeof a == "object" ? a.response?.status : void 0,
|
|
940
|
+
errorResponseType: a && typeof a == "object" ? Object.prototype.toString.call(
|
|
941
|
+
a.response?.data
|
|
1016
942
|
) : void 0,
|
|
1017
|
-
errorResponseDataType:
|
|
1018
|
-
}),
|
|
943
|
+
errorResponseDataType: a && typeof a == "object" ? a.response?.data?.type : void 0
|
|
944
|
+
}), n.fallbackToRawUrl && q(e.downloadUrl || e.url, t);
|
|
1019
945
|
}
|
|
1020
946
|
}
|
|
1021
|
-
const
|
|
1022
|
-
name: "
|
|
947
|
+
const He = T({
|
|
948
|
+
name: "JtAttachmentPreviewPdfOffice",
|
|
1023
949
|
props: {
|
|
1024
950
|
url: {
|
|
1025
951
|
type: String,
|
|
@@ -1043,159 +969,34 @@ const it = R({
|
|
|
1043
969
|
previewError: (e) => e instanceof Event
|
|
1044
970
|
},
|
|
1045
971
|
setup(e, { emit: t }) {
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
if (!d) return null;
|
|
1050
|
-
const g = typeof d == "string" ? await s.getDestination(d) : d;
|
|
1051
|
-
return !Array.isArray(g) || !g[0] ? null : await s.getPageIndex(g[0]) + 1;
|
|
1052
|
-
}
|
|
1053
|
-
async function A(s, d, g = 0) {
|
|
1054
|
-
if (!d?.length) return [];
|
|
1055
|
-
const b = [];
|
|
1056
|
-
for (const E of d) {
|
|
1057
|
-
const F = await v(s, E.dest);
|
|
1058
|
-
b.push({
|
|
1059
|
-
title: E.title || c("common.未命名标题"),
|
|
1060
|
-
pageNumber: F,
|
|
1061
|
-
level: g
|
|
1062
|
-
});
|
|
1063
|
-
const T = await A(s, E.items, g + 1);
|
|
1064
|
-
b.push(...T);
|
|
1065
|
-
}
|
|
1066
|
-
return b;
|
|
972
|
+
const n = D("ready");
|
|
973
|
+
function r() {
|
|
974
|
+
n.value = "ready", t("previewLoad", new Event("load"));
|
|
1067
975
|
}
|
|
1068
|
-
function
|
|
1069
|
-
|
|
1070
|
-
for (const s of h)
|
|
1071
|
-
s.cancel();
|
|
1072
|
-
h = [], l?.destroy(), l = null, i.clear();
|
|
976
|
+
function a() {
|
|
977
|
+
n.value = "error", t("previewError", new Event("error"));
|
|
1073
978
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
try {
|
|
1079
|
-
const d = await Ze();
|
|
1080
|
-
if (s !== f) return;
|
|
1081
|
-
const g = await at(e.url);
|
|
1082
|
-
if (s !== f) return;
|
|
1083
|
-
p("render-pdf-get-document-data", {
|
|
1084
|
-
byteLength: g.byteLength
|
|
1085
|
-
}), l = d.getDocument({ data: g });
|
|
1086
|
-
const b = await l.promise;
|
|
1087
|
-
if (s !== f) return;
|
|
1088
|
-
o.value = Array.from(
|
|
1089
|
-
{ length: b.numPages },
|
|
1090
|
-
(T, C) => C + 1
|
|
1091
|
-
), n.value = await A(
|
|
1092
|
-
b,
|
|
1093
|
-
await b.getOutline()
|
|
1094
|
-
), await ge();
|
|
1095
|
-
const E = i.values().next().value, F = Math.max(
|
|
1096
|
-
(E?.parentElement?.clientWidth ?? 800) - 32,
|
|
1097
|
-
320
|
|
1098
|
-
);
|
|
1099
|
-
for (const T of o.value) {
|
|
1100
|
-
if (s !== f) return;
|
|
1101
|
-
const C = await b.getPage(T), y = i.get(T), S = y?.getContext("2d");
|
|
1102
|
-
if (!y || !S) continue;
|
|
1103
|
-
const H = C.getViewport({ scale: 1 }), m = Math.min(F / H.width, 2), I = C.getViewport({ scale: m }), U = window.devicePixelRatio || 1;
|
|
1104
|
-
y.width = Math.floor(I.width * U), y.height = Math.floor(I.height * U), y.style.width = `${Math.floor(I.width)}px`, y.style.height = `${Math.floor(I.height)}px`, S.setTransform(U, 0, 0, U, 0, 0);
|
|
1105
|
-
const ie = C.render({
|
|
1106
|
-
canvas: y,
|
|
1107
|
-
canvasContext: S,
|
|
1108
|
-
viewport: I
|
|
1109
|
-
});
|
|
1110
|
-
h.push(ie), await ie.promise;
|
|
1111
|
-
}
|
|
1112
|
-
if (s !== f) return;
|
|
1113
|
-
a.value = "ready", t("previewLoad", new Event("load"));
|
|
1114
|
-
} catch (d) {
|
|
1115
|
-
if (s !== f) return;
|
|
1116
|
-
a.value = "error", u.value = d instanceof Error ? d.message : c("common.PDF加载失败"), t("previewError", new Event("error"));
|
|
979
|
+
return I(
|
|
980
|
+
() => e.url,
|
|
981
|
+
() => {
|
|
982
|
+
n.value = "ready";
|
|
1117
983
|
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
}
|
|
1124
|
-
return () => r("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
1125
|
-
a.value === "loading" ? r(
|
|
1126
|
-
"div",
|
|
1127
|
-
{ class: "jt-attachment-preview-service__pdf-state" },
|
|
1128
|
-
c("common.PDF加载中___")
|
|
1129
|
-
) : null,
|
|
1130
|
-
a.value === "error" ? r("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
1131
|
-
ve({
|
|
1132
|
-
icon: Ve,
|
|
984
|
+
), () => o("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
985
|
+
// PDF 预览只负责把现有 URL 交给 vue-office,下载和接口适配仍由外层服务处理。
|
|
986
|
+
n.value === "error" ? o("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
987
|
+
te({
|
|
988
|
+
icon: Ue,
|
|
1133
989
|
name: e.name
|
|
1134
990
|
})
|
|
1135
|
-
]) :
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
class: [
|
|
1142
|
-
"jt-attachment-preview-service__pdf-layout",
|
|
1143
|
-
a.value !== "ready" ? "jt-attachment-preview-service__pdf-layout--hidden" : ""
|
|
1144
|
-
]
|
|
1145
|
-
},
|
|
1146
|
-
[
|
|
1147
|
-
n.value.length ? r(
|
|
1148
|
-
"aside",
|
|
1149
|
-
{ class: "jt-attachment-preview-service__pdf-outline" },
|
|
1150
|
-
[
|
|
1151
|
-
r(
|
|
1152
|
-
"div",
|
|
1153
|
-
{
|
|
1154
|
-
class: "jt-attachment-preview-service__pdf-outline-title"
|
|
1155
|
-
},
|
|
1156
|
-
c("common.目录")
|
|
1157
|
-
),
|
|
1158
|
-
r(
|
|
1159
|
-
"div",
|
|
1160
|
-
{
|
|
1161
|
-
class: "jt-attachment-preview-service__pdf-outline-list"
|
|
1162
|
-
},
|
|
1163
|
-
n.value.map(
|
|
1164
|
-
(s, d) => r(
|
|
1165
|
-
"button",
|
|
1166
|
-
{
|
|
1167
|
-
key: `${s.title}-${d}`,
|
|
1168
|
-
class: "jt-attachment-preview-service__pdf-outline-item",
|
|
1169
|
-
style: { paddingLeft: `${12 + s.level * 14}px` },
|
|
1170
|
-
type: "button",
|
|
1171
|
-
disabled: !s.pageNumber,
|
|
1172
|
-
title: s.title,
|
|
1173
|
-
onClick: () => _(s.pageNumber)
|
|
1174
|
-
},
|
|
1175
|
-
s.title
|
|
1176
|
-
)
|
|
1177
|
-
)
|
|
1178
|
-
)
|
|
1179
|
-
]
|
|
1180
|
-
) : null,
|
|
1181
|
-
r(
|
|
1182
|
-
"div",
|
|
1183
|
-
{ class: "jt-attachment-preview-service__pdf-pages" },
|
|
1184
|
-
o.value.map(
|
|
1185
|
-
(s) => r("canvas", {
|
|
1186
|
-
key: s,
|
|
1187
|
-
ref: (d) => {
|
|
1188
|
-
d instanceof HTMLCanvasElement && i.set(s, d);
|
|
1189
|
-
},
|
|
1190
|
-
class: "jt-attachment-preview-service__pdf-page"
|
|
1191
|
-
})
|
|
1192
|
-
)
|
|
1193
|
-
)
|
|
1194
|
-
]
|
|
1195
|
-
)
|
|
991
|
+
]) : o(Ye, {
|
|
992
|
+
class: "jt-attachment-preview-service__pdf-document",
|
|
993
|
+
src: e.url,
|
|
994
|
+
onRendered: r,
|
|
995
|
+
onError: a
|
|
996
|
+
})
|
|
1196
997
|
]);
|
|
1197
998
|
}
|
|
1198
|
-
}),
|
|
999
|
+
}), We = T({
|
|
1199
1000
|
name: "JtAttachmentPreviewImageTransform",
|
|
1200
1001
|
props: {
|
|
1201
1002
|
url: {
|
|
@@ -1224,130 +1025,130 @@ const it = R({
|
|
|
1224
1025
|
previewError: (e) => e instanceof Event
|
|
1225
1026
|
},
|
|
1226
1027
|
setup(e, { emit: t }) {
|
|
1227
|
-
const
|
|
1228
|
-
let u = 0, l = 0,
|
|
1229
|
-
const
|
|
1028
|
+
const n = D(null), r = D("ready"), a = D(1), i = D(!1);
|
|
1029
|
+
let u = 0, l = 0, f = 0, d = 0, P = 0, A = 0, w = 0;
|
|
1030
|
+
const k = b(
|
|
1230
1031
|
() => ({
|
|
1231
1032
|
"--jt-attachment-preview-service-image-fit": e.fit,
|
|
1232
|
-
transform: `translate(${u}px, ${l}px) scale(${
|
|
1033
|
+
transform: `translate(${u}px, ${l}px) scale(${a.value})`
|
|
1233
1034
|
})
|
|
1234
1035
|
);
|
|
1235
|
-
function
|
|
1236
|
-
|
|
1036
|
+
function g() {
|
|
1037
|
+
n.value && (n.value.style.transform = `translate(${u}px, ${l}px) scale(${a.value})`);
|
|
1237
1038
|
}
|
|
1238
|
-
function
|
|
1039
|
+
function oe() {
|
|
1239
1040
|
w || (w = window.requestAnimationFrame(() => {
|
|
1240
|
-
w = 0,
|
|
1041
|
+
w = 0, g();
|
|
1241
1042
|
}));
|
|
1242
1043
|
}
|
|
1243
|
-
function
|
|
1244
|
-
|
|
1044
|
+
function B(c) {
|
|
1045
|
+
a.value = Math.min(Math.max(Number(c.toFixed(2)), 0.2), 5), a.value <= 1 && (u = 0, l = 0), g();
|
|
1245
1046
|
}
|
|
1246
|
-
function
|
|
1247
|
-
|
|
1047
|
+
function re() {
|
|
1048
|
+
B(a.value + 0.2);
|
|
1248
1049
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1050
|
+
function ie() {
|
|
1051
|
+
const c = Math.max(Number((a.value - 0.2).toFixed(2)), 0.2);
|
|
1052
|
+
a.value = c, c <= 1 && (u = 0, l = 0), g();
|
|
1252
1053
|
}
|
|
1253
|
-
function
|
|
1254
|
-
u = 0, l = 0,
|
|
1054
|
+
function G() {
|
|
1055
|
+
u = 0, l = 0, B(1);
|
|
1255
1056
|
}
|
|
1256
|
-
function
|
|
1257
|
-
|
|
1057
|
+
function le(c) {
|
|
1058
|
+
r.value = "ready", t("previewLoad", c);
|
|
1258
1059
|
}
|
|
1259
|
-
function
|
|
1260
|
-
|
|
1060
|
+
function se(c) {
|
|
1061
|
+
r.value = "error", t("previewError", c);
|
|
1261
1062
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1063
|
+
function ce(c) {
|
|
1064
|
+
a.value <= 1 || (c.preventDefault(), i.value = !0, f = c.clientX, d = c.clientY, P = u, A = l, window.addEventListener("pointermove", F), window.addEventListener("pointerup", ue, { once: !0 }));
|
|
1264
1065
|
}
|
|
1265
|
-
function
|
|
1266
|
-
i.value && (u =
|
|
1066
|
+
function F(c) {
|
|
1067
|
+
i.value && (u = P + c.clientX - f, l = A + c.clientY - d, oe());
|
|
1267
1068
|
}
|
|
1268
|
-
function
|
|
1269
|
-
i.value = !1, window.removeEventListener("pointermove",
|
|
1069
|
+
function ue() {
|
|
1070
|
+
i.value = !1, window.removeEventListener("pointermove", F);
|
|
1270
1071
|
}
|
|
1271
|
-
function
|
|
1272
|
-
|
|
1072
|
+
function de(c) {
|
|
1073
|
+
c.preventDefault(), B(a.value + (c.deltaY < 0 ? 0.1 : -0.1));
|
|
1273
1074
|
}
|
|
1274
|
-
return
|
|
1075
|
+
return z(g), I(
|
|
1275
1076
|
() => e.url,
|
|
1276
1077
|
() => {
|
|
1277
|
-
|
|
1078
|
+
r.value = "ready", G();
|
|
1278
1079
|
}
|
|
1279
|
-
),
|
|
1280
|
-
window.removeEventListener("pointermove",
|
|
1281
|
-
}), () =>
|
|
1080
|
+
), J(() => {
|
|
1081
|
+
window.removeEventListener("pointermove", F), w && window.cancelAnimationFrame(w);
|
|
1082
|
+
}), () => o(
|
|
1282
1083
|
"div",
|
|
1283
1084
|
{ class: "jt-attachment-preview-service__image-viewer" },
|
|
1284
|
-
|
|
1285
|
-
icon:
|
|
1085
|
+
r.value === "error" ? te({
|
|
1086
|
+
icon: Se,
|
|
1286
1087
|
name: e.name
|
|
1287
1088
|
}) : [
|
|
1288
|
-
|
|
1289
|
-
ref:
|
|
1089
|
+
o("img", {
|
|
1090
|
+
ref: n,
|
|
1290
1091
|
class: [
|
|
1291
1092
|
"jt-attachment-preview-service__media",
|
|
1292
1093
|
"jt-attachment-preview-service__image",
|
|
1293
|
-
|
|
1094
|
+
a.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
|
|
1294
1095
|
i.value ? "jt-attachment-preview-service__image--dragging" : ""
|
|
1295
1096
|
],
|
|
1296
1097
|
src: e.url,
|
|
1297
1098
|
alt: e.name,
|
|
1298
|
-
style:
|
|
1299
|
-
onLoad:
|
|
1300
|
-
onError:
|
|
1301
|
-
onPointerdown:
|
|
1302
|
-
onWheel:
|
|
1303
|
-
onDragstart: (
|
|
1099
|
+
style: k.value,
|
|
1100
|
+
onLoad: le,
|
|
1101
|
+
onError: se,
|
|
1102
|
+
onPointerdown: ce,
|
|
1103
|
+
onWheel: de,
|
|
1104
|
+
onDragstart: (c) => c.preventDefault(),
|
|
1304
1105
|
draggable: !1
|
|
1305
1106
|
}),
|
|
1306
|
-
|
|
1107
|
+
o(
|
|
1307
1108
|
"div",
|
|
1308
1109
|
{ class: "jt-attachment-preview-service__image-toolbar" },
|
|
1309
1110
|
[
|
|
1310
|
-
|
|
1111
|
+
o(
|
|
1311
1112
|
"button",
|
|
1312
1113
|
{
|
|
1313
1114
|
class: "jt-attachment-preview-service__image-tool",
|
|
1314
1115
|
type: "button",
|
|
1315
|
-
title:
|
|
1316
|
-
onClick:
|
|
1116
|
+
title: s("common.缩小"),
|
|
1117
|
+
onClick: ie
|
|
1317
1118
|
},
|
|
1318
|
-
[
|
|
1119
|
+
[o(_, () => o(fe))]
|
|
1319
1120
|
),
|
|
1320
|
-
|
|
1121
|
+
o(
|
|
1321
1122
|
"span",
|
|
1322
1123
|
{ class: "jt-attachment-preview-service__image-scale" },
|
|
1323
|
-
`${Math.round(
|
|
1124
|
+
`${Math.round(a.value * 100)}%`
|
|
1324
1125
|
),
|
|
1325
|
-
|
|
1126
|
+
o(
|
|
1326
1127
|
"button",
|
|
1327
1128
|
{
|
|
1328
1129
|
class: "jt-attachment-preview-service__image-tool",
|
|
1329
1130
|
type: "button",
|
|
1330
|
-
title:
|
|
1331
|
-
onClick:
|
|
1131
|
+
title: s("common.放大"),
|
|
1132
|
+
onClick: re
|
|
1332
1133
|
},
|
|
1333
|
-
[
|
|
1134
|
+
[o(_, () => o(pe))]
|
|
1334
1135
|
),
|
|
1335
|
-
|
|
1136
|
+
o(
|
|
1336
1137
|
"button",
|
|
1337
1138
|
{
|
|
1338
1139
|
class: "jt-attachment-preview-service__image-tool",
|
|
1339
1140
|
type: "button",
|
|
1340
|
-
title:
|
|
1341
|
-
onClick:
|
|
1141
|
+
title: s("common.复位"),
|
|
1142
|
+
onClick: G
|
|
1342
1143
|
},
|
|
1343
|
-
[
|
|
1144
|
+
[o(_, () => o(ve))]
|
|
1344
1145
|
)
|
|
1345
1146
|
]
|
|
1346
1147
|
)
|
|
1347
1148
|
]
|
|
1348
1149
|
);
|
|
1349
1150
|
}
|
|
1350
|
-
}),
|
|
1151
|
+
}), Qe = T({
|
|
1351
1152
|
name: "JtAttachmentPreviewService",
|
|
1352
1153
|
props: {
|
|
1353
1154
|
options: {
|
|
@@ -1360,49 +1161,47 @@ const it = R({
|
|
|
1360
1161
|
}
|
|
1361
1162
|
},
|
|
1362
1163
|
setup(e) {
|
|
1363
|
-
const t =
|
|
1364
|
-
() =>
|
|
1365
|
-
),
|
|
1164
|
+
const t = b(
|
|
1165
|
+
() => Y(e.options.url, e.options.name)
|
|
1166
|
+
), n = b(
|
|
1366
1167
|
() => e.options.downloadName || t.value
|
|
1367
|
-
),
|
|
1368
|
-
() => nt(o.value, e.options.url)
|
|
1369
|
-
), i = L(
|
|
1168
|
+
), r = b(() => X(e.options)), a = b(
|
|
1370
1169
|
() => ({
|
|
1371
1170
|
zIndex: e.options.zIndex ?? 3e3,
|
|
1372
1171
|
"--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
|
|
1373
1172
|
})
|
|
1374
1173
|
);
|
|
1375
|
-
function
|
|
1174
|
+
function i() {
|
|
1376
1175
|
e.options.onClose?.(), e.onDestroy();
|
|
1377
1176
|
}
|
|
1378
|
-
function
|
|
1379
|
-
|
|
1177
|
+
function u(d) {
|
|
1178
|
+
d.key === "Escape" && e.options.closeOnPressEscape !== !1 && i();
|
|
1380
1179
|
}
|
|
1381
|
-
function
|
|
1382
|
-
e.options.onLoad?.(
|
|
1180
|
+
function l(d) {
|
|
1181
|
+
e.options.onLoad?.(d);
|
|
1383
1182
|
}
|
|
1384
|
-
function f(
|
|
1385
|
-
e.options.onError?.(
|
|
1183
|
+
function f(d) {
|
|
1184
|
+
e.options.onError?.(d);
|
|
1386
1185
|
}
|
|
1387
|
-
return
|
|
1388
|
-
document.addEventListener("keydown",
|
|
1389
|
-
}),
|
|
1390
|
-
document.removeEventListener("keydown",
|
|
1186
|
+
return z(() => {
|
|
1187
|
+
document.addEventListener("keydown", u), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1188
|
+
}), J(() => {
|
|
1189
|
+
document.removeEventListener("keydown", u), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1391
1190
|
}), () => {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1191
|
+
const d = e.options.downloadable === !1 ? [] : [
|
|
1192
|
+
ee(
|
|
1394
1193
|
e.options,
|
|
1395
|
-
|
|
1194
|
+
n.value,
|
|
1396
1195
|
"jt-attachment-preview-service__top-download"
|
|
1397
1196
|
)
|
|
1398
1197
|
];
|
|
1399
|
-
return
|
|
1198
|
+
return o(
|
|
1400
1199
|
"div",
|
|
1401
|
-
{ class: "jt-attachment-preview-service", style:
|
|
1200
|
+
{ class: "jt-attachment-preview-service", style: a.value },
|
|
1402
1201
|
[
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1202
|
+
o("div", { class: "jt-attachment-preview-service__modal" }, [
|
|
1203
|
+
o("div", { class: "jt-attachment-preview-service__header" }, [
|
|
1204
|
+
o(
|
|
1406
1205
|
"div",
|
|
1407
1206
|
{
|
|
1408
1207
|
class: "jt-attachment-preview-service__filename",
|
|
@@ -1410,35 +1209,33 @@ const it = R({
|
|
|
1410
1209
|
},
|
|
1411
1210
|
t.value
|
|
1412
1211
|
),
|
|
1413
|
-
|
|
1212
|
+
o(
|
|
1414
1213
|
"div",
|
|
1415
1214
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1416
1215
|
[
|
|
1417
|
-
...
|
|
1418
|
-
|
|
1216
|
+
...d,
|
|
1217
|
+
o(
|
|
1419
1218
|
"button",
|
|
1420
1219
|
{
|
|
1421
1220
|
class: "jt-attachment-preview-service__close",
|
|
1422
1221
|
type: "button",
|
|
1423
|
-
"aria-label":
|
|
1424
|
-
onClick:
|
|
1222
|
+
"aria-label": s("common.关闭"),
|
|
1223
|
+
onClick: i
|
|
1425
1224
|
},
|
|
1426
1225
|
"×"
|
|
1427
1226
|
)
|
|
1428
1227
|
]
|
|
1429
1228
|
)
|
|
1430
1229
|
]),
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
type:
|
|
1230
|
+
o("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1231
|
+
Ze({
|
|
1232
|
+
type: r.value,
|
|
1434
1233
|
url: e.options.url,
|
|
1435
1234
|
name: t.value,
|
|
1436
|
-
downloadName:
|
|
1235
|
+
downloadName: n.value,
|
|
1437
1236
|
sourceOptions: e.options,
|
|
1438
|
-
sandbox: e.options.sandbox,
|
|
1439
|
-
iconText: n.value,
|
|
1440
1237
|
downloadable: e.options.downloadable !== !1,
|
|
1441
|
-
onLoad:
|
|
1238
|
+
onLoad: l,
|
|
1442
1239
|
onError: f
|
|
1443
1240
|
})
|
|
1444
1241
|
])
|
|
@@ -1447,7 +1244,7 @@ const it = R({
|
|
|
1447
1244
|
);
|
|
1448
1245
|
};
|
|
1449
1246
|
}
|
|
1450
|
-
}),
|
|
1247
|
+
}), j = T({
|
|
1451
1248
|
name: "JtAttachmentPreviewDetectingService",
|
|
1452
1249
|
props: {
|
|
1453
1250
|
options: {
|
|
@@ -1460,11 +1257,11 @@ const it = R({
|
|
|
1460
1257
|
},
|
|
1461
1258
|
title: {
|
|
1462
1259
|
type: String,
|
|
1463
|
-
default:
|
|
1260
|
+
default: s("common.正在识别文件类型")
|
|
1464
1261
|
},
|
|
1465
1262
|
desc: {
|
|
1466
1263
|
type: String,
|
|
1467
|
-
default:
|
|
1264
|
+
default: s("common.请稍候,识别完成后将自动预览或下载")
|
|
1468
1265
|
},
|
|
1469
1266
|
spinning: {
|
|
1470
1267
|
type: Boolean,
|
|
@@ -1472,28 +1269,28 @@ const it = R({
|
|
|
1472
1269
|
}
|
|
1473
1270
|
},
|
|
1474
1271
|
setup(e) {
|
|
1475
|
-
const t =
|
|
1476
|
-
() =>
|
|
1477
|
-
),
|
|
1272
|
+
const t = b(
|
|
1273
|
+
() => Y(e.options.url, e.options.name)
|
|
1274
|
+
), n = b(() => ({
|
|
1478
1275
|
zIndex: e.options.zIndex ?? 3e3
|
|
1479
1276
|
}));
|
|
1480
|
-
function
|
|
1277
|
+
function r() {
|
|
1481
1278
|
e.options.onClose?.(), e.onDestroy();
|
|
1482
1279
|
}
|
|
1483
|
-
function
|
|
1484
|
-
i.key === "Escape" && e.options.closeOnPressEscape !== !1 &&
|
|
1280
|
+
function a(i) {
|
|
1281
|
+
i.key === "Escape" && e.options.closeOnPressEscape !== !1 && r();
|
|
1485
1282
|
}
|
|
1486
|
-
return
|
|
1487
|
-
document.addEventListener("keydown",
|
|
1488
|
-
}),
|
|
1489
|
-
document.removeEventListener("keydown",
|
|
1490
|
-
}), () =>
|
|
1283
|
+
return z(() => {
|
|
1284
|
+
document.addEventListener("keydown", a), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1285
|
+
}), J(() => {
|
|
1286
|
+
document.removeEventListener("keydown", a), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1287
|
+
}), () => o(
|
|
1491
1288
|
"div",
|
|
1492
|
-
{ class: "jt-attachment-preview-service", style:
|
|
1289
|
+
{ class: "jt-attachment-preview-service", style: n.value },
|
|
1493
1290
|
[
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1291
|
+
o("div", { class: "jt-attachment-preview-service__modal" }, [
|
|
1292
|
+
o("div", { class: "jt-attachment-preview-service__header" }, [
|
|
1293
|
+
o(
|
|
1497
1294
|
"div",
|
|
1498
1295
|
{
|
|
1499
1296
|
class: "jt-attachment-preview-service__filename",
|
|
@@ -1501,34 +1298,34 @@ const it = R({
|
|
|
1501
1298
|
},
|
|
1502
1299
|
t.value
|
|
1503
1300
|
),
|
|
1504
|
-
|
|
1301
|
+
o(
|
|
1505
1302
|
"div",
|
|
1506
1303
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1507
1304
|
[
|
|
1508
|
-
|
|
1305
|
+
o(
|
|
1509
1306
|
"button",
|
|
1510
1307
|
{
|
|
1511
1308
|
class: "jt-attachment-preview-service__close",
|
|
1512
1309
|
type: "button",
|
|
1513
|
-
"aria-label":
|
|
1514
|
-
onClick:
|
|
1310
|
+
"aria-label": s("common.关闭"),
|
|
1311
|
+
onClick: r
|
|
1515
1312
|
},
|
|
1516
1313
|
"×"
|
|
1517
1314
|
)
|
|
1518
1315
|
]
|
|
1519
1316
|
)
|
|
1520
1317
|
]),
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
e.spinning ?
|
|
1318
|
+
o("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1319
|
+
o("div", { class: "jt-attachment-preview-service__detecting" }, [
|
|
1320
|
+
e.spinning ? o("span", {
|
|
1524
1321
|
class: "jt-attachment-preview-service__detecting-spinner"
|
|
1525
1322
|
}) : null,
|
|
1526
|
-
|
|
1323
|
+
o(
|
|
1527
1324
|
"span",
|
|
1528
1325
|
{ class: "jt-attachment-preview-service__detecting-title" },
|
|
1529
1326
|
e.title
|
|
1530
1327
|
),
|
|
1531
|
-
|
|
1328
|
+
o(
|
|
1532
1329
|
"span",
|
|
1533
1330
|
{ class: "jt-attachment-preview-service__detecting-desc" },
|
|
1534
1331
|
e.desc
|
|
@@ -1540,57 +1337,39 @@ const it = R({
|
|
|
1540
1337
|
);
|
|
1541
1338
|
}
|
|
1542
1339
|
});
|
|
1543
|
-
function
|
|
1544
|
-
return e.type === "empty" ?
|
|
1340
|
+
function Ze(e) {
|
|
1341
|
+
return e.type === "empty" ? o(
|
|
1545
1342
|
"div",
|
|
1546
1343
|
{ class: "jt-attachment-preview-service__empty" },
|
|
1547
|
-
|
|
1548
|
-
) : e.type === "image" ?
|
|
1344
|
+
s("common.暂无附件")
|
|
1345
|
+
) : e.type === "image" ? o(We, {
|
|
1549
1346
|
url: e.url,
|
|
1550
1347
|
name: e.name,
|
|
1551
1348
|
downloadName: e.downloadName,
|
|
1552
1349
|
downloadable: e.downloadable,
|
|
1553
1350
|
onPreviewLoad: e.onLoad,
|
|
1554
1351
|
onPreviewError: e.onError
|
|
1555
|
-
}) : e.type === "
|
|
1556
|
-
class: "jt-attachment-preview-service__media",
|
|
1557
|
-
src: e.url,
|
|
1558
|
-
controls: !0,
|
|
1559
|
-
onLoadeddata: e.onLoad,
|
|
1560
|
-
onError: e.onError
|
|
1561
|
-
}) : e.type === "audio" ? r("audio", {
|
|
1562
|
-
class: "jt-attachment-preview-service__audio",
|
|
1563
|
-
src: e.url,
|
|
1564
|
-
controls: !0,
|
|
1565
|
-
onLoadeddata: e.onLoad,
|
|
1566
|
-
onError: e.onError
|
|
1567
|
-
}) : e.type === "pdf" ? r(it, {
|
|
1352
|
+
}) : e.type === "pdf" ? o(He, {
|
|
1568
1353
|
url: e.url,
|
|
1569
1354
|
name: e.name,
|
|
1570
1355
|
downloadName: e.downloadName,
|
|
1571
1356
|
downloadable: e.downloadable,
|
|
1572
1357
|
onPreviewLoad: e.onLoad,
|
|
1573
1358
|
onPreviewError: e.onError
|
|
1574
|
-
}) :
|
|
1575
|
-
class: "jt-attachment-preview-
|
|
1576
|
-
|
|
1577
|
-
title: e.name,
|
|
1578
|
-
sandbox: e.sandbox || void 0,
|
|
1579
|
-
onLoad: e.onLoad
|
|
1580
|
-
}) : r("div", { class: "jt-attachment-preview-service__unsupported" }, [
|
|
1581
|
-
r("div", { class: "jt-attachment-preview-service__file-card" }, [
|
|
1582
|
-
r(
|
|
1359
|
+
}) : o("div", { class: "jt-attachment-preview-service__unsupported" }, [
|
|
1360
|
+
o("div", { class: "jt-attachment-preview-service__file-card" }, [
|
|
1361
|
+
o(
|
|
1583
1362
|
"div",
|
|
1584
1363
|
{ class: "jt-attachment-preview-service__file-icon" },
|
|
1585
|
-
|
|
1364
|
+
"FILE"
|
|
1586
1365
|
),
|
|
1587
|
-
|
|
1366
|
+
o(
|
|
1588
1367
|
"div",
|
|
1589
1368
|
{ class: "jt-attachment-preview-service__unsupported-text" },
|
|
1590
|
-
|
|
1369
|
+
s("common.暂不支持预览此类型的文件")
|
|
1591
1370
|
)
|
|
1592
1371
|
]),
|
|
1593
|
-
|
|
1372
|
+
o(
|
|
1594
1373
|
"div",
|
|
1595
1374
|
{
|
|
1596
1375
|
class: "jt-attachment-preview-service__file-name",
|
|
@@ -1598,159 +1377,166 @@ function ct(e) {
|
|
|
1598
1377
|
},
|
|
1599
1378
|
e.name
|
|
1600
1379
|
),
|
|
1601
|
-
e.downloadable ?
|
|
1380
|
+
e.downloadable ? ee(
|
|
1602
1381
|
e.sourceOptions,
|
|
1603
1382
|
e.downloadName,
|
|
1604
1383
|
"jt-attachment-preview-service__primary-download"
|
|
1605
1384
|
) : null
|
|
1606
1385
|
]);
|
|
1607
1386
|
}
|
|
1608
|
-
function
|
|
1387
|
+
function ae(e) {
|
|
1609
1388
|
if (typeof document > "u")
|
|
1610
1389
|
return { close: () => {
|
|
1611
1390
|
} };
|
|
1612
|
-
|
|
1391
|
+
m("open-called", {
|
|
1613
1392
|
rawOptions: typeof e == "string" ? e : { ...e }
|
|
1614
|
-
}),
|
|
1615
|
-
const t =
|
|
1393
|
+
}), v?.close();
|
|
1394
|
+
const t = Oe(
|
|
1616
1395
|
e
|
|
1617
|
-
),
|
|
1618
|
-
let
|
|
1396
|
+
), n = t.downloadName || Y(t.url, t.name);
|
|
1397
|
+
let r = !1, a = null, i = null;
|
|
1619
1398
|
const u = () => {
|
|
1620
|
-
|
|
1399
|
+
r = !0, a && (p(null, a), a.remove(), a = null), i && (URL.revokeObjectURL(i), i = null), v?.close === u && (v = null);
|
|
1621
1400
|
};
|
|
1622
1401
|
function l() {
|
|
1623
|
-
|
|
1624
|
-
|
|
1402
|
+
r || (a || (a = document.createElement("div"), document.body.appendChild(a)), p(
|
|
1403
|
+
o(Qe, {
|
|
1625
1404
|
options: t,
|
|
1626
1405
|
onDestroy: u
|
|
1627
1406
|
}),
|
|
1628
|
-
|
|
1407
|
+
a
|
|
1629
1408
|
));
|
|
1630
1409
|
}
|
|
1631
|
-
function
|
|
1632
|
-
|
|
1633
|
-
|
|
1410
|
+
function f() {
|
|
1411
|
+
r || (a || (a = document.createElement("div"), document.body.appendChild(a)), p(
|
|
1412
|
+
o(j, {
|
|
1634
1413
|
options: t,
|
|
1635
1414
|
onDestroy: u
|
|
1636
1415
|
}),
|
|
1637
|
-
|
|
1416
|
+
a
|
|
1638
1417
|
));
|
|
1639
1418
|
}
|
|
1640
|
-
function
|
|
1641
|
-
|
|
1419
|
+
function d() {
|
|
1420
|
+
a && (p(null, a), a.remove(), a = null);
|
|
1642
1421
|
}
|
|
1643
|
-
function
|
|
1644
|
-
|
|
1422
|
+
function P() {
|
|
1423
|
+
r || ne(t, n, {
|
|
1645
1424
|
fallbackToRawUrl: !0
|
|
1646
1425
|
});
|
|
1647
1426
|
}
|
|
1648
|
-
const A =
|
|
1649
|
-
return
|
|
1427
|
+
const A = X(t);
|
|
1428
|
+
return m("type-resolved", {
|
|
1650
1429
|
resolvedType: A,
|
|
1651
1430
|
url: t.url,
|
|
1652
1431
|
name: t.name,
|
|
1653
1432
|
mode: t.mode,
|
|
1654
1433
|
mimeType: t.mimeType,
|
|
1655
1434
|
extension: t.extension
|
|
1656
|
-
}),
|
|
1657
|
-
if (!
|
|
1658
|
-
if (
|
|
1435
|
+
}), S(A) ? l() : A === "unknown" ? (f(), Ge(t.url).then(async (w) => {
|
|
1436
|
+
if (!r) {
|
|
1437
|
+
if (S(w)) {
|
|
1659
1438
|
t.mode = w, l();
|
|
1660
1439
|
return;
|
|
1661
1440
|
}
|
|
1662
1441
|
try {
|
|
1663
|
-
const
|
|
1664
|
-
if (
|
|
1665
|
-
i = URL.createObjectURL(
|
|
1442
|
+
const k = await $(t.url), g = O(k.type);
|
|
1443
|
+
if (S(g)) {
|
|
1444
|
+
i = URL.createObjectURL(k), t.url = i, t.mode = g, l();
|
|
1666
1445
|
return;
|
|
1667
1446
|
}
|
|
1668
|
-
|
|
1447
|
+
d(), N(k, n);
|
|
1669
1448
|
} catch {
|
|
1670
|
-
|
|
1449
|
+
d(), P();
|
|
1671
1450
|
}
|
|
1672
1451
|
}
|
|
1673
|
-
})) :
|
|
1452
|
+
})) : P(), v = { close: u }, v;
|
|
1674
1453
|
}
|
|
1675
|
-
function
|
|
1676
|
-
|
|
1454
|
+
function Xe(e) {
|
|
1455
|
+
if (typeof e == "function") {
|
|
1456
|
+
h = null, R = e;
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
h = e, R = async (t) => {
|
|
1460
|
+
const n = await h.request(t);
|
|
1461
|
+
return h.mapResponse(n, t);
|
|
1462
|
+
};
|
|
1677
1463
|
}
|
|
1678
|
-
function
|
|
1464
|
+
function $e(e) {
|
|
1679
1465
|
if (typeof document > "u")
|
|
1680
1466
|
return { close: () => {
|
|
1681
1467
|
} };
|
|
1682
|
-
|
|
1683
|
-
let t = !1,
|
|
1684
|
-
document.body.appendChild(
|
|
1685
|
-
const
|
|
1686
|
-
t = !0,
|
|
1687
|
-
},
|
|
1688
|
-
return
|
|
1689
|
-
|
|
1690
|
-
options: { url: "", name:
|
|
1691
|
-
title:
|
|
1692
|
-
desc:
|
|
1468
|
+
v?.close();
|
|
1469
|
+
let t = !1, n = document.createElement("div");
|
|
1470
|
+
document.body.appendChild(n);
|
|
1471
|
+
const r = () => {
|
|
1472
|
+
t = !0, n && (p(null, n), n.remove(), n = null), v?.close === r && (v = null);
|
|
1473
|
+
}, a = { close: r };
|
|
1474
|
+
return v = a, R ? (p(
|
|
1475
|
+
o(j, {
|
|
1476
|
+
options: { url: "", name: s("common.附件预览") },
|
|
1477
|
+
title: s("common.正在获取文件信息"),
|
|
1478
|
+
desc: s("common.请稍候,获取完成后将自动预览或下载"),
|
|
1693
1479
|
spinning: !0,
|
|
1694
|
-
onDestroy:
|
|
1480
|
+
onDestroy: r
|
|
1695
1481
|
}),
|
|
1696
|
-
|
|
1697
|
-
),
|
|
1698
|
-
if (t)
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1482
|
+
n
|
|
1483
|
+
), Promise.resolve(R(e)).then((i) => {
|
|
1484
|
+
if (!t) {
|
|
1485
|
+
if (!i?.url) {
|
|
1486
|
+
p(
|
|
1487
|
+
o(j, {
|
|
1488
|
+
options: { url: "", name: s("common.附件预览") },
|
|
1489
|
+
title: s("common.文件信息缺少URL"),
|
|
1490
|
+
desc: s("common.请检查mapResponse是否返回了url字段"),
|
|
1491
|
+
spinning: !1,
|
|
1492
|
+
onDestroy: r
|
|
1493
|
+
}),
|
|
1494
|
+
n
|
|
1495
|
+
);
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
ae({
|
|
1499
|
+
...i,
|
|
1500
|
+
requestParams: e,
|
|
1501
|
+
useRegisteredDownload: !0
|
|
1502
|
+
});
|
|
1712
1503
|
}
|
|
1713
|
-
we({
|
|
1714
|
-
...u,
|
|
1715
|
-
requestParams: e,
|
|
1716
|
-
useRegisteredDownload: !0
|
|
1717
|
-
});
|
|
1718
1504
|
}).catch((i) => {
|
|
1719
1505
|
if (t) return;
|
|
1720
|
-
const u = i instanceof Error ? i.message :
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
options: { url: "", name:
|
|
1724
|
-
title:
|
|
1506
|
+
const u = i instanceof Error ? i.message : s("common.接口请求失败");
|
|
1507
|
+
p(
|
|
1508
|
+
o(j, {
|
|
1509
|
+
options: { url: "", name: s("common.附件预览") },
|
|
1510
|
+
title: s("common.文件信息获取失败"),
|
|
1725
1511
|
desc: u,
|
|
1726
1512
|
spinning: !1,
|
|
1727
|
-
onDestroy:
|
|
1513
|
+
onDestroy: r
|
|
1728
1514
|
}),
|
|
1729
|
-
|
|
1515
|
+
n
|
|
1730
1516
|
);
|
|
1731
|
-
}),
|
|
1732
|
-
|
|
1733
|
-
options: { url: "", name:
|
|
1734
|
-
title:
|
|
1735
|
-
desc:
|
|
1517
|
+
}), a) : (p(
|
|
1518
|
+
o(j, {
|
|
1519
|
+
options: { url: "", name: s("common.附件预览") },
|
|
1520
|
+
title: s("common.附件预览未初始化"),
|
|
1521
|
+
desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
|
|
1736
1522
|
spinning: !1,
|
|
1737
|
-
onDestroy:
|
|
1523
|
+
onDestroy: r
|
|
1738
1524
|
}),
|
|
1739
|
-
|
|
1740
|
-
),
|
|
1525
|
+
n
|
|
1526
|
+
), a);
|
|
1741
1527
|
}
|
|
1742
|
-
const
|
|
1743
|
-
openByParams:
|
|
1744
|
-
setup:
|
|
1528
|
+
const lt = Object.assign(ae, {
|
|
1529
|
+
openByParams: $e,
|
|
1530
|
+
setup: Xe
|
|
1745
1531
|
});
|
|
1746
1532
|
export {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1533
|
+
lt as J,
|
|
1534
|
+
$e as a,
|
|
1535
|
+
Xe as b,
|
|
1536
|
+
ot as g,
|
|
1537
|
+
it as i,
|
|
1538
|
+
L as n,
|
|
1539
|
+
rt as r,
|
|
1540
|
+
at as s,
|
|
1541
|
+
s as t
|
|
1756
1542
|
};
|