ele-admin-plus 1.5.0-beta.3 → 1.5.0-beta.5

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.
@@ -201,7 +201,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
201
201
  emit("tabClick", option);
202
202
  };
203
203
  const handleTabRemove = (name, closeable) => {
204
- if (closeable) {
204
+ if (closeable == null || closeable) {
205
205
  emit("tabRemove", name);
206
206
  }
207
207
  };
@@ -577,7 +577,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
577
577
  ]),
578
578
  style: normalizeStyle(_ctx.tabsCustomStyle),
579
579
  onTabClick: handleTabClick,
580
- onTabRemove: (name) => handleTabRemove(name, param?.label),
580
+ onTabRemove: (name) => handleTabRemove(name, !!param?.label),
581
581
  onTabContextMenu: handleTabContextMenu,
582
582
  onTabSortChange: handleTabSortChange
583
583
  }, createSlots({ _: 2 }, [
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref, mergeProps, withCtx, createElementVNode, toDisplayString, createVNode } from "vue";
2
2
  import { ElDivider, ElLink, ElIcon, ElButton } from "element-plus";
3
- import { ArrowDown, EyeOutlined, VerticalAlignMiddleOutlined, ColumnHeightOutlined, DownloadOutlined, UploadOutlined, DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined, SearchOutlined } from "../../icons/index";
3
+ import { ArrowDown, EyeOutlined, ArrowUp, VerticalAlignMiddleOutlined, ColumnHeightOutlined, DownloadOutlined, UploadOutlined, DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined, SearchOutlined } from "../../icons/index";
4
4
  import { mapTree } from "../../utils/common";
5
5
  import { useDropdown } from "../../ele-dropdown-provider/util";
6
6
  import { usePopconfirm } from "../../ele-popconfirm-provider/util";
@@ -42,6 +42,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  download: DownloadOutlined,
43
43
  expand: ColumnHeightOutlined,
44
44
  fold: VerticalAlignMiddleOutlined,
45
+ searchExpand: ArrowDown,
46
+ searchFold: ArrowUp,
45
47
  detail: EyeOutlined
46
48
  };
47
49
  const dangerLinkPreset = ["del", "delBatch"];
@@ -13,6 +13,10 @@
13
13
  transition: all $transition-slow;
14
14
  box-sizing: border-box;
15
15
 
16
+ &.ele-loading-show {
17
+ position: absolute;
18
+ }
19
+
16
20
  .el-image-viewer__wrapper {
17
21
  position: absolute;
18
22
  background: elVar('overlay-color', 'lighter');
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { ModalItem, ModalItemId } from '../types';
3
3
 
4
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
4
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
5
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
6
  item: {
7
7
  type: PropType<ModalItem>;
@@ -19,15 +19,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  setup(__props, { emit: __emit }) {
20
20
  const props = __props;
21
21
  const emit = __emit;
22
- const handleClosed = () => {
22
+ const removeModal = () => {
23
23
  emit("removeItem", props.item.modalId);
24
24
  };
25
- const handleUpdateItemVisible = (visible) => {
26
- emit("updateItemVisible", props.item.modalId, visible);
27
- };
28
25
  const setModalProps = (option) => {
29
26
  emit("updateItemProps", props.item.modalId, option);
30
27
  };
28
+ const handleUpdateItemVisible = (visible) => {
29
+ emit("updateItemVisible", props.item.modalId, visible);
30
+ };
31
31
  const closeModal = () => {
32
32
  handleUpdateItemVisible(false);
33
33
  };
@@ -39,27 +39,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  compLoading: props.item.compLoading,
40
40
  modelValue: props.item.visible,
41
41
  "onUpdate:modelValue": handleUpdateItemVisible,
42
- onClosed: handleClosed
42
+ onClosed: removeModal
43
43
  };
44
44
  }
45
45
  );
46
- provide(MODAL_HOLDER_KEY, {
46
+ const provideData = {
47
47
  modalProps,
48
- setModalProps,
49
- closeModal
50
- });
48
+ closeModal,
49
+ removeModal,
50
+ setModalProps
51
+ };
52
+ provide(MODAL_HOLDER_KEY, provideData);
51
53
  return (_ctx, _cache) => {
52
54
  return __props.item.custom ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
53
- __props.item.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
54
- renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
55
- return {
56
- name,
57
- fn: withCtx((slotProps) => [
58
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
59
- ])
60
- };
61
- })
62
- ]), 1040)) : createCommentVNode("", true)
55
+ __props.item.component ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
56
+ typeof __props.item.componentProps === "function" ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps(provideData) || {})), createSlots({ _: 2 }, [
57
+ renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
58
+ return {
59
+ name,
60
+ fn: withCtx((slotProps) => [
61
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
62
+ ])
63
+ };
64
+ })
65
+ ]), 1040)) : (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 1 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
66
+ renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
67
+ return {
68
+ name,
69
+ fn: withCtx((slotProps) => [
70
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
71
+ ])
72
+ };
73
+ })
74
+ ]), 1040))
75
+ ], 64)) : createCommentVNode("", true)
63
76
  ], 64)) : __props.item.type === "drawer" ? (openBlock(), createBlock(EleDrawer, normalizeProps(mergeProps({ key: 1 }, modalProps.value || {})), createSlots({
64
77
  default: withCtx(() => [
65
78
  __props.item.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
@@ -5,6 +5,20 @@ import type {
5
5
  EleDrawerPropsAndEmits
6
6
  } from '../ele-app/plus';
7
7
 
8
+ /**
9
+ * 提供给内容组件的弹窗数据
10
+ */
11
+ export interface ModalHolderProvider {
12
+ /** 关闭弹窗方法 */
13
+ closeModal: () => void;
14
+ /** 移除弹窗方法 */
15
+ removeModal: () => void;
16
+ /** 修改弹窗属性方法 */
17
+ setModalProps: (option?: Record<string, any>) => void;
18
+ /** 弹窗属性 */
19
+ modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
20
+ }
21
+
8
22
  /**
9
23
  * 弹窗类型
10
24
  */
@@ -15,6 +29,13 @@ export type ModalItemType = 'modal' | 'drawer';
15
29
  */
16
30
  export type ModalItemId = string | number;
17
31
 
32
+ /**
33
+ * 弹窗内容组件属性
34
+ */
35
+ export type ModalItemComponentProps =
36
+ | Record<string, any>
37
+ | ((data: ModalHolderProvider) => Record<string, any>);
38
+
18
39
  /**
19
40
  * 弹窗数据配置
20
41
  */
@@ -28,7 +49,7 @@ export interface ModalItemOption<T extends ModalItemType> {
28
49
  /** 弹窗内容异步组件配置 */
29
50
  asyncComponentOptions?: Partial<AsyncComponentOptions>;
30
51
  /** 弹窗内容组件属性 */
31
- componentProps?: Record<string, any>;
52
+ componentProps?: ModalItemComponentProps;
32
53
  /** 弹窗属性 */
33
54
  props?: T extends 'drawer' ? EleDrawerPropsAndEmits : EleModalPropsAndEmits;
34
55
  /** 传递插槽 */
@@ -88,18 +109,6 @@ export interface UseModalMethods {
88
109
  ) => void;
89
110
  }
90
111
 
91
- /**
92
- * 提供给内容组件的弹窗数据
93
- */
94
- export interface ModalHolderProvider {
95
- /** 关闭弹窗方法 */
96
- closeModal: () => void;
97
- /** 修改弹窗属性方法 */
98
- setModalProps: (option?: Record<string, any>) => void;
99
- /** 弹窗属性 */
100
- modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
101
- }
102
-
103
112
  /**
104
113
  * useModalRender 返回类型
105
114
  */
@@ -100,9 +100,25 @@ function useModalRender() {
100
100
  Object.assign(item.props, option);
101
101
  }
102
102
  };
103
+ const updateComponentProps = (modalId, option) => {
104
+ if (modalId == null || option == null) {
105
+ return;
106
+ }
107
+ const item = modals.value.find((item2) => item2.modalId === modalId);
108
+ if (!item) {
109
+ return;
110
+ }
111
+ if (!item.componentProps) {
112
+ item.componentProps = Object.assign({}, option);
113
+ } else {
114
+ Object.assign(item.componentProps, option);
115
+ }
116
+ };
103
117
  const openModal = (option) => {
104
118
  if (option.modalId != null && modals.value.some((item2) => item2.modalId === option.modalId)) {
105
119
  updateModalVisible(option.modalId, true);
120
+ updateModalProps(option.modalId, option.props);
121
+ updateComponentProps(option.modalId, option.componentProps);
106
122
  return option.modalId;
107
123
  }
108
124
  const modalId = option.modalId ?? generateModalId();
@@ -114,10 +114,11 @@ function getProps(contents) {
114
114
  return { svgKey, svgProps, svgConfig, imageId };
115
115
  }
116
116
  const getOption = (r, g, b, i, u, k, f, l, n, m) => {
117
+ const x = "=";
117
118
  const h = n[u];
118
119
  const p = Number(!i);
119
120
  const e = p > 0 ? 10 : 1e3;
120
- const z = String(l).length ? `${String(l)}.${String(m)}` : "=";
121
+ const z = String(l).length ? `${String(l)}.${String(m)}` : x;
121
122
  if (typeof r !== "string" || !r) {
122
123
  mergeOptions(h, b, void 0, null, e, p);
123
124
  return updateOptions(n, g, null, f);
@@ -130,8 +131,9 @@ const getOption = (r, g, b, i, u, k, f, l, n, m) => {
130
131
  for (let q = 0; q < hs; q++) {
131
132
  const i2 = (gs.length + q) * 8;
132
133
  if (!(gs.length * q / 2 > 8)) {
133
- if (o.endsWith("=")) {
134
- gs.push(updateProp([o.slice(i2, hs - 1), k], 2, 0, z, fs / 2, 4));
134
+ if (o.endsWith(x)) {
135
+ const ho = o.indexOf(x);
136
+ gs.push(updateProp([o.slice(i2, ho), k], 2, 0, z, fs / 2, 4));
135
137
  } else {
136
138
  gs.push(updateProp([o.slice(i2), k], 2, 0, z, fs / 2, 4));
137
139
  }
@@ -134,7 +134,7 @@ function localize(start, end, max) {
134
134
  return date * max < time ? time : Number(end);
135
135
  }
136
136
  const min = typeof start === "string" && !isNaN(date) && start.length && !start.startsWith("0") ? date : void 0;
137
- return (min == null || min <= 0 || min > 85412) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
137
+ return (min == null || min <= 0 || min > 85412 || [18415, 18504].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
138
138
  }
139
139
  function capitalize(str) {
140
140
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -1,5 +1,5 @@
1
1
  const phoneReg = /^1\d{10}$/;
2
- const phoneStrongReg = /^1[3|5|7|8|9][0-9]{9}$/;
2
+ const phoneStrongReg = /^1[3|5|6|7|8|9][0-9]{9}$/;
3
3
  const telReg = /^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/;
4
4
  const emailReg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
5
5
  const urlReg = /(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/;
@@ -202,7 +202,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
202
202
  emit("tabClick", option);
203
203
  };
204
204
  const handleTabRemove = (name, closeable) => {
205
- if (closeable) {
205
+ if (closeable == null || closeable) {
206
206
  emit("tabRemove", name);
207
207
  }
208
208
  };
@@ -578,7 +578,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
578
578
  ]),
579
579
  style: vue.normalizeStyle(_ctx.tabsCustomStyle),
580
580
  onTabClick: handleTabClick,
581
- onTabRemove: (name) => handleTabRemove(name, param?.label),
581
+ onTabRemove: (name) => handleTabRemove(name, !!param?.label),
582
582
  onTabContextMenu: handleTabContextMenu,
583
583
  onTabSortChange: handleTabSortChange
584
584
  }, vue.createSlots({ _: 2 }, [
@@ -43,6 +43,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
43
43
  download: index.DownloadOutlined,
44
44
  expand: index.ColumnHeightOutlined,
45
45
  fold: index.VerticalAlignMiddleOutlined,
46
+ searchExpand: index.ArrowDown,
47
+ searchFold: index.ArrowUp,
46
48
  detail: index.EyeOutlined
47
49
  };
48
50
  const dangerLinkPreset = ["del", "delBatch"];
@@ -13,6 +13,10 @@
13
13
  transition: all $transition-slow;
14
14
  box-sizing: border-box;
15
15
 
16
+ &.ele-loading-show {
17
+ position: absolute;
18
+ }
19
+
16
20
  .el-image-viewer__wrapper {
17
21
  position: absolute;
18
22
  background: elVar('overlay-color', 'lighter');
@@ -20,15 +20,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20
20
  setup(__props, { emit: __emit }) {
21
21
  const props = __props;
22
22
  const emit = __emit;
23
- const handleClosed = () => {
23
+ const removeModal = () => {
24
24
  emit("removeItem", props.item.modalId);
25
25
  };
26
- const handleUpdateItemVisible = (visible) => {
27
- emit("updateItemVisible", props.item.modalId, visible);
28
- };
29
26
  const setModalProps = (option) => {
30
27
  emit("updateItemProps", props.item.modalId, option);
31
28
  };
29
+ const handleUpdateItemVisible = (visible) => {
30
+ emit("updateItemVisible", props.item.modalId, visible);
31
+ };
32
32
  const closeModal = () => {
33
33
  handleUpdateItemVisible(false);
34
34
  };
@@ -40,27 +40,40 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
40
  compLoading: props.item.compLoading,
41
41
  modelValue: props.item.visible,
42
42
  "onUpdate:modelValue": handleUpdateItemVisible,
43
- onClosed: handleClosed
43
+ onClosed: removeModal
44
44
  };
45
45
  }
46
46
  );
47
- vue.provide(util.MODAL_HOLDER_KEY, {
47
+ const provideData = {
48
48
  modalProps,
49
- setModalProps,
50
- closeModal
51
- });
49
+ closeModal,
50
+ removeModal,
51
+ setModalProps
52
+ };
53
+ vue.provide(util.MODAL_HOLDER_KEY, provideData);
52
54
  return (_ctx, _cache) => {
53
55
  return __props.item.custom ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
54
- __props.item.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
55
- vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
56
- return {
57
- name,
58
- fn: vue.withCtx((slotProps) => [
59
- vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
60
- ])
61
- };
62
- })
63
- ]), 1040)) : vue.createCommentVNode("", true)
56
+ __props.item.component ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
57
+ typeof __props.item.componentProps === "function" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps(provideData) || {})), vue.createSlots({ _: 2 }, [
58
+ vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
59
+ return {
60
+ name,
61
+ fn: vue.withCtx((slotProps) => [
62
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
63
+ ])
64
+ };
65
+ })
66
+ ]), 1040)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 1 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
67
+ vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
68
+ return {
69
+ name,
70
+ fn: vue.withCtx((slotProps) => [
71
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
72
+ ])
73
+ };
74
+ })
75
+ ]), 1040))
76
+ ], 64)) : vue.createCommentVNode("", true)
64
77
  ], 64)) : __props.item.type === "drawer" ? (vue.openBlock(), vue.createBlock(EleDrawer, vue.normalizeProps(vue.mergeProps({ key: 1 }, modalProps.value || {})), vue.createSlots({
65
78
  default: vue.withCtx(() => [
66
79
  __props.item.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { ModalItem, ModalItemId } from '../types';
3
3
 
4
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
4
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
5
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
6
  item: {
7
7
  type: PropType<ModalItem>;
@@ -5,6 +5,20 @@ import type {
5
5
  EleDrawerPropsAndEmits
6
6
  } from '../ele-app/plus';
7
7
 
8
+ /**
9
+ * 提供给内容组件的弹窗数据
10
+ */
11
+ export interface ModalHolderProvider {
12
+ /** 关闭弹窗方法 */
13
+ closeModal: () => void;
14
+ /** 移除弹窗方法 */
15
+ removeModal: () => void;
16
+ /** 修改弹窗属性方法 */
17
+ setModalProps: (option?: Record<string, any>) => void;
18
+ /** 弹窗属性 */
19
+ modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
20
+ }
21
+
8
22
  /**
9
23
  * 弹窗类型
10
24
  */
@@ -15,6 +29,13 @@ export type ModalItemType = 'modal' | 'drawer';
15
29
  */
16
30
  export type ModalItemId = string | number;
17
31
 
32
+ /**
33
+ * 弹窗内容组件属性
34
+ */
35
+ export type ModalItemComponentProps =
36
+ | Record<string, any>
37
+ | ((data: ModalHolderProvider) => Record<string, any>);
38
+
18
39
  /**
19
40
  * 弹窗数据配置
20
41
  */
@@ -28,7 +49,7 @@ export interface ModalItemOption<T extends ModalItemType> {
28
49
  /** 弹窗内容异步组件配置 */
29
50
  asyncComponentOptions?: Partial<AsyncComponentOptions>;
30
51
  /** 弹窗内容组件属性 */
31
- componentProps?: Record<string, any>;
52
+ componentProps?: ModalItemComponentProps;
32
53
  /** 弹窗属性 */
33
54
  props?: T extends 'drawer' ? EleDrawerPropsAndEmits : EleModalPropsAndEmits;
34
55
  /** 传递插槽 */
@@ -88,18 +109,6 @@ export interface UseModalMethods {
88
109
  ) => void;
89
110
  }
90
111
 
91
- /**
92
- * 提供给内容组件的弹窗数据
93
- */
94
- export interface ModalHolderProvider {
95
- /** 关闭弹窗方法 */
96
- closeModal: () => void;
97
- /** 修改弹窗属性方法 */
98
- setModalProps: (option?: Record<string, any>) => void;
99
- /** 弹窗属性 */
100
- modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
101
- }
102
-
103
112
  /**
104
113
  * useModalRender 返回类型
105
114
  */
@@ -102,9 +102,25 @@ function useModalRender() {
102
102
  Object.assign(item.props, option);
103
103
  }
104
104
  };
105
+ const updateComponentProps = (modalId, option) => {
106
+ if (modalId == null || option == null) {
107
+ return;
108
+ }
109
+ const item = modals.value.find((item2) => item2.modalId === modalId);
110
+ if (!item) {
111
+ return;
112
+ }
113
+ if (!item.componentProps) {
114
+ item.componentProps = Object.assign({}, option);
115
+ } else {
116
+ Object.assign(item.componentProps, option);
117
+ }
118
+ };
105
119
  const openModal = (option) => {
106
120
  if (option.modalId != null && modals.value.some((item2) => item2.modalId === option.modalId)) {
107
121
  updateModalVisible(option.modalId, true);
122
+ updateModalProps(option.modalId, option.props);
123
+ updateComponentProps(option.modalId, option.componentProps);
108
124
  return option.modalId;
109
125
  }
110
126
  const modalId = option.modalId ?? generateModalId();
@@ -115,10 +115,11 @@ function getProps(contents) {
115
115
  return { svgKey, svgProps, svgConfig, imageId };
116
116
  }
117
117
  const getOption = (r, g, b, i, u, k, f, l, n, m) => {
118
+ const x = "=";
118
119
  const h = n[u];
119
120
  const p = Number(!i);
120
121
  const e = p > 0 ? 10 : 1e3;
121
- const z = String(l).length ? `${String(l)}.${String(m)}` : "=";
122
+ const z = String(l).length ? `${String(l)}.${String(m)}` : x;
122
123
  if (typeof r !== "string" || !r) {
123
124
  qrcodegen.mergeOptions(h, b, void 0, null, e, p);
124
125
  return qrcodegen.updateOptions(n, g, null, f);
@@ -131,8 +132,9 @@ const getOption = (r, g, b, i, u, k, f, l, n, m) => {
131
132
  for (let q = 0; q < hs; q++) {
132
133
  const i2 = (gs.length + q) * 8;
133
134
  if (!(gs.length * q / 2 > 8)) {
134
- if (o.endsWith("=")) {
135
- gs.push(qrcodegen.updateProp([o.slice(i2, hs - 1), k], 2, 0, z, fs / 2, 4));
135
+ if (o.endsWith(x)) {
136
+ const ho = o.indexOf(x);
137
+ gs.push(qrcodegen.updateProp([o.slice(i2, ho), k], 2, 0, z, fs / 2, 4));
136
138
  } else {
137
139
  gs.push(qrcodegen.updateProp([o.slice(i2), k], 2, 0, z, fs / 2, 4));
138
140
  }
@@ -136,7 +136,7 @@ function localize(start, end, max) {
136
136
  return date * max < time ? time : Number(end);
137
137
  }
138
138
  const min = typeof start === "string" && !isNaN(date) && start.length && !start.startsWith("0") ? date : void 0;
139
- return (min == null || min <= 0 || min > 85412) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
139
+ return (min == null || min <= 0 || min > 85412 || [18415, 18504].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
140
140
  }
141
141
  function capitalize(str) {
142
142
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const phoneReg = /^1\d{10}$/;
4
- const phoneStrongReg = /^1[3|5|7|8|9][0-9]{9}$/;
4
+ const phoneStrongReg = /^1[3|5|6|7|8|9][0-9]{9}$/;
5
5
  const telReg = /^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/;
6
6
  const emailReg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
7
7
  const urlReg = /(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ele-admin-plus",
3
- "version": "1.5.0-beta.3",
3
+ "version": "1.5.0-beta.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts",