erp-plus 1.0.142 → 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;
@@ -88,11 +88,11 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
88
88
  }>, {
89
89
  data: Record<string, any> | null;
90
90
  title: string;
91
+ items: DescriptionItem[];
91
92
  loading: boolean;
92
93
  column: number | "auto";
93
94
  loadingText: string;
94
95
  options: DescriptionGroup[];
95
- items: DescriptionItem[];
96
96
  showCover: boolean;
97
97
  dictOptions: Record<string, DictStatusOption[]>;
98
98
  groups: DescriptionGroup[];
@@ -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,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;
@@ -289,7 +289,7 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
289
289
  default: boolean;
290
290
  };
291
291
  placement: {
292
- type: PropType<"left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined>;
292
+ type: PropType<"left" | "right" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined>;
293
293
  default: string;
294
294
  };
295
295
  maxCollapseTags: {
@@ -305,8 +305,8 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
305
305
  onChange?: ((...args: any[]) => any) | undefined;
306
306
  onFocus?: ((...args: any[]) => any) | undefined;
307
307
  onClear?: ((...args: any[]) => any) | undefined;
308
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
309
308
  "onVisible-change"?: ((...args: any[]) => any) | undefined;
309
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
310
310
  "onRemove-tag"?: ((...args: any[]) => any) | undefined;
311
311
  "onPopup-scroll"?: ((...args: any[]) => any) | undefined;
312
312
  }>, {
@@ -318,16 +318,17 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
318
318
  change: (...args: any[]) => void;
319
319
  focus: (...args: any[]) => void;
320
320
  clear: (...args: any[]) => void;
321
- "update:modelValue": (...args: any[]) => void;
322
321
  "visible-change": (...args: any[]) => void;
322
+ "update:modelValue": (...args: any[]) => void;
323
323
  "remove-tag": (...args: any[]) => void;
324
324
  "popup-scroll": (...args: any[]) => void;
325
325
  }, PublicProps, {
326
326
  size: "default" | "small" | "large" | undefined;
327
327
  loading: boolean;
328
328
  disabled: boolean;
329
- modelValue: string | number | unknown[];
330
329
  name: string;
330
+ offset: number;
331
+ modelValue: string | number | unknown[];
331
332
  placeholder: string;
332
333
  id: string;
333
334
  teleported: boolean;
@@ -337,8 +338,7 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
337
338
  persistent: boolean;
338
339
  effect: "dark" | "light" | undefined;
339
340
  popperClass: string;
340
- offset: number;
341
- placement: "left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
341
+ placement: "left" | "right" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
342
342
  valueKey: string;
343
343
  validateEvent: boolean;
344
344
  suffixIcon: string | Function | Record<string, any>;
@@ -542,7 +542,7 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
542
542
  default: boolean;
543
543
  };
544
544
  placement: {
545
- type: PropType<"left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined>;
545
+ type: PropType<"left" | "right" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined>;
546
546
  default: string;
547
547
  };
548
548
  maxCollapseTags: {
@@ -558,8 +558,8 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
558
558
  onChange?: ((...args: any[]) => any) | undefined;
559
559
  onFocus?: ((...args: any[]) => any) | undefined;
560
560
  onClear?: ((...args: any[]) => any) | undefined;
561
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
562
561
  "onVisible-change"?: ((...args: any[]) => any) | undefined;
562
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
563
563
  "onRemove-tag"?: ((...args: any[]) => any) | undefined;
564
564
  "onPopup-scroll"?: ((...args: any[]) => any) | undefined;
565
565
  }>, {
@@ -570,8 +570,9 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
570
570
  size: "default" | "small" | "large" | undefined;
571
571
  loading: boolean;
572
572
  disabled: boolean;
573
- modelValue: string | number | unknown[];
574
573
  name: string;
574
+ offset: number;
575
+ modelValue: string | number | unknown[];
575
576
  placeholder: string;
576
577
  id: string;
577
578
  teleported: boolean;
@@ -581,8 +582,7 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
581
582
  persistent: boolean;
582
583
  effect: "dark" | "light" | undefined;
583
584
  popperClass: string;
584
- offset: number;
585
- placement: "left" | "right" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | undefined;
585
+ placement: "left" | "right" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
586
586
  valueKey: string;
587
587
  validateEvent: boolean;
588
588
  suffixIcon: string | Function | Record<string, any>;
@@ -196,8 +196,8 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
196
196
  change: (...args: any[]) => void;
197
197
  focus: (...args: any[]) => void;
198
198
  clear: (...args: any[]) => void;
199
- "update:modelValue": (...args: any[]) => void;
200
199
  "visible-change": (...args: any[]) => void;
200
+ "update:modelValue": (...args: any[]) => void;
201
201
  "remove-tag": (...args: any[]) => void;
202
202
  "popup-scroll": (...args: any[]) => void;
203
203
  }, string, PublicProps, Readonly<globalThis.ExtractPropTypes<{
@@ -385,16 +385,17 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
385
385
  onChange?: ((...args: any[]) => any) | undefined;
386
386
  onFocus?: ((...args: any[]) => any) | undefined;
387
387
  onClear?: ((...args: any[]) => any) | undefined;
388
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
389
388
  "onVisible-change"?: ((...args: any[]) => any) | undefined;
389
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
390
390
  "onRemove-tag"?: ((...args: any[]) => any) | undefined;
391
391
  "onPopup-scroll"?: ((...args: any[]) => any) | undefined;
392
392
  }>, {
393
393
  size: sizeType;
394
394
  loading: boolean;
395
395
  disabled: boolean;
396
- modelValue: string | number | unknown[];
397
396
  name: string;
397
+ offset: number;
398
+ modelValue: string | number | unknown[];
398
399
  placeholder: string;
399
400
  id: string;
400
401
  teleported: boolean;
@@ -404,7 +405,6 @@ declare const _default: DefineComponent<globalThis.ExtractPropTypes<{
404
405
  persistent: boolean;
405
406
  effect: effectType;
406
407
  popperClass: string;
407
- offset: number;
408
408
  placement: placementType;
409
409
  valueKey: string;
410
410
  validateEvent: boolean;
@@ -47,14 +47,14 @@ declare const _default: DefineComponent<__VLS_Props, {
47
47
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
48
48
  change: (...args: any[]) => void;
49
49
  clear: (...args: any[]) => void;
50
- "update:modelValue": (...args: any[]) => void;
51
50
  "visible-change": (...args: any[]) => void;
51
+ "update:modelValue": (...args: any[]) => void;
52
52
  "remove-tag": (...args: any[]) => void;
53
53
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
54
54
  onChange?: ((...args: any[]) => any) | undefined;
55
55
  onClear?: ((...args: any[]) => any) | undefined;
56
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
57
56
  "onVisible-change"?: ((...args: any[]) => any) | undefined;
57
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
58
58
  "onRemove-tag"?: ((...args: any[]) => any) | undefined;
59
59
  }>, {
60
60
  size: "large" | "default" | "small";
@@ -28,9 +28,9 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
28
  declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
29
29
  type: TagType;
30
30
  label: string;
31
+ square: boolean;
31
32
  variant: TagVariant;
32
33
  dense: boolean;
33
- square: boolean;
34
34
  shape: TagShape;
35
35
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
36
36
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -0,0 +1,45 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ /**
3
+ * 纯文本(跟随档位字号)
4
+ *
5
+ * 用途:说明 / 提示 / 辅助文案这类不需要任何盒子样式的文字。
6
+ * 存在的意义就是**字号自动跟随档位**:默认档 14px、稍小档 12px
7
+ * (字号只在档位文件里下发,组件内不写死,避免和 default.scss / size.scss 打架)。
8
+ *
9
+ * 颜色默认三级灰 $zz-text-thirdary(#838599,按 UED 截图取色),可用 color 覆盖。
10
+ * 行高不预设,跟随上下文(放在表单、Description、卡片里都与周围一致);
11
+ * 需要固定行高时在外层给 line-height 即可。
12
+ *
13
+ * <yw-text text="按清单行数自动生成,不可编辑" />
14
+ * <yw-text color="#1A1A1A">自定义颜色</yw-text>
15
+ * <yw-text truncate text="超长单行文本会显示省略号" />
16
+ */
17
+ type __VLS_Props = {
18
+ /** 文本内容(也可以直接用默认插槽) */
19
+ text?: string;
20
+ /** 文字颜色,默认 $zz-text-thirdary(#838599) */
21
+ color?: string;
22
+ /** 单行超出省略(需要父容器有宽度约束) */
23
+ truncate?: boolean;
24
+ };
25
+ declare function __VLS_template(): {
26
+ attrs: Partial<{}>;
27
+ slots: {
28
+ default?(_: {}): any;
29
+ };
30
+ refs: {};
31
+ rootEl: HTMLSpanElement;
32
+ };
33
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
34
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
35
+ color: string;
36
+ text: string;
37
+ truncate: boolean;
38
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
39
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
40
+ export default _default;
41
+ type __VLS_WithTemplateSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as Text } from './Text.vue';
3
+ declare const _default: typeof Text & Plugin;
4
+ export default _default;
@@ -1,28 +1,95 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  /**
3
- * 标题(左侧蓝色竖条 + 文字)
3
+ * 标题(左侧蓝色竖条 + 文字),支持两种形态:
4
4
  *
5
- * 从 Descriptions 的分组标题里拆出来的独立组件,样式与那里完全一致:
6
- * - 蓝条 4×12(两档相同),圆角 2px(= 宽度一半,两端半圆)
7
- * - 蓝条到文字 8px
5
+ * 1. 普通标题:<yw-title label="申请信息" />
6
+ * 2. 统计式:多段「标签 + 数值」,段间 1px 竖线,可挂链接按钮、行尾说明
7
+ * <yw-title
8
+ * :items="[
9
+ * { label: '收款合计:', value: '80,000.00' },
10
+ * { label: '付款合计:', value: '8,000.00', link: { text: '明细', key: 'pay' } }
11
+ * ]"
12
+ * :links="[{ text: '查看全部', key: 'all' }]"
13
+ * note="非实时数据,数据统计延迟约 5-10 分钟"
14
+ * @link-click="(link) => ..."
15
+ * />
16
+ *
17
+ * 规格(两档):
18
+ * - 蓝条 4×12、圆角 2px,到文字 8px
8
19
  * - 文字 500、#1A1A1A;字号默认档 14 / 稍小档 12
20
+ * - 段间竖线 1px 宽 × 1em 高、#1A1A1A,两侧各 12px
21
+ * - 数值 #F53F3F;说明文字 #838599 / 字重 400
9
22
  * - 组件不带外边距,与下方内容的间距由使用方给
23
+ *
24
+ * 2026-10-30 变更:竖线 2px → 1px;新增段内 / 行尾链接按钮;所有可见字段均可由外部传入
25
+ * (label / items[].label / items[].value / items[].valueColor / items[].link / links / note / showBar),
26
+ * 需要完全自定义时用 #item、#actions、#note 插槽。
10
27
  */
28
+ type LinkType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
29
+ /** 链接按钮(内部用 yw-button 的 link 形态实现,颜色/悬浮态跟随设计规范) */
30
+ export interface TitleLink {
31
+ /** 链接文字 */
32
+ text: string;
33
+ /** 业务标识,点击事件里带回来,便于一个回调里分支处理 */
34
+ key?: string | number;
35
+ /** 颜色类型,默认 primary(蓝色);default 为 #1A1A1A */
36
+ type?: LinkType;
37
+ /** 是否禁用 */
38
+ disabled?: boolean;
39
+ /** yw-button 的 icon 名(如 Plus / Edit),一般不用 */
40
+ icon?: string;
41
+ /** 自定义文字色,传了会覆盖 type 的颜色 */
42
+ color?: string;
43
+ /** 单个链接的点击回调;不传则统一走 @link-click */
44
+ onClick?: (e: MouseEvent) => void;
45
+ }
46
+ export interface TitleItem {
47
+ /** 段标签,例如「收款合计:」(冒号由调用方带上) */
48
+ label: string;
49
+ /** 段数值,例如「80,000.00」;不传则只渲染标签 */
50
+ value?: string | number;
51
+ /** 数值颜色,传了覆盖默认的危险色(例如负数红 / 正数绿) */
52
+ valueColor?: string;
53
+ /** 段尾链接按钮 */
54
+ link?: TitleLink;
55
+ }
11
56
  type __VLS_Props = {
12
57
  /** 标题文字(也可以直接用默认插槽) */
13
58
  label?: string;
59
+ /** 统计段列表;传了就用统计式排版,忽略 label / 默认插槽 */
60
+ items?: TitleItem[];
61
+ /** 行尾说明文字(灰字),例如「非实时数据,数据统计延迟约 5-10 分钟」 */
62
+ note?: string;
63
+ /** 行尾链接按钮组(在说明文字之后,多个之间 8px) */
64
+ links?: TitleLink[];
65
+ /** 是否显示左侧蓝条,默认 true */
66
+ showBar?: boolean;
14
67
  };
15
68
  declare function __VLS_template(): {
16
69
  attrs: Partial<{}>;
17
70
  slots: {
71
+ item?(_: {
72
+ item: TitleItem;
73
+ index: number;
74
+ }): any;
18
75
  default?(_: {}): any;
76
+ note?(_: {}): any;
77
+ actions?(_: {}): any;
19
78
  };
20
79
  refs: {};
21
80
  rootEl: HTMLDivElement;
22
81
  };
23
82
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
83
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
84
+ "link-click": (link: TitleLink, index: number) => any;
85
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
86
+ "onLink-click"?: ((link: TitleLink, index: number) => any) | undefined;
87
+ }>, {
25
88
  label: string;
89
+ items: TitleItem[];
90
+ note: string;
91
+ links: TitleLink[];
92
+ showBar: boolean;
26
93
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
27
94
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
95
  export default _default;
@@ -2,3 +2,4 @@ import { Plugin } from 'vue';
2
2
  import { default as Title } from './Title.vue';
3
3
  declare const _default: typeof Title & Plugin;
4
4
  export default _default;
5
+ export type { TitleItem, TitleLink } from './Title.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erp-plus",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
4
4
  "author": "zhangxl",
5
5
  "main": "dist/erp-plus.umd.js",
6
6
  "module": "dist/erp-plus.es.js",