@jt-home/mfe-components 1.0.59 → 1.0.60-beta.1

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.
Files changed (33) hide show
  1. package/dist/JtAttachmentPreview/index.cjs +2 -1
  2. package/dist/JtAttachmentPreview/index.mjs +6 -4
  3. package/dist/{index-D67nILVt.js → index-BdgCXrMw.js} +453 -667
  4. package/dist/index-DtqPcdZG.cjs +1 -0
  5. package/dist/index.cjs +2 -2
  6. package/dist/index.mjs +3171 -2615
  7. package/dist/style.css +1 -1
  8. package/dist/types/components/JtAttachmentPreview/index.d.ts +3 -3
  9. package/dist/types/components/JtAttachmentPreview/types.d.ts +6 -4
  10. package/dist/types/components/globalInfo/components/GlobalInfoGroup.vue.d.ts +9 -4
  11. package/dist/types/components/globalInfo/components/GlobalInfoLeftNav.vue.d.ts +29 -0
  12. package/dist/types/components/globalInfo/components/GlobalInfoSectionBlock.vue.d.ts +17 -12
  13. package/dist/types/components/globalInfo/components/GlobalInfoSectionOutlet.vue.d.ts +13 -0
  14. package/dist/types/components/globalInfo/components/GlobalInfoSections.vue.d.ts +9 -4
  15. package/dist/types/components/globalInfo/index.d.ts +6 -2
  16. package/dist/types/components/globalInfo/model/fieldUtils.d.ts +1 -1
  17. package/dist/types/components/globalInfo/model/fieldValidation.d.ts +19 -0
  18. package/dist/types/components/globalInfo/model/slotIdentity.d.ts +1 -1
  19. package/dist/types/components/globalInfo/model/types.d.ts +48 -1
  20. package/dist/types/components/globalInfo/model/valueListOptions.d.ts +4 -0
  21. package/dist/types/components/globalInfo/renderers/GlobalInfoAutoRenderer.vue.d.ts +50 -1
  22. package/dist/types/components/globalInfo/renderers/GlobalInfoFormRenderer.vue.d.ts +2 -0
  23. package/dist/types/components/globalInfo/renderers/GlobalInfoMultiFormRenderer.vue.d.ts +49 -0
  24. package/dist/types/components/globalInfo/renderers/optionPreload.d.ts +12 -2
  25. package/dist/types/components/index.d.ts +1 -1
  26. package/dist/types/main.d.ts +2 -1
  27. package/package.json +28 -26
  28. package/dist/JtAttachmentPreview/style.css +0 -1
  29. package/dist/index-DEbU13vV.cjs +0 -1
  30. package/dist/pdf-BmBuG7of.js +0 -18058
  31. package/dist/pdf-Da0bm_Ya.cjs +0 -55
  32. package/dist/pdf.worker.min-4PI-nNLo.js +0 -4
  33. package/dist/pdf.worker.min-BAJUPwg6.cjs +0 -1
@@ -1,6 +1,7 @@
1
- import { ref as j, isRef as ue, watch as $, defineComponent as R, openBlock as N, createElementBlock as q, createElementVNode as V, onBeforeUnmount as G, h as r, computed as L, onMounted as ee, nextTick as ge, render as P } from "vue";
2
- import { ElIcon as J } from "element-plus";
3
- const be = {
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
- }, ye = {
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
- }, Ae = {
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
- }, _e = {
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
- }, Pe = {
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
- }, ke = {
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
- }, je = {
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
- }, Ee = {
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
- }, Le = {
508
- "zh-cn": be,
509
- en: ye,
510
- th: Ae,
511
- vi: _e,
512
- es: Pe,
508
+ }, Ee = {
509
+ "zh-cn": we,
510
+ en: ge,
511
+ th: be,
512
+ vi: ye,
513
+ es: Ae,
513
514
  id: De,
514
- de: ke,
515
- pt: je,
516
- km: Ee
517
- }, z = [
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(z.map((e) => [e.key, e.elementPlusLocale]))
530
+ Object.fromEntries(E.map((e) => [e.key, e.elementPlusLocale]))
530
531
  );
531
- const Re = Object.freeze({
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(Re).map(([e, t]) => [t, e]))
544
+ Object.fromEntries(Object.entries(_e).map(([e, t]) => [t, e]))
544
545
  );
545
- function xe(e, t = {}) {
546
- const a = t.fallback ?? "zh", o = Ce(t.languageList), n = e.toLowerCase();
547
- return o.find((i) => i.key === n) ?? o.find((i) => i.key === a) ?? z[0];
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 Te(e, t = {}) {
550
- return xe(e, t).elementPlusLocale;
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 a = t.key ?? t.value, o = z.find((n) => n.key === a) ?? z[0];
555
+ const n = t.key ?? t.value, r = E.find((a) => a.key === n) ?? E[0];
555
556
  return {
556
- ...o,
557
+ ...r,
557
558
  ...t,
558
- key: o.key,
559
- elementPlusLocale: t.elementPlusLocale ?? o.elementPlusLocale
559
+ key: r.key,
560
+ elementPlusLocale: t.elementPlusLocale ?? r.elementPlusLocale
560
561
  };
561
- }) : z;
562
+ }) : E;
562
563
  }
563
- const Be = {
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 O(e) {
578
+ function L(e) {
578
579
  const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
579
- return Te(Be[t] || t) || "zh-cn";
580
+ return Re(Te[t] || t) || "zh-cn";
580
581
  }
581
- const B = j("zh-cn");
582
- let Q;
583
- function te() {
584
- Q?.(), Q = void 0;
582
+ const y = D("zh-cn");
583
+ let U;
584
+ function M() {
585
+ U?.(), U = void 0;
585
586
  }
586
- function le(e) {
587
- return e ? typeof e == "function" ? O(e()) : ue(e) ? O(e.value) : O(e) : B.value;
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 Fe(e, t) {
590
+ function Be(e, t) {
590
591
  if (e)
591
- return t.split(".").reduce((a, o) => {
592
- if (!(!a || typeof a != "object"))
593
- return a[o];
592
+ return t.split(".").reduce((n, r) => {
593
+ if (!(!n || typeof n != "object"))
594
+ return n[r];
594
595
  }, e);
595
596
  }
596
- function se(e, t) {
597
- const a = Fe(Le[e], t);
598
- return typeof a == "string" ? a : void 0;
597
+ function K(e, t) {
598
+ const n = Be(Ee[e], t);
599
+ return typeof n == "string" ? n : void 0;
599
600
  }
600
- function Se(e, t) {
601
- return t ? e.replace(/\{(\w+)\}/g, (a, o) => {
602
- const n = t[o];
603
- return n == null ? a : String(n);
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 pt(e) {
607
- te(), B.value = O(e);
607
+ function at(e) {
608
+ M(), y.value = L(e);
608
609
  }
609
- function vt() {
610
- return B.value;
610
+ function ot() {
611
+ return y.value;
611
612
  }
612
- function ht() {
613
- te(), B.value = "zh-cn";
613
+ function rt() {
614
+ M(), y.value = "zh-cn";
614
615
  }
615
- function wt(e, t = {}) {
616
- if (te(), t.locale) {
617
- if (typeof t.locale == "function" || ue(t.locale)) {
618
- Q = $(
619
- () => le(t.locale),
620
- (a) => {
621
- B.value = a;
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
- B.value = le(t.locale);
628
+ y.value = V(t.locale);
628
629
  }
629
630
  }
630
- function c(e, t = e, a) {
631
- const o = t || e, n = B.value, i = se(n, e) || se("zh-cn", e) || o || e;
632
- return Se(i, a);
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
- /*! Element Plus Icons Vue v2.3.2 */
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+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30sTPt6dEO74mKXLoiCgDTi1RFbUMUBhZXluQUDKbnWxWtjMLB2pYqUjmFg8WUzSg0TL+rCKVZeJheRJj9DYWHRRnHbBSYnr+qcSsoKCyeLKcfK/emc2UqH4LFGMcVWVftTC4w/TbmhGQjwvR6RBmNAbMYx4nD7k/I1GF3ZZOH3RtHAbDhcZQAG5SJgOn1Vt0mAzYwIUJgvjJ/2OVo2pcmcoQZWehxpBGue5sJEQTryyTBeuMoCtadEFmwjkwYzIyjNJief02IONj3OAqE/ZVJhJnZj3RS1c4nld04ijiC/5EJhbUyobBWJhT2OY5CYa1MKKyVCYXpdSIUphdbobB2HIXCWplQmJGFhZUn07kyNaFgbUsx1/1tb1Jh+i1hDmu0Y+uEN4xqV9ki5Q27atfmKWtYqd1lW84wqj1kr5xhB+3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e/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
- ]), He = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ke = /* @__PURE__ */ new Set([
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
- ]), We = /* @__PURE__ */ new Set([
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
- ]), Qe = /* @__PURE__ */ new Set([
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
- ]), Z = {
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: "fetch-bytes-then-pdfjs-data",
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 p(e, t) {
738
- console.info(`[JtAttachmentPreview DEBUG ${Z.marker}] ${e}`, {
739
- ...Z,
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__ = Z, p("module-loaded"));
744
- let D = null, K = null, k = null;
745
- async function Ze() {
746
- return K || (K = Promise.all([
747
- import("./pdf-BmBuG7of.js"),
748
- import("./pdf.worker.min-4PI-nNLo.js")
749
- ]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), K;
750
- }
751
- function Xe(e) {
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 de(e) {
697
+ function Z(e) {
755
698
  const [t] = e.split(/[?#]/);
756
699
  return t ?? "";
757
700
  }
758
- function ae(e, t) {
701
+ function Y(e, t) {
759
702
  if (t?.trim()) return t.trim();
760
- const a = de(e).split("/").filter(Boolean).pop();
761
- if (!a) return c("common.附件预览");
703
+ const n = Z(e).split("/").filter(Boolean).pop();
704
+ if (!n) return s("common.附件预览");
762
705
  try {
763
- return decodeURIComponent(a);
706
+ return decodeURIComponent(n);
764
707
  } catch {
765
- return a;
708
+ return n;
766
709
  }
767
710
  }
768
- function X(e) {
769
- return de(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
711
+ function H(e) {
712
+ return Z(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
770
713
  }
771
- function $e(e) {
714
+ function qe(e) {
772
715
  return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
773
716
  }
774
- function et(e) {
775
- const t = $e(e);
776
- return Ge.has(t) ? "image" : t === "pdf" ? "pdf" : He.has(t) ? "video" : Ke.has(t) ? "audio" : We.has(t) ? "iframe" : Qe.has(t) ? "unsupported" : "unknown";
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 ne(e) {
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 me(e) {
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 a = ne(e.mimeType);
787
- if (a !== "unknown") return a;
729
+ const n = O(e.mimeType);
730
+ if (n !== "unknown") return n;
788
731
  }
789
- const t = et(
790
- e.extension || X(e.name || "") || X(e.url)
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 tt(e) {
737
+ async function Ge(e) {
795
738
  try {
796
- const a = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
797
- return ne(a);
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 fe(e, t) {
803
- const a = await fetch(e, t);
804
- if (!a.ok) throw new Error(`fetch failed: ${a.status}`);
805
- return a.blob();
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 pe(e, t, a, o = !1) {
825
- return r(
750
+ function ee(e, t, n, r = !1) {
751
+ return o(
826
752
  "button",
827
753
  {
828
- class: a,
754
+ class: n,
829
755
  type: "button",
830
756
  onClick: () => {
831
- p("download-button-click", {
757
+ m("download-button-click", {
832
758
  url: e.url,
833
759
  downloadName: t,
834
- fallbackToRawUrl: o
835
- }), he(e, t, {
836
- fallbackToRawUrl: o
760
+ fallbackToRawUrl: r
761
+ }), ne(e, t, {
762
+ fallbackToRawUrl: r
837
763
  });
838
764
  }
839
765
  },
840
766
  [
841
- r(
842
- J,
767
+ o(
768
+ _,
843
769
  { class: "jt-attachment-preview-service__download-icon" },
844
- () => r(Me)
770
+ () => o(he)
845
771
  ),
846
- r(
772
+ o(
847
773
  "span",
848
774
  { class: "jt-attachment-preview-service__download-text" },
849
- c("common.下载")
775
+ s("common.下载")
850
776
  )
851
777
  ]
852
778
  );
853
779
  }
854
- function W(e) {
780
+ function S(e) {
855
781
  return e === "image" || e === "pdf";
856
782
  }
857
- function ve(e) {
858
- return r(
783
+ function te(e) {
784
+ return o(
859
785
  "div",
860
786
  { class: "jt-attachment-preview-service__preview-fallback" },
861
787
  [
862
- r("img", {
788
+ o("img", {
863
789
  class: "jt-attachment-preview-service__preview-fallback-icon",
864
790
  src: e.icon,
865
791
  alt: ""
866
792
  }),
867
- r(
793
+ o(
868
794
  "div",
869
795
  { class: "jt-attachment-preview-service__unsupported-text" },
870
- c("common.暂不支持预览此类型的文件")
796
+ s("common.暂不支持预览此类型的文件")
871
797
  ),
872
- r(
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 re(e, t) {
884
- const a = document.createElement("a");
885
- a.href = e, a.download = t, a.style.display = "none", document.body.appendChild(a), a.click(), a.remove();
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 oe(e, t) {
888
- const a = URL.createObjectURL(e);
889
- re(a, t), window.setTimeout(() => URL.revokeObjectURL(a), 1e3);
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 Y(e) {
817
+ function C(e) {
892
818
  return e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
893
819
  }
894
- function rt(e, t) {
895
- if (Y(e))
820
+ function Ve(e, t) {
821
+ if (C(e))
896
822
  return e;
897
823
  if (e && typeof e == "object") {
898
- const a = e;
899
- if (Y(a.data)) {
900
- const o = a.data;
824
+ const n = e;
825
+ if (C(n.data)) {
826
+ const r = n.data;
901
827
  return {
902
- blob: a.data,
903
- name: a.fileName || a.name || o.name || t
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 ot(e, t, a = {}) {
910
- p("download-start", {
835
+ async function Ke(e, t, n = {}) {
836
+ m("download-start", {
911
837
  url: e,
912
838
  downloadName: t,
913
- fallbackToRawUrl: !!a.fallbackToRawUrl,
914
- hasRequestInit: !!a.requestInit
839
+ fallbackToRawUrl: !!n.fallbackToRawUrl,
840
+ hasRequestInit: !!n.requestInit
915
841
  });
916
842
  try {
917
- const o = await fe(e, a.requestInit);
918
- p("download-blob-ready", {
843
+ const r = await $(e, n.requestInit);
844
+ m("download-blob-ready", {
919
845
  url: e,
920
846
  downloadName: t,
921
- blobType: o.type,
922
- blobSize: o.size
923
- }), oe(o, t);
847
+ blobType: r.type,
848
+ blobSize: r.size
849
+ }), N(r, t);
924
850
  } catch {
925
- p("download-blob-failed", {
851
+ m("download-blob-failed", {
926
852
  url: e,
927
853
  downloadName: t,
928
- fallbackToRawUrl: !!a.fallbackToRawUrl
929
- }), a.fallbackToRawUrl && re(e, t);
854
+ fallbackToRawUrl: !!n.fallbackToRawUrl
855
+ }), n.fallbackToRawUrl && q(e, t);
930
856
  }
931
857
  }
932
- function ce(e, t) {
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 he(e, t, a = {}) {
942
- const o = {
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 n = null;
950
- if (p("download-resolve-start", {
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: !!k?.downloadRequest,
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
- p("download-custom-handler-start", {
887
+ m("download-custom-handler-start", {
962
888
  url: e.url,
963
889
  downloadName: t
964
890
  });
965
- const l = await e.download(o);
966
- if (n = ce(l, t), !n) {
967
- p("download-custom-handler-done", {
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 && k?.downloadRequest) {
974
- p("download-setup-request-start", {
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 k.downloadRequest(
905
+ const l = await h.downloadRequest(
980
906
  e.requestParams
981
907
  );
982
- p("download-request-response", {
983
- isBlob: Y(l),
984
- isDataBlob: !!l && typeof l == "object" && Y(l.data),
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 h = rt(l, t), f = h || (k.mapDownloadResponse ? k.mapDownloadResponse(
913
+ const f = Ve(l, t), d = f || (h.mapDownloadResponse ? h.mapDownloadResponse(
988
914
  l,
989
915
  e.requestParams
990
916
  ) : l);
991
- n = ce(f, t);
917
+ a = W(d, t);
992
918
  }
993
- if (n?.blob) {
994
- p("download-result-blob", {
995
- downloadName: n.name,
996
- blobType: n.blob.type,
997
- blobSize: n.blob.size
998
- }), oe(n.blob, n.name);
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 = n?.url || e.downloadUrl || e.url, u = n?.name || t;
1002
- await ot(i, u, {
1003
- requestInit: n?.requestInit || e.downloadRequestInit,
1004
- fallbackToRawUrl: n?.fallbackToRawUrl ?? e.downloadFallbackToRawUrl ?? a.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 (n) {
1007
- p("download-handler-failed", {
932
+ } catch (a) {
933
+ m("download-handler-failed", {
1008
934
  url: e.url,
1009
935
  downloadName: t,
1010
- errorName: n instanceof Error ? n.name : "",
1011
- errorMessage: n instanceof Error ? n.message : String(n),
1012
- errorStack: n instanceof Error ? n.stack : "",
1013
- errorResponseStatus: n && typeof n == "object" ? n.response?.status : void 0,
1014
- errorResponseType: n && typeof n == "object" ? Object.prototype.toString.call(
1015
- n.response?.data
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: n && typeof n == "object" ? n.response?.data?.type : void 0
1018
- }), a.fallbackToRawUrl && re(e.downloadUrl || e.url, t);
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 it = R({
1022
- name: "JtAttachmentPreviewPdfCanvas",
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 a = j("loading"), o = j([]), n = j([]), i = /* @__PURE__ */ new Map(), u = j("");
1047
- let l = null, h = [], f = 0;
1048
- async function v(s, d) {
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 w() {
1069
- f += 1;
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
- async function x() {
1075
- w();
1076
- const s = f;
1077
- a.value = "loading", u.value = "", o.value = [], n.value = [];
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
- $(() => e.url, x, { immediate: !0 }), G(w);
1120
- function _(s) {
1121
- if (!s) return;
1122
- i.get(s)?.scrollIntoView({ behavior: "smooth", block: "start" });
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
- ]) : null,
1136
- null,
1137
- null,
1138
- r(
1139
- "div",
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
- }), lt = R({
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 a = j(null), o = j("ready"), n = j(1), i = j(!1);
1228
- let u = 0, l = 0, h = 0, f = 0, v = 0, A = 0, w = 0;
1229
- const x = L(
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(${n.value})`
1033
+ transform: `translate(${u}px, ${l}px) scale(${a.value})`
1233
1034
  })
1234
1035
  );
1235
- function _() {
1236
- a.value && (a.value.style.transform = `translate(${u}px, ${l}px) scale(${n.value})`);
1036
+ function g() {
1037
+ n.value && (n.value.style.transform = `translate(${u}px, ${l}px) scale(${a.value})`);
1237
1038
  }
1238
- function s() {
1039
+ function oe() {
1239
1040
  w || (w = window.requestAnimationFrame(() => {
1240
- w = 0, _();
1041
+ w = 0, g();
1241
1042
  }));
1242
1043
  }
1243
- function d(m) {
1244
- n.value = Math.min(Math.max(Number(m.toFixed(2)), 0.2), 5), n.value <= 1 && (u = 0, l = 0), _();
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 g() {
1247
- d(n.value + 0.2);
1047
+ function re() {
1048
+ B(a.value + 0.2);
1248
1049
  }
1249
- function b() {
1250
- const m = Math.max(Number((n.value - 0.2).toFixed(2)), 0.2);
1251
- n.value = m, m <= 1 && (u = 0, l = 0), _();
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 E() {
1254
- u = 0, l = 0, d(1);
1054
+ function G() {
1055
+ u = 0, l = 0, B(1);
1255
1056
  }
1256
- function F(m) {
1257
- o.value = "ready", t("previewLoad", m);
1057
+ function le(c) {
1058
+ r.value = "ready", t("previewLoad", c);
1258
1059
  }
1259
- function T(m) {
1260
- o.value = "error", t("previewError", m);
1060
+ function se(c) {
1061
+ r.value = "error", t("previewError", c);
1261
1062
  }
1262
- function C(m) {
1263
- n.value <= 1 || (m.preventDefault(), i.value = !0, h = m.clientX, f = m.clientY, v = u, A = l, window.addEventListener("pointermove", y), window.addEventListener("pointerup", S, { once: !0 }));
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 y(m) {
1266
- i.value && (u = v + m.clientX - h, l = A + m.clientY - f, s());
1066
+ function F(c) {
1067
+ i.value && (u = P + c.clientX - f, l = A + c.clientY - d, oe());
1267
1068
  }
1268
- function S() {
1269
- i.value = !1, window.removeEventListener("pointermove", y);
1069
+ function ue() {
1070
+ i.value = !1, window.removeEventListener("pointermove", F);
1270
1071
  }
1271
- function H(m) {
1272
- m.preventDefault(), d(n.value + (m.deltaY < 0 ? 0.1 : -0.1));
1072
+ function de(c) {
1073
+ c.preventDefault(), B(a.value + (c.deltaY < 0 ? 0.1 : -0.1));
1273
1074
  }
1274
- return ee(_), $(
1075
+ return z(g), I(
1275
1076
  () => e.url,
1276
1077
  () => {
1277
- o.value = "ready", E();
1078
+ r.value = "ready", G();
1278
1079
  }
1279
- ), G(() => {
1280
- window.removeEventListener("pointermove", y), w && window.cancelAnimationFrame(w);
1281
- }), () => r(
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
- o.value === "error" ? ve({
1285
- icon: qe,
1085
+ r.value === "error" ? te({
1086
+ icon: Se,
1286
1087
  name: e.name
1287
1088
  }) : [
1288
- r("img", {
1289
- ref: a,
1089
+ o("img", {
1090
+ ref: n,
1290
1091
  class: [
1291
1092
  "jt-attachment-preview-service__media",
1292
1093
  "jt-attachment-preview-service__image",
1293
- n.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
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: x.value,
1299
- onLoad: F,
1300
- onError: T,
1301
- onPointerdown: C,
1302
- onWheel: H,
1303
- onDragstart: (m) => m.preventDefault(),
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
- r(
1107
+ o(
1307
1108
  "div",
1308
1109
  { class: "jt-attachment-preview-service__image-toolbar" },
1309
1110
  [
1310
- r(
1111
+ o(
1311
1112
  "button",
1312
1113
  {
1313
1114
  class: "jt-attachment-preview-service__image-tool",
1314
1115
  type: "button",
1315
- title: c("common.缩小"),
1316
- onClick: b
1116
+ title: s("common.缩小"),
1117
+ onClick: ie
1317
1118
  },
1318
- [r(J, () => r(Ne))]
1119
+ [o(_, () => o(fe))]
1319
1120
  ),
1320
- r(
1121
+ o(
1321
1122
  "span",
1322
1123
  { class: "jt-attachment-preview-service__image-scale" },
1323
- `${Math.round(n.value * 100)}%`
1124
+ `${Math.round(a.value * 100)}%`
1324
1125
  ),
1325
- r(
1126
+ o(
1326
1127
  "button",
1327
1128
  {
1328
1129
  class: "jt-attachment-preview-service__image-tool",
1329
1130
  type: "button",
1330
- title: c("common.放大"),
1331
- onClick: g
1131
+ title: s("common.放大"),
1132
+ onClick: re
1332
1133
  },
1333
- [r(J, () => r(Oe))]
1134
+ [o(_, () => o(pe))]
1334
1135
  ),
1335
- r(
1136
+ o(
1336
1137
  "button",
1337
1138
  {
1338
1139
  class: "jt-attachment-preview-service__image-tool",
1339
1140
  type: "button",
1340
- title: c("common.复位"),
1341
- onClick: E
1141
+ title: s("common.复位"),
1142
+ onClick: G
1342
1143
  },
1343
- [r(J, () => r(Ue))]
1144
+ [o(_, () => o(ve))]
1344
1145
  )
1345
1146
  ]
1346
1147
  )
1347
1148
  ]
1348
1149
  );
1349
1150
  }
1350
- }), st = R({
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 = L(
1364
- () => ae(e.options.url, e.options.name)
1365
- ), a = L(
1164
+ const t = b(
1165
+ () => Y(e.options.url, e.options.name)
1166
+ ), n = b(
1366
1167
  () => e.options.downloadName || t.value
1367
- ), o = L(() => me(e.options)), n = L(
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 u() {
1174
+ function i() {
1376
1175
  e.options.onClose?.(), e.onDestroy();
1377
1176
  }
1378
- function l(v) {
1379
- v.key === "Escape" && e.options.closeOnPressEscape !== !1 && u();
1177
+ function u(d) {
1178
+ d.key === "Escape" && e.options.closeOnPressEscape !== !1 && i();
1380
1179
  }
1381
- function h(v) {
1382
- e.options.onLoad?.(v);
1180
+ function l(d) {
1181
+ e.options.onLoad?.(d);
1383
1182
  }
1384
- function f(v) {
1385
- e.options.onError?.(v);
1183
+ function f(d) {
1184
+ e.options.onError?.(d);
1386
1185
  }
1387
- return ee(() => {
1388
- document.addEventListener("keydown", l), document.body.classList.add("jt-attachment-preview-service-lock");
1389
- }), G(() => {
1390
- document.removeEventListener("keydown", l), document.body.classList.remove("jt-attachment-preview-service-lock");
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 v = e.options.downloadable === !1 ? [] : [
1393
- pe(
1191
+ const d = e.options.downloadable === !1 ? [] : [
1192
+ ee(
1394
1193
  e.options,
1395
- a.value,
1194
+ n.value,
1396
1195
  "jt-attachment-preview-service__top-download"
1397
1196
  )
1398
1197
  ];
1399
- return r(
1198
+ return o(
1400
1199
  "div",
1401
- { class: "jt-attachment-preview-service", style: i.value },
1200
+ { class: "jt-attachment-preview-service", style: a.value },
1402
1201
  [
1403
- r("div", { class: "jt-attachment-preview-service__modal" }, [
1404
- r("div", { class: "jt-attachment-preview-service__header" }, [
1405
- r(
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
- r(
1212
+ o(
1414
1213
  "div",
1415
1214
  { class: "jt-attachment-preview-service__header-actions" },
1416
1215
  [
1417
- ...v,
1418
- r(
1216
+ ...d,
1217
+ o(
1419
1218
  "button",
1420
1219
  {
1421
1220
  class: "jt-attachment-preview-service__close",
1422
1221
  type: "button",
1423
- "aria-label": c("common.关闭"),
1424
- onClick: u
1222
+ "aria-label": s("common.关闭"),
1223
+ onClick: i
1425
1224
  },
1426
1225
  "×"
1427
1226
  )
1428
1227
  ]
1429
1228
  )
1430
1229
  ]),
1431
- r("div", { class: "jt-attachment-preview-service__body" }, [
1432
- ct({
1433
- type: o.value,
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: a.value,
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: h,
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
- }), M = R({
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: c("common.正在识别文件类型")
1260
+ default: s("common.正在识别文件类型")
1464
1261
  },
1465
1262
  desc: {
1466
1263
  type: String,
1467
- default: c("common.请稍候,识别完成后将自动预览或下载")
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 = L(
1476
- () => ae(e.options.url, e.options.name)
1477
- ), a = L(() => ({
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 o() {
1277
+ function r() {
1481
1278
  e.options.onClose?.(), e.onDestroy();
1482
1279
  }
1483
- function n(i) {
1484
- i.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
1280
+ function a(i) {
1281
+ i.key === "Escape" && e.options.closeOnPressEscape !== !1 && r();
1485
1282
  }
1486
- return ee(() => {
1487
- document.addEventListener("keydown", n), document.body.classList.add("jt-attachment-preview-service-lock");
1488
- }), G(() => {
1489
- document.removeEventListener("keydown", n), document.body.classList.remove("jt-attachment-preview-service-lock");
1490
- }), () => r(
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: a.value },
1289
+ { class: "jt-attachment-preview-service", style: n.value },
1493
1290
  [
1494
- r("div", { class: "jt-attachment-preview-service__modal" }, [
1495
- r("div", { class: "jt-attachment-preview-service__header" }, [
1496
- r(
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
- r(
1301
+ o(
1505
1302
  "div",
1506
1303
  { class: "jt-attachment-preview-service__header-actions" },
1507
1304
  [
1508
- r(
1305
+ o(
1509
1306
  "button",
1510
1307
  {
1511
1308
  class: "jt-attachment-preview-service__close",
1512
1309
  type: "button",
1513
- "aria-label": c("common.关闭"),
1514
- onClick: o
1310
+ "aria-label": s("common.关闭"),
1311
+ onClick: r
1515
1312
  },
1516
1313
  "×"
1517
1314
  )
1518
1315
  ]
1519
1316
  )
1520
1317
  ]),
1521
- r("div", { class: "jt-attachment-preview-service__body" }, [
1522
- r("div", { class: "jt-attachment-preview-service__detecting" }, [
1523
- e.spinning ? r("span", {
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
- r(
1323
+ o(
1527
1324
  "span",
1528
1325
  { class: "jt-attachment-preview-service__detecting-title" },
1529
1326
  e.title
1530
1327
  ),
1531
- r(
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 ct(e) {
1544
- return e.type === "empty" ? r(
1340
+ function Ze(e) {
1341
+ return e.type === "empty" ? o(
1545
1342
  "div",
1546
1343
  { class: "jt-attachment-preview-service__empty" },
1547
- c("common.暂无附件")
1548
- ) : e.type === "image" ? r(lt, {
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 === "video" ? r("video", {
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
- }) : e.type === "iframe" ? r("iframe", {
1575
- class: "jt-attachment-preview-service__iframe",
1576
- src: e.url,
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
- e.iconText
1364
+ "FILE"
1586
1365
  ),
1587
- r(
1366
+ o(
1588
1367
  "div",
1589
1368
  { class: "jt-attachment-preview-service__unsupported-text" },
1590
- c("common.暂不支持预览此类型的文件")
1369
+ s("common.暂不支持预览此类型的文件")
1591
1370
  )
1592
1371
  ]),
1593
- r(
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 ? pe(
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 we(e) {
1387
+ function ae(e) {
1609
1388
  if (typeof document > "u")
1610
1389
  return { close: () => {
1611
1390
  } };
1612
- p("open-called", {
1391
+ m("open-called", {
1613
1392
  rawOptions: typeof e == "string" ? e : { ...e }
1614
- }), D?.close();
1615
- const t = Xe(
1393
+ }), v?.close();
1394
+ const t = Oe(
1616
1395
  e
1617
- ), a = t.downloadName || ae(t.url, t.name);
1618
- let o = !1, n = null, i = null;
1396
+ ), n = t.downloadName || Y(t.url, t.name);
1397
+ let r = !1, a = null, i = null;
1619
1398
  const u = () => {
1620
- o = !0, n && (P(null, n), n.remove(), n = null), i && (URL.revokeObjectURL(i), i = null), D?.close === u && (D = null);
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
- o || (n || (n = document.createElement("div"), document.body.appendChild(n)), P(
1624
- r(st, {
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
- n
1407
+ a
1629
1408
  ));
1630
1409
  }
1631
- function h() {
1632
- o || (n || (n = document.createElement("div"), document.body.appendChild(n)), P(
1633
- r(M, {
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
- n
1416
+ a
1638
1417
  ));
1639
1418
  }
1640
- function f() {
1641
- n && (P(null, n), n.remove(), n = null);
1419
+ function d() {
1420
+ a && (p(null, a), a.remove(), a = null);
1642
1421
  }
1643
- function v() {
1644
- o || he(t, a, {
1422
+ function P() {
1423
+ r || ne(t, n, {
1645
1424
  fallbackToRawUrl: !0
1646
1425
  });
1647
1426
  }
1648
- const A = me(t);
1649
- return p("type-resolved", {
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
- }), W(A) ? l() : A === "unknown" ? (h(), tt(t.url).then(async (w) => {
1657
- if (!o) {
1658
- if (W(w)) {
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 x = await fe(t.url), _ = ne(x.type);
1664
- if (W(_)) {
1665
- i = URL.createObjectURL(x), t.url = i, t.mode = _, l();
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
- f(), oe(x, a);
1447
+ d(), N(k, n);
1669
1448
  } catch {
1670
- f(), v();
1449
+ d(), P();
1671
1450
  }
1672
1451
  }
1673
- })) : v(), D = { close: u }, D;
1452
+ })) : P(), v = { close: u }, v;
1674
1453
  }
1675
- function ut(e) {
1676
- k = e;
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 dt(e) {
1464
+ function $e(e) {
1679
1465
  if (typeof document > "u")
1680
1466
  return { close: () => {
1681
1467
  } };
1682
- D?.close();
1683
- let t = !1, a = document.createElement("div");
1684
- document.body.appendChild(a);
1685
- const o = () => {
1686
- t = !0, a && (P(null, a), a.remove(), a = null), D?.close === o && (D = null);
1687
- }, n = { close: o };
1688
- return D = n, k ? (P(
1689
- r(M, {
1690
- options: { url: "", name: c("common.附件预览") },
1691
- title: c("common.正在获取文件信息"),
1692
- desc: c("common.请稍候,获取完成后将自动预览或下载"),
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: o
1480
+ onDestroy: r
1695
1481
  }),
1696
- a
1697
- ), k.request(e).then((i) => {
1698
- if (t) return;
1699
- const u = k?.mapResponse(i, e);
1700
- if (!u?.url) {
1701
- P(
1702
- r(M, {
1703
- options: { url: "", name: c("common.附件预览") },
1704
- title: c("common.文件信息缺少URL"),
1705
- desc: c("common.请检查mapResponse是否返回了url字段"),
1706
- spinning: !1,
1707
- onDestroy: o
1708
- }),
1709
- a
1710
- );
1711
- return;
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 : c("common.接口请求失败");
1721
- P(
1722
- r(M, {
1723
- options: { url: "", name: c("common.附件预览") },
1724
- title: c("common.文件信息获取失败"),
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: o
1513
+ onDestroy: r
1728
1514
  }),
1729
- a
1515
+ n
1730
1516
  );
1731
- }), n) : (P(
1732
- r(M, {
1733
- options: { url: "", name: c("common.附件预览") },
1734
- title: c("common.附件预览未初始化"),
1735
- desc: c("common.请先调用setupJtAttachmentPreview注册请求配置"),
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: o
1523
+ onDestroy: r
1738
1524
  }),
1739
- a
1740
- ), n);
1525
+ n
1526
+ ), a);
1741
1527
  }
1742
- const gt = Object.assign(we, {
1743
- openByParams: dt,
1744
- setup: ut
1528
+ const lt = Object.assign(ae, {
1529
+ openByParams: $e,
1530
+ setup: Xe
1745
1531
  });
1746
1532
  export {
1747
- gt as J,
1748
- dt as a,
1749
- ut as b,
1750
- vt as g,
1751
- wt as i,
1752
- O as n,
1753
- ht as r,
1754
- pt as s,
1755
- c as t
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
  };