erp-plus 1.0.141 → 1.0.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,15 @@
1
1
  import { Component, PropType, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
- type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
2
+ /** link = 库内的链接按钮:主色文字、无内边距、左右无外边距(可与文字紧贴) */
3
+ type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' | 'link';
3
4
  type ButtonSize = 'large' | 'default' | 'small';
4
5
  type NativeType = 'button' | 'submit' | 'reset';
6
+ type DropdownItem = string | {
7
+ label: string;
8
+ value?: string | number;
9
+ disabled?: boolean;
10
+ };
11
+ /** 与 el-dropdown 的 placement 取值对齐(子集),避免 String 直接被判为不兼容 */
12
+ type DropdownPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
5
13
  declare function __VLS_template(): any;
6
14
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
7
15
  declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
@@ -33,6 +41,17 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
33
41
  type: BooleanConstructor;
34
42
  default: boolean;
35
43
  };
44
+ /** 方形图标按钮:宽高相等、无内边距;没有文字/自定义图标时默认显示展开箭头 */
45
+ square: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ /** 受控的箭头朝向:方形箭头按钮常用来「展开/收起页面上的其他区域」,本身不弹面板。
50
+ * 传 true → 箭头朝上(表示该区域已展开);不传 → 朝下。dropdown 自身的展开态会叠加在上面。 */
51
+ expanded: {
52
+ type: BooleanConstructor;
53
+ default: undefined;
54
+ };
36
55
  circle: {
37
56
  type: BooleanConstructor;
38
57
  default: boolean;
@@ -77,8 +96,25 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
77
96
  type: PropType<string | Component>;
78
97
  default: string;
79
98
  };
99
+ /** 开启后按钮右侧带箭头,点击展开 items 菜单,展开时箭头翻转朝上 */
100
+ dropdown: {
101
+ type: BooleanConstructor;
102
+ default: boolean;
103
+ };
104
+ /** 菜单项,支持字符串简写;选中后触发 select 事件,参数是归一化后的 item 对象 */
105
+ items: {
106
+ type: PropType<DropdownItem[]>;
107
+ default: () => never[];
108
+ };
109
+ /** 面板位置:默认与按钮左对齐(设计稿上面板左边缘 = 按钮左边缘) */
110
+ dropdownPlacement: {
111
+ type: PropType<DropdownPlacement>;
112
+ default: string;
113
+ };
80
114
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
81
115
  click: (...args: any[]) => void;
116
+ select: (...args: any[]) => void;
117
+ "visible-change": (...args: any[]) => void;
82
118
  }, string, PublicProps, Readonly<globalThis.ExtractPropTypes<{
83
119
  type: {
84
120
  type: PropType<ButtonType>;
@@ -108,6 +144,17 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
108
144
  type: BooleanConstructor;
109
145
  default: boolean;
110
146
  };
147
+ /** 方形图标按钮:宽高相等、无内边距;没有文字/自定义图标时默认显示展开箭头 */
148
+ square: {
149
+ type: BooleanConstructor;
150
+ default: boolean;
151
+ };
152
+ /** 受控的箭头朝向:方形箭头按钮常用来「展开/收起页面上的其他区域」,本身不弹面板。
153
+ * 传 true → 箭头朝上(表示该区域已展开);不传 → 朝下。dropdown 自身的展开态会叠加在上面。 */
154
+ expanded: {
155
+ type: BooleanConstructor;
156
+ default: undefined;
157
+ };
111
158
  circle: {
112
159
  type: BooleanConstructor;
113
160
  default: boolean;
@@ -152,8 +199,25 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
152
199
  type: PropType<string | Component>;
153
200
  default: string;
154
201
  };
202
+ /** 开启后按钮右侧带箭头,点击展开 items 菜单,展开时箭头翻转朝上 */
203
+ dropdown: {
204
+ type: BooleanConstructor;
205
+ default: boolean;
206
+ };
207
+ /** 菜单项,支持字符串简写;选中后触发 select 事件,参数是归一化后的 item 对象 */
208
+ items: {
209
+ type: PropType<DropdownItem[]>;
210
+ default: () => never[];
211
+ };
212
+ /** 面板位置:默认与按钮左对齐(设计稿上面板左边缘 = 按钮左边缘) */
213
+ dropdownPlacement: {
214
+ type: PropType<DropdownPlacement>;
215
+ default: string;
216
+ };
155
217
  }>> & Readonly<{
156
218
  onClick?: ((...args: any[]) => any) | undefined;
219
+ onSelect?: ((...args: any[]) => any) | undefined;
220
+ "onVisible-change"?: ((...args: any[]) => any) | undefined;
157
221
  }>, {
158
222
  size: ButtonSize;
159
223
  link: boolean;
@@ -161,6 +225,11 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
161
225
  color: string;
162
226
  circle: boolean;
163
227
  text: boolean;
228
+ dropdown: boolean;
229
+ items: DropdownItem[];
230
+ dropdownPlacement: DropdownPlacement;
231
+ square: boolean;
232
+ expanded: boolean;
164
233
  plain: boolean;
165
234
  bg: boolean;
166
235
  round: boolean;
@@ -173,7 +242,7 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
173
242
  icon: string | Component;
174
243
  nativeType: NativeType;
175
244
  tag: string | Component;
176
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
245
+ }, {}, {}, {}, string, ComponentProvideOptions, true, any, any>;
177
246
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
178
247
  export default _default;
179
248
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -627,8 +627,8 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
627
627
  change: (...args: any[]) => void;
628
628
  focus: (...args: any[]) => void;
629
629
  clear: (...args: any[]) => void;
630
- "update:modelValue": (...args: any[]) => void;
631
630
  "visible-change": (...args: any[]) => void;
631
+ "update:modelValue": (...args: any[]) => void;
632
632
  "calendar-change": (...args: any[]) => void;
633
633
  "panel-change": (...args: any[]) => void;
634
634
  }, string, PublicProps, Readonly<globalThis.ExtractPropTypes<{
@@ -766,8 +766,8 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
766
766
  onChange?: ((...args: any[]) => any) | undefined;
767
767
  onFocus?: ((...args: any[]) => any) | undefined;
768
768
  onClear?: ((...args: any[]) => any) | undefined;
769
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
770
769
  "onVisible-change"?: ((...args: any[]) => any) | undefined;
770
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
771
771
  "onCalendar-change"?: ((...args: any[]) => any) | undefined;
772
772
  "onPanel-change"?: ((...args: any[]) => any) | undefined;
773
773
  }>, {
@@ -777,9 +777,9 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
777
777
  type: typeType;
778
778
  readonly: boolean;
779
779
  disabled: boolean;
780
+ name: string;
780
781
  modelValue: string | number | Date | [Date, Date];
781
782
  showFooter: boolean;
782
- name: string;
783
783
  placeholder: string;
784
784
  id: string;
785
785
  teleported: boolean;
@@ -1,39 +1,103 @@
1
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { h, VNodeChild, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { DictStatusOption } from '../DictStatus/DictStatus.vue';
2
3
  export interface DescriptionItem {
3
4
  /** 唯一键,缺省用下标 */
4
5
  key?: string | number;
5
6
  /** 字段名(组件自动补「:」) */
6
7
  label: string;
7
- /** 字段值;用 #value 插槽时不传 */
8
+ /** 字面量模式:显示值;路径模式(传了 data):字段路径(支持 'a.b.c') */
8
9
  value?: string | number;
10
+ /** 显示条件;函数形态收到 data */
11
+ visible?: boolean | ((data: Record<string, any>) => boolean);
12
+ /** 自定义渲染,签名与老组件一致:render(h, { row }),row = data;优先级最高(首参即 Vue 的 h 函数) */
13
+ render?: (hh: typeof h, ctx: {
14
+ row: Record<string, any>;
15
+ }) => VNodeChild;
16
+ /** type:'dict' 走 #dict 插槽;type:'file' 走 #file 插槽 */
17
+ type?: 'dict' | 'file';
18
+ /** dict 模式 = 字典类型名(经 #dict 插槽作用域 dicts 透出) */
19
+ filter?: string;
20
+ /** 通用透传插槽:渲染 <slot :name="slotName" :item :row v-bind="scope" />,无默认内容 */
21
+ slotName?: string;
22
+ /** 配合 slotName 追加透传给插槽的参数(v-bind 展开) */
23
+ scope?: Record<string, any>;
24
+ }
25
+ export interface DescriptionGroup {
26
+ /** 分组标题(蓝条 + 文字) */
27
+ title?: string;
28
+ items: DescriptionItem[];
9
29
  }
10
30
  type __VLS_Props = {
11
- /** 分组标题(左侧带蓝色竖条);不传则不渲染标题区 */
31
+ /** 单分组标题(仅 title+items 入口用) */
12
32
  title?: string;
33
+ /** 单分组描述项(字面量入口) */
34
+ items?: DescriptionItem[];
35
+ /** 多分组(新入口名) */
36
+ groups?: DescriptionGroup[];
37
+ /** 多分组(兼容老 CustomDescription 的入口名,优先于 groups) */
38
+ options?: DescriptionGroup[];
39
+ /** 数据源;传了即开启路径模式:item.value 按字段解析 */
40
+ data?: Record<string, any> | null;
13
41
  /** 列数:'auto' 按容器宽度自适应(默认);传数字则固定列数 */
14
42
  column?: number | 'auto';
15
43
  /** 自适应时的单列最小宽度(px),决定「多宽开始多排一列」 */
16
44
  minColumnWidth?: number;
17
- /** 描述项 */
18
- items?: DescriptionItem[];
45
+ /** 新式单向加载遮罩 */
46
+ loading?: boolean;
47
+ /** loading 遮罩文案 */
48
+ loadingText?: string;
49
+ /** 兼容老 API 的加载遮罩(v-model:showCover) */
50
+ showCover?: boolean;
51
+ /** showCover 遮罩文案 */
52
+ coverText?: string;
53
+ /** 字典名 → 选项映射(应用侧把 useDict 结果按名字汇总传入);
54
+ * #dict 插槽未提供时,type:'dict' 项内置渲染 YwDictStatus */
55
+ dictOptions?: Record<string, DictStatusOption[]>;
19
56
  };
20
57
  declare function __VLS_template(): {
21
58
  attrs: Partial<{}>;
22
- slots: {
59
+ slots: Partial<Record<string, (_: {
60
+ item: DescriptionItem;
61
+ row: Record<string, any> | null;
62
+ }) => any>> & {
63
+ dict?(_: {
64
+ item: DescriptionItem;
65
+ dicts: string | undefined;
66
+ value: string;
67
+ row: Record<string, any> | null;
68
+ }): any;
69
+ file?(_: {
70
+ item: DescriptionItem;
71
+ row: Record<string, any> | null;
72
+ }): any;
23
73
  value?(_: {
24
74
  item: DescriptionItem;
25
75
  index: number;
76
+ row: Record<string, any> | null;
26
77
  }): any;
78
+ other?(_: {}): any;
27
79
  };
28
80
  refs: {};
29
81
  rootEl: HTMLDivElement;
30
82
  };
31
83
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
32
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
84
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
85
+ "update:showCover": (value: boolean) => any;
86
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
87
+ "onUpdate:showCover"?: ((value: boolean) => any) | undefined;
88
+ }>, {
89
+ data: Record<string, any> | null;
33
90
  title: string;
34
- column: number | "auto";
35
91
  items: DescriptionItem[];
92
+ loading: boolean;
93
+ column: number | "auto";
94
+ loadingText: string;
95
+ options: DescriptionGroup[];
96
+ showCover: boolean;
97
+ dictOptions: Record<string, DictStatusOption[]>;
98
+ groups: DescriptionGroup[];
36
99
  minColumnWidth: number;
100
+ coverText: string;
37
101
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
38
102
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
39
103
  export default _default;
@@ -2,3 +2,4 @@ import { Plugin } from 'vue';
2
2
  import { default as Descriptions } from './Descriptions.vue';
3
3
  declare const _default: typeof Descriptions & Plugin;
4
4
  export default _default;
5
+ export type { DescriptionItem, DescriptionGroup } from './Descriptions.vue';
@@ -276,9 +276,9 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
276
276
  center: boolean;
277
277
  title: string;
278
278
  width: string | number;
279
+ top: string;
279
280
  modelValue: boolean;
280
281
  fullscreen: boolean;
281
- top: string;
282
282
  modal: boolean;
283
283
  modalPenetrable: boolean;
284
284
  modalClass: string;
@@ -0,0 +1,26 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export type DictTagType = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger';
3
+ export interface DictStatusOption {
4
+ /** 展示文案 */
5
+ label: string;
6
+ /** 字典值(宽松相等匹配 value) */
7
+ value: string;
8
+ /** 语义色:default 渲染纯文本,其余映射 YwTag 语义色 */
9
+ elTagType?: DictTagType;
10
+ /** 保留字段(老组件也未消费) */
11
+ elTagClass?: string;
12
+ }
13
+ type __VLS_Props = {
14
+ /** 字典选项(应用侧 useDict 结果原样传入) */
15
+ dictOption?: DictStatusOption[];
16
+ /** 字典值 */
17
+ value?: string | number;
18
+ /** 文字色(dot / 纯文本形态生效;filled 由 YwTag 语义色接管) */
19
+ color?: string;
20
+ };
21
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
+ color: string;
23
+ value: string | number;
24
+ dictOption: DictStatusOption[];
25
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
26
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as DictStatus } from './DictStatus.vue';
3
+ declare const _default: typeof DictStatus & Plugin;
4
+ export default _default;
5
+ export type { DictStatusOption, DictTagType } from './DictStatus.vue';
@@ -0,0 +1,68 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type DrawerSize = 'small' | 'default' | 'large' | 'huge' | 'full';
3
+ export interface DrawerProps {
4
+ /** 显隐(v-model) */
5
+ modelValue?: boolean;
6
+ /** 头部标题;为空时只显示关闭按钮 */
7
+ title?: string;
8
+ /** 预设宽度档:small 400 / default 680 / large 960 / huge 1200 / full 100% */
9
+ size?: DrawerSize;
10
+ /** 自定义宽度,优先级高于 size(数字按 px) */
11
+ width?: string | number;
12
+ /** 是否渲染蒙层底色。默认 false(设计稿要求:无蒙层,仅左侧投影) */
13
+ modal?: boolean;
14
+ /** 点击抽屉外部区域是否关闭。默认 true */
15
+ closeOnClickModal?: boolean;
16
+ /** 是否显示右上角关闭按钮 */
17
+ showClose?: boolean;
18
+ /** 挂到 body 上,避免被父级 overflow / transform 裁剪 */
19
+ appendToBody?: boolean;
20
+ appendTo?: string;
21
+ /** 打开时锁定页面滚动 */
22
+ lockScroll?: boolean;
23
+ /** ESC 关闭。无蒙层时点外部不会关闭(外部没有遮罩层可接点击),ESC 是唯一的键盘出口 */
24
+ closeOnPressEscape?: boolean;
25
+ destroyOnClose?: boolean;
26
+ zIndex?: number;
27
+ }
28
+ declare function __VLS_template(): {
29
+ attrs: Partial<{}>;
30
+ slots: Partial<Record<string, (_: any) => any>>;
31
+ refs: {};
32
+ rootEl: any;
33
+ };
34
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
35
+ declare const __VLS_component: DefineComponent<DrawerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
36
+ close: (...args: any[]) => void;
37
+ "update:modelValue": (...args: any[]) => void;
38
+ open: (...args: any[]) => void;
39
+ opened: (...args: any[]) => void;
40
+ closed: (...args: any[]) => void;
41
+ }, string, PublicProps, Readonly<DrawerProps> & Readonly<{
42
+ onClose?: ((...args: any[]) => any) | undefined;
43
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
44
+ onOpen?: ((...args: any[]) => any) | undefined;
45
+ onOpened?: ((...args: any[]) => any) | undefined;
46
+ onClosed?: ((...args: any[]) => any) | undefined;
47
+ }>, {
48
+ size: DrawerSize;
49
+ zIndex: number;
50
+ title: string;
51
+ width: string | number;
52
+ modelValue: boolean;
53
+ modal: boolean;
54
+ appendToBody: boolean;
55
+ appendTo: string;
56
+ lockScroll: boolean;
57
+ closeOnClickModal: boolean;
58
+ closeOnPressEscape: boolean;
59
+ showClose: boolean;
60
+ destroyOnClose: boolean;
61
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
62
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
63
+ export default _default;
64
+ type __VLS_WithTemplateSlots<T, S> = T & {
65
+ new (): {
66
+ $slots: S;
67
+ };
68
+ };
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as Drawer } from './Drawer.vue';
3
+ declare const _default: typeof Drawer & Plugin;
4
+ export default _default;
@@ -303,8 +303,8 @@ declare const __VLS_component: DefineComponent<globalThis.ExtractPropTypes<{
303
303
  label: string;
304
304
  disabled: boolean;
305
305
  autofocus: boolean;
306
- modelValue: string | number;
307
306
  name: string;
307
+ modelValue: string | number;
308
308
  placeholder: string;
309
309
  formatter: Function;
310
310
  ariaLabel: string;