sctj-components 1.0.32 → 1.0.34

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.
@@ -1,4 +1,4 @@
1
- import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, onMounted as onMounted$1, onUpdated, nextTick, withModifiers, normalizeStyle, onUnmounted, isRef, withDirectives, vShow, onBeforeMount, getCurrentInstance, reactive, resolveDirective, toRefs, resolveDynamicComponent, withKeys, pushScopeId, popScopeId, useSlots, onBeforeUnmount, markRaw, useCssVars, shallowRef } from "vue";
1
+ import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, useCssVars, withModifiers, normalizeStyle, nextTick, onMounted as onMounted$1, onUnmounted, isRef, withDirectives, vShow, onBeforeMount, getCurrentInstance, reactive, resolveDirective, toRefs, resolveDynamicComponent, withKeys, pushScopeId, popScopeId, useSlots, onBeforeUnmount, markRaw, shallowRef } from "vue";
2
2
  import VueOfficePdf from "@vue-office/pdf";
3
3
  import VueOfficeDocx from "@vue-office/docx";
4
4
  import VueOfficeExcel from "@vue-office/excel";
@@ -130,7 +130,7 @@ const _sfc_main$p = {
130
130
  };
131
131
  const index$2 = "";
132
132
  const index$1 = "";
133
- const index_vue_vue_type_style_index_0_scoped_392c966d_lang = "";
133
+ const index_vue_vue_type_style_index_0_scoped_006fbc77_lang = "";
134
134
  const index_vue_vue_type_style_index_1_lang = "";
135
135
  const _hoisted_1$i = { class: "upload-file" };
136
136
  const _hoisted_2$b = { class: "el-upload__tip" };
@@ -195,6 +195,10 @@ const _sfc_main$o = {
195
195
  successCode: {
196
196
  type: Number,
197
197
  default: 200
198
+ },
199
+ drag: {
200
+ type: Boolean,
201
+ default: true
198
202
  }
199
203
  },
200
204
  emits: ["update:modelValue", "delete", "success"],
@@ -378,6 +382,7 @@ const _sfc_main$o = {
378
382
  limit: __props.limit,
379
383
  "on-error": handleUploadError,
380
384
  "on-exceed": handleExceed,
385
+ drag: __props.drag,
381
386
  "on-success": handleUploadSuccess,
382
387
  "show-file-list": false,
383
388
  headers: __props.headers,
@@ -389,13 +394,15 @@ const _sfc_main$o = {
389
394
  renderSlot(_ctx.$slots, "button", {}, () => [
390
395
  createVNode(_component_el_button, {
391
396
  size: "small",
392
- type: "primary"
397
+ link: __props.drag,
398
+ type: "primary",
399
+ icon: "Plus"
393
400
  }, {
394
401
  default: withCtx(() => [
395
- createTextVNode("\u9009\u53D6\u6587\u4EF6")
402
+ createTextVNode(toDisplayString(__props.drag ? "\u9009\u53D6\u3001\u62D6\u62FD\u6587\u4EF6" : "\u9009\u62E9\u6587\u4EF6"), 1)
396
403
  ]),
397
404
  _: 1
398
- })
405
+ }, 8, ["link"])
399
406
  ], true)
400
407
  ]),
401
408
  _: 2
@@ -418,7 +425,7 @@ const _sfc_main$o = {
418
425
  ]),
419
426
  key: "0"
420
427
  } : void 0
421
- ]), 1040, ["action", "http-request", "file-list", "limit", "headers"])) : createCommentVNode("", true),
428
+ ]), 1040, ["action", "http-request", "file-list", "limit", "drag", "headers"])) : createCommentVNode("", true),
422
429
  __props.showFiles ? (openBlock(), createBlock(TransitionGroup, {
423
430
  key: 1,
424
431
  class: "upload-file-list el-upload-list el-upload-list--text",
@@ -510,8 +517,8 @@ const _sfc_main$o = {
510
517
  };
511
518
  }
512
519
  };
513
- const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-392c966d"]]);
514
- const index_vue_vue_type_style_index_0_scoped_1fbca88e_lang = "";
520
+ const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-006fbc77"]]);
521
+ const index_vue_vue_type_style_index_0_scoped_31d7e3ce_lang = "";
515
522
  const _hoisted_1$h = { class: "component-upload-image" };
516
523
  const _hoisted_2$a = {
517
524
  key: 0,
@@ -583,11 +590,19 @@ const _sfc_main$n = {
583
590
  successCode: {
584
591
  type: Number,
585
592
  default: 200
593
+ },
594
+ drag: {
595
+ type: Boolean,
596
+ default: true
586
597
  }
587
598
  },
588
599
  emits: ["update:modelValue", "delete", "success"],
589
600
  setup(__props, { emit }) {
590
601
  const props = __props;
602
+ useCssVars((_ctx) => ({
603
+ "4eaeea22": unref(computedWidth),
604
+ "6d5f604b": unref(computedHeight)
605
+ }));
591
606
  const dealFilePath = (path, baseUrl = "") => {
592
607
  if (!path)
593
608
  return path;
@@ -607,13 +622,10 @@ const _sfc_main$n = {
607
622
  const showTip = computed$1(() => {
608
623
  return (props == null ? void 0 : props.isShowTip) && ((props == null ? void 0 : props.fileType) || (props == null ? void 0 : props.fileSize));
609
624
  });
610
- const uploadWidth = computed$1(() => {
625
+ const computedWidth = computed$1(() => {
611
626
  return typeof (props == null ? void 0 : props.width) === "number" ? `${props.width}px` : props.width;
612
627
  });
613
- const uploadHeight = computed$1(() => {
614
- return typeof (props == null ? void 0 : props.height) === "number" ? `${props.height}px` : props.height;
615
- });
616
- const uploadLineHeight = computed$1(() => {
628
+ const computedHeight = computed$1(() => {
617
629
  return typeof (props == null ? void 0 : props.height) === "number" ? `${props.height}px` : props.height;
618
630
  });
619
631
  watch(
@@ -633,25 +645,6 @@ const _sfc_main$n = {
633
645
  },
634
646
  { deep: true, immediate: true }
635
647
  );
636
- const updateElementSize = () => {
637
- nextTick(() => {
638
- var _a;
639
- const el = (_a = imageUpload.value) == null ? void 0 : _a.$el;
640
- if (!el)
641
- return;
642
- const uploadBtns = el.querySelectorAll(".el-upload--picture-card");
643
- uploadBtns.forEach((element) => {
644
- element.style.width = uploadWidth.value;
645
- element.style.height = uploadHeight.value;
646
- element.style.lineHeight = uploadLineHeight.value;
647
- });
648
- const previewItems = el.querySelectorAll(".el-upload-list__item");
649
- previewItems.forEach((element) => {
650
- element.style.width = uploadWidth.value;
651
- element.style.height = uploadHeight.value;
652
- });
653
- });
654
- };
655
648
  const handleBeforeUpload = async (file) => {
656
649
  let isImg = false;
657
650
  if (props.fileType && props.fileType.length) {
@@ -701,6 +694,7 @@ const _sfc_main$n = {
701
694
  }
702
695
  };
703
696
  const handleDelete = (file) => {
697
+ fileList.value = fileList.value.filter((item) => item.url !== file.url);
704
698
  emit("delete", file);
705
699
  emit("update:modelValue", listToString(fileList.value));
706
700
  };
@@ -730,18 +724,12 @@ const _sfc_main$n = {
730
724
  return "";
731
725
  return list.map((item) => item.url).join(separator);
732
726
  };
733
- onMounted$1(() => {
734
- updateElementSize();
735
- });
736
- onUpdated(() => {
737
- updateElementSize();
738
- });
739
727
  return (_ctx, _cache) => {
740
728
  const _component_el_icon = resolveComponent("el-icon");
741
729
  const _component_el_upload = resolveComponent("el-upload");
742
730
  const _component_el_dialog = resolveComponent("el-dialog");
743
731
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
744
- createVNode(_component_el_upload, {
732
+ createVNode(_component_el_upload, mergeProps({
745
733
  disabled: props.disabled,
746
734
  multiple: "",
747
735
  action: __props.uploadImgUrl,
@@ -759,8 +747,9 @@ const _sfc_main$n = {
759
747
  headers: __props.headers,
760
748
  "file-list": fileList.value,
761
749
  "on-preview": handlePictureCardPreview,
762
- class: normalizeClass({ hide: fileList.value.length >= props.limit })
763
- }, {
750
+ drag: __props.drag,
751
+ class: { hide: fileList.value.length >= props.limit }
752
+ }, _ctx.$attrs), {
764
753
  default: withCtx(() => [
765
754
  createVNode(_component_el_icon, null, {
766
755
  default: withCtx(() => [
@@ -770,7 +759,7 @@ const _sfc_main$n = {
770
759
  })
771
760
  ]),
772
761
  _: 1
773
- }, 8, ["disabled", "action", "limit", "http-request", "headers", "file-list", "class"]),
762
+ }, 16, ["disabled", "action", "limit", "http-request", "headers", "file-list", "drag", "class"]),
774
763
  unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
775
764
  createTextVNode(" \u8BF7\u4E0A\u4F20 "),
776
765
  props.fileSize ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -802,7 +791,7 @@ const _sfc_main$n = {
802
791
  };
803
792
  }
804
793
  };
805
- const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-1fbca88e"]]);
794
+ const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-31d7e3ce"]]);
806
795
  const index_vue_vue_type_style_index_0_scoped_bebc33d5_lang = "";
807
796
  const _hoisted_1$g = { class: "image-slot" };
808
797
  const _sfc_main$m = {
@@ -2513,7 +2502,7 @@ const _sfc_main$d = {
2513
2502
  };
2514
2503
  }
2515
2504
  };
2516
- const index_vue_vue_type_style_index_0_scoped_cd968be9_lang = "";
2505
+ const index_vue_vue_type_style_index_0_scoped_48dc11be_lang = "";
2517
2506
  const _hoisted_1$9 = { class: "table-page-container" };
2518
2507
  const _hoisted_2$7 = { style: { "flex": "1", "height": "0" } };
2519
2508
  const _sfc_main$c = {
@@ -2563,7 +2552,7 @@ const _sfc_main$c = {
2563
2552
  };
2564
2553
  }
2565
2554
  };
2566
- const SCTJTablePageContainer = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-cd968be9"]]);
2555
+ const SCTJTablePageContainer = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-48dc11be"]]);
2567
2556
  const index_vue_vue_type_style_index_0_scoped_6e30b57f_lang = "";
2568
2557
  const _hoisted_1$8 = {
2569
2558
  key: 0,