@jt-home/mfe-components 1.0.38 → 1.0.40
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-C66W1IXZ.js → index-C6AyqKhk.js} +283 -276
- package/dist/index-poi8lPme.cjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +968 -944
- package/dist/style.css +1 -1
- package/dist/types/components/form/item/JtDatePicker/index.vue.d.ts +4 -1
- package/dist/types/components/form/item/JtInput/index.vue.d.ts +5 -2
- package/dist/types/components/form/item/JtSelect/types.d.ts +1 -0
- package/package.json +98 -99
- package/readme.md +694 -694
- package/dist/index-Cp7s5Qwh.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isRef as
|
|
2
|
-
import { ElIcon as
|
|
3
|
-
const
|
|
1
|
+
import { isRef as ce, defineComponent as L, openBlock as T, createElementBlock as U, createElementVNode as I, ref as j, watch as ee, onBeforeUnmount as O, h as a, computed as D, onMounted as W, nextTick as le, render as k } from "vue";
|
|
2
|
+
import { ElIcon as S } from "element-plus";
|
|
3
|
+
const ue = {
|
|
4
4
|
common: {
|
|
5
5
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
|
|
6
6
|
PDF加载中___: "PDF 加载中...",
|
|
@@ -55,7 +55,7 @@ const le = {
|
|
|
55
55
|
附件预览: "附件预览",
|
|
56
56
|
附件预览未初始化: "附件预览未初始化"
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, de = {
|
|
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 le = {
|
|
|
110
110
|
附件预览: "Attachment Preview",
|
|
111
111
|
附件预览未初始化: "Attachment preview not initialized"
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, me = {
|
|
114
114
|
common: {
|
|
115
115
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในตัวเบราว์เซอร์",
|
|
116
116
|
PDF加载中___: "กําลังโหลดไฟล์ PDF ...",
|
|
@@ -165,7 +165,7 @@ const le = {
|
|
|
165
165
|
附件预览: "เอกสารแนบตัวอย่าง",
|
|
166
166
|
附件预览未初始化: "การแสดงตัวอย่างของสิ่งที่แนบมาไม่ได้เริ่มต้น"
|
|
167
167
|
}
|
|
168
|
-
},
|
|
168
|
+
}, ve = {
|
|
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 le = {
|
|
|
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
|
+
}, he = {
|
|
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...",
|
|
@@ -330,7 +330,7 @@ const le = {
|
|
|
330
330
|
附件预览: "Lampiran Pratinjau",
|
|
331
331
|
附件预览未初始化: "Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi"
|
|
332
332
|
}
|
|
333
|
-
},
|
|
333
|
+
}, fe = {
|
|
334
334
|
common: {
|
|
335
335
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js kann die Datei nicht lesen, wurde auf die eingebaute Vorschau des Browsers umgeschaltet",
|
|
336
336
|
PDF加载中___: "PDF wird geladen...",
|
|
@@ -385,7 +385,7 @@ const le = {
|
|
|
385
385
|
附件预览: "Anhang Vorschau",
|
|
386
386
|
附件预览未初始化: "Anlage Vorschau nicht initialisiert"
|
|
387
387
|
}
|
|
388
|
-
},
|
|
388
|
+
}, ge = {
|
|
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 le = {
|
|
|
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:
|
|
443
|
+
}, we = {}, _e = {
|
|
444
|
+
"zh-cn": ue,
|
|
445
|
+
en: de,
|
|
446
|
+
th: me,
|
|
447
|
+
vi: ve,
|
|
448
|
+
es: he,
|
|
449
449
|
id: pe,
|
|
450
|
-
de:
|
|
451
|
-
pt:
|
|
452
|
-
km:
|
|
453
|
-
},
|
|
450
|
+
de: fe,
|
|
451
|
+
pt: ge,
|
|
452
|
+
km: we
|
|
453
|
+
}, ye = {
|
|
454
454
|
zh: "zh-cn",
|
|
455
455
|
"zh-hans": "zh-cn",
|
|
456
456
|
"zh-cn": "zh-cn",
|
|
@@ -475,100 +475,100 @@ const le = {
|
|
|
475
475
|
km_kh: "km",
|
|
476
476
|
"km-kh": "km"
|
|
477
477
|
};
|
|
478
|
-
function
|
|
478
|
+
function J(e) {
|
|
479
479
|
const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
|
|
480
|
-
return
|
|
480
|
+
return ye[t] || t || "zh-cn";
|
|
481
481
|
}
|
|
482
|
-
let
|
|
483
|
-
function
|
|
484
|
-
return e ? typeof e == "function" ?
|
|
482
|
+
let R = "zh-cn";
|
|
483
|
+
function ke(e) {
|
|
484
|
+
return e ? typeof e == "function" ? J(e()) : ce(e) ? J(e.value) : J(e) : R;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function be(e, t) {
|
|
487
487
|
if (e)
|
|
488
488
|
return t.split(".").reduce((n, r) => {
|
|
489
489
|
if (!(!n || typeof n != "object"))
|
|
490
490
|
return n[r];
|
|
491
491
|
}, e);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
const n =
|
|
493
|
+
function $(e, t) {
|
|
494
|
+
const n = be(_e[e], t);
|
|
495
495
|
return typeof n == "string" ? n : void 0;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
497
|
+
function $e(e) {
|
|
498
|
+
R = J(e);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
return
|
|
500
|
+
function et() {
|
|
501
|
+
return R;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
|
|
503
|
+
function tt() {
|
|
504
|
+
R = "zh-cn";
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
t.locale && (
|
|
506
|
+
function nt(e, t = {}) {
|
|
507
|
+
t.locale && (R = ke(t.locale));
|
|
508
508
|
}
|
|
509
509
|
function s(e, t = e) {
|
|
510
510
|
const n = t || e;
|
|
511
|
-
return
|
|
511
|
+
return $(R, e) || $("zh-cn", e) || n || e;
|
|
512
512
|
}
|
|
513
513
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
514
|
-
var
|
|
514
|
+
var Ae = /* @__PURE__ */ L({
|
|
515
515
|
name: "Download",
|
|
516
516
|
__name: "download",
|
|
517
517
|
setup(e) {
|
|
518
|
-
return (t, n) => (
|
|
518
|
+
return (t, n) => (T(), U("svg", {
|
|
519
519
|
xmlns: "http://www.w3.org/2000/svg",
|
|
520
520
|
viewBox: "0 0 1024 1024"
|
|
521
521
|
}, [
|
|
522
|
-
|
|
522
|
+
I("path", {
|
|
523
523
|
fill: "currentColor",
|
|
524
524
|
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"
|
|
525
525
|
})
|
|
526
526
|
]));
|
|
527
527
|
}
|
|
528
|
-
}),
|
|
528
|
+
}), Pe = Ae, De = /* @__PURE__ */ L({
|
|
529
529
|
name: "RefreshLeft",
|
|
530
530
|
__name: "refresh-left",
|
|
531
531
|
setup(e) {
|
|
532
|
-
return (t, n) => (
|
|
532
|
+
return (t, n) => (T(), U("svg", {
|
|
533
533
|
xmlns: "http://www.w3.org/2000/svg",
|
|
534
534
|
viewBox: "0 0 1024 1024"
|
|
535
535
|
}, [
|
|
536
|
-
|
|
536
|
+
I("path", {
|
|
537
537
|
fill: "currentColor",
|
|
538
538
|
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"
|
|
539
539
|
})
|
|
540
540
|
]));
|
|
541
541
|
}
|
|
542
|
-
}),
|
|
542
|
+
}), je = De, Le = /* @__PURE__ */ L({
|
|
543
543
|
name: "ZoomIn",
|
|
544
544
|
__name: "zoom-in",
|
|
545
545
|
setup(e) {
|
|
546
|
-
return (t, n) => (
|
|
546
|
+
return (t, n) => (T(), U("svg", {
|
|
547
547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
548
548
|
viewBox: "0 0 1024 1024"
|
|
549
549
|
}, [
|
|
550
|
-
|
|
550
|
+
I("path", {
|
|
551
551
|
fill: "currentColor",
|
|
552
552
|
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"
|
|
553
553
|
})
|
|
554
554
|
]));
|
|
555
555
|
}
|
|
556
|
-
}),
|
|
556
|
+
}), Ee = Le, xe = /* @__PURE__ */ L({
|
|
557
557
|
name: "ZoomOut",
|
|
558
558
|
__name: "zoom-out",
|
|
559
559
|
setup(e) {
|
|
560
|
-
return (t, n) => (
|
|
560
|
+
return (t, n) => (T(), U("svg", {
|
|
561
561
|
xmlns: "http://www.w3.org/2000/svg",
|
|
562
562
|
viewBox: "0 0 1024 1024"
|
|
563
563
|
}, [
|
|
564
|
-
|
|
564
|
+
I("path", {
|
|
565
565
|
fill: "currentColor",
|
|
566
566
|
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"
|
|
567
567
|
})
|
|
568
568
|
]));
|
|
569
569
|
}
|
|
570
|
-
}),
|
|
571
|
-
const
|
|
570
|
+
}), Ce = xe;
|
|
571
|
+
const Re = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30sTPt6dEO74mKXLoiCgDTi1RFbUMUBhZXluQUDKb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", Fe = /* @__PURE__ */ new Set([
|
|
572
572
|
"jpg",
|
|
573
573
|
"jpeg",
|
|
574
574
|
"png",
|
|
@@ -578,7 +578,7 @@ const Ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
578
578
|
"svg",
|
|
579
579
|
"avif",
|
|
580
580
|
"ico"
|
|
581
|
-
]), ze = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]),
|
|
581
|
+
]), ze = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Me = /* @__PURE__ */ new Set([
|
|
582
582
|
"mp3",
|
|
583
583
|
"wav",
|
|
584
584
|
"ogg",
|
|
@@ -586,7 +586,7 @@ const Ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
586
586
|
"m4a",
|
|
587
587
|
"aac",
|
|
588
588
|
"flac"
|
|
589
|
-
]),
|
|
589
|
+
]), Ne = /* @__PURE__ */ new Set([
|
|
590
590
|
"html",
|
|
591
591
|
"htm",
|
|
592
592
|
"txt",
|
|
@@ -595,7 +595,7 @@ const Ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
595
595
|
"csv",
|
|
596
596
|
"md",
|
|
597
597
|
"log"
|
|
598
|
-
]),
|
|
598
|
+
]), Se = /* @__PURE__ */ new Set([
|
|
599
599
|
"doc",
|
|
600
600
|
"docx",
|
|
601
601
|
"xls",
|
|
@@ -606,23 +606,23 @@ const Ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
606
606
|
"rar",
|
|
607
607
|
"7z"
|
|
608
608
|
]);
|
|
609
|
-
let b = null,
|
|
610
|
-
async function
|
|
611
|
-
return
|
|
609
|
+
let b = null, V = null, Y = null;
|
|
610
|
+
async function Je() {
|
|
611
|
+
return V || (V = Promise.all([
|
|
612
612
|
import("./pdf-BmBuG7of.js"),
|
|
613
613
|
import("./pdf.worker.min-4PI-nNLo.js")
|
|
614
|
-
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))),
|
|
614
|
+
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), V;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Ye(e) {
|
|
617
617
|
return typeof e == "string" ? { url: e } : e;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function te(e) {
|
|
620
620
|
const [t] = e.split(/[?#]/);
|
|
621
621
|
return t ?? "";
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Q(e, t) {
|
|
624
624
|
if (t?.trim()) return t.trim();
|
|
625
|
-
const n =
|
|
625
|
+
const n = te(e).split("/").filter(Boolean).pop();
|
|
626
626
|
if (!n) return s("common.附件预览");
|
|
627
627
|
try {
|
|
628
628
|
return decodeURIComponent(n);
|
|
@@ -630,64 +630,69 @@ function W(e, t) {
|
|
|
630
630
|
return n;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
return
|
|
633
|
+
function K(e) {
|
|
634
|
+
return te(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Te(e) {
|
|
637
637
|
return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
const t =
|
|
641
|
-
return Fe.has(t) ? "image" : t === "pdf" ? "pdf" : ze.has(t) ? "video" :
|
|
639
|
+
function Ue(e) {
|
|
640
|
+
const t = Te(e);
|
|
641
|
+
return Fe.has(t) ? "image" : t === "pdf" ? "pdf" : ze.has(t) ? "video" : Me.has(t) ? "audio" : Ne.has(t) ? "iframe" : Se.has(t) ? "unsupported" : "unknown";
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function X(e) {
|
|
644
644
|
const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
645
645
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function ne(e) {
|
|
648
648
|
if (!e.url.trim()) return "empty";
|
|
649
649
|
if (e.mode && e.mode !== "auto") return e.mode;
|
|
650
650
|
if (e.mimeType) {
|
|
651
|
-
const n =
|
|
651
|
+
const n = X(e.mimeType);
|
|
652
652
|
if (n !== "unknown") return n;
|
|
653
653
|
}
|
|
654
|
-
const t =
|
|
655
|
-
e.extension ||
|
|
654
|
+
const t = Ue(
|
|
655
|
+
e.extension || K(e.name || "") || K(e.url)
|
|
656
656
|
);
|
|
657
657
|
return t !== "unknown" ? t : "unknown";
|
|
658
658
|
}
|
|
659
659
|
async function Ie(e) {
|
|
660
660
|
try {
|
|
661
661
|
const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
|
|
662
|
-
return
|
|
662
|
+
return X(n);
|
|
663
663
|
} catch {
|
|
664
664
|
return "unknown";
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
async function
|
|
667
|
+
async function ae(e) {
|
|
668
668
|
const t = await fetch(e);
|
|
669
669
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
670
670
|
return t.blob();
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
672
|
+
async function Oe(e) {
|
|
673
|
+
const t = await fetch(e);
|
|
674
|
+
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
675
|
+
return new Uint8Array(await t.arrayBuffer());
|
|
676
|
+
}
|
|
677
|
+
function qe(e, t) {
|
|
678
|
+
const n = K(t);
|
|
674
679
|
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";
|
|
675
680
|
}
|
|
676
|
-
function
|
|
681
|
+
function ie(e, t, n) {
|
|
677
682
|
return a(
|
|
678
683
|
"button",
|
|
679
684
|
{
|
|
680
685
|
class: n,
|
|
681
686
|
type: "button",
|
|
682
687
|
onClick: () => {
|
|
683
|
-
|
|
688
|
+
oe(e, t);
|
|
684
689
|
}
|
|
685
690
|
},
|
|
686
691
|
[
|
|
687
692
|
a(
|
|
688
|
-
|
|
693
|
+
S,
|
|
689
694
|
{ class: "jt-attachment-preview-service__download-icon" },
|
|
690
|
-
() => a(
|
|
695
|
+
() => a(Pe)
|
|
691
696
|
),
|
|
692
697
|
a(
|
|
693
698
|
"span",
|
|
@@ -697,10 +702,10 @@ function ae(e, t, n) {
|
|
|
697
702
|
]
|
|
698
703
|
);
|
|
699
704
|
}
|
|
700
|
-
function
|
|
705
|
+
function G(e) {
|
|
701
706
|
return e === "image" || e === "pdf";
|
|
702
707
|
}
|
|
703
|
-
function
|
|
708
|
+
function re(e) {
|
|
704
709
|
return a(
|
|
705
710
|
"div",
|
|
706
711
|
{ class: "jt-attachment-preview-service__preview-fallback" },
|
|
@@ -726,19 +731,19 @@ function ie(e) {
|
|
|
726
731
|
]
|
|
727
732
|
);
|
|
728
733
|
}
|
|
729
|
-
function
|
|
734
|
+
function H(e, t) {
|
|
730
735
|
const n = document.createElement("a");
|
|
731
736
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
|
|
732
737
|
}
|
|
733
|
-
async function
|
|
738
|
+
async function oe(e, t) {
|
|
734
739
|
try {
|
|
735
|
-
const n = await
|
|
736
|
-
|
|
740
|
+
const n = await ae(e), r = URL.createObjectURL(n);
|
|
741
|
+
H(r, t), URL.revokeObjectURL(r);
|
|
737
742
|
} catch {
|
|
738
|
-
|
|
743
|
+
H(e, t);
|
|
739
744
|
}
|
|
740
745
|
}
|
|
741
|
-
const
|
|
746
|
+
const Ve = L({
|
|
742
747
|
name: "JtAttachmentPreviewPdfCanvas",
|
|
743
748
|
props: {
|
|
744
749
|
url: {
|
|
@@ -763,79 +768,81 @@ const Oe = E({
|
|
|
763
768
|
previewError: (e) => e instanceof Event
|
|
764
769
|
},
|
|
765
770
|
setup(e, { emit: t }) {
|
|
766
|
-
const n =
|
|
767
|
-
let m = null,
|
|
768
|
-
async function
|
|
769
|
-
if (!
|
|
770
|
-
const
|
|
771
|
-
return !Array.isArray(
|
|
771
|
+
const n = j("loading"), r = j([]), i = j([]), c = /* @__PURE__ */ new Map(), l = j("");
|
|
772
|
+
let m = null, _ = [], v = 0;
|
|
773
|
+
async function h(o, u) {
|
|
774
|
+
if (!u) return null;
|
|
775
|
+
const y = typeof u == "string" ? await o.getDestination(u) : u;
|
|
776
|
+
return !Array.isArray(y) || !y[0] ? null : await o.getPageIndex(y[0]) + 1;
|
|
772
777
|
}
|
|
773
|
-
async function
|
|
774
|
-
if (!
|
|
775
|
-
const
|
|
776
|
-
for (const
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
title:
|
|
780
|
-
pageNumber:
|
|
781
|
-
level:
|
|
778
|
+
async function E(o, u, y = 0) {
|
|
779
|
+
if (!u?.length) return [];
|
|
780
|
+
const g = [];
|
|
781
|
+
for (const P of u) {
|
|
782
|
+
const B = await h(o, P.dest);
|
|
783
|
+
g.push({
|
|
784
|
+
title: P.title || s("common.未命名标题"),
|
|
785
|
+
pageNumber: B,
|
|
786
|
+
level: y
|
|
782
787
|
});
|
|
783
|
-
const
|
|
784
|
-
|
|
788
|
+
const x = await E(o, P.items, y + 1);
|
|
789
|
+
g.push(...x);
|
|
785
790
|
}
|
|
786
|
-
return
|
|
791
|
+
return g;
|
|
787
792
|
}
|
|
788
|
-
function
|
|
793
|
+
function f() {
|
|
789
794
|
v += 1;
|
|
790
|
-
for (const o of
|
|
795
|
+
for (const o of _)
|
|
791
796
|
o.cancel();
|
|
792
|
-
|
|
797
|
+
_ = [], m?.destroy(), m = null, c.clear();
|
|
793
798
|
}
|
|
794
799
|
async function A() {
|
|
795
|
-
|
|
800
|
+
f();
|
|
796
801
|
const o = v;
|
|
797
|
-
n.value = "loading",
|
|
802
|
+
n.value = "loading", l.value = "", r.value = [], i.value = [];
|
|
798
803
|
try {
|
|
799
|
-
const
|
|
804
|
+
const u = await Je();
|
|
805
|
+
if (o !== v) return;
|
|
806
|
+
const y = await Oe(e.url);
|
|
800
807
|
if (o !== v) return;
|
|
801
|
-
m =
|
|
802
|
-
const
|
|
808
|
+
m = u.getDocument({ data: y });
|
|
809
|
+
const g = await m.promise;
|
|
803
810
|
if (o !== v) return;
|
|
804
811
|
r.value = Array.from(
|
|
805
|
-
{ length:
|
|
806
|
-
(
|
|
807
|
-
), i.value = await
|
|
808
|
-
|
|
809
|
-
await
|
|
810
|
-
), await
|
|
811
|
-
const P =
|
|
812
|
+
{ length: g.numPages },
|
|
813
|
+
(x, C) => C + 1
|
|
814
|
+
), i.value = await E(
|
|
815
|
+
g,
|
|
816
|
+
await g.getOutline()
|
|
817
|
+
), await le();
|
|
818
|
+
const P = c.values().next().value, B = Math.max(
|
|
812
819
|
(P?.parentElement?.clientWidth ?? 800) - 32,
|
|
813
820
|
320
|
|
814
821
|
);
|
|
815
|
-
for (const
|
|
822
|
+
for (const x of r.value) {
|
|
816
823
|
if (o !== v) return;
|
|
817
|
-
const
|
|
818
|
-
if (!
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
canvas:
|
|
823
|
-
canvasContext:
|
|
824
|
-
viewport:
|
|
824
|
+
const C = await g.getPage(x), w = c.get(x), F = w?.getContext("2d");
|
|
825
|
+
if (!w || !F) continue;
|
|
826
|
+
const q = C.getViewport({ scale: 1 }), d = Math.min(B / q.width, 2), z = C.getViewport({ scale: d }), N = window.devicePixelRatio || 1;
|
|
827
|
+
w.width = Math.floor(z.width * N), w.height = Math.floor(z.height * N), w.style.width = `${Math.floor(z.width)}px`, w.style.height = `${Math.floor(z.height)}px`, F.setTransform(N, 0, 0, N, 0, 0);
|
|
828
|
+
const Z = C.render({
|
|
829
|
+
canvas: w,
|
|
830
|
+
canvasContext: F,
|
|
831
|
+
viewport: z
|
|
825
832
|
});
|
|
826
|
-
|
|
833
|
+
_.push(Z), await Z.promise;
|
|
827
834
|
}
|
|
828
835
|
if (o !== v) return;
|
|
829
836
|
n.value = "ready", t("previewLoad", new Event("load"));
|
|
830
|
-
} catch (
|
|
837
|
+
} catch (u) {
|
|
831
838
|
if (o !== v) return;
|
|
832
|
-
n.value = "error",
|
|
839
|
+
n.value = "error", l.value = u instanceof Error ? u.message : s("common.PDF加载失败"), t("previewError", new Event("error"));
|
|
833
840
|
}
|
|
834
841
|
}
|
|
835
|
-
|
|
836
|
-
function
|
|
842
|
+
ee(() => e.url, A, { immediate: !0 }), O(f);
|
|
843
|
+
function p(o) {
|
|
837
844
|
if (!o) return;
|
|
838
|
-
|
|
845
|
+
c.get(o)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
839
846
|
}
|
|
840
847
|
return () => a("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
841
848
|
n.value === "loading" ? a(
|
|
@@ -844,8 +851,8 @@ const Oe = E({
|
|
|
844
851
|
s("common.PDF加载中___")
|
|
845
852
|
) : null,
|
|
846
853
|
n.value === "error" ? a("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
847
|
-
|
|
848
|
-
icon:
|
|
854
|
+
re({
|
|
855
|
+
icon: Be,
|
|
849
856
|
name: e.name
|
|
850
857
|
})
|
|
851
858
|
]) : null,
|
|
@@ -877,16 +884,16 @@ const Oe = E({
|
|
|
877
884
|
class: "jt-attachment-preview-service__pdf-outline-list"
|
|
878
885
|
},
|
|
879
886
|
i.value.map(
|
|
880
|
-
(o,
|
|
887
|
+
(o, u) => a(
|
|
881
888
|
"button",
|
|
882
889
|
{
|
|
883
|
-
key: `${o.title}-${
|
|
890
|
+
key: `${o.title}-${u}`,
|
|
884
891
|
class: "jt-attachment-preview-service__pdf-outline-item",
|
|
885
892
|
style: { paddingLeft: `${12 + o.level * 14}px` },
|
|
886
893
|
type: "button",
|
|
887
894
|
disabled: !o.pageNumber,
|
|
888
895
|
title: o.title,
|
|
889
|
-
onClick: () =>
|
|
896
|
+
onClick: () => p(o.pageNumber)
|
|
890
897
|
},
|
|
891
898
|
o.title
|
|
892
899
|
)
|
|
@@ -900,8 +907,8 @@ const Oe = E({
|
|
|
900
907
|
r.value.map(
|
|
901
908
|
(o) => a("canvas", {
|
|
902
909
|
key: o,
|
|
903
|
-
ref: (
|
|
904
|
-
|
|
910
|
+
ref: (u) => {
|
|
911
|
+
u instanceof HTMLCanvasElement && c.set(o, u);
|
|
905
912
|
},
|
|
906
913
|
class: "jt-attachment-preview-service__pdf-page"
|
|
907
914
|
})
|
|
@@ -911,7 +918,7 @@ const Oe = E({
|
|
|
911
918
|
)
|
|
912
919
|
]);
|
|
913
920
|
}
|
|
914
|
-
}),
|
|
921
|
+
}), Ge = L({
|
|
915
922
|
name: "JtAttachmentPreviewImageTransform",
|
|
916
923
|
props: {
|
|
917
924
|
url: {
|
|
@@ -940,65 +947,65 @@ const Oe = E({
|
|
|
940
947
|
previewError: (e) => e instanceof Event
|
|
941
948
|
},
|
|
942
949
|
setup(e, { emit: t }) {
|
|
943
|
-
const n =
|
|
944
|
-
let
|
|
945
|
-
const A =
|
|
950
|
+
const n = j(null), r = j("ready"), i = j(1), c = j(!1);
|
|
951
|
+
let l = 0, m = 0, _ = 0, v = 0, h = 0, E = 0, f = 0;
|
|
952
|
+
const A = D(
|
|
946
953
|
() => ({
|
|
947
954
|
"--jt-attachment-preview-service-image-fit": e.fit,
|
|
948
|
-
transform: `translate(${
|
|
955
|
+
transform: `translate(${l}px, ${m}px) scale(${i.value})`
|
|
949
956
|
})
|
|
950
957
|
);
|
|
951
|
-
function
|
|
952
|
-
n.value && (n.value.style.transform = `translate(${
|
|
958
|
+
function p() {
|
|
959
|
+
n.value && (n.value.style.transform = `translate(${l}px, ${m}px) scale(${i.value})`);
|
|
953
960
|
}
|
|
954
961
|
function o() {
|
|
955
|
-
|
|
956
|
-
|
|
962
|
+
f || (f = window.requestAnimationFrame(() => {
|
|
963
|
+
f = 0, p();
|
|
957
964
|
}));
|
|
958
965
|
}
|
|
959
|
-
function d
|
|
960
|
-
i.value = Math.min(Math.max(Number(
|
|
966
|
+
function u(d) {
|
|
967
|
+
i.value = Math.min(Math.max(Number(d.toFixed(2)), 0.2), 5), i.value <= 1 && (l = 0, m = 0), p();
|
|
961
968
|
}
|
|
962
|
-
function
|
|
963
|
-
|
|
969
|
+
function y() {
|
|
970
|
+
u(i.value + 0.2);
|
|
964
971
|
}
|
|
965
|
-
function
|
|
966
|
-
const
|
|
967
|
-
i.value =
|
|
972
|
+
function g() {
|
|
973
|
+
const d = Math.max(Number((i.value - 0.2).toFixed(2)), 0.2);
|
|
974
|
+
i.value = d, d <= 1 && (l = 0, m = 0), p();
|
|
968
975
|
}
|
|
969
|
-
function
|
|
970
|
-
|
|
976
|
+
function P() {
|
|
977
|
+
l = 0, m = 0, u(1);
|
|
971
978
|
}
|
|
972
|
-
function
|
|
973
|
-
r.value = "ready", t("previewLoad",
|
|
979
|
+
function B(d) {
|
|
980
|
+
r.value = "ready", t("previewLoad", d);
|
|
974
981
|
}
|
|
975
|
-
function
|
|
976
|
-
r.value = "error", t("previewError",
|
|
982
|
+
function x(d) {
|
|
983
|
+
r.value = "error", t("previewError", d);
|
|
977
984
|
}
|
|
978
|
-
function
|
|
979
|
-
i.value <= 1 || (
|
|
985
|
+
function C(d) {
|
|
986
|
+
i.value <= 1 || (d.preventDefault(), c.value = !0, _ = d.clientX, v = d.clientY, h = l, E = m, window.addEventListener("pointermove", w), window.addEventListener("pointerup", F, { once: !0 }));
|
|
980
987
|
}
|
|
981
|
-
function
|
|
982
|
-
|
|
988
|
+
function w(d) {
|
|
989
|
+
c.value && (l = h + d.clientX - _, m = E + d.clientY - v, o());
|
|
983
990
|
}
|
|
984
|
-
function
|
|
985
|
-
|
|
991
|
+
function F() {
|
|
992
|
+
c.value = !1, window.removeEventListener("pointermove", w);
|
|
986
993
|
}
|
|
987
|
-
function
|
|
988
|
-
|
|
994
|
+
function q(d) {
|
|
995
|
+
d.preventDefault(), u(i.value + (d.deltaY < 0 ? 0.1 : -0.1));
|
|
989
996
|
}
|
|
990
|
-
return
|
|
997
|
+
return W(p), ee(
|
|
991
998
|
() => e.url,
|
|
992
999
|
() => {
|
|
993
|
-
r.value = "ready",
|
|
1000
|
+
r.value = "ready", P();
|
|
994
1001
|
}
|
|
995
|
-
),
|
|
996
|
-
window.removeEventListener("pointermove",
|
|
1002
|
+
), O(() => {
|
|
1003
|
+
window.removeEventListener("pointermove", w), f && window.cancelAnimationFrame(f);
|
|
997
1004
|
}), () => a(
|
|
998
1005
|
"div",
|
|
999
1006
|
{ class: "jt-attachment-preview-service__image-viewer" },
|
|
1000
|
-
r.value === "error" ?
|
|
1001
|
-
icon:
|
|
1007
|
+
r.value === "error" ? re({
|
|
1008
|
+
icon: Re,
|
|
1002
1009
|
name: e.name
|
|
1003
1010
|
}) : [
|
|
1004
1011
|
a("img", {
|
|
@@ -1007,16 +1014,16 @@ const Oe = E({
|
|
|
1007
1014
|
"jt-attachment-preview-service__media",
|
|
1008
1015
|
"jt-attachment-preview-service__image",
|
|
1009
1016
|
i.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
|
|
1010
|
-
|
|
1017
|
+
c.value ? "jt-attachment-preview-service__image--dragging" : ""
|
|
1011
1018
|
],
|
|
1012
1019
|
src: e.url,
|
|
1013
1020
|
alt: e.name,
|
|
1014
1021
|
style: A.value,
|
|
1015
|
-
onLoad:
|
|
1016
|
-
onError:
|
|
1017
|
-
onPointerdown:
|
|
1018
|
-
onWheel:
|
|
1019
|
-
onDragstart: (
|
|
1022
|
+
onLoad: B,
|
|
1023
|
+
onError: x,
|
|
1024
|
+
onPointerdown: C,
|
|
1025
|
+
onWheel: q,
|
|
1026
|
+
onDragstart: (d) => d.preventDefault(),
|
|
1020
1027
|
draggable: !1
|
|
1021
1028
|
}),
|
|
1022
1029
|
a(
|
|
@@ -1029,9 +1036,9 @@ const Oe = E({
|
|
|
1029
1036
|
class: "jt-attachment-preview-service__image-tool",
|
|
1030
1037
|
type: "button",
|
|
1031
1038
|
title: s("common.缩小"),
|
|
1032
|
-
onClick:
|
|
1039
|
+
onClick: g
|
|
1033
1040
|
},
|
|
1034
|
-
[a(
|
|
1041
|
+
[a(S, () => a(Ce))]
|
|
1035
1042
|
),
|
|
1036
1043
|
a(
|
|
1037
1044
|
"span",
|
|
@@ -1044,9 +1051,9 @@ const Oe = E({
|
|
|
1044
1051
|
class: "jt-attachment-preview-service__image-tool",
|
|
1045
1052
|
type: "button",
|
|
1046
1053
|
title: s("common.放大"),
|
|
1047
|
-
onClick:
|
|
1054
|
+
onClick: y
|
|
1048
1055
|
},
|
|
1049
|
-
[a(
|
|
1056
|
+
[a(S, () => a(Ee))]
|
|
1050
1057
|
),
|
|
1051
1058
|
a(
|
|
1052
1059
|
"button",
|
|
@@ -1054,16 +1061,16 @@ const Oe = E({
|
|
|
1054
1061
|
class: "jt-attachment-preview-service__image-tool",
|
|
1055
1062
|
type: "button",
|
|
1056
1063
|
title: s("common.复位"),
|
|
1057
|
-
onClick:
|
|
1064
|
+
onClick: P
|
|
1058
1065
|
},
|
|
1059
|
-
[a(
|
|
1066
|
+
[a(S, () => a(je))]
|
|
1060
1067
|
)
|
|
1061
1068
|
]
|
|
1062
1069
|
)
|
|
1063
1070
|
]
|
|
1064
1071
|
);
|
|
1065
1072
|
}
|
|
1066
|
-
}),
|
|
1073
|
+
}), Ke = L({
|
|
1067
1074
|
name: "JtAttachmentPreviewService",
|
|
1068
1075
|
props: {
|
|
1069
1076
|
options: {
|
|
@@ -1076,37 +1083,37 @@ const Oe = E({
|
|
|
1076
1083
|
}
|
|
1077
1084
|
},
|
|
1078
1085
|
setup(e) {
|
|
1079
|
-
const t =
|
|
1080
|
-
() =>
|
|
1081
|
-
), n =
|
|
1086
|
+
const t = D(
|
|
1087
|
+
() => Q(e.options.url, e.options.name)
|
|
1088
|
+
), n = D(
|
|
1082
1089
|
() => e.options.downloadName || t.value
|
|
1083
|
-
), r =
|
|
1084
|
-
() =>
|
|
1085
|
-
),
|
|
1090
|
+
), r = D(() => ne(e.options)), i = D(
|
|
1091
|
+
() => qe(r.value, e.options.url)
|
|
1092
|
+
), c = D(
|
|
1086
1093
|
() => ({
|
|
1087
1094
|
zIndex: e.options.zIndex ?? 3e3,
|
|
1088
1095
|
"--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
|
|
1089
1096
|
})
|
|
1090
1097
|
);
|
|
1091
|
-
function
|
|
1098
|
+
function l() {
|
|
1092
1099
|
e.options.onClose?.(), e.onDestroy();
|
|
1093
1100
|
}
|
|
1094
|
-
function m(
|
|
1095
|
-
|
|
1101
|
+
function m(h) {
|
|
1102
|
+
h.key === "Escape" && e.options.closeOnPressEscape !== !1 && l();
|
|
1096
1103
|
}
|
|
1097
|
-
function
|
|
1098
|
-
e.options.onLoad?.(
|
|
1104
|
+
function _(h) {
|
|
1105
|
+
e.options.onLoad?.(h);
|
|
1099
1106
|
}
|
|
1100
|
-
function v(
|
|
1101
|
-
e.options.onError?.(
|
|
1107
|
+
function v(h) {
|
|
1108
|
+
e.options.onError?.(h);
|
|
1102
1109
|
}
|
|
1103
|
-
return
|
|
1110
|
+
return W(() => {
|
|
1104
1111
|
document.addEventListener("keydown", m), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1105
|
-
}),
|
|
1112
|
+
}), O(() => {
|
|
1106
1113
|
document.removeEventListener("keydown", m), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1107
1114
|
}), () => {
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1115
|
+
const h = e.options.downloadable === !1 ? [] : [
|
|
1116
|
+
ie(
|
|
1110
1117
|
e.options.url,
|
|
1111
1118
|
n.value,
|
|
1112
1119
|
"jt-attachment-preview-service__top-download"
|
|
@@ -1114,7 +1121,7 @@ const Oe = E({
|
|
|
1114
1121
|
];
|
|
1115
1122
|
return a(
|
|
1116
1123
|
"div",
|
|
1117
|
-
{ class: "jt-attachment-preview-service", style:
|
|
1124
|
+
{ class: "jt-attachment-preview-service", style: c.value },
|
|
1118
1125
|
[
|
|
1119
1126
|
a("div", { class: "jt-attachment-preview-service__modal" }, [
|
|
1120
1127
|
a("div", { class: "jt-attachment-preview-service__header" }, [
|
|
@@ -1130,14 +1137,14 @@ const Oe = E({
|
|
|
1130
1137
|
"div",
|
|
1131
1138
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1132
1139
|
[
|
|
1133
|
-
...
|
|
1140
|
+
...h,
|
|
1134
1141
|
a(
|
|
1135
1142
|
"button",
|
|
1136
1143
|
{
|
|
1137
1144
|
class: "jt-attachment-preview-service__close",
|
|
1138
1145
|
type: "button",
|
|
1139
1146
|
"aria-label": s("common.关闭"),
|
|
1140
|
-
onClick:
|
|
1147
|
+
onClick: l
|
|
1141
1148
|
},
|
|
1142
1149
|
"×"
|
|
1143
1150
|
)
|
|
@@ -1145,7 +1152,7 @@ const Oe = E({
|
|
|
1145
1152
|
)
|
|
1146
1153
|
]),
|
|
1147
1154
|
a("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1148
|
-
|
|
1155
|
+
He({
|
|
1149
1156
|
type: r.value,
|
|
1150
1157
|
url: e.options.url,
|
|
1151
1158
|
name: t.value,
|
|
@@ -1153,7 +1160,7 @@ const Oe = E({
|
|
|
1153
1160
|
sandbox: e.options.sandbox,
|
|
1154
1161
|
iconText: i.value,
|
|
1155
1162
|
downloadable: e.options.downloadable !== !1,
|
|
1156
|
-
onLoad:
|
|
1163
|
+
onLoad: _,
|
|
1157
1164
|
onError: v
|
|
1158
1165
|
})
|
|
1159
1166
|
])
|
|
@@ -1162,7 +1169,7 @@ const Oe = E({
|
|
|
1162
1169
|
);
|
|
1163
1170
|
};
|
|
1164
1171
|
}
|
|
1165
|
-
}),
|
|
1172
|
+
}), M = L({
|
|
1166
1173
|
name: "JtAttachmentPreviewDetectingService",
|
|
1167
1174
|
props: {
|
|
1168
1175
|
options: {
|
|
@@ -1187,20 +1194,20 @@ const Oe = E({
|
|
|
1187
1194
|
}
|
|
1188
1195
|
},
|
|
1189
1196
|
setup(e) {
|
|
1190
|
-
const t =
|
|
1191
|
-
() =>
|
|
1192
|
-
), n =
|
|
1197
|
+
const t = D(
|
|
1198
|
+
() => Q(e.options.url, e.options.name)
|
|
1199
|
+
), n = D(() => ({
|
|
1193
1200
|
zIndex: e.options.zIndex ?? 3e3
|
|
1194
1201
|
}));
|
|
1195
1202
|
function r() {
|
|
1196
1203
|
e.options.onClose?.(), e.onDestroy();
|
|
1197
1204
|
}
|
|
1198
|
-
function i(
|
|
1199
|
-
|
|
1205
|
+
function i(c) {
|
|
1206
|
+
c.key === "Escape" && e.options.closeOnPressEscape !== !1 && r();
|
|
1200
1207
|
}
|
|
1201
|
-
return
|
|
1208
|
+
return W(() => {
|
|
1202
1209
|
document.addEventListener("keydown", i), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1203
|
-
}),
|
|
1210
|
+
}), O(() => {
|
|
1204
1211
|
document.removeEventListener("keydown", i), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1205
1212
|
}), () => a(
|
|
1206
1213
|
"div",
|
|
@@ -1255,12 +1262,12 @@ const Oe = E({
|
|
|
1255
1262
|
);
|
|
1256
1263
|
}
|
|
1257
1264
|
});
|
|
1258
|
-
function
|
|
1265
|
+
function He(e) {
|
|
1259
1266
|
return e.type === "empty" ? a(
|
|
1260
1267
|
"div",
|
|
1261
1268
|
{ class: "jt-attachment-preview-service__empty" },
|
|
1262
1269
|
s("common.暂无附件")
|
|
1263
|
-
) : e.type === "image" ? a(
|
|
1270
|
+
) : e.type === "image" ? a(Ge, {
|
|
1264
1271
|
url: e.url,
|
|
1265
1272
|
name: e.name,
|
|
1266
1273
|
downloadName: e.downloadName,
|
|
@@ -1279,7 +1286,7 @@ function Ge(e) {
|
|
|
1279
1286
|
controls: !0,
|
|
1280
1287
|
onLoadeddata: e.onLoad,
|
|
1281
1288
|
onError: e.onError
|
|
1282
|
-
}) : e.type === "pdf" ? a(
|
|
1289
|
+
}) : e.type === "pdf" ? a(Ve, {
|
|
1283
1290
|
url: e.url,
|
|
1284
1291
|
name: e.name,
|
|
1285
1292
|
downloadName: e.downloadName,
|
|
@@ -1313,37 +1320,37 @@ function Ge(e) {
|
|
|
1313
1320
|
},
|
|
1314
1321
|
e.name
|
|
1315
1322
|
),
|
|
1316
|
-
e.downloadable ?
|
|
1323
|
+
e.downloadable ? ie(
|
|
1317
1324
|
e.url,
|
|
1318
1325
|
e.downloadName,
|
|
1319
1326
|
"jt-attachment-preview-service__primary-download"
|
|
1320
1327
|
) : null
|
|
1321
1328
|
]);
|
|
1322
1329
|
}
|
|
1323
|
-
function
|
|
1330
|
+
function se(e) {
|
|
1324
1331
|
if (typeof document > "u")
|
|
1325
1332
|
return { close: () => {
|
|
1326
1333
|
} };
|
|
1327
1334
|
b?.close();
|
|
1328
|
-
const t =
|
|
1329
|
-
let r = !1, i = null,
|
|
1330
|
-
const
|
|
1331
|
-
r = !0, i && (k(null, i), i.remove(), i = null),
|
|
1335
|
+
const t = Ye(e), n = t.downloadName || Q(t.url, t.name);
|
|
1336
|
+
let r = !1, i = null, c = null;
|
|
1337
|
+
const l = () => {
|
|
1338
|
+
r = !0, i && (k(null, i), i.remove(), i = null), c && (URL.revokeObjectURL(c), c = null), b?.close === l && (b = null);
|
|
1332
1339
|
};
|
|
1333
1340
|
function m() {
|
|
1334
1341
|
r || (i || (i = document.createElement("div"), document.body.appendChild(i)), k(
|
|
1335
|
-
a(
|
|
1342
|
+
a(Ke, {
|
|
1336
1343
|
options: t,
|
|
1337
|
-
onDestroy:
|
|
1344
|
+
onDestroy: l
|
|
1338
1345
|
}),
|
|
1339
1346
|
i
|
|
1340
1347
|
));
|
|
1341
1348
|
}
|
|
1342
|
-
function
|
|
1349
|
+
function _() {
|
|
1343
1350
|
r || (i || (i = document.createElement("div"), document.body.appendChild(i)), k(
|
|
1344
|
-
a(
|
|
1351
|
+
a(M, {
|
|
1345
1352
|
options: t,
|
|
1346
|
-
onDestroy:
|
|
1353
|
+
onDestroy: l
|
|
1347
1354
|
}),
|
|
1348
1355
|
i
|
|
1349
1356
|
));
|
|
@@ -1351,38 +1358,38 @@ function oe(e) {
|
|
|
1351
1358
|
function v() {
|
|
1352
1359
|
i && (k(null, i), i.remove(), i = null);
|
|
1353
1360
|
}
|
|
1354
|
-
function
|
|
1355
|
-
r ||
|
|
1361
|
+
function h() {
|
|
1362
|
+
r || oe(t.url, n);
|
|
1356
1363
|
}
|
|
1357
|
-
function
|
|
1364
|
+
function E(A) {
|
|
1358
1365
|
if (r) return;
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1366
|
+
const p = URL.createObjectURL(A);
|
|
1367
|
+
H(p, n), URL.revokeObjectURL(p);
|
|
1361
1368
|
}
|
|
1362
|
-
const
|
|
1363
|
-
return
|
|
1369
|
+
const f = ne(t);
|
|
1370
|
+
return G(f) ? m() : f === "unknown" ? (_(), Ie(t.url).then(async (A) => {
|
|
1364
1371
|
if (!r) {
|
|
1365
|
-
if (
|
|
1372
|
+
if (G(A)) {
|
|
1366
1373
|
t.mode = A, m();
|
|
1367
1374
|
return;
|
|
1368
1375
|
}
|
|
1369
1376
|
try {
|
|
1370
|
-
const
|
|
1371
|
-
if (
|
|
1372
|
-
|
|
1377
|
+
const p = await ae(t.url), o = X(p.type);
|
|
1378
|
+
if (G(o)) {
|
|
1379
|
+
c = URL.createObjectURL(p), t.url = c, t.mode = o, m();
|
|
1373
1380
|
return;
|
|
1374
1381
|
}
|
|
1375
|
-
v(),
|
|
1382
|
+
v(), E(p);
|
|
1376
1383
|
} catch {
|
|
1377
|
-
v(),
|
|
1384
|
+
v(), h();
|
|
1378
1385
|
}
|
|
1379
1386
|
}
|
|
1380
|
-
})) :
|
|
1387
|
+
})) : h(), b = { close: l }, b;
|
|
1381
1388
|
}
|
|
1382
|
-
function
|
|
1383
|
-
|
|
1389
|
+
function We(e) {
|
|
1390
|
+
Y = e;
|
|
1384
1391
|
}
|
|
1385
|
-
function
|
|
1392
|
+
function Qe(e) {
|
|
1386
1393
|
if (typeof document > "u")
|
|
1387
1394
|
return { close: () => {
|
|
1388
1395
|
} };
|
|
@@ -1392,8 +1399,8 @@ function He(e) {
|
|
|
1392
1399
|
const r = () => {
|
|
1393
1400
|
t = !0, n && (k(null, n), n.remove(), n = null), b?.close === r && (b = null);
|
|
1394
1401
|
}, i = { close: r };
|
|
1395
|
-
return b = i,
|
|
1396
|
-
a(
|
|
1402
|
+
return b = i, Y ? (k(
|
|
1403
|
+
a(M, {
|
|
1397
1404
|
options: { url: "", name: s("common.附件预览") },
|
|
1398
1405
|
title: s("common.正在获取文件信息"),
|
|
1399
1406
|
desc: s("common.请稍候,获取完成后将自动预览或下载"),
|
|
@@ -1401,12 +1408,12 @@ function He(e) {
|
|
|
1401
1408
|
onDestroy: r
|
|
1402
1409
|
}),
|
|
1403
1410
|
n
|
|
1404
|
-
),
|
|
1411
|
+
), Y.request(e).then((c) => {
|
|
1405
1412
|
if (t) return;
|
|
1406
|
-
const
|
|
1407
|
-
if (!
|
|
1413
|
+
const l = Y?.mapResponse(c, e);
|
|
1414
|
+
if (!l?.url) {
|
|
1408
1415
|
k(
|
|
1409
|
-
a(
|
|
1416
|
+
a(M, {
|
|
1410
1417
|
options: { url: "", name: s("common.附件预览") },
|
|
1411
1418
|
title: s("common.文件信息缺少URL"),
|
|
1412
1419
|
desc: s("common.请检查mapResponse是否返回了url字段"),
|
|
@@ -1417,22 +1424,22 @@ function He(e) {
|
|
|
1417
1424
|
);
|
|
1418
1425
|
return;
|
|
1419
1426
|
}
|
|
1420
|
-
|
|
1421
|
-
}).catch((
|
|
1427
|
+
se(l);
|
|
1428
|
+
}).catch((c) => {
|
|
1422
1429
|
if (t) return;
|
|
1423
|
-
const
|
|
1430
|
+
const l = c instanceof Error ? c.message : s("common.接口请求失败");
|
|
1424
1431
|
k(
|
|
1425
|
-
a(
|
|
1432
|
+
a(M, {
|
|
1426
1433
|
options: { url: "", name: s("common.附件预览") },
|
|
1427
1434
|
title: s("common.文件信息获取失败"),
|
|
1428
|
-
desc:
|
|
1435
|
+
desc: l,
|
|
1429
1436
|
spinning: !1,
|
|
1430
1437
|
onDestroy: r
|
|
1431
1438
|
}),
|
|
1432
1439
|
n
|
|
1433
1440
|
);
|
|
1434
1441
|
}), i) : (k(
|
|
1435
|
-
a(
|
|
1442
|
+
a(M, {
|
|
1436
1443
|
options: { url: "", name: s("common.附件预览") },
|
|
1437
1444
|
title: s("common.附件预览未初始化"),
|
|
1438
1445
|
desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
|
|
@@ -1442,18 +1449,18 @@ function He(e) {
|
|
|
1442
1449
|
n
|
|
1443
1450
|
), i);
|
|
1444
1451
|
}
|
|
1445
|
-
const
|
|
1446
|
-
openByParams:
|
|
1447
|
-
setup:
|
|
1452
|
+
const at = Object.assign(se, {
|
|
1453
|
+
openByParams: Qe,
|
|
1454
|
+
setup: We
|
|
1448
1455
|
});
|
|
1449
1456
|
export {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1457
|
+
at as J,
|
|
1458
|
+
Qe as a,
|
|
1459
|
+
We as b,
|
|
1460
|
+
et as g,
|
|
1461
|
+
nt as i,
|
|
1462
|
+
J as n,
|
|
1463
|
+
tt as r,
|
|
1464
|
+
$e as s,
|
|
1458
1465
|
s as t
|
|
1459
1466
|
};
|