@jt-home/mfe-components 1.0.43 → 1.0.44
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-DrZ9DS6y.js → index-BXyTJFiJ.js} +336 -301
- package/dist/index-CoLqaicq.cjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +100 -100
- package/dist/style.css +1 -1
- package/dist/types/locale/index.d.ts +3 -3
- package/dist/types/locale/types.d.ts +1 -0
- package/package.json +99 -99
- package/readme.md +694 -694
- package/dist/index-sksijs-r.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ElIcon as
|
|
1
|
+
import { ref as A, isRef as le, watch as $, defineComponent as E, openBlock as I, createElementBlock as O, createElementVNode as V, onBeforeUnmount as q, h as a, computed as j, onMounted as ee, nextTick as pe, render as _ } from "vue";
|
|
2
|
+
import { ElIcon as N } from "element-plus";
|
|
3
3
|
const he = {
|
|
4
4
|
common: {
|
|
5
5
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
|
|
@@ -11,6 +11,7 @@ const he = {
|
|
|
11
11
|
信息: "信息",
|
|
12
12
|
"信息集不能为空,最后一条数据不可删除": "信息集不能为空,最后一条数据不可删除",
|
|
13
13
|
共: "共",
|
|
14
|
+
"共{total}条记录": "共 {total} 条记录",
|
|
14
15
|
关闭: "关闭",
|
|
15
16
|
删除: "删除",
|
|
16
17
|
加载中___: "加载中...",
|
|
@@ -55,7 +56,7 @@ const he = {
|
|
|
55
56
|
附件预览: "附件预览",
|
|
56
57
|
附件预览未初始化: "附件预览未初始化"
|
|
57
58
|
}
|
|
58
|
-
},
|
|
59
|
+
}, ge = {
|
|
59
60
|
common: {
|
|
60
61
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js cannot read the file. It has been switched to browser built-in preview",
|
|
61
62
|
PDF加载中___: "PDF loading...",
|
|
@@ -66,6 +67,7 @@ const he = {
|
|
|
66
67
|
信息: "information",
|
|
67
68
|
"信息集不能为空,最后一条数据不可删除": "The information set cannot be empty, and the last piece of data cannot be deleted",
|
|
68
69
|
共: "total of",
|
|
70
|
+
"共{total}条记录": "Total {total} records",
|
|
69
71
|
关闭: "closed",
|
|
70
72
|
删除: "delete",
|
|
71
73
|
加载中___: "Loading...",
|
|
@@ -110,7 +112,7 @@ const he = {
|
|
|
110
112
|
附件预览: "Attachment Preview",
|
|
111
113
|
附件预览未初始化: "Attachment preview not initialized"
|
|
112
114
|
}
|
|
113
|
-
},
|
|
115
|
+
}, we = {
|
|
114
116
|
common: {
|
|
115
117
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในตัวเบราว์เซอร์",
|
|
116
118
|
PDF加载中___: "กําลังโหลดไฟล์ PDF ...",
|
|
@@ -121,6 +123,7 @@ const he = {
|
|
|
121
123
|
信息: "ข้อมูล",
|
|
122
124
|
"信息集不能为空,最后一条数据不可删除": "ชุดข้อมูลไม่สามารถว่างเปล่าได้ ข้อมูลสุดท้ายไม่สามารถลบได้",
|
|
123
125
|
共: "รวมทั้งหมด",
|
|
126
|
+
"共{total}条记录": "ทั้งหมด {total} รายการ",
|
|
124
127
|
关闭: "ปิด",
|
|
125
128
|
删除: "ลบ",
|
|
126
129
|
加载中___: "กําลังโหลด ...",
|
|
@@ -165,7 +168,7 @@ const he = {
|
|
|
165
168
|
附件预览: "เอกสารแนบตัวอย่าง",
|
|
166
169
|
附件预览未初始化: "การแสดงตัวอย่างของสิ่งที่แนบมาไม่ได้เริ่มต้น"
|
|
167
170
|
}
|
|
168
|
-
},
|
|
171
|
+
}, ye = {
|
|
169
172
|
common: {
|
|
170
173
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không thể đọc tập tin, đã chuyển sang trình duyệt built-in xem trước",
|
|
171
174
|
PDF加载中___: "Đang tải PDF...",
|
|
@@ -176,6 +179,7 @@ const he = {
|
|
|
176
179
|
信息: "thông tin / thông tin / thông tin",
|
|
177
180
|
"信息集不能为空,最后一条数据不可删除": "Bộ thông tin không thể trống, dữ liệu cuối cùng không thể bị xóa",
|
|
178
181
|
共: "tổng cộng",
|
|
182
|
+
"共{total}条记录": "Tổng {total} bản ghi",
|
|
179
183
|
关闭: "Đóng cửa đi",
|
|
180
184
|
删除: "Xóa bỏ nó đi",
|
|
181
185
|
加载中___: "Đang tải...",
|
|
@@ -220,7 +224,7 @@ const he = {
|
|
|
220
224
|
附件预览: "Xem trước tệp đính kèm",
|
|
221
225
|
附件预览未初始化: "Bản xem trước đính kèm không được khởi tạo"
|
|
222
226
|
}
|
|
223
|
-
},
|
|
227
|
+
}, be = {
|
|
224
228
|
common: {
|
|
225
229
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer este archivo, cambió a la vista previa integrada del navegador",
|
|
226
230
|
PDF加载中___: "Carga de PDF...",
|
|
@@ -231,6 +235,7 @@ const he = {
|
|
|
231
235
|
信息: "Información",
|
|
232
236
|
"信息集不能为空,最后一条数据不可删除": "El conjunto de información no puede estar vacío, el último elemento de datos no se puede eliminar.",
|
|
233
237
|
共: "Total",
|
|
238
|
+
"共{total}条记录": "Total {total} registros",
|
|
234
239
|
关闭: "Cierre",
|
|
235
240
|
删除: "Eliminación",
|
|
236
241
|
加载中___: "Loading...",
|
|
@@ -275,7 +280,7 @@ const he = {
|
|
|
275
280
|
附件预览: "Anexo Preview",
|
|
276
281
|
附件预览未初始化: "Anexo Preview no inicializado"
|
|
277
282
|
}
|
|
278
|
-
},
|
|
283
|
+
}, ke = {
|
|
279
284
|
common: {
|
|
280
285
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js tidak dapat membaca file ini, telah beralih ke pratinjau built-in browser",
|
|
281
286
|
PDF加载中___: "PDF sedang memuat...",
|
|
@@ -286,6 +291,7 @@ const he = {
|
|
|
286
291
|
信息: "Informasi:",
|
|
287
292
|
"信息集不能为空,最后一条数据不可删除": "Set informasi tidak dapat kosong, data terakhir tidak dapat dihapus, dan data terakhir tidak dapat dihapus.",
|
|
288
293
|
共: "bersama-sama",
|
|
294
|
+
"共{total}条记录": "Total {total} catatan",
|
|
289
295
|
关闭: "Penutupan",
|
|
290
296
|
删除: "Penghapusan",
|
|
291
297
|
加载中___: "sedang dimuat...",
|
|
@@ -341,6 +347,7 @@ const he = {
|
|
|
341
347
|
信息: "Information",
|
|
342
348
|
"信息集不能为空,最后一条数据不可删除": "Der Datensatz kann nicht leer sein, die letzten Daten können nicht gelöscht werden.",
|
|
343
349
|
共: "gemeinsam",
|
|
350
|
+
"共{total}条记录": "Insgesamt {total} Einträge",
|
|
344
351
|
关闭: "Schließen",
|
|
345
352
|
删除: "Löschen",
|
|
346
353
|
加载中___: "geladen...",
|
|
@@ -385,7 +392,7 @@ const he = {
|
|
|
385
392
|
附件预览: "Anhang Vorschau",
|
|
386
393
|
附件预览未初始化: "Anlage Vorschau nicht initialisiert"
|
|
387
394
|
}
|
|
388
|
-
},
|
|
395
|
+
}, Pe = {
|
|
389
396
|
common: {
|
|
390
397
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não pode ler o arquivo, mudou para a visualização integrada do navegador",
|
|
391
398
|
PDF加载中___: "PDF Carregando...",
|
|
@@ -396,6 +403,7 @@ const he = {
|
|
|
396
403
|
信息: "Informações",
|
|
397
404
|
"信息集不能为空,最后一条数据不可删除": "O conjunto de informações não pode estar vazio, o último item de dados não pode ser excluído",
|
|
398
405
|
共: "Total",
|
|
406
|
+
"共{total}条记录": "Total de {total} registros",
|
|
399
407
|
关闭: "Fechamento",
|
|
400
408
|
删除: "Exclusão",
|
|
401
409
|
加载中___: "Loading...",
|
|
@@ -440,78 +448,105 @@ const he = {
|
|
|
440
448
|
附件预览: "Anexo Preview",
|
|
441
449
|
附件预览未初始化: "Anexo Preview não inicializado"
|
|
442
450
|
}
|
|
443
|
-
}, Ae = {},
|
|
451
|
+
}, Ae = {}, De = {
|
|
444
452
|
"zh-cn": he,
|
|
445
|
-
en:
|
|
446
|
-
th:
|
|
447
|
-
vi:
|
|
448
|
-
es:
|
|
449
|
-
id:
|
|
453
|
+
en: ge,
|
|
454
|
+
th: we,
|
|
455
|
+
vi: ye,
|
|
456
|
+
es: be,
|
|
457
|
+
id: ke,
|
|
450
458
|
de: _e,
|
|
451
|
-
pt:
|
|
459
|
+
pt: Pe,
|
|
452
460
|
km: Ae
|
|
453
|
-
},
|
|
454
|
-
zh: "zh-cn",
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
461
|
+
}, S = [
|
|
462
|
+
{ key: "zh", label: "简体中文", displayLabel: "简体中文", elementPlusLocale: "zh-cn" },
|
|
463
|
+
{ key: "en", label: "英语", displayLabel: "English", elementPlusLocale: "en" },
|
|
464
|
+
{ key: "th", label: "泰语", displayLabel: "ไทย", elementPlusLocale: "th" },
|
|
465
|
+
{ key: "vi", label: "越南语", displayLabel: "Tiếng Việt", elementPlusLocale: "vi" },
|
|
466
|
+
{ key: "pt", label: "葡萄牙语", displayLabel: "Português", elementPlusLocale: "pt" },
|
|
467
|
+
{ key: "id", label: "印尼语", displayLabel: "Bahasa Indonesia", elementPlusLocale: "id" },
|
|
468
|
+
{ key: "de", label: "德语", displayLabel: "Deutsch", elementPlusLocale: "de" },
|
|
469
|
+
{ key: "es", label: "西班牙语", displayLabel: "Español", elementPlusLocale: "es" },
|
|
470
|
+
{ key: "km", label: "柬埔寨语", displayLabel: "ភាសាខ្មែរ", elementPlusLocale: "km" }
|
|
471
|
+
];
|
|
472
|
+
Object.freeze(
|
|
473
|
+
Object.fromEntries(S.map((e) => [e.key, e.elementPlusLocale]))
|
|
474
|
+
);
|
|
475
|
+
function Le(e, t = {}) {
|
|
476
|
+
const n = t.fallback ?? "zh", o = Ee(t.languageList), i = e.toLowerCase();
|
|
477
|
+
return o.find((l) => l.key === i) ?? o.find((l) => l.key === n) ?? S[0];
|
|
478
|
+
}
|
|
479
|
+
function je(e, t = {}) {
|
|
480
|
+
return Le(e, t).elementPlusLocale;
|
|
481
|
+
}
|
|
482
|
+
function Ee(e) {
|
|
483
|
+
return e != null && e.length ? e.map((t) => {
|
|
484
|
+
const n = t.key ?? t.value, o = S.find((i) => i.key === n) ?? S[0];
|
|
485
|
+
return {
|
|
486
|
+
...o,
|
|
487
|
+
...t,
|
|
488
|
+
key: o.key,
|
|
489
|
+
elementPlusLocale: t.elementPlusLocale ?? o.elementPlusLocale
|
|
490
|
+
};
|
|
491
|
+
}) : S;
|
|
492
|
+
}
|
|
493
|
+
const xe = {
|
|
494
|
+
"zh-hans": "zh",
|
|
495
|
+
"zh-cn": "zh",
|
|
496
|
+
cn: "zh",
|
|
460
497
|
"en-us": "en",
|
|
461
|
-
th_th: "th",
|
|
462
498
|
"th-th": "th",
|
|
463
|
-
vi_vn: "vi",
|
|
464
499
|
"vi-vn": "vi",
|
|
465
|
-
es_es: "es",
|
|
466
500
|
"es-es": "es",
|
|
467
|
-
id_id: "id",
|
|
468
501
|
"id-id": "id",
|
|
469
|
-
de_de: "de",
|
|
470
502
|
"de-de": "de",
|
|
471
|
-
pt_pt: "pt",
|
|
472
503
|
"pt-pt": "pt",
|
|
473
|
-
pt_br: "pt",
|
|
474
504
|
"pt-br": "pt",
|
|
475
|
-
km_kh: "km",
|
|
476
505
|
"km-kh": "km"
|
|
477
506
|
};
|
|
478
|
-
function
|
|
507
|
+
function U(e) {
|
|
479
508
|
const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
|
|
480
|
-
return
|
|
509
|
+
return je(xe[t] || t) || "zh-cn";
|
|
481
510
|
}
|
|
482
|
-
const B =
|
|
483
|
-
let
|
|
484
|
-
function
|
|
485
|
-
|
|
511
|
+
const B = A("zh-cn");
|
|
512
|
+
let W;
|
|
513
|
+
function te() {
|
|
514
|
+
W?.(), W = void 0;
|
|
486
515
|
}
|
|
487
|
-
function
|
|
488
|
-
return e ? typeof e == "function" ?
|
|
516
|
+
function oe(e) {
|
|
517
|
+
return e ? typeof e == "function" ? U(e()) : le(e) ? U(e.value) : U(e) : B.value;
|
|
489
518
|
}
|
|
490
|
-
function
|
|
519
|
+
function Re(e, t) {
|
|
491
520
|
if (e)
|
|
492
521
|
return t.split(".").reduce((n, o) => {
|
|
493
522
|
if (!(!n || typeof n != "object"))
|
|
494
523
|
return n[o];
|
|
495
524
|
}, e);
|
|
496
525
|
}
|
|
497
|
-
function
|
|
498
|
-
const n =
|
|
526
|
+
function re(e, t) {
|
|
527
|
+
const n = Re(De[e], t);
|
|
499
528
|
return typeof n == "string" ? n : void 0;
|
|
500
529
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
530
|
+
function Ce(e, t) {
|
|
531
|
+
return t ? e.replace(/\{(\w+)\}/g, (n, o) => {
|
|
532
|
+
const i = t[o];
|
|
533
|
+
return i == null ? n : String(i);
|
|
534
|
+
}) : e;
|
|
535
|
+
}
|
|
536
|
+
function st(e) {
|
|
537
|
+
te(), B.value = U(e);
|
|
503
538
|
}
|
|
504
|
-
function
|
|
539
|
+
function ct() {
|
|
505
540
|
return B.value;
|
|
506
541
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
542
|
+
function ut() {
|
|
543
|
+
te(), B.value = "zh-cn";
|
|
509
544
|
}
|
|
510
|
-
function
|
|
511
|
-
if (
|
|
512
|
-
if (typeof t.locale == "function" ||
|
|
513
|
-
|
|
514
|
-
() =>
|
|
545
|
+
function dt(e, t = {}) {
|
|
546
|
+
if (te(), t.locale) {
|
|
547
|
+
if (typeof t.locale == "function" || le(t.locale)) {
|
|
548
|
+
W = $(
|
|
549
|
+
() => oe(t.locale),
|
|
515
550
|
(n) => {
|
|
516
551
|
B.value = n;
|
|
517
552
|
},
|
|
@@ -519,72 +554,72 @@ function rt(e, t = {}) {
|
|
|
519
554
|
);
|
|
520
555
|
return;
|
|
521
556
|
}
|
|
522
|
-
B.value =
|
|
557
|
+
B.value = oe(t.locale);
|
|
523
558
|
}
|
|
524
559
|
}
|
|
525
|
-
function s(e, t = e) {
|
|
526
|
-
const
|
|
527
|
-
return
|
|
560
|
+
function s(e, t = e, n) {
|
|
561
|
+
const o = t || e, i = B.value, l = re(i, e) || re("zh-cn", e) || o || e;
|
|
562
|
+
return Ce(l, n);
|
|
528
563
|
}
|
|
529
564
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
530
|
-
var
|
|
565
|
+
var Be = /* @__PURE__ */ E({
|
|
531
566
|
name: "Download",
|
|
532
567
|
__name: "download",
|
|
533
568
|
setup(e) {
|
|
534
|
-
return (t, n) => (
|
|
569
|
+
return (t, n) => (I(), O("svg", {
|
|
535
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
536
571
|
viewBox: "0 0 1024 1024"
|
|
537
572
|
}, [
|
|
538
|
-
|
|
573
|
+
V("path", {
|
|
539
574
|
fill: "currentColor",
|
|
540
575
|
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
|
|
541
576
|
})
|
|
542
577
|
]));
|
|
543
578
|
}
|
|
544
|
-
}),
|
|
579
|
+
}), Te = Be, ze = /* @__PURE__ */ E({
|
|
545
580
|
name: "RefreshLeft",
|
|
546
581
|
__name: "refresh-left",
|
|
547
582
|
setup(e) {
|
|
548
|
-
return (t, n) => (
|
|
583
|
+
return (t, n) => (I(), O("svg", {
|
|
549
584
|
xmlns: "http://www.w3.org/2000/svg",
|
|
550
585
|
viewBox: "0 0 1024 1024"
|
|
551
586
|
}, [
|
|
552
|
-
|
|
587
|
+
V("path", {
|
|
553
588
|
fill: "currentColor",
|
|
554
589
|
d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
|
|
555
590
|
})
|
|
556
591
|
]));
|
|
557
592
|
}
|
|
558
|
-
}),
|
|
593
|
+
}), Fe = ze, Me = /* @__PURE__ */ E({
|
|
559
594
|
name: "ZoomIn",
|
|
560
595
|
__name: "zoom-in",
|
|
561
596
|
setup(e) {
|
|
562
|
-
return (t, n) => (
|
|
597
|
+
return (t, n) => (I(), O("svg", {
|
|
563
598
|
xmlns: "http://www.w3.org/2000/svg",
|
|
564
599
|
viewBox: "0 0 1024 1024"
|
|
565
600
|
}, [
|
|
566
|
-
|
|
601
|
+
V("path", {
|
|
567
602
|
fill: "currentColor",
|
|
568
603
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
|
|
569
604
|
})
|
|
570
605
|
]));
|
|
571
606
|
}
|
|
572
|
-
}),
|
|
607
|
+
}), Se = Me, Je = /* @__PURE__ */ E({
|
|
573
608
|
name: "ZoomOut",
|
|
574
609
|
__name: "zoom-out",
|
|
575
610
|
setup(e) {
|
|
576
|
-
return (t, n) => (
|
|
611
|
+
return (t, n) => (I(), O("svg", {
|
|
577
612
|
xmlns: "http://www.w3.org/2000/svg",
|
|
578
613
|
viewBox: "0 0 1024 1024"
|
|
579
614
|
}, [
|
|
580
|
-
|
|
615
|
+
V("path", {
|
|
581
616
|
fill: "currentColor",
|
|
582
617
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
|
|
583
618
|
})
|
|
584
619
|
]));
|
|
585
620
|
}
|
|
586
|
-
}),
|
|
587
|
-
const
|
|
621
|
+
}), Ne = Je;
|
|
622
|
+
const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30sTPt6dEO74mKXLoiCgDTi1RFbUMUBhZXluQUDKbnWxWtjMLB2pYqUjmFg8WUzSg0TL+rCKVZeJheRJj9DYWHRRnHbBSYnr+qcSsoKCyeLKcfK/emc2UqH4LFGMcVWVftTC4w/TbmhGQjwvR6RBmNAbMYx4nD7k/I1GF3ZZOH3RtHAbDhcZQAG5SJgOn1Vt0mAzYwIUJgvjJ/2OVo2pcmcoQZWehxpBGue5sJEQTryyTBeuMoCtadEFmwjkwYzIyjNJief02IONj3OAqE/ZVJhJnZj3RS1c4nld04ijiC/5EJhbUyobBWJhT2OY5CYa1MKKyVCYXpdSIUphdbobB2HIXCWplQmJGFhZUn07kyNaFgbUsx1/1tb1Jh+i1hDmu0Y+uEN4xqV9ki5Q27atfmKWtYqd1lW84wqj1kr5xhB+3RkjGMrl4yxrCm9pG984V5ytZJINjpY7hmLNki5XjdP0fGFkZ0qL1kfGEt7erzgsYY1lYefrtWsIZ5NAMMMBNg9gEGmD3sejbVnRpyjAvs5rr3DzDAAOsEmH2AAQZYJ8Ds4wJrSlN1NE3+CDYJu+5NgNkHGGCAdQLMPsAAA0zuEQyYbYABBlgnwOwDDDDAOvVhl5NJ1Fu1O6lHMGA/xQl2rPodpcBq6gfYYIABBpgJsAdiBDvX/cTAxF4egNkEWGDY5Q5s8v9onoZdR3KNC4yOg7AzOccFNvi36POJIy4wqgZgF/KIC6yporuCwNrq/nNW7ckzLjCi/bO//MEF9mCAAQYYYDwCDDAmAQYYkwADjEmAAcYkwABjEmCAMQkwwJgEGGBMAgwwJgEGGJMAA4xJgAHGJMD+B1hGE6hwgK1oAqUOsJz4lymHCuJfrpTM9SicYC/EvUw5lRD3Psde4lP29YSJG8bse+ulvZZ5uFTCV5YZl6hpXKXKs5TlL22jnlCaM7uHV7NEPam02LwwaVYkCiGEEEIIITTUH1Fqd5V0WMtQAAAAAElFTkSuQmCC", Ye = "data:image/png;base64,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", Ie = /* @__PURE__ */ new Set([
|
|
588
623
|
"jpg",
|
|
589
624
|
"jpeg",
|
|
590
625
|
"png",
|
|
@@ -594,7 +629,7 @@ const Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
594
629
|
"svg",
|
|
595
630
|
"avif",
|
|
596
631
|
"ico"
|
|
597
|
-
]),
|
|
632
|
+
]), Oe = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ve = /* @__PURE__ */ new Set([
|
|
598
633
|
"mp3",
|
|
599
634
|
"wav",
|
|
600
635
|
"ogg",
|
|
@@ -602,7 +637,7 @@ const Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
602
637
|
"m4a",
|
|
603
638
|
"aac",
|
|
604
639
|
"flac"
|
|
605
|
-
]),
|
|
640
|
+
]), qe = /* @__PURE__ */ new Set([
|
|
606
641
|
"html",
|
|
607
642
|
"htm",
|
|
608
643
|
"txt",
|
|
@@ -611,7 +646,7 @@ const Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
611
646
|
"csv",
|
|
612
647
|
"md",
|
|
613
648
|
"log"
|
|
614
|
-
]),
|
|
649
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
615
650
|
"doc",
|
|
616
651
|
"docx",
|
|
617
652
|
"xls",
|
|
@@ -621,35 +656,35 @@ const Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
621
656
|
"zip",
|
|
622
657
|
"rar",
|
|
623
658
|
"7z"
|
|
624
|
-
]),
|
|
659
|
+
]), Q = {
|
|
625
660
|
component: "JtAttachmentPreview",
|
|
626
661
|
marker: "2026-06-25-download-fix-recheck",
|
|
627
662
|
source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
|
|
628
663
|
pdfLoadMode: "fetch-bytes-then-pdfjs-data",
|
|
629
664
|
previewDownloadMode: "blob-only-no-raw-url-fallback"
|
|
630
665
|
};
|
|
631
|
-
function
|
|
632
|
-
console.info(`[JtAttachmentPreview DEBUG ${
|
|
633
|
-
...
|
|
666
|
+
function k(e, t) {
|
|
667
|
+
console.info(`[JtAttachmentPreview DEBUG ${Q.marker}] ${e}`, {
|
|
668
|
+
...Q,
|
|
634
669
|
...t
|
|
635
670
|
});
|
|
636
671
|
}
|
|
637
|
-
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ =
|
|
638
|
-
let
|
|
639
|
-
async function
|
|
640
|
-
return
|
|
672
|
+
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = Q, k("module-loaded"));
|
|
673
|
+
let P = null, H = null, Y = null;
|
|
674
|
+
async function He() {
|
|
675
|
+
return H || (H = Promise.all([
|
|
641
676
|
import("./pdf-BmBuG7of.js"),
|
|
642
677
|
import("./pdf.worker.min-4PI-nNLo.js")
|
|
643
|
-
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))),
|
|
678
|
+
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), H;
|
|
644
679
|
}
|
|
645
|
-
function
|
|
680
|
+
function Ke(e) {
|
|
646
681
|
return typeof e == "string" ? { url: e } : e;
|
|
647
682
|
}
|
|
648
683
|
function se(e) {
|
|
649
684
|
const [t] = e.split(/[?#]/);
|
|
650
685
|
return t ?? "";
|
|
651
686
|
}
|
|
652
|
-
function
|
|
687
|
+
function ne(e, t) {
|
|
653
688
|
if (t?.trim()) return t.trim();
|
|
654
689
|
const n = se(e).split("/").filter(Boolean).pop();
|
|
655
690
|
if (!n) return s("common.附件预览");
|
|
@@ -659,17 +694,17 @@ function te(e, t) {
|
|
|
659
694
|
return n;
|
|
660
695
|
}
|
|
661
696
|
}
|
|
662
|
-
function
|
|
697
|
+
function X(e) {
|
|
663
698
|
return se(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
|
|
664
699
|
}
|
|
665
|
-
function
|
|
700
|
+
function We(e) {
|
|
666
701
|
return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
|
|
667
702
|
}
|
|
668
|
-
function
|
|
669
|
-
const t =
|
|
670
|
-
return
|
|
703
|
+
function Qe(e) {
|
|
704
|
+
const t = We(e);
|
|
705
|
+
return Ie.has(t) ? "image" : t === "pdf" ? "pdf" : Oe.has(t) ? "video" : Ve.has(t) ? "audio" : qe.has(t) ? "iframe" : Ge.has(t) ? "unsupported" : "unknown";
|
|
671
706
|
}
|
|
672
|
-
function
|
|
707
|
+
function ae(e) {
|
|
673
708
|
const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
674
709
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
|
|
675
710
|
}
|
|
@@ -677,42 +712,42 @@ function ce(e) {
|
|
|
677
712
|
if (!e.url.trim()) return "empty";
|
|
678
713
|
if (e.mode && e.mode !== "auto") return e.mode;
|
|
679
714
|
if (e.mimeType) {
|
|
680
|
-
const n =
|
|
715
|
+
const n = ae(e.mimeType);
|
|
681
716
|
if (n !== "unknown") return n;
|
|
682
717
|
}
|
|
683
|
-
const t =
|
|
684
|
-
e.extension ||
|
|
718
|
+
const t = Qe(
|
|
719
|
+
e.extension || X(e.name || "") || X(e.url)
|
|
685
720
|
);
|
|
686
721
|
return t !== "unknown" ? t : "unknown";
|
|
687
722
|
}
|
|
688
|
-
async function
|
|
723
|
+
async function Xe(e) {
|
|
689
724
|
try {
|
|
690
725
|
const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
|
|
691
|
-
return
|
|
726
|
+
return ae(n);
|
|
692
727
|
} catch {
|
|
693
728
|
return "unknown";
|
|
694
729
|
}
|
|
695
730
|
}
|
|
696
|
-
async function
|
|
731
|
+
async function ue(e) {
|
|
697
732
|
const t = await fetch(e);
|
|
698
733
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
699
734
|
return t.blob();
|
|
700
735
|
}
|
|
701
|
-
async function
|
|
702
|
-
|
|
736
|
+
async function Ze(e) {
|
|
737
|
+
k("fetch-pdf-bytes-start", {
|
|
703
738
|
url: e
|
|
704
739
|
});
|
|
705
740
|
const t = await fetch(e);
|
|
706
741
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
707
742
|
const n = new Uint8Array(await t.arrayBuffer());
|
|
708
|
-
return
|
|
743
|
+
return k("fetch-pdf-bytes-done", {
|
|
709
744
|
url: e,
|
|
710
745
|
byteLength: n.byteLength,
|
|
711
746
|
contentType: t.headers.get("content-type") ?? ""
|
|
712
747
|
}), n;
|
|
713
748
|
}
|
|
714
|
-
function
|
|
715
|
-
const n =
|
|
749
|
+
function $e(e, t) {
|
|
750
|
+
const n = X(t);
|
|
716
751
|
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";
|
|
717
752
|
}
|
|
718
753
|
function de(e, t, n, o = !1) {
|
|
@@ -722,18 +757,18 @@ function de(e, t, n, o = !1) {
|
|
|
722
757
|
class: n,
|
|
723
758
|
type: "button",
|
|
724
759
|
onClick: () => {
|
|
725
|
-
|
|
760
|
+
k("download-button-click", {
|
|
726
761
|
url: e,
|
|
727
762
|
downloadName: t,
|
|
728
763
|
fallbackToRawUrl: o
|
|
729
|
-
}),
|
|
764
|
+
}), fe(e, t, { fallbackToRawUrl: o });
|
|
730
765
|
}
|
|
731
766
|
},
|
|
732
767
|
[
|
|
733
768
|
a(
|
|
734
|
-
|
|
769
|
+
N,
|
|
735
770
|
{ class: "jt-attachment-preview-service__download-icon" },
|
|
736
|
-
() => a(
|
|
771
|
+
() => a(Te)
|
|
737
772
|
),
|
|
738
773
|
a(
|
|
739
774
|
"span",
|
|
@@ -743,10 +778,10 @@ function de(e, t, n, o = !1) {
|
|
|
743
778
|
]
|
|
744
779
|
);
|
|
745
780
|
}
|
|
746
|
-
function
|
|
781
|
+
function K(e) {
|
|
747
782
|
return e === "image" || e === "pdf";
|
|
748
783
|
}
|
|
749
|
-
function
|
|
784
|
+
function me(e) {
|
|
750
785
|
return a(
|
|
751
786
|
"div",
|
|
752
787
|
{ class: "jt-attachment-preview-service__preview-fallback" },
|
|
@@ -772,36 +807,36 @@ function ue(e) {
|
|
|
772
807
|
]
|
|
773
808
|
);
|
|
774
809
|
}
|
|
775
|
-
function
|
|
810
|
+
function Z(e, t) {
|
|
776
811
|
const n = document.createElement("a");
|
|
777
812
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
|
|
778
813
|
}
|
|
779
|
-
async function
|
|
780
|
-
|
|
814
|
+
async function fe(e, t, n = {}) {
|
|
815
|
+
k("download-start", {
|
|
781
816
|
url: e,
|
|
782
817
|
downloadName: t,
|
|
783
818
|
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
784
819
|
});
|
|
785
820
|
let o = "";
|
|
786
821
|
try {
|
|
787
|
-
const i = await
|
|
788
|
-
o = URL.createObjectURL(i),
|
|
822
|
+
const i = await ue(e);
|
|
823
|
+
o = URL.createObjectURL(i), k("download-blob-ready", {
|
|
789
824
|
url: e,
|
|
790
825
|
downloadName: t,
|
|
791
826
|
blobType: i.type,
|
|
792
827
|
blobSize: i.size
|
|
793
|
-
}),
|
|
828
|
+
}), Z(o, t);
|
|
794
829
|
} catch {
|
|
795
|
-
|
|
830
|
+
k("download-blob-failed", {
|
|
796
831
|
url: e,
|
|
797
832
|
downloadName: t,
|
|
798
833
|
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
799
|
-
}), n.fallbackToRawUrl &&
|
|
834
|
+
}), n.fallbackToRawUrl && Z(e, t);
|
|
800
835
|
} finally {
|
|
801
836
|
o && window.setTimeout(() => URL.revokeObjectURL(o), 1e3);
|
|
802
837
|
}
|
|
803
838
|
}
|
|
804
|
-
const
|
|
839
|
+
const et = E({
|
|
805
840
|
name: "JtAttachmentPreviewPdfCanvas",
|
|
806
841
|
props: {
|
|
807
842
|
url: {
|
|
@@ -826,83 +861,83 @@ const We = E({
|
|
|
826
861
|
previewError: (e) => e instanceof Event
|
|
827
862
|
},
|
|
828
863
|
setup(e, { emit: t }) {
|
|
829
|
-
const n =
|
|
830
|
-
let m = null, b = [],
|
|
831
|
-
async function
|
|
832
|
-
if (!
|
|
833
|
-
const g = typeof
|
|
864
|
+
const n = A("loading"), o = A([]), i = A([]), l = /* @__PURE__ */ new Map(), c = A("");
|
|
865
|
+
let m = null, b = [], f = 0;
|
|
866
|
+
async function v(r, u) {
|
|
867
|
+
if (!u) return null;
|
|
868
|
+
const g = typeof u == "string" ? await r.getDestination(u) : u;
|
|
834
869
|
return !Array.isArray(g) || !g[0] ? null : await r.getPageIndex(g[0]) + 1;
|
|
835
870
|
}
|
|
836
|
-
async function x(r,
|
|
837
|
-
if (!
|
|
871
|
+
async function x(r, u, g = 0) {
|
|
872
|
+
if (!u?.length) return [];
|
|
838
873
|
const w = [];
|
|
839
|
-
for (const
|
|
840
|
-
const
|
|
874
|
+
for (const L of u) {
|
|
875
|
+
const T = await v(r, L.dest);
|
|
841
876
|
w.push({
|
|
842
|
-
title:
|
|
843
|
-
pageNumber:
|
|
877
|
+
title: L.title || s("common.未命名标题"),
|
|
878
|
+
pageNumber: T,
|
|
844
879
|
level: g
|
|
845
880
|
});
|
|
846
|
-
const R = await x(r,
|
|
881
|
+
const R = await x(r, L.items, g + 1);
|
|
847
882
|
w.push(...R);
|
|
848
883
|
}
|
|
849
884
|
return w;
|
|
850
885
|
}
|
|
851
|
-
function
|
|
852
|
-
|
|
886
|
+
function h() {
|
|
887
|
+
f += 1;
|
|
853
888
|
for (const r of b)
|
|
854
889
|
r.cancel();
|
|
855
|
-
b = [], m?.destroy(), m = null,
|
|
890
|
+
b = [], m?.destroy(), m = null, l.clear();
|
|
856
891
|
}
|
|
857
892
|
async function D() {
|
|
858
|
-
|
|
859
|
-
const r =
|
|
860
|
-
n.value = "loading",
|
|
893
|
+
h();
|
|
894
|
+
const r = f;
|
|
895
|
+
n.value = "loading", c.value = "", o.value = [], i.value = [];
|
|
861
896
|
try {
|
|
862
|
-
const
|
|
863
|
-
if (r !==
|
|
864
|
-
const g = await
|
|
865
|
-
if (r !==
|
|
866
|
-
|
|
897
|
+
const u = await He();
|
|
898
|
+
if (r !== f) return;
|
|
899
|
+
const g = await Ze(e.url);
|
|
900
|
+
if (r !== f) return;
|
|
901
|
+
k("render-pdf-get-document-data", {
|
|
867
902
|
byteLength: g.byteLength
|
|
868
|
-
}), m =
|
|
903
|
+
}), m = u.getDocument({ data: g });
|
|
869
904
|
const w = await m.promise;
|
|
870
|
-
if (r !==
|
|
905
|
+
if (r !== f) return;
|
|
871
906
|
o.value = Array.from(
|
|
872
907
|
{ length: w.numPages },
|
|
873
908
|
(R, C) => C + 1
|
|
874
909
|
), i.value = await x(
|
|
875
910
|
w,
|
|
876
911
|
await w.getOutline()
|
|
877
|
-
), await
|
|
878
|
-
const
|
|
879
|
-
(
|
|
912
|
+
), await pe();
|
|
913
|
+
const L = l.values().next().value, T = Math.max(
|
|
914
|
+
(L?.parentElement?.clientWidth ?? 800) - 32,
|
|
880
915
|
320
|
|
881
916
|
);
|
|
882
917
|
for (const R of o.value) {
|
|
883
|
-
if (r !==
|
|
884
|
-
const C = await w.getPage(R), y =
|
|
885
|
-
if (!y || !
|
|
886
|
-
const
|
|
887
|
-
y.width = Math.floor(
|
|
888
|
-
const
|
|
918
|
+
if (r !== f) return;
|
|
919
|
+
const C = await w.getPage(R), y = l.get(R), z = y?.getContext("2d");
|
|
920
|
+
if (!y || !z) continue;
|
|
921
|
+
const G = C.getViewport({ scale: 1 }), d = Math.min(T / G.width, 2), F = C.getViewport({ scale: d }), J = window.devicePixelRatio || 1;
|
|
922
|
+
y.width = Math.floor(F.width * J), y.height = Math.floor(F.height * J), y.style.width = `${Math.floor(F.width)}px`, y.style.height = `${Math.floor(F.height)}px`, z.setTransform(J, 0, 0, J, 0, 0);
|
|
923
|
+
const ie = C.render({
|
|
889
924
|
canvas: y,
|
|
890
|
-
canvasContext:
|
|
891
|
-
viewport:
|
|
925
|
+
canvasContext: z,
|
|
926
|
+
viewport: F
|
|
892
927
|
});
|
|
893
|
-
b.push(
|
|
928
|
+
b.push(ie), await ie.promise;
|
|
894
929
|
}
|
|
895
|
-
if (r !==
|
|
930
|
+
if (r !== f) return;
|
|
896
931
|
n.value = "ready", t("previewLoad", new Event("load"));
|
|
897
|
-
} catch (
|
|
898
|
-
if (r !==
|
|
899
|
-
n.value = "error",
|
|
932
|
+
} catch (u) {
|
|
933
|
+
if (r !== f) return;
|
|
934
|
+
n.value = "error", c.value = u instanceof Error ? u.message : s("common.PDF加载失败"), t("previewError", new Event("error"));
|
|
900
935
|
}
|
|
901
936
|
}
|
|
902
|
-
|
|
903
|
-
function
|
|
937
|
+
$(() => e.url, D, { immediate: !0 }), q(h);
|
|
938
|
+
function p(r) {
|
|
904
939
|
if (!r) return;
|
|
905
|
-
|
|
940
|
+
l.get(r)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
906
941
|
}
|
|
907
942
|
return () => a("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
908
943
|
n.value === "loading" ? a(
|
|
@@ -911,8 +946,8 @@ const We = E({
|
|
|
911
946
|
s("common.PDF加载中___")
|
|
912
947
|
) : null,
|
|
913
948
|
n.value === "error" ? a("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
914
|
-
|
|
915
|
-
icon:
|
|
949
|
+
me({
|
|
950
|
+
icon: Ye,
|
|
916
951
|
name: e.name
|
|
917
952
|
})
|
|
918
953
|
]) : null,
|
|
@@ -944,16 +979,16 @@ const We = E({
|
|
|
944
979
|
class: "jt-attachment-preview-service__pdf-outline-list"
|
|
945
980
|
},
|
|
946
981
|
i.value.map(
|
|
947
|
-
(r,
|
|
982
|
+
(r, u) => a(
|
|
948
983
|
"button",
|
|
949
984
|
{
|
|
950
|
-
key: `${r.title}-${
|
|
985
|
+
key: `${r.title}-${u}`,
|
|
951
986
|
class: "jt-attachment-preview-service__pdf-outline-item",
|
|
952
987
|
style: { paddingLeft: `${12 + r.level * 14}px` },
|
|
953
988
|
type: "button",
|
|
954
989
|
disabled: !r.pageNumber,
|
|
955
990
|
title: r.title,
|
|
956
|
-
onClick: () =>
|
|
991
|
+
onClick: () => p(r.pageNumber)
|
|
957
992
|
},
|
|
958
993
|
r.title
|
|
959
994
|
)
|
|
@@ -967,8 +1002,8 @@ const We = E({
|
|
|
967
1002
|
o.value.map(
|
|
968
1003
|
(r) => a("canvas", {
|
|
969
1004
|
key: r,
|
|
970
|
-
ref: (
|
|
971
|
-
|
|
1005
|
+
ref: (u) => {
|
|
1006
|
+
u instanceof HTMLCanvasElement && l.set(r, u);
|
|
972
1007
|
},
|
|
973
1008
|
class: "jt-attachment-preview-service__pdf-page"
|
|
974
1009
|
})
|
|
@@ -978,7 +1013,7 @@ const We = E({
|
|
|
978
1013
|
)
|
|
979
1014
|
]);
|
|
980
1015
|
}
|
|
981
|
-
}),
|
|
1016
|
+
}), tt = E({
|
|
982
1017
|
name: "JtAttachmentPreviewImageTransform",
|
|
983
1018
|
props: {
|
|
984
1019
|
url: {
|
|
@@ -1007,65 +1042,65 @@ const We = E({
|
|
|
1007
1042
|
previewError: (e) => e instanceof Event
|
|
1008
1043
|
},
|
|
1009
1044
|
setup(e, { emit: t }) {
|
|
1010
|
-
const n =
|
|
1011
|
-
let
|
|
1012
|
-
const D =
|
|
1045
|
+
const n = A(null), o = A("ready"), i = A(1), l = A(!1);
|
|
1046
|
+
let c = 0, m = 0, b = 0, f = 0, v = 0, x = 0, h = 0;
|
|
1047
|
+
const D = j(
|
|
1013
1048
|
() => ({
|
|
1014
1049
|
"--jt-attachment-preview-service-image-fit": e.fit,
|
|
1015
|
-
transform: `translate(${
|
|
1050
|
+
transform: `translate(${c}px, ${m}px) scale(${i.value})`
|
|
1016
1051
|
})
|
|
1017
1052
|
);
|
|
1018
|
-
function
|
|
1019
|
-
n.value && (n.value.style.transform = `translate(${
|
|
1053
|
+
function p() {
|
|
1054
|
+
n.value && (n.value.style.transform = `translate(${c}px, ${m}px) scale(${i.value})`);
|
|
1020
1055
|
}
|
|
1021
1056
|
function r() {
|
|
1022
|
-
|
|
1023
|
-
|
|
1057
|
+
h || (h = window.requestAnimationFrame(() => {
|
|
1058
|
+
h = 0, p();
|
|
1024
1059
|
}));
|
|
1025
1060
|
}
|
|
1026
|
-
function d
|
|
1027
|
-
i.value = Math.min(Math.max(Number(
|
|
1061
|
+
function u(d) {
|
|
1062
|
+
i.value = Math.min(Math.max(Number(d.toFixed(2)), 0.2), 5), i.value <= 1 && (c = 0, m = 0), p();
|
|
1028
1063
|
}
|
|
1029
1064
|
function g() {
|
|
1030
|
-
|
|
1065
|
+
u(i.value + 0.2);
|
|
1031
1066
|
}
|
|
1032
1067
|
function w() {
|
|
1033
|
-
const
|
|
1034
|
-
i.value =
|
|
1068
|
+
const d = Math.max(Number((i.value - 0.2).toFixed(2)), 0.2);
|
|
1069
|
+
i.value = d, d <= 1 && (c = 0, m = 0), p();
|
|
1035
1070
|
}
|
|
1036
|
-
function
|
|
1037
|
-
|
|
1071
|
+
function L() {
|
|
1072
|
+
c = 0, m = 0, u(1);
|
|
1038
1073
|
}
|
|
1039
|
-
function
|
|
1040
|
-
o.value = "ready", t("previewLoad",
|
|
1074
|
+
function T(d) {
|
|
1075
|
+
o.value = "ready", t("previewLoad", d);
|
|
1041
1076
|
}
|
|
1042
|
-
function R(
|
|
1043
|
-
o.value = "error", t("previewError",
|
|
1077
|
+
function R(d) {
|
|
1078
|
+
o.value = "error", t("previewError", d);
|
|
1044
1079
|
}
|
|
1045
|
-
function C(
|
|
1046
|
-
i.value <= 1 || (
|
|
1080
|
+
function C(d) {
|
|
1081
|
+
i.value <= 1 || (d.preventDefault(), l.value = !0, b = d.clientX, f = d.clientY, v = c, x = m, window.addEventListener("pointermove", y), window.addEventListener("pointerup", z, { once: !0 }));
|
|
1047
1082
|
}
|
|
1048
|
-
function y(
|
|
1049
|
-
|
|
1083
|
+
function y(d) {
|
|
1084
|
+
l.value && (c = v + d.clientX - b, m = x + d.clientY - f, r());
|
|
1050
1085
|
}
|
|
1051
|
-
function
|
|
1052
|
-
|
|
1086
|
+
function z() {
|
|
1087
|
+
l.value = !1, window.removeEventListener("pointermove", y);
|
|
1053
1088
|
}
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1089
|
+
function G(d) {
|
|
1090
|
+
d.preventDefault(), u(i.value + (d.deltaY < 0 ? 0.1 : -0.1));
|
|
1056
1091
|
}
|
|
1057
|
-
return
|
|
1092
|
+
return ee(p), $(
|
|
1058
1093
|
() => e.url,
|
|
1059
1094
|
() => {
|
|
1060
|
-
o.value = "ready",
|
|
1095
|
+
o.value = "ready", L();
|
|
1061
1096
|
}
|
|
1062
|
-
),
|
|
1063
|
-
window.removeEventListener("pointermove", y),
|
|
1097
|
+
), q(() => {
|
|
1098
|
+
window.removeEventListener("pointermove", y), h && window.cancelAnimationFrame(h);
|
|
1064
1099
|
}), () => a(
|
|
1065
1100
|
"div",
|
|
1066
1101
|
{ class: "jt-attachment-preview-service__image-viewer" },
|
|
1067
|
-
o.value === "error" ?
|
|
1068
|
-
icon:
|
|
1102
|
+
o.value === "error" ? me({
|
|
1103
|
+
icon: Ue,
|
|
1069
1104
|
name: e.name
|
|
1070
1105
|
}) : [
|
|
1071
1106
|
a("img", {
|
|
@@ -1074,16 +1109,16 @@ const We = E({
|
|
|
1074
1109
|
"jt-attachment-preview-service__media",
|
|
1075
1110
|
"jt-attachment-preview-service__image",
|
|
1076
1111
|
i.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
|
|
1077
|
-
|
|
1112
|
+
l.value ? "jt-attachment-preview-service__image--dragging" : ""
|
|
1078
1113
|
],
|
|
1079
1114
|
src: e.url,
|
|
1080
1115
|
alt: e.name,
|
|
1081
1116
|
style: D.value,
|
|
1082
|
-
onLoad:
|
|
1117
|
+
onLoad: T,
|
|
1083
1118
|
onError: R,
|
|
1084
1119
|
onPointerdown: C,
|
|
1085
|
-
onWheel:
|
|
1086
|
-
onDragstart: (
|
|
1120
|
+
onWheel: G,
|
|
1121
|
+
onDragstart: (d) => d.preventDefault(),
|
|
1087
1122
|
draggable: !1
|
|
1088
1123
|
}),
|
|
1089
1124
|
a(
|
|
@@ -1098,7 +1133,7 @@ const We = E({
|
|
|
1098
1133
|
title: s("common.缩小"),
|
|
1099
1134
|
onClick: w
|
|
1100
1135
|
},
|
|
1101
|
-
[a(
|
|
1136
|
+
[a(N, () => a(Ne))]
|
|
1102
1137
|
),
|
|
1103
1138
|
a(
|
|
1104
1139
|
"span",
|
|
@@ -1113,7 +1148,7 @@ const We = E({
|
|
|
1113
1148
|
title: s("common.放大"),
|
|
1114
1149
|
onClick: g
|
|
1115
1150
|
},
|
|
1116
|
-
[a(
|
|
1151
|
+
[a(N, () => a(Se))]
|
|
1117
1152
|
),
|
|
1118
1153
|
a(
|
|
1119
1154
|
"button",
|
|
@@ -1121,16 +1156,16 @@ const We = E({
|
|
|
1121
1156
|
class: "jt-attachment-preview-service__image-tool",
|
|
1122
1157
|
type: "button",
|
|
1123
1158
|
title: s("common.复位"),
|
|
1124
|
-
onClick:
|
|
1159
|
+
onClick: L
|
|
1125
1160
|
},
|
|
1126
|
-
[a(
|
|
1161
|
+
[a(N, () => a(Fe))]
|
|
1127
1162
|
)
|
|
1128
1163
|
]
|
|
1129
1164
|
)
|
|
1130
1165
|
]
|
|
1131
1166
|
);
|
|
1132
1167
|
}
|
|
1133
|
-
}),
|
|
1168
|
+
}), nt = E({
|
|
1134
1169
|
name: "JtAttachmentPreviewService",
|
|
1135
1170
|
props: {
|
|
1136
1171
|
options: {
|
|
@@ -1143,36 +1178,36 @@ const We = E({
|
|
|
1143
1178
|
}
|
|
1144
1179
|
},
|
|
1145
1180
|
setup(e) {
|
|
1146
|
-
const t =
|
|
1147
|
-
() =>
|
|
1148
|
-
), n =
|
|
1181
|
+
const t = j(
|
|
1182
|
+
() => ne(e.options.url, e.options.name)
|
|
1183
|
+
), n = j(
|
|
1149
1184
|
() => e.options.downloadName || t.value
|
|
1150
|
-
), o =
|
|
1151
|
-
() =>
|
|
1152
|
-
),
|
|
1185
|
+
), o = j(() => ce(e.options)), i = j(
|
|
1186
|
+
() => $e(o.value, e.options.url)
|
|
1187
|
+
), l = j(
|
|
1153
1188
|
() => ({
|
|
1154
1189
|
zIndex: e.options.zIndex ?? 3e3,
|
|
1155
1190
|
"--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
|
|
1156
1191
|
})
|
|
1157
1192
|
);
|
|
1158
|
-
function
|
|
1193
|
+
function c() {
|
|
1159
1194
|
e.options.onClose?.(), e.onDestroy();
|
|
1160
1195
|
}
|
|
1161
|
-
function m(
|
|
1162
|
-
|
|
1196
|
+
function m(v) {
|
|
1197
|
+
v.key === "Escape" && e.options.closeOnPressEscape !== !1 && c();
|
|
1163
1198
|
}
|
|
1164
|
-
function b(
|
|
1165
|
-
e.options.onLoad?.(
|
|
1199
|
+
function b(v) {
|
|
1200
|
+
e.options.onLoad?.(v);
|
|
1166
1201
|
}
|
|
1167
|
-
function v
|
|
1168
|
-
e.options.onError?.(
|
|
1202
|
+
function f(v) {
|
|
1203
|
+
e.options.onError?.(v);
|
|
1169
1204
|
}
|
|
1170
|
-
return
|
|
1205
|
+
return ee(() => {
|
|
1171
1206
|
document.addEventListener("keydown", m), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1172
|
-
}),
|
|
1207
|
+
}), q(() => {
|
|
1173
1208
|
document.removeEventListener("keydown", m), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1174
1209
|
}), () => {
|
|
1175
|
-
const
|
|
1210
|
+
const v = e.options.downloadable === !1 ? [] : [
|
|
1176
1211
|
de(
|
|
1177
1212
|
e.options.url,
|
|
1178
1213
|
n.value,
|
|
@@ -1181,7 +1216,7 @@ const We = E({
|
|
|
1181
1216
|
];
|
|
1182
1217
|
return a(
|
|
1183
1218
|
"div",
|
|
1184
|
-
{ class: "jt-attachment-preview-service", style:
|
|
1219
|
+
{ class: "jt-attachment-preview-service", style: l.value },
|
|
1185
1220
|
[
|
|
1186
1221
|
a("div", { class: "jt-attachment-preview-service__modal" }, [
|
|
1187
1222
|
a("div", { class: "jt-attachment-preview-service__header" }, [
|
|
@@ -1197,14 +1232,14 @@ const We = E({
|
|
|
1197
1232
|
"div",
|
|
1198
1233
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1199
1234
|
[
|
|
1200
|
-
...
|
|
1235
|
+
...v,
|
|
1201
1236
|
a(
|
|
1202
1237
|
"button",
|
|
1203
1238
|
{
|
|
1204
1239
|
class: "jt-attachment-preview-service__close",
|
|
1205
1240
|
type: "button",
|
|
1206
1241
|
"aria-label": s("common.关闭"),
|
|
1207
|
-
onClick:
|
|
1242
|
+
onClick: c
|
|
1208
1243
|
},
|
|
1209
1244
|
"×"
|
|
1210
1245
|
)
|
|
@@ -1212,7 +1247,7 @@ const We = E({
|
|
|
1212
1247
|
)
|
|
1213
1248
|
]),
|
|
1214
1249
|
a("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1215
|
-
|
|
1250
|
+
at({
|
|
1216
1251
|
type: o.value,
|
|
1217
1252
|
url: e.options.url,
|
|
1218
1253
|
name: t.value,
|
|
@@ -1221,7 +1256,7 @@ const We = E({
|
|
|
1221
1256
|
iconText: i.value,
|
|
1222
1257
|
downloadable: e.options.downloadable !== !1,
|
|
1223
1258
|
onLoad: b,
|
|
1224
|
-
onError:
|
|
1259
|
+
onError: f
|
|
1225
1260
|
})
|
|
1226
1261
|
])
|
|
1227
1262
|
])
|
|
@@ -1229,7 +1264,7 @@ const We = E({
|
|
|
1229
1264
|
);
|
|
1230
1265
|
};
|
|
1231
1266
|
}
|
|
1232
|
-
}),
|
|
1267
|
+
}), M = E({
|
|
1233
1268
|
name: "JtAttachmentPreviewDetectingService",
|
|
1234
1269
|
props: {
|
|
1235
1270
|
options: {
|
|
@@ -1254,20 +1289,20 @@ const We = E({
|
|
|
1254
1289
|
}
|
|
1255
1290
|
},
|
|
1256
1291
|
setup(e) {
|
|
1257
|
-
const t =
|
|
1258
|
-
() =>
|
|
1259
|
-
), n =
|
|
1292
|
+
const t = j(
|
|
1293
|
+
() => ne(e.options.url, e.options.name)
|
|
1294
|
+
), n = j(() => ({
|
|
1260
1295
|
zIndex: e.options.zIndex ?? 3e3
|
|
1261
1296
|
}));
|
|
1262
1297
|
function o() {
|
|
1263
1298
|
e.options.onClose?.(), e.onDestroy();
|
|
1264
1299
|
}
|
|
1265
|
-
function i(
|
|
1266
|
-
|
|
1300
|
+
function i(l) {
|
|
1301
|
+
l.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
|
|
1267
1302
|
}
|
|
1268
|
-
return
|
|
1303
|
+
return ee(() => {
|
|
1269
1304
|
document.addEventListener("keydown", i), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1270
|
-
}),
|
|
1305
|
+
}), q(() => {
|
|
1271
1306
|
document.removeEventListener("keydown", i), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1272
1307
|
}), () => a(
|
|
1273
1308
|
"div",
|
|
@@ -1322,12 +1357,12 @@ const We = E({
|
|
|
1322
1357
|
);
|
|
1323
1358
|
}
|
|
1324
1359
|
});
|
|
1325
|
-
function
|
|
1360
|
+
function at(e) {
|
|
1326
1361
|
return e.type === "empty" ? a(
|
|
1327
1362
|
"div",
|
|
1328
1363
|
{ class: "jt-attachment-preview-service__empty" },
|
|
1329
1364
|
s("common.暂无附件")
|
|
1330
|
-
) : e.type === "image" ? a(
|
|
1365
|
+
) : e.type === "image" ? a(tt, {
|
|
1331
1366
|
url: e.url,
|
|
1332
1367
|
name: e.name,
|
|
1333
1368
|
downloadName: e.downloadName,
|
|
@@ -1346,7 +1381,7 @@ function Ze(e) {
|
|
|
1346
1381
|
controls: !0,
|
|
1347
1382
|
onLoadeddata: e.onLoad,
|
|
1348
1383
|
onError: e.onError
|
|
1349
|
-
}) : e.type === "pdf" ? a(
|
|
1384
|
+
}) : e.type === "pdf" ? a(et, {
|
|
1350
1385
|
url: e.url,
|
|
1351
1386
|
name: e.name,
|
|
1352
1387
|
downloadName: e.downloadName,
|
|
@@ -1391,87 +1426,87 @@ function ve(e) {
|
|
|
1391
1426
|
if (typeof document > "u")
|
|
1392
1427
|
return { close: () => {
|
|
1393
1428
|
} };
|
|
1394
|
-
|
|
1429
|
+
k("open-called", {
|
|
1395
1430
|
rawOptions: typeof e == "string" ? e : { ...e }
|
|
1396
|
-
}),
|
|
1397
|
-
const t =
|
|
1398
|
-
let o = !1, i = null,
|
|
1399
|
-
const
|
|
1400
|
-
o = !0, i && (
|
|
1431
|
+
}), P?.close();
|
|
1432
|
+
const t = Ke(e), n = t.downloadName || ne(t.url, t.name);
|
|
1433
|
+
let o = !1, i = null, l = null;
|
|
1434
|
+
const c = () => {
|
|
1435
|
+
o = !0, i && (_(null, i), i.remove(), i = null), l && (URL.revokeObjectURL(l), l = null), P?.close === c && (P = null);
|
|
1401
1436
|
};
|
|
1402
1437
|
function m() {
|
|
1403
|
-
o || (i || (i = document.createElement("div"), document.body.appendChild(i)),
|
|
1404
|
-
a(
|
|
1438
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
|
|
1439
|
+
a(nt, {
|
|
1405
1440
|
options: t,
|
|
1406
|
-
onDestroy:
|
|
1441
|
+
onDestroy: c
|
|
1407
1442
|
}),
|
|
1408
1443
|
i
|
|
1409
1444
|
));
|
|
1410
1445
|
}
|
|
1411
1446
|
function b() {
|
|
1412
|
-
o || (i || (i = document.createElement("div"), document.body.appendChild(i)),
|
|
1413
|
-
a(
|
|
1447
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
|
|
1448
|
+
a(M, {
|
|
1414
1449
|
options: t,
|
|
1415
|
-
onDestroy:
|
|
1450
|
+
onDestroy: c
|
|
1416
1451
|
}),
|
|
1417
1452
|
i
|
|
1418
1453
|
));
|
|
1419
1454
|
}
|
|
1420
|
-
function v() {
|
|
1421
|
-
i && (k(null, i), i.remove(), i = null);
|
|
1422
|
-
}
|
|
1423
1455
|
function f() {
|
|
1424
|
-
|
|
1456
|
+
i && (_(null, i), i.remove(), i = null);
|
|
1457
|
+
}
|
|
1458
|
+
function v() {
|
|
1459
|
+
o || fe(t.url, n, {
|
|
1425
1460
|
fallbackToRawUrl: !0
|
|
1426
1461
|
});
|
|
1427
1462
|
}
|
|
1428
1463
|
function x(D) {
|
|
1429
1464
|
if (o) return;
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1465
|
+
const p = URL.createObjectURL(D);
|
|
1466
|
+
Z(p, n), URL.revokeObjectURL(p);
|
|
1432
1467
|
}
|
|
1433
|
-
const
|
|
1434
|
-
return
|
|
1435
|
-
resolvedType:
|
|
1468
|
+
const h = ce(t);
|
|
1469
|
+
return k("type-resolved", {
|
|
1470
|
+
resolvedType: h,
|
|
1436
1471
|
url: t.url,
|
|
1437
1472
|
name: t.name,
|
|
1438
1473
|
mode: t.mode,
|
|
1439
1474
|
mimeType: t.mimeType,
|
|
1440
1475
|
extension: t.extension
|
|
1441
|
-
}),
|
|
1476
|
+
}), K(h) ? m() : h === "unknown" ? (b(), Xe(t.url).then(async (D) => {
|
|
1442
1477
|
if (!o) {
|
|
1443
|
-
if (
|
|
1478
|
+
if (K(D)) {
|
|
1444
1479
|
t.mode = D, m();
|
|
1445
1480
|
return;
|
|
1446
1481
|
}
|
|
1447
1482
|
try {
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
|
|
1483
|
+
const p = await ue(t.url), r = ae(p.type);
|
|
1484
|
+
if (K(r)) {
|
|
1485
|
+
l = URL.createObjectURL(p), t.url = l, t.mode = r, m();
|
|
1451
1486
|
return;
|
|
1452
1487
|
}
|
|
1453
|
-
|
|
1488
|
+
f(), x(p);
|
|
1454
1489
|
} catch {
|
|
1455
|
-
|
|
1490
|
+
f(), v();
|
|
1456
1491
|
}
|
|
1457
1492
|
}
|
|
1458
|
-
})) :
|
|
1493
|
+
})) : v(), P = { close: c }, P;
|
|
1459
1494
|
}
|
|
1460
|
-
function
|
|
1461
|
-
|
|
1495
|
+
function it(e) {
|
|
1496
|
+
Y = e;
|
|
1462
1497
|
}
|
|
1463
|
-
function
|
|
1498
|
+
function ot(e) {
|
|
1464
1499
|
if (typeof document > "u")
|
|
1465
1500
|
return { close: () => {
|
|
1466
1501
|
} };
|
|
1467
|
-
|
|
1502
|
+
P?.close();
|
|
1468
1503
|
let t = !1, n = document.createElement("div");
|
|
1469
1504
|
document.body.appendChild(n);
|
|
1470
1505
|
const o = () => {
|
|
1471
|
-
t = !0, n && (
|
|
1506
|
+
t = !0, n && (_(null, n), n.remove(), n = null), P?.close === o && (P = null);
|
|
1472
1507
|
}, i = { close: o };
|
|
1473
|
-
return
|
|
1474
|
-
a(
|
|
1508
|
+
return P = i, Y ? (_(
|
|
1509
|
+
a(M, {
|
|
1475
1510
|
options: { url: "", name: s("common.附件预览") },
|
|
1476
1511
|
title: s("common.正在获取文件信息"),
|
|
1477
1512
|
desc: s("common.请稍候,获取完成后将自动预览或下载"),
|
|
@@ -1479,12 +1514,12 @@ function et(e) {
|
|
|
1479
1514
|
onDestroy: o
|
|
1480
1515
|
}),
|
|
1481
1516
|
n
|
|
1482
|
-
),
|
|
1517
|
+
), Y.request(e).then((l) => {
|
|
1483
1518
|
if (t) return;
|
|
1484
|
-
const
|
|
1485
|
-
if (!
|
|
1486
|
-
|
|
1487
|
-
a(
|
|
1519
|
+
const c = Y?.mapResponse(l, e);
|
|
1520
|
+
if (!c?.url) {
|
|
1521
|
+
_(
|
|
1522
|
+
a(M, {
|
|
1488
1523
|
options: { url: "", name: s("common.附件预览") },
|
|
1489
1524
|
title: s("common.文件信息缺少URL"),
|
|
1490
1525
|
desc: s("common.请检查mapResponse是否返回了url字段"),
|
|
@@ -1495,22 +1530,22 @@ function et(e) {
|
|
|
1495
1530
|
);
|
|
1496
1531
|
return;
|
|
1497
1532
|
}
|
|
1498
|
-
ve(
|
|
1499
|
-
}).catch((
|
|
1533
|
+
ve(c);
|
|
1534
|
+
}).catch((l) => {
|
|
1500
1535
|
if (t) return;
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
a(
|
|
1536
|
+
const c = l instanceof Error ? l.message : s("common.接口请求失败");
|
|
1537
|
+
_(
|
|
1538
|
+
a(M, {
|
|
1504
1539
|
options: { url: "", name: s("common.附件预览") },
|
|
1505
1540
|
title: s("common.文件信息获取失败"),
|
|
1506
|
-
desc:
|
|
1541
|
+
desc: c,
|
|
1507
1542
|
spinning: !1,
|
|
1508
1543
|
onDestroy: o
|
|
1509
1544
|
}),
|
|
1510
1545
|
n
|
|
1511
1546
|
);
|
|
1512
|
-
}), i) : (
|
|
1513
|
-
a(
|
|
1547
|
+
}), i) : (_(
|
|
1548
|
+
a(M, {
|
|
1514
1549
|
options: { url: "", name: s("common.附件预览") },
|
|
1515
1550
|
title: s("common.附件预览未初始化"),
|
|
1516
1551
|
desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
|
|
@@ -1520,18 +1555,18 @@ function et(e) {
|
|
|
1520
1555
|
n
|
|
1521
1556
|
), i);
|
|
1522
1557
|
}
|
|
1523
|
-
const
|
|
1524
|
-
openByParams:
|
|
1525
|
-
setup:
|
|
1558
|
+
const mt = Object.assign(ve, {
|
|
1559
|
+
openByParams: ot,
|
|
1560
|
+
setup: it
|
|
1526
1561
|
});
|
|
1527
1562
|
export {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1563
|
+
mt as J,
|
|
1564
|
+
ot as a,
|
|
1565
|
+
it as b,
|
|
1566
|
+
ct as g,
|
|
1567
|
+
dt as i,
|
|
1568
|
+
U as n,
|
|
1569
|
+
ut as r,
|
|
1570
|
+
st as s,
|
|
1536
1571
|
s as t
|
|
1537
1572
|
};
|