3h1-ui 2.15.25 → 2.15.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/es/index.js +2231 -2189
  2. package/es/style.css +46 -35
  3. package/lib/index.js +2228 -2186
  4. package/lib/style.css +46 -35
  5. package/package.json +3 -3
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { h, nextTick, createVNode, defineComponent, ref, computed, unref, watchEffect, watch, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createSlots, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, onMounted, normalizeClass, createCommentVNode, normalizeStyle, Transition, toHandlers, useSlots, withDirectives, vShow, getCurrentInstance, inject, onUnmounted, provide, onBeforeUnmount, resolveDynamicComponent, reactive, toRef, toRefs, TransitionGroup, getCurrentScope, onScopeDispose, readonly, defineAsyncComponent, isRef, toRaw, shallowRef, isVNode, useAttrs as useAttrs$2, shallowReactive, withKeys, withModifiers, render as render$1, resolveDirective, pushScopeId, popScopeId, useCssVars } from "vue";
2
- import { Radio, Select, Tree, TreeSelect, Cascader, Transfer, Input, Tooltip, Skeleton, Popover, Pagination, Empty, Button as Button$1, Table, FormItem, DatePicker, InputNumber, Modal as Modal$2, Popconfirm, Menu, Dropdown, Divider as Divider$1, Image, Progress, Tag, Alert, Upload, Space, AutoComplete, Switch, Checkbox, Slider, Rate, TimePicker, Col, Form, Row, MenuItem, MenuDivider, Spin, PageHeader, CheckboxGroup, TableSummaryRow, TableSummaryCell, TableSummary, Badge, FormItemRest, Drawer, Avatar, Descriptions, DescriptionsItem } from "ant-design-vue";
3
- import { isFunction as isFunction$4, isString as isString$3, isArray as isArray$3, getSlot as getSlot$1, addClass as addClass$1, removeClass as removeClass$1, getPopupContainer as getPopupContainer$1, triggerWindowResize, off, on, addResizeListener, removeResizeListener, buildUUID, withInstall as withInstall$5, extendSlots as extendSlots$1, isBoolean, isNumber as isNumber$2, isDef as isDef$1, warn as warn$1, downloadByUrl, isObject as isObject$3, isNull, dateUtil, isNullOrUnDef, error as error$1, deepMerge as deepMerge$1, getDynamicProps, buildProps, createBEM, forEach as forEach$1, isClient as isClient$1, filter, treeToList, eachTree, isEmpty, isServer, formatToDate, isMap as isMap$2, findNodeAll, getViewportOffset, isNullAndUnDef, dataURLtoBlob, deepMergeObjects } from "@shy-plugins/utils";
4
- import { useAttrs as useAttrs$1, useRuleFormItem, useTimeoutFn as useTimeoutFn$2, useScrollTo as useScrollTo$1, useIntersectionObserver, useCopyToClipboard, useMessage, usePagination as usePagination$2, useI18n as useI18n$1, useDesign as useDesign$1, useSortable, createContext as createContext$1, useContext as useContext$2, useBreakpoint, useContentHeight, useWindowSizeFn as useWindowSizeFn$1, onMountedOrActivated, useEventListener as useEventListener$1 } from "@shy-plugins/use";
2
+ import { Radio, Select, Tree, TreeSelect, Cascader, Transfer, Input, Tooltip, Skeleton, Popover, Pagination, Empty, Button as Button$1, Popconfirm, Menu, Dropdown, Divider as Divider$1, Table, FormItem, DatePicker, InputNumber, Modal as Modal$2, Image, Progress, Tag, Alert, Upload, Space, AutoComplete, Switch, Checkbox, Slider, Rate, TimePicker, Col, Form, Row, MenuItem, MenuDivider, Spin, PageHeader, CheckboxGroup, TableSummaryRow, TableSummaryCell, TableSummary, Badge, FormItemRest, Drawer, Avatar, Descriptions, DescriptionsItem } from "ant-design-vue";
3
+ import { isFunction as isFunction$4, isString as isString$3, isArray as isArray$3, getSlot as getSlot$1, addClass as addClass$1, removeClass as removeClass$1, getPopupContainer as getPopupContainer$1, triggerWindowResize, off, on, addResizeListener, removeResizeListener, extendSlots as extendSlots$1, withInstall as withInstall$5, isBoolean, isNumber as isNumber$2, buildUUID, isDef as isDef$1, warn as warn$1, downloadByUrl, isObject as isObject$3, isNull, dateUtil, isNullOrUnDef, error as error$1, deepMerge as deepMerge$1, getDynamicProps, buildProps, createBEM, forEach as forEach$1, isClient as isClient$1, filter, treeToList, eachTree, isEmpty, isServer, formatToDate, isMap as isMap$2, findNodeAll, getViewportOffset, isNullAndUnDef, dataURLtoBlob, deepMergeObjects } from "@shy-plugins/utils";
4
+ import { useAttrs as useAttrs$1, useRuleFormItem, useTimeoutFn as useTimeoutFn$2, useScrollTo as useScrollTo$1, useIntersectionObserver, useCopyToClipboard, useMessage, usePagination as usePagination$2, useDesign as useDesign$1, useI18n as useI18n$1, useSortable, createContext as createContext$1, useContext as useContext$2, useBreakpoint, useContentHeight, useWindowSizeFn as useWindowSizeFn$1, onMountedOrActivated, useEventListener as useEventListener$1 } from "@shy-plugins/use";
5
5
  import { zxcvbn } from "@zxcvbn-ts/core";
6
6
  import Iconify from "@purge-icons/generated";
7
7
  import dayjs from "dayjs";
@@ -7273,7 +7273,7 @@ function useTransition(source, options = {}) {
7273
7273
  }
7274
7274
  const _hoisted_1$u = { class: "flex justify-between" };
7275
7275
  const _hoisted_2$a = { key: 0 };
7276
- const _hoisted_3$7 = { class: "flex flex-wrap px-2" };
7276
+ const _hoisted_3$8 = { class: "flex flex-wrap px-2" };
7277
7277
  const _hoisted_4$5 = ["onClick", "title"];
7278
7278
  const _hoisted_5$4 = {
7279
7279
  key: 0,
@@ -7392,7 +7392,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
7392
7392
  unref(getPaginationList).length ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
7393
7393
  createVNode(unref(ScrollContainer$1), { class: "border border-solid border-t-0" }, {
7394
7394
  default: withCtx(() => [
7395
- createElementVNode("ul", _hoisted_3$7, [
7395
+ createElementVNode("ul", _hoisted_3$8, [
7396
7396
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getPaginationList), (icon) => {
7397
7397
  return openBlock(), createElementBlock("li", {
7398
7398
  key: icon,
@@ -7612,2284 +7612,2307 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
7612
7612
  };
7613
7613
  }
7614
7614
  });
7615
- const _hoisted_1$t = { key: 1 };
7616
- const _hoisted_2$9 = {
7617
- key: 0,
7618
- class: "table-children-required"
7619
- };
7620
- const _hoisted_3$6 = { class: "text-red-500" };
7621
- const _hoisted_4$4 = {
7622
- key: 0,
7623
- class: "table-children-delete-index"
7624
- };
7625
- const _hoisted_5$3 = ["onClick"];
7626
- const _hoisted_6$1 = {
7627
- key: 2,
7628
- class: "table-children-delete-index"
7615
+ const validColors = ["error", "warning", "success", ""];
7616
+ const buttonProps = {
7617
+ color: {
7618
+ type: String,
7619
+ validator: (v) => validColors.includes(v),
7620
+ default: ""
7621
+ },
7622
+ loading: { type: Boolean },
7623
+ disabled: { type: Boolean },
7624
+ /**
7625
+ * Text before icon.
7626
+ */
7627
+ preIcon: { type: String },
7628
+ /**
7629
+ * Text after icon.
7630
+ */
7631
+ postIcon: { type: String },
7632
+ /**
7633
+ * preIcon and postIcon icon size.
7634
+ * @default: 14
7635
+ */
7636
+ iconSize: { type: Number, default: 14 },
7637
+ onClick: { type: Function, default: null }
7629
7638
  };
7639
+ const __default__$3 = defineComponent({
7640
+ name: "AButton",
7641
+ extends: Button$1,
7642
+ inheritAttrs: false
7643
+ });
7630
7644
  const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7631
- __name: "Table",
7645
+ ...__default__$3,
7646
+ props: buttonProps,
7647
+ setup(__props) {
7648
+ const props2 = __props;
7649
+ const attrs = useAttrs$1({ excludeDefaultKeys: false });
7650
+ const getButtonClass = computed(() => {
7651
+ const { color, disabled } = props2;
7652
+ return [
7653
+ {
7654
+ [`ant-btn-${color}`]: !!color,
7655
+ [`is-disabled`]: disabled
7656
+ }
7657
+ ];
7658
+ });
7659
+ const getBindValue = computed(() => ({ ...unref(attrs), ...props2 }));
7660
+ return (_ctx, _cache) => {
7661
+ return openBlock(), createBlock(unref(Button$1), mergeProps(getBindValue.value, {
7662
+ class: getButtonClass.value,
7663
+ onClick: props2.onClick
7664
+ }), {
7665
+ default: withCtx((data) => [
7666
+ props2.preIcon ? (openBlock(), createBlock(unref(Icon2), {
7667
+ key: 0,
7668
+ icon: props2.preIcon,
7669
+ size: props2.iconSize
7670
+ }, null, 8, ["icon", "size"])) : createCommentVNode("", true),
7671
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(data || {}))),
7672
+ props2.postIcon ? (openBlock(), createBlock(unref(Icon2), {
7673
+ key: 1,
7674
+ icon: props2.postIcon,
7675
+ size: props2.iconSize
7676
+ }, null, 8, ["icon", "size"])) : createCommentVNode("", true)
7677
+ ]),
7678
+ _: 3
7679
+ }, 16, ["class", "onClick"]);
7680
+ };
7681
+ }
7682
+ });
7683
+ const props$7 = {
7684
+ /**
7685
+ * Whether to enable the drop-down menu
7686
+ * @default: true
7687
+ */
7688
+ enable: {
7689
+ type: Boolean,
7690
+ default: true
7691
+ }
7692
+ };
7693
+ const _sfc_main$14 = defineComponent({
7694
+ name: "PopButton",
7695
+ inheritAttrs: false,
7696
+ props: props$7,
7697
+ setup(props2, { slots }) {
7698
+ const attrs = useAttrs$1();
7699
+ const getBindValues = computed(() => {
7700
+ return Object.assign(
7701
+ {
7702
+ okText: "确定",
7703
+ cancelText: "取消"
7704
+ },
7705
+ { ...props2, ...unref(attrs) }
7706
+ );
7707
+ });
7708
+ return () => {
7709
+ const bindValues = omit$1(unref(getBindValues), "icon");
7710
+ const btnBind = omit$1(bindValues, "title");
7711
+ if (btnBind.disabled)
7712
+ btnBind.color = "";
7713
+ const Button2 = h(_sfc_main$15, btnBind, extendSlots$1(slots));
7714
+ if (!props2.enable) {
7715
+ return Button2;
7716
+ }
7717
+ return h(Popconfirm, bindValues, { default: () => Button2 });
7718
+ };
7719
+ }
7720
+ });
7721
+ const Button = withInstall$5(_sfc_main$15);
7722
+ const _hoisted_1$t = { class: "ml-1" };
7723
+ const _hoisted_2$9 = { class: "ml-1" };
7724
+ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
7725
+ __name: "Dropdown",
7632
7726
  props: {
7633
- rowKey: {
7634
- type: String,
7635
- default: () => "uuid"
7727
+ popconfirm: Boolean,
7728
+ /**
7729
+ * the trigger mode which executes the drop-down action
7730
+ * @default ['hover']
7731
+ * @type string[]
7732
+ */
7733
+ trigger: {
7734
+ type: [Array],
7735
+ default: () => {
7736
+ return ["contextmenu"];
7737
+ }
7636
7738
  },
7637
- columns: {
7739
+ dropMenuList: {
7638
7740
  type: Array,
7639
7741
  default: () => []
7640
7742
  },
7641
- value: {
7743
+ selectedKeys: {
7642
7744
  type: Array,
7643
7745
  default: () => []
7644
- },
7645
- isShowAction: {
7646
- type: Boolean,
7647
- default: () => true
7648
7746
  }
7649
7747
  },
7650
- emits: ["update:value", "change", "add", "remove"],
7651
- setup(__props, { expose: __expose, emit: __emit }) {
7652
- const formActionType = inject("formActionType");
7653
- const emit = __emit;
7748
+ emits: ["menuEvent"],
7749
+ setup(__props, { emit: __emit }) {
7750
+ const ADropdown = Dropdown;
7751
+ const AMenu = Menu;
7752
+ const AMenuItem = Menu.Item;
7753
+ const AMenuDivider = Menu.Divider;
7754
+ const APopconfirm = Popconfirm;
7654
7755
  const props2 = __props;
7655
- const emitData = ref([]);
7656
- const [state] = useRuleFormItem(props2, "value", "change", emitData);
7657
- const getColumns = computed(() => {
7658
- const indexColumn = {
7659
- title: "序号",
7660
- dataIndex: "index",
7661
- customRender: ({ index: index2 }) => {
7662
- return `${index2 + 1}`;
7663
- },
7664
- width: 50,
7665
- align: "center"
7756
+ const emit = __emit;
7757
+ function handleClickMenu(item) {
7758
+ var _a2;
7759
+ const { event } = item;
7760
+ const menu = props2.dropMenuList.find((item2) => `${item2.event}` === `${event}`);
7761
+ emit("menuEvent", menu);
7762
+ (_a2 = item.onClick) == null ? void 0 : _a2.call(item);
7763
+ }
7764
+ const getPopConfirmAttrs = computed(() => {
7765
+ return (attrs) => {
7766
+ const originAttrs = omit$1(attrs, ["confirm", "cancel", "icon"]);
7767
+ if (!attrs.onConfirm && attrs.confirm && isFunction$4(attrs.confirm))
7768
+ originAttrs["onConfirm"] = attrs.confirm;
7769
+ if (!attrs.onCancel && attrs.cancel && isFunction$4(attrs.cancel))
7770
+ originAttrs["onCancel"] = attrs.cancel;
7771
+ return originAttrs;
7666
7772
  };
7667
- return [
7668
- indexColumn,
7669
- ...props2.columns.map((item) => ({
7670
- ...item,
7671
- type: item.type ? item.type : "input"
7672
- }))
7673
- ];
7674
7773
  });
7675
- const plusClickEvent = () => {
7676
- state.value = [{ [props2.rowKey]: buildUUID() }, ...toRaw(state.value)];
7677
- emit("add", state.value);
7678
- };
7679
- const rowClickEvent = (index2) => {
7680
- const tempState = state.value.filter((item) => {
7681
- return item[props2.rowKey] !== index2;
7682
- });
7683
- tempState.forEach((item) => item[props2.rowKey] = buildUUID());
7684
- state.value = [...tempState];
7685
- emit("remove", state.value, index2);
7774
+ const getAttr = (key2) => ({ key: key2 });
7775
+ return (_ctx, _cache) => {
7776
+ return openBlock(), createBlock(unref(ADropdown), mergeProps({ trigger: __props.trigger }, _ctx.$attrs), {
7777
+ overlay: withCtx(() => [
7778
+ createVNode(unref(AMenu), { selectedKeys: __props.selectedKeys }, {
7779
+ default: withCtx(() => [
7780
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropMenuList, (item) => {
7781
+ return openBlock(), createElementBlock(Fragment, {
7782
+ key: `${item.event}`
7783
+ }, [
7784
+ createVNode(unref(AMenuItem), mergeProps({ ref_for: true }, getAttr(item.event), {
7785
+ onClick: ($event) => handleClickMenu(item),
7786
+ disabled: item.disabled
7787
+ }), {
7788
+ default: withCtx(() => [
7789
+ __props.popconfirm && item.popConfirm ? (openBlock(), createBlock(unref(APopconfirm), mergeProps({
7790
+ key: 0,
7791
+ ref_for: true
7792
+ }, getPopConfirmAttrs.value(item.popConfirm)), createSlots({
7793
+ default: withCtx(() => [
7794
+ createElementVNode("div", null, [
7795
+ item.icon ? (openBlock(), createBlock(unref(Icon2), {
7796
+ key: 0,
7797
+ icon: item.icon
7798
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
7799
+ createElementVNode("span", _hoisted_1$t, toDisplayString(item.text), 1)
7800
+ ])
7801
+ ]),
7802
+ _: 2
7803
+ }, [
7804
+ item.popConfirm.icon ? {
7805
+ name: "icon",
7806
+ fn: withCtx(() => [
7807
+ createVNode(unref(Icon2), {
7808
+ icon: item.popConfirm.icon
7809
+ }, null, 8, ["icon"])
7810
+ ]),
7811
+ key: "0"
7812
+ } : void 0
7813
+ ]), 1040)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7814
+ item.icon ? (openBlock(), createBlock(unref(Icon2), {
7815
+ key: 0,
7816
+ icon: item.icon
7817
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
7818
+ createElementVNode("span", _hoisted_2$9, toDisplayString(item.text), 1)
7819
+ ], 64))
7820
+ ]),
7821
+ _: 2
7822
+ }, 1040, ["onClick", "disabled"]),
7823
+ item.divider ? (openBlock(), createBlock(unref(AMenuDivider), {
7824
+ key: `d-${item.event}`
7825
+ })) : createCommentVNode("", true)
7826
+ ], 64);
7827
+ }), 128))
7828
+ ]),
7829
+ _: 1
7830
+ }, 8, ["selectedKeys"])
7831
+ ]),
7832
+ default: withCtx(() => [
7833
+ createElementVNode("span", null, [
7834
+ renderSlot(_ctx.$slots, "default")
7835
+ ])
7836
+ ]),
7837
+ _: 3
7838
+ }, 16, ["trigger"]);
7686
7839
  };
7687
- const getPopupContainer2 = () => document.body;
7688
- const rulesRef = reactive({});
7689
- const getRules = ({ column, record, index: index2, ...args }) => {
7690
- var _a2, _b;
7691
- const errKey = `${column.dataIndex}-${record.uuid}Info`;
7692
- if (!column.required && !column.rules)
7693
- return [];
7694
- if ((_a2 = rulesRef[errKey]) == null ? void 0 : _a2.rules)
7695
- return (_b = rulesRef[errKey]) == null ? void 0 : _b.rules;
7696
- rulesRef[errKey] = {
7697
- rules: [],
7698
- show: false,
7699
- msg: ""
7700
- };
7701
- if (!column.rules && column.required) {
7702
- rulesRef[errKey].rules = [
7703
- {
7704
- required: true,
7705
- validator: (rule, value) => {
7706
- const prefix = column.type.toLocaleLowerCase().includes("input") ? "请输入" : "请选择";
7707
- const errMsg = `${prefix}${column.title}`;
7708
- if (value) {
7709
- rulesRef[errKey].show = false;
7710
- return Promise.resolve();
7711
- }
7712
- rulesRef[errKey].show = true;
7713
- rulesRef[errKey].msg = errMsg;
7714
- return Promise.reject(errMsg);
7715
- }
7716
- }
7717
- ];
7718
- return rulesRef[errKey].rules;
7840
+ }
7841
+ });
7842
+ const key$3 = Symbol("basic-table");
7843
+ function createTableContext(instance) {
7844
+ provide(key$3, instance);
7845
+ }
7846
+ function useTableContext() {
7847
+ return inject(key$3);
7848
+ }
7849
+ const componentSetting = {
7850
+ // basic-table setting
7851
+ table: {
7852
+ // Form interface request general configuration
7853
+ // support xxx.xxx.xxx
7854
+ fetchSetting: {
7855
+ // The field name of the current page passed to the background
7856
+ pageField: "current",
7857
+ // The number field name of each page displayed in the background
7858
+ sizeField: "size",
7859
+ // Field name of the form data returned by the interface
7860
+ listField: "records",
7861
+ // Total number of tables returned by the interface field name
7862
+ totalField: "total"
7863
+ },
7864
+ // Number of pages that can be selected
7865
+ pageSizeOptions: ["10", "50", "80", "100"],
7866
+ // Default display quantity on one page
7867
+ defaultPageSize: 10,
7868
+ // Default Size
7869
+ defaultSize: "middle",
7870
+ // Custom general sort function
7871
+ defaultSortFn: (sortInfo) => {
7872
+ const { field, order } = sortInfo;
7873
+ if (field && order) {
7874
+ return {
7875
+ // The sort field passed to the backend you
7876
+ sort: field,
7877
+ // Sorting method passed to the background asc/desc
7878
+ order: order === "ascend" ? "asc" : "desc"
7879
+ };
7880
+ } else {
7881
+ return {};
7719
7882
  }
7720
- if (!isArray$2(column.rules))
7721
- return column.rules;
7722
- rulesRef[errKey].rules = cloneDeep(column.rules);
7723
- rulesRef[errKey].rules.forEach((item) => {
7724
- if (!item.validator || !isFunction$4(item.validator))
7725
- return;
7726
- const validator = item.validator;
7727
- item.validator = async (rule, value) => {
7728
- try {
7729
- rulesRef[errKey].show = false;
7730
- return await validator(
7731
- rule,
7732
- value,
7733
- { column, record, ...args },
7734
- formActionType
7735
- );
7736
- } catch (error2) {
7737
- rulesRef[errKey].show = true;
7738
- rulesRef[errKey].msg = error2;
7739
- return Promise.reject(error2);
7740
- }
7883
+ },
7884
+ // Custom general filter function
7885
+ defaultFilterFn: (data) => {
7886
+ return data;
7887
+ }
7888
+ },
7889
+ // scrollbar setting
7890
+ scrollbar: {
7891
+ // Whether to use native scroll bar
7892
+ // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
7893
+ native: false
7894
+ },
7895
+ tree: {
7896
+ searchToolbar: false
7897
+ }
7898
+ };
7899
+ const { table } = componentSetting;
7900
+ const {
7901
+ pageSizeOptions,
7902
+ defaultPageSize,
7903
+ fetchSetting,
7904
+ defaultSize,
7905
+ defaultSortFn,
7906
+ defaultFilterFn
7907
+ } = table;
7908
+ const ROW_KEY = "key";
7909
+ const PAGE_SIZE_OPTIONS = pageSizeOptions;
7910
+ const PAGE_SIZE = defaultPageSize;
7911
+ const FETCH_SETTING = fetchSetting;
7912
+ const DEFAULT_SIZE = defaultSize;
7913
+ const DEFAULT_SORT_FN = defaultSortFn;
7914
+ const DEFAULT_FILTER_FN = defaultFilterFn;
7915
+ let DEFAULT_ALIGN = "left";
7916
+ const INDEX_COLUMN_FLAG = "INDEX";
7917
+ const ACTION_COLUMN_FLAG = "ACTION";
7918
+ const ACTION_COLUMN_WIDTH = 160;
7919
+ const setConstConfig = (config) => {
7920
+ DEFAULT_ALIGN = config.align;
7921
+ };
7922
+ const __default__$2 = {
7923
+ name: "TableAction"
7924
+ };
7925
+ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
7926
+ ...__default__$2,
7927
+ props: {
7928
+ actions: {
7929
+ type: Array,
7930
+ default: null
7931
+ },
7932
+ dropDownActions: {
7933
+ type: Array,
7934
+ default: null
7935
+ },
7936
+ divider: {
7937
+ type: Boolean,
7938
+ default: true
7939
+ },
7940
+ outside: {
7941
+ type: Boolean
7942
+ },
7943
+ stopButtonPropagation: {
7944
+ type: Boolean,
7945
+ default: false
7946
+ },
7947
+ showCount: {
7948
+ type: Number,
7949
+ default: () => 3
7950
+ }
7951
+ },
7952
+ setup(__props) {
7953
+ const props2 = __props;
7954
+ const { prefixCls: prefixCls2 } = useDesign$1("basic-table-action");
7955
+ let table2 = {};
7956
+ if (!props2.outside) {
7957
+ table2 = useTableContext();
7958
+ }
7959
+ function isIfShow(action) {
7960
+ const ifShow = action.ifShow;
7961
+ let isIfShow2 = true;
7962
+ if (isBoolean(ifShow)) {
7963
+ isIfShow2 = ifShow;
7964
+ }
7965
+ if (isNumber$2(ifShow) || isString$3(ifShow)) {
7966
+ isIfShow2 = !!ifShow;
7967
+ }
7968
+ if (isFunction$4(ifShow)) {
7969
+ isIfShow2 = ifShow(action);
7970
+ }
7971
+ return isIfShow2;
7972
+ }
7973
+ const getActions = computed(() => {
7974
+ const cacheActions = [];
7975
+ return (toRaw(props2.actions) || []).filter((action, _) => {
7976
+ if (isIfShow(action) && cacheActions.length < props2.showCount - (props2.actions.length !== props2.showCount ? 1 : 0)) {
7977
+ cacheActions.push(action);
7978
+ return true;
7979
+ } else
7980
+ return false;
7981
+ }).map((action) => {
7982
+ const { popConfirm } = action;
7983
+ return {
7984
+ getPopupContainer: () => document.body,
7985
+ type: "link",
7986
+ size: "small",
7987
+ ...action,
7988
+ ...popConfirm || {},
7989
+ onConfirm: popConfirm == null ? void 0 : popConfirm.confirm,
7990
+ onCancel: popConfirm == null ? void 0 : popConfirm.cancel,
7991
+ enable: !!popConfirm
7741
7992
  };
7742
7993
  });
7743
- return rulesRef[errKey].rules;
7744
- };
7745
- watch(
7746
- () => state.value,
7747
- (v, old) => {
7748
- if (!isEqual(toRaw(v), toRaw(old))) {
7749
- emit(
7750
- "update:value",
7751
- toRaw(v).map((ele) => {
7752
- return {
7753
- ...ele,
7754
- [props2.rowKey]: ele[props2.rowKey] || buildUUID()
7755
- };
7756
- })
7757
- );
7758
- }
7759
- },
7760
- {
7761
- deep: true
7762
- }
7763
- );
7764
- const isScroll = ref(false);
7765
- const timer = ref();
7766
- onMounted(() => {
7767
- window.addEventListener(
7768
- "scroll",
7769
- (e) => {
7770
- clearTimeout(timer.value);
7771
- timer.value = setTimeout(() => {
7772
- isScroll.value = false;
7773
- }, 500);
7774
- if (isScroll.value)
7775
- return;
7776
- isScroll.value = true;
7777
- },
7778
- true
7779
- );
7780
7994
  });
7781
- onUnmounted(() => {
7782
- window.removeEventListener("scroll", () => {
7995
+ const getDropdownList = computed(() => {
7996
+ const cacheActions = [];
7997
+ const list = (toRaw(props2.actions) || []).filter((action, index2) => {
7998
+ if (isIfShow(action) && cacheActions.length < props2.showCount - (props2.actions.length !== props2.showCount ? 1 : 0)) {
7999
+ cacheActions.push(action);
8000
+ return false;
8001
+ } else if (isIfShow(action))
8002
+ return true;
7783
8003
  });
7784
- });
7785
- const loadKv = () => {
7786
- const columns = props2.columns;
7787
- let dicData = [];
7788
- columns.forEach(async (column) => {
7789
- if (column == null ? void 0 : column.api) {
7790
- dicData = await column.api();
7791
- column.dicData = dicData;
7792
- }
8004
+ return list.map((action, index2) => {
8005
+ const { label, popConfirm } = action;
8006
+ return {
8007
+ ...action,
8008
+ ...popConfirm,
8009
+ onConfirm: popConfirm == null ? void 0 : popConfirm.confirm,
8010
+ onCancel: popConfirm == null ? void 0 : popConfirm.cancel,
8011
+ text: label,
8012
+ divider: index2 < list.length - 1 ? props2.divider : false
8013
+ };
7793
8014
  });
7794
- };
7795
- const listFormRefs = ref([]);
7796
- const validate = async () => {
7797
- try {
7798
- for (let formRef of listFormRefs.value) {
7799
- await formRef.validate();
7800
- }
7801
- } catch {
7802
- throw new Error("校验失败");
7803
- }
7804
- };
7805
- loadKv();
7806
- __expose({ validate });
8015
+ });
8016
+ const getAlign = computed(() => {
8017
+ var _a2;
8018
+ const columns = ((_a2 = table2 == null ? void 0 : table2.getColumns) == null ? void 0 : _a2.call(table2)) || [];
8019
+ const actionColumn = columns.find((item) => item.flag === ACTION_COLUMN_FLAG);
8020
+ return (actionColumn == null ? void 0 : actionColumn.align) ?? "left";
8021
+ });
8022
+ function getTooltip(data) {
8023
+ return {
8024
+ getPopupContainer: () => unref(table2 == null ? void 0 : table2.wrapRef.value) ?? document.body,
8025
+ placement: "bottom",
8026
+ ...isString$3(data) ? { title: data } : data
8027
+ };
8028
+ }
8029
+ function onCellClick(e) {
8030
+ if (!props2.stopButtonPropagation)
8031
+ return;
8032
+ const path = e.composedPath();
8033
+ const isInButton = path.find((ele) => {
8034
+ var _a2;
8035
+ return ((_a2 = ele.tagName) == null ? void 0 : _a2.toUpperCase()) === "BUTTON";
8036
+ });
8037
+ isInButton && e.stopPropagation();
8038
+ }
7807
8039
  return (_ctx, _cache) => {
7808
- return openBlock(), createBlock(unref(Table), {
7809
- columns: getColumns.value,
7810
- "data-source": unref(state),
7811
- pagination: false,
7812
- bordered: "",
7813
- size: "small",
7814
- class: "table-children",
7815
- align: "center"
7816
- }, {
7817
- headerCell: withCtx(({ column }) => {
7818
- var _a2;
7819
- return [
7820
- column.dataIndex === "index" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7821
- __props.isShowAction ? (openBlock(), createElementBlock("div", {
7822
- key: 0,
7823
- class: "shy-table-edit-icon-plus",
7824
- onClick: plusClickEvent
7825
- }, [
7826
- createVNode(unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
7827
- ])) : (openBlock(), createElementBlock("div", _hoisted_1$t, "序号"))
7828
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7829
- column.required || ((_a2 = column == null ? void 0 : column.rules) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("span", _hoisted_2$9, "*")) : createCommentVNode("", true),
7830
- createElementVNode("span", null, toDisplayString(column.title), 1)
7831
- ], 64))
7832
- ];
7833
- }),
7834
- bodyCell: withCtx(({ column, record, index: index2, ...args }) => [
7835
- column.dataIndex !== "index" && column.type !== "text" ? (openBlock(), createBlock(unref(FormItem), {
7836
- required: column.required,
7837
- rules: getRules({ column, record, index: index2, ...args }),
7838
- name: [_ctx.$attrs.codeField, index2, column.dataIndex],
7839
- key: record[__props.rowKey]
7840
- }, {
7841
- default: withCtx(() => {
7842
- var _a2;
7843
- return [
7844
- createVNode(unref(Popover), {
7845
- overlayClassName: "table-children-err-popover",
7846
- visible: !!((_a2 = rulesRef == null ? void 0 : rulesRef[`${column.dataIndex}-${record.uuid}Info`]) == null ? void 0 : _a2.show) && !isScroll.value
7847
- }, {
7848
- content: withCtx(() => {
7849
- var _a3;
7850
- return [
7851
- createElementVNode("span", _hoisted_3$6, toDisplayString((_a3 = rulesRef[`${column.dataIndex}-${record.uuid}Info`]) == null ? void 0 : _a3.msg), 1)
7852
- ];
7853
- }),
8040
+ const _component_a_button = resolveComponent("a-button");
8041
+ return openBlock(), createElementBlock("div", {
8042
+ class: normalizeClass([unref(prefixCls2), getAlign.value]),
8043
+ onClick: onCellClick
8044
+ }, [
8045
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getActions.value, (action, index2) => {
8046
+ return openBlock(), createElementBlock(Fragment, {
8047
+ key: `${index2}-${action.label}`
8048
+ }, [
8049
+ action.tooltip ? (openBlock(), createBlock(unref(Tooltip), mergeProps({
8050
+ key: 0,
8051
+ ref_for: true
8052
+ }, getTooltip(action.tooltip)), {
8053
+ default: withCtx(() => [
8054
+ createVNode(unref(_sfc_main$14), mergeProps({ ref_for: true }, action), {
7854
8055
  default: withCtx(() => [
7855
- column.type === "select" ? (openBlock(), createBlock(unref(Select), {
8056
+ action.icon ? (openBlock(), createBlock(unref(Icon2), {
7856
8057
  key: 0,
7857
- value: record[column.dataIndex],
7858
- "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7859
- options: column.dicData,
7860
- mode: column.mode,
7861
- "max-tag-count": column.maxTagCount,
7862
- "max-tag-text-length": column.maxTagTextLength
7863
- }, null, 8, ["value", "onUpdate:value", "options", "mode", "max-tag-count", "max-tag-text-length"])) : column.type === "datePicker" ? (openBlock(), createBlock(unref(DatePicker), {
7864
- key: 1,
7865
- value: record[column.dataIndex],
7866
- "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7867
- valueFormat: "YYYY-MM-DD HH:mm:ss"
7868
- }, null, 8, ["value", "onUpdate:value"])) : column.type === "number" ? (openBlock(), createBlock(unref(InputNumber), {
7869
- key: 2,
7870
- value: record[column.dataIndex],
7871
- "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7872
- min: column.min,
7873
- max: column.max,
7874
- precision: column.precision ?? 2
7875
- }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : column.type === "input" ? (openBlock(), createBlock(unref(Input), {
7876
- key: 3,
7877
- value: record[column.dataIndex],
7878
- "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7879
- disabled: !props2.isShowAction
7880
- }, null, 8, ["value", "onUpdate:value", "disabled"])) : (openBlock(), createBlock(resolveDynamicComponent(unref(componentMap$2).get(column.type)), mergeProps(
7881
- {
7882
- key: 4,
7883
- allowClear: "",
7884
- getPopupContainer: getPopupContainer2,
7885
- style: { width: "100%" }
7886
- },
7887
- unref(isFunction$4)(column.componentProps) ? column.componentProps({ record, column, index: index2, ...args }) : column.componentProps,
7888
- {
7889
- value: record[column.dataIndex],
7890
- "onUpdate:value": ($event) => record[column.dataIndex] = $event
7891
- }
7892
- ), null, 16, ["value", "onUpdate:value"]))
8058
+ icon: action.icon,
8059
+ class: normalizeClass({ "mr-1": !!action.label })
8060
+ }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
8061
+ action.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
8062
+ createTextVNode(toDisplayString(action.label), 1)
8063
+ ], 64)) : createCommentVNode("", true)
7893
8064
  ]),
7894
8065
  _: 2
7895
- }, 1032, ["visible"])
7896
- ];
7897
- }),
7898
- _: 2
7899
- }, 1032, ["required", "rules", "name"])) : column.dataIndex === "index" ? (openBlock(), createElementBlock("div", {
7900
- class: "table-children-delete-wrapper",
7901
- key: record[__props.rowKey]
7902
- }, [
7903
- __props.isShowAction ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
7904
- __props.isShowAction ? (openBlock(), createElementBlock("div", {
8066
+ }, 1040)
8067
+ ]),
8068
+ _: 2
8069
+ }, 1040)) : (openBlock(), createBlock(unref(_sfc_main$14), mergeProps({
7905
8070
  key: 1,
7906
- class: "table-children-delete-item",
7907
- onClick: ($event) => rowClickEvent(record[__props.rowKey])
7908
- }, [
7909
- createVNode(unref(DeleteFilled$1), { style: { color: "#fff" } })
7910
- ], 8, _hoisted_5$3)) : (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(index2 + 1), 1))
7911
- ])) : createCommentVNode("", true)
7912
- ]),
7913
- _: 1
7914
- }, 8, ["columns", "data-source"]);
8071
+ ref_for: true
8072
+ }, action), {
8073
+ default: withCtx(() => [
8074
+ action.icon ? (openBlock(), createBlock(unref(Icon2), {
8075
+ key: 0,
8076
+ icon: action.icon,
8077
+ class: normalizeClass({ "mr-1": !!action.label })
8078
+ }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
8079
+ action.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
8080
+ createTextVNode(toDisplayString(action.label), 1)
8081
+ ], 64)) : createCommentVNode("", true)
8082
+ ]),
8083
+ _: 2
8084
+ }, 1040)),
8085
+ __props.divider && index2 < getActions.value.length - 1 ? (openBlock(), createBlock(unref(Divider$1), {
8086
+ key: 2,
8087
+ type: "vertical",
8088
+ class: "action-divider"
8089
+ })) : createCommentVNode("", true)
8090
+ ], 64);
8091
+ }), 128)),
8092
+ getDropdownList.value.length > 0 ? (openBlock(), createBlock(unref(_sfc_main$13), {
8093
+ key: 0,
8094
+ trigger: ["hover"],
8095
+ dropMenuList: getDropdownList.value,
8096
+ popconfirm: ""
8097
+ }, {
8098
+ default: withCtx(() => [
8099
+ renderSlot(_ctx.$slots, "more"),
8100
+ !_ctx.$slots.more ? (openBlock(), createBlock(_component_a_button, {
8101
+ key: 0,
8102
+ type: "link",
8103
+ size: "small"
8104
+ }, {
8105
+ default: withCtx(() => [
8106
+ createVNode(unref(MoreOutlined$1), { class: "icon-more" })
8107
+ ]),
8108
+ _: 1
8109
+ })) : createCommentVNode("", true)
8110
+ ]),
8111
+ _: 3
8112
+ }, 8, ["dropMenuList"])) : createCommentVNode("", true)
8113
+ ], 2);
7915
8114
  };
7916
8115
  }
7917
8116
  });
7918
- const Table_vue_vue_type_style_index_0_lang = "";
7919
- const modal = "";
7920
- useI18n$1();
7921
- const modalProps = {
7922
- visible: { type: Boolean },
7923
- scrollTop: { type: Boolean, default: true },
7924
- height: { type: Number },
7925
- minHeight: { type: Number },
7926
- // open drag
7927
- draggable: { type: Boolean, default: true },
7928
- centered: { type: Boolean },
7929
- cancelText: { type: String, default: "取消" },
7930
- okText: { type: String, default: "确认" },
7931
- closeFunc: Function
8117
+ const TableAction_vue_vue_type_style_index_0_lang = "";
8118
+ const _hoisted_1$s = { key: 1 };
8119
+ const _hoisted_2$8 = {
8120
+ key: 0,
8121
+ class: "table-children-required"
7932
8122
  };
7933
- const basicProps$6 = Object.assign({}, modalProps, {
7934
- defaultFullscreen: { type: Boolean },
7935
- // Can it be full screen
7936
- canFullscreen: { type: Boolean, default: true },
7937
- // After enabling the wrapper, the bottom can be increased in height
7938
- wrapperFooterOffset: { type: Number, default: 0 },
7939
- // Warm reminder message
7940
- helpMessage: [String, Array],
7941
- // Whether to setting wrapper
7942
- useWrapper: { type: Boolean, default: true },
7943
- loading: { type: Boolean },
7944
- loadingTip: { type: String },
7945
- /**
7946
- * @description: Show close button
7947
- */
7948
- showCancelBtn: { type: Boolean, default: true },
7949
- /**
7950
- * @description: Show confirmation button
7951
- */
7952
- showOkBtn: { type: Boolean, default: true },
7953
- wrapperProps: Object,
7954
- afterClose: Function,
7955
- bodyStyle: Object,
7956
- closable: { type: Boolean, default: true },
7957
- closeIcon: Object,
7958
- confirmLoading: { type: Boolean },
7959
- destroyOnClose: { type: Boolean },
7960
- footer: Object,
7961
- getContainer: Function,
7962
- mask: { type: Boolean, default: true },
7963
- maskClosable: { type: Boolean, default: false },
7964
- keyboard: { type: Boolean, default: true },
7965
- maskStyle: Object,
7966
- okType: { type: String, default: "primary" },
7967
- okButtonProps: Object,
7968
- cancelButtonProps: Object,
7969
- title: { type: String },
7970
- visible: { type: Boolean },
7971
- width: [String, Number],
7972
- wrapClassName: { type: String },
7973
- zIndex: { type: Number }
7974
- });
7975
- function is(val, type) {
7976
- return toString.call(val) === `[object ${type}]`;
7977
- }
7978
- function isFunction$1(val) {
7979
- return typeof val === "function";
7980
- }
7981
- function isObject$1(val) {
7982
- return val !== null && is(val, "Object");
7983
- }
7984
- function isDef(val) {
7985
- return typeof val !== "undefined";
7986
- }
7987
- function isUnDef(val) {
7988
- return !isDef(val);
7989
- }
7990
- function isString$1(val) {
7991
- return is(val, "String");
7992
- }
7993
- function isArray(val) {
7994
- return val && Array.isArray(val);
7995
- }
7996
- function useTimeoutFn(handle, wait, native = false) {
7997
- if (!isFunction$1(handle)) {
7998
- throw new Error("handle is not Function!");
7999
- }
8000
- const { readyRef, stop, start } = useTimeoutRef(wait);
8001
- if (native) {
8002
- handle();
8003
- } else {
8004
- watch(
8005
- readyRef,
8006
- (maturity) => {
8007
- maturity && handle();
8008
- },
8009
- { immediate: false }
8010
- );
8011
- }
8012
- return { readyRef, stop, start };
8013
- }
8014
- function useTimeoutRef(wait) {
8015
- const readyRef = ref(false);
8016
- let timer;
8017
- function stop() {
8018
- readyRef.value = false;
8019
- timer && window.clearTimeout(timer);
8020
- }
8021
- function start() {
8022
- stop();
8023
- timer = setTimeout(() => {
8024
- readyRef.value = true;
8025
- }, wait);
8026
- }
8027
- start();
8028
- tryOnUnmounted(stop);
8029
- return { readyRef, stop, start };
8030
- }
8031
- function useModalDragMove(context) {
8032
- const getStyle = (dom, attr) => {
8033
- return getComputedStyle(dom)[attr];
8034
- };
8035
- const drag = (wrap) => {
8036
- if (!wrap)
8037
- return;
8038
- wrap.setAttribute("data-drag", unref(context.draggable));
8039
- const dialogHeaderEl = wrap.querySelector(".ant-modal-header");
8040
- const dragDom = wrap.querySelector(".ant-modal");
8041
- if (!dialogHeaderEl || !dragDom || !unref(context.draggable))
8042
- return;
8043
- dialogHeaderEl.style.cursor = "move";
8044
- dialogHeaderEl.onmousedown = (e) => {
8045
- if (!e)
8046
- return;
8047
- const disX = e.clientX;
8048
- const disY = e.clientY;
8049
- const screenWidth = document.body.clientWidth;
8050
- const screenHeight = document.documentElement.clientHeight;
8051
- const dragDomWidth = dragDom.offsetWidth;
8052
- const dragDomheight = dragDom.offsetHeight;
8053
- const minDragDomLeft = dragDom.offsetLeft;
8054
- const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
8055
- const minDragDomTop = dragDom.offsetTop;
8056
- const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
8057
- const domLeft = getStyle(dragDom, "left");
8058
- const domTop = getStyle(dragDom, "top");
8059
- let styL = +domLeft;
8060
- let styT = +domTop;
8061
- if (domLeft.includes("%")) {
8062
- styL = +document.body.clientWidth * (+domLeft.replace(/%/g, "") / 100);
8063
- styT = +document.body.clientHeight * (+domTop.replace(/%/g, "") / 100);
8064
- } else {
8065
- styL = +domLeft.replace(/px/g, "");
8066
- styT = +domTop.replace(/px/g, "");
8067
- }
8068
- document.onmousemove = function(e2) {
8069
- let left = e2.clientX - disX;
8070
- let top = e2.clientY - disY;
8071
- if (-left > minDragDomLeft) {
8072
- left = -minDragDomLeft;
8073
- } else if (left > maxDragDomLeft) {
8074
- left = maxDragDomLeft;
8075
- }
8076
- if (-top > minDragDomTop) {
8077
- top = -minDragDomTop;
8078
- } else if (top > maxDragDomTop) {
8079
- top = maxDragDomTop;
8080
- }
8081
- dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
8082
- };
8083
- document.onmouseup = () => {
8084
- document.onmousemove = null;
8085
- document.onmouseup = null;
8086
- };
8087
- };
8088
- };
8089
- const handleDrag = () => {
8090
- const dragWraps = document.querySelectorAll(".ant-modal-wrap");
8091
- for (const wrap of Array.from(dragWraps)) {
8092
- if (!wrap)
8093
- continue;
8094
- const display = getStyle(wrap, "display");
8095
- const draggable = wrap.getAttribute("data-drag");
8096
- if (display !== "none") {
8097
- if (draggable === null || unref(context.destroyOnClose)) {
8098
- drag(wrap);
8099
- }
8100
- }
8101
- }
8102
- };
8103
- watchEffect(() => {
8104
- if (!unref(context.visible) || !unref(context.draggable)) {
8105
- return;
8106
- }
8107
- useTimeoutFn(() => {
8108
- handleDrag();
8109
- }, 30);
8110
- });
8111
- }
8112
- const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
8113
- const LISTENER_PREFIX = /^on[A-Z]/;
8114
- function entries(obj) {
8115
- return Object.keys(obj).map((key2) => [key2, obj[key2]]);
8116
- }
8117
- function useAttrs(params = {}) {
8118
- const instance = getCurrentInstance();
8119
- if (!instance)
8120
- return {};
8121
- const {
8122
- excludeListeners = false,
8123
- excludeKeys = [],
8124
- excludeDefaultKeys = true
8125
- } = params;
8126
- const attrs = shallowRef({});
8127
- const allExcludeKeys = excludeKeys.concat(
8128
- excludeDefaultKeys ? DEFAULT_EXCLUDE_KEYS : []
8129
- );
8130
- instance.attrs = reactive(instance.attrs);
8131
- watchEffect(() => {
8132
- const res = entries(instance.attrs).reduce((acm, [key2, val]) => {
8133
- if (!allExcludeKeys.includes(key2) && !(excludeListeners && LISTENER_PREFIX.test(key2))) {
8134
- acm[key2] = val;
8135
- }
8136
- return acm;
8137
- }, {});
8138
- attrs.value = res;
8139
- });
8140
- return attrs;
8141
- }
8142
- function getSlot(slots, slot = "default", data) {
8143
- if (!slots || !Reflect.has(slots, slot)) {
8144
- return null;
8145
- }
8146
- if (!isFunction$1(slots[slot])) {
8147
- console.error(`${slot} is not a function!`);
8148
- return null;
8149
- }
8150
- const slotFn = slots[slot];
8151
- if (!slotFn)
8152
- return null;
8153
- return slotFn(data);
8154
- }
8155
- function extendSlots(slots, excludeKeys = []) {
8156
- const slotKeys = Object.keys(slots);
8157
- const ret = {};
8158
- slotKeys.map((key2) => {
8159
- if (excludeKeys.includes(key2)) {
8160
- return null;
8161
- }
8162
- ret[key2] = (data) => getSlot(slots, key2, data);
8163
- });
8164
- return ret;
8165
- }
8166
- function _isSlot$3(s) {
8167
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
8168
- }
8169
- const Modal$1 = /* @__PURE__ */ defineComponent({
8170
- name: "Modal",
8171
- inheritAttrs: false,
8172
- props: basicProps$6,
8173
- emits: ["cancel"],
8174
- setup(props2, {
8175
- slots,
8176
- emit
8177
- }) {
8178
- const {
8179
- visible,
8180
- draggable,
8181
- destroyOnClose
8182
- } = toRefs(props2);
8183
- const attrs = useAttrs();
8184
- useModalDragMove({
8185
- visible,
8186
- destroyOnClose,
8187
- draggable
8188
- });
8189
- const onCancel = (e) => {
8190
- emit("cancel", e);
8191
- };
8192
- return () => {
8193
- let _slot;
8194
- const propsData = {
8195
- ...unref(attrs),
8196
- ...props2,
8197
- onCancel
8198
- };
8199
- return createVNode(Modal$2, propsData, _isSlot$3(_slot = extendSlots(slots)) ? _slot : {
8200
- default: () => [_slot]
8201
- });
8202
- };
8203
- }
8204
- });
8205
- function useWindowSizeFn(fn, wait = 150, options) {
8206
- let handler = () => {
8207
- fn();
8208
- };
8209
- const handleSize = useDebounceFn$1(handler, wait);
8210
- handler = handleSize;
8211
- const start = () => {
8212
- if (options && options.immediate) {
8213
- handler();
8214
- }
8215
- window.addEventListener("resize", handler);
8216
- };
8217
- const stop = () => {
8218
- window.removeEventListener("resize", handler);
8219
- };
8220
- tryOnMounted(() => {
8221
- start();
8222
- });
8223
- tryOnUnmounted(() => {
8224
- stop();
8225
- });
8226
- return [start, stop];
8227
- }
8228
- const easeInOutQuad = (t2, b, c, d) => {
8229
- t2 /= d / 2;
8230
- if (t2 < 1) {
8231
- return c / 2 * t2 * t2 + b;
8232
- }
8233
- t2--;
8234
- return -c / 2 * (t2 * (t2 - 2) - 1) + b;
8235
- };
8236
- const move = (el, amount) => {
8237
- el.scrollTop = amount;
8238
- };
8239
- const position = (el) => {
8240
- return el.scrollTop;
8241
- };
8242
- function useScrollTo({
8243
- el,
8244
- to,
8245
- duration = 500,
8246
- callback
8247
- }) {
8248
- const isActiveRef = ref(false);
8249
- const start = position(el);
8250
- const change3 = to - start;
8251
- const increment = 20;
8252
- let currentTime = 0;
8253
- duration = isUnDef(duration) ? 500 : duration;
8254
- const animateScroll = function() {
8255
- if (!unref(isActiveRef)) {
8256
- return;
8257
- }
8258
- currentTime += increment;
8259
- const val = easeInOutQuad(currentTime, start, change3, duration);
8260
- move(el, val);
8261
- if (currentTime < duration && unref(isActiveRef)) {
8262
- requestAnimationFrame(animateScroll);
8263
- } else {
8264
- if (callback && isFunction$1(callback)) {
8265
- callback();
8266
- }
8267
- }
8268
- };
8269
- const run = () => {
8270
- isActiveRef.value = true;
8271
- animateScroll();
8272
- };
8273
- const stop = () => {
8274
- isActiveRef.value = false;
8275
- };
8276
- return { start: run, stop };
8277
- }
8278
- const _sfc_main$14 = defineComponent({
8279
- name: "ScrollContainer",
8280
- components: { Scrollbar },
8281
- setup() {
8282
- const scrollbarRef = ref(null);
8283
- function scrollTo(to, duration = 500) {
8284
- const scrollbar = unref(scrollbarRef);
8285
- if (!scrollbar) {
8286
- return;
8287
- }
8288
- nextTick(() => {
8289
- const wrap = unref(scrollbar.wrap);
8290
- if (!wrap) {
8291
- return;
8292
- }
8293
- const { start } = useScrollTo({
8294
- el: wrap,
8295
- to,
8296
- duration
8297
- });
8298
- start();
8299
- });
8300
- }
8301
- function getScrollWrap() {
8302
- const scrollbar = unref(scrollbarRef);
8303
- if (!scrollbar) {
8304
- return null;
8305
- }
8306
- return scrollbar.wrap;
8307
- }
8308
- function scrollBottom() {
8309
- const scrollbar = unref(scrollbarRef);
8310
- if (!scrollbar) {
8311
- return;
8312
- }
8313
- nextTick(() => {
8314
- const wrap = unref(scrollbar.wrap);
8315
- if (!wrap) {
8316
- return;
8317
- }
8318
- const scrollHeight = wrap.scrollHeight;
8319
- const { start } = useScrollTo({
8320
- el: wrap,
8321
- to: scrollHeight
8322
- });
8323
- start();
8324
- });
8325
- }
8326
- return {
8327
- scrollbarRef,
8328
- scrollTo,
8329
- scrollBottom,
8330
- getScrollWrap
8331
- };
8332
- }
8333
- });
8334
- const ScrollContainer_vue_vue_type_style_index_0_lang = "";
8335
- function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
8336
- const _component_Scrollbar = resolveComponent("Scrollbar");
8337
- return openBlock(), createBlock(_component_Scrollbar, mergeProps({
8338
- ref: "scrollbarRef",
8339
- class: "scroll-container"
8340
- }, _ctx.$attrs), {
8341
- default: withCtx(() => [
8342
- renderSlot(_ctx.$slots, "default")
8343
- ]),
8344
- _: 3
8345
- }, 16);
8346
- }
8347
- const ScrollContainer = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$D]]);
8348
- function createContext(context, key2 = Symbol(), options = {}) {
8349
- const { readonly: readonly$1 = true, createProvider = false, native = false } = options;
8350
- const state = reactive(context);
8351
- const provideData = readonly$1 ? readonly(state) : state;
8352
- !createProvider && provide(key2, native ? context : provideData);
8353
- return {
8354
- state
8355
- };
8356
- }
8357
- function useContext$1(key2 = Symbol(), defaultValue) {
8358
- return inject(key2, defaultValue || {});
8359
- }
8360
- const key$3 = Symbol();
8361
- function createModalContext(context) {
8362
- return createContext(context, key$3);
8363
- }
8364
- function useModalContext() {
8365
- return useContext$1(key$3);
8366
- }
8367
- const props$7 = {
8368
- loading: { type: Boolean },
8369
- useWrapper: { type: Boolean, default: true },
8370
- modalHeaderHeight: { type: Number, default: 57 },
8371
- modalFooterHeight: { type: Number, default: 74 },
8372
- minHeight: { type: Number, default: 200 },
8373
- height: { type: Number },
8374
- footerOffset: { type: Number, default: 0 },
8375
- visible: { type: Boolean },
8376
- fullScreen: { type: Boolean },
8377
- loadingTip: { type: String }
8378
- };
8379
- const _sfc_main$13 = defineComponent({
8380
- name: "ModalWrapper",
8381
- components: { ScrollContainer },
8382
- inheritAttrs: false,
8383
- props: props$7,
8384
- emits: ["height-change", "ext-height"],
8385
- setup(props2, { emit }) {
8386
- const wrapperRef = ref(null);
8387
- const spinRef = ref(null);
8388
- const realHeightRef = ref(0);
8389
- const minRealHeightRef = ref(0);
8390
- let realHeight = 0;
8391
- useWindowSizeFn(setModalHeight.bind(null, false));
8392
- useMutationObserver(
8393
- spinRef,
8394
- () => {
8395
- setModalHeight();
8396
- },
8397
- {
8398
- attributes: true,
8399
- subtree: true
8400
- }
8401
- );
8402
- createModalContext({
8403
- redoModalHeight: setModalHeight
8404
- });
8405
- const spinStyle = computed(() => {
8406
- return {
8407
- minHeight: `${props2.minHeight}px`,
8408
- [props2.fullScreen ? "height" : "maxHeight"]: `${unref(realHeightRef)}px`
8409
- };
8410
- });
8411
- watchEffect(() => {
8412
- props2.useWrapper && setModalHeight();
8413
- });
8414
- watch(
8415
- () => props2.fullScreen,
8416
- (v) => {
8417
- setModalHeight();
8418
- if (!v) {
8419
- realHeightRef.value = minRealHeightRef.value;
8420
- } else {
8421
- minRealHeightRef.value = realHeightRef.value;
8422
- }
8423
- }
8424
- );
8425
- onMounted(() => {
8426
- const { modalHeaderHeight, modalFooterHeight } = props2;
8427
- emit("ext-height", modalHeaderHeight + modalFooterHeight);
8428
- });
8429
- onUnmounted(() => {
8430
- });
8431
- async function scrollTop() {
8432
- nextTick(() => {
8433
- var _a2;
8434
- const wrapperRefDom = unref(wrapperRef);
8435
- if (!wrapperRefDom)
8436
- return;
8437
- (_a2 = wrapperRefDom == null ? void 0 : wrapperRefDom.scrollTo) == null ? void 0 : _a2.call(wrapperRefDom, 0);
8438
- });
8439
- }
8440
- async function setModalHeight() {
8441
- if (!props2.visible)
8442
- return;
8443
- const wrapperRefDom = unref(wrapperRef);
8444
- if (!wrapperRefDom)
8445
- return;
8446
- const bodyDom = wrapperRefDom.$el.parentElement;
8447
- if (!bodyDom)
8448
- return;
8449
- bodyDom.style.padding = "0";
8450
- await nextTick();
8451
- try {
8452
- const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
8453
- if (!modalDom)
8454
- return;
8455
- const modalRect = getComputedStyle(modalDom).top;
8456
- const modalTop = Number.parseInt(modalRect);
8457
- let maxHeight = window.innerHeight - modalTop * 2 + (props2.footerOffset || 0) - props2.modalFooterHeight - props2.modalHeaderHeight;
8458
- if (modalTop < 40) {
8459
- maxHeight -= 26;
8460
- }
8461
- await nextTick();
8462
- const spinEl = unref(spinRef);
8463
- if (!spinEl)
8464
- return;
8465
- await nextTick();
8466
- realHeight = spinEl.scrollHeight;
8467
- if (props2.fullScreen) {
8468
- realHeightRef.value = window.innerHeight - props2.modalFooterHeight - props2.modalHeaderHeight - 28;
8469
- } else {
8470
- realHeightRef.value = props2.height ? props2.height : realHeight > maxHeight ? maxHeight : realHeight;
8471
- }
8472
- emit("height-change", unref(realHeightRef));
8473
- } catch (error2) {
8474
- }
8475
- }
8476
- return { wrapperRef, spinRef, spinStyle, scrollTop, setModalHeight };
8477
- }
8478
- });
8479
- const _hoisted_1$s = ["loading-tip"];
8480
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
8481
- const _component_ScrollContainer = resolveComponent("ScrollContainer");
8482
- return openBlock(), createBlock(_component_ScrollContainer, { ref: "wrapperRef" }, {
8483
- default: withCtx(() => [
8484
- createElementVNode("div", {
8485
- ref: "spinRef",
8486
- style: normalizeStyle(_ctx.spinStyle),
8487
- "loading-tip": _ctx.loadingTip
8488
- }, [
8489
- renderSlot(_ctx.$slots, "default")
8490
- ], 12, _hoisted_1$s)
8491
- ]),
8492
- _: 3
8493
- }, 512);
8494
- }
8495
- const ModalWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$C]]);
8496
- function getKey$1(namespace, key2) {
8497
- if (!namespace) {
8498
- return key2;
8499
- }
8500
- if (key2.startsWith(namespace)) {
8501
- return key2;
8502
- }
8503
- return `${namespace}.${key2}`;
8504
- }
8505
- function useI18n(namespace) {
8506
- const normalFn = {
8507
- t: (key2) => {
8508
- return getKey$1(namespace, key2);
8509
- }
8510
- };
8511
- {
8512
- return normalFn;
8513
- }
8514
- }
8515
- const _sfc_main$12 = defineComponent({
8516
- name: "ModalClose",
8517
- components: {
8518
- Tooltip,
8519
- FullscreenExitOutlined: FullscreenExitOutlined$1,
8520
- FullscreenOutlined: FullscreenOutlined$1,
8521
- CloseOutlined: CloseOutlined$1
8522
- },
8523
- props: {
8524
- canFullscreen: { type: Boolean, default: true },
8525
- fullScreen: { type: Boolean }
8526
- },
8527
- emits: ["cancel", "fullscreen"],
8528
- setup(props2, { emit }) {
8529
- const prefixCls2 = "shy-basic-modal-close";
8530
- const { t: t2 } = useI18n();
8531
- const getClass = computed(() => {
8532
- return [
8533
- prefixCls2,
8534
- `${prefixCls2}--custom`,
8535
- {
8536
- [`${prefixCls2}--can-full`]: props2.canFullscreen
8537
- }
8538
- ];
8539
- });
8540
- function handleCancel(e) {
8541
- emit("cancel", e);
8542
- }
8543
- function handleFullScreen(e) {
8544
- e == null ? void 0 : e.stopPropagation();
8545
- e == null ? void 0 : e.preventDefault();
8546
- emit("fullscreen");
8547
- }
8548
- return {
8549
- t: t2,
8550
- getClass,
8551
- prefixCls: prefixCls2,
8552
- handleCancel,
8553
- handleFullScreen
8554
- };
8555
- }
8556
- });
8557
- const ModalClose_vue_vue_type_style_index_0_lang = "";
8558
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
8559
- const _component_FullscreenExitOutlined = resolveComponent("FullscreenExitOutlined");
8560
- const _component_Tooltip = resolveComponent("Tooltip");
8561
- const _component_FullscreenOutlined = resolveComponent("FullscreenOutlined");
8562
- const _component_CloseOutlined = resolveComponent("CloseOutlined");
8563
- return openBlock(), createElementBlock("div", {
8564
- class: normalizeClass(_ctx.getClass)
8565
- }, [
8566
- _ctx.canFullscreen ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
8567
- _ctx.fullScreen ? (openBlock(), createBlock(_component_Tooltip, {
8568
- key: 0,
8569
- title: "还原",
8570
- placement: "bottom"
8571
- }, {
8572
- default: withCtx(() => [
8573
- createVNode(_component_FullscreenExitOutlined, {
8574
- role: "full",
8575
- onClick: _ctx.handleFullScreen
8576
- }, null, 8, ["onClick"])
8577
- ]),
8578
- _: 1
8579
- })) : (openBlock(), createBlock(_component_Tooltip, {
8580
- key: 1,
8581
- title: "全屏",
8582
- placement: "bottom"
8583
- }, {
8584
- default: withCtx(() => [
8585
- createVNode(_component_FullscreenOutlined, {
8586
- role: "close",
8587
- onClick: _ctx.handleFullScreen
8588
- }, null, 8, ["onClick"])
8589
- ]),
8590
- _: 1
8591
- }))
8592
- ], 64)) : createCommentVNode("", true),
8593
- createVNode(_component_Tooltip, {
8594
- title: "关闭",
8595
- placement: "bottom"
8596
- }, {
8597
- default: withCtx(() => [
8598
- createVNode(_component_CloseOutlined, { onClick: _ctx.handleCancel }, null, 8, ["onClick"])
8599
- ]),
8600
- _: 1
8601
- })
8602
- ], 2);
8603
- }
8604
- const ModalClose = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$B]]);
8605
- const _sfc_main$11 = defineComponent({
8606
- name: "BasicModalFooter",
8607
- props: basicProps$6,
8608
- emits: ["ok", "cancel"],
8609
- setup(_, { emit }) {
8610
- function handleOk(e) {
8611
- emit("ok", e);
8612
- }
8613
- function handleCancel(e) {
8614
- emit("cancel", e);
8615
- }
8616
- return { handleOk, handleCancel };
8617
- }
8618
- });
8619
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
8620
- const _component_a_button = resolveComponent("a-button");
8621
- return openBlock(), createElementBlock("div", null, [
8622
- renderSlot(_ctx.$slots, "insertFooter"),
8623
- _ctx.showCancelBtn ? (openBlock(), createBlock(_component_a_button, mergeProps({ key: 0 }, _ctx.cancelButtonProps, { onClick: _ctx.handleCancel }), {
8624
- default: withCtx(() => [
8625
- createTextVNode(toDisplayString(_ctx.cancelText), 1)
8626
- ]),
8627
- _: 1
8628
- }, 16, ["onClick"])) : createCommentVNode("", true),
8629
- renderSlot(_ctx.$slots, "centerFooter"),
8630
- _ctx.showOkBtn ? (openBlock(), createBlock(_component_a_button, mergeProps({
8631
- key: 1,
8632
- type: _ctx.okType,
8633
- onClick: _ctx.handleOk,
8634
- loading: _ctx.confirmLoading
8635
- }, _ctx.okButtonProps), {
8636
- default: withCtx(() => [
8637
- createTextVNode(toDisplayString(_ctx.okText), 1)
8638
- ]),
8639
- _: 1
8640
- }, 16, ["type", "onClick", "loading"])) : createCommentVNode("", true),
8641
- renderSlot(_ctx.$slots, "appendFooter")
8642
- ]);
8643
- }
8644
- const ModalFooter = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$A]]);
8645
- function deepMerge(src = {}, target = {}) {
8646
- let key2;
8647
- const res = cloneDeep(src);
8648
- for (key2 in target) {
8649
- res[key2] = isObject$1(res[key2]) ? deepMerge(res[key2], target[key2]) : res[key2] = target[key2];
8650
- }
8651
- return res;
8652
- }
8653
- function getPopupContainer(node) {
8654
- return (node == null ? void 0 : node.parentNode) ?? document.body;
8655
- }
8656
- function useContext(key2 = Symbol(), defaultValue) {
8657
- return inject(key2, defaultValue || {});
8658
- }
8659
- const key$2 = Symbol();
8660
- function useAppProviderContext() {
8661
- return useContext(key$2);
8662
- }
8663
- function useDesign(scope) {
8664
- const values = useAppProviderContext();
8665
- return {
8666
- // prefixCls: computed(() => `${values.prefixCls}-${scope}`),
8667
- prefixCls: `${values.prefixCls}-${scope}`,
8668
- prefixVar: values.prefixCls
8669
- // style,
8670
- };
8671
- }
8672
- const props$6 = {
8673
- /**
8674
- * Help text max-width
8675
- * @default: 600px
8676
- */
8677
- maxWidth: {
8678
- type: String,
8679
- default: "600px"
8680
- },
8681
- /**
8682
- * Whether to display the serial number
8683
- * @default: false
8684
- */
8685
- showIndex: {
8686
- type: Boolean
8687
- },
8688
- /**
8689
- * Help text font color
8690
- * @default: #ffffff
8691
- */
8692
- color: {
8693
- type: String,
8694
- default: "#ffffff"
8695
- },
8696
- /**
8697
- * Help text font size
8698
- * @default: 14px
8699
- */
8700
- fontSize: {
8701
- type: String,
8702
- default: "14px"
8703
- },
8704
- /**
8705
- * Help text list
8706
- */
8707
- placement: {
8708
- type: String,
8709
- default: "right"
8710
- },
8711
- /**
8712
- * Help text list
8713
- */
8714
- text: {
8715
- type: [Array, String]
8716
- }
8123
+ const _hoisted_3$7 = { class: "text-red-500" };
8124
+ const _hoisted_4$4 = {
8125
+ key: 0,
8126
+ class: "table-children-delete-index"
8717
8127
  };
8718
- const _sfc_main$10 = /* @__PURE__ */ defineComponent({
8719
- name: "BasicHelp",
8720
- components: {
8721
- Tooltip
8128
+ const _hoisted_5$3 = ["onClick"];
8129
+ const _hoisted_6$1 = {
8130
+ key: 2,
8131
+ class: "table-children-delete-index"
8132
+ };
8133
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
8134
+ __name: "Table",
8135
+ props: {
8136
+ rowKey: {
8137
+ type: String,
8138
+ default: () => "uuid"
8139
+ },
8140
+ columns: {
8141
+ type: Array,
8142
+ default: () => []
8143
+ },
8144
+ value: {
8145
+ type: Array,
8146
+ default: () => []
8147
+ },
8148
+ isShowAction: {
8149
+ type: Boolean,
8150
+ default: () => true
8151
+ },
8152
+ isShowDelAction: {
8153
+ type: Boolean,
8154
+ default: () => false
8155
+ }
8722
8156
  },
8723
- props: props$6,
8724
- setup(props2, {
8725
- slots
8726
- }) {
8727
- const {
8728
- prefixCls: prefixCls2
8729
- } = useDesign("basic-help");
8730
- const getTooltipStyle = computed(() => ({
8731
- color: props2.color,
8732
- fontSize: props2.fontSize
8733
- }));
8734
- const getOverlayStyle = computed(() => ({
8735
- maxWidth: props2.maxWidth
8736
- }));
8737
- function renderTitle() {
8738
- const textList = props2.text;
8739
- if (isString$1(textList)) {
8740
- return createVNode("p", null, [textList]);
8157
+ emits: ["update:value", "change", "add", "remove"],
8158
+ setup(__props, { expose: __expose, emit: __emit }) {
8159
+ const formActionType = inject("formActionType");
8160
+ const emit = __emit;
8161
+ const props2 = __props;
8162
+ const emitData = ref([]);
8163
+ const [state] = useRuleFormItem(props2, "value", "change", emitData);
8164
+ const actionColumn = {
8165
+ title: "操作",
8166
+ dataIndex: "_action",
8167
+ width: 100,
8168
+ align: "center",
8169
+ fixed: "right"
8170
+ };
8171
+ const getColumns = computed(() => {
8172
+ const indexColumn = {
8173
+ title: "序号",
8174
+ dataIndex: "index",
8175
+ customRender: ({ index: index2 }) => {
8176
+ return `${index2 + 1}`;
8177
+ },
8178
+ width: 50,
8179
+ align: "center"
8180
+ };
8181
+ return [
8182
+ indexColumn,
8183
+ ...props2.columns.map((item) => ({
8184
+ ...item,
8185
+ type: item.type ? item.type : "input"
8186
+ })),
8187
+ ...(props2 == null ? void 0 : props2.isShowDelAction) ? [actionColumn] : []
8188
+ ];
8189
+ });
8190
+ const plusClickEvent = () => {
8191
+ state.value = [{ [props2.rowKey]: buildUUID() }, ...toRaw(state.value)];
8192
+ emit("add", state.value);
8193
+ };
8194
+ const rowClickEvent = (index2) => {
8195
+ const tempState = state.value.filter((item) => {
8196
+ return item[props2.rowKey] !== index2;
8197
+ });
8198
+ tempState.forEach((item) => item[props2.rowKey] = buildUUID());
8199
+ state.value = [...tempState];
8200
+ emit("remove", state.value, index2);
8201
+ };
8202
+ const getPopupContainer2 = () => document.body;
8203
+ const rulesRef = reactive({});
8204
+ const getRules = ({ column, record, index: index2, ...args }) => {
8205
+ var _a2, _b;
8206
+ const errKey = `${column.dataIndex}-${record.uuid}Info`;
8207
+ if (!column.required && !column.rules)
8208
+ return [];
8209
+ if ((_a2 = rulesRef[errKey]) == null ? void 0 : _a2.rules)
8210
+ return (_b = rulesRef[errKey]) == null ? void 0 : _b.rules;
8211
+ rulesRef[errKey] = {
8212
+ rules: [],
8213
+ show: false,
8214
+ msg: ""
8215
+ };
8216
+ if (!column.rules && column.required) {
8217
+ rulesRef[errKey].rules = [
8218
+ {
8219
+ required: true,
8220
+ validator: (rule, value) => {
8221
+ const prefix = column.type.toLocaleLowerCase().includes("input") ? "请输入" : "请选择";
8222
+ const errMsg = `${prefix}${column.title}`;
8223
+ if (value) {
8224
+ rulesRef[errKey].show = false;
8225
+ return Promise.resolve();
8226
+ }
8227
+ rulesRef[errKey].show = true;
8228
+ rulesRef[errKey].msg = errMsg;
8229
+ return Promise.reject(errMsg);
8230
+ }
8231
+ }
8232
+ ];
8233
+ return rulesRef[errKey].rules;
8741
8234
  }
8742
- if (isArray(textList)) {
8743
- return textList.map((text, index2) => {
8744
- return createVNode("p", {
8745
- "key": text
8746
- }, [createVNode(Fragment, null, [props2.showIndex ? `${index2 + 1}. ` : "", text])]);
8747
- });
8235
+ if (!isArray$2(column.rules))
8236
+ return column.rules;
8237
+ rulesRef[errKey].rules = cloneDeep(column.rules);
8238
+ rulesRef[errKey].rules.forEach((item) => {
8239
+ if (!item.validator || !isFunction$4(item.validator))
8240
+ return;
8241
+ const validator = item.validator;
8242
+ item.validator = async (rule, value) => {
8243
+ try {
8244
+ rulesRef[errKey].show = false;
8245
+ return await validator(
8246
+ rule,
8247
+ value,
8248
+ { column, record, ...args },
8249
+ formActionType
8250
+ );
8251
+ } catch (error2) {
8252
+ rulesRef[errKey].show = true;
8253
+ rulesRef[errKey].msg = error2;
8254
+ return Promise.reject(error2);
8255
+ }
8256
+ };
8257
+ });
8258
+ return rulesRef[errKey].rules;
8259
+ };
8260
+ watch(
8261
+ () => state.value,
8262
+ (v, old) => {
8263
+ if (!isEqual(toRaw(v), toRaw(old))) {
8264
+ emit(
8265
+ "update:value",
8266
+ toRaw(v).map((ele) => {
8267
+ return {
8268
+ ...ele,
8269
+ [props2.rowKey]: ele[props2.rowKey] || buildUUID()
8270
+ };
8271
+ })
8272
+ );
8273
+ }
8274
+ },
8275
+ {
8276
+ deep: true
8748
8277
  }
8749
- return null;
8750
- }
8751
- return () => {
8752
- return createVNode(Tooltip, {
8753
- "overlayClassName": `${prefixCls2}__wrap`,
8754
- "title": createVNode("div", {
8755
- "style": unref(getTooltipStyle)
8756
- }, [renderTitle()]),
8757
- "autoAdjustOverflow": true,
8758
- "overlayStyle": unref(getOverlayStyle),
8759
- "placement": props2.placement,
8760
- "getPopupContainer": () => getPopupContainer()
8761
- }, {
8762
- default: () => [createVNode("span", {
8763
- "class": prefixCls2
8764
- }, [getSlot(slots) || createVNode(InfoCircleOutlined$1, null, null)])]
8278
+ );
8279
+ const isScroll = ref(false);
8280
+ const timer = ref();
8281
+ onMounted(() => {
8282
+ window.addEventListener(
8283
+ "scroll",
8284
+ (e) => {
8285
+ clearTimeout(timer.value);
8286
+ timer.value = setTimeout(() => {
8287
+ isScroll.value = false;
8288
+ }, 500);
8289
+ if (isScroll.value)
8290
+ return;
8291
+ isScroll.value = true;
8292
+ },
8293
+ true
8294
+ );
8295
+ });
8296
+ onUnmounted(() => {
8297
+ window.removeEventListener("scroll", () => {
8298
+ });
8299
+ });
8300
+ const loadKv = () => {
8301
+ const columns = props2.columns;
8302
+ let dicData = [];
8303
+ columns.forEach(async (column) => {
8304
+ if (column == null ? void 0 : column.api) {
8305
+ dicData = await column.api();
8306
+ column.dicData = dicData;
8307
+ }
8765
8308
  });
8766
8309
  };
8767
- }
8768
- });
8769
- const BasicHelp_vue_vue_type_style_index_0_lang = "";
8770
- const prefixCls$3 = "shy-basic-title";
8771
- const _sfc_main$$ = /* @__PURE__ */ defineComponent({
8772
- __name: "BasicTitle",
8773
- props: {
8774
- /**
8775
- * Help text list or string
8776
- * @default: ''
8777
- */
8778
- helpMessage: {
8779
- type: [String, Array],
8780
- default: ""
8781
- },
8782
- /**
8783
- * Whether the color block on the left side of the title
8784
- * @default: false
8785
- */
8786
- span: { type: Boolean },
8787
- /**
8788
- * Whether to default the text, that is, not bold
8789
- * @default: false
8790
- */
8791
- normal: { type: Boolean }
8792
- },
8793
- setup(__props) {
8794
- const props2 = __props;
8795
- const slots = useSlots();
8796
- const getClass = computed(() => [
8797
- prefixCls$3,
8798
- { [`${prefixCls$3}-show-span`]: props2.span && slots.default },
8799
- { [`${prefixCls$3}-normal`]: props2.normal }
8800
- ]);
8310
+ const listFormRefs = ref([]);
8311
+ const validate = async () => {
8312
+ try {
8313
+ for (let formRef of listFormRefs.value) {
8314
+ await formRef.validate();
8315
+ }
8316
+ } catch {
8317
+ throw new Error("校验失败");
8318
+ }
8319
+ };
8320
+ loadKv();
8321
+ __expose({ validate });
8801
8322
  return (_ctx, _cache) => {
8802
- return openBlock(), createElementBlock("span", {
8803
- class: normalizeClass(getClass.value)
8804
- }, [
8805
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
8806
- __props.helpMessage ? (openBlock(), createBlock(_sfc_main$10, {
8807
- key: 0,
8808
- class: normalizeClass(`${prefixCls$3}-help`),
8809
- text: __props.helpMessage
8810
- }, null, 8, ["class", "text"])) : createCommentVNode("", true)
8811
- ], 2);
8323
+ return openBlock(), createBlock(unref(Table), {
8324
+ columns: getColumns.value,
8325
+ "data-source": unref(state),
8326
+ pagination: false,
8327
+ bordered: "",
8328
+ size: "small",
8329
+ class: "table-children",
8330
+ align: "center"
8331
+ }, {
8332
+ headerCell: withCtx(({ column }) => {
8333
+ var _a2;
8334
+ return [
8335
+ column.dataIndex === "index" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
8336
+ __props.isShowAction ? (openBlock(), createElementBlock("div", {
8337
+ key: 0,
8338
+ class: "shy-table-edit-icon-plus",
8339
+ onClick: plusClickEvent
8340
+ }, [
8341
+ createVNode(unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
8342
+ ])) : (openBlock(), createElementBlock("div", _hoisted_1$s, "序号"))
8343
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
8344
+ column.required || ((_a2 = column == null ? void 0 : column.rules) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("span", _hoisted_2$8, "*")) : createCommentVNode("", true),
8345
+ createElementVNode("span", null, toDisplayString(column.title), 1)
8346
+ ], 64))
8347
+ ];
8348
+ }),
8349
+ bodyCell: withCtx(({ column, record, index: index2, ...args }) => [
8350
+ column.dataIndex === "_action" ? (openBlock(), createBlock(_sfc_main$12, {
8351
+ key: 0,
8352
+ actions: [
8353
+ {
8354
+ label: "删除",
8355
+ popConfirm: {
8356
+ title: "确定删除",
8357
+ confirm: rowClickEvent.bind(null, record[__props.rowKey])
8358
+ }
8359
+ }
8360
+ ]
8361
+ }, null, 8, ["actions"])) : column.dataIndex !== "index" && column.type !== "text" ? (openBlock(), createBlock(unref(FormItem), {
8362
+ required: column.required,
8363
+ rules: getRules({ column, record, index: index2, ...args }),
8364
+ name: [_ctx.$attrs.codeField, index2, column.dataIndex],
8365
+ key: record[__props.rowKey]
8366
+ }, {
8367
+ default: withCtx(() => {
8368
+ var _a2;
8369
+ return [
8370
+ createVNode(unref(Popover), {
8371
+ overlayClassName: "table-children-err-popover",
8372
+ visible: !!((_a2 = rulesRef == null ? void 0 : rulesRef[`${column.dataIndex}-${record.uuid}Info`]) == null ? void 0 : _a2.show) && !isScroll.value
8373
+ }, {
8374
+ content: withCtx(() => {
8375
+ var _a3;
8376
+ return [
8377
+ createElementVNode("span", _hoisted_3$7, toDisplayString((_a3 = rulesRef[`${column.dataIndex}-${record.uuid}Info`]) == null ? void 0 : _a3.msg), 1)
8378
+ ];
8379
+ }),
8380
+ default: withCtx(() => [
8381
+ column.type === "select" ? (openBlock(), createBlock(unref(Select), {
8382
+ key: 0,
8383
+ value: record[column.dataIndex],
8384
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event,
8385
+ options: column.dicData,
8386
+ mode: column.mode,
8387
+ "max-tag-count": column.maxTagCount,
8388
+ "max-tag-text-length": column.maxTagTextLength
8389
+ }, null, 8, ["value", "onUpdate:value", "options", "mode", "max-tag-count", "max-tag-text-length"])) : column.type === "datePicker" ? (openBlock(), createBlock(unref(DatePicker), {
8390
+ key: 1,
8391
+ value: record[column.dataIndex],
8392
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event,
8393
+ valueFormat: "YYYY-MM-DD HH:mm:ss"
8394
+ }, null, 8, ["value", "onUpdate:value"])) : column.type === "number" ? (openBlock(), createBlock(unref(InputNumber), {
8395
+ key: 2,
8396
+ value: record[column.dataIndex],
8397
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event,
8398
+ min: column.min,
8399
+ max: column.max,
8400
+ precision: column.precision ?? 2
8401
+ }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : column.type === "input" ? (openBlock(), createBlock(unref(Input), {
8402
+ key: 3,
8403
+ value: record[column.dataIndex],
8404
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event,
8405
+ disabled: !props2.isShowAction
8406
+ }, null, 8, ["value", "onUpdate:value", "disabled"])) : (openBlock(), createBlock(resolveDynamicComponent(unref(componentMap$2).get(column.type)), mergeProps(
8407
+ {
8408
+ key: 4,
8409
+ allowClear: "",
8410
+ getPopupContainer: getPopupContainer2,
8411
+ style: { width: "100%" }
8412
+ },
8413
+ unref(isFunction$4)(column.componentProps) ? column.componentProps({ record, column, index: index2, ...args }) : column.componentProps,
8414
+ {
8415
+ value: record[column.dataIndex],
8416
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event
8417
+ }
8418
+ ), null, 16, ["value", "onUpdate:value"]))
8419
+ ]),
8420
+ _: 2
8421
+ }, 1032, ["visible"])
8422
+ ];
8423
+ }),
8424
+ _: 2
8425
+ }, 1032, ["required", "rules", "name"])) : column.dataIndex === "index" ? (openBlock(), createElementBlock("div", {
8426
+ class: normalizeClass({ isShowDelAction: "table-children-delete-wrapper" }),
8427
+ key: record[__props.rowKey]
8428
+ }, [
8429
+ __props.isShowAction ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
8430
+ __props.isShowAction ? (openBlock(), createElementBlock("div", {
8431
+ key: 1,
8432
+ class: "table-children-delete-item",
8433
+ onClick: ($event) => rowClickEvent(record[__props.rowKey])
8434
+ }, [
8435
+ createVNode(unref(DeleteFilled$1), { style: { color: "#fff" } })
8436
+ ], 8, _hoisted_5$3)) : (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(index2 + 1), 1))
8437
+ ])) : createCommentVNode("", true)
8438
+ ]),
8439
+ _: 1
8440
+ }, 8, ["columns", "data-source"]);
8812
8441
  };
8813
8442
  }
8814
8443
  });
8815
- const BasicTitle_vue_vue_type_style_index_0_scoped_a48f9d86_lang = "";
8816
- const BasicTitle = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-a48f9d86"]]);
8817
- const _sfc_main$_ = defineComponent({
8818
- name: "BasicModalHeader",
8819
- components: { BasicTitle },
8820
- props: {
8821
- helpMessage: {
8822
- type: [String, Array]
8823
- },
8824
- title: { type: String }
8825
- },
8826
- emits: ["dblclick"]
8444
+ const Table_vue_vue_type_style_index_0_lang = "";
8445
+ const modal = "";
8446
+ useI18n$1();
8447
+ const modalProps = {
8448
+ visible: { type: Boolean },
8449
+ scrollTop: { type: Boolean, default: true },
8450
+ height: { type: Number },
8451
+ minHeight: { type: Number },
8452
+ // open drag
8453
+ draggable: { type: Boolean, default: true },
8454
+ centered: { type: Boolean },
8455
+ cancelText: { type: String, default: "取消" },
8456
+ okText: { type: String, default: "确认" },
8457
+ closeFunc: Function
8458
+ };
8459
+ const basicProps$6 = Object.assign({}, modalProps, {
8460
+ defaultFullscreen: { type: Boolean },
8461
+ // Can it be full screen
8462
+ canFullscreen: { type: Boolean, default: true },
8463
+ // After enabling the wrapper, the bottom can be increased in height
8464
+ wrapperFooterOffset: { type: Number, default: 0 },
8465
+ // Warm reminder message
8466
+ helpMessage: [String, Array],
8467
+ // Whether to setting wrapper
8468
+ useWrapper: { type: Boolean, default: true },
8469
+ loading: { type: Boolean },
8470
+ loadingTip: { type: String },
8471
+ /**
8472
+ * @description: Show close button
8473
+ */
8474
+ showCancelBtn: { type: Boolean, default: true },
8475
+ /**
8476
+ * @description: Show confirmation button
8477
+ */
8478
+ showOkBtn: { type: Boolean, default: true },
8479
+ wrapperProps: Object,
8480
+ afterClose: Function,
8481
+ bodyStyle: Object,
8482
+ closable: { type: Boolean, default: true },
8483
+ closeIcon: Object,
8484
+ confirmLoading: { type: Boolean },
8485
+ destroyOnClose: { type: Boolean },
8486
+ footer: Object,
8487
+ getContainer: Function,
8488
+ mask: { type: Boolean, default: true },
8489
+ maskClosable: { type: Boolean, default: false },
8490
+ keyboard: { type: Boolean, default: true },
8491
+ maskStyle: Object,
8492
+ okType: { type: String, default: "primary" },
8493
+ okButtonProps: Object,
8494
+ cancelButtonProps: Object,
8495
+ title: { type: String },
8496
+ visible: { type: Boolean },
8497
+ width: [String, Number],
8498
+ wrapClassName: { type: String },
8499
+ zIndex: { type: Number }
8827
8500
  });
8828
- function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
8829
- const _component_BasicTitle = resolveComponent("BasicTitle");
8830
- return openBlock(), createBlock(_component_BasicTitle, { helpMessage: _ctx.helpMessage }, {
8831
- default: withCtx(() => [
8832
- createTextVNode(toDisplayString(_ctx.title), 1)
8833
- ]),
8834
- _: 1
8835
- }, 8, ["helpMessage"]);
8501
+ function is(val, type) {
8502
+ return toString.call(val) === `[object ${type}]`;
8836
8503
  }
8837
- const ModalHeader = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$z]]);
8838
- function useFullScreen(context) {
8839
- const fullScreenRef = ref(false);
8840
- const getWrapClassName = computed(() => {
8841
- const clsName = unref(context.wrapClassName) || "";
8842
- return unref(fullScreenRef) ? `fullscreen-modal ${clsName} ` : unref(clsName);
8843
- });
8844
- function handleFullScreen(e) {
8845
- e && e.stopPropagation();
8846
- fullScreenRef.value = !unref(fullScreenRef);
8847
- }
8848
- return { getWrapClassName, handleFullScreen, fullScreenRef };
8504
+ function isFunction$1(val) {
8505
+ return typeof val === "function";
8849
8506
  }
8850
- const _sfc_main$Z = defineComponent({
8851
- name: "BasicModal",
8852
- components: { Modal: Modal$1, ModalWrapper, ModalClose, ModalFooter, ModalHeader },
8853
- inheritAttrs: false,
8854
- props: basicProps$6,
8855
- emits: [
8856
- "visible-change",
8857
- "height-change",
8858
- "cancel",
8859
- "ok",
8860
- "register",
8861
- "update:visible"
8862
- ],
8863
- setup(props2, { emit, attrs }) {
8864
- const visibleRef = ref(false);
8865
- const propsRef = ref(null);
8866
- const modalWrapperRef = ref(null);
8867
- const prefixCls2 = "shy-basic-modal";
8868
- const extHeightRef = ref(0);
8869
- const modalMethods = {
8870
- setModalProps,
8871
- emitVisible: void 0,
8872
- redoModalHeight: () => {
8873
- nextTick(() => {
8874
- if (unref(modalWrapperRef)) {
8875
- unref(modalWrapperRef).setModalHeight();
8876
- }
8877
- });
8878
- }
8879
- };
8880
- const instance = getCurrentInstance();
8881
- if (instance) {
8882
- emit("register", modalMethods, instance.uid);
8883
- }
8884
- const getMergeProps = computed(() => {
8885
- return {
8886
- ...props2,
8887
- ...unref(propsRef)
8888
- };
8889
- });
8890
- const { handleFullScreen, getWrapClassName, fullScreenRef } = useFullScreen(
8891
- {
8892
- modalWrapperRef,
8893
- extHeightRef,
8894
- wrapClassName: toRef(getMergeProps.value, "wrapClassName")
8895
- }
8896
- );
8897
- const getProps = computed(() => {
8898
- const opt = {
8899
- ...unref(getMergeProps),
8900
- visible: unref(visibleRef),
8901
- okButtonProps: void 0,
8902
- cancelButtonProps: void 0,
8903
- title: void 0
8904
- };
8905
- return {
8906
- ...opt,
8907
- wrapClassName: unref(getWrapClassName)
8908
- };
8909
- });
8910
- const getBindValue = computed(() => {
8911
- const attr = {
8912
- ...attrs,
8913
- ...unref(getMergeProps),
8914
- visible: unref(visibleRef),
8915
- wrapClassName: unref(getWrapClassName)
8916
- };
8917
- if (unref(fullScreenRef)) {
8918
- return omit$1(attr, ["height", "title"]);
8919
- }
8920
- return omit$1(attr, "title");
8921
- });
8922
- const getWrapperHeight = computed(() => {
8923
- if (unref(fullScreenRef))
8924
- return void 0;
8925
- return unref(getProps).height;
8926
- });
8927
- watchEffect(() => {
8928
- visibleRef.value = !!props2.visible;
8929
- fullScreenRef.value = !!props2.defaultFullscreen;
8930
- });
8507
+ function isObject$1(val) {
8508
+ return val !== null && is(val, "Object");
8509
+ }
8510
+ function isDef(val) {
8511
+ return typeof val !== "undefined";
8512
+ }
8513
+ function isUnDef(val) {
8514
+ return !isDef(val);
8515
+ }
8516
+ function isString$1(val) {
8517
+ return is(val, "String");
8518
+ }
8519
+ function isArray(val) {
8520
+ return val && Array.isArray(val);
8521
+ }
8522
+ function useTimeoutFn(handle, wait, native = false) {
8523
+ if (!isFunction$1(handle)) {
8524
+ throw new Error("handle is not Function!");
8525
+ }
8526
+ const { readyRef, stop, start } = useTimeoutRef(wait);
8527
+ if (native) {
8528
+ handle();
8529
+ } else {
8931
8530
  watch(
8932
- () => unref(visibleRef),
8933
- (v) => {
8934
- var _a2;
8935
- emit("visible-change", v);
8936
- emit("update:visible", v);
8937
- instance && ((_a2 = modalMethods.emitVisible) == null ? void 0 : _a2.call(modalMethods, v, instance.uid));
8938
- nextTick(() => {
8939
- if (props2.scrollTop && v && unref(modalWrapperRef)) {
8940
- unref(modalWrapperRef).scrollTop();
8941
- }
8942
- });
8531
+ readyRef,
8532
+ (maturity) => {
8533
+ maturity && handle();
8943
8534
  },
8944
- {
8945
- immediate: false
8946
- }
8535
+ { immediate: false }
8947
8536
  );
8948
- async function handleCancel(e) {
8949
- var _a2, _b;
8950
- e == null ? void 0 : e.stopPropagation();
8951
- if ((_b = (_a2 = e.target) == null ? void 0 : _a2.classList) == null ? void 0 : _b.contains(
8952
- prefixCls2 + "-close--custom"
8953
- ))
8954
- return;
8955
- if (props2.closeFunc && isFunction$1(props2.closeFunc)) {
8956
- const isClose = await props2.closeFunc();
8957
- visibleRef.value = !isClose;
8537
+ }
8538
+ return { readyRef, stop, start };
8539
+ }
8540
+ function useTimeoutRef(wait) {
8541
+ const readyRef = ref(false);
8542
+ let timer;
8543
+ function stop() {
8544
+ readyRef.value = false;
8545
+ timer && window.clearTimeout(timer);
8546
+ }
8547
+ function start() {
8548
+ stop();
8549
+ timer = setTimeout(() => {
8550
+ readyRef.value = true;
8551
+ }, wait);
8552
+ }
8553
+ start();
8554
+ tryOnUnmounted(stop);
8555
+ return { readyRef, stop, start };
8556
+ }
8557
+ function useModalDragMove(context) {
8558
+ const getStyle = (dom, attr) => {
8559
+ return getComputedStyle(dom)[attr];
8560
+ };
8561
+ const drag = (wrap) => {
8562
+ if (!wrap)
8563
+ return;
8564
+ wrap.setAttribute("data-drag", unref(context.draggable));
8565
+ const dialogHeaderEl = wrap.querySelector(".ant-modal-header");
8566
+ const dragDom = wrap.querySelector(".ant-modal");
8567
+ if (!dialogHeaderEl || !dragDom || !unref(context.draggable))
8568
+ return;
8569
+ dialogHeaderEl.style.cursor = "move";
8570
+ dialogHeaderEl.onmousedown = (e) => {
8571
+ if (!e)
8958
8572
  return;
8573
+ const disX = e.clientX;
8574
+ const disY = e.clientY;
8575
+ const screenWidth = document.body.clientWidth;
8576
+ const screenHeight = document.documentElement.clientHeight;
8577
+ const dragDomWidth = dragDom.offsetWidth;
8578
+ const dragDomheight = dragDom.offsetHeight;
8579
+ const minDragDomLeft = dragDom.offsetLeft;
8580
+ const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
8581
+ const minDragDomTop = dragDom.offsetTop;
8582
+ const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
8583
+ const domLeft = getStyle(dragDom, "left");
8584
+ const domTop = getStyle(dragDom, "top");
8585
+ let styL = +domLeft;
8586
+ let styT = +domTop;
8587
+ if (domLeft.includes("%")) {
8588
+ styL = +document.body.clientWidth * (+domLeft.replace(/%/g, "") / 100);
8589
+ styT = +document.body.clientHeight * (+domTop.replace(/%/g, "") / 100);
8590
+ } else {
8591
+ styL = +domLeft.replace(/px/g, "");
8592
+ styT = +domTop.replace(/px/g, "");
8959
8593
  }
8960
- visibleRef.value = false;
8961
- emit("cancel", e);
8962
- }
8963
- function setModalProps(props22) {
8964
- propsRef.value = deepMerge(unref(propsRef) || {}, props22);
8965
- if (Reflect.has(props22, "visible")) {
8966
- visibleRef.value = !!props22.visible;
8967
- }
8968
- if (Reflect.has(props22, "defaultFullscreen")) {
8969
- fullScreenRef.value = !!props22.defaultFullscreen;
8594
+ document.onmousemove = function(e2) {
8595
+ let left = e2.clientX - disX;
8596
+ let top = e2.clientY - disY;
8597
+ if (-left > minDragDomLeft) {
8598
+ left = -minDragDomLeft;
8599
+ } else if (left > maxDragDomLeft) {
8600
+ left = maxDragDomLeft;
8601
+ }
8602
+ if (-top > minDragDomTop) {
8603
+ top = -minDragDomTop;
8604
+ } else if (top > maxDragDomTop) {
8605
+ top = maxDragDomTop;
8606
+ }
8607
+ dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
8608
+ };
8609
+ document.onmouseup = () => {
8610
+ document.onmousemove = null;
8611
+ document.onmouseup = null;
8612
+ };
8613
+ };
8614
+ };
8615
+ const handleDrag = () => {
8616
+ const dragWraps = document.querySelectorAll(".ant-modal-wrap");
8617
+ for (const wrap of Array.from(dragWraps)) {
8618
+ if (!wrap)
8619
+ continue;
8620
+ const display = getStyle(wrap, "display");
8621
+ const draggable = wrap.getAttribute("data-drag");
8622
+ if (display !== "none") {
8623
+ if (draggable === null || unref(context.destroyOnClose)) {
8624
+ drag(wrap);
8625
+ }
8970
8626
  }
8971
8627
  }
8972
- function handleOk(e) {
8973
- emit("ok", e);
8974
- }
8975
- function handleHeightChange(height) {
8976
- emit("height-change", height);
8977
- }
8978
- function handleExtHeight(height) {
8979
- extHeightRef.value = height;
8980
- }
8981
- function handleTitleDbClick(e) {
8982
- if (!props2.canFullscreen)
8983
- return;
8984
- e.stopPropagation();
8985
- handleFullScreen(e);
8628
+ };
8629
+ watchEffect(() => {
8630
+ if (!unref(context.visible) || !unref(context.draggable)) {
8631
+ return;
8986
8632
  }
8987
- return {
8988
- handleCancel,
8989
- getBindValue,
8990
- getProps,
8991
- handleFullScreen,
8992
- fullScreenRef,
8993
- getMergeProps,
8994
- handleOk,
8995
- visibleRef,
8996
- omit: omit$1,
8997
- modalWrapperRef,
8998
- handleExtHeight,
8999
- handleHeightChange,
9000
- handleTitleDbClick,
9001
- getWrapperHeight
9002
- };
9003
- }
9004
- });
9005
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
9006
- const _component_ModalClose = resolveComponent("ModalClose");
9007
- const _component_ModalHeader = resolveComponent("ModalHeader");
9008
- const _component_ModalFooter = resolveComponent("ModalFooter");
9009
- const _component_ModalWrapper = resolveComponent("ModalWrapper");
9010
- const _component_Modal = resolveComponent("Modal");
9011
- return openBlock(), createBlock(_component_Modal, mergeProps({ class: "modal-wrapper" }, _ctx.getBindValue, { onCancel: _ctx.handleCancel }), createSlots({
9012
- default: withCtx(() => [
9013
- createVNode(_component_ModalWrapper, mergeProps(
9014
- {
9015
- useWrapper: _ctx.getProps.useWrapper,
9016
- footerOffset: _ctx.wrapperFooterOffset,
9017
- fullScreen: _ctx.fullScreenRef,
9018
- ref: "modalWrapperRef",
9019
- loading: _ctx.getProps.loading,
9020
- "loading-tip": _ctx.getProps.loadingTip,
9021
- minHeight: _ctx.getProps.minHeight,
9022
- height: _ctx.getWrapperHeight,
9023
- visible: _ctx.visibleRef,
9024
- modalFooterHeight: _ctx.footer !== void 0 && !_ctx.footer ? 0 : void 0
9025
- },
9026
- _ctx.omit(_ctx.getProps.wrapperProps, "visible", "height", "modalFooterHeight"),
9027
- {
9028
- onExtHeight: _ctx.handleExtHeight,
9029
- onHeightChange: _ctx.handleHeightChange
9030
- }
9031
- ), {
9032
- default: withCtx(() => [
9033
- renderSlot(_ctx.$slots, "default")
9034
- ]),
9035
- _: 3
9036
- }, 16, ["useWrapper", "footerOffset", "fullScreen", "loading", "loading-tip", "minHeight", "height", "visible", "modalFooterHeight", "onExtHeight", "onHeightChange"])
9037
- ]),
9038
- _: 2
9039
- }, [
9040
- !_ctx.$slots.closeIcon ? {
9041
- name: "closeIcon",
9042
- fn: withCtx(() => [
9043
- createVNode(_component_ModalClose, {
9044
- canFullscreen: _ctx.getProps.canFullscreen,
9045
- fullScreen: _ctx.fullScreenRef,
9046
- onCancel: _ctx.handleCancel,
9047
- onFullscreen: _ctx.handleFullScreen
9048
- }, null, 8, ["canFullscreen", "fullScreen", "onCancel", "onFullscreen"])
9049
- ]),
9050
- key: "0"
9051
- } : void 0,
9052
- !_ctx.$slots.title ? {
9053
- name: "title",
9054
- fn: withCtx(() => [
9055
- createVNode(_component_ModalHeader, {
9056
- helpMessage: _ctx.getProps.helpMessage,
9057
- title: _ctx.getMergeProps.title,
9058
- onDblclick: _ctx.handleTitleDbClick
9059
- }, null, 8, ["helpMessage", "title", "onDblclick"])
9060
- ]),
9061
- key: "1"
9062
- } : void 0,
9063
- !_ctx.$slots.footer ? {
9064
- name: "footer",
9065
- fn: withCtx(() => [
9066
- createVNode(_component_ModalFooter, mergeProps(_ctx.getBindValue, {
9067
- onOk: _ctx.handleOk,
9068
- onCancel: _ctx.handleCancel
9069
- }), createSlots({ _: 2 }, [
9070
- renderList(Object.keys(_ctx.$slots), (item) => {
9071
- return {
9072
- name: item,
9073
- fn: withCtx((data) => [
9074
- renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
9075
- ])
9076
- };
9077
- })
9078
- ]), 1040, ["onOk", "onCancel"])
9079
- ]),
9080
- key: "2"
9081
- } : void 0,
9082
- renderList(Object.keys(_ctx.omit(_ctx.$slots, "default")), (item) => {
9083
- return {
9084
- name: item,
9085
- fn: withCtx((data) => [
9086
- renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
9087
- ])
9088
- };
9089
- })
9090
- ]), 1040, ["onCancel"]);
8633
+ useTimeoutFn(() => {
8634
+ handleDrag();
8635
+ }, 30);
8636
+ });
9091
8637
  }
9092
- const basicModal = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$y]]);
9093
- const projectName = {}.VITE_GLOB_APP_TITLE;
9094
- function error(message) {
9095
- throw new Error(`[${projectName} error]:${message}`);
8638
+ const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
8639
+ const LISTENER_PREFIX = /^on[A-Z]/;
8640
+ function entries(obj) {
8641
+ return Object.keys(obj).map((key2) => [key2, obj[key2]]);
9096
8642
  }
9097
- const dataTransfer = reactive({});
9098
- const visibleData$1 = reactive({});
9099
- function useModal() {
9100
- const modal2 = ref(null);
9101
- const loaded = ref(false);
9102
- const uid = ref("");
9103
- function register(modalMethod, uuid) {
9104
- if (!getCurrentInstance()) {
9105
- throw new Error(
9106
- "useModal() can only be used inside setup() or functional components!"
9107
- );
8643
+ function useAttrs(params = {}) {
8644
+ const instance = getCurrentInstance();
8645
+ if (!instance)
8646
+ return {};
8647
+ const {
8648
+ excludeListeners = false,
8649
+ excludeKeys = [],
8650
+ excludeDefaultKeys = true
8651
+ } = params;
8652
+ const attrs = shallowRef({});
8653
+ const allExcludeKeys = excludeKeys.concat(
8654
+ excludeDefaultKeys ? DEFAULT_EXCLUDE_KEYS : []
8655
+ );
8656
+ instance.attrs = reactive(instance.attrs);
8657
+ watchEffect(() => {
8658
+ const res = entries(instance.attrs).reduce((acm, [key2, val]) => {
8659
+ if (!allExcludeKeys.includes(key2) && !(excludeListeners && LISTENER_PREFIX.test(key2))) {
8660
+ acm[key2] = val;
8661
+ }
8662
+ return acm;
8663
+ }, {});
8664
+ attrs.value = res;
8665
+ });
8666
+ return attrs;
8667
+ }
8668
+ function getSlot(slots, slot = "default", data) {
8669
+ if (!slots || !Reflect.has(slots, slot)) {
8670
+ return null;
8671
+ }
8672
+ if (!isFunction$1(slots[slot])) {
8673
+ console.error(`${slot} is not a function!`);
8674
+ return null;
8675
+ }
8676
+ const slotFn = slots[slot];
8677
+ if (!slotFn)
8678
+ return null;
8679
+ return slotFn(data);
8680
+ }
8681
+ function extendSlots(slots, excludeKeys = []) {
8682
+ const slotKeys = Object.keys(slots);
8683
+ const ret = {};
8684
+ slotKeys.map((key2) => {
8685
+ if (excludeKeys.includes(key2)) {
8686
+ return null;
9108
8687
  }
9109
- uid.value = uuid;
9110
- onUnmounted(() => {
9111
- modal2.value = null;
9112
- loaded.value = false;
9113
- dataTransfer[unref(uid)] = null;
8688
+ ret[key2] = (data) => getSlot(slots, key2, data);
8689
+ });
8690
+ return ret;
8691
+ }
8692
+ function _isSlot$3(s) {
8693
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
8694
+ }
8695
+ const Modal$1 = /* @__PURE__ */ defineComponent({
8696
+ name: "Modal",
8697
+ inheritAttrs: false,
8698
+ props: basicProps$6,
8699
+ emits: ["cancel"],
8700
+ setup(props2, {
8701
+ slots,
8702
+ emit
8703
+ }) {
8704
+ const {
8705
+ visible,
8706
+ draggable,
8707
+ destroyOnClose
8708
+ } = toRefs(props2);
8709
+ const attrs = useAttrs();
8710
+ useModalDragMove({
8711
+ visible,
8712
+ destroyOnClose,
8713
+ draggable
9114
8714
  });
9115
- if (unref(loaded) && modalMethod === unref(modal2))
9116
- return;
9117
- modal2.value = modalMethod;
9118
- loaded.value = true;
9119
- modalMethod.emitVisible = (visible, uid2) => {
9120
- visibleData$1[uid2] = visible;
8715
+ const onCancel = (e) => {
8716
+ emit("cancel", e);
9121
8717
  };
8718
+ return () => {
8719
+ let _slot;
8720
+ const propsData = {
8721
+ ...unref(attrs),
8722
+ ...props2,
8723
+ onCancel
8724
+ };
8725
+ return createVNode(Modal$2, propsData, _isSlot$3(_slot = extendSlots(slots)) ? _slot : {
8726
+ default: () => [_slot]
8727
+ });
8728
+ };
8729
+ }
8730
+ });
8731
+ function useWindowSizeFn(fn, wait = 150, options) {
8732
+ let handler = () => {
8733
+ fn();
8734
+ };
8735
+ const handleSize = useDebounceFn$1(handler, wait);
8736
+ handler = handleSize;
8737
+ const start = () => {
8738
+ if (options && options.immediate) {
8739
+ handler();
8740
+ }
8741
+ window.addEventListener("resize", handler);
8742
+ };
8743
+ const stop = () => {
8744
+ window.removeEventListener("resize", handler);
8745
+ };
8746
+ tryOnMounted(() => {
8747
+ start();
8748
+ });
8749
+ tryOnUnmounted(() => {
8750
+ stop();
8751
+ });
8752
+ return [start, stop];
8753
+ }
8754
+ const easeInOutQuad = (t2, b, c, d) => {
8755
+ t2 /= d / 2;
8756
+ if (t2 < 1) {
8757
+ return c / 2 * t2 * t2 + b;
9122
8758
  }
9123
- const getInstance = () => {
9124
- const instance = unref(modal2);
9125
- if (!instance) {
9126
- error("useModal instance is undefined!");
8759
+ t2--;
8760
+ return -c / 2 * (t2 * (t2 - 2) - 1) + b;
8761
+ };
8762
+ const move = (el, amount) => {
8763
+ el.scrollTop = amount;
8764
+ };
8765
+ const position = (el) => {
8766
+ return el.scrollTop;
8767
+ };
8768
+ function useScrollTo({
8769
+ el,
8770
+ to,
8771
+ duration = 500,
8772
+ callback
8773
+ }) {
8774
+ const isActiveRef = ref(false);
8775
+ const start = position(el);
8776
+ const change3 = to - start;
8777
+ const increment = 20;
8778
+ let currentTime = 0;
8779
+ duration = isUnDef(duration) ? 500 : duration;
8780
+ const animateScroll = function() {
8781
+ if (!unref(isActiveRef)) {
8782
+ return;
8783
+ }
8784
+ currentTime += increment;
8785
+ const val = easeInOutQuad(currentTime, start, change3, duration);
8786
+ move(el, val);
8787
+ if (currentTime < duration && unref(isActiveRef)) {
8788
+ requestAnimationFrame(animateScroll);
8789
+ } else {
8790
+ if (callback && isFunction$1(callback)) {
8791
+ callback();
8792
+ }
9127
8793
  }
9128
- return instance;
9129
8794
  };
9130
- const methods2 = {
9131
- setModalProps: (props2) => {
9132
- var _a2;
9133
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps(props2);
9134
- },
9135
- getVisible: computed(() => {
9136
- return visibleData$1[~~unref(uid)];
9137
- }),
9138
- redoModalHeight: () => {
9139
- var _a2, _b;
9140
- (_b = (_a2 = getInstance()) == null ? void 0 : _a2.redoModalHeight) == null ? void 0 : _b.call(_a2);
9141
- },
9142
- openModal: (visible = true, data, openOnSet = true) => {
9143
- var _a2;
9144
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({
9145
- visible
9146
- });
9147
- if (!data)
9148
- return;
9149
- const id = unref(uid);
9150
- if (openOnSet) {
9151
- dataTransfer[id] = null;
9152
- dataTransfer[id] = toRaw(data);
8795
+ const run = () => {
8796
+ isActiveRef.value = true;
8797
+ animateScroll();
8798
+ };
8799
+ const stop = () => {
8800
+ isActiveRef.value = false;
8801
+ };
8802
+ return { start: run, stop };
8803
+ }
8804
+ const _sfc_main$10 = defineComponent({
8805
+ name: "ScrollContainer",
8806
+ components: { Scrollbar },
8807
+ setup() {
8808
+ const scrollbarRef = ref(null);
8809
+ function scrollTo(to, duration = 500) {
8810
+ const scrollbar = unref(scrollbarRef);
8811
+ if (!scrollbar) {
9153
8812
  return;
9154
8813
  }
9155
- const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data));
9156
- if (!equal) {
9157
- dataTransfer[id] = toRaw(data);
8814
+ nextTick(() => {
8815
+ const wrap = unref(scrollbar.wrap);
8816
+ if (!wrap) {
8817
+ return;
8818
+ }
8819
+ const { start } = useScrollTo({
8820
+ el: wrap,
8821
+ to,
8822
+ duration
8823
+ });
8824
+ start();
8825
+ });
8826
+ }
8827
+ function getScrollWrap() {
8828
+ const scrollbar = unref(scrollbarRef);
8829
+ if (!scrollbar) {
8830
+ return null;
9158
8831
  }
9159
- },
9160
- closeModal: () => {
9161
- var _a2;
9162
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ visible: false });
8832
+ return scrollbar.wrap;
9163
8833
  }
9164
- };
9165
- return [register, methods2];
9166
- }
9167
- const useModalInner = (callbackFn) => {
9168
- const modalInstanceRef = ref(null);
9169
- const currentInstance = getCurrentInstance();
9170
- const uidRef = ref("");
9171
- const getInstance = () => {
9172
- const instance = unref(modalInstanceRef);
9173
- if (!instance) {
9174
- error("useModalInner instance is undefined!");
8834
+ function scrollBottom() {
8835
+ const scrollbar = unref(scrollbarRef);
8836
+ if (!scrollbar) {
8837
+ return;
8838
+ }
8839
+ nextTick(() => {
8840
+ const wrap = unref(scrollbar.wrap);
8841
+ if (!wrap) {
8842
+ return;
8843
+ }
8844
+ const scrollHeight = wrap.scrollHeight;
8845
+ const { start } = useScrollTo({
8846
+ el: wrap,
8847
+ to: scrollHeight
8848
+ });
8849
+ start();
8850
+ });
9175
8851
  }
9176
- return instance;
8852
+ return {
8853
+ scrollbarRef,
8854
+ scrollTo,
8855
+ scrollBottom,
8856
+ getScrollWrap
8857
+ };
8858
+ }
8859
+ });
8860
+ const ScrollContainer_vue_vue_type_style_index_0_lang = "";
8861
+ function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
8862
+ const _component_Scrollbar = resolveComponent("Scrollbar");
8863
+ return openBlock(), createBlock(_component_Scrollbar, mergeProps({
8864
+ ref: "scrollbarRef",
8865
+ class: "scroll-container"
8866
+ }, _ctx.$attrs), {
8867
+ default: withCtx(() => [
8868
+ renderSlot(_ctx.$slots, "default")
8869
+ ]),
8870
+ _: 3
8871
+ }, 16);
8872
+ }
8873
+ const ScrollContainer = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$D]]);
8874
+ function createContext(context, key2 = Symbol(), options = {}) {
8875
+ const { readonly: readonly$1 = true, createProvider = false, native = false } = options;
8876
+ const state = reactive(context);
8877
+ const provideData = readonly$1 ? readonly(state) : state;
8878
+ !createProvider && provide(key2, native ? context : provideData);
8879
+ return {
8880
+ state
9177
8881
  };
9178
- const register = (modalInstance, uuid) => {
9179
- tryOnUnmounted(() => {
9180
- modalInstanceRef.value = null;
8882
+ }
8883
+ function useContext$1(key2 = Symbol(), defaultValue) {
8884
+ return inject(key2, defaultValue || {});
8885
+ }
8886
+ const key$2 = Symbol();
8887
+ function createModalContext(context) {
8888
+ return createContext(context, key$2);
8889
+ }
8890
+ function useModalContext() {
8891
+ return useContext$1(key$2);
8892
+ }
8893
+ const props$6 = {
8894
+ loading: { type: Boolean },
8895
+ useWrapper: { type: Boolean, default: true },
8896
+ modalHeaderHeight: { type: Number, default: 57 },
8897
+ modalFooterHeight: { type: Number, default: 74 },
8898
+ minHeight: { type: Number, default: 200 },
8899
+ height: { type: Number },
8900
+ footerOffset: { type: Number, default: 0 },
8901
+ visible: { type: Boolean },
8902
+ fullScreen: { type: Boolean },
8903
+ loadingTip: { type: String }
8904
+ };
8905
+ const _sfc_main$$ = defineComponent({
8906
+ name: "ModalWrapper",
8907
+ components: { ScrollContainer },
8908
+ inheritAttrs: false,
8909
+ props: props$6,
8910
+ emits: ["height-change", "ext-height"],
8911
+ setup(props2, { emit }) {
8912
+ const wrapperRef = ref(null);
8913
+ const spinRef = ref(null);
8914
+ const realHeightRef = ref(0);
8915
+ const minRealHeightRef = ref(0);
8916
+ let realHeight = 0;
8917
+ useWindowSizeFn(setModalHeight.bind(null, false));
8918
+ useMutationObserver(
8919
+ spinRef,
8920
+ () => {
8921
+ setModalHeight();
8922
+ },
8923
+ {
8924
+ attributes: true,
8925
+ subtree: true
8926
+ }
8927
+ );
8928
+ createModalContext({
8929
+ redoModalHeight: setModalHeight
8930
+ });
8931
+ const spinStyle = computed(() => {
8932
+ return {
8933
+ minHeight: `${props2.minHeight}px`,
8934
+ [props2.fullScreen ? "height" : "maxHeight"]: `${unref(realHeightRef)}px`
8935
+ };
8936
+ });
8937
+ watchEffect(() => {
8938
+ props2.useWrapper && setModalHeight();
8939
+ });
8940
+ watch(
8941
+ () => props2.fullScreen,
8942
+ (v) => {
8943
+ setModalHeight();
8944
+ if (!v) {
8945
+ realHeightRef.value = minRealHeightRef.value;
8946
+ } else {
8947
+ minRealHeightRef.value = realHeightRef.value;
8948
+ }
8949
+ }
8950
+ );
8951
+ onMounted(() => {
8952
+ const { modalHeaderHeight, modalFooterHeight } = props2;
8953
+ emit("ext-height", modalHeaderHeight + modalFooterHeight);
9181
8954
  });
9182
- uidRef.value = uuid;
9183
- modalInstanceRef.value = modalInstance;
9184
- currentInstance == null ? void 0 : currentInstance.emit("register", modalInstance, uuid);
9185
- };
9186
- watchEffect(() => {
9187
- const data = dataTransfer[unref(uidRef)];
9188
- if (!data)
9189
- return;
9190
- if (!callbackFn || !isFunction$1(callbackFn))
9191
- return;
9192
- nextTick(() => {
9193
- callbackFn(data);
8955
+ onUnmounted(() => {
9194
8956
  });
9195
- });
9196
- return [
9197
- register,
9198
- {
9199
- changeLoading: (loading = true) => {
9200
- var _a2;
9201
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ loading });
9202
- },
9203
- getVisible: computed(() => {
9204
- return visibleData$1[~~unref(uidRef)];
9205
- }),
9206
- changeOkLoading: (loading = true) => {
9207
- var _a2;
9208
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ confirmLoading: loading });
9209
- },
9210
- closeModal: () => {
9211
- var _a2;
9212
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ visible: false });
9213
- },
9214
- setModalProps: (props2) => {
9215
- var _a2;
9216
- (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps(props2);
9217
- },
9218
- redoModalHeight: () => {
8957
+ async function scrollTop() {
8958
+ nextTick(() => {
9219
8959
  var _a2;
9220
- const callRedo = (_a2 = getInstance()) == null ? void 0 : _a2.redoModalHeight;
9221
- callRedo && callRedo();
8960
+ const wrapperRefDom = unref(wrapperRef);
8961
+ if (!wrapperRefDom)
8962
+ return;
8963
+ (_a2 = wrapperRefDom == null ? void 0 : wrapperRefDom.scrollTo) == null ? void 0 : _a2.call(wrapperRefDom, 0);
8964
+ });
8965
+ }
8966
+ async function setModalHeight() {
8967
+ if (!props2.visible)
8968
+ return;
8969
+ const wrapperRefDom = unref(wrapperRef);
8970
+ if (!wrapperRefDom)
8971
+ return;
8972
+ const bodyDom = wrapperRefDom.$el.parentElement;
8973
+ if (!bodyDom)
8974
+ return;
8975
+ bodyDom.style.padding = "0";
8976
+ await nextTick();
8977
+ try {
8978
+ const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
8979
+ if (!modalDom)
8980
+ return;
8981
+ const modalRect = getComputedStyle(modalDom).top;
8982
+ const modalTop = Number.parseInt(modalRect);
8983
+ let maxHeight = window.innerHeight - modalTop * 2 + (props2.footerOffset || 0) - props2.modalFooterHeight - props2.modalHeaderHeight;
8984
+ if (modalTop < 40) {
8985
+ maxHeight -= 26;
8986
+ }
8987
+ await nextTick();
8988
+ const spinEl = unref(spinRef);
8989
+ if (!spinEl)
8990
+ return;
8991
+ await nextTick();
8992
+ realHeight = spinEl.scrollHeight;
8993
+ if (props2.fullScreen) {
8994
+ realHeightRef.value = window.innerHeight - props2.modalFooterHeight - props2.modalHeaderHeight - 28;
8995
+ } else {
8996
+ realHeightRef.value = props2.height ? props2.height : realHeight > maxHeight ? maxHeight : realHeight;
8997
+ }
8998
+ emit("height-change", unref(realHeightRef));
8999
+ } catch (error2) {
9222
9000
  }
9223
9001
  }
9224
- ];
9225
- };
9226
- const BasicModal = withInstall$5(basicModal);
9227
- const basicProps$5 = {
9228
- listType: {
9229
- type: String,
9230
- default: "picture-card"
9231
- },
9232
- helpText: {
9233
- type: String,
9234
- default: ""
9235
- },
9236
- // 文件最大多少MB
9237
- maxSize: {
9238
- type: Number,
9239
- default: 2
9240
- },
9241
- // 最大数量的文件,Infinity不限制
9242
- maxNumber: {
9243
- type: Number,
9244
- default: 1
9245
- },
9246
- // 根据后缀,或者其他
9247
- accept: {
9248
- type: Array,
9249
- default: () => []
9250
- },
9251
- multiple: {
9252
- type: Boolean,
9253
- default: false
9254
- },
9255
- uploadParams: {
9256
- type: Object,
9257
- default: () => ({})
9258
- },
9259
- api: {
9260
- type: Function,
9261
- default: null,
9262
- required: true
9263
- },
9264
- name: {
9265
- type: String,
9266
- default: "file"
9267
- },
9268
- filename: {
9269
- type: String,
9270
- default: null
9271
- },
9272
- fileListOpenDrag: {
9273
- type: Boolean,
9274
- default: true
9275
- },
9276
- fileListDragOptions: {
9277
- type: Object,
9278
- default: () => ({})
9002
+ return { wrapperRef, spinRef, spinStyle, scrollTop, setModalHeight };
9279
9003
  }
9280
- };
9281
- const uploadContainerProps = {
9282
- value: {
9283
- type: Array,
9284
- default: () => []
9285
- },
9286
- ...basicProps$5,
9287
- showPreviewNumber: {
9288
- type: Boolean,
9289
- default: true
9290
- },
9291
- emptyHidePreview: {
9292
- type: Boolean,
9293
- default: false
9004
+ });
9005
+ const _hoisted_1$r = ["loading-tip"];
9006
+ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
9007
+ const _component_ScrollContainer = resolveComponent("ScrollContainer");
9008
+ return openBlock(), createBlock(_component_ScrollContainer, { ref: "wrapperRef" }, {
9009
+ default: withCtx(() => [
9010
+ createElementVNode("div", {
9011
+ ref: "spinRef",
9012
+ style: normalizeStyle(_ctx.spinStyle),
9013
+ "loading-tip": _ctx.loadingTip
9014
+ }, [
9015
+ renderSlot(_ctx.$slots, "default")
9016
+ ], 12, _hoisted_1$r)
9017
+ ]),
9018
+ _: 3
9019
+ }, 512);
9020
+ }
9021
+ const ModalWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$C]]);
9022
+ function getKey$1(namespace, key2) {
9023
+ if (!namespace) {
9024
+ return key2;
9294
9025
  }
9295
- };
9296
- const previewProps = {
9297
- value: {
9298
- type: Array,
9299
- default: () => []
9026
+ if (key2.startsWith(namespace)) {
9027
+ return key2;
9300
9028
  }
9301
- };
9302
- const fileListProps = {
9303
- columns: {
9304
- type: Array,
9305
- default: null
9306
- },
9307
- actionColumn: {
9308
- type: Object,
9309
- default: null
9310
- },
9311
- dataSource: {
9312
- type: Array,
9313
- default: null
9029
+ return `${namespace}.${key2}`;
9030
+ }
9031
+ function useI18n(namespace) {
9032
+ const normalFn = {
9033
+ t: (key2) => {
9034
+ return getKey$1(namespace, key2);
9035
+ }
9036
+ };
9037
+ {
9038
+ return normalFn;
9039
+ }
9040
+ }
9041
+ const _sfc_main$_ = defineComponent({
9042
+ name: "ModalClose",
9043
+ components: {
9044
+ Tooltip,
9045
+ FullscreenExitOutlined: FullscreenExitOutlined$1,
9046
+ FullscreenOutlined: FullscreenOutlined$1,
9047
+ CloseOutlined: CloseOutlined$1
9314
9048
  },
9315
- openDrag: {
9316
- type: Boolean,
9317
- default: false
9049
+ props: {
9050
+ canFullscreen: { type: Boolean, default: true },
9051
+ fullScreen: { type: Boolean }
9318
9052
  },
9319
- dragOptions: {
9320
- type: Object,
9321
- default: () => ({})
9322
- }
9323
- };
9324
- useI18n$1();
9325
- function useUploadType({
9326
- acceptRef,
9327
- helpTextRef,
9328
- maxNumberRef,
9329
- maxSizeRef
9330
- }) {
9331
- const getAccept = computed(() => {
9332
- const accept = unref(acceptRef);
9333
- if (accept && accept.length > 0) {
9334
- return accept;
9335
- }
9336
- return [];
9337
- });
9338
- const getStringAccept = computed(() => {
9339
- return unref(getAccept).map((item) => {
9340
- if (item.indexOf("/") > 0 || item.startsWith(".")) {
9341
- return item;
9342
- } else {
9343
- return `.${item}`;
9344
- }
9345
- }).join(",");
9346
- });
9347
- const getHelpText = computed(() => {
9348
- const helpText = unref(helpTextRef);
9349
- if (helpText) {
9350
- return helpText;
9053
+ emits: ["cancel", "fullscreen"],
9054
+ setup(props2, { emit }) {
9055
+ const prefixCls2 = "shy-basic-modal-close";
9056
+ const { t: t2 } = useI18n();
9057
+ const getClass = computed(() => {
9058
+ return [
9059
+ prefixCls2,
9060
+ `${prefixCls2}--custom`,
9061
+ {
9062
+ [`${prefixCls2}--can-full`]: props2.canFullscreen
9063
+ }
9064
+ ];
9065
+ });
9066
+ function handleCancel(e) {
9067
+ emit("cancel", e);
9351
9068
  }
9352
- const helpTexts = [];
9353
- const accept = unref(acceptRef);
9354
- if (accept.length > 0) {
9355
- helpTexts.push(`支持${accept}格式`);
9069
+ function handleFullScreen(e) {
9070
+ e == null ? void 0 : e.stopPropagation();
9071
+ e == null ? void 0 : e.preventDefault();
9072
+ emit("fullscreen");
9356
9073
  }
9357
- const maxSize = unref(maxSizeRef);
9358
- if (maxSize) {
9359
- helpTexts.push(`单个文件不超过${maxSize}MB`);
9074
+ return {
9075
+ t: t2,
9076
+ getClass,
9077
+ prefixCls: prefixCls2,
9078
+ handleCancel,
9079
+ handleFullScreen
9080
+ };
9081
+ }
9082
+ });
9083
+ const ModalClose_vue_vue_type_style_index_0_lang = "";
9084
+ function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
9085
+ const _component_FullscreenExitOutlined = resolveComponent("FullscreenExitOutlined");
9086
+ const _component_Tooltip = resolveComponent("Tooltip");
9087
+ const _component_FullscreenOutlined = resolveComponent("FullscreenOutlined");
9088
+ const _component_CloseOutlined = resolveComponent("CloseOutlined");
9089
+ return openBlock(), createElementBlock("div", {
9090
+ class: normalizeClass(_ctx.getClass)
9091
+ }, [
9092
+ _ctx.canFullscreen ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
9093
+ _ctx.fullScreen ? (openBlock(), createBlock(_component_Tooltip, {
9094
+ key: 0,
9095
+ title: "还原",
9096
+ placement: "bottom"
9097
+ }, {
9098
+ default: withCtx(() => [
9099
+ createVNode(_component_FullscreenExitOutlined, {
9100
+ role: "full",
9101
+ onClick: _ctx.handleFullScreen
9102
+ }, null, 8, ["onClick"])
9103
+ ]),
9104
+ _: 1
9105
+ })) : (openBlock(), createBlock(_component_Tooltip, {
9106
+ key: 1,
9107
+ title: "全屏",
9108
+ placement: "bottom"
9109
+ }, {
9110
+ default: withCtx(() => [
9111
+ createVNode(_component_FullscreenOutlined, {
9112
+ role: "close",
9113
+ onClick: _ctx.handleFullScreen
9114
+ }, null, 8, ["onClick"])
9115
+ ]),
9116
+ _: 1
9117
+ }))
9118
+ ], 64)) : createCommentVNode("", true),
9119
+ createVNode(_component_Tooltip, {
9120
+ title: "关闭",
9121
+ placement: "bottom"
9122
+ }, {
9123
+ default: withCtx(() => [
9124
+ createVNode(_component_CloseOutlined, { onClick: _ctx.handleCancel }, null, 8, ["onClick"])
9125
+ ]),
9126
+ _: 1
9127
+ })
9128
+ ], 2);
9129
+ }
9130
+ const ModalClose = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$B]]);
9131
+ const _sfc_main$Z = defineComponent({
9132
+ name: "BasicModalFooter",
9133
+ props: basicProps$6,
9134
+ emits: ["ok", "cancel"],
9135
+ setup(_, { emit }) {
9136
+ function handleOk(e) {
9137
+ emit("ok", e);
9360
9138
  }
9361
- const maxNumber = unref(maxNumberRef);
9362
- if (maxNumber && maxNumber !== Infinity) {
9363
- helpTexts.push(`最多只能上传${maxNumber}个文件`);
9139
+ function handleCancel(e) {
9140
+ emit("cancel", e);
9364
9141
  }
9365
- return helpTexts.join(",");
9366
- });
9367
- return { getAccept, getStringAccept, getHelpText };
9142
+ return { handleOk, handleCancel };
9143
+ }
9144
+ });
9145
+ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
9146
+ const _component_a_button = resolveComponent("a-button");
9147
+ return openBlock(), createElementBlock("div", null, [
9148
+ renderSlot(_ctx.$slots, "insertFooter"),
9149
+ _ctx.showCancelBtn ? (openBlock(), createBlock(_component_a_button, mergeProps({ key: 0 }, _ctx.cancelButtonProps, { onClick: _ctx.handleCancel }), {
9150
+ default: withCtx(() => [
9151
+ createTextVNode(toDisplayString(_ctx.cancelText), 1)
9152
+ ]),
9153
+ _: 1
9154
+ }, 16, ["onClick"])) : createCommentVNode("", true),
9155
+ renderSlot(_ctx.$slots, "centerFooter"),
9156
+ _ctx.showOkBtn ? (openBlock(), createBlock(_component_a_button, mergeProps({
9157
+ key: 1,
9158
+ type: _ctx.okType,
9159
+ onClick: _ctx.handleOk,
9160
+ loading: _ctx.confirmLoading
9161
+ }, _ctx.okButtonProps), {
9162
+ default: withCtx(() => [
9163
+ createTextVNode(toDisplayString(_ctx.okText), 1)
9164
+ ]),
9165
+ _: 1
9166
+ }, 16, ["type", "onClick", "loading"])) : createCommentVNode("", true),
9167
+ renderSlot(_ctx.$slots, "appendFooter")
9168
+ ]);
9368
9169
  }
9369
- var UploadResultStatus = /* @__PURE__ */ ((UploadResultStatus2) => {
9370
- UploadResultStatus2["DONE"] = "done";
9371
- UploadResultStatus2["SUCCESS"] = "success";
9372
- UploadResultStatus2["ERROR"] = "error";
9373
- UploadResultStatus2["UPLOADING"] = "uploading";
9374
- return UploadResultStatus2;
9375
- })(UploadResultStatus || {});
9376
- function checkImgType(file) {
9377
- return isImgTypeByName(file.name);
9170
+ const ModalFooter = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$A]]);
9171
+ function deepMerge(src = {}, target = {}) {
9172
+ let key2;
9173
+ const res = cloneDeep(src);
9174
+ for (key2 in target) {
9175
+ res[key2] = isObject$1(res[key2]) ? deepMerge(res[key2], target[key2]) : res[key2] = target[key2];
9176
+ }
9177
+ return res;
9378
9178
  }
9379
- function isImgTypeByName(name) {
9380
- return /\.(jpg|jpeg|png|gif|webp)$/i.test(name);
9179
+ function getPopupContainer(node) {
9180
+ return (node == null ? void 0 : node.parentNode) ?? document.body;
9381
9181
  }
9382
- function getBase64WithFile(file) {
9383
- return new Promise((resolve, reject) => {
9384
- const reader = new FileReader();
9385
- reader.readAsDataURL(file);
9386
- reader.onload = () => resolve({ result: reader.result, file });
9387
- reader.onerror = (error2) => reject(error2);
9388
- });
9182
+ function useContext(key2 = Symbol(), defaultValue) {
9183
+ return inject(key2, defaultValue || {});
9389
9184
  }
9390
- const validColors = ["error", "warning", "success", ""];
9391
- const buttonProps = {
9185
+ const key$1 = Symbol();
9186
+ function useAppProviderContext() {
9187
+ return useContext(key$1);
9188
+ }
9189
+ function useDesign(scope) {
9190
+ const values = useAppProviderContext();
9191
+ return {
9192
+ // prefixCls: computed(() => `${values.prefixCls}-${scope}`),
9193
+ prefixCls: `${values.prefixCls}-${scope}`,
9194
+ prefixVar: values.prefixCls
9195
+ // style,
9196
+ };
9197
+ }
9198
+ const props$5 = {
9199
+ /**
9200
+ * Help text max-width
9201
+ * @default: 600px
9202
+ */
9203
+ maxWidth: {
9204
+ type: String,
9205
+ default: "600px"
9206
+ },
9207
+ /**
9208
+ * Whether to display the serial number
9209
+ * @default: false
9210
+ */
9211
+ showIndex: {
9212
+ type: Boolean
9213
+ },
9214
+ /**
9215
+ * Help text font color
9216
+ * @default: #ffffff
9217
+ */
9392
9218
  color: {
9393
9219
  type: String,
9394
- validator: (v) => validColors.includes(v),
9395
- default: ""
9220
+ default: "#ffffff"
9396
9221
  },
9397
- loading: { type: Boolean },
9398
- disabled: { type: Boolean },
9399
9222
  /**
9400
- * Text before icon.
9223
+ * Help text font size
9224
+ * @default: 14px
9401
9225
  */
9402
- preIcon: { type: String },
9226
+ fontSize: {
9227
+ type: String,
9228
+ default: "14px"
9229
+ },
9403
9230
  /**
9404
- * Text after icon.
9231
+ * Help text list
9405
9232
  */
9406
- postIcon: { type: String },
9233
+ placement: {
9234
+ type: String,
9235
+ default: "right"
9236
+ },
9407
9237
  /**
9408
- * preIcon and postIcon icon size.
9409
- * @default: 14
9238
+ * Help text list
9410
9239
  */
9411
- iconSize: { type: Number, default: 14 },
9412
- onClick: { type: Function, default: null }
9240
+ text: {
9241
+ type: [Array, String]
9242
+ }
9413
9243
  };
9414
- const __default__$3 = defineComponent({
9415
- name: "AButton",
9416
- extends: Button$1,
9417
- inheritAttrs: false
9244
+ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9245
+ name: "BasicHelp",
9246
+ components: {
9247
+ Tooltip
9248
+ },
9249
+ props: props$5,
9250
+ setup(props2, {
9251
+ slots
9252
+ }) {
9253
+ const {
9254
+ prefixCls: prefixCls2
9255
+ } = useDesign("basic-help");
9256
+ const getTooltipStyle = computed(() => ({
9257
+ color: props2.color,
9258
+ fontSize: props2.fontSize
9259
+ }));
9260
+ const getOverlayStyle = computed(() => ({
9261
+ maxWidth: props2.maxWidth
9262
+ }));
9263
+ function renderTitle() {
9264
+ const textList = props2.text;
9265
+ if (isString$1(textList)) {
9266
+ return createVNode("p", null, [textList]);
9267
+ }
9268
+ if (isArray(textList)) {
9269
+ return textList.map((text, index2) => {
9270
+ return createVNode("p", {
9271
+ "key": text
9272
+ }, [createVNode(Fragment, null, [props2.showIndex ? `${index2 + 1}. ` : "", text])]);
9273
+ });
9274
+ }
9275
+ return null;
9276
+ }
9277
+ return () => {
9278
+ return createVNode(Tooltip, {
9279
+ "overlayClassName": `${prefixCls2}__wrap`,
9280
+ "title": createVNode("div", {
9281
+ "style": unref(getTooltipStyle)
9282
+ }, [renderTitle()]),
9283
+ "autoAdjustOverflow": true,
9284
+ "overlayStyle": unref(getOverlayStyle),
9285
+ "placement": props2.placement,
9286
+ "getPopupContainer": () => getPopupContainer()
9287
+ }, {
9288
+ default: () => [createVNode("span", {
9289
+ "class": prefixCls2
9290
+ }, [getSlot(slots) || createVNode(InfoCircleOutlined$1, null, null)])]
9291
+ });
9292
+ };
9293
+ }
9418
9294
  });
9419
- const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9420
- ...__default__$3,
9421
- props: buttonProps,
9295
+ const BasicHelp_vue_vue_type_style_index_0_lang = "";
9296
+ const prefixCls$3 = "shy-basic-title";
9297
+ const _sfc_main$X = /* @__PURE__ */ defineComponent({
9298
+ __name: "BasicTitle",
9299
+ props: {
9300
+ /**
9301
+ * Help text list or string
9302
+ * @default: ''
9303
+ */
9304
+ helpMessage: {
9305
+ type: [String, Array],
9306
+ default: ""
9307
+ },
9308
+ /**
9309
+ * Whether the color block on the left side of the title
9310
+ * @default: false
9311
+ */
9312
+ span: { type: Boolean },
9313
+ /**
9314
+ * Whether to default the text, that is, not bold
9315
+ * @default: false
9316
+ */
9317
+ normal: { type: Boolean }
9318
+ },
9422
9319
  setup(__props) {
9423
9320
  const props2 = __props;
9424
- const attrs = useAttrs$1({ excludeDefaultKeys: false });
9425
- const getButtonClass = computed(() => {
9426
- const { color, disabled } = props2;
9427
- return [
9428
- {
9429
- [`ant-btn-${color}`]: !!color,
9430
- [`is-disabled`]: disabled
9431
- }
9432
- ];
9433
- });
9434
- const getBindValue = computed(() => ({ ...unref(attrs), ...props2 }));
9321
+ const slots = useSlots();
9322
+ const getClass = computed(() => [
9323
+ prefixCls$3,
9324
+ { [`${prefixCls$3}-show-span`]: props2.span && slots.default },
9325
+ { [`${prefixCls$3}-normal`]: props2.normal }
9326
+ ]);
9435
9327
  return (_ctx, _cache) => {
9436
- return openBlock(), createBlock(unref(Button$1), mergeProps(getBindValue.value, {
9437
- class: getButtonClass.value,
9438
- onClick: props2.onClick
9439
- }), {
9440
- default: withCtx((data) => [
9441
- props2.preIcon ? (openBlock(), createBlock(unref(Icon2), {
9442
- key: 0,
9443
- icon: props2.preIcon,
9444
- size: props2.iconSize
9445
- }, null, 8, ["icon", "size"])) : createCommentVNode("", true),
9446
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(data || {}))),
9447
- props2.postIcon ? (openBlock(), createBlock(unref(Icon2), {
9448
- key: 1,
9449
- icon: props2.postIcon,
9450
- size: props2.iconSize
9451
- }, null, 8, ["icon", "size"])) : createCommentVNode("", true)
9452
- ]),
9453
- _: 3
9454
- }, 16, ["class", "onClick"]);
9328
+ return openBlock(), createElementBlock("span", {
9329
+ class: normalizeClass(getClass.value)
9330
+ }, [
9331
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
9332
+ __props.helpMessage ? (openBlock(), createBlock(_sfc_main$Y, {
9333
+ key: 0,
9334
+ class: normalizeClass(`${prefixCls$3}-help`),
9335
+ text: __props.helpMessage
9336
+ }, null, 8, ["class", "text"])) : createCommentVNode("", true)
9337
+ ], 2);
9455
9338
  };
9456
9339
  }
9457
9340
  });
9458
- const props$5 = {
9459
- /**
9460
- * Whether to enable the drop-down menu
9461
- * @default: true
9462
- */
9463
- enable: {
9464
- type: Boolean,
9465
- default: true
9341
+ const BasicTitle_vue_vue_type_style_index_0_scoped_a48f9d86_lang = "";
9342
+ const BasicTitle = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-a48f9d86"]]);
9343
+ const _sfc_main$W = defineComponent({
9344
+ name: "BasicModalHeader",
9345
+ components: { BasicTitle },
9346
+ props: {
9347
+ helpMessage: {
9348
+ type: [String, Array]
9349
+ },
9350
+ title: { type: String }
9351
+ },
9352
+ emits: ["dblclick"]
9353
+ });
9354
+ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
9355
+ const _component_BasicTitle = resolveComponent("BasicTitle");
9356
+ return openBlock(), createBlock(_component_BasicTitle, { helpMessage: _ctx.helpMessage }, {
9357
+ default: withCtx(() => [
9358
+ createTextVNode(toDisplayString(_ctx.title), 1)
9359
+ ]),
9360
+ _: 1
9361
+ }, 8, ["helpMessage"]);
9362
+ }
9363
+ const ModalHeader = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$z]]);
9364
+ function useFullScreen(context) {
9365
+ const fullScreenRef = ref(false);
9366
+ const getWrapClassName = computed(() => {
9367
+ const clsName = unref(context.wrapClassName) || "";
9368
+ return unref(fullScreenRef) ? `fullscreen-modal ${clsName} ` : unref(clsName);
9369
+ });
9370
+ function handleFullScreen(e) {
9371
+ e && e.stopPropagation();
9372
+ fullScreenRef.value = !unref(fullScreenRef);
9466
9373
  }
9467
- };
9468
- const _sfc_main$X = defineComponent({
9469
- name: "PopButton",
9374
+ return { getWrapClassName, handleFullScreen, fullScreenRef };
9375
+ }
9376
+ const _sfc_main$V = defineComponent({
9377
+ name: "BasicModal",
9378
+ components: { Modal: Modal$1, ModalWrapper, ModalClose, ModalFooter, ModalHeader },
9470
9379
  inheritAttrs: false,
9471
- props: props$5,
9472
- setup(props2, { slots }) {
9473
- const attrs = useAttrs$1();
9474
- const getBindValues = computed(() => {
9475
- return Object.assign(
9476
- {
9477
- okText: "确定",
9478
- cancelText: "取消"
9479
- },
9480
- { ...props2, ...unref(attrs) }
9481
- );
9482
- });
9483
- return () => {
9484
- const bindValues = omit$1(unref(getBindValues), "icon");
9485
- const btnBind = omit$1(bindValues, "title");
9486
- if (btnBind.disabled)
9487
- btnBind.color = "";
9488
- const Button2 = h(_sfc_main$Y, btnBind, extendSlots$1(slots));
9489
- if (!props2.enable) {
9490
- return Button2;
9380
+ props: basicProps$6,
9381
+ emits: [
9382
+ "visible-change",
9383
+ "height-change",
9384
+ "cancel",
9385
+ "ok",
9386
+ "register",
9387
+ "update:visible"
9388
+ ],
9389
+ setup(props2, { emit, attrs }) {
9390
+ const visibleRef = ref(false);
9391
+ const propsRef = ref(null);
9392
+ const modalWrapperRef = ref(null);
9393
+ const prefixCls2 = "shy-basic-modal";
9394
+ const extHeightRef = ref(0);
9395
+ const modalMethods = {
9396
+ setModalProps,
9397
+ emitVisible: void 0,
9398
+ redoModalHeight: () => {
9399
+ nextTick(() => {
9400
+ if (unref(modalWrapperRef)) {
9401
+ unref(modalWrapperRef).setModalHeight();
9402
+ }
9403
+ });
9491
9404
  }
9492
- return h(Popconfirm, bindValues, { default: () => Button2 });
9493
9405
  };
9494
- }
9495
- });
9496
- const Button = withInstall$5(_sfc_main$Y);
9497
- const _hoisted_1$r = { class: "ml-1" };
9498
- const _hoisted_2$8 = { class: "ml-1" };
9499
- const _sfc_main$W = /* @__PURE__ */ defineComponent({
9500
- __name: "Dropdown",
9501
- props: {
9502
- popconfirm: Boolean,
9503
- /**
9504
- * the trigger mode which executes the drop-down action
9505
- * @default ['hover']
9506
- * @type string[]
9507
- */
9508
- trigger: {
9509
- type: [Array],
9510
- default: () => {
9511
- return ["contextmenu"];
9406
+ const instance = getCurrentInstance();
9407
+ if (instance) {
9408
+ emit("register", modalMethods, instance.uid);
9409
+ }
9410
+ const getMergeProps = computed(() => {
9411
+ return {
9412
+ ...props2,
9413
+ ...unref(propsRef)
9414
+ };
9415
+ });
9416
+ const { handleFullScreen, getWrapClassName, fullScreenRef } = useFullScreen(
9417
+ {
9418
+ modalWrapperRef,
9419
+ extHeightRef,
9420
+ wrapClassName: toRef(getMergeProps.value, "wrapClassName")
9421
+ }
9422
+ );
9423
+ const getProps = computed(() => {
9424
+ const opt = {
9425
+ ...unref(getMergeProps),
9426
+ visible: unref(visibleRef),
9427
+ okButtonProps: void 0,
9428
+ cancelButtonProps: void 0,
9429
+ title: void 0
9430
+ };
9431
+ return {
9432
+ ...opt,
9433
+ wrapClassName: unref(getWrapClassName)
9434
+ };
9435
+ });
9436
+ const getBindValue = computed(() => {
9437
+ const attr = {
9438
+ ...attrs,
9439
+ ...unref(getMergeProps),
9440
+ visible: unref(visibleRef),
9441
+ wrapClassName: unref(getWrapClassName)
9442
+ };
9443
+ if (unref(fullScreenRef)) {
9444
+ return omit$1(attr, ["height", "title"]);
9445
+ }
9446
+ return omit$1(attr, "title");
9447
+ });
9448
+ const getWrapperHeight = computed(() => {
9449
+ if (unref(fullScreenRef))
9450
+ return void 0;
9451
+ return unref(getProps).height;
9452
+ });
9453
+ watchEffect(() => {
9454
+ visibleRef.value = !!props2.visible;
9455
+ fullScreenRef.value = !!props2.defaultFullscreen;
9456
+ });
9457
+ watch(
9458
+ () => unref(visibleRef),
9459
+ (v) => {
9460
+ var _a2;
9461
+ emit("visible-change", v);
9462
+ emit("update:visible", v);
9463
+ instance && ((_a2 = modalMethods.emitVisible) == null ? void 0 : _a2.call(modalMethods, v, instance.uid));
9464
+ nextTick(() => {
9465
+ if (props2.scrollTop && v && unref(modalWrapperRef)) {
9466
+ unref(modalWrapperRef).scrollTop();
9467
+ }
9468
+ });
9469
+ },
9470
+ {
9471
+ immediate: false
9472
+ }
9473
+ );
9474
+ async function handleCancel(e) {
9475
+ var _a2, _b;
9476
+ e == null ? void 0 : e.stopPropagation();
9477
+ if ((_b = (_a2 = e.target) == null ? void 0 : _a2.classList) == null ? void 0 : _b.contains(
9478
+ prefixCls2 + "-close--custom"
9479
+ ))
9480
+ return;
9481
+ if (props2.closeFunc && isFunction$1(props2.closeFunc)) {
9482
+ const isClose = await props2.closeFunc();
9483
+ visibleRef.value = !isClose;
9484
+ return;
9485
+ }
9486
+ visibleRef.value = false;
9487
+ emit("cancel", e);
9488
+ }
9489
+ function setModalProps(props22) {
9490
+ propsRef.value = deepMerge(unref(propsRef) || {}, props22);
9491
+ if (Reflect.has(props22, "visible")) {
9492
+ visibleRef.value = !!props22.visible;
9493
+ }
9494
+ if (Reflect.has(props22, "defaultFullscreen")) {
9495
+ fullScreenRef.value = !!props22.defaultFullscreen;
9512
9496
  }
9513
- },
9514
- dropMenuList: {
9515
- type: Array,
9516
- default: () => []
9517
- },
9518
- selectedKeys: {
9519
- type: Array,
9520
- default: () => []
9521
9497
  }
9522
- },
9523
- emits: ["menuEvent"],
9524
- setup(__props, { emit: __emit }) {
9525
- const ADropdown = Dropdown;
9526
- const AMenu = Menu;
9527
- const AMenuItem = Menu.Item;
9528
- const AMenuDivider = Menu.Divider;
9529
- const APopconfirm = Popconfirm;
9530
- const props2 = __props;
9531
- const emit = __emit;
9532
- function handleClickMenu(item) {
9533
- var _a2;
9534
- const { event } = item;
9535
- const menu = props2.dropMenuList.find((item2) => `${item2.event}` === `${event}`);
9536
- emit("menuEvent", menu);
9537
- (_a2 = item.onClick) == null ? void 0 : _a2.call(item);
9498
+ function handleOk(e) {
9499
+ emit("ok", e);
9538
9500
  }
9539
- const getPopConfirmAttrs = computed(() => {
9540
- return (attrs) => {
9541
- const originAttrs = omit$1(attrs, ["confirm", "cancel", "icon"]);
9542
- if (!attrs.onConfirm && attrs.confirm && isFunction$4(attrs.confirm))
9543
- originAttrs["onConfirm"] = attrs.confirm;
9544
- if (!attrs.onCancel && attrs.cancel && isFunction$4(attrs.cancel))
9545
- originAttrs["onCancel"] = attrs.cancel;
9546
- return originAttrs;
9547
- };
9548
- });
9549
- const getAttr = (key2) => ({ key: key2 });
9550
- return (_ctx, _cache) => {
9551
- return openBlock(), createBlock(unref(ADropdown), mergeProps({ trigger: __props.trigger }, _ctx.$attrs), {
9552
- overlay: withCtx(() => [
9553
- createVNode(unref(AMenu), { selectedKeys: __props.selectedKeys }, {
9554
- default: withCtx(() => [
9555
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropMenuList, (item) => {
9556
- return openBlock(), createElementBlock(Fragment, {
9557
- key: `${item.event}`
9558
- }, [
9559
- createVNode(unref(AMenuItem), mergeProps({ ref_for: true }, getAttr(item.event), {
9560
- onClick: ($event) => handleClickMenu(item),
9561
- disabled: item.disabled
9562
- }), {
9563
- default: withCtx(() => [
9564
- __props.popconfirm && item.popConfirm ? (openBlock(), createBlock(unref(APopconfirm), mergeProps({
9565
- key: 0,
9566
- ref_for: true
9567
- }, getPopConfirmAttrs.value(item.popConfirm)), createSlots({
9568
- default: withCtx(() => [
9569
- createElementVNode("div", null, [
9570
- item.icon ? (openBlock(), createBlock(unref(Icon2), {
9571
- key: 0,
9572
- icon: item.icon
9573
- }, null, 8, ["icon"])) : createCommentVNode("", true),
9574
- createElementVNode("span", _hoisted_1$r, toDisplayString(item.text), 1)
9575
- ])
9576
- ]),
9577
- _: 2
9578
- }, [
9579
- item.popConfirm.icon ? {
9580
- name: "icon",
9581
- fn: withCtx(() => [
9582
- createVNode(unref(Icon2), {
9583
- icon: item.popConfirm.icon
9584
- }, null, 8, ["icon"])
9585
- ]),
9586
- key: "0"
9587
- } : void 0
9588
- ]), 1040)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
9589
- item.icon ? (openBlock(), createBlock(unref(Icon2), {
9590
- key: 0,
9591
- icon: item.icon
9592
- }, null, 8, ["icon"])) : createCommentVNode("", true),
9593
- createElementVNode("span", _hoisted_2$8, toDisplayString(item.text), 1)
9594
- ], 64))
9595
- ]),
9596
- _: 2
9597
- }, 1040, ["onClick", "disabled"]),
9598
- item.divider ? (openBlock(), createBlock(unref(AMenuDivider), {
9599
- key: `d-${item.event}`
9600
- })) : createCommentVNode("", true)
9601
- ], 64);
9602
- }), 128))
9603
- ]),
9604
- _: 1
9605
- }, 8, ["selectedKeys"])
9606
- ]),
9607
- default: withCtx(() => [
9608
- createElementVNode("span", null, [
9609
- renderSlot(_ctx.$slots, "default")
9610
- ])
9611
- ]),
9612
- _: 3
9613
- }, 16, ["trigger"]);
9501
+ function handleHeightChange(height) {
9502
+ emit("height-change", height);
9503
+ }
9504
+ function handleExtHeight(height) {
9505
+ extHeightRef.value = height;
9506
+ }
9507
+ function handleTitleDbClick(e) {
9508
+ if (!props2.canFullscreen)
9509
+ return;
9510
+ e.stopPropagation();
9511
+ handleFullScreen(e);
9512
+ }
9513
+ return {
9514
+ handleCancel,
9515
+ getBindValue,
9516
+ getProps,
9517
+ handleFullScreen,
9518
+ fullScreenRef,
9519
+ getMergeProps,
9520
+ handleOk,
9521
+ visibleRef,
9522
+ omit: omit$1,
9523
+ modalWrapperRef,
9524
+ handleExtHeight,
9525
+ handleHeightChange,
9526
+ handleTitleDbClick,
9527
+ getWrapperHeight
9614
9528
  };
9615
9529
  }
9616
9530
  });
9617
- const key$1 = Symbol("basic-table");
9618
- function createTableContext(instance) {
9619
- provide(key$1, instance);
9531
+ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
9532
+ const _component_ModalClose = resolveComponent("ModalClose");
9533
+ const _component_ModalHeader = resolveComponent("ModalHeader");
9534
+ const _component_ModalFooter = resolveComponent("ModalFooter");
9535
+ const _component_ModalWrapper = resolveComponent("ModalWrapper");
9536
+ const _component_Modal = resolveComponent("Modal");
9537
+ return openBlock(), createBlock(_component_Modal, mergeProps({ class: "modal-wrapper" }, _ctx.getBindValue, { onCancel: _ctx.handleCancel }), createSlots({
9538
+ default: withCtx(() => [
9539
+ createVNode(_component_ModalWrapper, mergeProps(
9540
+ {
9541
+ useWrapper: _ctx.getProps.useWrapper,
9542
+ footerOffset: _ctx.wrapperFooterOffset,
9543
+ fullScreen: _ctx.fullScreenRef,
9544
+ ref: "modalWrapperRef",
9545
+ loading: _ctx.getProps.loading,
9546
+ "loading-tip": _ctx.getProps.loadingTip,
9547
+ minHeight: _ctx.getProps.minHeight,
9548
+ height: _ctx.getWrapperHeight,
9549
+ visible: _ctx.visibleRef,
9550
+ modalFooterHeight: _ctx.footer !== void 0 && !_ctx.footer ? 0 : void 0
9551
+ },
9552
+ _ctx.omit(_ctx.getProps.wrapperProps, "visible", "height", "modalFooterHeight"),
9553
+ {
9554
+ onExtHeight: _ctx.handleExtHeight,
9555
+ onHeightChange: _ctx.handleHeightChange
9556
+ }
9557
+ ), {
9558
+ default: withCtx(() => [
9559
+ renderSlot(_ctx.$slots, "default")
9560
+ ]),
9561
+ _: 3
9562
+ }, 16, ["useWrapper", "footerOffset", "fullScreen", "loading", "loading-tip", "minHeight", "height", "visible", "modalFooterHeight", "onExtHeight", "onHeightChange"])
9563
+ ]),
9564
+ _: 2
9565
+ }, [
9566
+ !_ctx.$slots.closeIcon ? {
9567
+ name: "closeIcon",
9568
+ fn: withCtx(() => [
9569
+ createVNode(_component_ModalClose, {
9570
+ canFullscreen: _ctx.getProps.canFullscreen,
9571
+ fullScreen: _ctx.fullScreenRef,
9572
+ onCancel: _ctx.handleCancel,
9573
+ onFullscreen: _ctx.handleFullScreen
9574
+ }, null, 8, ["canFullscreen", "fullScreen", "onCancel", "onFullscreen"])
9575
+ ]),
9576
+ key: "0"
9577
+ } : void 0,
9578
+ !_ctx.$slots.title ? {
9579
+ name: "title",
9580
+ fn: withCtx(() => [
9581
+ createVNode(_component_ModalHeader, {
9582
+ helpMessage: _ctx.getProps.helpMessage,
9583
+ title: _ctx.getMergeProps.title,
9584
+ onDblclick: _ctx.handleTitleDbClick
9585
+ }, null, 8, ["helpMessage", "title", "onDblclick"])
9586
+ ]),
9587
+ key: "1"
9588
+ } : void 0,
9589
+ !_ctx.$slots.footer ? {
9590
+ name: "footer",
9591
+ fn: withCtx(() => [
9592
+ createVNode(_component_ModalFooter, mergeProps(_ctx.getBindValue, {
9593
+ onOk: _ctx.handleOk,
9594
+ onCancel: _ctx.handleCancel
9595
+ }), createSlots({ _: 2 }, [
9596
+ renderList(Object.keys(_ctx.$slots), (item) => {
9597
+ return {
9598
+ name: item,
9599
+ fn: withCtx((data) => [
9600
+ renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
9601
+ ])
9602
+ };
9603
+ })
9604
+ ]), 1040, ["onOk", "onCancel"])
9605
+ ]),
9606
+ key: "2"
9607
+ } : void 0,
9608
+ renderList(Object.keys(_ctx.omit(_ctx.$slots, "default")), (item) => {
9609
+ return {
9610
+ name: item,
9611
+ fn: withCtx((data) => [
9612
+ renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
9613
+ ])
9614
+ };
9615
+ })
9616
+ ]), 1040, ["onCancel"]);
9620
9617
  }
9621
- function useTableContext() {
9622
- return inject(key$1);
9618
+ const basicModal = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$y]]);
9619
+ const projectName = {}.VITE_GLOB_APP_TITLE;
9620
+ function error(message) {
9621
+ throw new Error(`[${projectName} error]:${message}`);
9623
9622
  }
9624
- const componentSetting = {
9625
- // basic-table setting
9626
- table: {
9627
- // Form interface request general configuration
9628
- // support xxx.xxx.xxx
9629
- fetchSetting: {
9630
- // The field name of the current page passed to the background
9631
- pageField: "current",
9632
- // The number field name of each page displayed in the background
9633
- sizeField: "size",
9634
- // Field name of the form data returned by the interface
9635
- listField: "records",
9636
- // Total number of tables returned by the interface field name
9637
- totalField: "total"
9623
+ const dataTransfer = reactive({});
9624
+ const visibleData$1 = reactive({});
9625
+ function useModal() {
9626
+ const modal2 = ref(null);
9627
+ const loaded = ref(false);
9628
+ const uid = ref("");
9629
+ function register(modalMethod, uuid) {
9630
+ if (!getCurrentInstance()) {
9631
+ throw new Error(
9632
+ "useModal() can only be used inside setup() or functional components!"
9633
+ );
9634
+ }
9635
+ uid.value = uuid;
9636
+ onUnmounted(() => {
9637
+ modal2.value = null;
9638
+ loaded.value = false;
9639
+ dataTransfer[unref(uid)] = null;
9640
+ });
9641
+ if (unref(loaded) && modalMethod === unref(modal2))
9642
+ return;
9643
+ modal2.value = modalMethod;
9644
+ loaded.value = true;
9645
+ modalMethod.emitVisible = (visible, uid2) => {
9646
+ visibleData$1[uid2] = visible;
9647
+ };
9648
+ }
9649
+ const getInstance = () => {
9650
+ const instance = unref(modal2);
9651
+ if (!instance) {
9652
+ error("useModal instance is undefined!");
9653
+ }
9654
+ return instance;
9655
+ };
9656
+ const methods2 = {
9657
+ setModalProps: (props2) => {
9658
+ var _a2;
9659
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps(props2);
9638
9660
  },
9639
- // Number of pages that can be selected
9640
- pageSizeOptions: ["10", "50", "80", "100"],
9641
- // Default display quantity on one page
9642
- defaultPageSize: 10,
9643
- // Default Size
9644
- defaultSize: "middle",
9645
- // Custom general sort function
9646
- defaultSortFn: (sortInfo) => {
9647
- const { field, order } = sortInfo;
9648
- if (field && order) {
9649
- return {
9650
- // The sort field passed to the backend you
9651
- sort: field,
9652
- // Sorting method passed to the background asc/desc
9653
- order: order === "ascend" ? "asc" : "desc"
9654
- };
9655
- } else {
9656
- return {};
9661
+ getVisible: computed(() => {
9662
+ return visibleData$1[~~unref(uid)];
9663
+ }),
9664
+ redoModalHeight: () => {
9665
+ var _a2, _b;
9666
+ (_b = (_a2 = getInstance()) == null ? void 0 : _a2.redoModalHeight) == null ? void 0 : _b.call(_a2);
9667
+ },
9668
+ openModal: (visible = true, data, openOnSet = true) => {
9669
+ var _a2;
9670
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({
9671
+ visible
9672
+ });
9673
+ if (!data)
9674
+ return;
9675
+ const id = unref(uid);
9676
+ if (openOnSet) {
9677
+ dataTransfer[id] = null;
9678
+ dataTransfer[id] = toRaw(data);
9679
+ return;
9680
+ }
9681
+ const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data));
9682
+ if (!equal) {
9683
+ dataTransfer[id] = toRaw(data);
9657
9684
  }
9658
9685
  },
9659
- // Custom general filter function
9660
- defaultFilterFn: (data) => {
9661
- return data;
9686
+ closeModal: () => {
9687
+ var _a2;
9688
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ visible: false });
9689
+ }
9690
+ };
9691
+ return [register, methods2];
9692
+ }
9693
+ const useModalInner = (callbackFn) => {
9694
+ const modalInstanceRef = ref(null);
9695
+ const currentInstance = getCurrentInstance();
9696
+ const uidRef = ref("");
9697
+ const getInstance = () => {
9698
+ const instance = unref(modalInstanceRef);
9699
+ if (!instance) {
9700
+ error("useModalInner instance is undefined!");
9701
+ }
9702
+ return instance;
9703
+ };
9704
+ const register = (modalInstance, uuid) => {
9705
+ tryOnUnmounted(() => {
9706
+ modalInstanceRef.value = null;
9707
+ });
9708
+ uidRef.value = uuid;
9709
+ modalInstanceRef.value = modalInstance;
9710
+ currentInstance == null ? void 0 : currentInstance.emit("register", modalInstance, uuid);
9711
+ };
9712
+ watchEffect(() => {
9713
+ const data = dataTransfer[unref(uidRef)];
9714
+ if (!data)
9715
+ return;
9716
+ if (!callbackFn || !isFunction$1(callbackFn))
9717
+ return;
9718
+ nextTick(() => {
9719
+ callbackFn(data);
9720
+ });
9721
+ });
9722
+ return [
9723
+ register,
9724
+ {
9725
+ changeLoading: (loading = true) => {
9726
+ var _a2;
9727
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ loading });
9728
+ },
9729
+ getVisible: computed(() => {
9730
+ return visibleData$1[~~unref(uidRef)];
9731
+ }),
9732
+ changeOkLoading: (loading = true) => {
9733
+ var _a2;
9734
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ confirmLoading: loading });
9735
+ },
9736
+ closeModal: () => {
9737
+ var _a2;
9738
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps({ visible: false });
9739
+ },
9740
+ setModalProps: (props2) => {
9741
+ var _a2;
9742
+ (_a2 = getInstance()) == null ? void 0 : _a2.setModalProps(props2);
9743
+ },
9744
+ redoModalHeight: () => {
9745
+ var _a2;
9746
+ const callRedo = (_a2 = getInstance()) == null ? void 0 : _a2.redoModalHeight;
9747
+ callRedo && callRedo();
9748
+ }
9662
9749
  }
9750
+ ];
9751
+ };
9752
+ const BasicModal = withInstall$5(basicModal);
9753
+ const basicProps$5 = {
9754
+ listType: {
9755
+ type: String,
9756
+ default: "picture-card"
9663
9757
  },
9664
- // scrollbar setting
9665
- scrollbar: {
9666
- // Whether to use native scroll bar
9667
- // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
9668
- native: false
9758
+ helpText: {
9759
+ type: String,
9760
+ default: ""
9669
9761
  },
9670
- tree: {
9671
- searchToolbar: false
9762
+ // 文件最大多少MB
9763
+ maxSize: {
9764
+ type: Number,
9765
+ default: 2
9766
+ },
9767
+ // 最大数量的文件,Infinity不限制
9768
+ maxNumber: {
9769
+ type: Number,
9770
+ default: 1
9771
+ },
9772
+ // 根据后缀,或者其他
9773
+ accept: {
9774
+ type: Array,
9775
+ default: () => []
9776
+ },
9777
+ multiple: {
9778
+ type: Boolean,
9779
+ default: false
9780
+ },
9781
+ uploadParams: {
9782
+ type: Object,
9783
+ default: () => ({})
9784
+ },
9785
+ api: {
9786
+ type: Function,
9787
+ default: null,
9788
+ required: true
9789
+ },
9790
+ name: {
9791
+ type: String,
9792
+ default: "file"
9793
+ },
9794
+ filename: {
9795
+ type: String,
9796
+ default: null
9797
+ },
9798
+ fileListOpenDrag: {
9799
+ type: Boolean,
9800
+ default: true
9801
+ },
9802
+ fileListDragOptions: {
9803
+ type: Object,
9804
+ default: () => ({})
9672
9805
  }
9673
9806
  };
9674
- const { table } = componentSetting;
9675
- const {
9676
- pageSizeOptions,
9677
- defaultPageSize,
9678
- fetchSetting,
9679
- defaultSize,
9680
- defaultSortFn,
9681
- defaultFilterFn
9682
- } = table;
9683
- const ROW_KEY = "key";
9684
- const PAGE_SIZE_OPTIONS = pageSizeOptions;
9685
- const PAGE_SIZE = defaultPageSize;
9686
- const FETCH_SETTING = fetchSetting;
9687
- const DEFAULT_SIZE = defaultSize;
9688
- const DEFAULT_SORT_FN = defaultSortFn;
9689
- const DEFAULT_FILTER_FN = defaultFilterFn;
9690
- let DEFAULT_ALIGN = "left";
9691
- const INDEX_COLUMN_FLAG = "INDEX";
9692
- const ACTION_COLUMN_FLAG = "ACTION";
9693
- const ACTION_COLUMN_WIDTH = 160;
9694
- const setConstConfig = (config) => {
9695
- DEFAULT_ALIGN = config.align;
9696
- };
9697
- const __default__$2 = {
9698
- name: "TableAction"
9807
+ const uploadContainerProps = {
9808
+ value: {
9809
+ type: Array,
9810
+ default: () => []
9811
+ },
9812
+ ...basicProps$5,
9813
+ showPreviewNumber: {
9814
+ type: Boolean,
9815
+ default: true
9816
+ },
9817
+ emptyHidePreview: {
9818
+ type: Boolean,
9819
+ default: false
9820
+ }
9699
9821
  };
9700
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
9701
- ...__default__$2,
9702
- props: {
9703
- actions: {
9704
- type: Array,
9705
- default: null
9706
- },
9707
- dropDownActions: {
9708
- type: Array,
9709
- default: null
9710
- },
9711
- divider: {
9712
- type: Boolean,
9713
- default: true
9714
- },
9715
- outside: {
9716
- type: Boolean
9717
- },
9718
- stopButtonPropagation: {
9719
- type: Boolean,
9720
- default: false
9721
- },
9722
- showCount: {
9723
- type: Number,
9724
- default: () => 3
9725
- }
9822
+ const previewProps = {
9823
+ value: {
9824
+ type: Array,
9825
+ default: () => []
9826
+ }
9827
+ };
9828
+ const fileListProps = {
9829
+ columns: {
9830
+ type: Array,
9831
+ default: null
9726
9832
  },
9727
- setup(__props) {
9728
- const props2 = __props;
9729
- const { prefixCls: prefixCls2 } = useDesign$1("basic-table-action");
9730
- let table2 = {};
9731
- if (!props2.outside) {
9732
- table2 = useTableContext();
9833
+ actionColumn: {
9834
+ type: Object,
9835
+ default: null
9836
+ },
9837
+ dataSource: {
9838
+ type: Array,
9839
+ default: null
9840
+ },
9841
+ openDrag: {
9842
+ type: Boolean,
9843
+ default: false
9844
+ },
9845
+ dragOptions: {
9846
+ type: Object,
9847
+ default: () => ({})
9848
+ }
9849
+ };
9850
+ useI18n$1();
9851
+ function useUploadType({
9852
+ acceptRef,
9853
+ helpTextRef,
9854
+ maxNumberRef,
9855
+ maxSizeRef
9856
+ }) {
9857
+ const getAccept = computed(() => {
9858
+ const accept = unref(acceptRef);
9859
+ if (accept && accept.length > 0) {
9860
+ return accept;
9733
9861
  }
9734
- function isIfShow(action) {
9735
- const ifShow = action.ifShow;
9736
- let isIfShow2 = true;
9737
- if (isBoolean(ifShow)) {
9738
- isIfShow2 = ifShow;
9739
- }
9740
- if (isNumber$2(ifShow) || isString$3(ifShow)) {
9741
- isIfShow2 = !!ifShow;
9742
- }
9743
- if (isFunction$4(ifShow)) {
9744
- isIfShow2 = ifShow(action);
9862
+ return [];
9863
+ });
9864
+ const getStringAccept = computed(() => {
9865
+ return unref(getAccept).map((item) => {
9866
+ if (item.indexOf("/") > 0 || item.startsWith(".")) {
9867
+ return item;
9868
+ } else {
9869
+ return `.${item}`;
9745
9870
  }
9746
- return isIfShow2;
9871
+ }).join(",");
9872
+ });
9873
+ const getHelpText = computed(() => {
9874
+ const helpText = unref(helpTextRef);
9875
+ if (helpText) {
9876
+ return helpText;
9747
9877
  }
9748
- const getActions = computed(() => {
9749
- const cacheActions = [];
9750
- return (toRaw(props2.actions) || []).filter((action, _) => {
9751
- if (isIfShow(action) && cacheActions.length < props2.showCount - (props2.actions.length !== props2.showCount ? 1 : 0)) {
9752
- cacheActions.push(action);
9753
- return true;
9754
- } else
9755
- return false;
9756
- }).map((action) => {
9757
- const { popConfirm } = action;
9758
- return {
9759
- getPopupContainer: () => document.body,
9760
- type: "link",
9761
- size: "small",
9762
- ...action,
9763
- ...popConfirm || {},
9764
- onConfirm: popConfirm == null ? void 0 : popConfirm.confirm,
9765
- onCancel: popConfirm == null ? void 0 : popConfirm.cancel,
9766
- enable: !!popConfirm
9767
- };
9768
- });
9769
- });
9770
- const getDropdownList = computed(() => {
9771
- const cacheActions = [];
9772
- const list = (toRaw(props2.actions) || []).filter((action, index2) => {
9773
- if (isIfShow(action) && cacheActions.length < props2.showCount - (props2.actions.length !== props2.showCount ? 1 : 0)) {
9774
- cacheActions.push(action);
9775
- return false;
9776
- } else if (isIfShow(action))
9777
- return true;
9778
- });
9779
- return list.map((action, index2) => {
9780
- const { label, popConfirm } = action;
9781
- return {
9782
- ...action,
9783
- ...popConfirm,
9784
- onConfirm: popConfirm == null ? void 0 : popConfirm.confirm,
9785
- onCancel: popConfirm == null ? void 0 : popConfirm.cancel,
9786
- text: label,
9787
- divider: index2 < list.length - 1 ? props2.divider : false
9788
- };
9789
- });
9790
- });
9791
- const getAlign = computed(() => {
9792
- var _a2;
9793
- const columns = ((_a2 = table2 == null ? void 0 : table2.getColumns) == null ? void 0 : _a2.call(table2)) || [];
9794
- const actionColumn = columns.find((item) => item.flag === ACTION_COLUMN_FLAG);
9795
- return (actionColumn == null ? void 0 : actionColumn.align) ?? "left";
9796
- });
9797
- function getTooltip(data) {
9798
- return {
9799
- getPopupContainer: () => unref(table2 == null ? void 0 : table2.wrapRef.value) ?? document.body,
9800
- placement: "bottom",
9801
- ...isString$3(data) ? { title: data } : data
9802
- };
9878
+ const helpTexts = [];
9879
+ const accept = unref(acceptRef);
9880
+ if (accept.length > 0) {
9881
+ helpTexts.push(`支持${accept}格式`);
9803
9882
  }
9804
- function onCellClick(e) {
9805
- if (!props2.stopButtonPropagation)
9806
- return;
9807
- const path = e.composedPath();
9808
- const isInButton = path.find((ele) => {
9809
- var _a2;
9810
- return ((_a2 = ele.tagName) == null ? void 0 : _a2.toUpperCase()) === "BUTTON";
9811
- });
9812
- isInButton && e.stopPropagation();
9883
+ const maxSize = unref(maxSizeRef);
9884
+ if (maxSize) {
9885
+ helpTexts.push(`单个文件不超过${maxSize}MB`);
9813
9886
  }
9814
- return (_ctx, _cache) => {
9815
- const _component_a_button = resolveComponent("a-button");
9816
- return openBlock(), createElementBlock("div", {
9817
- class: normalizeClass([unref(prefixCls2), getAlign.value]),
9818
- onClick: onCellClick
9819
- }, [
9820
- (openBlock(true), createElementBlock(Fragment, null, renderList(getActions.value, (action, index2) => {
9821
- return openBlock(), createElementBlock(Fragment, {
9822
- key: `${index2}-${action.label}`
9823
- }, [
9824
- action.tooltip ? (openBlock(), createBlock(unref(Tooltip), mergeProps({
9825
- key: 0,
9826
- ref_for: true
9827
- }, getTooltip(action.tooltip)), {
9828
- default: withCtx(() => [
9829
- createVNode(unref(_sfc_main$X), mergeProps({ ref_for: true }, action), {
9830
- default: withCtx(() => [
9831
- action.icon ? (openBlock(), createBlock(unref(Icon2), {
9832
- key: 0,
9833
- icon: action.icon,
9834
- class: normalizeClass({ "mr-1": !!action.label })
9835
- }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
9836
- action.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
9837
- createTextVNode(toDisplayString(action.label), 1)
9838
- ], 64)) : createCommentVNode("", true)
9839
- ]),
9840
- _: 2
9841
- }, 1040)
9842
- ]),
9843
- _: 2
9844
- }, 1040)) : (openBlock(), createBlock(unref(_sfc_main$X), mergeProps({
9845
- key: 1,
9846
- ref_for: true
9847
- }, action), {
9848
- default: withCtx(() => [
9849
- action.icon ? (openBlock(), createBlock(unref(Icon2), {
9850
- key: 0,
9851
- icon: action.icon,
9852
- class: normalizeClass({ "mr-1": !!action.label })
9853
- }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
9854
- action.label ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
9855
- createTextVNode(toDisplayString(action.label), 1)
9856
- ], 64)) : createCommentVNode("", true)
9857
- ]),
9858
- _: 2
9859
- }, 1040)),
9860
- __props.divider && index2 < getActions.value.length - 1 ? (openBlock(), createBlock(unref(Divider$1), {
9861
- key: 2,
9862
- type: "vertical",
9863
- class: "action-divider"
9864
- })) : createCommentVNode("", true)
9865
- ], 64);
9866
- }), 128)),
9867
- getDropdownList.value.length > 0 ? (openBlock(), createBlock(unref(_sfc_main$W), {
9868
- key: 0,
9869
- trigger: ["hover"],
9870
- dropMenuList: getDropdownList.value,
9871
- popconfirm: ""
9872
- }, {
9873
- default: withCtx(() => [
9874
- renderSlot(_ctx.$slots, "more"),
9875
- !_ctx.$slots.more ? (openBlock(), createBlock(_component_a_button, {
9876
- key: 0,
9877
- type: "link",
9878
- size: "small"
9879
- }, {
9880
- default: withCtx(() => [
9881
- createVNode(unref(MoreOutlined$1), { class: "icon-more" })
9882
- ]),
9883
- _: 1
9884
- })) : createCommentVNode("", true)
9885
- ]),
9886
- _: 3
9887
- }, 8, ["dropMenuList"])) : createCommentVNode("", true)
9888
- ], 2);
9889
- };
9890
- }
9891
- });
9892
- const TableAction_vue_vue_type_style_index_0_lang = "";
9887
+ const maxNumber = unref(maxNumberRef);
9888
+ if (maxNumber && maxNumber !== Infinity) {
9889
+ helpTexts.push(`最多只能上传${maxNumber}个文件`);
9890
+ }
9891
+ return helpTexts.join(",");
9892
+ });
9893
+ return { getAccept, getStringAccept, getHelpText };
9894
+ }
9895
+ var UploadResultStatus = /* @__PURE__ */ ((UploadResultStatus2) => {
9896
+ UploadResultStatus2["DONE"] = "done";
9897
+ UploadResultStatus2["SUCCESS"] = "success";
9898
+ UploadResultStatus2["ERROR"] = "error";
9899
+ UploadResultStatus2["UPLOADING"] = "uploading";
9900
+ return UploadResultStatus2;
9901
+ })(UploadResultStatus || {});
9902
+ function checkImgType(file) {
9903
+ return isImgTypeByName(file.name);
9904
+ }
9905
+ function isImgTypeByName(name) {
9906
+ return /\.(jpg|jpeg|png|gif|webp)$/i.test(name);
9907
+ }
9908
+ function getBase64WithFile(file) {
9909
+ return new Promise((resolve, reject) => {
9910
+ const reader = new FileReader();
9911
+ reader.readAsDataURL(file);
9912
+ reader.onload = () => resolve({ result: reader.result, file });
9913
+ reader.onerror = (error2) => reject(error2);
9914
+ });
9915
+ }
9893
9916
  const _hoisted_1$q = { class: "thumb" };
9894
9917
  const _sfc_main$U = /* @__PURE__ */ defineComponent({
9895
9918
  __name: "ThumbUrl",
@@ -10016,7 +10039,7 @@ function createActionColumn(handleRemove) {
10016
10039
  color: "error",
10017
10040
  onClick: handleRemove.bind(null, record)
10018
10041
  }];
10019
- return createVNode(_sfc_main$V, {
10042
+ return createVNode(_sfc_main$12, {
10020
10043
  "actions": actions,
10021
10044
  "outside": true
10022
10045
  }, null);
@@ -10064,7 +10087,7 @@ function createPreviewActionColumn({
10064
10087
  label: t$1("component.upload.download"),
10065
10088
  onClick: handleDownload.bind(null, record)
10066
10089
  }];
10067
- return createVNode(_sfc_main$V, {
10090
+ return createVNode(_sfc_main$12, {
10068
10091
  "actions": actions,
10069
10092
  "outside": true
10070
10093
  }, null);
@@ -10594,7 +10617,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
10594
10617
  });
10595
10618
  const _hoisted_1$o = { key: 0 };
10596
10619
  const _hoisted_2$7 = { style: { "margin-top": "8px" } };
10597
- const _hoisted_3$5 = ["src"];
10620
+ const _hoisted_3$6 = ["src"];
10598
10621
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
10599
10622
  __name: "ImageUpload",
10600
10623
  props: {
@@ -10763,7 +10786,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
10763
10786
  alt: "",
10764
10787
  style: { "width": "100%" },
10765
10788
  src: previewImage.value
10766
- }, null, 8, _hoisted_3$5)
10789
+ }, null, 8, _hoisted_3$6)
10767
10790
  ]),
10768
10791
  _: 1
10769
10792
  }, 8, ["open", "title"])
@@ -10807,7 +10830,7 @@ componentMap$2.set("TimePicker", TimePicker);
10807
10830
  componentMap$2.set("StrengthMeter", StrengthMeter);
10808
10831
  componentMap$2.set("IconPicker", _sfc_main$19);
10809
10832
  componentMap$2.set("InputCountDown", CountdownInput);
10810
- componentMap$2.set("Table", _sfc_main$15);
10833
+ componentMap$2.set("Table", _sfc_main$11);
10811
10834
  componentMap$2.set("Tinymce", _sfc_main$16);
10812
10835
  componentMap$2.set("Divider", Divider);
10813
10836
  function add(compName, component) {
@@ -11357,7 +11380,7 @@ const _sfc_main$N = defineComponent({
11357
11380
  name: "BasicFormAction",
11358
11381
  components: {
11359
11382
  FormItem: Form.Item,
11360
- BasicButton: _sfc_main$Y,
11383
+ BasicButton: _sfc_main$15,
11361
11384
  [Col.name]: Col,
11362
11385
  Button: Button$1
11363
11386
  },
@@ -14087,12 +14110,12 @@ const PageSecond = /* @__PURE__ */ defineComponent({
14087
14110
  }, [createVNode(Space, null, {
14088
14111
  default: () => {
14089
14112
  var _a3, _b, _c;
14090
- return [(_a3 = slots.beforeConfirmButton) == null ? void 0 : _a3.call(slots), props2.isShowConfirmButton ? createVNode(_sfc_main$Y, {
14113
+ return [(_a3 = slots.beforeConfirmButton) == null ? void 0 : _a3.call(slots), props2.isShowConfirmButton ? createVNode(_sfc_main$15, {
14091
14114
  "onClick": handleConfirm,
14092
14115
  "type": "primary"
14093
14116
  }, {
14094
14117
  default: () => [props2.confirmButtonText]
14095
- }) : null, (_b = slots.beforeCancelButton) == null ? void 0 : _b.call(slots), props2.isShowCancelButton ? createVNode(_sfc_main$Y, {
14118
+ }) : null, (_b = slots.beforeCancelButton) == null ? void 0 : _b.call(slots), props2.isShowCancelButton ? createVNode(_sfc_main$15, {
14096
14119
  "onClick": handleCancel
14097
14120
  }, {
14098
14121
  default: () => [props2.cancelButtonText]
@@ -15992,6 +16015,7 @@ const _sfc_main$C = defineComponent({
15992
16015
  });
15993
16016
  const checkIndex = ref(false);
15994
16017
  const checkSelect = ref(false);
16018
+ const showTableSettingHead = ref(true);
15995
16019
  const { prefixCls: prefixCls2 } = useDesign$1("basic-column-setting");
15996
16020
  const getValues = computed(() => {
15997
16021
  return unref(table2 == null ? void 0 : table2.getBindValues) || {};
@@ -16008,6 +16032,7 @@ const _sfc_main$C = defineComponent({
16008
16032
  const values = unref(getValues);
16009
16033
  checkIndex.value = !!values.showIndexColumn;
16010
16034
  checkSelect.value = !!values.rowSelection;
16035
+ showTableSettingHead.value = !!values.showTableSettingHead;
16011
16036
  });
16012
16037
  function getLeafNodes(columns) {
16013
16038
  let leafColumns = [];
@@ -16219,6 +16244,7 @@ const _sfc_main$C = defineComponent({
16219
16244
  handleVisibleChange,
16220
16245
  checkIndex,
16221
16246
  checkSelect,
16247
+ showTableSettingHead,
16222
16248
  handleIndexCheckChange,
16223
16249
  handleSelectCheckChange,
16224
16250
  defaultRowSelection,
@@ -16255,7 +16281,8 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
16255
16281
  createElementVNode("div", {
16256
16282
  class: normalizeClass(`${_ctx.prefixCls}__popover-title`)
16257
16283
  }, [
16258
- createVNode(_component_Checkbox, {
16284
+ _ctx.showTableSettingHead ? (openBlock(), createBlock(_component_Checkbox, {
16285
+ key: 0,
16259
16286
  indeterminate: _ctx.indeterminate,
16260
16287
  checked: _ctx.checkAll,
16261
16288
  "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => _ctx.checkAll = $event),
@@ -16265,8 +16292,9 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
16265
16292
  createTextVNode(toDisplayString(_ctx.t("component.table.settingColumnShow")), 1)
16266
16293
  ]),
16267
16294
  _: 1
16268
- }, 8, ["indeterminate", "checked", "onChange"]),
16269
- createVNode(_component_Checkbox, {
16295
+ }, 8, ["indeterminate", "checked", "onChange"])) : createCommentVNode("", true),
16296
+ _ctx.showTableSettingHead ? (openBlock(), createBlock(_component_Checkbox, {
16297
+ key: 1,
16270
16298
  checked: _ctx.checkIndex,
16271
16299
  "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => _ctx.checkIndex = $event),
16272
16300
  onChange: _ctx.handleIndexCheckChange
@@ -16275,8 +16303,9 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
16275
16303
  createTextVNode(toDisplayString(_ctx.t("component.table.settingIndexColumnShow")), 1)
16276
16304
  ]),
16277
16305
  _: 1
16278
- }, 8, ["checked", "onChange"]),
16279
- createVNode(_component_Checkbox, {
16306
+ }, 8, ["checked", "onChange"])) : createCommentVNode("", true),
16307
+ _ctx.showTableSettingHead ? (openBlock(), createBlock(_component_Checkbox, {
16308
+ key: 2,
16280
16309
  checked: _ctx.checkSelect,
16281
16310
  "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => _ctx.checkSelect = $event),
16282
16311
  onChange: _ctx.handleSelectCheckChange,
@@ -16286,8 +16315,9 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
16286
16315
  createTextVNode(toDisplayString(_ctx.t("component.table.settingSelectColumnShow")), 1)
16287
16316
  ]),
16288
16317
  _: 1
16289
- }, 8, ["checked", "onChange", "disabled"]),
16318
+ }, 8, ["checked", "onChange", "disabled"])) : createCommentVNode("", true),
16290
16319
  createVNode(_component_a_button, {
16320
+ class: normalizeClass({ "single-reset": !_ctx.showTableSettingHead }),
16291
16321
  size: "small",
16292
16322
  type: "link",
16293
16323
  onClick: _ctx.reset
@@ -16296,7 +16326,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
16296
16326
  createTextVNode(toDisplayString(_ctx.t("common.resetText")), 1)
16297
16327
  ]),
16298
16328
  _: 1
16299
- }, 8, ["onClick"])
16329
+ }, 8, ["class", "onClick"])
16300
16330
  ], 2)
16301
16331
  ]),
16302
16332
  content: withCtx(() => [
@@ -16672,7 +16702,7 @@ const getGlobalAdvancedType = (fieldList, value) => {
16672
16702
  };
16673
16703
  const _hoisted_1$j = { class: "shy-ui-advanced-search-add" };
16674
16704
  const _hoisted_2$6 = { class: "shy-ui-advanced-search-item-wrapper" };
16675
- const _hoisted_3$4 = {
16705
+ const _hoisted_3$5 = {
16676
16706
  key: 0,
16677
16707
  class: "shy-ui-advanced-search-item-value-range"
16678
16708
  };
@@ -16901,7 +16931,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16901
16931
  }, {
16902
16932
  default: withCtx(() => [
16903
16933
  getTypeByField(schema == null ? void 0 : schema.field) === "number" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
16904
- schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
16934
+ schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
16905
16935
  createVNode(unref(FormItem), null, {
16906
16936
  default: withCtx(() => [
16907
16937
  createVNode(unref(InputNumber), {
@@ -17210,14 +17240,14 @@ const _hoisted_2$5 = {
17210
17240
  key: 0,
17211
17241
  style: { "margin": "5px" }
17212
17242
  };
17213
- const _hoisted_3$3 = { class: "flex items-center" };
17243
+ const _hoisted_3$4 = { class: "flex items-center" };
17214
17244
  function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
17215
17245
  const _component_TableSetting = resolveComponent("TableSetting");
17216
17246
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
17217
17247
  _ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
17218
17248
  renderSlot(_ctx.$slots, "headerTop")
17219
17249
  ])) : createCommentVNode("", true),
17220
- createElementVNode("div", _hoisted_3$3, [
17250
+ createElementVNode("div", _hoisted_3$4, [
17221
17251
  _ctx.$slots.tableTitle ? renderSlot(_ctx.$slots, "tableTitle", { key: 0 }) : createCommentVNode("", true),
17222
17252
  createElementVNode("div", {
17223
17253
  class: normalizeClass(`${_ctx.prefixCls}__toolbar`)
@@ -17755,6 +17785,10 @@ const basicProps$3 = reactive({
17755
17785
  size: {
17756
17786
  type: String,
17757
17787
  default: DEFAULT_SIZE
17788
+ },
17789
+ showTableSettingHead: {
17790
+ type: Boolean,
17791
+ default: true
17758
17792
  }
17759
17793
  });
17760
17794
  const basicPropChange = (options) => {
@@ -17770,7 +17804,7 @@ const _sfc_main$s = defineComponent({
17770
17804
  }
17771
17805
  },
17772
17806
  components: {
17773
- BasicButton: _sfc_main$Y,
17807
+ BasicButton: _sfc_main$15,
17774
17808
  Space,
17775
17809
  AdvancedSearch: _sfc_main$x
17776
17810
  },
@@ -17969,7 +18003,7 @@ const TableGlobalSearch_vue_vue_type_style_index_0_scoped_5f6e7403_lang = "";
17969
18003
  const _withScopeId = (n) => (pushScopeId("data-v-5f6e7403"), n = n(), popScopeId(), n);
17970
18004
  const _hoisted_1$f = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索全部", -1));
17971
18005
  const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索特定字段", -1));
17972
- const _hoisted_3$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
18006
+ const _hoisted_3$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
17973
18007
  const _hoisted_4$2 = { class: "shy-basic-table-global-search-checkbox-wrapper" };
17974
18008
  const _hoisted_5$1 = { style: { "color": "#131415", "font-size": "12px" } };
17975
18009
  function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
@@ -17995,7 +18029,7 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
17995
18029
  _hoisted_2$4,
17996
18030
  _ctx.curSelected === 2 ? (openBlock(), createBlock(_component_CheckOutlined, { key: 0 })) : createCommentVNode("", true)
17997
18031
  ], 2),
17998
- _hoisted_3$2,
18032
+ _hoisted_3$3,
17999
18033
  createElementVNode("div", _hoisted_4$2, [
18000
18034
  createVNode(_component_CheckboxGroup, {
18001
18035
  value: _ctx.fieldList,
@@ -18343,11 +18377,13 @@ const _sfc_main$q = defineComponent({
18343
18377
  };
18344
18378
  }
18345
18379
  });
18380
+ const BasicTable_vue_vue_type_style_index_0_scoped_fe75557a_lang = "";
18346
18381
  const _hoisted_1$e = {
18347
18382
  class: "shy-page",
18348
18383
  style: { "padding": "0" }
18349
18384
  };
18350
18385
  const _hoisted_2$3 = { class: "relative" };
18386
+ const _hoisted_3$2 = { class: "page-left" };
18351
18387
  function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18352
18388
  const _component_BasicForm = resolveComponent("BasicForm");
18353
18389
  const _component_TableAdvancedSearch = resolveComponent("TableAdvancedSearch");
@@ -18378,7 +18414,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18378
18414
  return {
18379
18415
  name: _ctx.replaceFormSlotKey(item),
18380
18416
  fn: withCtx((data) => [
18381
- renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
18417
+ renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})), void 0, true)
18382
18418
  ])
18383
18419
  };
18384
18420
  })
@@ -18393,7 +18429,10 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18393
18429
  withDirectives(createVNode(_component_TableGlobalSearch, { schemasAdvancedSearch: _ctx.schemasAdvancedSearchGlobal }, null, 8, ["schemasAdvancedSearch"]), [
18394
18430
  [vShow, _ctx.isVisibleGlobalSearch]
18395
18431
  ]),
18396
- withDirectives(createVNode(_component_Table, mergeProps({ ref: "tableElRef" }, _ctx.getBindValues, {
18432
+ withDirectives(createVNode(_component_Table, mergeProps({
18433
+ id: "table",
18434
+ ref: "tableElRef"
18435
+ }, _ctx.getBindValues, {
18397
18436
  rowClassName: _ctx.getRowClassName,
18398
18437
  onChange: _ctx.handleTableChange,
18399
18438
  onResizeColumn: _ctx.handleResizeColumn,
@@ -18411,7 +18450,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18411
18450
  ], 4)
18412
18451
  ]),
18413
18452
  bodyCell: withCtx((data) => [
18414
- renderSlot(_ctx.$slots, "bodyCell", normalizeProps(guardReactiveProps(data || {})))
18453
+ renderSlot(_ctx.$slots, "bodyCell", normalizeProps(guardReactiveProps(data || {})), void 0, true)
18415
18454
  ]),
18416
18455
  _: 2
18417
18456
  }, [
@@ -18419,7 +18458,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18419
18458
  return {
18420
18459
  name: item,
18421
18460
  fn: withCtx((data) => [
18422
- renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
18461
+ renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})), void 0, true)
18423
18462
  ])
18424
18463
  };
18425
18464
  }),
@@ -18463,12 +18502,15 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
18463
18502
  } : void 0
18464
18503
  ]), 1040, ["rowClassName", "onChange", "onResizeColumn"]), [
18465
18504
  [vShow, _ctx.getEmptyDataIsShowTable]
18505
+ ]),
18506
+ createElementVNode("div", _hoisted_3$2, [
18507
+ renderSlot(_ctx.$slots, "pageLeft", {}, void 0, true)
18466
18508
  ])
18467
18509
  ])
18468
18510
  ])
18469
18511
  ], 2);
18470
18512
  }
18471
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$i]]);
18513
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$i], ["__scopeId", "data-v-fe75557a"]]);
18472
18514
  const _sfc_main$p = defineComponent({
18473
18515
  name: "TableImage",
18474
18516
  components: { AImage: Image, PreviewGroup: Image.PreviewGroup, Badge },
@@ -22715,7 +22757,7 @@ const _sfc_main$g = defineComponent({
22715
22757
  Upload,
22716
22758
  Avatar,
22717
22759
  Tooltip,
22718
- BasicButton: _sfc_main$Y
22760
+ BasicButton: _sfc_main$15
22719
22761
  },
22720
22762
  props: props$2,
22721
22763
  emits: ["uploadSuccess", "register", "beforeUpload"],
@@ -23615,7 +23657,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
23615
23657
  ];
23616
23658
  });
23617
23659
  return (_ctx, _cache) => {
23618
- return openBlock(), createBlock(_sfc_main$V, {
23660
+ return openBlock(), createBlock(_sfc_main$12, {
23619
23661
  actions: getActions.value,
23620
23662
  "show-count": 4,
23621
23663
  outside: true
@@ -25463,7 +25505,7 @@ export {
25463
25505
  ApiTreeSelect,
25464
25506
  CropperAvatar as AvatarCropper,
25465
25507
  BasicArrow,
25466
- _sfc_main$Y as BasicButton,
25508
+ _sfc_main$15 as BasicButton,
25467
25509
  BasicContainer,
25468
25510
  BasicDrawer,
25469
25511
  BasicForm,
@@ -25483,7 +25525,7 @@ export {
25483
25525
  CropperImage,
25484
25526
  Description,
25485
25527
  DescriptionsForm,
25486
- _sfc_main$W as Dropdown,
25528
+ _sfc_main$13 as Dropdown,
25487
25529
  EditTableHeaderCell as EditTableHeaderIcon,
25488
25530
  _sfc_main$O as FormItem,
25489
25531
  Icon2 as Icon,
@@ -25494,15 +25536,15 @@ export {
25494
25536
  PageSecond,
25495
25537
  PageWrapper,
25496
25538
  PageWrapperFixedHeightKey,
25497
- _sfc_main$X as PopConfirmButton,
25539
+ _sfc_main$14 as PopConfirmButton,
25498
25540
  RadioButtonGroup,
25499
25541
  RoleEnum,
25500
25542
  ScrollContainer$1 as ScrollContainer,
25501
25543
  Scrollbar,
25502
25544
  StrengthMeter,
25503
25545
  SvgIcon,
25504
- _sfc_main$V as TableAction,
25505
- _sfc_main$15 as TableChildren,
25546
+ _sfc_main$12 as TableAction,
25547
+ _sfc_main$11 as TableChildren,
25506
25548
  TableDict,
25507
25549
  TableImg,
25508
25550
  _sfc_main$3 as TablePlus,