@shaonq/vue 1.3.3 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { Component } from 'vue';
4
4
  import { ComponentOptionsMixin } from 'vue';
5
5
  import { ComponentProvideOptions } from 'vue';
6
6
  import { ComputedOptions } from 'vue';
7
+ import { CSSProperties } from 'vue';
7
8
  import { DefineComponent } from 'vue';
8
9
  import { ExtractPropTypes } from 'vue';
9
10
  import { FormItem } from '@arco-design/web-vue';
@@ -19,7 +20,9 @@ import { PublicProps } from 'vue';
19
20
  import { Ref } from 'vue';
20
21
  import { SelectOptionData } from '@arco-design/web-vue';
21
22
  import { Size } from '@arco-design/web-vue';
23
+ import { StoreDefinition } from 'pinia';
22
24
  import { TablePublicMethods } from 'vxe-table';
25
+ import { VNode } from 'vue';
23
26
  import { VxeColumnPropTypes } from 'vxe-table';
24
27
  import { VxeTable } from 'vxe-table';
25
28
  import { VxeTableDataRow } from 'vxe-table';
@@ -227,14 +230,24 @@ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
227
230
 
228
231
  declare type ButtonInstance = InstanceType<typeof Button>;
229
232
 
230
- /** 组件属性处理函数签名 */
233
+ /**
234
+ * componentAttr 中函数属性的回调参数
235
+ * @description 当 `componentAttr` 的某个值为函数时,函数在渲染时执行,注入以下参数
236
+ */
231
237
  declare type ComponentAttrHandler = (util: OrcFormUtilBind, index?: any) => unknown;
232
238
 
233
- /** 组件属性允许的值类型 */
239
+ /** componentAttr 支持的静态值类型 */
234
240
  declare type ComponentAttrValue = null | boolean | number | string | RecordAny_3 | RecordAny_3[] | ComponentAttrHandler;
235
241
 
236
- export declare interface CssType extends Partial<CSSStyleDeclaration>, RecordAny_2 {
237
- }
242
+ /**
243
+ * 单元格样式:对象 | 支持动态函数
244
+ * @param {Object} params
245
+ * @param {any} params.row - 行数据
246
+ * @param {number} params.rowIndex - 行索引
247
+ * @param {RecordAny} params.column - 列配置
248
+ * @param {number} params.columnIndex - 列索引
249
+ */
250
+ export declare type CssType = Partial<CSSProperties> & RecordAny_2;
238
251
 
239
252
  export declare const deepClone: <T = RecordAny | RecordAny[]>(origin: T) => T;
240
253
 
@@ -245,6 +258,8 @@ export default _default;
245
258
 
246
259
  export declare function delay(ms: number): Promise<unknown>;
247
260
 
261
+ declare type DictLoadFn = (code: string) => Promise<unknown[]>;
262
+
248
263
  export declare const download: (url: string, fileName?: string) => boolean;
249
264
 
250
265
  /**
@@ -290,15 +305,15 @@ declare interface FieldOption {
290
305
 
291
306
  export declare function findObject<T extends RecordAny>(obj: T, keys?: string | string[]): T;
292
307
 
293
- /** 行数据格式化 千分位|日期 */
308
+ /** 行数据格式化工具:千分位|日期|百分比 */
294
309
  export declare const formatTable: {
295
- /** 千分位|保留小数 */
310
+ /** 千分位格式化,支持小数位控制 */
296
311
  tf: (val: any, digits?: any) => any;
297
- /** 快捷格式化日期 */
312
+ /** 快捷日期格式化 yyyy-MM-dd */
298
313
  t: (val: any) => string;
299
- /** 完整格式化日期 yyyy-MM-dd HH:mm:ss */
314
+ /** 完整日期格式化,默认 yyyy-MM-dd HH:mm:ss */
300
315
  time: (val: any, f?: string) => string;
301
- /** percent 格式化百分比 */
316
+ /** 百分比格式化,默认保留2位小数,数据自动×100 */
302
317
  p: (val: any, digits?: any, percent?: string) => string;
303
318
  };
304
319
 
@@ -410,396 +425,11 @@ declare const lang_2: {
410
425
  };
411
426
  };
412
427
 
413
- export declare const locale: {
414
- enUS: {
415
- fe: {
416
- panel: {
417
- title: string;
418
- model: string;
419
- bcid: string;
420
- padding: string;
421
- name: string;
422
- width: string;
423
- height: string;
424
- size: string;
425
- labelWidth: string;
426
- labelAlign: string;
427
- custom: string;
428
- placeholder: string;
429
- layout: string;
430
- block: string;
431
- inline: string;
432
- contentPosition: string;
433
- left: string;
434
- right: string;
435
- center: string;
436
- showInput: string;
437
- min: string;
438
- max: string;
439
- step: string;
440
- multiple: string;
441
- filterable: string;
442
- allowHalf: string;
443
- showAlpha: string;
444
- showLabel: string;
445
- option: string;
446
- options: string;
447
- staticData: string;
448
- remoteData: string;
449
- remoteFunc: string;
450
- value: string;
451
- label: string;
452
- childrenOption: string;
453
- defaultValue: string;
454
- showType: string;
455
- isRange: string;
456
- isTimestamp: string;
457
- startPlaceholder: string;
458
- endPlaceholder: string;
459
- format: string;
460
- limit: string;
461
- imageAction: string;
462
- tip: string;
463
- action: string;
464
- defaultType: string;
465
- string: string;
466
- object: string;
467
- array: string;
468
- number: string;
469
- boolean: string;
470
- integer: string;
471
- float: string;
472
- url: string;
473
- email: string;
474
- hex: string;
475
- gutter: string;
476
- columnOption: string;
477
- span: string;
478
- justify: string;
479
- justifyStart: string;
480
- justifyEnd: string;
481
- justifyCenter: string;
482
- justifySpaceAround: string;
483
- justifySpaceBetween: string;
484
- align: string;
485
- alignTop: string;
486
- alignMiddle: string;
487
- alignBottom: string;
488
- type: string;
489
- default: string;
490
- card: string;
491
- borderCard: string;
492
- tabPosition: string;
493
- top: string;
494
- bottom: string;
495
- tabOption: string;
496
- tabName: string;
497
- customClass: string;
498
- attribute: string;
499
- dataBind: string;
500
- hidden: string;
501
- readonly: string;
502
- disabled: string;
503
- editable: string;
504
- clearable: string;
505
- arrowControl: string;
506
- isDelete: string;
507
- isEdit: string;
508
- showPassword: string;
509
- validate: string;
510
- required: string;
511
- patternPlaceholder: string;
512
- newOption: string;
513
- tab: string;
514
- validatorRequired: string;
515
- validatorType: string;
516
- validatorPattern: string;
517
- showWordLimit: string;
518
- maxLength: string;
519
- textAlign: string;
520
- fontSize: string;
521
- fontFamily: string;
522
- rowspan: string;
523
- colspan: string;
524
- borderTop: string;
525
- borderLeft: string;
526
- };
527
- side: {
528
- fields: {
529
- input: string;
530
- textarea: string;
531
- number: string;
532
- radio: string;
533
- checkbox: string;
534
- time: string;
535
- date: string;
536
- rate: string;
537
- color: string;
538
- select: string;
539
- switch: string;
540
- slider: string;
541
- text: string;
542
- blank: string;
543
- fileupload: string;
544
- imgupload: string;
545
- editor: string;
546
- cascader: string;
547
- table: string;
548
- grid: string;
549
- tabs: string;
550
- divider: string;
551
- };
552
- basic: {
553
- title: string;
554
- };
555
- advance: {
556
- title: string;
557
- };
558
- layout: {
559
- title: string;
560
- };
561
- };
562
- description: {
563
- containerEmpty: string;
564
- configEmpty: string;
565
- tableEmpty: string;
566
- uploadJsonInfo: string;
567
- };
568
- message: {
569
- copySuccess: string;
570
- validError: string;
571
- };
572
- actions: {
573
- import: string;
574
- clear: string;
575
- preview: string;
576
- json: string;
577
- code: string;
578
- getData: string;
579
- reset: string;
580
- copyData: string;
581
- cancel: string;
582
- confirm: string;
583
- addOption: string;
584
- addColumn: string;
585
- addTab: string;
586
- upload: string;
587
- add: string;
588
- enabledEdit: string;
589
- disabledEdit: string;
590
- };
591
- config: {
592
- width: string;
593
- height: string;
594
- title: string;
595
- labelWidth: string;
596
- labelAlign: string;
597
- labelAlignLeft: string;
598
- labelAlignRight: string;
599
- labelAlignTop: string;
600
- size: string;
601
- customClass: string;
602
- };
603
- };
604
- };
605
- zhCN: {
606
- fe: {
607
- panel: {
608
- title: string;
609
- model: string;
610
- bcid: string;
611
- padding: string;
612
- name: string;
613
- width: string;
614
- height: string;
615
- size: string;
616
- labelWidth: string;
617
- labelAlign: string;
618
- custom: string;
619
- placeholder: string;
620
- layout: string;
621
- block: string;
622
- inline: string;
623
- contentPosition: string;
624
- left: string;
625
- right: string;
626
- center: string;
627
- showInput: string;
628
- min: string;
629
- max: string;
630
- step: string;
631
- multiple: string;
632
- filterable: string;
633
- allowHalf: string;
634
- showAlpha: string;
635
- showLabel: string;
636
- option: string;
637
- options: string;
638
- staticData: string;
639
- remoteData: string;
640
- remoteFunc: string;
641
- value: string;
642
- label: string;
643
- childrenOption: string;
644
- defaultValue: string;
645
- showType: string;
646
- isRange: string;
647
- isTimestamp: string;
648
- startPlaceholder: string;
649
- endPlaceholder: string;
650
- format: string;
651
- limit: string;
652
- imageAction: string;
653
- tip: string;
654
- action: string;
655
- defaultType: string;
656
- string: string;
657
- object: string;
658
- array: string;
659
- number: string;
660
- boolean: string;
661
- integer: string;
662
- float: string;
663
- url: string;
664
- email: string;
665
- hex: string;
666
- gutter: string;
667
- columnOption: string;
668
- span: string;
669
- justify: string;
670
- justifyStart: string;
671
- justifyEnd: string;
672
- justifyCenter: string;
673
- justifySpaceAround: string;
674
- justifySpaceBetween: string;
675
- align: string;
676
- alignTop: string;
677
- alignMiddle: string;
678
- alignBottom: string;
679
- type: string;
680
- default: string;
681
- card: string;
682
- borderCard: string;
683
- tabPosition: string;
684
- top: string;
685
- bottom: string;
686
- tabOption: string;
687
- tabName: string;
688
- customClass: string;
689
- attribute: string;
690
- dataBind: string;
691
- hidden: string;
692
- readonly: string;
693
- disabled: string;
694
- editable: string;
695
- clearable: string;
696
- arrowControl: string;
697
- isDelete: string;
698
- isEdit: string;
699
- showPassword: string;
700
- validate: string;
701
- required: string;
702
- patternPlaceholder: string;
703
- newOption: string;
704
- tab: string;
705
- validatorRequired: string;
706
- validatorType: string;
707
- validatorPattern: string;
708
- showWordLimit: string;
709
- maxLength: string;
710
- textAlign: string;
711
- fontSize: string;
712
- fontFamily: string;
713
- rowspan: string;
714
- colspan: string;
715
- borderTop: string;
716
- borderLeft: string;
717
- };
718
- side: {
719
- fields: {
720
- input: string;
721
- textarea: string;
722
- number: string;
723
- radio: string;
724
- checkbox: string;
725
- time: string;
726
- date: string;
727
- rate: string;
728
- color: string;
729
- select: string;
730
- switch: string;
731
- slider: string;
732
- text: string;
733
- blank: string;
734
- fileupload: string;
735
- imgupload: string;
736
- editor: string;
737
- cascader: string;
738
- table: string;
739
- grid: string;
740
- tabs: string;
741
- divider: string;
742
- };
743
- basic: {
744
- title: string;
745
- };
746
- advance: {
747
- title: string;
748
- };
749
- layout: {
750
- title: string;
751
- };
752
- };
753
- description: {
754
- containerEmpty: string;
755
- configEmpty: string;
756
- tableEmpty: string;
757
- uploadJsonInfo: string;
758
- };
759
- message: {
760
- copySuccess: string;
761
- validError: string;
762
- };
763
- actions: {
764
- import: string;
765
- clear: string;
766
- preview: string;
767
- json: string;
768
- code: string;
769
- getData: string;
770
- reset: string;
771
- copyData: string;
772
- cancel: string;
773
- confirm: string;
774
- addOption: string;
775
- addColumn: string;
776
- addTab: string;
777
- upload: string;
778
- add: string;
779
- enabledEdit: string;
780
- disabledEdit: string;
781
- };
782
- config: {
783
- width: string;
784
- height: string;
785
- title: string;
786
- labelWidth: string;
787
- labelAlign: string;
788
- labelAlignLeft: string;
789
- labelAlignRight: string;
790
- labelAlignTop: string;
791
- size: string;
792
- customClass: string;
793
- };
794
- };
795
- };
796
- };
797
-
798
428
  /** 日志 */
799
429
  export declare function log(...args: any[]): void;
800
430
 
801
431
  /** 合并配置文件 */
802
- export declare function mergeConfig(defaults: RecordAny, overrides: RecordAny, isRoot?: boolean): RecordAny;
432
+ export declare function mergeConfig(defaults: RecordAny, overrides: RecordAny): RecordAny;
803
433
 
804
434
  declare type ModalInstance = InstanceType<typeof Modal>;
805
435
 
@@ -812,61 +442,28 @@ declare function onSubmit(): Promise<[boolean, any]>;
812
442
 
813
443
  declare function onSubmit_2(): Promise<void>;
814
444
 
815
- export declare const OrcDesign: DefineComponent<ExtractPropTypes<{
816
- readonly: BooleanConstructor;
817
- data: {
818
- type: ObjectConstructor;
819
- default(): {};
820
- };
821
- models: {
822
- type: ObjectConstructor;
823
- default(): {};
824
- };
825
- remoteFuncs: {
826
- type: ObjectConstructor;
827
- default(): {};
828
- };
829
- moduleConfig: ArrayConstructor;
830
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
831
- save: (...args: any[]) => void;
832
- }, string, PublicProps, Readonly< ExtractPropTypes<{
833
- readonly: BooleanConstructor;
834
- data: {
835
- type: ObjectConstructor;
836
- default(): {};
837
- };
838
- models: {
839
- type: ObjectConstructor;
840
- default(): {};
841
- };
842
- remoteFuncs: {
843
- type: ObjectConstructor;
844
- default(): {};
845
- };
846
- moduleConfig: ArrayConstructor;
847
- }>> & Readonly<{
848
- onSave?: ((...args: any[]) => any) | undefined;
849
- }>, {
850
- data: Record<string, any>;
851
- readonly: boolean;
852
- models: Record<string, any>;
853
- remoteFuncs: Record<string, any>;
854
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
855
-
856
445
  export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_5<{
446
+ /** 表单字段配置数组 */
857
447
  config?: OrcFormItem[] | undefined;
448
+ /** 标签宽度,默认 '110px' */
858
449
  labelWidth?: string | undefined;
450
+ /** 标签对齐方式,默认 'right' */
859
451
  labelAlign?: "left" | "right" | undefined;
452
+ /** 提交按钮加载状态 */
860
453
  loading?: boolean | undefined;
454
+ /** 是否禁用整个表单 */
861
455
  disabled?: boolean | undefined;
456
+ /** 是否隐藏提交按钮 */
862
457
  hideSubmit?: boolean | undefined;
458
+ /** 表单数据(v-model) */
863
459
  modelValue?: Record<string, any> | undefined;
864
460
  /** 栅格间距 */
865
461
  gutter?: number | undefined;
866
- /** 栅格 24 */
462
+ /** 每行栅格数(基于 24 栅格),默认 24 */
867
463
  span?: number | undefined;
464
+ /** 透传到 Arco Form 组件的 props */
868
465
  formAttr?: Record<string, any> | undefined;
869
- /** 栅格grid 优先级低于行 span */
466
+ /** 栅格 grid 配置(优先级低于行内 span) */
870
467
  grid?: Record<string, any> | undefined;
871
468
  }>, {
872
469
  config: () => never[];
@@ -883,25 +480,33 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
883
480
  }>>, {
884
481
  onSubmit: typeof onSubmit;
885
482
  onReset: (defValue?: Partial<any> | undefined) => void;
886
- resetFields(): void;
483
+ resetFields: typeof resetFields;
887
484
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
888
485
  error: (...args: any[]) => void;
889
486
  submit: (...args: any[]) => void;
890
487
  "update:modelValue": (...args: any[]) => void;
891
488
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_5<{
489
+ /** 表单字段配置数组 */
892
490
  config?: OrcFormItem[] | undefined;
491
+ /** 标签宽度,默认 '110px' */
893
492
  labelWidth?: string | undefined;
493
+ /** 标签对齐方式,默认 'right' */
894
494
  labelAlign?: "left" | "right" | undefined;
495
+ /** 提交按钮加载状态 */
895
496
  loading?: boolean | undefined;
497
+ /** 是否禁用整个表单 */
896
498
  disabled?: boolean | undefined;
499
+ /** 是否隐藏提交按钮 */
897
500
  hideSubmit?: boolean | undefined;
501
+ /** 表单数据(v-model) */
898
502
  modelValue?: Record<string, any> | undefined;
899
503
  /** 栅格间距 */
900
504
  gutter?: number | undefined;
901
- /** 栅格 24 */
505
+ /** 每行栅格数(基于 24 栅格),默认 24 */
902
506
  span?: number | undefined;
507
+ /** 透传到 Arco Form 组件的 props */
903
508
  formAttr?: Record<string, any> | undefined;
904
- /** 栅格grid 优先级低于行 span */
509
+ /** 栅格 grid 配置(优先级低于行内 span) */
905
510
  grid?: Record<string, any> | undefined;
906
511
  }>, {
907
512
  config: () => never[];
@@ -920,11 +525,11 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
920
525
  onSubmit?: ((...args: any[]) => any) | undefined;
921
526
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
922
527
  }>, {
923
- grid: Record<string, any>;
924
- loading: boolean;
925
528
  disabled: boolean;
926
- modelValue: Record<string, any>;
529
+ loading: boolean;
530
+ grid: Record<string, any>;
927
531
  span: number;
532
+ modelValue: Record<string, any>;
928
533
  config: OrcFormItem[];
929
534
  labelWidth: string;
930
535
  labelAlign: "left" | "right";
@@ -936,10 +541,7 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
936
541
  value?: any;
937
542
  setValue?: ((v: any) => void) | undefined;
938
543
  options?: any;
939
- utils: OrcFormUtil & {
940
- model: string;
941
- getFormItem: () => OrcFormItem;
942
- } & Pick<OrcFormUtil, "onChange" | "onMounted">;
544
+ utils: OrcFormUtilBind;
943
545
  componentAttr: RecordAny_3;
944
546
  }) => any>> & {
945
547
  row?(_: {
@@ -974,7 +576,7 @@ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<E
974
576
  "onUpdate:modelValue"?: ((data: RecordAny) => any) | undefined;
975
577
  }>, {
976
578
  title: string;
977
- size: "large" | "medium" | "small" | "mini";
579
+ size: "medium" | "large" | "small" | "mini";
978
580
  modelValue: RecordAny;
979
581
  gutter: number;
980
582
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
@@ -993,80 +595,148 @@ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<E
993
595
  }>;
994
596
 
995
597
  /**
996
- * 表单配置项类型定义
997
- * @description 描述表单字段的元数据和行为规则
598
+ * 表单配置项
599
+ * @description 通过 `:config` 传递给 `<orc-form>` 的数组项,描述每个字段
600
+ * @example
601
+ * ```ts
602
+ * { type: 'a-input', model: 'name', name: '姓名', defaultValue: '',
603
+ * options: { required: true, placeholder: '请输入' } }
604
+ * ```
998
605
  */
999
606
  export declare type OrcFormItem = {
1000
607
  /**
1001
608
  * 组件类型标识
1002
- * @description 支持 Arco 内置组件或自定义 Vue 组件
609
+ * @description
610
+ * - 字符串: Arco 内置组件名,如 `'a-input'`、`'a-select'`、`'a-date-picker'`、`'a-switch'` 等
611
+ * - 组件对象: 自定义 Vue 组件或 `defineAsyncComponent`
612
+ * - 自定义组件时自动注入 `modelValue` / `updateModelValue` 实现 v-model
613
+ * - 自定义组件额外注入 `utils` prop(类型为 `OrcFormUtilBind`)
1003
614
  * @example
1004
- * - 内置组件: 'a-input'
1005
- * - 自定义组件: defineAsyncComponent(() => import('./custom-component.vue'))
615
+ * ```ts
616
+ * type: 'a-input'
617
+ * type: 'a-select'
618
+ * type: 'a-date-picker'
619
+ * type: 'a-textarea'
620
+ * type: defineAsyncComponent(() => import('./CustomPicker.vue'))
621
+ * ```
1006
622
  */
1007
623
  type?: string | Component;
1008
624
  /** 表单项标签文本 */
1009
625
  name?: string;
1010
- /** 关联数据模型键名 */
1011
- model?: OrcFormUtil['model'];
1012
- /** 是否渲染该表单项 */
1013
- show?: boolean;
1014
626
  /**
1015
- * 字段默认值
1016
- * @description 根据组件类型自动进行类型推断
627
+ * 关联数据字段名
628
+ * @description 对应 model 对象中的 key
1017
629
  */
630
+ model?: string;
631
+ /** 是否渲染该字段,默认 true。可通过 `util.setShow(model, bool)` 动态控制 */
632
+ show?: boolean;
633
+ /** 字段初始值,不传则默认为 null */
1018
634
  defaultValue?: Exclude<ComponentAttrValue, ComponentAttrHandler>;
1019
- /** 验证触发时机 */
635
+ /** 校验触发时机(仅当 Arco 组件支持时有效) */
1020
636
  validateTrigger?: 'change' | 'input' | 'focus' | 'blur';
1021
- /** 组件原生属性配置 */
637
+ /**
638
+ * 组件原型属性透传
639
+ * @description 透传到 Arco 组件或自定义组件的 props
640
+ * @note
641
+ * - 值可以是静态值,也可以是一个函数 `(util, index?) => value`,函数会在渲染时执行
642
+ * - 当 `type` 为 Arco 字符串时,可传 Arco 组件对应的 props:
643
+ * - `'a-input'` → `maxLength`, `showWordLimit`, `allowClear` 等
644
+ * - `'a-select'` → `options`, `allowSearch`, `multiple`, `maxTagCount` 等
645
+ * - `'a-date-picker'` → `format`, `showTime`, `disabledDate` 等
646
+ * - `'a-input-number'` → `min`, `max`, `precision`, `step` 等
647
+ * - `'a-switch'` → `checkedValue`, `uncheckedValue` 等
648
+ * - `'a-radio-group'` → `options`, `direction` 等
649
+ * - `'a-textarea'` → `maxLength`, `showWordLimit`, `autoSize` 等
650
+ * - `'a-tree-select'` → `treeData`, `allowSearch`, `treeCheckable` 等
651
+ * @example
652
+ * ```ts
653
+ * // 静态值
654
+ * componentAttr: { min: 0, max: 100 }
655
+ * // 函数值(渲染时执行)
656
+ * componentAttr: { disabled: (util) => util.getModel('type') === 'readonly' }
657
+ * ```
658
+ */
1022
659
  componentAttr?: Record<string, ComponentAttrValue>;
1023
660
  /**
1024
- * 表单项容器属性
1025
- * @see FormItemInstance 查看可用属性
661
+ * Arco FormItem 容器属性透传
662
+ * @description 对应 FormItem 组件的 props,如 `labelColFlex`, `rules`, `disabled`, `help`, `extra` 等
663
+ * @see https://arco.design/vue/component/form#API
1026
664
  */
1027
665
  itemAttr?: FormItemInstance['$props'];
1028
666
  /**
1029
- * 自定义类名配置
1030
- * @description 支持响应式配置函数
1031
- * @param itemConfig - 当前表单项配置
1032
- * @param models - 表单数据模型
667
+ * 自定义行 class
668
+ * @description 支持静态字符串或动态函数
669
+ * @example
670
+ * ```ts
671
+ * customClass: 'my-field'
672
+ * customClass: (item, models) => models.age > 18 ? 'adult' : 'minor'
673
+ * ```
1033
674
  */
1034
675
  customClass?: string | ((itemConfig: OrcFormItem, models: RecordAny_3) => string);
1035
676
  /**
1036
- * 多值序列化配置
1037
- * @description 开启后自动将数组转换为逗号分隔字符串
1038
- * @note 需要组件原生支持多选模式 (需同时配置 componentAttr.multiple)
677
+ * 多值逗号序列化
678
+ * @description 开启后自动将 `string[]` 序列化为逗号分隔字符串存储,读取时反序列化为数组
679
+ * @note 组件需支持多选(如 `a-select` 需配置 `componentAttr: { multiple: true }`)
1039
680
  */
1040
681
  dotNotation?: boolean;
1041
- /** 数据字典系统编码 */
682
+ /** 数据字典编码(配合 OrcPinia 字典 store 使用) */
1042
683
  datadict?: string;
1043
- /** 字段级配置选项 */
684
+ /** 字段级配置 */
1044
685
  options?: {
1045
- /** 必填标识 */
686
+ /** 必填标识(显示红色星号) */
1046
687
  required?: boolean;
1047
- /** 栅格布局宽度 (基于24栅格系统) */
688
+ /** 栅格宽度(基于 24 栅格) */
1048
689
  span?: number;
1049
690
  /** 栅格偏移量 */
1050
691
  offset?: number;
1051
- /** 禁用状态 */
692
+ /** 禁用 */
1052
693
  disabled?: boolean;
1053
- /** 输入占位符 */
694
+ /** 占位文本 */
1054
695
  placeholder?: string;
1055
- /** 帮助说明文案 */
696
+ /** 帮助说明(显示在表单项下方) */
1056
697
  help?: string;
1057
- /** 悬浮提示内容 */
698
+ /** tooltip 提示 */
1058
699
  tooltip?: string;
1059
- /** 选择器选项列表 */
700
+ /** 选择器数据源(仅对 select / radio-group 等选择类组件有效) */
1060
701
  options?: SelectOptionData[];
1061
702
  };
1062
703
  /**
1063
- * 验证规则配置
1064
- * @description 支持静态配置或动态规则生成函数
704
+ * 校验规则
705
+ * @description 支持 Arco Form 校验规则数组,或返回规则数组的函数
706
+ * @example
707
+ * ```ts
708
+ * rules: [{ required: true, message: '必填' }]
709
+ * rules: (item, util) => [{ required: true, message: '请选择' }]
710
+ * ```
1065
711
  */
1066
712
  rules?: RecordAny_3[] | ((val: OrcFormItem, util: OrcFormUtil) => RecordAny_3[]);
1067
- /** 表单事件处理器 */
1068
- events?: Pick<OrcFormUtil, 'onMounted' | 'onChange'>;
1069
- /** 扩展说明字段 */
713
+ /**
714
+ * 字段事件
715
+ * @description
716
+ * - `onMounted`: 组件挂载时触发,可用于异步加载选项
717
+ * - `onChange`: 值变化时触发,可用于联动、清空等
718
+ * @example
719
+ * ```ts
720
+ * events: {
721
+ * async onMounted(util) {
722
+ * // 异步加载下拉选项
723
+ * const res = await fetchOptions();
724
+ * util.setModelOption(util.model, res);
725
+ * },
726
+ * onChange(val, util) {
727
+ * // radio 切换联动
728
+ * const isTypeA = util.getModel(util.model) === 'A';
729
+ * util.setShow('fieldX', isTypeA);
730
+ * util.setShow('fieldY', !isTypeA);
731
+ * },
732
+ * }
733
+ * ```
734
+ */
735
+ events?: {
736
+ onMounted?: (util: OrcFormUtilBind) => any | Promise<any>;
737
+ onChange?: (val: any, util: OrcFormUtilBind) => void | Promise<void>;
738
+ };
739
+ /** 内部备注字段 */
1070
740
  note?: string;
1071
741
  };
1072
742
 
@@ -1077,64 +747,93 @@ export declare const OrcFormSpace: __VLS_WithTemplateSlots_7< DefineComponent<{}
1077
747
  }>;
1078
748
 
1079
749
  /**
1080
- * 表单提交数据结构
750
+ * 表单提交事件数据结构
751
+ * @description OrcForm 的 `@submit` 事件回调参数
752
+ * @example
753
+ * ```ts
754
+ * @submit="({ data, utils }) => {
755
+ * utils.setLoading(true);
756
+ * await save(data);
757
+ * utils.setLoading(false);
758
+ * utils.setVisible(false);
759
+ * }"
760
+ * ```
1081
761
  */
1082
762
  export declare type OrcFormSubmit = {
1083
- /** 表单数据集合 */
763
+ /** 表单数据 */
1084
764
  data: RecordAny_3;
1085
- /** 表单工具方法 */
765
+ /** 表单工具 */
1086
766
  utils: {
1087
- /** 控制提交弹窗可见性 */
1088
- setVisible: (a: boolean) => void;
1089
- /** 控制加载状态 */
1090
- setLoading: (a: boolean) => void;
767
+ /** 关闭弹窗(弹窗表单模式下有效) */
768
+ setVisible: (visible: boolean) => void;
769
+ /** 设置加载状态,submit 按钮显示 loading */
770
+ setLoading: (loading: boolean) => void;
1091
771
  };
1092
772
  };
1093
773
 
1094
774
  export declare const OrcFormTable: Component<any, any, any, ComputedOptions, MethodOptions, {}, any>;
1095
775
 
776
+ /**
777
+ * 表单工具方法集合
778
+ * @description 通过 OrcForm 的 slot 或 OrcFormItem events 回调中获取
779
+ */
1096
780
  declare type OrcFormUtil = {
1097
781
  /**
1098
- * 获取/查询选项数据
1099
- * @overload@overload 获取指定模型的选项列表
1100
- * @param model - 模型标识符
782
+ * 获取已注册的选择器选项列表
783
+ * @param model - 字段 model
1101
784
  */
1102
785
  getModelOption(model: string): SelectOptionData[];
1103
786
  /**
1104
- * @overload@overload 根据值查找特定选项
1105
- * @param model - 模型标识符
1106
- * @param val - 要查找的选项值
1107
- * @returns 匹配的选项对象
787
+ * 根据值查找选项
788
+ * @param model - 字段 model
789
+ * @param val - 要查找的 value
1108
790
  */
1109
791
  getModelOption(model: string, val: string): SelectOptionData;
1110
- /** 读取所有内容 */
1111
- getModels: () => any;
1112
- /** 获取指定模型的值 */
792
+ /** 获取表单所有字段的当前值 */
793
+ getModels: () => RecordAny_3;
794
+ /** 获取指定字段的当前值 */
1113
795
  getModel: (model: string) => any;
1114
- /** 检查指定模型是否可见 */
796
+ /** 检查指定字段是否可见 */
1115
797
  getShow: (model: string) => boolean;
1116
- /** 设置指定模型的选项数据 */
1117
- setModelOption: (model: string, val: any) => void;
798
+ /** 动态更新指定字段的选择器选项 */
799
+ setModelOption: (model: string, val: SelectOptionData[]) => void;
800
+ /**
801
+ * 设置字段值
802
+ * @param model - 字段 model,或 `{ key: value }` 批量设置对象
803
+ * @param value - 当 model 为字符串时的值
804
+ * @example
805
+ * ```ts
806
+ * util.setModel('name', '张三')
807
+ * util.setModel({ name: '张三', age: 18 })
808
+ * ```
809
+ */
810
+ setModel: (model: string | RecordAny_3, value?: any) => void;
1118
811
  /**
1119
- * 设置模型值
1120
- * @param c - 模型键名或键值对对象
1121
- * @param v - 当第一个参数为键名时使用的值
812
+ * 控制字段的显示/隐藏
813
+ * @param model - 字段 model 或数组
814
+ * @param val - true 显示,false 隐藏
1122
815
  */
1123
- setModel: (c: string | RecordAny_3, v?: any) => void;
1124
- /** 控制模型可见性 */
1125
816
  setShow: (model: string | string[], val: boolean) => void;
1126
- /** 用于双向数据绑定的模型属性 */
817
+ /** 当前字段的 model 名(仅在 events 回调中可用) */
1127
818
  model?: string;
1128
- /** 组件挂载后执行 */
819
+ /** 组件挂载时触发(仅当定义在 events 中时) */
1129
820
  onMounted?: (util: OrcFormUtilBind) => any | Promise<any>;
1130
- /** 值改变时触发 */
821
+ /**
822
+ * 值变化时触发(仅当定义在 events 中时)
823
+ * @param val - 新值
824
+ * @param util - 表单工具
825
+ */
1131
826
  onChange?: (val: any, util: OrcFormUtilBind) => void | Promise<void>;
1132
827
  };
1133
828
 
829
+ /**
830
+ * OrcFormUtil 的绑定版
831
+ * @description 在 events 回调中获取,比 OrcFormUtil 多了 `model`(当前字段名)和 `getFormItem`(当前配置项)
832
+ */
1134
833
  declare type OrcFormUtilBind = OrcFormUtil & {
1135
834
  model: string;
1136
835
  getFormItem: () => OrcFormItem;
1137
- } & OrcFormItem['events'];
836
+ };
1138
837
 
1139
838
  export declare const OrcHiddenView: __VLS_WithTemplateSlots_2< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
1140
839
  isShow?: boolean | undefined;
@@ -1432,7 +1131,7 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
1432
1131
  default: string;
1433
1132
  };
1434
1133
  toolbar: {
1435
- type: (ArrayConstructor | StringConstructor)[];
1134
+ type: (StringConstructor | ArrayConstructor)[];
1436
1135
  default: string;
1437
1136
  };
1438
1137
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
@@ -1443,14 +1142,14 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
1443
1142
  default: string;
1444
1143
  };
1445
1144
  toolbar: {
1446
- type: (ArrayConstructor | StringConstructor)[];
1145
+ type: (StringConstructor | ArrayConstructor)[];
1447
1146
  default: string;
1448
1147
  };
1449
1148
  }>> & Readonly<{
1450
1149
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
1451
1150
  }>, {
1452
- modelValue: string;
1453
1151
  toolbar: string | unknown[];
1152
+ modelValue: string;
1454
1153
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
1455
1154
 
1456
1155
  export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_4<{
@@ -1503,36 +1202,54 @@ export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<Extra
1503
1202
  default?(_: {}): any;
1504
1203
  }>;
1505
1204
 
1205
+ /**
1206
+ * OrcSearch 搜索项配置
1207
+ * @description 定义搜索栏每一维度的字段类型、默认值、选项数据
1208
+ * @example
1209
+ * ```ts
1210
+ * { type: 'input', name: 'name', label: '名称' }
1211
+ * { type: 'select', name: 'status', label: '状态', options: [{ label: '启用', value: '1' }] }
1212
+ * { type: 'date', name: 'range', label: '日期范围', multiple: true }
1213
+ * { type: 'number', name: 'num', label: '数字', min: 0, max: 100 }
1214
+ * ```
1215
+ */
1506
1216
  export declare interface OrcSearchItem extends RecordAny {
1507
- /** input 类型 */
1508
- type?: string;
1509
- /** 同form [name] */
1217
+ /**
1218
+ * 搜索组件类型
1219
+ * @description 支持以下类型:
1220
+ * - `'input'` — 文本输入框
1221
+ * - `'select'` — 下拉选择器(配合 `options` 传入选项列表)
1222
+ * - `'date'` — 日期选择器(配合 `multiple: true` 可实现日期范围)
1223
+ * - `'number'` — 数字输入框(配合 `min`/`max` 限制范围)
1224
+ */
1225
+ type?: 'input' | 'select' | 'date' | 'number' | string;
1226
+ /** 字段名(对应提交数据的 key) */
1510
1227
  name: string;
1511
- /** 标签名称 */
1228
+ /** 显示标签 */
1512
1229
  label: string;
1513
- /** 初始值 */
1230
+ /** 初始值。`multiple: true` 时支持逗号分隔字符串如 `'2024-01,2024-12'` */
1514
1231
  defaultValue?: string | boolean | number | string[];
1515
- /** 默认是显示 */
1232
+ /** 是否显示该搜索项,默认 true */
1516
1233
  show?: boolean;
1517
- /** type =number 最小值 */
1234
+ /** 数字最小值(type=number) */
1518
1235
  min?: number;
1519
- /** type =number 最大值 */
1236
+ /** 数字最大值(type=number) */
1520
1237
  max?: number;
1521
- /** type=select | type=date */
1238
+ /** 是否开启多选/范围模式(type=select 或 type=date) */
1522
1239
  multiple?: boolean;
1523
- /** type=select */
1240
+ /** 选择器选项列表(type=select) */
1524
1241
  options?: {
1525
1242
  label: string;
1526
1243
  value: string;
1527
1244
  disabled?: boolean;
1528
1245
  }[];
1529
- /** type=date */
1246
+ /** 日期格式化(type=date),如 `'YYYY-MM-DD'` */
1530
1247
  format?: string;
1531
- /** type=date */
1248
+ /** 日期是否包含时间选择(type=date) */
1532
1249
  showTime?: boolean;
1533
- /** 必填 */
1250
+ /** 是否必填 */
1534
1251
  required?: boolean;
1535
- /** 表单验证 */
1252
+ /** 校验规则 */
1536
1253
  rules?: RecordAny | RecordAny[];
1537
1254
  }
1538
1255
 
@@ -1553,8 +1270,8 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1553
1270
  getReserveSelection(): RecordAny_2[];
1554
1271
  clearSelection(): void;
1555
1272
  insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
1556
- row: any;
1557
- rows: any;
1273
+ row: RecordAny_2;
1274
+ rows: RecordAny_2[];
1558
1275
  }>;
1559
1276
  removeRows(): void;
1560
1277
  validate(list?: RecordAny_2[] | undefined): Promise<[string, RecordAny_2[]]>;
@@ -1564,16 +1281,14 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1564
1281
  setSelectionRow(row: any, bool?: boolean | undefined): void;
1565
1282
  loading: Ref<boolean, boolean>;
1566
1283
  setLoading: typeof setLoading;
1567
- /** 执行搜索 ,是否返回第一页 */
1568
1284
  dataInit(isFirst?: boolean | undefined): Promise<void>;
1569
- /** 加载数据 */
1570
1285
  loadData(list: any[]): void;
1571
1286
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1572
1287
  "update:selectedKeys": (...args: any[]) => void;
1573
1288
  confirm: (...args: any[]) => void;
1574
1289
  change: (...args: any[]) => void;
1575
- cellClick: (...args: any[]) => void;
1576
1290
  onReset: (...args: any[]) => void;
1291
+ cellClick: (...args: any[]) => void;
1577
1292
  cellDblclick: (...args: any[]) => void;
1578
1293
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {
1579
1294
  isHover: boolean;
@@ -1588,13 +1303,13 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1588
1303
  "onUpdate:selectedKeys"?: ((...args: any[]) => any) | undefined;
1589
1304
  onConfirm?: ((...args: any[]) => any) | undefined;
1590
1305
  onChange?: ((...args: any[]) => any) | undefined;
1591
- onCellClick?: ((...args: any[]) => any) | undefined;
1592
1306
  onOnReset?: ((...args: any[]) => any) | undefined;
1307
+ onCellClick?: ((...args: any[]) => any) | undefined;
1593
1308
  onCellDblclick?: ((...args: any[]) => any) | undefined;
1594
1309
  }>, {
1595
1310
  data: RecordAny_2[];
1596
1311
  option: OrcTableOption;
1597
- size: "large" | "medium" | "small" | "mini";
1312
+ size: "medium" | "large" | "small" | "mini";
1598
1313
  locale: I18nType;
1599
1314
  isHover: boolean;
1600
1315
  selectedKeys: string[];
@@ -1608,55 +1323,134 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
1608
1323
  rowIndex: number;
1609
1324
  columnIndex: number;
1610
1325
  value: any;
1611
- updateValue: (value: string | number | boolean | RecordAny_2 | null) => void;
1326
+ updateValue: (newValue: any) => void;
1612
1327
  formatValue: any;
1613
1328
  }): any;
1614
1329
  footer?(_: {}): any;
1615
1330
  }>;
1616
1331
 
1332
+ /**
1333
+ * 表格组件暴露方法
1334
+ * @description `<orc-table ref="tableRef">` 可调用的方法
1335
+ */
1617
1336
  declare interface OrcTableExpose extends TableGridTwoType {
1337
+ /** 是否正在加载数据 */
1618
1338
  loading: boolean;
1339
+ /** 手动设置加载状态 */
1619
1340
  setLoading: (loading?: boolean) => void;
1620
- /** 请求数据 */
1621
- dataInit: () => Promise<void>;
1622
- /** 重置表单数据 */
1341
+ /** 请求服务端数据(如配置 url),可传 true 跳回第一页 */
1342
+ dataInit: (isFirst?: boolean) => Promise<void>;
1343
+ /** 加载静态数据并刷新表格 */
1623
1344
  loadData: (list: RecordAny_2[]) => void;
1624
1345
  }
1625
1346
 
1626
- /** column type */
1347
+ /**
1348
+ * 表格列配置
1349
+ * @description 定义每一列的数据映射、显示格式、编辑方式
1350
+ */
1627
1351
  export declare interface OrcTableItem extends RecordAny_2 {
1352
+ /** 是否显示该列,默认 true */
1628
1353
  show?: boolean;
1354
+ /** 数据字段名(必填) */
1629
1355
  dataIndex: string;
1356
+ /** 列标题 */
1630
1357
  title?: string;
1358
+ /** 列宽度(像素) */
1631
1359
  width?: number;
1360
+ /** 是否可排序 */
1632
1361
  sort?: boolean;
1633
- /** 开启编辑 */
1634
- cell?: boolean | Component;
1635
- /** @example
1636
- * <a-badge status="normal" text="Normal" />
1637
- * status: normal|processing|success|warning|danger
1362
+ /**
1363
+ * 单元格渲染模式
1364
+ * @description
1365
+ * - `true` — 开启行内编辑模式(配合 edit-render)
1366
+ * - `Component` — 渲染为指定组件(如 Badge、Tag),配合 `cellAttr` 传参
1367
+ * - `VNode` — 渲染为 VNode 内容
1368
+ * @example
1369
+ * ```ts
1370
+ * // 行内编辑
1371
+ * { cell: true }
1372
+ * // 渲染为组件
1373
+ * { cell: Badge, div: true, cellAttr: { text: (v) => v.value, status: (v) => 'success' } }
1374
+ * // 渲染为 VNode
1375
+ * { cell: h('div', '自定义内容') }
1376
+ * ```
1377
+ */
1378
+ cell?: boolean | Component | VNode;
1379
+ /**
1380
+ * 组件属性(当 cell 为 Component 时使用)
1381
+ * @description 每个 key 可以是静态值或函数,函数接收 `{ record, value, rowIndex, columnIndex, updateValue, formatValue }`
1382
+ * @example
1383
+ * ```ts
1384
+ * { cell: Badge, div: true, cellAttr: {
1385
+ * text: ({ value }) => value ? '启用' : '禁用',
1386
+ * status: ({ value }) => value ? 'success' : 'normal',
1387
+ * } }
1388
+ * ```
1638
1389
  */
1639
1390
  cellAttr?: {
1640
- [key: string]: (v1: Record<'record' | 'dataIndex' | 'rowIndex' | 'columnIndex' | 'value' | 'updateValue' | 'formatValue', any>) => unknown;
1391
+ [key: string]: (v1: {
1392
+ record: RecordAny_2;
1393
+ value: any;
1394
+ rowIndex: number;
1395
+ columnIndex: number;
1396
+ updateValue: (val: any) => void;
1397
+ formatValue: string;
1398
+ }) => unknown;
1641
1399
  } | {
1642
1400
  [key: string]: unknown;
1643
1401
  };
1402
+ /**
1403
+ * 渲染模式(仅在 cell 为 Component 时有效)
1404
+ * @description `true` 时在 `#default` 插槽渲染组件,而非仅在编辑模式下显示
1405
+ */
1644
1406
  div?: boolean;
1645
- /** 没内容时候得提示 */
1407
+ /** 空数据占位文本 */
1646
1408
  placeholder?: string;
1409
+ /** 单元格文字超出是否以 tooltip 展示 */
1647
1410
  tooltip?: boolean;
1411
+ /** 是否显示省略号 */
1648
1412
  ellipsis?: boolean;
1413
+ /** 列对齐方式 */
1649
1414
  align?: VxeColumnPropTypes.Align;
1415
+ /** 表头对齐方式 */
1650
1416
  headerAlign?: VxeColumnPropTypes.HeaderAlign;
1417
+ /** 表尾对齐方式 */
1651
1418
  footerAlign?: VxeColumnPropTypes.FooterAlign;
1419
+ /** 固定列方向 */
1420
+ fixed?: 'left' | 'right';
1421
+ /**
1422
+ * 行数据格式化
1423
+ * @param val 原始值
1424
+ * @param record 整行数据
1425
+ * @returns 格式化后的显示文本
1426
+ */
1652
1427
  format?: (val: any, record?: RecordAny_2) => string;
1428
+ /**
1429
+ * 行内样式
1430
+ * @description 支持静态对象或根据行数据动态返回
1431
+ */
1653
1432
  style?: CssType | ((record: RecordAny_2) => CssType);
1654
- /** 同 :title-prefix "{ content: '必填', icon: 'vxe-cell--required-icon' }" */
1433
+ /** 标题帮助提示(同 vxe-table title-prefix) */
1655
1434
  help?: VxeColumnPropTypes.TitlePrefix;
1435
+ /** 列过滤条件列表 */
1436
+ filters?: VxeColumnPropTypes.Filters;
1437
+ /** 是否支持多选过滤 */
1438
+ filterMultiple?: boolean;
1439
+ /** 自定义过滤方法 */
1440
+ filterMethod?: VxeColumnPropTypes.FilterMethod;
1441
+ /** 数据类型 */
1442
+ dataType?: 'link' | 'number' | 'date' | 'time' | 'string' | 'status';
1443
+ /** orc-search 联动 */
1444
+ search?: {
1445
+ show?: boolean;
1446
+ hidden?: boolean;
1447
+ options?: RecordAny_2[];
1448
+ } & RecordAny_2;
1656
1449
  }
1657
1450
 
1658
1451
  /**
1659
- * table option type
1452
+ * 表格配置项
1453
+ * @description 传递给 `<orc-table :option>` 的完整配置
1660
1454
  * @example
1661
1455
  * ```ts
1662
1456
  * {
@@ -1664,88 +1458,133 @@ export declare interface OrcTableItem extends RecordAny_2 {
1664
1458
  * scrollY: { enabled: true },
1665
1459
  * columns: [
1666
1460
  * { dataIndex: 'index', title: '序', width: 26 },
1667
- * ]
1461
+ * ],
1462
+ * selectedType: 'checkbox',
1463
+ * selectedTrigger: 'row',
1668
1464
  * }
1669
1465
  * ```
1670
1466
  */
1671
1467
  export declare interface OrcTableOption extends RecordAny_2 {
1672
- /** 可使用 `orc-provider` 全局注入 */
1468
+ /**
1469
+ * 异步请求封装函数
1470
+ * @description 需通过 `orc-provider` 全局注入,或直接传入
1471
+ */
1673
1472
  useErrData?: <T = RecordAny_2>(config: RecordAny_2) => Promise<[boolean, T]>;
1674
- /** 请求地址 */
1473
+ /** 服务端分页请求地址,不传则使用静态数据 */
1675
1474
  url?: string;
1676
- /** 请求类型 */
1475
+ /** 请求方法 */
1677
1476
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
1678
- /** 是否保留多选状态 */
1477
+ /** 是否保留跨页多选状态 */
1679
1478
  reserve?: boolean;
1680
- /** 原 checkbox-config.checkField 在行中存储 bool 值,不存在则无效 */
1479
+ /** 原 vxe-table checkbox-config.checkField,行中存储多选 bool 值的字段名 */
1681
1480
  checkKey?: string;
1682
- /** 行主键[自动生成] */
1481
+ /**
1482
+ * 行主键字段名
1483
+ * @default '_X_ROW_KEY'
1484
+ */
1683
1485
  rowKey?: string;
1684
- /** 多选时 同kay选择 */
1486
+ /**
1487
+ * 多选联动 key
1488
+ * @description 有此值时,同一 key 的行会联动选中/取消
1489
+ */
1685
1490
  checkboxKey?: string;
1686
- /** 自定义列 同 resolveColumns() */
1491
+ /** 列配置 */
1687
1492
  columns: OrcTableItem[];
1688
- /** 默认分页条数 */
1493
+ /** 默认每页条数 */
1689
1494
  pageSize?: number;
1690
- /** 默认分页列表 */
1495
+ /** 每页条数选项列表 */
1691
1496
  pageSizeOptions?: number[];
1692
- /** 开启行选中 */
1497
+ /** 行选中类型 */
1693
1498
  selectedType?: 'checkbox' | 'radio';
1694
- /** 触发方式 */
1499
+ /** 选中触发方式 */
1695
1500
  selectedTrigger?: 'cell' | 'row' | 'default';
1696
- /** 行必填数据 指定 [dataIndex] */
1501
+ /** 行必填字段名列表(用于行校验高亮) */
1697
1502
  requiredKeys?: string[];
1698
- /** 表单组件第一次自动请求接口 */
1503
+ /** 首次自动请求数据(url 模式),默认 true */
1699
1504
  firstLoad?: boolean;
1700
- /** 原来 show-overflow ellipsis(只显示省略号), title(并且显示为原生 title), tooltip(并且显示为 tooltip 提示) */
1505
+ /**
1506
+ * 单元格溢出行为
1507
+ * @description 'ellipsis' — 省略号,'title' — 原生 title,'tooltip' — tooltip 提示
1508
+ */
1701
1509
  tooltip?: ('ellipsis' | 'title' | 'tooltip') | boolean;
1702
- /** 原来 show-footer-overflow ellipsis(只显示省略号), title(并且显示为原生 title), tooltip(并且显示为 tooltip 提示) */
1510
+ /** 表尾单元格溢出行为,同 tooltip 参数 */
1703
1511
  footerTooltip?: ('ellipsis' | 'title' | 'tooltip') | boolean;
1704
- /** 给表头单元添加 style : ({ column, columnIndex })=> {} , dataIndex as column.property */
1705
- headerStyle?: (record: RecordAny_2 & {
1512
+ /**
1513
+ * 表头样式
1514
+ * @param record - 包含 `{ column, columnIndex }`,dataIndex 在 column.property 中
1515
+ */
1516
+ headerStyle?: (record: {
1706
1517
  column: {
1707
1518
  property: string;
1708
1519
  } & RecordAny_2;
1520
+ columnIndex: number;
1709
1521
  }) => CssType;
1710
- /** 给表尾单元添加 style : any | (({ $rowIndex, column, columnIndex, $columnIndex }) => any) */
1711
- footerStyle?: (record: RecordAny_2 & {
1522
+ /**
1523
+ * 表尾样式
1524
+ * @param record - 包含 `{ $rowIndex, column, columnIndex, $columnIndex }`
1525
+ */
1526
+ footerStyle?: (record: {
1527
+ $rowIndex: number;
1712
1528
  column: {
1713
1529
  property: string;
1714
1530
  } & RecordAny_2;
1531
+ columnIndex: number;
1532
+ $columnIndex: number;
1715
1533
  }) => CssType;
1716
- /** 表尾的数据获取方法,返回一个二维数组 (columns, data) => string[][] */
1534
+ /**
1535
+ * 表尾合计方法
1536
+ * @returns 二维数组,外层对应表尾行,内层对应每列
1537
+ * @see useOrcTableFooter 快速使用
1538
+ */
1717
1539
  footerMethod?: VxeTablePropTypes.FooterMethod;
1718
- /** 同 merge-footer-items 临时合并表尾 (不能用于展开行,不建议用于固定列、树形结构) */
1540
+ /** 表尾合并配置(不能与展开行、固定列、树形结构同时使用) */
1719
1541
  mergeFooter?: VxeTablePropTypes.MergeFooterItems;
1720
- /** 自定义列 同 columns */
1542
+ /** 列预处理函数,在 columns 渲染前执行 */
1721
1543
  resolveColumns?: (columns?: OrcTableItem[]) => OrcTableItem[];
1722
- /** 计算总条目 */
1544
+ /** 计算总条目数(服务端分页) */
1723
1545
  resolveTotal?: (e: RecordAny_2) => number;
1724
- /** 请求超时时间 */
1546
+ /** 请求超时时间(毫秒) */
1725
1547
  timeout?: number;
1726
- /** 静态参数 */
1548
+ /** 固定请求参数,会与分页参数合并发送 */
1727
1549
  data?: RecordAny_2;
1728
- /** 自定义分页 */
1729
- resolvePage?: (page?: RecordAny_2) => any;
1730
- /** 自定义数据 */
1550
+ /**
1551
+ * 自定义分页参数
1552
+ * @param page - `{ page, size }` 分页信息,可扩展额外参数
1553
+ * @returns 发送到接口的分页参数对象
1554
+ */
1555
+ resolvePage?: (page: RecordAny_2) => any;
1556
+ /**
1557
+ * 解析接口返回的数据列表
1558
+ * @param data - 接口原始返回值
1559
+ * @param page - `{ page, size }` 当前分页信息
1560
+ * @returns 表格行数据数组
1561
+ */
1731
1562
  resolveData?: (data: RecordAny_2, page?: RecordAny_2) => RecordAny_2[];
1732
- /** 数据请求成功 */
1563
+ /** 数据请求成功回调 */
1733
1564
  success?: (data?: any) => void;
1734
- /** 数据请求失败 */
1565
+ /** 数据请求失败回调 */
1735
1566
  error?: (data?: any) => void;
1736
- /** 开启重复行省略 group by */
1567
+ /**
1568
+ * 皮肤行分组字段
1569
+ * @description 相同值的行合并显示,开启后重复行隐藏相同内容
1570
+ */
1737
1571
  skinRow?: string;
1738
- /** 非重复行且未被跳过的样式 */
1572
+ /** 皮肤行样式(非重复行且未被跳过时应用) */
1739
1573
  skinRowStyle?: CssType;
1740
- /** 重复行显示内容 */
1574
+ /** 被隐藏的重复行显示文字 */
1741
1575
  skinRowText?: string;
1742
- /** 同 edit-rules , demo : { sex: [ { required: true, message: '性别必须填写' } ] } */
1576
+ /**
1577
+ * 行编辑校验规则
1578
+ * @example { sex: [{ required: true, message: '性别必须填写' }] }
1579
+ */
1743
1580
  rules?: VxeTablePropTypes.EditRules;
1744
- /** 横向虚拟滚动配置 { enabled, gt } */
1581
+ /** 横向虚拟滚动 */
1745
1582
  scrollX?: VxeTablePropTypes.ScrollX;
1746
- /** 纵向虚拟滚动配置 { enabled, gt } */
1583
+ /** 纵向虚拟滚动 */
1747
1584
  scrollY?: VxeTablePropTypes.ScrollY;
1585
+ /** 选中模式附加属性 */
1748
1586
  selectedProps?: any;
1587
+ /** 透传 vxe-table 原生 props */
1749
1588
  tableProps?: TableInstance['$props'];
1750
1589
  }
1751
1590
 
@@ -1754,33 +1593,17 @@ declare interface Props {
1754
1593
  }
1755
1594
 
1756
1595
  declare type Props_2 = {
1757
- /** 表格标题 */
1758
1596
  title?: string;
1759
- /** 高 */
1760
1597
  height?: number | string;
1761
- /** 多语言 */
1762
1598
  locale?: I18nType;
1763
- /** 是否隐藏工具栏 */
1764
1599
  hideToolbar?: boolean;
1765
- /** 是否隐藏设置按钮 */
1766
1600
  hideSetting?: boolean;
1767
- /** 是否隐藏分页 */
1768
1601
  hidePagination?: boolean;
1769
- /** 是否启用悬停效果,默认值为 true */
1770
1602
  isHover?: boolean;
1771
- /** 表格尺寸,可选值为 'medium' | 'small' | 'mini',默认值为 'mini' */
1772
1603
  size?: 'large' | 'medium' | 'small' | 'mini';
1773
- /** 用户选择的列表,默认值为空数组 */
1774
1604
  selectedKeys?: string[];
1775
- /** 数据源,默认值为空数组 */
1776
1605
  data?: RecordAny_2[];
1777
- /** 配置文件,默认值为 { columns: [] } */
1778
1606
  option?: OrcTableOption;
1779
- /**
1780
- * 用户保存数据钩子函数
1781
- * - getColumn: 异步获取列配置,返回一个包含布尔值和列数据的元组
1782
- * - setColumn: 设置列配置
1783
- */
1784
1607
  hook?: {
1785
1608
  getColumn: () => Promise<[boolean, RecordAny_2[]]>;
1786
1609
  setColumn: (list: RecordAny_2[]) => void;
@@ -1839,6 +1662,8 @@ declare type RecordAny_2 = Record<string, any>;
1839
1662
  /** 通用对象类型 (键值对形式) */
1840
1663
  declare type RecordAny_3 = Record<string, any>;
1841
1664
 
1665
+ declare function resetFields(): void;
1666
+
1842
1667
  /**
1843
1668
  * set path object
1844
1669
  * @example
@@ -1852,47 +1677,61 @@ export declare function setData(object: RecordAny, path: string, defaultValue?:
1852
1677
 
1853
1678
  declare function setLoading(val?: boolean): void;
1854
1679
 
1855
- declare interface TableGridTwoType extends RecordAny_2 {
1856
- /** 读取配置的rowKey 默认 _X_ROW_KEY */
1680
+ /**
1681
+ * 表格工具方法
1682
+ * @description 通过 `useOrcTable()` 返回的 `tableUtils` 或 `tableRef` 暴露的方法
1683
+ */
1684
+ declare interface TableGridTwoType {
1685
+ /** 读取配置的 rowKey,默认 `_X_ROW_KEY` */
1857
1686
  getRowKey(): string;
1858
- /** 读取当前页数据 */
1687
+ /** 读取当前页全部数据 */
1859
1688
  getTableData(): RecordAny_2[];
1860
- /** 读取选中行 */
1689
+ /** 读取当前选中的行数据 */
1861
1690
  getSelection(): RecordAny_2[];
1862
- /** 不支持夸行选择,可读取rowKey重复的数据 */
1691
+ /**
1692
+ * 按 checkboxKey 获取选中行
1693
+ * @param keys - 要匹配的 key 列表,默认当前选中行
1694
+ */
1863
1695
  getCheckboxKeySelection(keys?: string[]): RecordAny_2[];
1864
- /** option.reserve = true 读取所有跨页选中数据 */
1696
+ /** 读取跨页选中数据(需开启 `option.reserve`) */
1865
1697
  getReserveSelection(): RecordAny_2[];
1866
- /** 清空选中行 */
1698
+ /** 清空所有选中行 */
1867
1699
  clearSelection(): void;
1868
- /** 原insertAt 往表格插入临时数据,从指定位置插入一行或多行;第二个参数:row 指定( isNext +1 )位置、null从第一行插入、-1 从最后插入 */
1700
+ /**
1701
+ * 插入一行数据
1702
+ * @param record - 行数据
1703
+ * @param row - 插入位置参照行(number 为索引、目标行对象、null 为首行、-1 为末尾)
1704
+ * @param isNext - 是否插入在参照行之后(仅当 row 为对象时有效)
1705
+ * @returns 插入结果 `{ row, rows }`
1706
+ */
1869
1707
  insertRow(record: RecordAny_2, row?: RecordAny_2 | number, isNext?: boolean): Promise<{
1870
- row: any;
1871
- rows: any;
1708
+ row: RecordAny_2;
1709
+ rows: RecordAny_2[];
1872
1710
  }>;
1873
- /** 删除复选框选中的行数据 */
1711
+ /** 删除 Checkbox 选中的行 */
1874
1712
  removeRows(): void;
1875
1713
  /**
1876
1714
  * 选中行数据校验
1877
- * @param list 默认 所有选择的数据
1715
+ * @param list - 默认校验当前所有选中行
1716
+ * @returns `[errMsg, validatedList]` — 空字符串表示无错误
1878
1717
  */
1879
1718
  validate(list?: RecordAny_2[]): Promise<[string, RecordAny_2[]]>;
1880
1719
  /**
1881
- * 根据 row 获取行的序号
1882
- * @param row 行对象
1720
+ * 根据 row 获取行序号(从 1 开始)
1721
+ * @param row - 行对象
1883
1722
  */
1884
1723
  getRowSeq(row: any): string | number;
1885
1724
  /**
1886
- * 根据 row 获取相对于 data 中的索引
1887
- * @param row 行对象
1725
+ * 根据 row 获取行索引(从 0 开始)
1726
+ * @param row - 行对象
1888
1727
  */
1889
1728
  getRowIndex(row: any): number;
1890
- /**
1891
- * 删除RowIndex这一行
1892
- */
1729
+ /** 删除指定索引的行 */
1893
1730
  removerRowIndex(rowIndex: number): void;
1894
1731
  /**
1895
- * 选择当前行
1732
+ * 选中/取消选中指定行
1733
+ * @param row - 行对象
1734
+ * @param bool - true 选中,false 取消
1896
1735
  */
1897
1736
  setSelectionRow(row: any, bool?: boolean): void;
1898
1737
  }
@@ -1905,6 +1744,41 @@ export declare function toArray<T>(target: T | T[]): T[];
1905
1744
  /** 读取数据类型 */
1906
1745
  export declare function typeName(o: unknown): string;
1907
1746
 
1747
+ /**
1748
+ * 字典缓存 Store
1749
+ *
1750
+ * @example
1751
+ * // 1. 初始化(在 main.ts 或 App.vue 中执行一次)
1752
+ * const dictStore = useDictStore();
1753
+ * dictStore.registerLoadFn(async (code) => {
1754
+ * const res = await fetch(`/api/dict/${code}`);
1755
+ * return res.json();
1756
+ * });
1757
+ *
1758
+ * @example
1759
+ * // 2. 在组件中使用
1760
+ * const dictStore = useDictStore();
1761
+ * const genders = await dictStore.getDict('gender');
1762
+ * const freshData = await dictStore.getDict('gender', true); // 强制刷新
1763
+ * dictStore.clearCache('gender'); // 清除缓存
1764
+ */
1765
+ export declare const useDictStore: StoreDefinition<"orc-dict", Pick<{
1766
+ dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
1767
+ registerLoadFn: (fn: DictLoadFn) => void;
1768
+ getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
1769
+ clearCache: (code?: string) => void;
1770
+ }, "dicts">, Pick<{
1771
+ dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
1772
+ registerLoadFn: (fn: DictLoadFn) => void;
1773
+ getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
1774
+ clearCache: (code?: string) => void;
1775
+ }, never>, Pick<{
1776
+ dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
1777
+ registerLoadFn: (fn: DictLoadFn) => void;
1778
+ getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
1779
+ clearCache: (code?: string) => void;
1780
+ }, "registerLoadFn" | "getDict" | "clearCache">>;
1781
+
1908
1782
  /**
1909
1783
  * @example
1910
1784
  * ```
@@ -1966,10 +1840,9 @@ export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSe
1966
1840
 
1967
1841
  export declare const useOrcTable: (option: OrcTableOption) => {
1968
1842
  tableRef: Ref<{
1969
- [x: string]: any;
1970
1843
  loading: boolean;
1971
1844
  setLoading: (loading?: boolean | undefined) => void;
1972
- dataInit: () => Promise<void>;
1845
+ dataInit: (isFirst?: boolean | undefined) => Promise<void>;
1973
1846
  loadData: (list: RecordAny_2[]) => void;
1974
1847
  getRowKey: () => string;
1975
1848
  getTableData: () => RecordAny_2[];
@@ -1978,8 +1851,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
1978
1851
  getReserveSelection: () => RecordAny_2[];
1979
1852
  clearSelection: () => void;
1980
1853
  insertRow: (record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined) => Promise<{
1981
- row: any;
1982
- rows: any;
1854
+ row: RecordAny_2;
1855
+ rows: RecordAny_2[];
1983
1856
  }>;
1984
1857
  removeRows: () => void;
1985
1858
  validate: (list?: RecordAny_2[] | undefined) => Promise<[string, RecordAny_2[]]>;
@@ -1988,10 +1861,9 @@ export declare const useOrcTable: (option: OrcTableOption) => {
1988
1861
  removerRowIndex: (rowIndex: number) => void;
1989
1862
  setSelectionRow: (row: any, bool?: boolean | undefined) => void;
1990
1863
  }, OrcTableExpose | {
1991
- [x: string]: any;
1992
1864
  loading: boolean;
1993
1865
  setLoading: (loading?: boolean | undefined) => void;
1994
- dataInit: () => Promise<void>;
1866
+ dataInit: (isFirst?: boolean | undefined) => Promise<void>;
1995
1867
  loadData: (list: RecordAny_2[]) => void;
1996
1868
  getRowKey: () => string;
1997
1869
  getTableData: () => RecordAny_2[];
@@ -2000,8 +1872,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
2000
1872
  getReserveSelection: () => RecordAny_2[];
2001
1873
  clearSelection: () => void;
2002
1874
  insertRow: (record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined) => Promise<{
2003
- row: any;
2004
- rows: any;
1875
+ row: RecordAny_2;
1876
+ rows: RecordAny_2[];
2005
1877
  }>;
2006
1878
  removeRows: () => void;
2007
1879
  validate: (list?: RecordAny_2[] | undefined) => Promise<[string, RecordAny_2[]]>;
@@ -2028,15 +1900,19 @@ export declare const useOrcTable: (option: OrcTableOption) => {
2028
1900
  firstLoad?: boolean | undefined;
2029
1901
  tooltip?: boolean | "title" | "tooltip" | "ellipsis" | undefined;
2030
1902
  footerTooltip?: boolean | "title" | "tooltip" | "ellipsis" | undefined;
2031
- headerStyle?: ((record: RecordAny_2 & {
1903
+ headerStyle?: ((record: {
2032
1904
  column: {
2033
1905
  property: string;
2034
1906
  } & RecordAny_2;
1907
+ columnIndex: number;
2035
1908
  }) => CssType) | undefined;
2036
- footerStyle?: ((record: RecordAny_2 & {
1909
+ footerStyle?: ((record: {
1910
+ $rowIndex: number;
2037
1911
  column: {
2038
1912
  property: string;
2039
1913
  } & RecordAny_2;
1914
+ columnIndex: number;
1915
+ $columnIndex: number;
2040
1916
  }) => CssType) | undefined;
2041
1917
  footerMethod?: VxeTablePropTypes<VxeTableDataRow> | undefined;
2042
1918
  mergeFooter?: VxeTablePropTypes<VxeTableDataRow> | undefined;
@@ -2044,7 +1920,7 @@ export declare const useOrcTable: (option: OrcTableOption) => {
2044
1920
  resolveTotal?: ((e: RecordAny_2) => number) | undefined;
2045
1921
  timeout?: number | undefined;
2046
1922
  data?: RecordAny_2 | undefined;
2047
- resolvePage?: ((page?: RecordAny_2 | undefined) => any) | undefined;
1923
+ resolvePage?: ((page: RecordAny_2) => any) | undefined;
2048
1924
  resolveData?: ((data: RecordAny_2, page?: RecordAny_2 | undefined) => RecordAny_2[]) | undefined;
2049
1925
  success?: ((data?: any) => void) | undefined;
2050
1926
  error?: ((data?: any) => void) | undefined;
@@ -2065,8 +1941,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
2065
1941
  getReserveSelection(): RecordAny_2[];
2066
1942
  clearSelection(): void;
2067
1943
  insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
2068
- row: any;
2069
- rows: any;
1944
+ row: RecordAny_2;
1945
+ rows: RecordAny_2[];
2070
1946
  }>;
2071
1947
  removeRows(): void;
2072
1948
  validate(list?: RecordAny_2[] | undefined): Promise<[string, RecordAny_2[]]>;