cc1-form 1.2.28 → 1.2.29

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.
@@ -19,15 +19,15 @@ export declare const getFormRowUnits: (item: CurdConfigColumn) => number;
19
19
  export declare const getFormStripeBand: (cell: Pick<CurdFormGridCell, "gridRow">) => number;
20
20
  export declare const getFormDisabled: (item: CurdConfigColumn, type: DialogType, form: Record<string, any>) => any;
21
21
  export declare const getFormBind: (item: CurdConfigColumn, type: DialogType) => Partial<{
22
- on: Record<string, any>;
23
- label: string;
24
- value: any;
25
- itemFields: import("../../indexType").CurdSelectData[];
26
- inputWidth: any;
27
- inputClass: string;
28
- }> | Partial<{
29
22
  [key: string]: any;
30
23
  on: any;
24
+ data: import("../../indexType").CurdSelectData[];
25
+ dataApi: (param: any, type: "init" | "update") => import("../../indexType").CurdSelectData[] | Promise<import("../../indexType").CurdSelectData[]> | boolean;
26
+ dataApiConfig: Partial<{
27
+ once: boolean;
28
+ init: boolean;
29
+ update: boolean;
30
+ }>;
31
31
  }>;
32
32
  export declare const getFormOn: (item: CurdConfigColumn, type: DialogType, appendArgs?: any[]) => Record<string, any>;
33
33
  export declare const getFormColumnSpan: (column: CurdFormColumn, itemConfig: CurdFormColumn[] | CurdFormGridCell[], form: Record<string, any>, type: DialogType, formOption?: {
@@ -57,13 +57,14 @@ export declare const buildFormColumnEntry: (item: CurdConfigColumn & {
57
57
  export declare const appendFormColumnToRows: (rows: CurdFormColumn[][], currentRow: CurdFormColumn[], entry: CurdFormColumn, maxSpan: number) => CurdFormColumn<any>[];
58
58
  export declare const buildFormColumnRows: (columns: CurdConfigColumn[], options?: FormGridOptions) => CurdFormColumn[][];
59
59
  export declare const createFormRulesHandler: (getRequiredMessage: (item: CurdConfigColumn) => string) => (item: CurdConfigColumn, form: Record<string, any>) => any[] | undefined;
60
- export declare const createDefaultFormRulesHandler: () => (item: CurdConfigColumn, form: Record<string, any>) => any[] | undefined;
60
+ export declare const createDefaultFormRulesHandler: (formOption: StandaloneFormOption | undefined) => (item: CurdConfigColumn, form: Record<string, any>) => any[] | undefined;
61
61
  export type StandaloneFormOption = {
62
62
  maxSpan?: number;
63
63
  defaultSpan?: number;
64
64
  labelWidth?: string;
65
65
  stripe?: boolean;
66
66
  layout?: 'row' | 'column';
67
+ error?: (key: string, item: CurdConfigColumn) => string;
67
68
  };
68
69
  /** 独立表单(TColumn)初始化 */
69
70
  export declare const initStandaloneFormState: (columns: CurdConfigColumn[], formOption: StandaloneFormOption | undefined, form: Record<string, any>) => {
@@ -6,6 +6,7 @@ declare const EDialog: {
6
6
  View: any;
7
7
  Remove: any;
8
8
  };
9
+ export declare const getColumnType: (item: CurdConfigColumn) => any;
9
10
  export declare const createUpdateModule: (getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
10
11
  update: {
11
12
  title: string;
@@ -21,15 +22,15 @@ export declare const createUpdateModule: (getConf: CurdConfGetter, props: CurdPr
21
22
  formMaxSpan: number;
22
23
  getDisabled: (item: CurdConfigColumn, isTable?: boolean) => any;
23
24
  getBind: (item: CurdConfigColumn) => Partial<{
24
- on: Record<string, any>;
25
- label: string;
26
- value: any;
27
- itemFields: import("../indexType").CurdSelectData[];
28
- inputWidth: any;
29
- inputClass: string;
30
- }> | Partial<{
31
25
  [key: string]: any;
32
26
  on: any;
27
+ data: import("../indexType").CurdSelectData[];
28
+ dataApi: (param: any, type: "init" | "update") => import("../indexType").CurdSelectData[] | Promise<import("../indexType").CurdSelectData[]> | boolean;
29
+ dataApiConfig: Partial<{
30
+ once: boolean;
31
+ init: boolean;
32
+ update: boolean;
33
+ }>;
33
34
  }>;
34
35
  getOn: (item: CurdConfigColumn, row?: any) => Record<string, any>;
35
36
  getOptions: <T = any>(key: string) => {
@@ -401,7 +401,7 @@ export declare const curdConf: (props: CurdProps) => {
401
401
  row?: number | undefined;
402
402
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
403
403
  } | undefined;
404
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
404
+ type?: any;
405
405
  table?: {
406
406
  table?: boolean | undefined;
407
407
  minWidth?: any;
@@ -829,7 +829,7 @@ export declare const curdConf: (props: CurdProps) => {
829
829
  row?: number | undefined;
830
830
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
831
831
  } | undefined;
832
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
832
+ type?: any;
833
833
  table?: {
834
834
  table?: boolean | undefined;
835
835
  minWidth?: any;
@@ -881,15 +881,15 @@ export declare const curdConf: (props: CurdProps) => {
881
881
  formMaxSpan: number;
882
882
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
883
883
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
884
- on: Record<string, any>;
885
- label: string;
886
- value: any;
887
- itemFields: import("./indexType").CurdSelectData[];
888
- inputWidth: any;
889
- inputClass: string;
890
- }> | Partial<{
891
884
  [key: string]: any;
892
885
  on: any;
886
+ data: import("./indexType").CurdSelectData[];
887
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
888
+ dataApiConfig: Partial<{
889
+ once: boolean;
890
+ init: boolean;
891
+ update: boolean;
892
+ }>;
893
893
  }>;
894
894
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
895
895
  getOptions: <T = any>(key: string) => {
@@ -1303,7 +1303,7 @@ export declare const curdConf: (props: CurdProps) => {
1303
1303
  row?: number | undefined;
1304
1304
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
1305
1305
  } | undefined;
1306
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1306
+ type?: any;
1307
1307
  table?: {
1308
1308
  table?: boolean | undefined;
1309
1309
  minWidth?: any;
@@ -1765,7 +1765,7 @@ export declare const curdConf: (props: CurdProps) => {
1765
1765
  row?: number | undefined;
1766
1766
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
1767
1767
  } | undefined;
1768
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1768
+ type?: any;
1769
1769
  table?: {
1770
1770
  table?: boolean | undefined;
1771
1771
  minWidth?: any;
@@ -2245,7 +2245,7 @@ export declare const curdConf: (props: CurdProps) => {
2245
2245
  row?: number | undefined;
2246
2246
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
2247
2247
  } | undefined;
2248
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2248
+ type?: any;
2249
2249
  table?: {
2250
2250
  table?: boolean | undefined;
2251
2251
  minWidth?: any;
@@ -2349,6 +2349,7 @@ export declare const curdConf: (props: CurdProps) => {
2349
2349
  closeBefore?: ((data: any) => any) | undefined;
2350
2350
  submitBefore?: ((form: any, update: curdConfType["conf"]["update"]) => any) | undefined;
2351
2351
  submitAfter?: ((form: any, update: curdConfType["conf"]["update"]) => any) | undefined;
2352
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
2352
2353
  } | undefined;
2353
2354
  column: {
2354
2355
  key: string;
@@ -2723,7 +2724,7 @@ export declare const curdConf: (props: CurdProps) => {
2723
2724
  row?: number | undefined;
2724
2725
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
2725
2726
  } | undefined;
2726
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2727
+ type?: any;
2727
2728
  table?: {
2728
2729
  table?: boolean | undefined;
2729
2730
  minWidth?: any;
@@ -417,7 +417,7 @@ declare const conf: {
417
417
  row?: number | undefined;
418
418
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
419
419
  } | undefined;
420
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
420
+ type?: any;
421
421
  table?: {
422
422
  table?: boolean | undefined;
423
423
  minWidth?: any;
@@ -845,7 +845,7 @@ declare const conf: {
845
845
  row?: number | undefined;
846
846
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
847
847
  } | undefined;
848
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
848
+ type?: any;
849
849
  table?: {
850
850
  table?: boolean | undefined;
851
851
  minWidth?: any;
@@ -897,15 +897,15 @@ declare const conf: {
897
897
  formMaxSpan: number;
898
898
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
899
899
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
900
- on: Record<string, any>;
901
- label: string;
902
- value: any;
903
- itemFields: import("./indexType").CurdSelectData[];
904
- inputWidth: any;
905
- inputClass: string;
906
- }> | Partial<{
907
900
  [key: string]: any;
908
901
  on: any;
902
+ data: import("./indexType").CurdSelectData[];
903
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
904
+ dataApiConfig: Partial<{
905
+ once: boolean;
906
+ init: boolean;
907
+ update: boolean;
908
+ }>;
909
909
  }>;
910
910
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
911
911
  getOptions: <T = any>(key: string) => {
@@ -1319,7 +1319,7 @@ declare const conf: {
1319
1319
  row?: number | undefined;
1320
1320
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
1321
1321
  } | undefined;
1322
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1322
+ type?: any;
1323
1323
  table?: {
1324
1324
  table?: boolean | undefined;
1325
1325
  minWidth?: any;
@@ -1781,7 +1781,7 @@ declare const conf: {
1781
1781
  row?: number | undefined;
1782
1782
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
1783
1783
  } | undefined;
1784
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1784
+ type?: any;
1785
1785
  table?: {
1786
1786
  table?: boolean | undefined;
1787
1787
  minWidth?: any;
@@ -2261,7 +2261,7 @@ declare const conf: {
2261
2261
  row?: number | undefined;
2262
2262
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
2263
2263
  } | undefined;
2264
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2264
+ type?: any;
2265
2265
  table?: {
2266
2266
  table?: boolean | undefined;
2267
2267
  minWidth?: any;
@@ -2365,6 +2365,7 @@ declare const conf: {
2365
2365
  closeBefore?: ((data: any) => any) | undefined;
2366
2366
  submitBefore?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
2367
2367
  submitAfter?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
2368
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
2368
2369
  } | undefined;
2369
2370
  column: {
2370
2371
  key: string;
@@ -2739,7 +2740,7 @@ declare const conf: {
2739
2740
  row?: number | undefined;
2740
2741
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
2741
2742
  } | undefined;
2742
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2743
+ type?: any;
2743
2744
  table?: {
2744
2745
  table?: boolean | undefined;
2745
2746
  minWidth?: any;
@@ -3209,7 +3210,7 @@ declare var __VLS_1: {}, __VLS_7: {
3209
3210
  row?: number | undefined;
3210
3211
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
3211
3212
  } | undefined;
3212
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
3213
+ type?: any;
3213
3214
  table?: {
3214
3215
  table?: boolean | undefined;
3215
3216
  minWidth?: any;
@@ -3637,7 +3638,7 @@ declare var __VLS_1: {}, __VLS_7: {
3637
3638
  row?: number | undefined;
3638
3639
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
3639
3640
  } | undefined;
3640
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
3641
+ type?: any;
3641
3642
  table?: {
3642
3643
  table?: boolean | undefined;
3643
3644
  minWidth?: any;
@@ -3689,15 +3690,15 @@ declare var __VLS_1: {}, __VLS_7: {
3689
3690
  formMaxSpan: number;
3690
3691
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
3691
3692
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
3692
- on: Record<string, any>;
3693
- label: string;
3694
- value: any;
3695
- itemFields: import("./indexType").CurdSelectData[];
3696
- inputWidth: any;
3697
- inputClass: string;
3698
- }> | Partial<{
3699
3693
  [key: string]: any;
3700
3694
  on: any;
3695
+ data: import("./indexType").CurdSelectData[];
3696
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
3697
+ dataApiConfig: Partial<{
3698
+ once: boolean;
3699
+ init: boolean;
3700
+ update: boolean;
3701
+ }>;
3701
3702
  }>;
3702
3703
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
3703
3704
  getOptions: <T = any>(key: string) => {
@@ -4102,7 +4103,7 @@ declare var __VLS_1: {}, __VLS_7: {
4102
4103
  row?: number | undefined;
4103
4104
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4104
4105
  } | undefined;
4105
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4106
+ type?: any;
4106
4107
  table?: {
4107
4108
  table?: boolean | undefined;
4108
4109
  minWidth?: any;
@@ -4530,7 +4531,7 @@ declare var __VLS_1: {}, __VLS_7: {
4530
4531
  row?: number | undefined;
4531
4532
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4532
4533
  } | undefined;
4533
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4534
+ type?: any;
4534
4535
  table?: {
4535
4536
  table?: boolean | undefined;
4536
4537
  minWidth?: any;
@@ -4582,15 +4583,15 @@ declare var __VLS_1: {}, __VLS_7: {
4582
4583
  formMaxSpan: number;
4583
4584
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
4584
4585
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
4585
- on: Record<string, any>;
4586
- label: string;
4587
- value: any;
4588
- itemFields: import("./indexType").CurdSelectData[];
4589
- inputWidth: any;
4590
- inputClass: string;
4591
- }> | Partial<{
4592
4586
  [key: string]: any;
4593
4587
  on: any;
4588
+ data: import("./indexType").CurdSelectData[];
4589
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
4590
+ dataApiConfig: Partial<{
4591
+ once: boolean;
4592
+ init: boolean;
4593
+ update: boolean;
4594
+ }>;
4594
4595
  }>;
4595
4596
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
4596
4597
  getOptions: <T = any>(key: string) => {
@@ -4992,7 +4993,7 @@ declare var __VLS_1: {}, __VLS_7: {
4992
4993
  row?: number | undefined;
4993
4994
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4994
4995
  } | undefined;
4995
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4996
+ type?: any;
4996
4997
  table?: {
4997
4998
  table?: boolean | undefined;
4998
4999
  minWidth?: any;
@@ -5420,7 +5421,7 @@ declare var __VLS_1: {}, __VLS_7: {
5420
5421
  row?: number | undefined;
5421
5422
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
5422
5423
  } | undefined;
5423
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
5424
+ type?: any;
5424
5425
  table?: {
5425
5426
  table?: boolean | undefined;
5426
5427
  minWidth?: any;
@@ -5472,15 +5473,15 @@ declare var __VLS_1: {}, __VLS_7: {
5472
5473
  formMaxSpan: number;
5473
5474
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
5474
5475
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
5475
- on: Record<string, any>;
5476
- label: string;
5477
- value: any;
5478
- itemFields: import("./indexType").CurdSelectData[];
5479
- inputWidth: any;
5480
- inputClass: string;
5481
- }> | Partial<{
5482
5476
  [key: string]: any;
5483
5477
  on: any;
5478
+ data: import("./indexType").CurdSelectData[];
5479
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
5480
+ dataApiConfig: Partial<{
5481
+ once: boolean;
5482
+ init: boolean;
5483
+ update: boolean;
5484
+ }>;
5484
5485
  }>;
5485
5486
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
5486
5487
  getOptions: <T = any>(key: string) => {
@@ -6031,7 +6032,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6031
6032
  row?: number | undefined;
6032
6033
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6033
6034
  } | undefined;
6034
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6035
+ type?: any;
6035
6036
  table?: {
6036
6037
  table?: boolean | undefined;
6037
6038
  minWidth?: any;
@@ -6459,7 +6460,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6459
6460
  row?: number | undefined;
6460
6461
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6461
6462
  } | undefined;
6462
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6463
+ type?: any;
6463
6464
  table?: {
6464
6465
  table?: boolean | undefined;
6465
6466
  minWidth?: any;
@@ -6511,15 +6512,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6511
6512
  formMaxSpan: number;
6512
6513
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
6513
6514
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
6514
- on: Record<string, any>;
6515
- label: string;
6516
- value: any;
6517
- itemFields: import("./indexType").CurdSelectData[];
6518
- inputWidth: any;
6519
- inputClass: string;
6520
- }> | Partial<{
6521
6515
  [key: string]: any;
6522
6516
  on: any;
6517
+ data: import("./indexType").CurdSelectData[];
6518
+ dataApi: (param: any, type: "init" | "update") => import("./indexType").CurdSelectData[] | Promise<import("./indexType").CurdSelectData[]> | boolean;
6519
+ dataApiConfig: Partial<{
6520
+ once: boolean;
6521
+ init: boolean;
6522
+ update: boolean;
6523
+ }>;
6523
6524
  }>;
6524
6525
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
6525
6526
  getOptions: <T = any>(key: string) => {
@@ -6933,7 +6934,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6933
6934
  row?: number | undefined;
6934
6935
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6935
6936
  } | undefined;
6936
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6937
+ type?: any;
6937
6938
  table?: {
6938
6939
  table?: boolean | undefined;
6939
6940
  minWidth?: any;
@@ -7395,7 +7396,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7395
7396
  row?: number | undefined;
7396
7397
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
7397
7398
  } | undefined;
7398
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
7399
+ type?: any;
7399
7400
  table?: {
7400
7401
  table?: boolean | undefined;
7401
7402
  minWidth?: any;
@@ -7875,7 +7876,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7875
7876
  row?: number | undefined;
7876
7877
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
7877
7878
  } | undefined;
7878
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
7879
+ type?: any;
7879
7880
  table?: {
7880
7881
  table?: boolean | undefined;
7881
7882
  minWidth?: any;
@@ -7979,6 +7980,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7979
7980
  closeBefore?: ((data: any) => any) | undefined;
7980
7981
  submitBefore?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
7981
7982
  submitAfter?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
7983
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
7982
7984
  } | undefined;
7983
7985
  column: {
7984
7986
  key: string;
@@ -8353,7 +8355,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
8353
8355
  row?: number | undefined;
8354
8356
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
8355
8357
  } | undefined;
8356
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
8358
+ type?: any;
8357
8359
  table?: {
8358
8360
  table?: boolean | undefined;
8359
8361
  minWidth?: any;
@@ -368,6 +368,13 @@ export interface CurdConfig<T = any> {
368
368
  * 提交后执行处理
369
369
  */
370
370
  submitAfter?: (form: T, update: curdConfType['conf']['update']) => any;
371
+ /**
372
+ * 错误提示
373
+ * @param key 字段名
374
+ * @param item 字段配置
375
+ * @returns 错误提示
376
+ */
377
+ error?: (key: string, item: CurdConfigColumn) => string;
371
378
  }>;
372
379
  /**
373
380
  * 表格列和新增编辑表单字段
@@ -523,7 +530,6 @@ export interface CurdConfigColumn<T = any> {
523
530
  * - `datetime` — 日期时间选择器 (ElDatePicker),通过 `options.datetime` 配置,提交时自动转为时间戳
524
531
  * - `number` — 数字输入
525
532
  * - `color` — 颜色选择
526
- * - `icon` — 图标选择
527
533
  * - `slider` — 滑块
528
534
  * - `upload` — 文件上传
529
535
  * - `editor` — 富文本编辑器
@@ -545,7 +551,7 @@ export interface CurdConfigColumn<T = any> {
545
551
  * options: { 'my-upload': { accept: 'image/*', limit: 1 } } }
546
552
  * ```
547
553
  */
548
- type?: 'input' | 'select' | 'switch' | 'radio' | 'checkbox' | 'date' | 'time' | 'datetime' | 'number' | 'color' | 'icon' | 'slider' | 'upload' | 'editor' | 'tree' | 'treeSelect' | 'list';
554
+ type?: any;
549
555
  /**
550
556
  * 表格配置
551
557
  */
@@ -1,3 +1,4 @@
1
+ import type { CurdConfigColumn } from '..';
1
2
  /**
2
3
  * 表单工具类,提供自定义组件注册、选项数据动态更新等辅助方法
3
4
  *
@@ -23,6 +24,18 @@ export default class TForm {
23
24
  static customComponent: {
24
25
  [key: string]: any;
25
26
  };
27
+ /**
28
+ * 错误提示
29
+ */
30
+ static error: Partial<{
31
+ /**
32
+ * 全局异常提示回调,如果返回空字符串,则不进行提示
33
+ * @param key 字段名
34
+ * @param item 字段配置
35
+ * @returns 错误提示
36
+ */
37
+ callback: (key: string, item: CurdConfigColumn) => string;
38
+ }>;
26
39
  /**
27
40
  * 根据字段名查找对应 column 的 options 配置对象
28
41
  *
@@ -32,21 +45,21 @@ export default class TForm {
32
45
  */
33
46
  static findOptions: (option: any, field: string) => any;
34
47
  /**
35
- * 更新组件数据
36
- * @param option
37
- * @param field
38
- * @param data
39
- *
40
- * @example
41
- * TForm.setOptionsData(
42
- conf.option,
43
- 'url',
44
- list.map(item => ({
45
- label: item.path,
46
- value: item.path,
47
- }))
48
- )
49
- */
48
+ * 更新组件数据
49
+ * @param option
50
+ * @param field
51
+ * @param data
52
+ *
53
+ * @example
54
+ * TForm.setOptionsData(
55
+ conf.option,
56
+ 'url',
57
+ list.map(item => ({
58
+ label: item.path,
59
+ value: item.path,
60
+ }))
61
+ )
62
+ */
50
63
  static setOptionsData: (option: any, field: string, data: any) => void;
51
64
  static form: {
52
65
  openBefore: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",