sctj-components 1.0.84 → 1.0.86

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.
@@ -130,7 +130,7 @@ const _sfc_main$v = {
130
130
  };
131
131
  const index$2 = "";
132
132
  const index$1 = "";
133
- const index_vue_vue_type_style_index_0_scoped_3ae88961_lang = "";
133
+ const index_vue_vue_type_style_index_0_scoped_9fdf9efd_lang = "";
134
134
  const index_vue_vue_type_style_index_1_lang = "";
135
135
  const _hoisted_1$m = { class: "upload-file" };
136
136
  const _hoisted_2$f = { class: "el-upload__tip" };
@@ -138,7 +138,13 @@ const _hoisted_3$b = { style: { "color": "#f56c6c" } };
138
138
  const _hoisted_4$a = { style: { "color": "#f56c6c" } };
139
139
  const _hoisted_5$7 = ["title"];
140
140
  const _hoisted_6$4 = { class: "ele-upload-list__item-content-action" };
141
- const _hoisted_7$4 = { style: { "width": "100%", "height": "100%", "overflow": "auto" } };
141
+ const _hoisted_7$4 = { style: { "display": "flex", "justify-content": "space-between" } };
142
+ const _hoisted_8$4 = ["id"];
143
+ const _hoisted_9$3 = {
144
+ key: 0,
145
+ class: "preview-toolbar"
146
+ };
147
+ const _hoisted_10$3 = { class: "previewDialogContent" };
142
148
  const _sfc_main$u = {
143
149
  __name: "index",
144
150
  props: {
@@ -153,7 +159,7 @@ const _sfc_main$u = {
153
159
  },
154
160
  fileType: {
155
161
  type: Array,
156
- default: () => ["docx", "xlsx", "doc", "xls", "ppt", "txt", "pdf", "png", "jpg", "jpeg", "pptx", "zip"]
162
+ default: () => ["docx", "xlsx", "doc", "xls", "ppt", "txt", "pdf", "png", "jpg", "jpeg", "pptx", "zip", "mp4"]
157
163
  },
158
164
  isShowTip: {
159
165
  type: Boolean,
@@ -220,6 +226,8 @@ const _sfc_main$u = {
220
226
  const previewVisibleImg = ref$1(false);
221
227
  const previewUrl = ref$1("");
222
228
  const previewType = ref$1("");
229
+ const pdfRotation = ref$1(0);
230
+ const pdfScale = ref$1(1);
223
231
  const loadingInstance = ref$1(null);
224
232
  const fileUpload2 = ref$1(null);
225
233
  const showTip = computed$1(() => {
@@ -323,7 +331,7 @@ const _sfc_main$u = {
323
331
  const fileExt = fileName.split(".").pop().toLowerCase();
324
332
  const link = document.createElement("a");
325
333
  link.style.display = "none";
326
- link.target = fileExt === "pdf" ? "_blank" : "_self";
334
+ link.target = fileExt === "pdf" || fileExt === "mp4" ? "_blank" : "_self";
327
335
  link.href = file.url;
328
336
  link.download = fileName;
329
337
  document.body.appendChild(link);
@@ -371,6 +379,64 @@ const _sfc_main$u = {
371
379
  previewUrl.value = "";
372
380
  previewType.value = "";
373
381
  };
382
+ const setTransform = (element, type, value) => {
383
+ let currentTransform = element.style.transform || "";
384
+ currentTransform = currentTransform.split(" ").filter((item) => !item.includes(type));
385
+ currentTransform.push(value);
386
+ element.style.transform = currentTransform.join(" ");
387
+ };
388
+ const saclc = (value) => {
389
+ pdfScale.value += value;
390
+ if (previewType.value === "pdf") {
391
+ const pdfViewer = document.querySelector(".pdf-viewer");
392
+ if (pdfViewer) {
393
+ const canvases = pdfViewer.querySelectorAll("canvas");
394
+ canvases.forEach((canvas) => {
395
+ setTransform(canvas, "scale", `scale(${pdfScale.value})`);
396
+ });
397
+ }
398
+ }
399
+ if (previewType.value === "docx") {
400
+ const docxViewer = document.querySelector(".docx-viewer");
401
+ if (docxViewer) {
402
+ const sections = docxViewer.querySelectorAll("section");
403
+ sections.forEach((section) => {
404
+ setTransform(section, "scale", `scale(${pdfScale.value})`);
405
+ });
406
+ }
407
+ }
408
+ };
409
+ const rotate = () => {
410
+ pdfRotation.value = (pdfRotation.value + 90) % 360;
411
+ if (previewType.value === "pdf") {
412
+ const pdfViewer = document.querySelector(".pdf-viewer");
413
+ if (pdfViewer) {
414
+ const canvases = pdfViewer.querySelectorAll("canvas");
415
+ canvases.forEach((canvas) => {
416
+ setTransform(canvas, "rotate", `rotate(${pdfRotation.value}deg)`);
417
+ });
418
+ canvases[0].scrollIntoView({
419
+ behavior: "smooth",
420
+ block: "start",
421
+ inline: "nearest"
422
+ });
423
+ }
424
+ }
425
+ if (previewType.value === "docx") {
426
+ const docxViewer = document.querySelector(".docx-viewer");
427
+ if (docxViewer) {
428
+ const sections = docxViewer.querySelectorAll("section");
429
+ sections.forEach((section) => {
430
+ setTransform(section, "rotate", `rotate(${pdfRotation.value}deg)`);
431
+ });
432
+ sections[0].scrollIntoView({
433
+ behavior: "smooth",
434
+ block: "start",
435
+ inline: "nearest"
436
+ });
437
+ }
438
+ }
439
+ };
374
440
  return (_ctx, _cache) => {
375
441
  const _component_el_button = resolveComponent("el-button");
376
442
  const _component_el_upload = resolveComponent("el-upload");
@@ -488,22 +554,55 @@ const _sfc_main$u = {
488
554
  })) : createCommentVNode("", true),
489
555
  createVNode(_component_el_dialog, {
490
556
  modelValue: previewVisible.value,
491
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => previewVisible.value = $event),
557
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => previewVisible.value = $event),
492
558
  "append-to-body": "",
493
559
  class: "previewDialog",
494
560
  title: "\u6587\u4EF6\u9884\u89C8",
495
561
  fullscreen: "",
496
562
  "before-close": handlePreviewClose
497
563
  }, {
498
- default: withCtx(() => [
564
+ header: withCtx(({ close, titleId, titleClass }) => [
499
565
  createElementVNode("div", _hoisted_7$4, [
566
+ createElementVNode("div", {
567
+ id: titleId,
568
+ class: normalizeClass(titleClass)
569
+ }, "\u6587\u4EF6\u9884\u89C8", 10, _hoisted_8$4),
570
+ previewType.value === "pdf" || previewType.value === "docx" ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
571
+ createVNode(_component_el_button, {
572
+ onClick: _cache[0] || (_cache[0] = ($event) => saclc(-0.1)),
573
+ title: "\u7F29\u5C0F",
574
+ type: "default",
575
+ circle: "",
576
+ icon: "Minus"
577
+ }),
578
+ createVNode(_component_el_button, {
579
+ onClick: _cache[1] || (_cache[1] = ($event) => saclc(0.1)),
580
+ title: "\u653E\u5927",
581
+ type: "default",
582
+ circle: "",
583
+ icon: "Plus"
584
+ }),
585
+ createVNode(_component_el_button, {
586
+ onClick: rotate,
587
+ title: "\u65CB\u8F6C",
588
+ type: "default",
589
+ circle: "",
590
+ icon: "RefreshRight"
591
+ })
592
+ ])) : createCommentVNode("", true)
593
+ ])
594
+ ]),
595
+ default: withCtx(() => [
596
+ createElementVNode("div", _hoisted_10$3, [
500
597
  previewType.value === "pdf" ? (openBlock(), createBlock(unref(VueOfficePdf), {
501
598
  key: 0,
502
- src: previewUrl.value
599
+ src: previewUrl.value,
600
+ class: "pdf-viewer"
503
601
  }, null, 8, ["src"])) : createCommentVNode("", true),
504
602
  previewType.value === "docx" ? (openBlock(), createBlock(unref(VueOfficeDocx), {
505
603
  key: 1,
506
- src: previewUrl.value
604
+ src: previewUrl.value,
605
+ class: "docx-viewer"
507
606
  }, null, 8, ["src"])) : createCommentVNode("", true),
508
607
  previewType.value === "xlsx" ? (openBlock(), createBlock(unref(VueOfficeExcel), {
509
608
  key: 2,
@@ -517,13 +616,13 @@ const _sfc_main$u = {
517
616
  key: 2,
518
617
  "url-list": previewUrl.value,
519
618
  "show-progress": "",
520
- onClose: _cache[1] || (_cache[1] = ($event) => previewVisibleImg.value = false)
619
+ onClose: _cache[3] || (_cache[3] = ($event) => previewVisibleImg.value = false)
521
620
  }, null, 8, ["url-list"])) : createCommentVNode("", true)
522
621
  ]);
523
622
  };
524
623
  }
525
624
  };
526
- const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-3ae88961"]]);
625
+ const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-9fdf9efd"]]);
527
626
  const index_vue_vue_type_style_index_0_scoped_672e5149_lang = "";
528
627
  const _hoisted_1$l = { class: "component-upload-image" };
529
628
  const _hoisted_2$e = {