@shaonq/vue 1.3.3 → 1.4.2
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 +497 -619
- package/lib/index.js +2239 -4334
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ import { PublicProps } from 'vue';
|
|
|
19
19
|
import { Ref } from 'vue';
|
|
20
20
|
import { SelectOptionData } from '@arco-design/web-vue';
|
|
21
21
|
import { Size } from '@arco-design/web-vue';
|
|
22
|
+
import { StoreDefinition } from 'pinia';
|
|
22
23
|
import { TablePublicMethods } from 'vxe-table';
|
|
24
|
+
import { VNode } from 'vue';
|
|
23
25
|
import { VxeColumnPropTypes } from 'vxe-table';
|
|
24
26
|
import { VxeTable } from 'vxe-table';
|
|
25
27
|
import { VxeTableDataRow } from 'vxe-table';
|
|
@@ -227,10 +229,13 @@ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
|
|
|
227
229
|
|
|
228
230
|
declare type ButtonInstance = InstanceType<typeof Button>;
|
|
229
231
|
|
|
230
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* componentAttr 中函数属性的回调参数
|
|
234
|
+
* @description 当 `componentAttr` 的某个值为函数时,函数在渲染时执行,注入以下参数
|
|
235
|
+
*/
|
|
231
236
|
declare type ComponentAttrHandler = (util: OrcFormUtilBind, index?: any) => unknown;
|
|
232
237
|
|
|
233
|
-
/**
|
|
238
|
+
/** componentAttr 支持的静态值类型 */
|
|
234
239
|
declare type ComponentAttrValue = null | boolean | number | string | RecordAny_3 | RecordAny_3[] | ComponentAttrHandler;
|
|
235
240
|
|
|
236
241
|
export declare interface CssType extends Partial<CSSStyleDeclaration>, RecordAny_2 {
|
|
@@ -245,6 +250,8 @@ export default _default;
|
|
|
245
250
|
|
|
246
251
|
export declare function delay(ms: number): Promise<unknown>;
|
|
247
252
|
|
|
253
|
+
declare type DictLoadFn = (code: string) => Promise<unknown[]>;
|
|
254
|
+
|
|
248
255
|
export declare const download: (url: string, fileName?: string) => boolean;
|
|
249
256
|
|
|
250
257
|
/**
|
|
@@ -410,396 +417,11 @@ declare const lang_2: {
|
|
|
410
417
|
};
|
|
411
418
|
};
|
|
412
419
|
|
|
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
420
|
/** 日志 */
|
|
799
421
|
export declare function log(...args: any[]): void;
|
|
800
422
|
|
|
801
423
|
/** 合并配置文件 */
|
|
802
|
-
export declare function mergeConfig(defaults: RecordAny, overrides: RecordAny
|
|
424
|
+
export declare function mergeConfig(defaults: RecordAny, overrides: RecordAny): RecordAny;
|
|
803
425
|
|
|
804
426
|
declare type ModalInstance = InstanceType<typeof Modal>;
|
|
805
427
|
|
|
@@ -812,61 +434,28 @@ declare function onSubmit(): Promise<[boolean, any]>;
|
|
|
812
434
|
|
|
813
435
|
declare function onSubmit_2(): Promise<void>;
|
|
814
436
|
|
|
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
437
|
export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_5<{
|
|
438
|
+
/** 表单字段配置数组 */
|
|
857
439
|
config?: OrcFormItem[] | undefined;
|
|
440
|
+
/** 标签宽度,默认 '110px' */
|
|
858
441
|
labelWidth?: string | undefined;
|
|
442
|
+
/** 标签对齐方式,默认 'right' */
|
|
859
443
|
labelAlign?: "left" | "right" | undefined;
|
|
444
|
+
/** 提交按钮加载状态 */
|
|
860
445
|
loading?: boolean | undefined;
|
|
446
|
+
/** 是否禁用整个表单 */
|
|
861
447
|
disabled?: boolean | undefined;
|
|
448
|
+
/** 是否隐藏提交按钮 */
|
|
862
449
|
hideSubmit?: boolean | undefined;
|
|
450
|
+
/** 表单数据(v-model) */
|
|
863
451
|
modelValue?: Record<string, any> | undefined;
|
|
864
452
|
/** 栅格间距 */
|
|
865
453
|
gutter?: number | undefined;
|
|
866
|
-
/**
|
|
454
|
+
/** 每行栅格数(基于 24 栅格),默认 24 */
|
|
867
455
|
span?: number | undefined;
|
|
456
|
+
/** 透传到 Arco Form 组件的 props */
|
|
868
457
|
formAttr?: Record<string, any> | undefined;
|
|
869
|
-
/** 栅格grid
|
|
458
|
+
/** 栅格 grid 配置(优先级低于行内 span) */
|
|
870
459
|
grid?: Record<string, any> | undefined;
|
|
871
460
|
}>, {
|
|
872
461
|
config: () => never[];
|
|
@@ -883,25 +472,33 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
|
|
|
883
472
|
}>>, {
|
|
884
473
|
onSubmit: typeof onSubmit;
|
|
885
474
|
onReset: (defValue?: Partial<any> | undefined) => void;
|
|
886
|
-
resetFields
|
|
475
|
+
resetFields: typeof resetFields;
|
|
887
476
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
888
477
|
error: (...args: any[]) => void;
|
|
889
478
|
submit: (...args: any[]) => void;
|
|
890
479
|
"update:modelValue": (...args: any[]) => void;
|
|
891
480
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_5<{
|
|
481
|
+
/** 表单字段配置数组 */
|
|
892
482
|
config?: OrcFormItem[] | undefined;
|
|
483
|
+
/** 标签宽度,默认 '110px' */
|
|
893
484
|
labelWidth?: string | undefined;
|
|
485
|
+
/** 标签对齐方式,默认 'right' */
|
|
894
486
|
labelAlign?: "left" | "right" | undefined;
|
|
487
|
+
/** 提交按钮加载状态 */
|
|
895
488
|
loading?: boolean | undefined;
|
|
489
|
+
/** 是否禁用整个表单 */
|
|
896
490
|
disabled?: boolean | undefined;
|
|
491
|
+
/** 是否隐藏提交按钮 */
|
|
897
492
|
hideSubmit?: boolean | undefined;
|
|
493
|
+
/** 表单数据(v-model) */
|
|
898
494
|
modelValue?: Record<string, any> | undefined;
|
|
899
495
|
/** 栅格间距 */
|
|
900
496
|
gutter?: number | undefined;
|
|
901
|
-
/**
|
|
497
|
+
/** 每行栅格数(基于 24 栅格),默认 24 */
|
|
902
498
|
span?: number | undefined;
|
|
499
|
+
/** 透传到 Arco Form 组件的 props */
|
|
903
500
|
formAttr?: Record<string, any> | undefined;
|
|
904
|
-
/** 栅格grid
|
|
501
|
+
/** 栅格 grid 配置(优先级低于行内 span) */
|
|
905
502
|
grid?: Record<string, any> | undefined;
|
|
906
503
|
}>, {
|
|
907
504
|
config: () => never[];
|
|
@@ -921,8 +518,8 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
|
|
|
921
518
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
922
519
|
}>, {
|
|
923
520
|
grid: Record<string, any>;
|
|
924
|
-
loading: boolean;
|
|
925
521
|
disabled: boolean;
|
|
522
|
+
loading: boolean;
|
|
926
523
|
modelValue: Record<string, any>;
|
|
927
524
|
span: number;
|
|
928
525
|
config: OrcFormItem[];
|
|
@@ -936,10 +533,7 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
|
|
|
936
533
|
value?: any;
|
|
937
534
|
setValue?: ((v: any) => void) | undefined;
|
|
938
535
|
options?: any;
|
|
939
|
-
utils:
|
|
940
|
-
model: string;
|
|
941
|
-
getFormItem: () => OrcFormItem;
|
|
942
|
-
} & Pick<OrcFormUtil, "onChange" | "onMounted">;
|
|
536
|
+
utils: OrcFormUtilBind;
|
|
943
537
|
componentAttr: RecordAny_3;
|
|
944
538
|
}) => any>> & {
|
|
945
539
|
row?(_: {
|
|
@@ -993,80 +587,148 @@ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<E
|
|
|
993
587
|
}>;
|
|
994
588
|
|
|
995
589
|
/**
|
|
996
|
-
*
|
|
997
|
-
* @description
|
|
590
|
+
* 表单配置项
|
|
591
|
+
* @description 通过 `:config` 传递给 `<orc-form>` 的数组项,描述每个字段
|
|
592
|
+
* @example
|
|
593
|
+
* ```ts
|
|
594
|
+
* { type: 'a-input', model: 'name', name: '姓名', defaultValue: '',
|
|
595
|
+
* options: { required: true, placeholder: '请输入' } }
|
|
596
|
+
* ```
|
|
998
597
|
*/
|
|
999
598
|
export declare type OrcFormItem = {
|
|
1000
599
|
/**
|
|
1001
600
|
* 组件类型标识
|
|
1002
|
-
* @description
|
|
601
|
+
* @description
|
|
602
|
+
* - 字符串: Arco 内置组件名,如 `'a-input'`、`'a-select'`、`'a-date-picker'`、`'a-switch'` 等
|
|
603
|
+
* - 组件对象: 自定义 Vue 组件或 `defineAsyncComponent`
|
|
604
|
+
* - 自定义组件时自动注入 `modelValue` / `updateModelValue` 实现 v-model
|
|
605
|
+
* - 自定义组件额外注入 `utils` prop(类型为 `OrcFormUtilBind`)
|
|
1003
606
|
* @example
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
607
|
+
* ```ts
|
|
608
|
+
* type: 'a-input'
|
|
609
|
+
* type: 'a-select'
|
|
610
|
+
* type: 'a-date-picker'
|
|
611
|
+
* type: 'a-textarea'
|
|
612
|
+
* type: defineAsyncComponent(() => import('./CustomPicker.vue'))
|
|
613
|
+
* ```
|
|
1006
614
|
*/
|
|
1007
615
|
type?: string | Component;
|
|
1008
616
|
/** 表单项标签文本 */
|
|
1009
617
|
name?: string;
|
|
1010
|
-
/** 关联数据模型键名 */
|
|
1011
|
-
model?: OrcFormUtil['model'];
|
|
1012
|
-
/** 是否渲染该表单项 */
|
|
1013
|
-
show?: boolean;
|
|
1014
618
|
/**
|
|
1015
|
-
*
|
|
1016
|
-
* @description
|
|
619
|
+
* 关联数据字段名
|
|
620
|
+
* @description 对应 model 对象中的 key
|
|
1017
621
|
*/
|
|
622
|
+
model?: string;
|
|
623
|
+
/** 是否渲染该字段,默认 true。可通过 `util.setShow(model, bool)` 动态控制 */
|
|
624
|
+
show?: boolean;
|
|
625
|
+
/** 字段初始值,不传则默认为 null */
|
|
1018
626
|
defaultValue?: Exclude<ComponentAttrValue, ComponentAttrHandler>;
|
|
1019
|
-
/**
|
|
627
|
+
/** 校验触发时机(仅当 Arco 组件支持时有效) */
|
|
1020
628
|
validateTrigger?: 'change' | 'input' | 'focus' | 'blur';
|
|
1021
|
-
/**
|
|
629
|
+
/**
|
|
630
|
+
* 组件原型属性透传
|
|
631
|
+
* @description 透传到 Arco 组件或自定义组件的 props
|
|
632
|
+
* @note
|
|
633
|
+
* - 值可以是静态值,也可以是一个函数 `(util, index?) => value`,函数会在渲染时执行
|
|
634
|
+
* - 当 `type` 为 Arco 字符串时,可传 Arco 组件对应的 props:
|
|
635
|
+
* - `'a-input'` → `maxLength`, `showWordLimit`, `allowClear` 等
|
|
636
|
+
* - `'a-select'` → `options`, `allowSearch`, `multiple`, `maxTagCount` 等
|
|
637
|
+
* - `'a-date-picker'` → `format`, `showTime`, `disabledDate` 等
|
|
638
|
+
* - `'a-input-number'` → `min`, `max`, `precision`, `step` 等
|
|
639
|
+
* - `'a-switch'` → `checkedValue`, `uncheckedValue` 等
|
|
640
|
+
* - `'a-radio-group'` → `options`, `direction` 等
|
|
641
|
+
* - `'a-textarea'` → `maxLength`, `showWordLimit`, `autoSize` 等
|
|
642
|
+
* - `'a-tree-select'` → `treeData`, `allowSearch`, `treeCheckable` 等
|
|
643
|
+
* @example
|
|
644
|
+
* ```ts
|
|
645
|
+
* // 静态值
|
|
646
|
+
* componentAttr: { min: 0, max: 100 }
|
|
647
|
+
* // 函数值(渲染时执行)
|
|
648
|
+
* componentAttr: { disabled: (util) => util.getModel('type') === 'readonly' }
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
1022
651
|
componentAttr?: Record<string, ComponentAttrValue>;
|
|
1023
652
|
/**
|
|
1024
|
-
*
|
|
1025
|
-
* @
|
|
653
|
+
* Arco FormItem 容器属性透传
|
|
654
|
+
* @description 对应 FormItem 组件的 props,如 `labelColFlex`, `rules`, `disabled`, `help`, `extra` 等
|
|
655
|
+
* @see https://arco.design/vue/component/form#API
|
|
1026
656
|
*/
|
|
1027
657
|
itemAttr?: FormItemInstance['$props'];
|
|
1028
658
|
/**
|
|
1029
|
-
*
|
|
1030
|
-
* @description
|
|
1031
|
-
* @
|
|
1032
|
-
*
|
|
659
|
+
* 自定义行 class
|
|
660
|
+
* @description 支持静态字符串或动态函数
|
|
661
|
+
* @example
|
|
662
|
+
* ```ts
|
|
663
|
+
* customClass: 'my-field'
|
|
664
|
+
* customClass: (item, models) => models.age > 18 ? 'adult' : 'minor'
|
|
665
|
+
* ```
|
|
1033
666
|
*/
|
|
1034
667
|
customClass?: string | ((itemConfig: OrcFormItem, models: RecordAny_3) => string);
|
|
1035
668
|
/**
|
|
1036
|
-
*
|
|
1037
|
-
* @description
|
|
1038
|
-
* @note
|
|
669
|
+
* 多值逗号序列化
|
|
670
|
+
* @description 开启后自动将 `string[]` 序列化为逗号分隔字符串存储,读取时反序列化为数组
|
|
671
|
+
* @note 组件需支持多选(如 `a-select` 需配置 `componentAttr: { multiple: true }`)
|
|
1039
672
|
*/
|
|
1040
673
|
dotNotation?: boolean;
|
|
1041
|
-
/**
|
|
674
|
+
/** 数据字典编码(配合 OrcPinia 字典 store 使用) */
|
|
1042
675
|
datadict?: string;
|
|
1043
|
-
/**
|
|
676
|
+
/** 字段级配置 */
|
|
1044
677
|
options?: {
|
|
1045
|
-
/**
|
|
678
|
+
/** 必填标识(显示红色星号) */
|
|
1046
679
|
required?: boolean;
|
|
1047
|
-
/**
|
|
680
|
+
/** 栅格宽度(基于 24 栅格) */
|
|
1048
681
|
span?: number;
|
|
1049
682
|
/** 栅格偏移量 */
|
|
1050
683
|
offset?: number;
|
|
1051
|
-
/**
|
|
684
|
+
/** 禁用 */
|
|
1052
685
|
disabled?: boolean;
|
|
1053
|
-
/**
|
|
686
|
+
/** 占位文本 */
|
|
1054
687
|
placeholder?: string;
|
|
1055
|
-
/**
|
|
688
|
+
/** 帮助说明(显示在表单项下方) */
|
|
1056
689
|
help?: string;
|
|
1057
|
-
/**
|
|
690
|
+
/** tooltip 提示 */
|
|
1058
691
|
tooltip?: string;
|
|
1059
|
-
/**
|
|
692
|
+
/** 选择器数据源(仅对 select / radio-group 等选择类组件有效) */
|
|
1060
693
|
options?: SelectOptionData[];
|
|
1061
694
|
};
|
|
1062
695
|
/**
|
|
1063
|
-
*
|
|
1064
|
-
* @description
|
|
696
|
+
* 校验规则
|
|
697
|
+
* @description 支持 Arco Form 校验规则数组,或返回规则数组的函数
|
|
698
|
+
* @example
|
|
699
|
+
* ```ts
|
|
700
|
+
* rules: [{ required: true, message: '必填' }]
|
|
701
|
+
* rules: (item, util) => [{ required: true, message: '请选择' }]
|
|
702
|
+
* ```
|
|
1065
703
|
*/
|
|
1066
704
|
rules?: RecordAny_3[] | ((val: OrcFormItem, util: OrcFormUtil) => RecordAny_3[]);
|
|
1067
|
-
/**
|
|
1068
|
-
|
|
1069
|
-
|
|
705
|
+
/**
|
|
706
|
+
* 字段事件
|
|
707
|
+
* @description
|
|
708
|
+
* - `onMounted`: 组件挂载时触发,可用于异步加载选项
|
|
709
|
+
* - `onChange`: 值变化时触发,可用于联动、清空等
|
|
710
|
+
* @example
|
|
711
|
+
* ```ts
|
|
712
|
+
* events: {
|
|
713
|
+
* async onMounted(util) {
|
|
714
|
+
* // 异步加载下拉选项
|
|
715
|
+
* const res = await fetchOptions();
|
|
716
|
+
* util.setModelOption(util.model, res);
|
|
717
|
+
* },
|
|
718
|
+
* onChange(val, util) {
|
|
719
|
+
* // radio 切换联动
|
|
720
|
+
* const isTypeA = util.getModel(util.model) === 'A';
|
|
721
|
+
* util.setShow('fieldX', isTypeA);
|
|
722
|
+
* util.setShow('fieldY', !isTypeA);
|
|
723
|
+
* },
|
|
724
|
+
* }
|
|
725
|
+
* ```
|
|
726
|
+
*/
|
|
727
|
+
events?: {
|
|
728
|
+
onMounted?: (util: OrcFormUtilBind) => any | Promise<any>;
|
|
729
|
+
onChange?: (val: any, util: OrcFormUtilBind) => void | Promise<void>;
|
|
730
|
+
};
|
|
731
|
+
/** 内部备注字段 */
|
|
1070
732
|
note?: string;
|
|
1071
733
|
};
|
|
1072
734
|
|
|
@@ -1077,64 +739,93 @@ export declare const OrcFormSpace: __VLS_WithTemplateSlots_7< DefineComponent<{}
|
|
|
1077
739
|
}>;
|
|
1078
740
|
|
|
1079
741
|
/**
|
|
1080
|
-
*
|
|
742
|
+
* 表单提交事件数据结构
|
|
743
|
+
* @description OrcForm 的 `@submit` 事件回调参数
|
|
744
|
+
* @example
|
|
745
|
+
* ```ts
|
|
746
|
+
* @submit="({ data, utils }) => {
|
|
747
|
+
* utils.setLoading(true);
|
|
748
|
+
* await save(data);
|
|
749
|
+
* utils.setLoading(false);
|
|
750
|
+
* utils.setVisible(false);
|
|
751
|
+
* }"
|
|
752
|
+
* ```
|
|
1081
753
|
*/
|
|
1082
754
|
export declare type OrcFormSubmit = {
|
|
1083
|
-
/**
|
|
755
|
+
/** 表单数据 */
|
|
1084
756
|
data: RecordAny_3;
|
|
1085
|
-
/**
|
|
757
|
+
/** 表单工具 */
|
|
1086
758
|
utils: {
|
|
1087
|
-
/**
|
|
1088
|
-
setVisible: (
|
|
1089
|
-
/**
|
|
1090
|
-
setLoading: (
|
|
759
|
+
/** 关闭弹窗(弹窗表单模式下有效) */
|
|
760
|
+
setVisible: (visible: boolean) => void;
|
|
761
|
+
/** 设置加载状态,submit 按钮显示 loading */
|
|
762
|
+
setLoading: (loading: boolean) => void;
|
|
1091
763
|
};
|
|
1092
764
|
};
|
|
1093
765
|
|
|
1094
766
|
export declare const OrcFormTable: Component<any, any, any, ComputedOptions, MethodOptions, {}, any>;
|
|
1095
767
|
|
|
768
|
+
/**
|
|
769
|
+
* 表单工具方法集合
|
|
770
|
+
* @description 通过 OrcForm 的 slot 或 OrcFormItem events 回调中获取
|
|
771
|
+
*/
|
|
1096
772
|
declare type OrcFormUtil = {
|
|
1097
773
|
/**
|
|
1098
|
-
*
|
|
1099
|
-
* @
|
|
1100
|
-
* @param model - 模型标识符
|
|
774
|
+
* 获取已注册的选择器选项列表
|
|
775
|
+
* @param model - 字段 model
|
|
1101
776
|
*/
|
|
1102
777
|
getModelOption(model: string): SelectOptionData[];
|
|
1103
778
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
* @param model -
|
|
1106
|
-
* @param val -
|
|
1107
|
-
* @returns 匹配的选项对象
|
|
779
|
+
* 根据值查找选项
|
|
780
|
+
* @param model - 字段 model
|
|
781
|
+
* @param val - 要查找的 value
|
|
1108
782
|
*/
|
|
1109
783
|
getModelOption(model: string, val: string): SelectOptionData;
|
|
1110
|
-
/**
|
|
1111
|
-
getModels: () =>
|
|
1112
|
-
/**
|
|
784
|
+
/** 获取表单所有字段的当前值 */
|
|
785
|
+
getModels: () => RecordAny_3;
|
|
786
|
+
/** 获取指定字段的当前值 */
|
|
1113
787
|
getModel: (model: string) => any;
|
|
1114
|
-
/**
|
|
788
|
+
/** 检查指定字段是否可见 */
|
|
1115
789
|
getShow: (model: string) => boolean;
|
|
1116
|
-
/**
|
|
1117
|
-
setModelOption: (model: string, val:
|
|
790
|
+
/** 动态更新指定字段的选择器选项 */
|
|
791
|
+
setModelOption: (model: string, val: SelectOptionData[]) => void;
|
|
792
|
+
/**
|
|
793
|
+
* 设置字段值
|
|
794
|
+
* @param model - 字段 model,或 `{ key: value }` 批量设置对象
|
|
795
|
+
* @param value - 当 model 为字符串时的值
|
|
796
|
+
* @example
|
|
797
|
+
* ```ts
|
|
798
|
+
* util.setModel('name', '张三')
|
|
799
|
+
* util.setModel({ name: '张三', age: 18 })
|
|
800
|
+
* ```
|
|
801
|
+
*/
|
|
802
|
+
setModel: (model: string | RecordAny_3, value?: any) => void;
|
|
1118
803
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
* @param
|
|
1121
|
-
* @param
|
|
804
|
+
* 控制字段的显示/隐藏
|
|
805
|
+
* @param model - 字段 model 或数组
|
|
806
|
+
* @param val - true 显示,false 隐藏
|
|
1122
807
|
*/
|
|
1123
|
-
setModel: (c: string | RecordAny_3, v?: any) => void;
|
|
1124
|
-
/** 控制模型可见性 */
|
|
1125
808
|
setShow: (model: string | string[], val: boolean) => void;
|
|
1126
|
-
/**
|
|
809
|
+
/** 当前字段的 model 名(仅在 events 回调中可用) */
|
|
1127
810
|
model?: string;
|
|
1128
|
-
/**
|
|
811
|
+
/** 组件挂载时触发(仅当定义在 events 中时) */
|
|
1129
812
|
onMounted?: (util: OrcFormUtilBind) => any | Promise<any>;
|
|
1130
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* 值变化时触发(仅当定义在 events 中时)
|
|
815
|
+
* @param val - 新值
|
|
816
|
+
* @param util - 表单工具
|
|
817
|
+
*/
|
|
1131
818
|
onChange?: (val: any, util: OrcFormUtilBind) => void | Promise<void>;
|
|
1132
819
|
};
|
|
1133
820
|
|
|
821
|
+
/**
|
|
822
|
+
* OrcFormUtil 的绑定版
|
|
823
|
+
* @description 在 events 回调中获取,比 OrcFormUtil 多了 `model`(当前字段名)和 `getFormItem`(当前配置项)
|
|
824
|
+
*/
|
|
1134
825
|
declare type OrcFormUtilBind = OrcFormUtil & {
|
|
1135
826
|
model: string;
|
|
1136
827
|
getFormItem: () => OrcFormItem;
|
|
1137
|
-
}
|
|
828
|
+
};
|
|
1138
829
|
|
|
1139
830
|
export declare const OrcHiddenView: __VLS_WithTemplateSlots_2< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
|
|
1140
831
|
isShow?: boolean | undefined;
|
|
@@ -1503,36 +1194,54 @@ export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<Extra
|
|
|
1503
1194
|
default?(_: {}): any;
|
|
1504
1195
|
}>;
|
|
1505
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* OrcSearch 搜索项配置
|
|
1199
|
+
* @description 定义搜索栏每一维度的字段类型、默认值、选项数据
|
|
1200
|
+
* @example
|
|
1201
|
+
* ```ts
|
|
1202
|
+
* { type: 'input', name: 'name', label: '名称' }
|
|
1203
|
+
* { type: 'select', name: 'status', label: '状态', options: [{ label: '启用', value: '1' }] }
|
|
1204
|
+
* { type: 'date', name: 'range', label: '日期范围', multiple: true }
|
|
1205
|
+
* { type: 'number', name: 'num', label: '数字', min: 0, max: 100 }
|
|
1206
|
+
* ```
|
|
1207
|
+
*/
|
|
1506
1208
|
export declare interface OrcSearchItem extends RecordAny {
|
|
1507
|
-
/**
|
|
1508
|
-
|
|
1509
|
-
|
|
1209
|
+
/**
|
|
1210
|
+
* 搜索组件类型
|
|
1211
|
+
* @description 支持以下类型:
|
|
1212
|
+
* - `'input'` — 文本输入框
|
|
1213
|
+
* - `'select'` — 下拉选择器(配合 `options` 传入选项列表)
|
|
1214
|
+
* - `'date'` — 日期选择器(配合 `multiple: true` 可实现日期范围)
|
|
1215
|
+
* - `'number'` — 数字输入框(配合 `min`/`max` 限制范围)
|
|
1216
|
+
*/
|
|
1217
|
+
type?: 'input' | 'select' | 'date' | 'number';
|
|
1218
|
+
/** 字段名(对应提交数据的 key) */
|
|
1510
1219
|
name: string;
|
|
1511
|
-
/**
|
|
1220
|
+
/** 显示标签 */
|
|
1512
1221
|
label: string;
|
|
1513
|
-
/**
|
|
1222
|
+
/** 初始值。`multiple: true` 时支持逗号分隔字符串如 `'2024-01,2024-12'` */
|
|
1514
1223
|
defaultValue?: string | boolean | number | string[];
|
|
1515
|
-
/**
|
|
1224
|
+
/** 是否显示该搜索项,默认 true */
|
|
1516
1225
|
show?: boolean;
|
|
1517
|
-
/** type
|
|
1226
|
+
/** 数字最小值(type=number) */
|
|
1518
1227
|
min?: number;
|
|
1519
|
-
/** type
|
|
1228
|
+
/** 数字最大值(type=number) */
|
|
1520
1229
|
max?: number;
|
|
1521
|
-
/** type=select
|
|
1230
|
+
/** 是否开启多选/范围模式(type=select 或 type=date) */
|
|
1522
1231
|
multiple?: boolean;
|
|
1523
|
-
/** type=select */
|
|
1232
|
+
/** 选择器选项列表(type=select) */
|
|
1524
1233
|
options?: {
|
|
1525
1234
|
label: string;
|
|
1526
1235
|
value: string;
|
|
1527
1236
|
disabled?: boolean;
|
|
1528
1237
|
}[];
|
|
1529
|
-
/** type=date */
|
|
1238
|
+
/** 日期格式化(type=date),如 `'YYYY-MM-DD'` */
|
|
1530
1239
|
format?: string;
|
|
1531
|
-
/** type=date
|
|
1240
|
+
/** 日期是否包含时间选择(type=date) */
|
|
1532
1241
|
showTime?: boolean;
|
|
1533
|
-
/**
|
|
1242
|
+
/** 是否必填 */
|
|
1534
1243
|
required?: boolean;
|
|
1535
|
-
/**
|
|
1244
|
+
/** 校验规则 */
|
|
1536
1245
|
rules?: RecordAny | RecordAny[];
|
|
1537
1246
|
}
|
|
1538
1247
|
|
|
@@ -1551,10 +1260,10 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1551
1260
|
getSelection(): RecordAny_2[];
|
|
1552
1261
|
getCheckboxKeySelection(keys?: string[] | undefined): RecordAny_2[];
|
|
1553
1262
|
getReserveSelection(): RecordAny_2[];
|
|
1554
|
-
clearSelection(): void;
|
|
1263
|
+
clearSelection(): void; /** 计算分页信息 */
|
|
1555
1264
|
insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
|
|
1556
|
-
row:
|
|
1557
|
-
rows:
|
|
1265
|
+
row: RecordAny_2;
|
|
1266
|
+
rows: RecordAny_2[];
|
|
1558
1267
|
}>;
|
|
1559
1268
|
removeRows(): void;
|
|
1560
1269
|
validate(list?: RecordAny_2[] | undefined): Promise<[string, RecordAny_2[]]>;
|
|
@@ -1614,49 +1323,120 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1614
1323
|
footer?(_: {}): any;
|
|
1615
1324
|
}>;
|
|
1616
1325
|
|
|
1326
|
+
/**
|
|
1327
|
+
* 表格组件暴露方法
|
|
1328
|
+
* @description `<orc-table ref="tableRef">` 可调用的方法
|
|
1329
|
+
*/
|
|
1617
1330
|
declare interface OrcTableExpose extends TableGridTwoType {
|
|
1331
|
+
/** 是否正在加载数据 */
|
|
1618
1332
|
loading: boolean;
|
|
1333
|
+
/** 手动设置加载状态 */
|
|
1619
1334
|
setLoading: (loading?: boolean) => void;
|
|
1620
|
-
/**
|
|
1621
|
-
dataInit: () => Promise<void>;
|
|
1622
|
-
/**
|
|
1335
|
+
/** 请求服务端数据(如配置 url),可传 true 跳回第一页 */
|
|
1336
|
+
dataInit: (isFirst?: boolean) => Promise<void>;
|
|
1337
|
+
/** 加载静态数据并刷新表格 */
|
|
1623
1338
|
loadData: (list: RecordAny_2[]) => void;
|
|
1624
1339
|
}
|
|
1625
1340
|
|
|
1626
|
-
/**
|
|
1341
|
+
/**
|
|
1342
|
+
* 表格列配置
|
|
1343
|
+
* @description 定义每一列的数据映射、显示格式、编辑方式
|
|
1344
|
+
*/
|
|
1627
1345
|
export declare interface OrcTableItem extends RecordAny_2 {
|
|
1346
|
+
/** 是否显示该列,默认 true */
|
|
1628
1347
|
show?: boolean;
|
|
1348
|
+
/** 数据字段名(必填) */
|
|
1629
1349
|
dataIndex: string;
|
|
1350
|
+
/** 列标题 */
|
|
1630
1351
|
title?: string;
|
|
1352
|
+
/** 列宽度(像素) */
|
|
1631
1353
|
width?: number;
|
|
1354
|
+
/** 是否可排序 */
|
|
1632
1355
|
sort?: boolean;
|
|
1633
|
-
/**
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1356
|
+
/**
|
|
1357
|
+
* 单元格渲染模式
|
|
1358
|
+
* @description
|
|
1359
|
+
* - `true` — 开启行内编辑模式(配合 edit-render)
|
|
1360
|
+
* - `Component` — 渲染为指定组件(如 Badge、Tag),配合 `cellAttr` 传参
|
|
1361
|
+
* - `VNode` — 渲染为 VNode 内容
|
|
1362
|
+
* @example
|
|
1363
|
+
* ```ts
|
|
1364
|
+
* // 行内编辑
|
|
1365
|
+
* { cell: true }
|
|
1366
|
+
* // 渲染为组件
|
|
1367
|
+
* { cell: Badge, div: true, cellAttr: { text: (v) => v.value, status: (v) => 'success' } }
|
|
1368
|
+
* // 渲染为 VNode
|
|
1369
|
+
* { cell: h('div', '自定义内容') }
|
|
1370
|
+
* ```
|
|
1371
|
+
*/
|
|
1372
|
+
cell?: boolean | Component | VNode;
|
|
1373
|
+
/**
|
|
1374
|
+
* 组件属性(当 cell 为 Component 时使用)
|
|
1375
|
+
* @description 每个 key 可以是静态值或函数,函数接收 `{ record, value, rowIndex, columnIndex, updateValue, formatValue }`
|
|
1376
|
+
* @example
|
|
1377
|
+
* ```ts
|
|
1378
|
+
* { cell: Badge, div: true, cellAttr: {
|
|
1379
|
+
* text: ({ value }) => value ? '启用' : '禁用',
|
|
1380
|
+
* status: ({ value }) => value ? 'success' : 'normal',
|
|
1381
|
+
* } }
|
|
1382
|
+
* ```
|
|
1638
1383
|
*/
|
|
1639
1384
|
cellAttr?: {
|
|
1640
|
-
[key: string]: (v1:
|
|
1385
|
+
[key: string]: (v1: {
|
|
1386
|
+
record: RecordAny_2;
|
|
1387
|
+
value: any;
|
|
1388
|
+
rowIndex: number;
|
|
1389
|
+
columnIndex: number;
|
|
1390
|
+
updateValue: (val: any) => void;
|
|
1391
|
+
formatValue: string;
|
|
1392
|
+
}) => unknown;
|
|
1641
1393
|
} | {
|
|
1642
1394
|
[key: string]: unknown;
|
|
1643
1395
|
};
|
|
1396
|
+
/**
|
|
1397
|
+
* 渲染模式(仅在 cell 为 Component 时有效)
|
|
1398
|
+
* @description `true` 时在 `#default` 插槽渲染组件,而非仅在编辑模式下显示
|
|
1399
|
+
*/
|
|
1644
1400
|
div?: boolean;
|
|
1645
|
-
/**
|
|
1401
|
+
/** 空数据占位文本 */
|
|
1646
1402
|
placeholder?: string;
|
|
1403
|
+
/** 单元格文字超出是否以 tooltip 展示 */
|
|
1647
1404
|
tooltip?: boolean;
|
|
1405
|
+
/** 是否显示省略号 */
|
|
1648
1406
|
ellipsis?: boolean;
|
|
1407
|
+
/** 列对齐方式 */
|
|
1649
1408
|
align?: VxeColumnPropTypes.Align;
|
|
1409
|
+
/** 表头对齐方式 */
|
|
1650
1410
|
headerAlign?: VxeColumnPropTypes.HeaderAlign;
|
|
1411
|
+
/** 表尾对齐方式 */
|
|
1651
1412
|
footerAlign?: VxeColumnPropTypes.FooterAlign;
|
|
1413
|
+
/** 固定列方向 */
|
|
1414
|
+
fixed?: 'left' | 'right';
|
|
1415
|
+
/**
|
|
1416
|
+
* 行数据格式化
|
|
1417
|
+
* @param val 原始值
|
|
1418
|
+
* @param record 整行数据
|
|
1419
|
+
* @returns 格式化后的显示文本
|
|
1420
|
+
*/
|
|
1652
1421
|
format?: (val: any, record?: RecordAny_2) => string;
|
|
1422
|
+
/**
|
|
1423
|
+
* 行内样式
|
|
1424
|
+
* @description 支持静态对象或根据行数据动态返回
|
|
1425
|
+
*/
|
|
1653
1426
|
style?: CssType | ((record: RecordAny_2) => CssType);
|
|
1654
|
-
/**
|
|
1427
|
+
/** 标题帮助提示(同 vxe-table title-prefix) */
|
|
1655
1428
|
help?: VxeColumnPropTypes.TitlePrefix;
|
|
1429
|
+
/** 列过滤条件列表 */
|
|
1430
|
+
filters?: VxeColumnPropTypes.Filters;
|
|
1431
|
+
/** 是否支持多选过滤 */
|
|
1432
|
+
filterMultiple?: boolean;
|
|
1433
|
+
/** 自定义过滤方法 */
|
|
1434
|
+
filterMethod?: VxeColumnPropTypes.FilterMethod;
|
|
1656
1435
|
}
|
|
1657
1436
|
|
|
1658
1437
|
/**
|
|
1659
|
-
*
|
|
1438
|
+
* 表格配置项
|
|
1439
|
+
* @description 传递给 `<orc-table :option>` 的完整配置
|
|
1660
1440
|
* @example
|
|
1661
1441
|
* ```ts
|
|
1662
1442
|
* {
|
|
@@ -1664,88 +1444,133 @@ export declare interface OrcTableItem extends RecordAny_2 {
|
|
|
1664
1444
|
* scrollY: { enabled: true },
|
|
1665
1445
|
* columns: [
|
|
1666
1446
|
* { dataIndex: 'index', title: '序', width: 26 },
|
|
1667
|
-
* ]
|
|
1447
|
+
* ],
|
|
1448
|
+
* selectedType: 'checkbox',
|
|
1449
|
+
* selectedTrigger: 'row',
|
|
1668
1450
|
* }
|
|
1669
1451
|
* ```
|
|
1670
1452
|
*/
|
|
1671
1453
|
export declare interface OrcTableOption extends RecordAny_2 {
|
|
1672
|
-
/**
|
|
1454
|
+
/**
|
|
1455
|
+
* 异步请求封装函数
|
|
1456
|
+
* @description 需通过 `orc-provider` 全局注入,或直接传入
|
|
1457
|
+
*/
|
|
1673
1458
|
useErrData?: <T = RecordAny_2>(config: RecordAny_2) => Promise<[boolean, T]>;
|
|
1674
|
-
/**
|
|
1459
|
+
/** 服务端分页请求地址,不传则使用静态数据 */
|
|
1675
1460
|
url?: string;
|
|
1676
|
-
/**
|
|
1461
|
+
/** 请求方法 */
|
|
1677
1462
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
1678
|
-
/**
|
|
1463
|
+
/** 是否保留跨页多选状态 */
|
|
1679
1464
|
reserve?: boolean;
|
|
1680
|
-
/** 原 checkbox-config.checkField
|
|
1465
|
+
/** 原 vxe-table checkbox-config.checkField,行中存储多选 bool 值的字段名 */
|
|
1681
1466
|
checkKey?: string;
|
|
1682
|
-
/**
|
|
1467
|
+
/**
|
|
1468
|
+
* 行主键字段名
|
|
1469
|
+
* @default '_X_ROW_KEY'
|
|
1470
|
+
*/
|
|
1683
1471
|
rowKey?: string;
|
|
1684
|
-
/**
|
|
1472
|
+
/**
|
|
1473
|
+
* 多选联动 key
|
|
1474
|
+
* @description 有此值时,同一 key 的行会联动选中/取消
|
|
1475
|
+
*/
|
|
1685
1476
|
checkboxKey?: string;
|
|
1686
|
-
/**
|
|
1477
|
+
/** 列配置 */
|
|
1687
1478
|
columns: OrcTableItem[];
|
|
1688
|
-
/**
|
|
1479
|
+
/** 默认每页条数 */
|
|
1689
1480
|
pageSize?: number;
|
|
1690
|
-
/**
|
|
1481
|
+
/** 每页条数选项列表 */
|
|
1691
1482
|
pageSizeOptions?: number[];
|
|
1692
|
-
/**
|
|
1483
|
+
/** 行选中类型 */
|
|
1693
1484
|
selectedType?: 'checkbox' | 'radio';
|
|
1694
|
-
/**
|
|
1485
|
+
/** 选中触发方式 */
|
|
1695
1486
|
selectedTrigger?: 'cell' | 'row' | 'default';
|
|
1696
|
-
/**
|
|
1487
|
+
/** 行必填字段名列表(用于行校验高亮) */
|
|
1697
1488
|
requiredKeys?: string[];
|
|
1698
|
-
/**
|
|
1489
|
+
/** 首次自动请求数据(url 模式),默认 true */
|
|
1699
1490
|
firstLoad?: boolean;
|
|
1700
|
-
/**
|
|
1491
|
+
/**
|
|
1492
|
+
* 单元格溢出行为
|
|
1493
|
+
* @description 'ellipsis' — 省略号,'title' — 原生 title,'tooltip' — tooltip 提示
|
|
1494
|
+
*/
|
|
1701
1495
|
tooltip?: ('ellipsis' | 'title' | 'tooltip') | boolean;
|
|
1702
|
-
/**
|
|
1496
|
+
/** 表尾单元格溢出行为,同 tooltip 参数 */
|
|
1703
1497
|
footerTooltip?: ('ellipsis' | 'title' | 'tooltip') | boolean;
|
|
1704
|
-
/**
|
|
1705
|
-
|
|
1498
|
+
/**
|
|
1499
|
+
* 表头样式
|
|
1500
|
+
* @param record - 包含 `{ column, columnIndex }`,dataIndex 在 column.property 中
|
|
1501
|
+
*/
|
|
1502
|
+
headerStyle?: (record: {
|
|
1706
1503
|
column: {
|
|
1707
1504
|
property: string;
|
|
1708
1505
|
} & RecordAny_2;
|
|
1506
|
+
columnIndex: number;
|
|
1709
1507
|
}) => CssType;
|
|
1710
|
-
/**
|
|
1711
|
-
|
|
1508
|
+
/**
|
|
1509
|
+
* 表尾样式
|
|
1510
|
+
* @param record - 包含 `{ $rowIndex, column, columnIndex, $columnIndex }`
|
|
1511
|
+
*/
|
|
1512
|
+
footerStyle?: (record: {
|
|
1513
|
+
$rowIndex: number;
|
|
1712
1514
|
column: {
|
|
1713
1515
|
property: string;
|
|
1714
1516
|
} & RecordAny_2;
|
|
1517
|
+
columnIndex: number;
|
|
1518
|
+
$columnIndex: number;
|
|
1715
1519
|
}) => CssType;
|
|
1716
|
-
/**
|
|
1520
|
+
/**
|
|
1521
|
+
* 表尾合计方法
|
|
1522
|
+
* @returns 二维数组,外层对应表尾行,内层对应每列
|
|
1523
|
+
* @see useOrcTableFooter 快速使用
|
|
1524
|
+
*/
|
|
1717
1525
|
footerMethod?: VxeTablePropTypes.FooterMethod;
|
|
1718
|
-
/**
|
|
1526
|
+
/** 表尾合并配置(不能与展开行、固定列、树形结构同时使用) */
|
|
1719
1527
|
mergeFooter?: VxeTablePropTypes.MergeFooterItems;
|
|
1720
|
-
/**
|
|
1528
|
+
/** 列预处理函数,在 columns 渲染前执行 */
|
|
1721
1529
|
resolveColumns?: (columns?: OrcTableItem[]) => OrcTableItem[];
|
|
1722
|
-
/**
|
|
1530
|
+
/** 计算总条目数(服务端分页) */
|
|
1723
1531
|
resolveTotal?: (e: RecordAny_2) => number;
|
|
1724
|
-
/**
|
|
1532
|
+
/** 请求超时时间(毫秒) */
|
|
1725
1533
|
timeout?: number;
|
|
1726
|
-
/**
|
|
1534
|
+
/** 固定请求参数,会与分页参数合并发送 */
|
|
1727
1535
|
data?: RecordAny_2;
|
|
1728
|
-
/**
|
|
1729
|
-
|
|
1730
|
-
|
|
1536
|
+
/**
|
|
1537
|
+
* 自定义分页参数
|
|
1538
|
+
* @param page - `{ page, size }` 分页信息,可扩展额外参数
|
|
1539
|
+
* @returns 发送到接口的分页参数对象
|
|
1540
|
+
*/
|
|
1541
|
+
resolvePage?: (page: RecordAny_2) => any;
|
|
1542
|
+
/**
|
|
1543
|
+
* 解析接口返回的数据列表
|
|
1544
|
+
* @param data - 接口原始返回值
|
|
1545
|
+
* @param page - `{ page, size }` 当前分页信息
|
|
1546
|
+
* @returns 表格行数据数组
|
|
1547
|
+
*/
|
|
1731
1548
|
resolveData?: (data: RecordAny_2, page?: RecordAny_2) => RecordAny_2[];
|
|
1732
|
-
/**
|
|
1549
|
+
/** 数据请求成功回调 */
|
|
1733
1550
|
success?: (data?: any) => void;
|
|
1734
|
-
/**
|
|
1551
|
+
/** 数据请求失败回调 */
|
|
1735
1552
|
error?: (data?: any) => void;
|
|
1736
|
-
/**
|
|
1553
|
+
/**
|
|
1554
|
+
* 皮肤行分组字段
|
|
1555
|
+
* @description 相同值的行合并显示,开启后重复行隐藏相同内容
|
|
1556
|
+
*/
|
|
1737
1557
|
skinRow?: string;
|
|
1738
|
-
/**
|
|
1558
|
+
/** 皮肤行样式(非重复行且未被跳过时应用) */
|
|
1739
1559
|
skinRowStyle?: CssType;
|
|
1740
|
-
/**
|
|
1560
|
+
/** 被隐藏的重复行显示文字 */
|
|
1741
1561
|
skinRowText?: string;
|
|
1742
|
-
/**
|
|
1562
|
+
/**
|
|
1563
|
+
* 行编辑校验规则
|
|
1564
|
+
* @example { sex: [{ required: true, message: '性别必须填写' }] }
|
|
1565
|
+
*/
|
|
1743
1566
|
rules?: VxeTablePropTypes.EditRules;
|
|
1744
|
-
/**
|
|
1567
|
+
/** 横向虚拟滚动 */
|
|
1745
1568
|
scrollX?: VxeTablePropTypes.ScrollX;
|
|
1746
|
-
/**
|
|
1569
|
+
/** 纵向虚拟滚动 */
|
|
1747
1570
|
scrollY?: VxeTablePropTypes.ScrollY;
|
|
1571
|
+
/** 选中模式附加属性 */
|
|
1748
1572
|
selectedProps?: any;
|
|
1573
|
+
/** 透传 vxe-table 原生 props */
|
|
1749
1574
|
tableProps?: TableInstance['$props'];
|
|
1750
1575
|
}
|
|
1751
1576
|
|
|
@@ -1754,32 +1579,32 @@ declare interface Props {
|
|
|
1754
1579
|
}
|
|
1755
1580
|
|
|
1756
1581
|
declare type Props_2 = {
|
|
1757
|
-
/**
|
|
1582
|
+
/** 表格标题,显示在工具栏左侧 */
|
|
1758
1583
|
title?: string;
|
|
1759
|
-
/**
|
|
1584
|
+
/** 表格高度(像素或百分比) */
|
|
1760
1585
|
height?: number | string;
|
|
1761
1586
|
/** 多语言 */
|
|
1762
1587
|
locale?: I18nType;
|
|
1763
1588
|
/** 是否隐藏工具栏 */
|
|
1764
1589
|
hideToolbar?: boolean;
|
|
1765
|
-
/**
|
|
1590
|
+
/** 是否隐藏列设置按钮 */
|
|
1766
1591
|
hideSetting?: boolean;
|
|
1767
|
-
/**
|
|
1592
|
+
/** 是否隐藏底部分页 */
|
|
1768
1593
|
hidePagination?: boolean;
|
|
1769
|
-
/**
|
|
1594
|
+
/** 是否启用行悬停效果,默认 true */
|
|
1770
1595
|
isHover?: boolean;
|
|
1771
|
-
/**
|
|
1596
|
+
/** 表格尺寸 */
|
|
1772
1597
|
size?: 'large' | 'medium' | 'small' | 'mini';
|
|
1773
|
-
/**
|
|
1598
|
+
/** 选中行 key 列表(v-model) */
|
|
1774
1599
|
selectedKeys?: string[];
|
|
1775
|
-
/**
|
|
1600
|
+
/** 静态数据源 */
|
|
1776
1601
|
data?: RecordAny_2[];
|
|
1777
|
-
/**
|
|
1602
|
+
/** 表格配置 */
|
|
1778
1603
|
option?: OrcTableOption;
|
|
1779
1604
|
/**
|
|
1780
|
-
*
|
|
1781
|
-
* - getColumn:
|
|
1782
|
-
* - setColumn:
|
|
1605
|
+
* 列配置持久化钩子
|
|
1606
|
+
* - getColumn: 异步获取用户保存的列配置,返回 `[err, columns]`
|
|
1607
|
+
* - setColumn: 保存用户调整后的列配置
|
|
1783
1608
|
*/
|
|
1784
1609
|
hook?: {
|
|
1785
1610
|
getColumn: () => Promise<[boolean, RecordAny_2[]]>;
|
|
@@ -1839,6 +1664,8 @@ declare type RecordAny_2 = Record<string, any>;
|
|
|
1839
1664
|
/** 通用对象类型 (键值对形式) */
|
|
1840
1665
|
declare type RecordAny_3 = Record<string, any>;
|
|
1841
1666
|
|
|
1667
|
+
declare function resetFields(): void;
|
|
1668
|
+
|
|
1842
1669
|
/**
|
|
1843
1670
|
* set path object
|
|
1844
1671
|
* @example
|
|
@@ -1852,47 +1679,61 @@ export declare function setData(object: RecordAny, path: string, defaultValue?:
|
|
|
1852
1679
|
|
|
1853
1680
|
declare function setLoading(val?: boolean): void;
|
|
1854
1681
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1682
|
+
/**
|
|
1683
|
+
* 表格工具方法
|
|
1684
|
+
* @description 通过 `useOrcTable()` 返回的 `tableUtils` 或 `tableRef` 暴露的方法
|
|
1685
|
+
*/
|
|
1686
|
+
declare interface TableGridTwoType {
|
|
1687
|
+
/** 读取配置的 rowKey,默认 `_X_ROW_KEY` */
|
|
1857
1688
|
getRowKey(): string;
|
|
1858
|
-
/**
|
|
1689
|
+
/** 读取当前页全部数据 */
|
|
1859
1690
|
getTableData(): RecordAny_2[];
|
|
1860
|
-
/**
|
|
1691
|
+
/** 读取当前选中的行数据 */
|
|
1861
1692
|
getSelection(): RecordAny_2[];
|
|
1862
|
-
/**
|
|
1693
|
+
/**
|
|
1694
|
+
* 按 checkboxKey 获取选中行
|
|
1695
|
+
* @param keys - 要匹配的 key 列表,默认当前选中行
|
|
1696
|
+
*/
|
|
1863
1697
|
getCheckboxKeySelection(keys?: string[]): RecordAny_2[];
|
|
1864
|
-
/** option.reserve
|
|
1698
|
+
/** 读取跨页选中数据(需开启 `option.reserve`) */
|
|
1865
1699
|
getReserveSelection(): RecordAny_2[];
|
|
1866
|
-
/**
|
|
1700
|
+
/** 清空所有选中行 */
|
|
1867
1701
|
clearSelection(): void;
|
|
1868
|
-
/**
|
|
1702
|
+
/**
|
|
1703
|
+
* 插入一行数据
|
|
1704
|
+
* @param record - 行数据
|
|
1705
|
+
* @param row - 插入位置参照行(number 为索引、目标行对象、null 为首行、-1 为末尾)
|
|
1706
|
+
* @param isNext - 是否插入在参照行之后(仅当 row 为对象时有效)
|
|
1707
|
+
* @returns 插入结果 `{ row, rows }`
|
|
1708
|
+
*/
|
|
1869
1709
|
insertRow(record: RecordAny_2, row?: RecordAny_2 | number, isNext?: boolean): Promise<{
|
|
1870
|
-
row:
|
|
1871
|
-
rows:
|
|
1710
|
+
row: RecordAny_2;
|
|
1711
|
+
rows: RecordAny_2[];
|
|
1872
1712
|
}>;
|
|
1873
|
-
/**
|
|
1713
|
+
/** 删除 Checkbox 选中的行 */
|
|
1874
1714
|
removeRows(): void;
|
|
1875
1715
|
/**
|
|
1876
1716
|
* 选中行数据校验
|
|
1877
|
-
* @param list
|
|
1717
|
+
* @param list - 默认校验当前所有选中行
|
|
1718
|
+
* @returns `[errMsg, validatedList]` — 空字符串表示无错误
|
|
1878
1719
|
*/
|
|
1879
1720
|
validate(list?: RecordAny_2[]): Promise<[string, RecordAny_2[]]>;
|
|
1880
1721
|
/**
|
|
1881
|
-
* 根据 row
|
|
1882
|
-
* @param row 行对象
|
|
1722
|
+
* 根据 row 获取行序号(从 1 开始)
|
|
1723
|
+
* @param row - 行对象
|
|
1883
1724
|
*/
|
|
1884
1725
|
getRowSeq(row: any): string | number;
|
|
1885
1726
|
/**
|
|
1886
|
-
* 根据 row
|
|
1887
|
-
* @param row 行对象
|
|
1727
|
+
* 根据 row 获取行索引(从 0 开始)
|
|
1728
|
+
* @param row - 行对象
|
|
1888
1729
|
*/
|
|
1889
1730
|
getRowIndex(row: any): number;
|
|
1890
|
-
/**
|
|
1891
|
-
* 删除RowIndex这一行
|
|
1892
|
-
*/
|
|
1731
|
+
/** 删除指定索引的行 */
|
|
1893
1732
|
removerRowIndex(rowIndex: number): void;
|
|
1894
1733
|
/**
|
|
1895
|
-
*
|
|
1734
|
+
* 选中/取消选中指定行
|
|
1735
|
+
* @param row - 行对象
|
|
1736
|
+
* @param bool - true 选中,false 取消
|
|
1896
1737
|
*/
|
|
1897
1738
|
setSelectionRow(row: any, bool?: boolean): void;
|
|
1898
1739
|
}
|
|
@@ -1905,6 +1746,41 @@ export declare function toArray<T>(target: T | T[]): T[];
|
|
|
1905
1746
|
/** 读取数据类型 */
|
|
1906
1747
|
export declare function typeName(o: unknown): string;
|
|
1907
1748
|
|
|
1749
|
+
/**
|
|
1750
|
+
* 字典缓存 Store
|
|
1751
|
+
*
|
|
1752
|
+
* @example
|
|
1753
|
+
* // 1. 初始化(在 main.ts 或 App.vue 中执行一次)
|
|
1754
|
+
* const dictStore = useDictStore();
|
|
1755
|
+
* dictStore.registerLoadFn(async (code) => {
|
|
1756
|
+
* const res = await fetch(`/api/dict/${code}`);
|
|
1757
|
+
* return res.json();
|
|
1758
|
+
* });
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* // 2. 在组件中使用
|
|
1762
|
+
* const dictStore = useDictStore();
|
|
1763
|
+
* const genders = await dictStore.getDict('gender');
|
|
1764
|
+
* const freshData = await dictStore.getDict('gender', true); // 强制刷新
|
|
1765
|
+
* dictStore.clearCache('gender'); // 清除缓存
|
|
1766
|
+
*/
|
|
1767
|
+
export declare const useDictStore: StoreDefinition<"orc-dict", Pick<{
|
|
1768
|
+
dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
|
|
1769
|
+
registerLoadFn: (fn: DictLoadFn) => void;
|
|
1770
|
+
getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
|
|
1771
|
+
clearCache: (code?: string) => void;
|
|
1772
|
+
}, "dicts">, Pick<{
|
|
1773
|
+
dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
|
|
1774
|
+
registerLoadFn: (fn: DictLoadFn) => void;
|
|
1775
|
+
getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
|
|
1776
|
+
clearCache: (code?: string) => void;
|
|
1777
|
+
}, never>, Pick<{
|
|
1778
|
+
dicts: Ref<Record<string, unknown[]>, Record<string, unknown[]>>;
|
|
1779
|
+
registerLoadFn: (fn: DictLoadFn) => void;
|
|
1780
|
+
getDict: <T = unknown[]>(code: string, force?: boolean) => Promise<T>;
|
|
1781
|
+
clearCache: (code?: string) => void;
|
|
1782
|
+
}, "registerLoadFn" | "getDict" | "clearCache">>;
|
|
1783
|
+
|
|
1908
1784
|
/**
|
|
1909
1785
|
* @example
|
|
1910
1786
|
* ```
|
|
@@ -1926,7 +1802,7 @@ export declare function typeName(o: unknown): string;
|
|
|
1926
1802
|
*/
|
|
1927
1803
|
export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSearchItem[]), local?: Ref<string>): readonly [Ref<{
|
|
1928
1804
|
[x: string]: any;
|
|
1929
|
-
type?:
|
|
1805
|
+
type?: "number" | "input" | "select" | "date" | undefined;
|
|
1930
1806
|
name: string;
|
|
1931
1807
|
label: string;
|
|
1932
1808
|
defaultValue?: string | number | boolean | string[] | undefined;
|
|
@@ -1945,7 +1821,7 @@ export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSe
|
|
|
1945
1821
|
rules?: RecordAny | RecordAny[] | undefined;
|
|
1946
1822
|
}[], OrcSearchItem[] | {
|
|
1947
1823
|
[x: string]: any;
|
|
1948
|
-
type?:
|
|
1824
|
+
type?: "number" | "input" | "select" | "date" | undefined;
|
|
1949
1825
|
name: string;
|
|
1950
1826
|
label: string;
|
|
1951
1827
|
defaultValue?: string | number | boolean | string[] | undefined;
|
|
@@ -1966,10 +1842,9 @@ export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSe
|
|
|
1966
1842
|
|
|
1967
1843
|
export declare const useOrcTable: (option: OrcTableOption) => {
|
|
1968
1844
|
tableRef: Ref<{
|
|
1969
|
-
[x: string]: any;
|
|
1970
1845
|
loading: boolean;
|
|
1971
1846
|
setLoading: (loading?: boolean | undefined) => void;
|
|
1972
|
-
dataInit: () => Promise<void>;
|
|
1847
|
+
dataInit: (isFirst?: boolean | undefined) => Promise<void>;
|
|
1973
1848
|
loadData: (list: RecordAny_2[]) => void;
|
|
1974
1849
|
getRowKey: () => string;
|
|
1975
1850
|
getTableData: () => RecordAny_2[];
|
|
@@ -1978,8 +1853,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
1978
1853
|
getReserveSelection: () => RecordAny_2[];
|
|
1979
1854
|
clearSelection: () => void;
|
|
1980
1855
|
insertRow: (record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined) => Promise<{
|
|
1981
|
-
row:
|
|
1982
|
-
rows:
|
|
1856
|
+
row: RecordAny_2;
|
|
1857
|
+
rows: RecordAny_2[];
|
|
1983
1858
|
}>;
|
|
1984
1859
|
removeRows: () => void;
|
|
1985
1860
|
validate: (list?: RecordAny_2[] | undefined) => Promise<[string, RecordAny_2[]]>;
|
|
@@ -1988,10 +1863,9 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
1988
1863
|
removerRowIndex: (rowIndex: number) => void;
|
|
1989
1864
|
setSelectionRow: (row: any, bool?: boolean | undefined) => void;
|
|
1990
1865
|
}, OrcTableExpose | {
|
|
1991
|
-
[x: string]: any;
|
|
1992
1866
|
loading: boolean;
|
|
1993
1867
|
setLoading: (loading?: boolean | undefined) => void;
|
|
1994
|
-
dataInit: () => Promise<void>;
|
|
1868
|
+
dataInit: (isFirst?: boolean | undefined) => Promise<void>;
|
|
1995
1869
|
loadData: (list: RecordAny_2[]) => void;
|
|
1996
1870
|
getRowKey: () => string;
|
|
1997
1871
|
getTableData: () => RecordAny_2[];
|
|
@@ -2000,8 +1874,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
2000
1874
|
getReserveSelection: () => RecordAny_2[];
|
|
2001
1875
|
clearSelection: () => void;
|
|
2002
1876
|
insertRow: (record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined) => Promise<{
|
|
2003
|
-
row:
|
|
2004
|
-
rows:
|
|
1877
|
+
row: RecordAny_2;
|
|
1878
|
+
rows: RecordAny_2[];
|
|
2005
1879
|
}>;
|
|
2006
1880
|
removeRows: () => void;
|
|
2007
1881
|
validate: (list?: RecordAny_2[] | undefined) => Promise<[string, RecordAny_2[]]>;
|
|
@@ -2028,15 +1902,19 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
2028
1902
|
firstLoad?: boolean | undefined;
|
|
2029
1903
|
tooltip?: boolean | "title" | "tooltip" | "ellipsis" | undefined;
|
|
2030
1904
|
footerTooltip?: boolean | "title" | "tooltip" | "ellipsis" | undefined;
|
|
2031
|
-
headerStyle?: ((record:
|
|
1905
|
+
headerStyle?: ((record: {
|
|
2032
1906
|
column: {
|
|
2033
1907
|
property: string;
|
|
2034
1908
|
} & RecordAny_2;
|
|
1909
|
+
columnIndex: number;
|
|
2035
1910
|
}) => CssType) | undefined;
|
|
2036
|
-
footerStyle?: ((record:
|
|
1911
|
+
footerStyle?: ((record: {
|
|
1912
|
+
$rowIndex: number;
|
|
2037
1913
|
column: {
|
|
2038
1914
|
property: string;
|
|
2039
1915
|
} & RecordAny_2;
|
|
1916
|
+
columnIndex: number;
|
|
1917
|
+
$columnIndex: number;
|
|
2040
1918
|
}) => CssType) | undefined;
|
|
2041
1919
|
footerMethod?: VxeTablePropTypes<VxeTableDataRow> | undefined;
|
|
2042
1920
|
mergeFooter?: VxeTablePropTypes<VxeTableDataRow> | undefined;
|
|
@@ -2044,7 +1922,7 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
2044
1922
|
resolveTotal?: ((e: RecordAny_2) => number) | undefined;
|
|
2045
1923
|
timeout?: number | undefined;
|
|
2046
1924
|
data?: RecordAny_2 | undefined;
|
|
2047
|
-
resolvePage?: ((page
|
|
1925
|
+
resolvePage?: ((page: RecordAny_2) => any) | undefined;
|
|
2048
1926
|
resolveData?: ((data: RecordAny_2, page?: RecordAny_2 | undefined) => RecordAny_2[]) | undefined;
|
|
2049
1927
|
success?: ((data?: any) => void) | undefined;
|
|
2050
1928
|
error?: ((data?: any) => void) | undefined;
|
|
@@ -2065,8 +1943,8 @@ export declare const useOrcTable: (option: OrcTableOption) => {
|
|
|
2065
1943
|
getReserveSelection(): RecordAny_2[];
|
|
2066
1944
|
clearSelection(): void;
|
|
2067
1945
|
insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
|
|
2068
|
-
row:
|
|
2069
|
-
rows:
|
|
1946
|
+
row: RecordAny_2;
|
|
1947
|
+
rows: RecordAny_2[];
|
|
2070
1948
|
}>;
|
|
2071
1949
|
removeRows(): void;
|
|
2072
1950
|
validate(list?: RecordAny_2[] | undefined): Promise<[string, RecordAny_2[]]>;
|