bmp-layout 0.0.13 → 0.0.15

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/bmp-layout.es.js CHANGED
@@ -1,8 +1,9 @@
1
- import { openBlock, createBlock, unref, normalizeClass, nextTick, ref, computed, watch, withCtx, createElementBlock, createElementVNode, normalizeStyle, createVNode, Fragment, defineComponent, isVNode, Teleport, Transition, withModifiers, toDisplayString, renderList, createCommentVNode, resolveComponent, provide, resolveDynamicComponent, onMounted, TransitionGroup, createTextVNode, mergeProps, isRef, onUnmounted, withDirectives, resolveDirective, renderSlot, render, useCssVars, createSlots, watchEffect, vShow, useSlots, useAttrs, inject, onBeforeUnmount, reactive, onUpdated } from "vue";
1
+ import { openBlock, createBlock, unref, normalizeClass, nextTick, ref, computed, watch, withCtx, createElementBlock, createElementVNode, normalizeStyle, createVNode, Fragment, defineComponent, isVNode, Teleport, Transition, withModifiers, toDisplayString, renderList, createCommentVNode, resolveComponent, provide, resolveDynamicComponent, onMounted, TransitionGroup, createTextVNode, mergeProps, isRef, onUnmounted, withDirectives, resolveDirective, renderSlot, watchEffect, vShow, useSlots, useAttrs, createSlots, inject, onBeforeUnmount, reactive, onUpdated, render, useCssVars } from "vue";
2
2
  import { createPinia, defineStore } from "pinia";
3
3
  import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
4
4
  import { cloneDeep, omit } from "lodash-es";
5
- import { ElBacktop, ElIcon, ElMenuItem, ElSubMenu, ElScrollbar, ElMenu, ElInput, ElBadge, ElDropdown, ElDropdownMenu, ElDropdownItem, ElAvatar, ElMessageBox, ElBreadcrumb, ElBreadcrumbItem, ElDrawer, ElMessage, ElConfigProvider, ElCard, ElImageViewer, ElNotification, ElUpload, ElLink, ElButton, ElPagination, ElDialog, ElAlert, ElAffix } from "element-plus";
5
+ import { ElBacktop, ElIcon, ElMenuItem, ElSubMenu, ElScrollbar, ElMenu, ElInput, ElBadge, ElDropdown, ElDropdownMenu, ElDropdownItem, ElAvatar, ElMessageBox, ElBreadcrumb, ElBreadcrumbItem, ElDrawer, ElMessage, ElConfigProvider, ElCard, ElPagination, ElDialog, ElAlert, ElAffix, ElImageViewer, ElNotification, ElUpload, ElLink, ElButton, ElAutocomplete, ElButtonGroup, ElCarousel, ElCarouselItem, ElCollapse, ElCollapseItem, ElCollapseTransition, ElDivider, ElEmpty, ElOverlay, ElPageHeader, ElProgress, ElResult, ElSkeleton, ElSkeletonItem, ElSpace, ElTag, ElText, ElCascader, ElCascaderPanel, ElCheckbox, ElCheckboxButton, ElCheckboxGroup, ElColorPicker, ElDatePicker, ElForm, ElFormItem, ElInputNumber, ElInputTag, ElRadio, ElRadioButton, ElRadioGroup, ElRate, ElSelect, ElOption, ElOptionGroup, ElSelectV2, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElMention, ElCalendar, ElCheckTag, ElCountdown, ElDescriptions, ElDescriptionsItem, ElImage, ElStatistic, ElTable, ElTableColumn, ElTimeline, ElTimelineItem, ElTree, ElTreeV2, ElMenuItemGroup, ElTabs, ElTabPane, ElPopover, ElPopconfirm, ElTooltip, ElContainer, ElAside, ElFooter, ElHeader, ElMain, ElRow, ElCol, ElSplitter, ElSplitterPanel, ElSegmented, ElTour, ElTourStep, ElWatermark, ElPopper } from "element-plus";
6
+ import { ElAffix as ElAffix2, ElAside as ElAside2, ElAutocomplete as ElAutocomplete2, ElAvatar as ElAvatar2, ElBreadcrumb as ElBreadcrumb2, ElBreadcrumbItem as ElBreadcrumbItem2, ElButton as ElButton2, ElButtonGroup as ElButtonGroup2, ElCalendar as ElCalendar2, ElCard as ElCard2, ElCarousel as ElCarousel2, ElCarouselItem as ElCarouselItem2, ElCascader as ElCascader2, ElCascaderPanel as ElCascaderPanel2, ElCheckTag as ElCheckTag2, ElCheckbox as ElCheckbox2, ElCheckboxButton as ElCheckboxButton2, ElCheckboxGroup as ElCheckboxGroup2, ElCol as ElCol2, ElCollapse as ElCollapse2, ElCollapseItem as ElCollapseItem2, ElCollapseTransition as ElCollapseTransition2, ElColorPicker as ElColorPicker2, ElConfigProvider as ElConfigProvider2, ElContainer as ElContainer2, ElCountdown as ElCountdown2, ElDatePicker as ElDatePicker2, ElDescriptions as ElDescriptions2, ElDescriptionsItem as ElDescriptionsItem2, ElDivider as ElDivider2, ElDrawer as ElDrawer2, ElDropdown as ElDropdown2, ElDropdownItem as ElDropdownItem2, ElDropdownMenu as ElDropdownMenu2, ElEmpty as ElEmpty2, ElFooter as ElFooter2, ElForm as ElForm2, ElFormItem as ElFormItem2, ElHeader as ElHeader2, ElImage as ElImage2, ElImageViewer as ElImageViewer2, ElInfiniteScroll, ElInput as ElInput2, ElInputNumber as ElInputNumber2, ElInputTag as ElInputTag2, ElLink as ElLink2, ElLoading, ElMain as ElMain2, ElMention as ElMention2, ElMenu as ElMenu2, ElMenuItem as ElMenuItem2, ElMenuItemGroup as ElMenuItemGroup2, ElMessage as ElMessage2, ElMessageBox as ElMessageBox2, ElNotification as ElNotification2, ElOption as ElOption2, ElOptionGroup as ElOptionGroup2, ElOverlay as ElOverlay2, ElPageHeader as ElPageHeader2, ElPopconfirm as ElPopconfirm2, ElPopover as ElPopover2, ElPopper as ElPopper2, ElProgress as ElProgress2, ElRadio as ElRadio2, ElRadioButton as ElRadioButton2, ElRadioGroup as ElRadioGroup2, ElRate as ElRate2, ElResult as ElResult2, ElRow as ElRow2, ElScrollbar as ElScrollbar2, ElSegmented as ElSegmented2, ElSelect as ElSelect2, ElSelectV2 as ElSelectV22, ElSkeleton as ElSkeleton2, ElSkeletonItem as ElSkeletonItem2, ElSlider as ElSlider2, ElSpace as ElSpace2, ElSplitter as ElSplitter2, ElSplitterPanel as ElSplitterPanel2, ElStatistic as ElStatistic2, ElSubMenu as ElSubMenu2, ElSwitch as ElSwitch2, ElTabPane as ElTabPane2, ElTable as ElTable2, ElTableColumn as ElTableColumn2, ElTabs as ElTabs2, ElTag as ElTag2, ElText as ElText2, ElTimePicker as ElTimePicker2, ElTimeSelect as ElTimeSelect2, ElTimeline as ElTimeline2, ElTimelineItem as ElTimelineItem2, ElTooltip as ElTooltip2, ElTour as ElTour2, ElTourStep as ElTourStep2, ElTransfer as ElTransfer2, ElTree as ElTree2, ElTreeSelect as ElTreeSelect2, ElTreeV2 as ElTreeV22, ElUpload as ElUpload2, ElWatermark as ElWatermark2 } from "element-plus";
6
7
  import { createRouter, createWebHashHistory, useRoute, useRouter } from "vue-router";
7
8
  import "vue-i18n";
8
9
  import { useClipboard, useWindowSize } from "@vueuse/core";
@@ -9456,11 +9457,11 @@ const _sfc_main$c = /* @__PURE__ */ Object.assign({ name: "PageCard" }, {
9456
9457
  };
9457
9458
  }
9458
9459
  });
9459
- const PageCard = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-32ef0d97"]]);
9460
+ const PageCard = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-eb81072a"]]);
9460
9461
  const _hoisted_1$5 = { class: "ml-2px" };
9461
9462
  const _hoisted_2$5 = { class: "flex items-center" };
9462
- const _sfc_main$b = /* @__PURE__ */ Object.assign({ name: "PageHeader" }, {
9463
- __name: "PageHeader",
9463
+ const _sfc_main$b = /* @__PURE__ */ Object.assign({ name: "PageNavBar" }, {
9464
+ __name: "PageNavBar",
9464
9465
  props: {
9465
9466
  title: {
9466
9467
  type: String,
@@ -9485,7 +9486,7 @@ const _sfc_main$b = /* @__PURE__ */ Object.assign({ name: "PageHeader" }, {
9485
9486
  return (_ctx, _cache) => {
9486
9487
  const _component_Icon = resolveComponent("Icon");
9487
9488
  return openBlock(), createElementBlock("div", {
9488
- ref: "pageHeader",
9489
+ ref: "pageNavBar",
9489
9490
  class: normalizeClass([`${unref(prefixCls2)}`])
9490
9491
  }, [
9491
9492
  createElementVNode("div", {
@@ -9522,1764 +9523,1764 @@ const _sfc_main$b = /* @__PURE__ */ Object.assign({ name: "PageHeader" }, {
9522
9523
  };
9523
9524
  }
9524
9525
  });
9525
- const PageHeader = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-68d4a56d"]]);
9526
- const _sfc_main$a = /* @__PURE__ */ Object.assign({ name: "ImageViewer" }, {
9527
- __name: "ImageViewer",
9526
+ const PageNavBar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-0d587176"]]);
9527
+ const _sfc_main$a = /* @__PURE__ */ Object.assign({ name: "Badge" }, {
9528
+ __name: "Badge",
9528
9529
  props: {
9529
- urlList: {
9530
- type: Array,
9531
- default: () => []
9532
- },
9533
- zIndex: {
9534
- type: Number,
9535
- default: 200
9530
+ value: {
9531
+ type: [String, Number],
9532
+ default: ""
9536
9533
  },
9537
- initialIndex: {
9534
+ max: {
9538
9535
  type: Number,
9539
- default: 0
9540
- },
9541
- infinite: {
9542
- type: Boolean,
9543
- default: true
9536
+ default: 99
9544
9537
  },
9545
- hideOnClickModal: {
9538
+ isDot: {
9546
9539
  type: Boolean,
9547
9540
  default: false
9548
9541
  },
9549
- teleported: {
9542
+ hidden: {
9550
9543
  type: Boolean,
9551
9544
  default: false
9552
9545
  },
9553
- show: {
9554
- type: Boolean,
9555
- default: false
9546
+ type: {
9547
+ type: String,
9548
+ default: "danger",
9549
+ validator(value) {
9550
+ return ["primary", "success", "warning", "danger", "info"].includes(value);
9551
+ }
9556
9552
  }
9557
9553
  },
9558
9554
  setup(__props) {
9559
9555
  const props = __props;
9560
- const getBindValue = computed(() => {
9561
- const propsData = { ...props };
9562
- delete propsData.show;
9563
- return propsData;
9564
- });
9565
- const show = ref(props.show);
9566
- const close = () => {
9567
- show.value = false;
9568
- };
9556
+ const { getPrefixCls: getPrefixCls2 } = useDesign();
9557
+ const prefixCls2 = getPrefixCls2("badge");
9569
9558
  return (_ctx, _cache) => {
9570
- return unref(show) ? (openBlock(), createBlock(unref(ElImageViewer), mergeProps({ key: 0 }, unref(getBindValue), { onClose: close }), null, 16)) : createCommentVNode("", true);
9559
+ return openBlock(), createBlock(unref(ElBadge), mergeProps(props, { class: unref(prefixCls2) }), {
9560
+ default: withCtx(() => [
9561
+ renderSlot(_ctx.$slots, "default")
9562
+ ]),
9563
+ _: 3
9564
+ }, 16, ["class"]);
9571
9565
  };
9572
9566
  }
9573
9567
  });
9574
- let instance = null;
9575
- function createImageViewer(options) {
9576
- if (!isClient)
9577
- return;
9578
- const {
9579
- urlList,
9580
- initialIndex = 0,
9581
- infinite = true,
9582
- hideOnClickModal = false,
9583
- teleported = false,
9584
- zIndex = 2e3,
9585
- show = true
9586
- } = options;
9587
- const propsData = {};
9588
- const container = document.createElement("div");
9589
- propsData.urlList = urlList;
9590
- propsData.initialIndex = initialIndex;
9591
- propsData.infinite = infinite;
9592
- propsData.hideOnClickModal = hideOnClickModal;
9593
- propsData.teleported = teleported;
9594
- propsData.zIndex = zIndex;
9595
- propsData.show = show;
9596
- document.body.appendChild(container);
9597
- instance = createVNode(_sfc_main$a, propsData);
9598
- render(instance, container);
9599
- }
9600
- const useMessage = () => {
9601
- const { t: t2 } = useI18n("layout");
9602
- const scssVariables = variables$1;
9603
- return {
9604
- // 消息提示
9605
- info(content) {
9606
- ElMessage.info(content);
9607
- },
9608
- // 错误消息
9609
- error(content) {
9610
- ElMessage.error(content);
9611
- },
9612
- // 成功消息
9613
- success(content) {
9614
- ElMessage.success(content);
9615
- },
9616
- // 警告消息
9617
- warning(content) {
9618
- ElMessage.warning(content);
9568
+ const _sfc_main$9 = /* @__PURE__ */ Object.assign({ name: "Pagination" }, {
9569
+ __name: "Pagination",
9570
+ props: {
9571
+ // 总条目数
9572
+ total: {
9573
+ required: true,
9574
+ type: Number
9619
9575
  },
9620
- // 弹出提示
9621
- alert(content) {
9622
- ElMessageBox.alert(content, t2("common.confirmTitle"));
9576
+ // 当前页数:pageNo
9577
+ page: {
9578
+ type: Number,
9579
+ default: 1
9623
9580
  },
9624
- // 错误提示
9625
- alertError(content) {
9626
- ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "error" });
9581
+ // 每页显示条目个数:pageSize
9582
+ limit: {
9583
+ type: Number,
9584
+ default: 20
9627
9585
  },
9628
- // 成功提示
9629
- alertSuccess(content) {
9630
- ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "success" });
9586
+ // 设置最大页码按钮数。 页码按钮的数量,当总页数超过该值时会折叠
9587
+ // 移动端页码按钮的数量端默认值 5
9588
+ pagerCount: {
9589
+ type: Number,
9590
+ default: document.body.clientWidth < 992 ? 5 : 7
9591
+ }
9592
+ },
9593
+ emits: ["update:page", "update:limit", "pagination"],
9594
+ setup(__props, { emit: __emit }) {
9595
+ const appStore = useAppStore();
9596
+ const layoutCurrentSize = computed(() => appStore.currentSize);
9597
+ const isSmall = ref(layoutCurrentSize.value === "small");
9598
+ watchEffect(() => {
9599
+ isSmall.value = layoutCurrentSize.value === "small";
9600
+ });
9601
+ const props = __props;
9602
+ const emit = __emit;
9603
+ const currentPage = computed({
9604
+ get() {
9605
+ return props.page;
9606
+ },
9607
+ set(val) {
9608
+ emit("update:page", val);
9609
+ }
9610
+ });
9611
+ const pageSize = computed({
9612
+ get() {
9613
+ return props.limit;
9614
+ },
9615
+ set(val) {
9616
+ emit("update:limit", val);
9617
+ }
9618
+ });
9619
+ const handleSizeChange = (val) => {
9620
+ if (currentPage.value * val > props.total) {
9621
+ currentPage.value = 1;
9622
+ }
9623
+ emit("pagination", { page: currentPage.value, limit: val });
9624
+ };
9625
+ const handleCurrentChange = (val) => {
9626
+ emit("pagination", { page: val, limit: pageSize.value });
9627
+ };
9628
+ return (_ctx, _cache) => {
9629
+ return withDirectives((openBlock(), createBlock(unref(ElPagination), {
9630
+ "current-page": currentPage.value,
9631
+ "onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
9632
+ "page-size": pageSize.value,
9633
+ "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pageSize.value = $event),
9634
+ "pager-count": __props.pagerCount,
9635
+ total: __props.total,
9636
+ small: unref(isSmall),
9637
+ class: "m-t-16px",
9638
+ layout: "prev, pager, next, sizes",
9639
+ onSizeChange: handleSizeChange,
9640
+ onCurrentChange: handleCurrentChange
9641
+ }, null, 8, ["current-page", "page-size", "pager-count", "total", "small"])), [
9642
+ [vShow, __props.total > 0]
9643
+ ]);
9644
+ };
9645
+ }
9646
+ });
9647
+ const _hoisted_1$4 = { class: "title" };
9648
+ const _hoisted_2$4 = { class: "absolute right-17px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between" };
9649
+ const _hoisted_3$4 = { class: "p-20px" };
9650
+ const _hoisted_4$4 = {
9651
+ key: 1,
9652
+ class: "pt-16px p-l-20px p-r-20px"
9653
+ };
9654
+ const _sfc_main$8 = /* @__PURE__ */ Object.assign({ name: "Dialog" }, {
9655
+ __name: "Dialog",
9656
+ props: {
9657
+ modelValue: {
9658
+ type: Boolean,
9659
+ default: false
9631
9660
  },
9632
- // 警告提示
9633
- alertWarning(content) {
9634
- ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "warning" });
9661
+ title: {
9662
+ type: String,
9663
+ default: "Dialog"
9635
9664
  },
9636
- // 通知提示
9637
- notify(content) {
9638
- ElNotification.info(content);
9665
+ fullscreen: {
9666
+ type: Boolean,
9667
+ default: false
9639
9668
  },
9640
- // 错误通知
9641
- notifyError(content) {
9642
- ElNotification.error(content);
9669
+ width: {
9670
+ type: [String, Number]
9643
9671
  },
9644
- // 成功通知
9645
- notifySuccess(content) {
9646
- ElNotification.success(content);
9672
+ // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度
9673
+ scroll: {
9674
+ type: Boolean,
9675
+ default: false
9647
9676
  },
9648
- // 警告通知
9649
- notifyWarning(content) {
9650
- ElNotification.warning(content);
9677
+ maxHeight: {
9678
+ type: [String, Number],
9679
+ default: "60vh"
9651
9680
  },
9652
- // 确认窗体
9653
- confirm(content, tip, options = {}) {
9654
- return ElMessageBox.confirm(content, tip ? tip : t2("common.confirmTitle"), {
9655
- ...options,
9656
- customClass: `${options.customClass} ${scssVariables.namespace}-message-box`,
9657
- confirmButtonText: options.confirmButtonText ?? t2("common.ok"),
9658
- cancelButtonText: options.cancelButtonText ?? t2("common.cancel"),
9659
- buttonSize: "default",
9660
- center: true
9661
- });
9681
+ // width有值时优先使用width
9682
+ size: {
9683
+ type: String,
9684
+ default: "default",
9685
+ validate(value) {
9686
+ return ["large", "default", "small"].includes(value);
9687
+ }
9662
9688
  },
9663
- // 删除窗体
9664
- delConfirm(content, tip) {
9665
- return ElMessageBox.confirm(
9666
- content ? content : t2("common.delMessage"),
9667
- tip ? tip : t2("common.confirmTitle"),
9668
- {
9669
- customClass: `${scssVariables.namespace}-message-box`,
9670
- confirmButtonText: t2("common.ok"),
9671
- cancelButtonText: t2("common.cancel"),
9672
- buttonSize: "default",
9673
- center: true,
9674
- type: "warning"
9675
- }
9676
- );
9689
+ top: {
9690
+ type: String,
9691
+ default: "0"
9677
9692
  },
9678
- // 导出窗体
9679
- exportConfirm(content, tip) {
9680
- return ElMessageBox.confirm(
9681
- content ? content : t2("common.exportMessage"),
9682
- tip ? tip : t2("common.confirmTitle"),
9683
- {
9684
- confirmButtonText: t2("common.ok"),
9685
- cancelButtonText: t2("common.cancel"),
9686
- type: "warning"
9687
- }
9688
- );
9689
- },
9690
- // 提交内容
9691
- prompt(content, tip, options = {}) {
9692
- return ElMessageBox.prompt(content, tip, {
9693
- confirmButtonText: t2("common.ok"),
9694
- cancelButtonText: t2("common.cancel"),
9695
- ...options
9696
- });
9697
- }
9698
- };
9699
- };
9700
- const _hoisted_1$4 = { class: "upload-box" };
9701
- const _hoisted_2$4 = ["src"];
9702
- const _hoisted_3$4 = { key: 0 };
9703
- const _hoisted_4$4 = { key: 0 };
9704
- const _hoisted_5$3 = {
9705
- key: 1,
9706
- class: "upload-empty"
9707
- };
9708
- const _hoisted_6$2 = { class: "el-upload__tip" };
9709
- const _sfc_main$9 = /* @__PURE__ */ Object.assign({ name: "UploadImg", inheritAttrs: false }, {
9710
- __name: "UploadImg",
9711
- props: {
9712
- modelValue: {
9713
- type: String,
9714
- default: ""
9715
- },
9716
- // 是否支持拖拽上传 ==> 非必传(默认为 true)
9717
- drag: {
9718
- type: Boolean,
9719
- default: true
9720
- },
9721
- // 是否禁用上传组件 ==> 非必传(默认为 false)
9722
- disabled: {
9723
- type: Boolean,
9724
- default: false
9725
- },
9726
- // 图片大小限制 ==> 非必传(默认为 5M)
9727
- fileSize: {
9728
- type: Number,
9729
- default: 5
9730
- },
9731
- // 图片类型限制 ==> 非必传(默认为 ["image/jpeg", "image/png", "image/gif"])
9732
- fileType: {
9733
- type: Array,
9734
- default: () => ["image/jpeg", "image/png", "image/gif"]
9735
- },
9736
- // 组件高度 ==> 非必传(默认为 150px)
9737
- height: {
9738
- type: String,
9739
- default: "100px"
9740
- },
9741
- // 组件宽度 ==> 非必传(默认为 150px)
9742
- width: {
9743
- type: String,
9744
- default: "100px"
9745
- },
9746
- // 组件边框圆角 ==> 非必传(默认为 8px)
9747
- borderradius: {
9748
- type: String,
9749
- default: "4px"
9750
- },
9751
- // 是否显示删除按钮
9752
- showDelete: {
9693
+ scrollbarAlways: {
9753
9694
  type: Boolean,
9754
9695
  default: true
9755
- },
9756
- // 是否显示按钮文字
9757
- showBtnText: {
9758
- type: Boolean,
9759
- default: false
9760
- },
9761
- // 上传目录 ==> 非必传(默认为 undefined)
9762
- directory: {
9763
- type: String,
9764
- default: void 0
9765
- },
9766
- // 自定义上传函数(必填)==> 必传
9767
- customUpload: {
9768
- type: Function,
9769
- required: true
9770
- },
9771
- // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
9772
- getUploadUrl: {
9773
- type: Function,
9774
- default: (res) => res.data
9775
9696
  }
9776
9697
  },
9777
- emits: ["update:modelValue"],
9698
+ emits: ["update:modelValue", "close"],
9778
9699
  setup(__props, { emit: __emit }) {
9779
- useCssVars((_ctx) => ({
9780
- "3d8ea9da": __props.width,
9781
- "2c0dbd7a": __props.height,
9782
- "00ef71d1": __props.borderradius
9783
- }));
9700
+ const slots = useSlots();
9784
9701
  const props = __props;
9785
- const { t: t2 } = useI18n("layout");
9786
- const message = useMessage();
9787
- const uuid = ref("id-" + generateUUID());
9788
- const imagePreview = (imgUrl) => {
9789
- createImageViewer({
9790
- zIndex: 9999999,
9791
- urlList: [imgUrl]
9792
- });
9793
- };
9794
9702
  const emit = __emit;
9795
- const deleteImg = () => {
9796
- emit("update:modelValue", "");
9797
- };
9798
- const httpRequest = async (options) => {
9799
- return await props.customUpload(options.file, {
9800
- directory: props.directory
9801
- });
9802
- };
9803
- const beforeUpload = (rawFile) => {
9804
- const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
9805
- const imgType = props.fileType;
9806
- if (!imgType.includes(rawFile.type))
9807
- message.notifyWarning("上传图片不符合所需的格式!");
9808
- if (!imgSize)
9809
- message.notifyWarning(`上传图片大小不能超过 ${props.fileSize}M!`);
9810
- return imgType.includes(rawFile.type) && imgSize;
9811
- };
9812
- const uploadSuccess = (res) => {
9813
- message.success("上传成功");
9814
- const fileUrl = props.getUploadUrl(res);
9815
- emit("update:modelValue", fileUrl);
9816
- };
9817
- const uploadError = () => {
9818
- message.notifyError("图片上传失败,请您重新上传!");
9703
+ const getBindValue = computed(() => {
9704
+ const delArr = ["fullscreen", "title", "maxHeight", "appendToBody"];
9705
+ const attrs = useAttrs();
9706
+ const obj = { ...attrs, ...props };
9707
+ for (const key in obj) {
9708
+ if (delArr.indexOf(key) !== -1) {
9709
+ delete obj[key];
9710
+ }
9711
+ }
9712
+ return obj;
9713
+ });
9714
+ const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight);
9715
+ const dialogStyle = computed(() => {
9716
+ return {
9717
+ height: unref(dialogHeight)
9718
+ };
9719
+ });
9720
+ const dialogWidth = computed(() => {
9721
+ return props.width ?? (props.size === "default" ? "40%" : props.size === "large" ? "60%" : "30%");
9722
+ });
9723
+ const dialogClose = () => {
9724
+ emit("update:modelValue", false);
9725
+ emit("close");
9819
9726
  };
9820
9727
  return (_ctx, _cache) => {
9821
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
9822
- createVNode(unref(ElUpload), {
9823
- id: unref(uuid),
9824
- accept: __props.fileType.join(","),
9825
- "before-upload": beforeUpload,
9826
- class: normalizeClass(["upload", __props.drag ? "no-border" : ""]),
9827
- disabled: __props.disabled,
9828
- drag: __props.drag,
9829
- "http-request": httpRequest,
9830
- multiple: false,
9831
- "on-error": uploadError,
9832
- "on-success": uploadSuccess,
9833
- "show-file-list": false
9834
- }, {
9835
- default: withCtx(() => [
9836
- __props.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
9837
- createElementVNode("img", {
9838
- src: __props.modelValue,
9839
- class: "upload-image"
9840
- }, null, 8, _hoisted_2$4),
9841
- createElementVNode("div", {
9842
- class: "upload-handle",
9843
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {
9844
- }, ["stop"]))
9845
- }, [
9846
- createElementVNode("div", {
9847
- class: "handle-icon",
9848
- onClick: _cache[0] || (_cache[0] = ($event) => imagePreview(__props.modelValue))
9849
- }, [
9850
- createVNode(unref(_sfc_main$v), { icon: "ant-design:zoom-in-outlined" }),
9851
- __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(unref(t2)("action.detail")), 1)) : createCommentVNode("", true)
9852
- ]),
9853
- __props.showDelete && !__props.disabled ? (openBlock(), createElementBlock("div", {
9854
- key: 0,
9855
- class: "handle-icon",
9856
- onClick: deleteImg
9857
- }, [
9858
- createVNode(unref(_sfc_main$v), { icon: "ant-design:delete-outlined" }),
9859
- __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(unref(t2)("action.del")), 1)) : createCommentVNode("", true)
9860
- ])) : createCommentVNode("", true)
9728
+ const _component_Icon = resolveComponent("Icon");
9729
+ return openBlock(), createBlock(unref(ElDialog), mergeProps(unref(getBindValue), {
9730
+ "close-on-click-modal": true,
9731
+ fullscreen: __props.fullscreen,
9732
+ width: unref(dialogWidth),
9733
+ top: __props.top,
9734
+ "destroy-on-close": "",
9735
+ "lock-scroll": "",
9736
+ class: "com-dialog",
9737
+ "modal-class": "com-modal-dialog",
9738
+ "footer-class": __props.scroll ? "footer-shadow" : "",
9739
+ "show-close": false,
9740
+ onClose: dialogClose
9741
+ }), createSlots({
9742
+ header: withCtx(({ close }) => [
9743
+ createElementVNode("div", _hoisted_1$4, [
9744
+ renderSlot(_ctx.$slots, "title", {}, () => [
9745
+ createTextVNode(toDisplayString(__props.title), 1)
9746
+ ]),
9747
+ createElementVNode("div", _hoisted_2$4, [
9748
+ createVNode(_component_Icon, {
9749
+ class: "is-hover cursor-pointer",
9750
+ icon: "ep:close",
9751
+ "hover-color": "var(--el-color-primary)",
9752
+ color: "var(--el-color-info)",
9753
+ onClick: withModifiers(close, ["stop"])
9754
+ }, null, 8, ["onClick"])
9755
+ ])
9756
+ ])
9757
+ ]),
9758
+ default: withCtx(() => [
9759
+ __props.scroll ? (openBlock(), createBlock(unref(ElScrollbar), {
9760
+ key: 0,
9761
+ style: normalizeStyle(unref(dialogStyle)),
9762
+ always: __props.scrollbarAlways
9763
+ }, {
9764
+ default: withCtx(() => [
9765
+ createElementVNode("div", _hoisted_3$4, [
9766
+ renderSlot(_ctx.$slots, "default")
9861
9767
  ])
9862
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_5$3, [
9863
- renderSlot(_ctx.$slots, "empty", {}, () => [
9864
- createVNode(unref(_sfc_main$v), {
9865
- icon: "ep:plus",
9866
- size: 20
9867
- }),
9868
- _cache[2] || (_cache[2] = createElementVNode("span", { class: "empty-text" }, "点击上传", -1))
9869
- ], true)
9870
- ]))
9768
+ ]),
9769
+ _: 3
9770
+ }, 8, ["style", "always"])) : (openBlock(), createElementBlock("div", _hoisted_4$4, [
9771
+ renderSlot(_ctx.$slots, "default")
9772
+ ]))
9773
+ ]),
9774
+ _: 2
9775
+ }, [
9776
+ unref(slots).footer ? {
9777
+ name: "footer",
9778
+ fn: withCtx(() => [
9779
+ renderSlot(_ctx.$slots, "footer")
9871
9780
  ]),
9872
- _: 3
9873
- }, 8, ["id", "accept", "class", "disabled", "drag"]),
9874
- createElementVNode("div", _hoisted_6$2, [
9875
- renderSlot(_ctx.$slots, "tip", {}, void 0, true)
9876
- ])
9877
- ]);
9781
+ key: "0"
9782
+ } : void 0
9783
+ ]), 1040, ["fullscreen", "width", "top", "footer-class"]);
9878
9784
  };
9879
9785
  }
9880
9786
  });
9881
- const UploadImg = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-4a1df97a"]]);
9882
- const _hoisted_1$3 = { class: "upload-box" };
9883
- const _hoisted_2$3 = { class: "upload-empty" };
9884
- const _hoisted_3$3 = ["src"];
9885
- const _hoisted_4$3 = ["onClick"];
9886
- const _hoisted_5$2 = { key: 0 };
9887
- const _hoisted_6$1 = ["onClick"];
9888
- const _hoisted_7 = { key: 0 };
9889
- const _hoisted_8 = { class: "el-upload__tip" };
9890
- const _sfc_main$8 = /* @__PURE__ */ Object.assign({ name: "UploadImgs", inheritAttrs: false }, {
9891
- __name: "UploadImgs",
9787
+ const _sfc_main$7 = /* @__PURE__ */ Object.assign({ name: "Alert" }, {
9788
+ __name: "Alert",
9892
9789
  props: {
9893
- modelValue: {
9894
- type: [String, Array],
9895
- required: true
9896
- },
9897
- // 是否支持拖拽上传 ==> 非必传(默认为 true)
9898
- drag: {
9899
- type: Boolean,
9900
- default: true
9790
+ title: String,
9791
+ type: {
9792
+ type: String,
9793
+ default: "info",
9794
+ validator(value) {
9795
+ return ["success", "warning", "info", "error"].includes(value);
9796
+ }
9901
9797
  },
9902
- // 是否禁用上传组件 ==> 非必传(默认为 false)
9903
- disabled: {
9798
+ description: String,
9799
+ closable: {
9904
9800
  type: Boolean,
9905
9801
  default: false
9906
9802
  },
9907
- // 最大图片上传数 ==> 非必传(默认为 5张)
9908
- limit: {
9909
- type: Number,
9910
- default: 5
9911
- },
9912
- // 图片大小限制 ==> 非必传(默认为 5M)
9913
- fileSize: {
9914
- type: Number,
9915
- default: 5
9916
- },
9917
- // 图片类型限制 ==> 非必传(默认为 ["image/jpeg", "image/png", "image/gif"])
9918
- fileType: {
9919
- type: Array,
9920
- default: () => ["image/jpeg", "image/png", "image/gif"]
9921
- },
9922
- // 组件高度 ==> 非必传(默认为 150px)
9923
- height: {
9924
- type: String,
9925
- default: "100px"
9926
- },
9927
- // 组件宽度 ==> 非必传(默认为 150px)
9928
- width: {
9929
- type: String,
9930
- default: "100px"
9931
- },
9932
- // 组件边框圆角 ==> 非必传(默认为 8px)
9933
- borderradius: {
9934
- type: String,
9935
- default: "4px"
9936
- },
9937
- // 是否显示按钮文字
9938
- showBtnText: {
9803
+ center: {
9939
9804
  type: Boolean,
9940
9805
  default: false
9941
9806
  },
9942
- // 上传目录 ==> 非必传(默认为 undefined)
9943
- directory: {
9944
- type: String,
9945
- default: void 0
9946
- },
9947
- // 自定义上传函数(必填)==> 必传
9948
- customUpload: {
9949
- type: Function,
9950
- required: true
9951
- },
9952
- // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
9953
- getUploadUrl: {
9954
- type: Function,
9955
- default: (res) => res.data
9807
+ closeText: String,
9808
+ showIcon: {
9809
+ type: Boolean,
9810
+ default: false
9956
9811
  }
9957
9812
  },
9958
- emits: ["update:modelValue"],
9959
- setup(__props, { emit: __emit }) {
9960
- useCssVars((_ctx) => ({
9961
- "1238a60c": __props.borderradius,
9962
- "c60c1990": __props.width,
9963
- "2f150c16": __props.height
9964
- }));
9965
- const message = useMessage();
9966
- const imagePreview = (imgUrl) => {
9967
- createImageViewer({
9968
- zIndex: 9999999,
9969
- urlList: [imgUrl]
9970
- });
9971
- };
9813
+ setup(__props) {
9814
+ const { getPrefixCls: getPrefixCls2 } = useDesign();
9815
+ const prefixCls2 = getPrefixCls2("alert");
9972
9816
  const props = __props;
9973
- const httpRequest = async (options) => {
9974
- return await props.customUpload(options.file, {
9975
- directory: props.directory
9976
- });
9977
- };
9978
- const fileList = ref([]);
9979
- const uploadNumber = ref(0);
9980
- const uploadList = ref([]);
9981
- const beforeUpload = (rawFile) => {
9982
- const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
9983
- const imgType = props.fileType;
9984
- if (!imgType.includes(rawFile.type))
9985
- ElNotification({
9986
- title: "温馨提示",
9987
- message: "上传图片不符合所需的格式!",
9988
- type: "warning"
9989
- });
9990
- if (!imgSize)
9991
- ElNotification({
9992
- title: "温馨提示",
9993
- message: `上传图片大小不能超过 ${props.fileSize}M!`,
9994
- type: "warning"
9995
- });
9996
- uploadNumber.value++;
9997
- return imgType.includes(rawFile.type) && imgSize;
9998
- };
9999
- const emit = __emit;
10000
- const uploadSuccess = (res) => {
10001
- message.success("上传成功");
10002
- const fileUrl = props.getUploadUrl(res);
10003
- const index = fileList.value.findIndex((item) => {
10004
- var _a2;
10005
- return ((_a2 = item.response) == null ? void 0 : _a2.data) === fileUrl;
10006
- });
10007
- fileList.value.splice(index, 1);
10008
- uploadList.value.push({ name: fileUrl, url: fileUrl });
10009
- if (uploadList.value.length == uploadNumber.value) {
10010
- fileList.value.push(...uploadList.value);
10011
- uploadList.value = [];
10012
- uploadNumber.value = 0;
10013
- emitUpdateModelValue();
10014
- }
10015
- };
10016
- watch(
10017
- () => props.modelValue,
10018
- (val) => {
10019
- if (!val) {
10020
- fileList.value = [];
10021
- return;
10022
- }
10023
- fileList.value = [];
10024
- fileList.value.push(
10025
- ...val.map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
10026
- );
10027
- },
10028
- { immediate: true, deep: true }
10029
- );
10030
- const emitUpdateModelValue = () => {
10031
- let result = fileList.value.map((file) => file.url);
10032
- emit("update:modelValue", result);
10033
- };
10034
- const handleRemove = (uploadFile) => {
10035
- fileList.value = fileList.value.filter(
10036
- (item) => item.url !== uploadFile.url || item.name !== uploadFile.name
10037
- );
10038
- emit(
10039
- "update:modelValue",
10040
- fileList.value.map((file) => file.url)
10041
- );
10042
- };
10043
- const uploadError = () => {
10044
- ElNotification({
10045
- title: "温馨提示",
10046
- message: "图片上传失败,请您重新上传!",
10047
- type: "error"
10048
- });
10049
- };
10050
- const handleExceed = () => {
10051
- ElNotification({
10052
- title: "温馨提示",
10053
- message: `当前最多只能上传 ${props.limit} 张图片,请移除后上传!`,
10054
- type: "warning"
10055
- });
10056
- };
10057
9817
  return (_ctx, _cache) => {
10058
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
10059
- createVNode(unref(ElUpload), {
10060
- "file-list": unref(fileList),
10061
- "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(fileList) ? fileList.value = $event : null),
10062
- accept: __props.fileType.join(","),
10063
- "before-upload": beforeUpload,
10064
- class: normalizeClass(["upload", __props.drag ? "no-border" : ""]),
10065
- disabled: __props.disabled,
10066
- drag: __props.drag,
10067
- "http-request": httpRequest,
10068
- limit: __props.limit,
10069
- multiple: true,
10070
- "on-error": uploadError,
10071
- "on-exceed": handleExceed,
10072
- "on-success": uploadSuccess,
10073
- "list-type": "picture-card"
10074
- }, {
10075
- file: withCtx(({ file }) => [
10076
- createElementVNode("img", {
10077
- src: file.url,
10078
- class: "upload-image"
10079
- }, null, 8, _hoisted_3$3),
10080
- createElementVNode("div", {
10081
- class: "upload-handle",
10082
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
10083
- }, ["stop"]))
10084
- }, [
10085
- createElementVNode("div", {
10086
- class: "handle-icon",
10087
- onClick: ($event) => imagePreview(file.url)
10088
- }, [
10089
- createVNode(unref(_sfc_main$v), { icon: "ant-design:zoom-in-outlined" }),
10090
- __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_5$2, "查看")) : createCommentVNode("", true)
10091
- ], 8, _hoisted_4$3),
10092
- !__props.disabled ? (openBlock(), createElementBlock("div", {
10093
- key: 0,
10094
- class: "handle-icon",
10095
- onClick: ($event) => handleRemove(file)
10096
- }, [
10097
- createVNode(unref(_sfc_main$v), { icon: "ant-design:delete-outlined" }),
10098
- __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_7, "删除")) : createCommentVNode("", true)
10099
- ], 8, _hoisted_6$1)) : createCommentVNode("", true)
10100
- ])
10101
- ]),
10102
- default: withCtx(() => [
10103
- createElementVNode("div", _hoisted_2$3, [
10104
- renderSlot(_ctx.$slots, "empty", {}, () => [
10105
- createVNode(unref(_sfc_main$v), {
10106
- icon: "ep:plus",
10107
- size: 20
10108
- }),
10109
- _cache[2] || (_cache[2] = createElementVNode("span", { class: "empty-text" }, "点击上传", -1))
10110
- ], true)
10111
- ])
10112
- ]),
10113
- _: 3
10114
- }, 8, ["file-list", "accept", "class", "disabled", "drag", "limit"]),
10115
- createElementVNode("div", _hoisted_8, [
10116
- renderSlot(_ctx.$slots, "tip", {}, void 0, true)
10117
- ])
10118
- ]);
9818
+ return openBlock(), createBlock(unref(ElAlert), mergeProps(props, { class: unref(prefixCls2) }), null, 16, ["class"]);
10119
9819
  };
10120
9820
  }
10121
9821
  });
10122
- const UploadImgs = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-92b67a34"]]);
10123
- const _hoisted_1$2 = { class: "mt-10px line-height-20px color-[var(--el-upload-tip-color)] text-12px" };
10124
- const _hoisted_2$2 = { class: "flex items-center" };
10125
- const _hoisted_3$2 = { class: "ml-10px" };
10126
- const _hoisted_4$2 = { class: "ml-10px" };
10127
- const _hoisted_5$1 = { class: "ml-10px" };
10128
- const _sfc_main$7 = /* @__PURE__ */ Object.assign({ name: "UploadFile", inheritAttrs: false }, {
10129
- __name: "UploadFile",
10130
- props: {
10131
- modelValue: {
10132
- type: [String, Array],
10133
- required: true
10134
- },
10135
- // 文件类型, 例如['png', 'jpg', 'jpeg']
10136
- fileType: {
10137
- type: Array,
10138
- default: () => ["doc", "xls", "ppt", "txt", "pdf"]
10139
- },
10140
- // 大小限制(MB)
10141
- fileSize: {
10142
- type: Number,
10143
- default: 5
10144
- },
10145
- // 数量限制
10146
- limit: {
10147
- type: Number,
10148
- default: 5
10149
- },
10150
- // 自动上传
10151
- autoUpload: {
10152
- type: Boolean,
10153
- default: true
10154
- },
10155
- // 拖拽上传
10156
- drag: {
10157
- type: Boolean,
10158
- default: false
10159
- },
10160
- // 是否显示提示
10161
- isShowTip: {
10162
- type: Boolean,
10163
- default: true
10164
- },
10165
- // 是否禁用上传组件 ==> 非必传(默认为 false)
10166
- disabled: {
10167
- type: Boolean,
10168
- default: false
10169
- },
10170
- // 上传目录 ==> 非必传(默认为 undefined)
10171
- directory: {
10172
- type: String,
10173
- default: void 0
10174
- },
10175
- // 自定义上传函数(必填)==> 必传
10176
- customUpload: {
10177
- type: Function,
10178
- required: true
10179
- },
10180
- // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
10181
- getUploadUrl: {
10182
- type: Function,
10183
- default: (res) => res.data
9822
+ const t = (t2) => "object" == typeof t2 && null != t2 && 1 === t2.nodeType, e$1 = (t2, e2) => (!e2 || "hidden" !== t2) && ("visible" !== t2 && "clip" !== t2), n = (t2, n2) => {
9823
+ if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
9824
+ const o2 = getComputedStyle(t2, null);
9825
+ return e$1(o2.overflowY, n2) || e$1(o2.overflowX, n2) || ((t3) => {
9826
+ const e2 = ((t4) => {
9827
+ if (!t4.ownerDocument || !t4.ownerDocument.defaultView)
9828
+ return null;
9829
+ try {
9830
+ return t4.ownerDocument.defaultView.frameElement;
9831
+ } catch (t5) {
9832
+ return null;
9833
+ }
9834
+ })(t3);
9835
+ return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth);
9836
+ })(t2);
9837
+ }
9838
+ return false;
9839
+ }, o$1 = (t2, e2, n2, o2, l2, r2, i, s) => r2 < t2 && i > e2 || r2 > t2 && i < e2 ? 0 : r2 <= t2 && s <= n2 || i >= e2 && s >= n2 ? r2 - t2 - o2 : i > e2 && s < n2 || r2 < t2 && s > n2 ? i - e2 + l2 : 0, l = (t2) => {
9840
+ const e2 = t2.parentElement;
9841
+ return null == e2 ? t2.getRootNode().host || null : e2;
9842
+ }, r = (e2, r2) => {
9843
+ var i, s, d, h;
9844
+ if ("undefined" == typeof document)
9845
+ return [];
9846
+ const { scrollMode: c, block: f, inline: u, boundary: a, skipOverflowHiddenElements: g } = r2, p = "function" == typeof a ? a : (t2) => t2 !== a;
9847
+ if (!t(e2))
9848
+ throw new TypeError("Invalid target");
9849
+ const m = document.scrollingElement || document.documentElement, w = [];
9850
+ let W = e2;
9851
+ for (; t(W) && p(W); ) {
9852
+ if (W = l(W), W === m) {
9853
+ w.push(W);
9854
+ break;
10184
9855
  }
10185
- },
10186
- emits: ["update:modelValue"],
10187
- setup(__props, { emit: __emit }) {
10188
- const message = useMessage();
10189
- const emit = __emit;
10190
- const props = __props;
10191
- const uploadRef = ref();
10192
- const uploadList = ref([]);
10193
- const fileList = ref([]);
10194
- const uploadNumber = ref(0);
10195
- const httpRequest = async (options) => {
10196
- return await props.customUpload(options.file, {
10197
- directory: props.directory
9856
+ null != W && W === document.body && n(W) && !n(document.documentElement) || null != W && n(W, g) && w.push(W);
9857
+ }
9858
+ const b = null != (s = null == (i = window.visualViewport) ? void 0 : i.width) ? s : innerWidth, H = null != (h = null == (d = window.visualViewport) ? void 0 : d.height) ? h : innerHeight, { scrollX: y, scrollY: M } = window, { height: v, width: E, top: x, right: C, bottom: I, left: R } = e2.getBoundingClientRect(), { top: T, right: B, bottom: F, left: V } = ((t2) => {
9859
+ const e3 = window.getComputedStyle(t2);
9860
+ return { top: parseFloat(e3.scrollMarginTop) || 0, right: parseFloat(e3.scrollMarginRight) || 0, bottom: parseFloat(e3.scrollMarginBottom) || 0, left: parseFloat(e3.scrollMarginLeft) || 0 };
9861
+ })(e2);
9862
+ let k = "start" === f || "nearest" === f ? x - T : "end" === f ? I + F : x + v / 2 - T + F, D = "center" === u ? R + E / 2 - V + B : "end" === u ? C + B : R - V;
9863
+ const L = [];
9864
+ for (let t2 = 0; t2 < w.length; t2++) {
9865
+ const e3 = w[t2], { height: l2, width: r3, top: i2, right: s2, bottom: d2, left: h2 } = e3.getBoundingClientRect();
9866
+ if ("if-needed" === c && x >= 0 && R >= 0 && I <= H && C <= b && (e3 === m && !n(e3) || x >= i2 && I <= d2 && R >= h2 && C <= s2))
9867
+ return L;
9868
+ const a2 = getComputedStyle(e3), g2 = parseInt(a2.borderLeftWidth, 10), p2 = parseInt(a2.borderTopWidth, 10), W2 = parseInt(a2.borderRightWidth, 10), T2 = parseInt(a2.borderBottomWidth, 10);
9869
+ let B2 = 0, F2 = 0;
9870
+ const V2 = "offsetWidth" in e3 ? e3.offsetWidth - e3.clientWidth - g2 - W2 : 0, S = "offsetHeight" in e3 ? e3.offsetHeight - e3.clientHeight - p2 - T2 : 0, X = "offsetWidth" in e3 ? 0 === e3.offsetWidth ? 0 : r3 / e3.offsetWidth : 0, Y = "offsetHeight" in e3 ? 0 === e3.offsetHeight ? 0 : l2 / e3.offsetHeight : 0;
9871
+ if (m === e3)
9872
+ B2 = "start" === f ? k : "end" === f ? k - H : "nearest" === f ? o$1(M, M + H, H, p2, T2, M + k, M + k + v, v) : k - H / 2, F2 = "start" === u ? D : "center" === u ? D - b / 2 : "end" === u ? D - b : o$1(y, y + b, b, g2, W2, y + D, y + D + E, E), B2 = Math.max(0, B2 + M), F2 = Math.max(0, F2 + y);
9873
+ else {
9874
+ B2 = "start" === f ? k - i2 - p2 : "end" === f ? k - d2 + T2 + S : "nearest" === f ? o$1(i2, d2, l2, p2, T2 + S, k, k + v, v) : k - (i2 + l2 / 2) + S / 2, F2 = "start" === u ? D - h2 - g2 : "center" === u ? D - (h2 + r3 / 2) + V2 / 2 : "end" === u ? D - s2 + W2 + V2 : o$1(h2, s2, r3, g2, W2 + V2, D, D + E, E);
9875
+ const { scrollLeft: t3, scrollTop: n2 } = e3;
9876
+ B2 = 0 === Y ? 0 : Math.max(0, Math.min(n2 + B2 / Y, e3.scrollHeight - l2 / Y + S)), F2 = 0 === X ? 0 : Math.max(0, Math.min(t3 + F2 / X, e3.scrollWidth - r3 / X + V2)), k += n2 - B2, D += t3 - F2;
9877
+ }
9878
+ L.push({ el: e3, top: B2, left: F2 });
9879
+ }
9880
+ return L;
9881
+ };
9882
+ const o = (t2) => false === t2 ? { block: "end", inline: "nearest" } : ((t3) => t3 === Object(t3) && 0 !== Object.keys(t3).length)(t2) ? t2 : { block: "start", inline: "nearest" };
9883
+ function e(e2, r$1) {
9884
+ if (!e2.isConnected || !((t2) => {
9885
+ let o2 = t2;
9886
+ for (; o2 && o2.parentNode; ) {
9887
+ if (o2.parentNode === document)
9888
+ return true;
9889
+ o2 = o2.parentNode instanceof ShadowRoot ? o2.parentNode.host : o2.parentNode;
9890
+ }
9891
+ return false;
9892
+ })(e2))
9893
+ return;
9894
+ const n2 = ((t2) => {
9895
+ const o2 = window.getComputedStyle(t2);
9896
+ return { top: parseFloat(o2.scrollMarginTop) || 0, right: parseFloat(o2.scrollMarginRight) || 0, bottom: parseFloat(o2.scrollMarginBottom) || 0, left: parseFloat(o2.scrollMarginLeft) || 0 };
9897
+ })(e2);
9898
+ if (((t2) => "object" == typeof t2 && "function" == typeof t2.behavior)(r$1))
9899
+ return r$1.behavior(r(e2, r$1));
9900
+ const l2 = "boolean" == typeof r$1 || null == r$1 ? void 0 : r$1.behavior;
9901
+ for (const { el: a, top: i, left: s } of r(e2, o(r$1))) {
9902
+ const t2 = i - n2.top + n2.bottom, o2 = s - n2.left + n2.right;
9903
+ a.scroll({ top: t2, left: o2, behavior: l2 });
9904
+ }
9905
+ }
9906
+ let raf = (callback2) => setTimeout(callback2, 16);
9907
+ let caf = (num) => clearTimeout(num);
9908
+ if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
9909
+ raf = (callback2) => window.requestAnimationFrame(callback2);
9910
+ caf = (handle) => window.cancelAnimationFrame(handle);
9911
+ }
9912
+ let rafUUID = 0;
9913
+ const rafIds = /* @__PURE__ */ new Map();
9914
+ function cleanup(id) {
9915
+ rafIds.delete(id);
9916
+ }
9917
+ function wrapperRaf(callback2, times = 1) {
9918
+ rafUUID += 1;
9919
+ const id = rafUUID;
9920
+ function callRef(leftTimes) {
9921
+ if (leftTimes === 0) {
9922
+ cleanup(id);
9923
+ callback2();
9924
+ } else {
9925
+ const realId = raf(() => {
9926
+ callRef(leftTimes - 1);
10198
9927
  });
10199
- };
10200
- const beforeUpload = (file) => {
10201
- if (fileList.value.length >= props.limit) {
10202
- message.error(`上传文件数量不能超过${props.limit}个!`);
10203
- return false;
9928
+ rafIds.set(id, realId);
9929
+ }
9930
+ }
9931
+ callRef(times);
9932
+ return id;
9933
+ }
9934
+ wrapperRaf.cancel = (id) => {
9935
+ const realId = rafIds.get(id);
9936
+ cleanup(realId);
9937
+ return caf(realId);
9938
+ };
9939
+ const sharpMatcherRegx = /#([\S ]+)$/;
9940
+ const getDefaultContainer = () => {
9941
+ return window;
9942
+ };
9943
+ const getOffsetTop = (element, container) => {
9944
+ if (!element.getClientRects().length) {
9945
+ return 0;
9946
+ }
9947
+ const ele = element.getBoundingClientRect();
9948
+ if (ele.width || ele.height) {
9949
+ if (container === window) {
9950
+ container = element.ownerDocument.documentElement;
9951
+ return ele.top - container.clientTop;
9952
+ }
9953
+ return ele.top - container.getBoundingClientRect().top;
9954
+ }
9955
+ return ele.top;
9956
+ };
9957
+ const isWindow = (obj) => {
9958
+ return obj !== null && obj !== void 0 && obj === obj.window;
9959
+ };
9960
+ const getScroll = (target, top) => {
9961
+ var _a2;
9962
+ if (typeof window === "undefined") {
9963
+ return 0;
9964
+ }
9965
+ const method = "scrollTop";
9966
+ let result = 0;
9967
+ if (isWindow(target)) {
9968
+ result = target["scrollY"];
9969
+ } else if (target instanceof Document) {
9970
+ result = target.documentElement[method];
9971
+ } else if (target instanceof HTMLElement) {
9972
+ result = target[method];
9973
+ } else if (target) {
9974
+ result = target[method];
9975
+ }
9976
+ if (target && !isWindow(target) && typeof result !== "number") {
9977
+ result = (_a2 = (target.ownerDocument ?? target).documentElement) == null ? void 0 : _a2[method];
9978
+ }
9979
+ return result;
9980
+ };
9981
+ const easeInOutCubic = (t2, b, c, d) => {
9982
+ const cc = c - b;
9983
+ t2 /= d / 2;
9984
+ if (t2 < 1) {
9985
+ return cc / 2 * t2 * t2 * t2 + b;
9986
+ }
9987
+ return cc / 2 * ((t2 -= 2) * t2 * t2 + 2) + b;
9988
+ };
9989
+ const scrollTo = (y, options = {}) => {
9990
+ const { getContainer = () => window, callback: callback2, duration = 450 } = options;
9991
+ const container = getContainer();
9992
+ const scrollTop = getScroll(container);
9993
+ const startTime = Date.now();
9994
+ const frameFunc = () => {
9995
+ const timestamp = Date.now();
9996
+ const time = timestamp - startTime;
9997
+ const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
9998
+ if (isWindow(container)) {
9999
+ container.scrollTo(window.scrollX, nextScrollTop);
10000
+ } else if (container instanceof Document) {
10001
+ container.documentElement.scrollTop = nextScrollTop;
10002
+ } else {
10003
+ container.scrollTop = nextScrollTop;
10004
+ }
10005
+ if (time < duration) {
10006
+ wrapperRaf(frameFunc);
10007
+ } else if (typeof callback2 === "function") {
10008
+ callback2();
10009
+ }
10010
+ };
10011
+ wrapperRaf(frameFunc);
10012
+ };
10013
+ const addEventListener = (target, eventType, cb, option) => {
10014
+ if (target && target.addEventListener) {
10015
+ target.addEventListener(eventType, cb, option);
10016
+ }
10017
+ return {
10018
+ remove: () => {
10019
+ if (target && target.removeEventListener) {
10020
+ target.removeEventListener(eventType, cb);
10204
10021
  }
10205
- let fileExtension = "";
10206
- if (file.name.lastIndexOf(".") > -1) {
10207
- fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
10022
+ }
10023
+ };
10024
+ };
10025
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10026
+ name: "AnchorLink",
10027
+ props: {
10028
+ prefixCls: String,
10029
+ href: String,
10030
+ title: String,
10031
+ target: String,
10032
+ customTitleProps: {
10033
+ type: Object,
10034
+ default: () => {
10208
10035
  }
10209
- const isImg = props.fileType.some((type) => {
10210
- if (file.type.indexOf(type) > -1)
10211
- return true;
10212
- return !!(fileExtension && fileExtension.indexOf(type) > -1);
10036
+ }
10037
+ },
10038
+ setup(props, {
10039
+ slots,
10040
+ attrs
10041
+ }) {
10042
+ let mergedTitle = null;
10043
+ const {
10044
+ handleClick: contextHandleClick,
10045
+ scrollTo: scrollTo2,
10046
+ unregisterLink,
10047
+ registerLink,
10048
+ activeLink
10049
+ } = inject("useAnchor");
10050
+ const handleClick = (e2) => {
10051
+ const {
10052
+ href
10053
+ } = props;
10054
+ contextHandleClick(e2, {
10055
+ title: mergedTitle,
10056
+ href
10213
10057
  });
10214
- const isLimit = file.size < props.fileSize * 1024 * 1024;
10215
- if (!isImg) {
10216
- message.error(`文件格式不正确, 请上传${props.fileType.join("、")}格式!`);
10217
- return false;
10218
- }
10219
- if (!isLimit) {
10220
- message.error(`上传文件大小不能超过${props.fileSize}MB!`);
10221
- return false;
10222
- }
10223
- message.success("正在上传文件,请稍候...");
10224
- uploadNumber.value++;
10058
+ scrollTo2(href);
10225
10059
  };
10226
- const handleFileSuccess = (res) => {
10227
- message.success("上传成功");
10228
- const fileUrl = props.getUploadUrl(res);
10229
- const index = fileList.value.findIndex((item) => {
10230
- var _a2;
10231
- return ((_a2 = item.response) == null ? void 0 : _a2.data) === fileUrl;
10060
+ watch(() => props.href, (val, oldVal) => {
10061
+ nextTick(() => {
10062
+ unregisterLink(oldVal);
10063
+ registerLink(val);
10232
10064
  });
10233
- fileList.value.splice(index, 1);
10234
- uploadList.value.push({ name: fileUrl, url: fileUrl });
10235
- if (uploadList.value.length == uploadNumber.value) {
10236
- fileList.value.push(...uploadList.value);
10237
- uploadList.value = [];
10238
- uploadNumber.value = 0;
10239
- emitUpdateModelValue();
10240
- }
10241
- };
10242
- const handleExceed = () => {
10243
- message.error(`上传文件数量不能超过${props.limit}个!`);
10244
- };
10245
- const excelUploadError = () => {
10246
- message.error("导入数据失败,请您重新上传!");
10247
- };
10248
- const handleRemove = (file) => {
10249
- const index = fileList.value.map((f) => f.name).indexOf(file.name);
10250
- if (index > -1) {
10251
- fileList.value.splice(index, 1);
10252
- emitUpdateModelValue();
10253
- }
10254
- };
10255
- const handlePreview = (uploadFile) => {
10256
- console.log(uploadFile);
10257
- };
10258
- watch(
10259
- () => props.modelValue,
10260
- (val) => {
10261
- if (!val) {
10262
- fileList.value = [];
10263
- return;
10264
- }
10265
- fileList.value = [];
10266
- if (isString(val)) {
10267
- fileList.value.push(
10268
- ...val.split(",").map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
10269
- );
10270
- return;
10271
- }
10272
- fileList.value.push(
10273
- ...val.map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
10274
- );
10275
- },
10276
- { immediate: true, deep: true }
10277
- );
10278
- const emitUpdateModelValue = () => {
10279
- let result = fileList.value.map((file) => file.url);
10280
- if (props.limit === 1 || isString(props.modelValue)) {
10281
- result = result.join(",");
10282
- }
10283
- emit("update:modelValue", result);
10284
- };
10285
- return (_ctx, _cache) => {
10286
- return openBlock(), createElementBlock("div", {
10287
- class: normalizeClass(["upload-file", _ctx.$attrs.class])
10288
- }, [
10289
- !__props.disabled ? (openBlock(), createBlock(unref(ElUpload), {
10290
- key: 0,
10291
- ref_key: "uploadRef",
10292
- ref: uploadRef,
10293
- "file-list": unref(fileList),
10294
- "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null),
10295
- "auto-upload": __props.autoUpload,
10296
- "before-upload": beforeUpload,
10297
- disabled: __props.disabled,
10298
- drag: __props.drag,
10299
- "http-request": httpRequest,
10300
- limit: props.limit,
10301
- multiple: props.limit > 1,
10302
- "on-error": excelUploadError,
10303
- "on-exceed": handleExceed,
10304
- "on-preview": handlePreview,
10305
- "on-remove": handleRemove,
10306
- "on-success": handleFileSuccess,
10307
- "show-file-list": true,
10308
- class: "upload-file-uploader",
10309
- name: "file"
10310
- }, createSlots({
10311
- file: withCtx((row) => [
10312
- createElementVNode("div", _hoisted_2$2, [
10313
- createElementVNode("span", null, toDisplayString(row.file.name), 1),
10314
- createElementVNode("div", _hoisted_3$2, [
10315
- createVNode(unref(ElLink), {
10316
- href: row.file.url,
10317
- underline: "never",
10318
- download: "",
10319
- target: "_blank",
10320
- type: "primary"
10321
- }, {
10322
- default: withCtx(() => _cache[2] || (_cache[2] = [
10323
- createTextVNode(" 下载 ", -1)
10324
- ])),
10325
- _: 2,
10326
- __: [2]
10327
- }, 1032, ["href"])
10328
- ]),
10329
- createElementVNode("div", _hoisted_4$2, [
10330
- createVNode(unref(ElLink), {
10331
- type: "danger",
10332
- onClick: ($event) => handleRemove(row.file)
10333
- }, {
10334
- default: withCtx(() => _cache[3] || (_cache[3] = [
10335
- createTextVNode(" 删除", -1)
10336
- ])),
10337
- _: 2,
10338
- __: [3]
10339
- }, 1032, ["onClick"])
10340
- ])
10341
- ])
10342
- ]),
10343
- default: withCtx(() => [
10344
- createVNode(unref(ElButton), { type: "primary" }, {
10345
- default: withCtx(() => [
10346
- createVNode(unref(_sfc_main$v), { icon: "ant-design:upload-outlined" }),
10347
- _cache[1] || (_cache[1] = createTextVNode(" 选取文件 ", -1))
10348
- ]),
10349
- _: 1,
10350
- __: [1]
10351
- })
10352
- ]),
10353
- _: 2
10354
- }, [
10355
- __props.isShowTip ? {
10356
- name: "tip",
10357
- fn: withCtx(() => [
10358
- createElementVNode("div", _hoisted_1$2, [
10359
- createElementVNode("span", null, "格式为:" + toDisplayString(__props.fileType.join("、")) + ",", 1),
10360
- createElementVNode("span", null, "大小不超过" + toDisplayString(__props.fileSize) + "MB。", 1)
10361
- ])
10362
- ]),
10363
- key: "0"
10364
- } : void 0
10365
- ]), 1032, ["file-list", "auto-upload", "disabled", "drag", "limit", "multiple"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(fileList), (file, index) => {
10366
- return openBlock(), createElementBlock("div", {
10367
- key: index,
10368
- class: "flex items-center file-list-item"
10369
- }, [
10370
- createElementVNode("span", null, toDisplayString(file.name), 1),
10371
- createElementVNode("div", _hoisted_5$1, [
10372
- createVNode(unref(ElLink), {
10373
- href: file.url,
10374
- underline: "never",
10375
- download: "",
10376
- target: "_blank",
10377
- type: "primary"
10378
- }, {
10379
- default: withCtx(() => _cache[4] || (_cache[4] = [
10380
- createTextVNode(" 下载 ", -1)
10381
- ])),
10382
- _: 2,
10383
- __: [4]
10384
- }, 1032, ["href"])
10385
- ])
10386
- ]);
10387
- }), 128))
10388
- ], 2);
10065
+ });
10066
+ onMounted(() => {
10067
+ registerLink(props.href);
10068
+ });
10069
+ onBeforeUnmount(() => {
10070
+ unregisterLink(props.href);
10071
+ });
10072
+ return () => {
10073
+ var _a2;
10074
+ const {
10075
+ prefixCls: prefixCls2,
10076
+ href,
10077
+ target,
10078
+ title = slots.title,
10079
+ customTitleProps = {}
10080
+ } = props;
10081
+ mergedTitle = typeof title === "function" ? title(customTitleProps) : title;
10082
+ const active = activeLink.value === href;
10083
+ const wrapperClassName = [`${prefixCls2}-link`, {
10084
+ [`${prefixCls2}-link-active`]: active
10085
+ }, attrs.class];
10086
+ const titleClassName = [`${prefixCls2}-link-title`, {
10087
+ [`${prefixCls2}-link-title-active`]: active
10088
+ }];
10089
+ return createVNode("div", mergeProps(attrs, {
10090
+ "class": wrapperClassName
10091
+ }), [createVNode("a", {
10092
+ "class": titleClassName,
10093
+ "href": href,
10094
+ "title": typeof mergedTitle === "string" ? mergedTitle : "",
10095
+ "target": target,
10096
+ "onClick": handleClick
10097
+ }, [slots.customTitle ? slots.customTitle(customTitleProps) : mergedTitle]), (_a2 = slots.default) == null ? void 0 : _a2.call(slots)]);
10389
10098
  };
10390
- }
10391
- });
10392
- const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f625d304"]]);
10393
- const _sfc_main$6 = /* @__PURE__ */ Object.assign({ name: "Badge" }, {
10394
- __name: "Badge",
10395
- props: {
10396
- value: {
10397
- type: [String, Number],
10398
- default: ""
10399
- },
10400
- max: {
10401
- type: Number,
10402
- default: 99
10403
- },
10404
- isDot: {
10099
+ }
10100
+ });
10101
+ function _isSlot(s) {
10102
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10103
+ }
10104
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10105
+ name: "Anchor",
10106
+ props: {
10107
+ offsetTop: Number,
10108
+ bounds: Number,
10109
+ affix: {
10405
10110
  type: Boolean,
10406
- default: false
10111
+ default: true
10407
10112
  },
10408
- hidden: {
10113
+ showInkInFixed: {
10409
10114
  type: Boolean,
10410
10115
  default: false
10411
10116
  },
10412
- type: {
10117
+ getContainer: Function,
10118
+ wrapperClass: String,
10119
+ wrapperStyle: {
10120
+ type: Object,
10121
+ default: void 0
10122
+ },
10123
+ // getCurrentAnchor: Function,
10124
+ targetOffset: Number,
10125
+ items: {
10126
+ type: Array,
10127
+ default: () => []
10128
+ },
10129
+ direction: {
10413
10130
  type: String,
10414
- default: "danger",
10131
+ default: "vertical",
10415
10132
  validator(value) {
10416
- return ["primary", "success", "warning", "danger", "info"].includes(value);
10133
+ return ["vertical", "horizontal"].includes(value);
10417
10134
  }
10418
10135
  }
10419
10136
  },
10420
- setup(__props) {
10421
- const props = __props;
10422
- const { getPrefixCls: getPrefixCls2 } = useDesign();
10423
- const prefixCls2 = getPrefixCls2("badge");
10424
- return (_ctx, _cache) => {
10425
- return openBlock(), createBlock(unref(ElBadge), mergeProps(props, { class: unref(prefixCls2) }), {
10426
- default: withCtx(() => [
10427
- renderSlot(_ctx.$slots, "default")
10428
- ]),
10429
- _: 3
10430
- }, 16, ["class"]);
10137
+ setup(props, {
10138
+ attrs,
10139
+ emit,
10140
+ slots,
10141
+ expose
10142
+ }) {
10143
+ const {
10144
+ getPrefixCls: getPrefixCls2
10145
+ } = useDesign();
10146
+ const prefixCls2 = getPrefixCls2("anchor");
10147
+ const anchorDirection = computed(() => props.direction ?? "vertical");
10148
+ const spanLinkNode = ref(null);
10149
+ const anchorRef = ref();
10150
+ const state = reactive({
10151
+ links: [],
10152
+ scrollContainer: null,
10153
+ scrollEvent: null,
10154
+ animating: false
10155
+ });
10156
+ const activeLink = ref(null);
10157
+ const getContainer = computed(() => {
10158
+ const {
10159
+ getContainer: getContainer2
10160
+ } = props;
10161
+ return getContainer2 || getDefaultContainer;
10162
+ });
10163
+ const getCurrentAnchor = (offsetTop = 0, bounds = 5) => {
10164
+ const linkSections = [];
10165
+ const container = getContainer.value();
10166
+ state.links.forEach((link) => {
10167
+ const sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
10168
+ if (!sharpLinkMatch) {
10169
+ return;
10170
+ }
10171
+ const target = document.getElementById(sharpLinkMatch[1]);
10172
+ if (target) {
10173
+ const top = getOffsetTop(target, container);
10174
+ if (top < offsetTop + bounds) {
10175
+ linkSections.push({
10176
+ link,
10177
+ top
10178
+ });
10179
+ }
10180
+ }
10181
+ });
10182
+ if (linkSections.length) {
10183
+ const maxSection = linkSections.reduce((prev, curr) => curr.top > prev.top ? curr : prev);
10184
+ return maxSection.link;
10185
+ }
10186
+ return "";
10187
+ };
10188
+ const setCurrentActiveLink = (link) => {
10189
+ const {
10190
+ getCurrentAnchor: getCurrentAnchor2
10191
+ } = props;
10192
+ if (activeLink.value === link) {
10193
+ return;
10194
+ }
10195
+ activeLink.value = typeof getCurrentAnchor2 === "function" ? getCurrentAnchor2(link) : link;
10196
+ emit("change", link);
10197
+ };
10198
+ const handleScrollTo = (link) => {
10199
+ const {
10200
+ offsetTop,
10201
+ targetOffset
10202
+ } = props;
10203
+ setCurrentActiveLink(link);
10204
+ const sharpLinkMatch = sharpMatcherRegx.exec(link);
10205
+ if (!sharpLinkMatch) {
10206
+ return;
10207
+ }
10208
+ const targetElement = document.getElementById(sharpLinkMatch[1]);
10209
+ if (!targetElement) {
10210
+ return;
10211
+ }
10212
+ const container = getContainer.value();
10213
+ const scrollTop = getScroll(container);
10214
+ const eleOffsetTop = getOffsetTop(targetElement, container);
10215
+ let y = scrollTop + eleOffsetTop;
10216
+ y -= targetOffset !== void 0 ? targetOffset : offsetTop || 0;
10217
+ state.animating = true;
10218
+ scrollTo(y, {
10219
+ callback: () => {
10220
+ state.animating = false;
10221
+ },
10222
+ getContainer: getContainer.value
10223
+ });
10224
+ };
10225
+ expose({
10226
+ scrollTo: handleScrollTo
10227
+ });
10228
+ const handleScroll = () => {
10229
+ if (state.animating) {
10230
+ return;
10231
+ }
10232
+ const {
10233
+ offsetTop,
10234
+ bounds,
10235
+ targetOffset
10236
+ } = props;
10237
+ const currentActiveLink = getCurrentAnchor(targetOffset !== void 0 ? targetOffset : offsetTop || 0, bounds);
10238
+ setCurrentActiveLink(currentActiveLink);
10239
+ };
10240
+ const updateInk = () => {
10241
+ const linkNode = anchorRef.value.querySelector(`.${prefixCls2}-link-title-active`);
10242
+ if (linkNode && spanLinkNode.value) {
10243
+ const horizontalAnchor = anchorDirection.value === "horizontal";
10244
+ spanLinkNode.value.style.top = horizontalAnchor ? "" : `${linkNode.offsetTop + linkNode.clientHeight / 2}px`;
10245
+ spanLinkNode.value.style.height = horizontalAnchor ? "" : `${linkNode.clientHeight}px`;
10246
+ spanLinkNode.value.style.left = horizontalAnchor ? `${linkNode.offsetLeft}px` : "";
10247
+ spanLinkNode.value.style.width = horizontalAnchor ? `${linkNode.clientWidth}px` : "";
10248
+ if (horizontalAnchor) {
10249
+ e(linkNode, {
10250
+ scrollMode: "if-needed",
10251
+ block: "nearest"
10252
+ });
10253
+ }
10254
+ }
10255
+ };
10256
+ provide("useAnchor", {
10257
+ registerLink: (link) => {
10258
+ if (!state.links.includes(link)) {
10259
+ state.links.push(link);
10260
+ }
10261
+ },
10262
+ unregisterLink: (link) => {
10263
+ const index = state.links.indexOf(link);
10264
+ if (index !== -1) {
10265
+ state.links.splice(index, 1);
10266
+ }
10267
+ },
10268
+ activeLink,
10269
+ scrollTo: handleScrollTo,
10270
+ handleClick: (e2, info) => {
10271
+ emit("click", e2, info);
10272
+ },
10273
+ direction: anchorDirection
10274
+ });
10275
+ onMounted(() => {
10276
+ nextTick(() => {
10277
+ const container = getContainer.value();
10278
+ state.scrollContainer = container;
10279
+ state.scrollEvent = addEventListener(state.scrollContainer, "scroll", handleScroll);
10280
+ handleScroll();
10281
+ });
10282
+ });
10283
+ onBeforeUnmount(() => {
10284
+ if (state.scrollEvent) {
10285
+ state.scrollEvent.remove();
10286
+ }
10287
+ });
10288
+ onUpdated(() => {
10289
+ if (state.scrollEvent) {
10290
+ const currentContainer = getContainer.value();
10291
+ if (state.scrollContainer !== currentContainer) {
10292
+ state.scrollContainer = currentContainer;
10293
+ state.scrollEvent.remove();
10294
+ state.scrollEvent = addEventListener(state.scrollContainer, "scroll", handleScroll);
10295
+ handleScroll();
10296
+ }
10297
+ }
10298
+ updateInk();
10299
+ });
10300
+ const createNestedLink = (options) => Array.isArray(options) ? options.map((option) => {
10301
+ const {
10302
+ children,
10303
+ key,
10304
+ href,
10305
+ target,
10306
+ class: cls,
10307
+ style,
10308
+ title
10309
+ } = option;
10310
+ return createVNode(_sfc_main$6, {
10311
+ "key": key,
10312
+ "href": href,
10313
+ "target": target,
10314
+ "class": cls,
10315
+ "style": style,
10316
+ "title": title,
10317
+ "prefixCls": prefixCls2,
10318
+ "customTitleProps": option
10319
+ }, {
10320
+ default: () => [anchorDirection.value === "vertical" ? createNestedLink(children) : null],
10321
+ customTitle: slots.customTitle
10322
+ });
10323
+ }) : null;
10324
+ return () => {
10325
+ var _a2;
10326
+ const {
10327
+ offsetTop,
10328
+ affix,
10329
+ showInkInFixed
10330
+ } = props;
10331
+ const inkClass = [`${prefixCls2}-ink`, {
10332
+ [`${prefixCls2}-ink-visible`]: activeLink.value
10333
+ }];
10334
+ const wrapperClass = [props.wrapperClass, `${prefixCls2}-wrapper`, {
10335
+ [`${prefixCls2}-wrapper-horizontal`]: anchorDirection.value === "horizontal"
10336
+ }];
10337
+ const anchorClass = [prefixCls2, {
10338
+ [`${prefixCls2}-fixed`]: !affix && !showInkInFixed
10339
+ }];
10340
+ const wrapperStyle = {
10341
+ maxHeight: offsetTop ? `calc(100vh - ${offsetTop}px)` : "100vh",
10342
+ ...props.wrapperStyle
10343
+ };
10344
+ const anchorContent = createVNode("div", {
10345
+ "class": wrapperClass,
10346
+ "style": wrapperStyle,
10347
+ "ref": anchorRef
10348
+ }, [createVNode("div", {
10349
+ "class": anchorClass
10350
+ }, [createVNode("span", {
10351
+ "class": inkClass,
10352
+ "ref": spanLinkNode
10353
+ }, null), Array.isArray(props.items) ? createNestedLink(props.items) : (_a2 = slots.default) == null ? void 0 : _a2.call(slots)])]);
10354
+ return !affix ? anchorContent : createVNode(ElAffix, mergeProps(attrs, {
10355
+ "offset": offsetTop
10356
+ }), _isSlot(anchorContent) ? anchorContent : {
10357
+ default: () => [anchorContent]
10358
+ });
10431
10359
  };
10432
10360
  }
10433
10361
  });
10434
- const _sfc_main$5 = /* @__PURE__ */ Object.assign({ name: "Pagination" }, {
10435
- __name: "Pagination",
10362
+ const _hoisted_1$3 = { class: "com-steps" };
10363
+ const _hoisted_2$3 = { class: "steps-item-container" };
10364
+ const _hoisted_3$3 = { class: "steps-item-icon" };
10365
+ const _hoisted_4$3 = { class: "steps-icon" };
10366
+ const _hoisted_5$3 = { class: "steps-item-content" };
10367
+ const _hoisted_6$2 = { class: "steps-item-title" };
10368
+ const _sfc_main$4 = /* @__PURE__ */ Object.assign({ name: "Steps" }, {
10369
+ __name: "Steps",
10436
10370
  props: {
10437
- // 总条目数
10438
- total: {
10439
- required: true,
10440
- type: Number
10441
- },
10442
- // 当前页数:pageNo
10443
- page: {
10444
- type: Number,
10445
- default: 1
10446
- },
10447
- // 每页显示条目个数:pageSize
10448
- limit: {
10371
+ // 设置当前激活步骤
10372
+ active: {
10449
10373
  type: Number,
10450
- default: 20
10374
+ default: 0
10451
10375
  },
10452
- // 设置最大页码按钮数。 页码按钮的数量,当总页数超过该值时会折叠
10453
- // 移动端页码按钮的数量端默认值 5
10454
- pagerCount: {
10455
- type: Number,
10456
- default: document.body.clientWidth < 992 ? 5 : 7
10376
+ // 配置选项卡内容
10377
+ items: {
10378
+ type: Array,
10379
+ default: () => []
10457
10380
  }
10458
10381
  },
10459
- emits: ["update:page", "update:limit", "pagination"],
10460
- setup(__props, { emit: __emit }) {
10461
- const appStore = useAppStore();
10462
- const layoutCurrentSize = computed(() => appStore.currentSize);
10463
- const isSmall = ref(layoutCurrentSize.value === "small");
10464
- watchEffect(() => {
10465
- isSmall.value = layoutCurrentSize.value === "small";
10466
- });
10467
- const props = __props;
10468
- const emit = __emit;
10469
- const currentPage = computed({
10470
- get() {
10471
- return props.page;
10472
- },
10473
- set(val) {
10474
- emit("update:page", val);
10475
- }
10476
- });
10477
- const pageSize = computed({
10478
- get() {
10479
- return props.limit;
10480
- },
10481
- set(val) {
10482
- emit("update:limit", val);
10483
- }
10484
- });
10485
- const handleSizeChange = (val) => {
10486
- if (currentPage.value * val > props.total) {
10487
- currentPage.value = 1;
10488
- }
10489
- emit("pagination", { page: currentPage.value, limit: val });
10490
- };
10491
- const handleCurrentChange = (val) => {
10492
- emit("pagination", { page: val, limit: pageSize.value });
10493
- };
10382
+ setup(__props) {
10494
10383
  return (_ctx, _cache) => {
10495
- return withDirectives((openBlock(), createBlock(unref(ElPagination), {
10496
- "current-page": currentPage.value,
10497
- "onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
10498
- "page-size": pageSize.value,
10499
- "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pageSize.value = $event),
10500
- "pager-count": __props.pagerCount,
10501
- total: __props.total,
10502
- small: unref(isSmall),
10503
- class: "m-t-16px",
10504
- layout: "prev, pager, next, sizes",
10505
- onSizeChange: handleSizeChange,
10506
- onCurrentChange: handleCurrentChange
10507
- }, null, 8, ["current-page", "page-size", "pager-count", "total", "small"])), [
10508
- [vShow, __props.total > 0]
10384
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
10385
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
10386
+ return openBlock(), createElementBlock("div", {
10387
+ key: index,
10388
+ class: normalizeClass(["steps-item", {
10389
+ "steps-item-finish": __props.active > index,
10390
+ "steps-item-process": __props.active == index,
10391
+ "steps-item-wait": __props.active < index
10392
+ }])
10393
+ }, [
10394
+ createElementVNode("div", _hoisted_2$3, [
10395
+ createElementVNode("div", _hoisted_3$3, [
10396
+ createElementVNode("div", _hoisted_4$3, [
10397
+ __props.active > index ? (openBlock(), createBlock(unref(_sfc_main$v), {
10398
+ key: 0,
10399
+ icon: "ant-design:check-outlined",
10400
+ color: "#fff"
10401
+ })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
10402
+ createTextVNode(toDisplayString(index + 1), 1)
10403
+ ], 64))
10404
+ ])
10405
+ ]),
10406
+ createElementVNode("div", _hoisted_5$3, [
10407
+ createElementVNode("div", _hoisted_6$2, toDisplayString(item.title), 1)
10408
+ ])
10409
+ ])
10410
+ ], 2);
10411
+ }), 128))
10509
10412
  ]);
10510
10413
  };
10511
10414
  }
10512
10415
  });
10513
- const _hoisted_1$1 = { class: "title" };
10514
- const _hoisted_2$1 = { class: "absolute right-17px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between" };
10515
- const _hoisted_3$1 = { class: "p-20px" };
10516
- const _hoisted_4$1 = {
10517
- key: 1,
10518
- class: "pt-16px p-l-20px p-r-20px"
10519
- };
10520
- const _sfc_main$4 = /* @__PURE__ */ Object.assign({ name: "Dialog" }, {
10521
- __name: "Dialog",
10416
+ const Steps = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-eb3cf40f"]]);
10417
+ const _sfc_main$3 = /* @__PURE__ */ Object.assign({ name: "ImageViewer" }, {
10418
+ __name: "ImageViewer",
10522
10419
  props: {
10523
- modelValue: {
10524
- type: Boolean,
10525
- default: false
10526
- },
10527
- title: {
10528
- type: String,
10529
- default: "Dialog"
10530
- },
10531
- fullscreen: {
10532
- type: Boolean,
10533
- default: false
10534
- },
10535
- width: {
10536
- type: [String, Number]
10537
- },
10538
- // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度
10539
- scroll: {
10540
- type: Boolean,
10541
- default: false
10542
- },
10543
- maxHeight: {
10544
- type: [String, Number],
10545
- default: "60vh"
10420
+ urlList: {
10421
+ type: Array,
10422
+ default: () => []
10546
10423
  },
10547
- // width有值时优先使用width
10548
- size: {
10549
- type: String,
10550
- default: "default",
10551
- validate(value) {
10552
- return ["large", "default", "small"].includes(value);
10553
- }
10424
+ zIndex: {
10425
+ type: Number,
10426
+ default: 200
10554
10427
  },
10555
- top: {
10556
- type: String,
10557
- default: "0"
10428
+ initialIndex: {
10429
+ type: Number,
10430
+ default: 0
10558
10431
  },
10559
- scrollbarAlways: {
10432
+ infinite: {
10560
10433
  type: Boolean,
10561
- default: true
10562
- }
10563
- },
10564
- emits: ["update:modelValue", "close"],
10565
- setup(__props, { emit: __emit }) {
10566
- const slots = useSlots();
10567
- const props = __props;
10568
- const emit = __emit;
10569
- const getBindValue = computed(() => {
10570
- const delArr = ["fullscreen", "title", "maxHeight", "appendToBody"];
10571
- const attrs = useAttrs();
10572
- const obj = { ...attrs, ...props };
10573
- for (const key in obj) {
10574
- if (delArr.indexOf(key) !== -1) {
10575
- delete obj[key];
10576
- }
10577
- }
10578
- return obj;
10579
- });
10580
- const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight);
10581
- const dialogStyle = computed(() => {
10582
- return {
10583
- height: unref(dialogHeight)
10584
- };
10585
- });
10586
- const dialogWidth = computed(() => {
10587
- return props.width ?? (props.size === "default" ? "40%" : props.size === "large" ? "60%" : "30%");
10588
- });
10589
- const dialogClose = () => {
10590
- emit("update:modelValue", false);
10591
- emit("close");
10592
- };
10593
- return (_ctx, _cache) => {
10594
- const _component_Icon = resolveComponent("Icon");
10595
- return openBlock(), createBlock(unref(ElDialog), mergeProps(unref(getBindValue), {
10596
- "close-on-click-modal": true,
10597
- fullscreen: __props.fullscreen,
10598
- width: unref(dialogWidth),
10599
- top: __props.top,
10600
- "destroy-on-close": "",
10601
- "lock-scroll": "",
10602
- class: "com-dialog",
10603
- "modal-class": "com-modal-dialog",
10604
- "footer-class": __props.scroll ? "footer-shadow" : "",
10605
- "show-close": false,
10606
- onClose: dialogClose
10607
- }), createSlots({
10608
- header: withCtx(({ close }) => [
10609
- createElementVNode("div", _hoisted_1$1, [
10610
- renderSlot(_ctx.$slots, "title", {}, () => [
10611
- createTextVNode(toDisplayString(__props.title), 1)
10612
- ]),
10613
- createElementVNode("div", _hoisted_2$1, [
10614
- createVNode(_component_Icon, {
10615
- class: "is-hover cursor-pointer",
10616
- icon: "ep:close",
10617
- "hover-color": "var(--el-color-primary)",
10618
- color: "var(--el-color-info)",
10619
- onClick: withModifiers(close, ["stop"])
10620
- }, null, 8, ["onClick"])
10621
- ])
10622
- ])
10623
- ]),
10624
- default: withCtx(() => [
10625
- __props.scroll ? (openBlock(), createBlock(unref(ElScrollbar), {
10626
- key: 0,
10627
- style: normalizeStyle(unref(dialogStyle)),
10628
- always: __props.scrollbarAlways
10629
- }, {
10630
- default: withCtx(() => [
10631
- createElementVNode("div", _hoisted_3$1, [
10632
- renderSlot(_ctx.$slots, "default")
10633
- ])
10634
- ]),
10635
- _: 3
10636
- }, 8, ["style", "always"])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [
10637
- renderSlot(_ctx.$slots, "default")
10638
- ]))
10639
- ]),
10640
- _: 2
10641
- }, [
10642
- unref(slots).footer ? {
10643
- name: "footer",
10644
- fn: withCtx(() => [
10645
- renderSlot(_ctx.$slots, "footer")
10646
- ]),
10647
- key: "0"
10648
- } : void 0
10649
- ]), 1040, ["fullscreen", "width", "top", "footer-class"]);
10650
- };
10651
- }
10652
- });
10653
- const _sfc_main$3 = /* @__PURE__ */ Object.assign({ name: "Alert" }, {
10654
- __name: "Alert",
10655
- props: {
10656
- title: String,
10657
- type: {
10658
- type: String,
10659
- default: "info",
10660
- validator(value) {
10661
- return ["success", "warning", "info", "error"].includes(value);
10662
- }
10434
+ default: true
10663
10435
  },
10664
- description: String,
10665
- closable: {
10436
+ hideOnClickModal: {
10666
10437
  type: Boolean,
10667
10438
  default: false
10668
10439
  },
10669
- center: {
10440
+ teleported: {
10670
10441
  type: Boolean,
10671
10442
  default: false
10672
10443
  },
10673
- closeText: String,
10674
- showIcon: {
10444
+ show: {
10675
10445
  type: Boolean,
10676
10446
  default: false
10677
10447
  }
10678
10448
  },
10679
10449
  setup(__props) {
10680
- const { getPrefixCls: getPrefixCls2 } = useDesign();
10681
- const prefixCls2 = getPrefixCls2("alert");
10682
10450
  const props = __props;
10451
+ const getBindValue = computed(() => {
10452
+ const propsData = { ...props };
10453
+ delete propsData.show;
10454
+ return propsData;
10455
+ });
10456
+ const show = ref(props.show);
10457
+ const close = () => {
10458
+ show.value = false;
10459
+ };
10683
10460
  return (_ctx, _cache) => {
10684
- return openBlock(), createBlock(unref(ElAlert), mergeProps(props, { class: unref(prefixCls2) }), null, 16, ["class"]);
10461
+ return unref(show) ? (openBlock(), createBlock(unref(ElImageViewer), mergeProps({ key: 0 }, unref(getBindValue), { onClose: close }), null, 16)) : createCommentVNode("", true);
10685
10462
  };
10686
10463
  }
10687
10464
  });
10688
- const t = (t2) => "object" == typeof t2 && null != t2 && 1 === t2.nodeType, e$1 = (t2, e2) => (!e2 || "hidden" !== t2) && ("visible" !== t2 && "clip" !== t2), n = (t2, n2) => {
10689
- if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
10690
- const o2 = getComputedStyle(t2, null);
10691
- return e$1(o2.overflowY, n2) || e$1(o2.overflowX, n2) || ((t3) => {
10692
- const e2 = ((t4) => {
10693
- if (!t4.ownerDocument || !t4.ownerDocument.defaultView)
10694
- return null;
10695
- try {
10696
- return t4.ownerDocument.defaultView.frameElement;
10697
- } catch (t5) {
10698
- return null;
10699
- }
10700
- })(t3);
10701
- return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth);
10702
- })(t2);
10703
- }
10704
- return false;
10705
- }, o$1 = (t2, e2, n2, o2, l2, r2, i, s) => r2 < t2 && i > e2 || r2 > t2 && i < e2 ? 0 : r2 <= t2 && s <= n2 || i >= e2 && s >= n2 ? r2 - t2 - o2 : i > e2 && s < n2 || r2 < t2 && s > n2 ? i - e2 + l2 : 0, l = (t2) => {
10706
- const e2 = t2.parentElement;
10707
- return null == e2 ? t2.getRootNode().host || null : e2;
10708
- }, r = (e2, r2) => {
10709
- var i, s, d, h;
10710
- if ("undefined" == typeof document)
10711
- return [];
10712
- const { scrollMode: c, block: f, inline: u, boundary: a, skipOverflowHiddenElements: g } = r2, p = "function" == typeof a ? a : (t2) => t2 !== a;
10713
- if (!t(e2))
10714
- throw new TypeError("Invalid target");
10715
- const m = document.scrollingElement || document.documentElement, w = [];
10716
- let W = e2;
10717
- for (; t(W) && p(W); ) {
10718
- if (W = l(W), W === m) {
10719
- w.push(W);
10720
- break;
10721
- }
10722
- null != W && W === document.body && n(W) && !n(document.documentElement) || null != W && n(W, g) && w.push(W);
10723
- }
10724
- const b = null != (s = null == (i = window.visualViewport) ? void 0 : i.width) ? s : innerWidth, H = null != (h = null == (d = window.visualViewport) ? void 0 : d.height) ? h : innerHeight, { scrollX: y, scrollY: M } = window, { height: v, width: E, top: x, right: C, bottom: I, left: R } = e2.getBoundingClientRect(), { top: T, right: B, bottom: F, left: V } = ((t2) => {
10725
- const e3 = window.getComputedStyle(t2);
10726
- return { top: parseFloat(e3.scrollMarginTop) || 0, right: parseFloat(e3.scrollMarginRight) || 0, bottom: parseFloat(e3.scrollMarginBottom) || 0, left: parseFloat(e3.scrollMarginLeft) || 0 };
10727
- })(e2);
10728
- let k = "start" === f || "nearest" === f ? x - T : "end" === f ? I + F : x + v / 2 - T + F, D = "center" === u ? R + E / 2 - V + B : "end" === u ? C + B : R - V;
10729
- const L = [];
10730
- for (let t2 = 0; t2 < w.length; t2++) {
10731
- const e3 = w[t2], { height: l2, width: r3, top: i2, right: s2, bottom: d2, left: h2 } = e3.getBoundingClientRect();
10732
- if ("if-needed" === c && x >= 0 && R >= 0 && I <= H && C <= b && (e3 === m && !n(e3) || x >= i2 && I <= d2 && R >= h2 && C <= s2))
10733
- return L;
10734
- const a2 = getComputedStyle(e3), g2 = parseInt(a2.borderLeftWidth, 10), p2 = parseInt(a2.borderTopWidth, 10), W2 = parseInt(a2.borderRightWidth, 10), T2 = parseInt(a2.borderBottomWidth, 10);
10735
- let B2 = 0, F2 = 0;
10736
- const V2 = "offsetWidth" in e3 ? e3.offsetWidth - e3.clientWidth - g2 - W2 : 0, S = "offsetHeight" in e3 ? e3.offsetHeight - e3.clientHeight - p2 - T2 : 0, X = "offsetWidth" in e3 ? 0 === e3.offsetWidth ? 0 : r3 / e3.offsetWidth : 0, Y = "offsetHeight" in e3 ? 0 === e3.offsetHeight ? 0 : l2 / e3.offsetHeight : 0;
10737
- if (m === e3)
10738
- B2 = "start" === f ? k : "end" === f ? k - H : "nearest" === f ? o$1(M, M + H, H, p2, T2, M + k, M + k + v, v) : k - H / 2, F2 = "start" === u ? D : "center" === u ? D - b / 2 : "end" === u ? D - b : o$1(y, y + b, b, g2, W2, y + D, y + D + E, E), B2 = Math.max(0, B2 + M), F2 = Math.max(0, F2 + y);
10739
- else {
10740
- B2 = "start" === f ? k - i2 - p2 : "end" === f ? k - d2 + T2 + S : "nearest" === f ? o$1(i2, d2, l2, p2, T2 + S, k, k + v, v) : k - (i2 + l2 / 2) + S / 2, F2 = "start" === u ? D - h2 - g2 : "center" === u ? D - (h2 + r3 / 2) + V2 / 2 : "end" === u ? D - s2 + W2 + V2 : o$1(h2, s2, r3, g2, W2 + V2, D, D + E, E);
10741
- const { scrollLeft: t3, scrollTop: n2 } = e3;
10742
- B2 = 0 === Y ? 0 : Math.max(0, Math.min(n2 + B2 / Y, e3.scrollHeight - l2 / Y + S)), F2 = 0 === X ? 0 : Math.max(0, Math.min(t3 + F2 / X, e3.scrollWidth - r3 / X + V2)), k += n2 - B2, D += t3 - F2;
10743
- }
10744
- L.push({ el: e3, top: B2, left: F2 });
10745
- }
10746
- return L;
10747
- };
10748
- const o = (t2) => false === t2 ? { block: "end", inline: "nearest" } : ((t3) => t3 === Object(t3) && 0 !== Object.keys(t3).length)(t2) ? t2 : { block: "start", inline: "nearest" };
10749
- function e(e2, r$1) {
10750
- if (!e2.isConnected || !((t2) => {
10751
- let o2 = t2;
10752
- for (; o2 && o2.parentNode; ) {
10753
- if (o2.parentNode === document)
10754
- return true;
10755
- o2 = o2.parentNode instanceof ShadowRoot ? o2.parentNode.host : o2.parentNode;
10756
- }
10757
- return false;
10758
- })(e2))
10465
+ let instance = null;
10466
+ function createImageViewer(options) {
10467
+ if (!isClient)
10759
10468
  return;
10760
- const n2 = ((t2) => {
10761
- const o2 = window.getComputedStyle(t2);
10762
- return { top: parseFloat(o2.scrollMarginTop) || 0, right: parseFloat(o2.scrollMarginRight) || 0, bottom: parseFloat(o2.scrollMarginBottom) || 0, left: parseFloat(o2.scrollMarginLeft) || 0 };
10763
- })(e2);
10764
- if (((t2) => "object" == typeof t2 && "function" == typeof t2.behavior)(r$1))
10765
- return r$1.behavior(r(e2, r$1));
10766
- const l2 = "boolean" == typeof r$1 || null == r$1 ? void 0 : r$1.behavior;
10767
- for (const { el: a, top: i, left: s } of r(e2, o(r$1))) {
10768
- const t2 = i - n2.top + n2.bottom, o2 = s - n2.left + n2.right;
10769
- a.scroll({ top: t2, left: o2, behavior: l2 });
10770
- }
10771
- }
10772
- let raf = (callback2) => setTimeout(callback2, 16);
10773
- let caf = (num) => clearTimeout(num);
10774
- if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
10775
- raf = (callback2) => window.requestAnimationFrame(callback2);
10776
- caf = (handle) => window.cancelAnimationFrame(handle);
10777
- }
10778
- let rafUUID = 0;
10779
- const rafIds = /* @__PURE__ */ new Map();
10780
- function cleanup(id) {
10781
- rafIds.delete(id);
10782
- }
10783
- function wrapperRaf(callback2, times = 1) {
10784
- rafUUID += 1;
10785
- const id = rafUUID;
10786
- function callRef(leftTimes) {
10787
- if (leftTimes === 0) {
10788
- cleanup(id);
10789
- callback2();
10790
- } else {
10791
- const realId = raf(() => {
10792
- callRef(leftTimes - 1);
10793
- });
10794
- rafIds.set(id, realId);
10795
- }
10796
- }
10797
- callRef(times);
10798
- return id;
10469
+ const {
10470
+ urlList,
10471
+ initialIndex = 0,
10472
+ infinite = true,
10473
+ hideOnClickModal = false,
10474
+ teleported = false,
10475
+ zIndex = 2e3,
10476
+ show = true
10477
+ } = options;
10478
+ const propsData = {};
10479
+ const container = document.createElement("div");
10480
+ propsData.urlList = urlList;
10481
+ propsData.initialIndex = initialIndex;
10482
+ propsData.infinite = infinite;
10483
+ propsData.hideOnClickModal = hideOnClickModal;
10484
+ propsData.teleported = teleported;
10485
+ propsData.zIndex = zIndex;
10486
+ propsData.show = show;
10487
+ document.body.appendChild(container);
10488
+ instance = createVNode(_sfc_main$3, propsData);
10489
+ render(instance, container);
10799
10490
  }
10800
- wrapperRaf.cancel = (id) => {
10801
- const realId = rafIds.get(id);
10802
- cleanup(realId);
10803
- return caf(realId);
10804
- };
10805
- const sharpMatcherRegx = /#([\S ]+)$/;
10806
- const getDefaultContainer = () => {
10807
- return window;
10808
- };
10809
- const getOffsetTop = (element, container) => {
10810
- if (!element.getClientRects().length) {
10811
- return 0;
10812
- }
10813
- const ele = element.getBoundingClientRect();
10814
- if (ele.width || ele.height) {
10815
- if (container === window) {
10816
- container = element.ownerDocument.documentElement;
10817
- return ele.top - container.clientTop;
10818
- }
10819
- return ele.top - container.getBoundingClientRect().top;
10820
- }
10821
- return ele.top;
10822
- };
10823
- const isWindow = (obj) => {
10824
- return obj !== null && obj !== void 0 && obj === obj.window;
10825
- };
10826
- const getScroll = (target, top) => {
10827
- var _a2;
10828
- if (typeof window === "undefined") {
10829
- return 0;
10830
- }
10831
- const method = "scrollTop";
10832
- let result = 0;
10833
- if (isWindow(target)) {
10834
- result = target["scrollY"];
10835
- } else if (target instanceof Document) {
10836
- result = target.documentElement[method];
10837
- } else if (target instanceof HTMLElement) {
10838
- result = target[method];
10839
- } else if (target) {
10840
- result = target[method];
10841
- }
10842
- if (target && !isWindow(target) && typeof result !== "number") {
10843
- result = (_a2 = (target.ownerDocument ?? target).documentElement) == null ? void 0 : _a2[method];
10844
- }
10845
- return result;
10846
- };
10847
- const easeInOutCubic = (t2, b, c, d) => {
10848
- const cc = c - b;
10849
- t2 /= d / 2;
10850
- if (t2 < 1) {
10851
- return cc / 2 * t2 * t2 * t2 + b;
10852
- }
10853
- return cc / 2 * ((t2 -= 2) * t2 * t2 + 2) + b;
10854
- };
10855
- const scrollTo = (y, options = {}) => {
10856
- const { getContainer = () => window, callback: callback2, duration = 450 } = options;
10857
- const container = getContainer();
10858
- const scrollTop = getScroll(container);
10859
- const startTime = Date.now();
10860
- const frameFunc = () => {
10861
- const timestamp = Date.now();
10862
- const time = timestamp - startTime;
10863
- const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
10864
- if (isWindow(container)) {
10865
- container.scrollTo(window.scrollX, nextScrollTop);
10866
- } else if (container instanceof Document) {
10867
- container.documentElement.scrollTop = nextScrollTop;
10868
- } else {
10869
- container.scrollTop = nextScrollTop;
10870
- }
10871
- if (time < duration) {
10872
- wrapperRaf(frameFunc);
10873
- } else if (typeof callback2 === "function") {
10874
- callback2();
10491
+ const useMessage = () => {
10492
+ const { t: t2 } = useI18n("layout");
10493
+ const scssVariables = variables$1;
10494
+ return {
10495
+ // 消息提示
10496
+ info(content) {
10497
+ ElMessage.info(content);
10498
+ },
10499
+ // 错误消息
10500
+ error(content) {
10501
+ ElMessage.error(content);
10502
+ },
10503
+ // 成功消息
10504
+ success(content) {
10505
+ ElMessage.success(content);
10506
+ },
10507
+ // 警告消息
10508
+ warning(content) {
10509
+ ElMessage.warning(content);
10510
+ },
10511
+ // 弹出提示
10512
+ alert(content) {
10513
+ ElMessageBox.alert(content, t2("common.confirmTitle"));
10514
+ },
10515
+ // 错误提示
10516
+ alertError(content) {
10517
+ ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "error" });
10518
+ },
10519
+ // 成功提示
10520
+ alertSuccess(content) {
10521
+ ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "success" });
10522
+ },
10523
+ // 警告提示
10524
+ alertWarning(content) {
10525
+ ElMessageBox.alert(content, t2("common.confirmTitle"), { type: "warning" });
10526
+ },
10527
+ // 通知提示
10528
+ notify(content) {
10529
+ ElNotification.info(content);
10530
+ },
10531
+ // 错误通知
10532
+ notifyError(content) {
10533
+ ElNotification.error(content);
10534
+ },
10535
+ // 成功通知
10536
+ notifySuccess(content) {
10537
+ ElNotification.success(content);
10538
+ },
10539
+ // 警告通知
10540
+ notifyWarning(content) {
10541
+ ElNotification.warning(content);
10542
+ },
10543
+ // 确认窗体
10544
+ confirm(content, tip, options = {}) {
10545
+ return ElMessageBox.confirm(content, tip ? tip : t2("common.confirmTitle"), {
10546
+ ...options,
10547
+ customClass: `${options.customClass} ${scssVariables.namespace}-message-box`,
10548
+ confirmButtonText: options.confirmButtonText ?? t2("common.ok"),
10549
+ cancelButtonText: options.cancelButtonText ?? t2("common.cancel"),
10550
+ buttonSize: "default",
10551
+ center: true
10552
+ });
10553
+ },
10554
+ // 删除窗体
10555
+ delConfirm(content, tip) {
10556
+ return ElMessageBox.confirm(
10557
+ content ? content : t2("common.delMessage"),
10558
+ tip ? tip : t2("common.confirmTitle"),
10559
+ {
10560
+ customClass: `${scssVariables.namespace}-message-box`,
10561
+ confirmButtonText: t2("common.ok"),
10562
+ cancelButtonText: t2("common.cancel"),
10563
+ buttonSize: "default",
10564
+ center: true,
10565
+ type: "warning"
10566
+ }
10567
+ );
10568
+ },
10569
+ // 导出窗体
10570
+ exportConfirm(content, tip) {
10571
+ return ElMessageBox.confirm(
10572
+ content ? content : t2("common.exportMessage"),
10573
+ tip ? tip : t2("common.confirmTitle"),
10574
+ {
10575
+ confirmButtonText: t2("common.ok"),
10576
+ cancelButtonText: t2("common.cancel"),
10577
+ type: "warning"
10578
+ }
10579
+ );
10580
+ },
10581
+ // 提交内容
10582
+ prompt(content, tip, options = {}) {
10583
+ return ElMessageBox.prompt(content, tip, {
10584
+ confirmButtonText: t2("common.ok"),
10585
+ cancelButtonText: t2("common.cancel"),
10586
+ ...options
10587
+ });
10875
10588
  }
10876
10589
  };
10877
- wrapperRaf(frameFunc);
10878
10590
  };
10879
- const addEventListener = (target, eventType, cb, option) => {
10880
- if (target && target.addEventListener) {
10881
- target.addEventListener(eventType, cb, option);
10882
- }
10883
- return {
10884
- remove: () => {
10885
- if (target && target.removeEventListener) {
10886
- target.removeEventListener(eventType, cb);
10887
- }
10888
- }
10889
- };
10591
+ const _hoisted_1$2 = { class: "upload-box" };
10592
+ const _hoisted_2$2 = ["src"];
10593
+ const _hoisted_3$2 = { key: 0 };
10594
+ const _hoisted_4$2 = { key: 0 };
10595
+ const _hoisted_5$2 = {
10596
+ key: 1,
10597
+ class: "upload-empty"
10890
10598
  };
10891
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10892
- name: "AnchorLink",
10599
+ const _hoisted_6$1 = { class: "el-upload__tip" };
10600
+ const _sfc_main$2 = /* @__PURE__ */ Object.assign({ name: "UploadImg", inheritAttrs: false }, {
10601
+ __name: "UploadImg",
10893
10602
  props: {
10894
- prefixCls: String,
10895
- href: String,
10896
- title: String,
10897
- target: String,
10898
- customTitleProps: {
10899
- type: Object,
10900
- default: () => {
10901
- }
10603
+ modelValue: {
10604
+ type: String,
10605
+ default: ""
10606
+ },
10607
+ // 是否支持拖拽上传 ==> 非必传(默认为 true)
10608
+ drag: {
10609
+ type: Boolean,
10610
+ default: true
10611
+ },
10612
+ // 是否禁用上传组件 ==> 非必传(默认为 false)
10613
+ disabled: {
10614
+ type: Boolean,
10615
+ default: false
10616
+ },
10617
+ // 图片大小限制 ==> 非必传(默认为 5M)
10618
+ fileSize: {
10619
+ type: Number,
10620
+ default: 5
10621
+ },
10622
+ // 图片类型限制 ==> 非必传(默认为 ["image/jpeg", "image/png", "image/gif"])
10623
+ fileType: {
10624
+ type: Array,
10625
+ default: () => ["image/jpeg", "image/png", "image/gif"]
10626
+ },
10627
+ // 组件高度 ==> 非必传(默认为 150px)
10628
+ height: {
10629
+ type: String,
10630
+ default: "100px"
10631
+ },
10632
+ // 组件宽度 ==> 非必传(默认为 150px)
10633
+ width: {
10634
+ type: String,
10635
+ default: "100px"
10636
+ },
10637
+ // 组件边框圆角 ==> 非必传(默认为 8px)
10638
+ borderradius: {
10639
+ type: String,
10640
+ default: "4px"
10641
+ },
10642
+ // 是否显示删除按钮
10643
+ showDelete: {
10644
+ type: Boolean,
10645
+ default: true
10646
+ },
10647
+ // 是否显示按钮文字
10648
+ showBtnText: {
10649
+ type: Boolean,
10650
+ default: false
10651
+ },
10652
+ // 上传目录 ==> 非必传(默认为 undefined)
10653
+ directory: {
10654
+ type: String,
10655
+ default: void 0
10656
+ },
10657
+ // 自定义上传函数(必填)==> 必传
10658
+ customUpload: {
10659
+ type: Function,
10660
+ required: true
10661
+ },
10662
+ // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
10663
+ getUploadUrl: {
10664
+ type: Function,
10665
+ default: (res) => res.data
10666
+ }
10667
+ },
10668
+ emits: ["update:modelValue"],
10669
+ setup(__props, { emit: __emit }) {
10670
+ useCssVars((_ctx) => ({
10671
+ "3d8ea9da": __props.width,
10672
+ "2c0dbd7a": __props.height,
10673
+ "00ef71d1": __props.borderradius
10674
+ }));
10675
+ const props = __props;
10676
+ const { t: t2 } = useI18n("layout");
10677
+ const message = useMessage();
10678
+ const uuid = ref("id-" + generateUUID());
10679
+ const imagePreview = (imgUrl) => {
10680
+ createImageViewer({
10681
+ zIndex: 9999999,
10682
+ urlList: [imgUrl]
10683
+ });
10684
+ };
10685
+ const emit = __emit;
10686
+ const deleteImg = () => {
10687
+ emit("update:modelValue", "");
10688
+ };
10689
+ const httpRequest = async (options) => {
10690
+ return await props.customUpload(options.file, {
10691
+ directory: props.directory
10692
+ });
10693
+ };
10694
+ const beforeUpload = (rawFile) => {
10695
+ const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
10696
+ const imgType = props.fileType;
10697
+ if (!imgType.includes(rawFile.type))
10698
+ message.notifyWarning("上传图片不符合所需的格式!");
10699
+ if (!imgSize)
10700
+ message.notifyWarning(`上传图片大小不能超过 ${props.fileSize}M!`);
10701
+ return imgType.includes(rawFile.type) && imgSize;
10702
+ };
10703
+ const uploadSuccess = (res) => {
10704
+ message.success("上传成功");
10705
+ const fileUrl = props.getUploadUrl(res);
10706
+ emit("update:modelValue", fileUrl);
10707
+ };
10708
+ const uploadError = () => {
10709
+ message.notifyError("图片上传失败,请您重新上传!");
10710
+ };
10711
+ return (_ctx, _cache) => {
10712
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
10713
+ createVNode(unref(ElUpload), {
10714
+ id: unref(uuid),
10715
+ accept: __props.fileType.join(","),
10716
+ "before-upload": beforeUpload,
10717
+ class: normalizeClass(["upload", __props.drag ? "no-border" : ""]),
10718
+ disabled: __props.disabled,
10719
+ drag: __props.drag,
10720
+ "http-request": httpRequest,
10721
+ multiple: false,
10722
+ "on-error": uploadError,
10723
+ "on-success": uploadSuccess,
10724
+ "show-file-list": false
10725
+ }, {
10726
+ default: withCtx(() => [
10727
+ __props.modelValue ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
10728
+ createElementVNode("img", {
10729
+ src: __props.modelValue,
10730
+ class: "upload-image"
10731
+ }, null, 8, _hoisted_2$2),
10732
+ createElementVNode("div", {
10733
+ class: "upload-handle",
10734
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
10735
+ }, ["stop"]))
10736
+ }, [
10737
+ createElementVNode("div", {
10738
+ class: "handle-icon",
10739
+ onClick: _cache[0] || (_cache[0] = ($event) => imagePreview(__props.modelValue))
10740
+ }, [
10741
+ createVNode(unref(_sfc_main$v), { icon: "ant-design:zoom-in-outlined" }),
10742
+ __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(unref(t2)("action.detail")), 1)) : createCommentVNode("", true)
10743
+ ]),
10744
+ __props.showDelete && !__props.disabled ? (openBlock(), createElementBlock("div", {
10745
+ key: 0,
10746
+ class: "handle-icon",
10747
+ onClick: deleteImg
10748
+ }, [
10749
+ createVNode(unref(_sfc_main$v), { icon: "ant-design:delete-outlined" }),
10750
+ __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(unref(t2)("action.del")), 1)) : createCommentVNode("", true)
10751
+ ])) : createCommentVNode("", true)
10752
+ ])
10753
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_5$2, [
10754
+ renderSlot(_ctx.$slots, "empty", {}, () => [
10755
+ createVNode(unref(_sfc_main$v), {
10756
+ icon: "ep:plus",
10757
+ size: 20
10758
+ }),
10759
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "empty-text" }, "点击上传", -1))
10760
+ ], true)
10761
+ ]))
10762
+ ]),
10763
+ _: 3
10764
+ }, 8, ["id", "accept", "class", "disabled", "drag"]),
10765
+ createElementVNode("div", _hoisted_6$1, [
10766
+ renderSlot(_ctx.$slots, "tip", {}, void 0, true)
10767
+ ])
10768
+ ]);
10769
+ };
10770
+ }
10771
+ });
10772
+ const UploadImg = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-4a1df97a"]]);
10773
+ const _hoisted_1$1 = { class: "upload-box" };
10774
+ const _hoisted_2$1 = { class: "upload-empty" };
10775
+ const _hoisted_3$1 = ["src"];
10776
+ const _hoisted_4$1 = ["onClick"];
10777
+ const _hoisted_5$1 = { key: 0 };
10778
+ const _hoisted_6 = ["onClick"];
10779
+ const _hoisted_7 = { key: 0 };
10780
+ const _hoisted_8 = { class: "el-upload__tip" };
10781
+ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ name: "UploadImgs", inheritAttrs: false }, {
10782
+ __name: "UploadImgs",
10783
+ props: {
10784
+ modelValue: {
10785
+ type: [String, Array],
10786
+ required: true
10787
+ },
10788
+ // 是否支持拖拽上传 ==> 非必传(默认为 true)
10789
+ drag: {
10790
+ type: Boolean,
10791
+ default: true
10792
+ },
10793
+ // 是否禁用上传组件 ==> 非必传(默认为 false)
10794
+ disabled: {
10795
+ type: Boolean,
10796
+ default: false
10797
+ },
10798
+ // 最大图片上传数 ==> 非必传(默认为 5张)
10799
+ limit: {
10800
+ type: Number,
10801
+ default: 5
10802
+ },
10803
+ // 图片大小限制 ==> 非必传(默认为 5M)
10804
+ fileSize: {
10805
+ type: Number,
10806
+ default: 5
10807
+ },
10808
+ // 图片类型限制 ==> 非必传(默认为 ["image/jpeg", "image/png", "image/gif"])
10809
+ fileType: {
10810
+ type: Array,
10811
+ default: () => ["image/jpeg", "image/png", "image/gif"]
10812
+ },
10813
+ // 组件高度 ==> 非必传(默认为 150px)
10814
+ height: {
10815
+ type: String,
10816
+ default: "100px"
10817
+ },
10818
+ // 组件宽度 ==> 非必传(默认为 150px)
10819
+ width: {
10820
+ type: String,
10821
+ default: "100px"
10822
+ },
10823
+ // 组件边框圆角 ==> 非必传(默认为 8px)
10824
+ borderradius: {
10825
+ type: String,
10826
+ default: "4px"
10827
+ },
10828
+ // 是否显示按钮文字
10829
+ showBtnText: {
10830
+ type: Boolean,
10831
+ default: false
10832
+ },
10833
+ // 上传目录 ==> 非必传(默认为 undefined)
10834
+ directory: {
10835
+ type: String,
10836
+ default: void 0
10837
+ },
10838
+ // 自定义上传函数(必填)==> 必传
10839
+ customUpload: {
10840
+ type: Function,
10841
+ required: true
10842
+ },
10843
+ // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
10844
+ getUploadUrl: {
10845
+ type: Function,
10846
+ default: (res) => res.data
10902
10847
  }
10903
10848
  },
10904
- setup(props, {
10905
- slots,
10906
- attrs
10907
- }) {
10908
- let mergedTitle = null;
10909
- const {
10910
- handleClick: contextHandleClick,
10911
- scrollTo: scrollTo2,
10912
- unregisterLink,
10913
- registerLink,
10914
- activeLink
10915
- } = inject("useAnchor");
10916
- const handleClick = (e2) => {
10917
- const {
10918
- href
10919
- } = props;
10920
- contextHandleClick(e2, {
10921
- title: mergedTitle,
10922
- href
10849
+ emits: ["update:modelValue"],
10850
+ setup(__props, { emit: __emit }) {
10851
+ useCssVars((_ctx) => ({
10852
+ "1238a60c": __props.borderradius,
10853
+ "c60c1990": __props.width,
10854
+ "2f150c16": __props.height
10855
+ }));
10856
+ const message = useMessage();
10857
+ const imagePreview = (imgUrl) => {
10858
+ createImageViewer({
10859
+ zIndex: 9999999,
10860
+ urlList: [imgUrl]
10923
10861
  });
10924
- scrollTo2(href);
10925
10862
  };
10926
- watch(() => props.href, (val, oldVal) => {
10927
- nextTick(() => {
10928
- unregisterLink(oldVal);
10929
- registerLink(val);
10863
+ const props = __props;
10864
+ const httpRequest = async (options) => {
10865
+ return await props.customUpload(options.file, {
10866
+ directory: props.directory
10930
10867
  });
10931
- });
10932
- onMounted(() => {
10933
- registerLink(props.href);
10934
- });
10935
- onBeforeUnmount(() => {
10936
- unregisterLink(props.href);
10937
- });
10938
- return () => {
10939
- var _a2;
10940
- const {
10941
- prefixCls: prefixCls2,
10942
- href,
10943
- target,
10944
- title = slots.title,
10945
- customTitleProps = {}
10946
- } = props;
10947
- mergedTitle = typeof title === "function" ? title(customTitleProps) : title;
10948
- const active = activeLink.value === href;
10949
- const wrapperClassName = [`${prefixCls2}-link`, {
10950
- [`${prefixCls2}-link-active`]: active
10951
- }, attrs.class];
10952
- const titleClassName = [`${prefixCls2}-link-title`, {
10953
- [`${prefixCls2}-link-title-active`]: active
10954
- }];
10955
- return createVNode("div", mergeProps(attrs, {
10956
- "class": wrapperClassName
10957
- }), [createVNode("a", {
10958
- "class": titleClassName,
10959
- "href": href,
10960
- "title": typeof mergedTitle === "string" ? mergedTitle : "",
10961
- "target": target,
10962
- "onClick": handleClick
10963
- }, [slots.customTitle ? slots.customTitle(customTitleProps) : mergedTitle]), (_a2 = slots.default) == null ? void 0 : _a2.call(slots)]);
10868
+ };
10869
+ const fileList = ref([]);
10870
+ const uploadNumber = ref(0);
10871
+ const uploadList = ref([]);
10872
+ const beforeUpload = (rawFile) => {
10873
+ const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
10874
+ const imgType = props.fileType;
10875
+ if (!imgType.includes(rawFile.type))
10876
+ ElNotification({
10877
+ title: "温馨提示",
10878
+ message: "上传图片不符合所需的格式!",
10879
+ type: "warning"
10880
+ });
10881
+ if (!imgSize)
10882
+ ElNotification({
10883
+ title: "温馨提示",
10884
+ message: `上传图片大小不能超过 ${props.fileSize}M!`,
10885
+ type: "warning"
10886
+ });
10887
+ uploadNumber.value++;
10888
+ return imgType.includes(rawFile.type) && imgSize;
10889
+ };
10890
+ const emit = __emit;
10891
+ const uploadSuccess = (res) => {
10892
+ message.success("上传成功");
10893
+ const fileUrl = props.getUploadUrl(res);
10894
+ const index = fileList.value.findIndex((item) => {
10895
+ var _a2;
10896
+ return ((_a2 = item.response) == null ? void 0 : _a2.data) === fileUrl;
10897
+ });
10898
+ fileList.value.splice(index, 1);
10899
+ uploadList.value.push({ name: fileUrl, url: fileUrl });
10900
+ if (uploadList.value.length == uploadNumber.value) {
10901
+ fileList.value.push(...uploadList.value);
10902
+ uploadList.value = [];
10903
+ uploadNumber.value = 0;
10904
+ emitUpdateModelValue();
10905
+ }
10906
+ };
10907
+ watch(
10908
+ () => props.modelValue,
10909
+ (val) => {
10910
+ if (!val) {
10911
+ fileList.value = [];
10912
+ return;
10913
+ }
10914
+ fileList.value = [];
10915
+ fileList.value.push(
10916
+ ...val.map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
10917
+ );
10918
+ },
10919
+ { immediate: true, deep: true }
10920
+ );
10921
+ const emitUpdateModelValue = () => {
10922
+ let result = fileList.value.map((file) => file.url);
10923
+ emit("update:modelValue", result);
10924
+ };
10925
+ const handleRemove = (uploadFile) => {
10926
+ fileList.value = fileList.value.filter(
10927
+ (item) => item.url !== uploadFile.url || item.name !== uploadFile.name
10928
+ );
10929
+ emit(
10930
+ "update:modelValue",
10931
+ fileList.value.map((file) => file.url)
10932
+ );
10933
+ };
10934
+ const uploadError = () => {
10935
+ ElNotification({
10936
+ title: "温馨提示",
10937
+ message: "图片上传失败,请您重新上传!",
10938
+ type: "error"
10939
+ });
10940
+ };
10941
+ const handleExceed = () => {
10942
+ ElNotification({
10943
+ title: "温馨提示",
10944
+ message: `当前最多只能上传 ${props.limit} 张图片,请移除后上传!`,
10945
+ type: "warning"
10946
+ });
10947
+ };
10948
+ return (_ctx, _cache) => {
10949
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
10950
+ createVNode(unref(ElUpload), {
10951
+ "file-list": unref(fileList),
10952
+ "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(fileList) ? fileList.value = $event : null),
10953
+ accept: __props.fileType.join(","),
10954
+ "before-upload": beforeUpload,
10955
+ class: normalizeClass(["upload", __props.drag ? "no-border" : ""]),
10956
+ disabled: __props.disabled,
10957
+ drag: __props.drag,
10958
+ "http-request": httpRequest,
10959
+ limit: __props.limit,
10960
+ multiple: true,
10961
+ "on-error": uploadError,
10962
+ "on-exceed": handleExceed,
10963
+ "on-success": uploadSuccess,
10964
+ "list-type": "picture-card"
10965
+ }, {
10966
+ file: withCtx(({ file }) => [
10967
+ createElementVNode("img", {
10968
+ src: file.url,
10969
+ class: "upload-image"
10970
+ }, null, 8, _hoisted_3$1),
10971
+ createElementVNode("div", {
10972
+ class: "upload-handle",
10973
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
10974
+ }, ["stop"]))
10975
+ }, [
10976
+ createElementVNode("div", {
10977
+ class: "handle-icon",
10978
+ onClick: ($event) => imagePreview(file.url)
10979
+ }, [
10980
+ createVNode(unref(_sfc_main$v), { icon: "ant-design:zoom-in-outlined" }),
10981
+ __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_5$1, "查看")) : createCommentVNode("", true)
10982
+ ], 8, _hoisted_4$1),
10983
+ !__props.disabled ? (openBlock(), createElementBlock("div", {
10984
+ key: 0,
10985
+ class: "handle-icon",
10986
+ onClick: ($event) => handleRemove(file)
10987
+ }, [
10988
+ createVNode(unref(_sfc_main$v), { icon: "ant-design:delete-outlined" }),
10989
+ __props.showBtnText ? (openBlock(), createElementBlock("span", _hoisted_7, "删除")) : createCommentVNode("", true)
10990
+ ], 8, _hoisted_6)) : createCommentVNode("", true)
10991
+ ])
10992
+ ]),
10993
+ default: withCtx(() => [
10994
+ createElementVNode("div", _hoisted_2$1, [
10995
+ renderSlot(_ctx.$slots, "empty", {}, () => [
10996
+ createVNode(unref(_sfc_main$v), {
10997
+ icon: "ep:plus",
10998
+ size: 20
10999
+ }),
11000
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "empty-text" }, "点击上传", -1))
11001
+ ], true)
11002
+ ])
11003
+ ]),
11004
+ _: 3
11005
+ }, 8, ["file-list", "accept", "class", "disabled", "drag", "limit"]),
11006
+ createElementVNode("div", _hoisted_8, [
11007
+ renderSlot(_ctx.$slots, "tip", {}, void 0, true)
11008
+ ])
11009
+ ]);
10964
11010
  };
10965
11011
  }
10966
11012
  });
10967
- function _isSlot(s) {
10968
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10969
- }
10970
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10971
- name: "Anchor",
11013
+ const UploadImgs = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-92b67a34"]]);
11014
+ const _hoisted_1 = { class: "mt-10px line-height-20px color-[var(--el-upload-tip-color)] text-12px" };
11015
+ const _hoisted_2 = { class: "flex items-center" };
11016
+ const _hoisted_3 = { class: "ml-10px" };
11017
+ const _hoisted_4 = { class: "ml-10px" };
11018
+ const _hoisted_5 = { class: "ml-10px" };
11019
+ const _sfc_main = /* @__PURE__ */ Object.assign({ name: "UploadFile", inheritAttrs: false }, {
11020
+ __name: "UploadFile",
10972
11021
  props: {
10973
- offsetTop: Number,
10974
- bounds: Number,
10975
- affix: {
11022
+ modelValue: {
11023
+ type: [String, Array],
11024
+ required: true
11025
+ },
11026
+ // 文件类型, 例如['png', 'jpg', 'jpeg']
11027
+ fileType: {
11028
+ type: Array,
11029
+ default: () => ["doc", "xls", "ppt", "txt", "pdf"]
11030
+ },
11031
+ // 大小限制(MB)
11032
+ fileSize: {
11033
+ type: Number,
11034
+ default: 5
11035
+ },
11036
+ // 数量限制
11037
+ limit: {
11038
+ type: Number,
11039
+ default: 5
11040
+ },
11041
+ // 自动上传
11042
+ autoUpload: {
10976
11043
  type: Boolean,
10977
11044
  default: true
10978
11045
  },
10979
- showInkInFixed: {
11046
+ // 拖拽上传
11047
+ drag: {
10980
11048
  type: Boolean,
10981
11049
  default: false
10982
11050
  },
10983
- getContainer: Function,
10984
- wrapperClass: String,
10985
- wrapperStyle: {
10986
- type: Object,
10987
- default: void 0
11051
+ // 是否显示提示
11052
+ isShowTip: {
11053
+ type: Boolean,
11054
+ default: true
10988
11055
  },
10989
- // getCurrentAnchor: Function,
10990
- targetOffset: Number,
10991
- items: {
10992
- type: Array,
10993
- default: () => []
11056
+ // 是否禁用上传组件 ==> 非必传(默认为 false)
11057
+ disabled: {
11058
+ type: Boolean,
11059
+ default: false
10994
11060
  },
10995
- direction: {
11061
+ // 上传目录 ==> 非必传(默认为 undefined)
11062
+ directory: {
10996
11063
  type: String,
10997
- default: "vertical",
10998
- validator(value) {
10999
- return ["vertical", "horizontal"].includes(value);
11000
- }
11064
+ default: void 0
11065
+ },
11066
+ // 自定义上传函数(必填)==> 必传
11067
+ customUpload: {
11068
+ type: Function,
11069
+ required: true
11070
+ },
11071
+ // 自定义从上传结果中提取 URL 的函数 ==> 非必传(默认为提取 res.data)
11072
+ getUploadUrl: {
11073
+ type: Function,
11074
+ default: (res) => res.data
11001
11075
  }
11002
11076
  },
11003
- setup(props, {
11004
- attrs,
11005
- emit,
11006
- slots,
11007
- expose
11008
- }) {
11009
- const {
11010
- getPrefixCls: getPrefixCls2
11011
- } = useDesign();
11012
- const prefixCls2 = getPrefixCls2("anchor");
11013
- const anchorDirection = computed(() => props.direction ?? "vertical");
11014
- const spanLinkNode = ref(null);
11015
- const anchorRef = ref();
11016
- const state = reactive({
11017
- links: [],
11018
- scrollContainer: null,
11019
- scrollEvent: null,
11020
- animating: false
11021
- });
11022
- const activeLink = ref(null);
11023
- const getContainer = computed(() => {
11024
- const {
11025
- getContainer: getContainer2
11026
- } = props;
11027
- return getContainer2 || getDefaultContainer;
11028
- });
11029
- const getCurrentAnchor = (offsetTop = 0, bounds = 5) => {
11030
- const linkSections = [];
11031
- const container = getContainer.value();
11032
- state.links.forEach((link) => {
11033
- const sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
11034
- if (!sharpLinkMatch) {
11035
- return;
11036
- }
11037
- const target = document.getElementById(sharpLinkMatch[1]);
11038
- if (target) {
11039
- const top = getOffsetTop(target, container);
11040
- if (top < offsetTop + bounds) {
11041
- linkSections.push({
11042
- link,
11043
- top
11044
- });
11045
- }
11046
- }
11077
+ emits: ["update:modelValue"],
11078
+ setup(__props, { emit: __emit }) {
11079
+ const message = useMessage();
11080
+ const emit = __emit;
11081
+ const props = __props;
11082
+ const uploadRef = ref();
11083
+ const uploadList = ref([]);
11084
+ const fileList = ref([]);
11085
+ const uploadNumber = ref(0);
11086
+ const httpRequest = async (options) => {
11087
+ return await props.customUpload(options.file, {
11088
+ directory: props.directory
11047
11089
  });
11048
- if (linkSections.length) {
11049
- const maxSection = linkSections.reduce((prev, curr) => curr.top > prev.top ? curr : prev);
11050
- return maxSection.link;
11051
- }
11052
- return "";
11053
- };
11054
- const setCurrentActiveLink = (link) => {
11055
- const {
11056
- getCurrentAnchor: getCurrentAnchor2
11057
- } = props;
11058
- if (activeLink.value === link) {
11059
- return;
11060
- }
11061
- activeLink.value = typeof getCurrentAnchor2 === "function" ? getCurrentAnchor2(link) : link;
11062
- emit("change", link);
11063
11090
  };
11064
- const handleScrollTo = (link) => {
11065
- const {
11066
- offsetTop,
11067
- targetOffset
11068
- } = props;
11069
- setCurrentActiveLink(link);
11070
- const sharpLinkMatch = sharpMatcherRegx.exec(link);
11071
- if (!sharpLinkMatch) {
11072
- return;
11091
+ const beforeUpload = (file) => {
11092
+ if (fileList.value.length >= props.limit) {
11093
+ message.error(`上传文件数量不能超过${props.limit}个!`);
11094
+ return false;
11073
11095
  }
11074
- const targetElement = document.getElementById(sharpLinkMatch[1]);
11075
- if (!targetElement) {
11076
- return;
11096
+ let fileExtension = "";
11097
+ if (file.name.lastIndexOf(".") > -1) {
11098
+ fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
11077
11099
  }
11078
- const container = getContainer.value();
11079
- const scrollTop = getScroll(container);
11080
- const eleOffsetTop = getOffsetTop(targetElement, container);
11081
- let y = scrollTop + eleOffsetTop;
11082
- y -= targetOffset !== void 0 ? targetOffset : offsetTop || 0;
11083
- state.animating = true;
11084
- scrollTo(y, {
11085
- callback: () => {
11086
- state.animating = false;
11087
- },
11088
- getContainer: getContainer.value
11100
+ const isImg = props.fileType.some((type) => {
11101
+ if (file.type.indexOf(type) > -1)
11102
+ return true;
11103
+ return !!(fileExtension && fileExtension.indexOf(type) > -1);
11089
11104
  });
11105
+ const isLimit = file.size < props.fileSize * 1024 * 1024;
11106
+ if (!isImg) {
11107
+ message.error(`文件格式不正确, 请上传${props.fileType.join("、")}格式!`);
11108
+ return false;
11109
+ }
11110
+ if (!isLimit) {
11111
+ message.error(`上传文件大小不能超过${props.fileSize}MB!`);
11112
+ return false;
11113
+ }
11114
+ message.success("正在上传文件,请稍候...");
11115
+ uploadNumber.value++;
11090
11116
  };
11091
- expose({
11092
- scrollTo: handleScrollTo
11093
- });
11094
- const handleScroll = () => {
11095
- if (state.animating) {
11096
- return;
11117
+ const handleFileSuccess = (res) => {
11118
+ message.success("上传成功");
11119
+ const fileUrl = props.getUploadUrl(res);
11120
+ const index = fileList.value.findIndex((item) => {
11121
+ var _a2;
11122
+ return ((_a2 = item.response) == null ? void 0 : _a2.data) === fileUrl;
11123
+ });
11124
+ fileList.value.splice(index, 1);
11125
+ uploadList.value.push({ name: fileUrl, url: fileUrl });
11126
+ if (uploadList.value.length == uploadNumber.value) {
11127
+ fileList.value.push(...uploadList.value);
11128
+ uploadList.value = [];
11129
+ uploadNumber.value = 0;
11130
+ emitUpdateModelValue();
11097
11131
  }
11098
- const {
11099
- offsetTop,
11100
- bounds,
11101
- targetOffset
11102
- } = props;
11103
- const currentActiveLink = getCurrentAnchor(targetOffset !== void 0 ? targetOffset : offsetTop || 0, bounds);
11104
- setCurrentActiveLink(currentActiveLink);
11105
11132
  };
11106
- const updateInk = () => {
11107
- const linkNode = anchorRef.value.querySelector(`.${prefixCls2}-link-title-active`);
11108
- if (linkNode && spanLinkNode.value) {
11109
- const horizontalAnchor = anchorDirection.value === "horizontal";
11110
- spanLinkNode.value.style.top = horizontalAnchor ? "" : `${linkNode.offsetTop + linkNode.clientHeight / 2}px`;
11111
- spanLinkNode.value.style.height = horizontalAnchor ? "" : `${linkNode.clientHeight}px`;
11112
- spanLinkNode.value.style.left = horizontalAnchor ? `${linkNode.offsetLeft}px` : "";
11113
- spanLinkNode.value.style.width = horizontalAnchor ? `${linkNode.clientWidth}px` : "";
11114
- if (horizontalAnchor) {
11115
- e(linkNode, {
11116
- scrollMode: "if-needed",
11117
- block: "nearest"
11118
- });
11119
- }
11133
+ const handleExceed = () => {
11134
+ message.error(`上传文件数量不能超过${props.limit}个!`);
11135
+ };
11136
+ const excelUploadError = () => {
11137
+ message.error("导入数据失败,请您重新上传!");
11138
+ };
11139
+ const handleRemove = (file) => {
11140
+ const index = fileList.value.map((f) => f.name).indexOf(file.name);
11141
+ if (index > -1) {
11142
+ fileList.value.splice(index, 1);
11143
+ emitUpdateModelValue();
11120
11144
  }
11121
11145
  };
11122
- provide("useAnchor", {
11123
- registerLink: (link) => {
11124
- if (!state.links.includes(link)) {
11125
- state.links.push(link);
11146
+ const handlePreview = (uploadFile) => {
11147
+ console.log(uploadFile);
11148
+ };
11149
+ watch(
11150
+ () => props.modelValue,
11151
+ (val) => {
11152
+ if (!val) {
11153
+ fileList.value = [];
11154
+ return;
11126
11155
  }
11127
- },
11128
- unregisterLink: (link) => {
11129
- const index = state.links.indexOf(link);
11130
- if (index !== -1) {
11131
- state.links.splice(index, 1);
11156
+ fileList.value = [];
11157
+ if (isString(val)) {
11158
+ fileList.value.push(
11159
+ ...val.split(",").map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
11160
+ );
11161
+ return;
11132
11162
  }
11163
+ fileList.value.push(
11164
+ ...val.map((url) => ({ name: url.substring(url.lastIndexOf("/") + 1), url }))
11165
+ );
11133
11166
  },
11134
- activeLink,
11135
- scrollTo: handleScrollTo,
11136
- handleClick: (e2, info) => {
11137
- emit("click", e2, info);
11138
- },
11139
- direction: anchorDirection
11140
- });
11141
- onMounted(() => {
11142
- nextTick(() => {
11143
- const container = getContainer.value();
11144
- state.scrollContainer = container;
11145
- state.scrollEvent = addEventListener(state.scrollContainer, "scroll", handleScroll);
11146
- handleScroll();
11147
- });
11148
- });
11149
- onBeforeUnmount(() => {
11150
- if (state.scrollEvent) {
11151
- state.scrollEvent.remove();
11152
- }
11153
- });
11154
- onUpdated(() => {
11155
- if (state.scrollEvent) {
11156
- const currentContainer = getContainer.value();
11157
- if (state.scrollContainer !== currentContainer) {
11158
- state.scrollContainer = currentContainer;
11159
- state.scrollEvent.remove();
11160
- state.scrollEvent = addEventListener(state.scrollContainer, "scroll", handleScroll);
11161
- handleScroll();
11162
- }
11167
+ { immediate: true, deep: true }
11168
+ );
11169
+ const emitUpdateModelValue = () => {
11170
+ let result = fileList.value.map((file) => file.url);
11171
+ if (props.limit === 1 || isString(props.modelValue)) {
11172
+ result = result.join(",");
11163
11173
  }
11164
- updateInk();
11165
- });
11166
- const createNestedLink = (options) => Array.isArray(options) ? options.map((option) => {
11167
- const {
11168
- children,
11169
- key,
11170
- href,
11171
- target,
11172
- class: cls,
11173
- style,
11174
- title
11175
- } = option;
11176
- return createVNode(_sfc_main$2, {
11177
- "key": key,
11178
- "href": href,
11179
- "target": target,
11180
- "class": cls,
11181
- "style": style,
11182
- "title": title,
11183
- "prefixCls": prefixCls2,
11184
- "customTitleProps": option
11185
- }, {
11186
- default: () => [anchorDirection.value === "vertical" ? createNestedLink(children) : null],
11187
- customTitle: slots.customTitle
11188
- });
11189
- }) : null;
11190
- return () => {
11191
- var _a2;
11192
- const {
11193
- offsetTop,
11194
- affix,
11195
- showInkInFixed
11196
- } = props;
11197
- const inkClass = [`${prefixCls2}-ink`, {
11198
- [`${prefixCls2}-ink-visible`]: activeLink.value
11199
- }];
11200
- const wrapperClass = [props.wrapperClass, `${prefixCls2}-wrapper`, {
11201
- [`${prefixCls2}-wrapper-horizontal`]: anchorDirection.value === "horizontal"
11202
- }];
11203
- const anchorClass = [prefixCls2, {
11204
- [`${prefixCls2}-fixed`]: !affix && !showInkInFixed
11205
- }];
11206
- const wrapperStyle = {
11207
- maxHeight: offsetTop ? `calc(100vh - ${offsetTop}px)` : "100vh",
11208
- ...props.wrapperStyle
11209
- };
11210
- const anchorContent = createVNode("div", {
11211
- "class": wrapperClass,
11212
- "style": wrapperStyle,
11213
- "ref": anchorRef
11214
- }, [createVNode("div", {
11215
- "class": anchorClass
11216
- }, [createVNode("span", {
11217
- "class": inkClass,
11218
- "ref": spanLinkNode
11219
- }, null), Array.isArray(props.items) ? createNestedLink(props.items) : (_a2 = slots.default) == null ? void 0 : _a2.call(slots)])]);
11220
- return !affix ? anchorContent : createVNode(ElAffix, mergeProps(attrs, {
11221
- "offset": offsetTop
11222
- }), _isSlot(anchorContent) ? anchorContent : {
11223
- default: () => [anchorContent]
11224
- });
11174
+ emit("update:modelValue", result);
11225
11175
  };
11226
- }
11227
- });
11228
- const _hoisted_1 = { class: "com-steps" };
11229
- const _hoisted_2 = { class: "steps-item-container" };
11230
- const _hoisted_3 = { class: "steps-item-icon" };
11231
- const _hoisted_4 = { class: "steps-icon" };
11232
- const _hoisted_5 = { class: "steps-item-content" };
11233
- const _hoisted_6 = { class: "steps-item-title" };
11234
- const _sfc_main = /* @__PURE__ */ Object.assign({ name: "Steps" }, {
11235
- __name: "Steps",
11236
- props: {
11237
- // 设置当前激活步骤
11238
- active: {
11239
- type: Number,
11240
- default: 0
11241
- },
11242
- // 配置选项卡内容
11243
- items: {
11244
- type: Array,
11245
- default: () => []
11246
- }
11247
- },
11248
- setup(__props) {
11249
11176
  return (_ctx, _cache) => {
11250
- return openBlock(), createElementBlock("div", _hoisted_1, [
11251
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
11252
- return openBlock(), createElementBlock("div", {
11253
- key: index,
11254
- class: normalizeClass(["steps-item", {
11255
- "steps-item-finish": __props.active > index,
11256
- "steps-item-process": __props.active == index,
11257
- "steps-item-wait": __props.active < index
11258
- }])
11259
- }, [
11177
+ return openBlock(), createElementBlock("div", {
11178
+ class: normalizeClass(["upload-file", _ctx.$attrs.class])
11179
+ }, [
11180
+ !__props.disabled ? (openBlock(), createBlock(unref(ElUpload), {
11181
+ key: 0,
11182
+ ref_key: "uploadRef",
11183
+ ref: uploadRef,
11184
+ "file-list": unref(fileList),
11185
+ "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null),
11186
+ "auto-upload": __props.autoUpload,
11187
+ "before-upload": beforeUpload,
11188
+ disabled: __props.disabled,
11189
+ drag: __props.drag,
11190
+ "http-request": httpRequest,
11191
+ limit: props.limit,
11192
+ multiple: props.limit > 1,
11193
+ "on-error": excelUploadError,
11194
+ "on-exceed": handleExceed,
11195
+ "on-preview": handlePreview,
11196
+ "on-remove": handleRemove,
11197
+ "on-success": handleFileSuccess,
11198
+ "show-file-list": true,
11199
+ class: "upload-file-uploader",
11200
+ name: "file"
11201
+ }, createSlots({
11202
+ file: withCtx((row) => [
11260
11203
  createElementVNode("div", _hoisted_2, [
11204
+ createElementVNode("span", null, toDisplayString(row.file.name), 1),
11261
11205
  createElementVNode("div", _hoisted_3, [
11262
- createElementVNode("div", _hoisted_4, [
11263
- __props.active > index ? (openBlock(), createBlock(unref(_sfc_main$v), {
11264
- key: 0,
11265
- icon: "ant-design:check-outlined",
11266
- color: "#fff"
11267
- })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
11268
- createTextVNode(toDisplayString(index + 1), 1)
11269
- ], 64))
11270
- ])
11206
+ createVNode(unref(ElLink), {
11207
+ href: row.file.url,
11208
+ underline: "never",
11209
+ download: "",
11210
+ target: "_blank",
11211
+ type: "primary"
11212
+ }, {
11213
+ default: withCtx(() => _cache[2] || (_cache[2] = [
11214
+ createTextVNode(" 下载 ", -1)
11215
+ ])),
11216
+ _: 2,
11217
+ __: [2]
11218
+ }, 1032, ["href"])
11271
11219
  ]),
11272
- createElementVNode("div", _hoisted_5, [
11273
- createElementVNode("div", _hoisted_6, toDisplayString(item.title), 1)
11220
+ createElementVNode("div", _hoisted_4, [
11221
+ createVNode(unref(ElLink), {
11222
+ type: "danger",
11223
+ onClick: ($event) => handleRemove(row.file)
11224
+ }, {
11225
+ default: withCtx(() => _cache[3] || (_cache[3] = [
11226
+ createTextVNode(" 删除", -1)
11227
+ ])),
11228
+ _: 2,
11229
+ __: [3]
11230
+ }, 1032, ["onClick"])
11274
11231
  ])
11275
11232
  ])
11276
- ], 2);
11233
+ ]),
11234
+ default: withCtx(() => [
11235
+ createVNode(unref(ElButton), { type: "primary" }, {
11236
+ default: withCtx(() => [
11237
+ createVNode(unref(_sfc_main$v), { icon: "ant-design:upload-outlined" }),
11238
+ _cache[1] || (_cache[1] = createTextVNode(" 选取文件 ", -1))
11239
+ ]),
11240
+ _: 1,
11241
+ __: [1]
11242
+ })
11243
+ ]),
11244
+ _: 2
11245
+ }, [
11246
+ __props.isShowTip ? {
11247
+ name: "tip",
11248
+ fn: withCtx(() => [
11249
+ createElementVNode("div", _hoisted_1, [
11250
+ createElementVNode("span", null, "格式为:" + toDisplayString(__props.fileType.join("、")) + ",", 1),
11251
+ createElementVNode("span", null, "大小不超过" + toDisplayString(__props.fileSize) + "MB。", 1)
11252
+ ])
11253
+ ]),
11254
+ key: "0"
11255
+ } : void 0
11256
+ ]), 1032, ["file-list", "auto-upload", "disabled", "drag", "limit", "multiple"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(fileList), (file, index) => {
11257
+ return openBlock(), createElementBlock("div", {
11258
+ key: index,
11259
+ class: "flex items-center file-list-item"
11260
+ }, [
11261
+ createElementVNode("span", null, toDisplayString(file.name), 1),
11262
+ createElementVNode("div", _hoisted_5, [
11263
+ createVNode(unref(ElLink), {
11264
+ href: file.url,
11265
+ underline: "never",
11266
+ download: "",
11267
+ target: "_blank",
11268
+ type: "primary"
11269
+ }, {
11270
+ default: withCtx(() => _cache[4] || (_cache[4] = [
11271
+ createTextVNode(" 下载 ", -1)
11272
+ ])),
11273
+ _: 2,
11274
+ __: [4]
11275
+ }, 1032, ["href"])
11276
+ ])
11277
+ ]);
11277
11278
  }), 128))
11278
- ]);
11279
+ ], 2);
11279
11280
  };
11280
11281
  }
11281
11282
  });
11282
- const Steps = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-eb3cf40f"]]);
11283
+ const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f625d304"]]);
11283
11284
  function useLayout() {
11284
11285
  const collapsed = ref(false);
11285
11286
  const toggleCollapsed = () => {
@@ -11290,22 +11291,233 @@ function useLayout() {
11290
11291
  toggleCollapsed
11291
11292
  };
11292
11293
  }
11294
+ const install = (app) => {
11295
+ app.component("BmpLayout", BmpLayout);
11296
+ app.component("BmpConfigGlobal", _sfc_main$d);
11297
+ app.component("BmpPageCard", PageCard);
11298
+ app.component("BmpPageNavBar", PageNavBar);
11299
+ app.component("BmpIcon", _sfc_main$v);
11300
+ app.component("BmpBadge", _sfc_main$a);
11301
+ app.component("BmpPagination", _sfc_main$9);
11302
+ app.component("BmpDialog", _sfc_main$8);
11303
+ app.component("BmpAlert", _sfc_main$7);
11304
+ app.component("BmpAnchor", _sfc_main$5);
11305
+ app.component("BmpSteps", Steps);
11306
+ app.component("BmpBacktop", _sfc_main$w);
11307
+ app.component("BmpAffix", ElAffix);
11308
+ app.component("BmpAutocomplete", ElAutocomplete);
11309
+ app.component("BmpAvatar", ElAvatar);
11310
+ app.component("BmpBreadcrumb", ElBreadcrumb);
11311
+ app.component("BmpBreadcrumbItem", ElBreadcrumbItem);
11312
+ app.component("BmpButton", ElButton);
11313
+ app.component("BmpButtonGroup", ElButtonGroup);
11314
+ app.component("BmpCard", ElCard);
11315
+ app.component("BmpCarousel", ElCarousel);
11316
+ app.component("BmpCarouselItem", ElCarouselItem);
11317
+ app.component("BmpCollapse", ElCollapse);
11318
+ app.component("BmpCollapseItem", ElCollapseItem);
11319
+ app.component("BmpCollapseTransition", ElCollapseTransition);
11320
+ app.component("BmpDivider", ElDivider);
11321
+ app.component("BmpDrawer", ElDrawer);
11322
+ app.component("BmpEmpty", ElEmpty);
11323
+ app.component("BmpLink", ElLink);
11324
+ app.component("BmpOverlay", ElOverlay);
11325
+ app.component("BmpPageHeader", ElPageHeader);
11326
+ app.component("BmpProgress", ElProgress);
11327
+ app.component("BmpResult", ElResult);
11328
+ app.component("BmpScrollbar", ElScrollbar);
11329
+ app.component("BmpSkeleton", ElSkeleton);
11330
+ app.component("BmpSkeletonItem", ElSkeletonItem);
11331
+ app.component("BmpSpace", ElSpace);
11332
+ app.component("BmpTag", ElTag);
11333
+ app.component("BmpText", ElText);
11334
+ app.component("BmpCascader", ElCascader);
11335
+ app.component("BmpCascaderPanel", ElCascaderPanel);
11336
+ app.component("BmpCheckbox", ElCheckbox);
11337
+ app.component("BmpCheckboxButton", ElCheckboxButton);
11338
+ app.component("BmpCheckboxGroup", ElCheckboxGroup);
11339
+ app.component("BmpColorPicker", ElColorPicker);
11340
+ app.component("BmpDatePicker", ElDatePicker);
11341
+ app.component("BmpForm", ElForm);
11342
+ app.component("BmpFormItem", ElFormItem);
11343
+ app.component("BmpInput", ElInput);
11344
+ app.component("BmpInputNumber", ElInputNumber);
11345
+ app.component("BmpInputTag", ElInputTag);
11346
+ app.component("BmpRadio", ElRadio);
11347
+ app.component("BmpRadioButton", ElRadioButton);
11348
+ app.component("BmpRadioGroup", ElRadioGroup);
11349
+ app.component("BmpRate", ElRate);
11350
+ app.component("BmpSelect", ElSelect);
11351
+ app.component("BmpOption", ElOption);
11352
+ app.component("BmpOptionGroup", ElOptionGroup);
11353
+ app.component("BmpSelectV2", ElSelectV2);
11354
+ app.component("BmpSlider", ElSlider);
11355
+ app.component("BmpSwitch", ElSwitch);
11356
+ app.component("BmpTimePicker", ElTimePicker);
11357
+ app.component("BmpTimeSelect", ElTimeSelect);
11358
+ app.component("BmpTransfer", ElTransfer);
11359
+ app.component("BmpTreeSelect", ElTreeSelect);
11360
+ app.component("BmpMention", ElMention);
11361
+ app.component("BmpCalendar", ElCalendar);
11362
+ app.component("BmpCheckTag", ElCheckTag);
11363
+ app.component("BmpCountdown", ElCountdown);
11364
+ app.component("BmpDescriptions", ElDescriptions);
11365
+ app.component("BmpDescriptionsItem", ElDescriptionsItem);
11366
+ app.component("BmpImage", ElImage);
11367
+ app.component("BmpImageViewer", ElImageViewer);
11368
+ app.component("BmpStatistic", ElStatistic);
11369
+ app.component("BmpTable", ElTable);
11370
+ app.component("BmpTableColumn", ElTableColumn);
11371
+ app.component("BmpTimeline", ElTimeline);
11372
+ app.component("BmpTimelineItem", ElTimelineItem);
11373
+ app.component("BmpTree", ElTree);
11374
+ app.component("BmpTreeV2", ElTreeV2);
11375
+ app.component("BmpDropdown", ElDropdown);
11376
+ app.component("BmpDropdownItem", ElDropdownItem);
11377
+ app.component("BmpDropdownMenu", ElDropdownMenu);
11378
+ app.component("BmpMenu", ElMenu);
11379
+ app.component("BmpMenuItem", ElMenuItem);
11380
+ app.component("BmpMenuItemGroup", ElMenuItemGroup);
11381
+ app.component("BmpSubMenu", ElSubMenu);
11382
+ app.component("BmpTabs", ElTabs);
11383
+ app.component("BmpTabPane", ElTabPane);
11384
+ app.component("BmpPopover", ElPopover);
11385
+ app.component("BmpPopconfirm", ElPopconfirm);
11386
+ app.component("BmpTooltip", ElTooltip);
11387
+ app.component("BmpContainer", ElContainer);
11388
+ app.component("BmpAside", ElAside);
11389
+ app.component("BmpFooter", ElFooter);
11390
+ app.component("BmpHeader", ElHeader);
11391
+ app.component("BmpMain", ElMain);
11392
+ app.component("BmpRow", ElRow);
11393
+ app.component("BmpCol", ElCol);
11394
+ app.component("BmpSplitter", ElSplitter);
11395
+ app.component("BmpSplitterPanel", ElSplitterPanel);
11396
+ app.component("BmpConfigProvider", ElConfigProvider);
11397
+ app.component("BmpSegmented", ElSegmented);
11398
+ app.component("BmpTour", ElTour);
11399
+ app.component("BmpTourStep", ElTourStep);
11400
+ app.component("BmpUpload", ElUpload);
11401
+ app.component("BmpWatermark", ElWatermark);
11402
+ app.component("BmpPopper", ElPopper);
11403
+ };
11404
+ BmpLayout.install = install;
11293
11405
  export {
11294
- _sfc_main$3 as BmpAlert,
11295
- _sfc_main$1 as BmpAnchor,
11406
+ ElAffix2 as BmpAffix,
11407
+ _sfc_main$7 as BmpAlert,
11408
+ _sfc_main$5 as BmpAnchor,
11409
+ ElAside2 as BmpAside,
11410
+ ElAutocomplete2 as BmpAutocomplete,
11411
+ ElAvatar2 as BmpAvatar,
11296
11412
  _sfc_main$w as BmpBacktop,
11297
- _sfc_main$6 as BmpBadge,
11413
+ _sfc_main$a as BmpBadge,
11414
+ ElBreadcrumb2 as BmpBreadcrumb,
11415
+ ElBreadcrumbItem2 as BmpBreadcrumbItem,
11416
+ ElButton2 as BmpButton,
11417
+ ElButtonGroup2 as BmpButtonGroup,
11418
+ ElCalendar2 as BmpCalendar,
11419
+ ElCard2 as BmpCard,
11420
+ ElCarousel2 as BmpCarousel,
11421
+ ElCarouselItem2 as BmpCarouselItem,
11422
+ ElCascader2 as BmpCascader,
11423
+ ElCascaderPanel2 as BmpCascaderPanel,
11424
+ ElCheckTag2 as BmpCheckTag,
11425
+ ElCheckbox2 as BmpCheckbox,
11426
+ ElCheckboxButton2 as BmpCheckboxButton,
11427
+ ElCheckboxGroup2 as BmpCheckboxGroup,
11428
+ ElCol2 as BmpCol,
11429
+ ElCollapse2 as BmpCollapse,
11430
+ ElCollapseItem2 as BmpCollapseItem,
11431
+ ElCollapseTransition2 as BmpCollapseTransition,
11432
+ ElColorPicker2 as BmpColorPicker,
11298
11433
  _sfc_main$d as BmpConfigGlobal,
11434
+ ElConfigProvider2 as BmpConfigProvider,
11435
+ ElContainer2 as BmpContainer,
11436
+ ElCountdown2 as BmpCountdown,
11299
11437
  createImageViewer as BmpCreateImageViewer,
11300
- _sfc_main$4 as BmpDialog,
11438
+ ElDatePicker2 as BmpDatePicker,
11439
+ ElDescriptions2 as BmpDescriptions,
11440
+ ElDescriptionsItem2 as BmpDescriptionsItem,
11441
+ _sfc_main$8 as BmpDialog,
11442
+ ElDivider2 as BmpDivider,
11443
+ ElDrawer2 as BmpDrawer,
11444
+ ElDropdown2 as BmpDropdown,
11445
+ ElDropdownItem2 as BmpDropdownItem,
11446
+ ElDropdownMenu2 as BmpDropdownMenu,
11447
+ ElEmpty2 as BmpEmpty,
11448
+ ElFooter2 as BmpFooter,
11449
+ ElForm2 as BmpForm,
11450
+ ElFormItem2 as BmpFormItem,
11451
+ ElHeader2 as BmpHeader,
11301
11452
  _sfc_main$v as BmpIcon,
11453
+ ElImage2 as BmpImage,
11454
+ ElImageViewer2 as BmpImageViewer,
11455
+ ElInfiniteScroll as BmpInfiniteScroll,
11456
+ ElInput2 as BmpInput,
11457
+ ElInputNumber2 as BmpInputNumber,
11458
+ ElInputTag2 as BmpInputTag,
11302
11459
  BmpLayout,
11460
+ ElLink2 as BmpLink,
11461
+ ElLoading as BmpLoading,
11462
+ ElMain2 as BmpMain,
11463
+ ElMention2 as BmpMention,
11464
+ ElMenu2 as BmpMenu,
11465
+ ElMenuItem2 as BmpMenuItem,
11466
+ ElMenuItemGroup2 as BmpMenuItemGroup,
11467
+ ElMessage2 as BmpMessage,
11468
+ ElMessageBox2 as BmpMessageBox,
11469
+ ElNotification2 as BmpNotification,
11470
+ ElOption2 as BmpOption,
11471
+ ElOptionGroup2 as BmpOptionGroup,
11472
+ ElOverlay2 as BmpOverlay,
11303
11473
  PageCard as BmpPageCard,
11304
- PageHeader as BmpPageHeader,
11305
- _sfc_main$5 as BmpPagination,
11474
+ ElPageHeader2 as BmpPageHeader,
11475
+ PageNavBar as BmpPageNavBar,
11476
+ _sfc_main$9 as BmpPagination,
11477
+ ElPopconfirm2 as BmpPopconfirm,
11478
+ ElPopover2 as BmpPopover,
11479
+ ElPopper2 as BmpPopper,
11480
+ ElProgress2 as BmpProgress,
11481
+ ElRadio2 as BmpRadio,
11482
+ ElRadioButton2 as BmpRadioButton,
11483
+ ElRadioGroup2 as BmpRadioGroup,
11484
+ ElRate2 as BmpRate,
11485
+ ElResult2 as BmpResult,
11486
+ ElRow2 as BmpRow,
11487
+ ElScrollbar2 as BmpScrollbar,
11488
+ ElSegmented2 as BmpSegmented,
11489
+ ElSelect2 as BmpSelect,
11490
+ ElSelectV22 as BmpSelectV2,
11306
11491
  setI18n as BmpSetI18n,
11307
11492
  setPinia as BmpSetPinia,
11493
+ ElSkeleton2 as BmpSkeleton,
11494
+ ElSkeletonItem2 as BmpSkeletonItem,
11495
+ ElSlider2 as BmpSlider,
11496
+ ElSpace2 as BmpSpace,
11497
+ ElSplitter2 as BmpSplitter,
11498
+ ElSplitterPanel2 as BmpSplitterPanel,
11499
+ ElStatistic2 as BmpStatistic,
11308
11500
  Steps as BmpSteps,
11501
+ ElSubMenu2 as BmpSubMenu,
11502
+ ElSwitch2 as BmpSwitch,
11503
+ ElTabPane2 as BmpTabPane,
11504
+ ElTable2 as BmpTable,
11505
+ ElTableColumn2 as BmpTableColumn,
11506
+ ElTabs2 as BmpTabs,
11507
+ ElTag2 as BmpTag,
11508
+ ElText2 as BmpText,
11509
+ ElTimePicker2 as BmpTimePicker,
11510
+ ElTimeSelect2 as BmpTimeSelect,
11511
+ ElTimeline2 as BmpTimeline,
11512
+ ElTimelineItem2 as BmpTimelineItem,
11513
+ ElTooltip2 as BmpTooltip,
11514
+ ElTour2 as BmpTour,
11515
+ ElTourStep2 as BmpTourStep,
11516
+ ElTransfer2 as BmpTransfer,
11517
+ ElTree2 as BmpTree,
11518
+ ElTreeSelect2 as BmpTreeSelect,
11519
+ ElTreeV22 as BmpTreeV2,
11520
+ ElUpload2 as BmpUpload,
11309
11521
  UploadFile as BmpUploadFile,
11310
11522
  UploadImg as BmpUploadImg,
11311
11523
  UploadImgs as BmpUploadImgs,
@@ -11316,5 +11528,7 @@ export {
11316
11528
  usePermissionStoreWithOut as BmpUsePermissionStoreWithOut,
11317
11529
  useUserStore as BmpUseUserStore,
11318
11530
  useUserStoreWithOut as BmpUseUserStoreWithOut,
11319
- BmpLayout as default
11531
+ ElWatermark2 as BmpWatermark,
11532
+ BmpLayout as default,
11533
+ install
11320
11534
  };