cc1-form 1.2.27 → 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.
@@ -1,5 +1,5 @@
1
1
  import FormField from './field.vue';
2
- import { getFormGridShowFlags, getFormStripeBand } from './shared';
2
+ import { getFormGridShowFlags } from './shared';
3
3
  import type { CurdConfigColumn, CurdFormGridCell } from '../../indexType';
4
4
  declare const isFun: (fun: any, ...args: any[]) => any;
5
5
  type __VLS_Props = {
@@ -24,6 +24,7 @@ declare const gridStyle: import("vue").ComputedRef<{
24
24
  declare const isLastGridRow: (cell: CurdFormGridCell) => boolean;
25
25
  /** 跨整行带高度(form.row >= 12),需撑满网格格以便标签分隔线与左侧两行等高 */
26
26
  declare const isRowSpanCell: (cell: CurdFormGridCell) => boolean;
27
+ declare const getVisibleStripeBand: (cell: CurdFormGridCell) => number;
27
28
  declare const getCellGridStyle: (cell: CurdFormGridCell) => {
28
29
  gridRow: string;
29
30
  gridColumn: string;
@@ -47,12 +48,12 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
47
48
  declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
48
49
  FormField: typeof FormField;
49
50
  getFormGridShowFlags: typeof getFormGridShowFlags;
50
- getFormStripeBand: typeof getFormStripeBand;
51
51
  isFun: typeof isFun;
52
52
  visibleCells: typeof visibleCells;
53
53
  gridStyle: typeof gridStyle;
54
54
  isLastGridRow: typeof isLastGridRow;
55
55
  isRowSpanCell: typeof isRowSpanCell;
56
+ getVisibleStripeBand: typeof getVisibleStripeBand;
56
57
  getCellGridStyle: typeof getCellGridStyle;
57
58
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
59
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -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) => {
@@ -41,9 +42,10 @@ export declare const createUpdateModule: (getConf: CurdConfGetter, props: CurdPr
41
42
  getApiData: (form: any) => any;
42
43
  };
43
44
  view: {};
44
- open: (type: keyof typeof EDialog, item?: any) => void;
45
+ openLoading: boolean;
46
+ open: (type: keyof typeof EDialog, item?: any) => Promise<void>;
45
47
  validate: () => Promise<true | undefined>;
46
- submit: () => void;
48
+ submit: () => Promise<void>;
47
49
  close: () => void;
48
50
  };
49
51
  };
@@ -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) => {
@@ -901,9 +901,10 @@ export declare const curdConf: (props: CurdProps) => {
901
901
  getApiData: (form: any) => any;
902
902
  };
903
903
  view: {};
904
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
904
+ openLoading: boolean;
905
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
905
906
  validate: () => Promise<true | undefined>;
906
- submit: () => void;
907
+ submit: () => Promise<void>;
907
908
  close: () => void;
908
909
  };
909
910
  export: {
@@ -1302,7 +1303,7 @@ export declare const curdConf: (props: CurdProps) => {
1302
1303
  row?: number | undefined;
1303
1304
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
1304
1305
  } | undefined;
1305
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1306
+ type?: any;
1306
1307
  table?: {
1307
1308
  table?: boolean | undefined;
1308
1309
  minWidth?: any;
@@ -1764,7 +1765,7 @@ export declare const curdConf: (props: CurdProps) => {
1764
1765
  row?: number | undefined;
1765
1766
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
1766
1767
  } | undefined;
1767
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1768
+ type?: any;
1768
1769
  table?: {
1769
1770
  table?: boolean | undefined;
1770
1771
  minWidth?: any;
@@ -2244,7 +2245,7 @@ export declare const curdConf: (props: CurdProps) => {
2244
2245
  row?: number | undefined;
2245
2246
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
2246
2247
  } | undefined;
2247
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2248
+ type?: any;
2248
2249
  table?: {
2249
2250
  table?: boolean | undefined;
2250
2251
  minWidth?: any;
@@ -2348,6 +2349,7 @@ export declare const curdConf: (props: CurdProps) => {
2348
2349
  closeBefore?: ((data: any) => any) | undefined;
2349
2350
  submitBefore?: ((form: any, update: curdConfType["conf"]["update"]) => any) | undefined;
2350
2351
  submitAfter?: ((form: any, update: curdConfType["conf"]["update"]) => any) | undefined;
2352
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
2351
2353
  } | undefined;
2352
2354
  column: {
2353
2355
  key: string;
@@ -2722,7 +2724,7 @@ export declare const curdConf: (props: CurdProps) => {
2722
2724
  row?: number | undefined;
2723
2725
  tipText?: string | ((row: any, type: "Add" | "Update" | "View" | "Remove") => string) | undefined;
2724
2726
  } | undefined;
2725
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2727
+ type?: any;
2726
2728
  table?: {
2727
2729
  table?: boolean | undefined;
2728
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) => {
@@ -917,9 +917,10 @@ declare const conf: {
917
917
  getApiData: (form: any) => any;
918
918
  };
919
919
  view: {};
920
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
920
+ openLoading: boolean;
921
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
921
922
  validate: () => Promise<true | undefined>;
922
- submit: () => void;
923
+ submit: () => Promise<void>;
923
924
  close: () => void;
924
925
  };
925
926
  export: {
@@ -1318,7 +1319,7 @@ declare const conf: {
1318
1319
  row?: number | undefined;
1319
1320
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
1320
1321
  } | undefined;
1321
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1322
+ type?: any;
1322
1323
  table?: {
1323
1324
  table?: boolean | undefined;
1324
1325
  minWidth?: any;
@@ -1780,7 +1781,7 @@ declare const conf: {
1780
1781
  row?: number | undefined;
1781
1782
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
1782
1783
  } | undefined;
1783
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
1784
+ type?: any;
1784
1785
  table?: {
1785
1786
  table?: boolean | undefined;
1786
1787
  minWidth?: any;
@@ -2260,7 +2261,7 @@ declare const conf: {
2260
2261
  row?: number | undefined;
2261
2262
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
2262
2263
  } | undefined;
2263
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2264
+ type?: any;
2264
2265
  table?: {
2265
2266
  table?: boolean | undefined;
2266
2267
  minWidth?: any;
@@ -2364,6 +2365,7 @@ declare const conf: {
2364
2365
  closeBefore?: ((data: any) => any) | undefined;
2365
2366
  submitBefore?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
2366
2367
  submitAfter?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
2368
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
2367
2369
  } | undefined;
2368
2370
  column: {
2369
2371
  key: string;
@@ -2738,7 +2740,7 @@ declare const conf: {
2738
2740
  row?: number | undefined;
2739
2741
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
2740
2742
  } | undefined;
2741
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
2743
+ type?: any;
2742
2744
  table?: {
2743
2745
  table?: boolean | undefined;
2744
2746
  minWidth?: any;
@@ -3208,7 +3210,7 @@ declare var __VLS_1: {}, __VLS_7: {
3208
3210
  row?: number | undefined;
3209
3211
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
3210
3212
  } | undefined;
3211
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
3213
+ type?: any;
3212
3214
  table?: {
3213
3215
  table?: boolean | undefined;
3214
3216
  minWidth?: any;
@@ -3636,7 +3638,7 @@ declare var __VLS_1: {}, __VLS_7: {
3636
3638
  row?: number | undefined;
3637
3639
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
3638
3640
  } | undefined;
3639
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
3641
+ type?: any;
3640
3642
  table?: {
3641
3643
  table?: boolean | undefined;
3642
3644
  minWidth?: any;
@@ -3688,15 +3690,15 @@ declare var __VLS_1: {}, __VLS_7: {
3688
3690
  formMaxSpan: number;
3689
3691
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
3690
3692
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
3691
- on: Record<string, any>;
3692
- label: string;
3693
- value: any;
3694
- itemFields: import("./indexType").CurdSelectData[];
3695
- inputWidth: any;
3696
- inputClass: string;
3697
- }> | Partial<{
3698
3693
  [key: string]: any;
3699
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
+ }>;
3700
3702
  }>;
3701
3703
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
3702
3704
  getOptions: <T = any>(key: string) => {
@@ -3708,9 +3710,10 @@ declare var __VLS_1: {}, __VLS_7: {
3708
3710
  getApiData: (form: any) => any;
3709
3711
  };
3710
3712
  view: {};
3711
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
3713
+ openLoading: boolean;
3714
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
3712
3715
  validate: () => Promise<true | undefined>;
3713
- submit: () => void;
3716
+ submit: () => Promise<void>;
3714
3717
  close: () => void;
3715
3718
  };
3716
3719
  }, __VLS_267: string | number, __VLS_268: {
@@ -4100,7 +4103,7 @@ declare var __VLS_1: {}, __VLS_7: {
4100
4103
  row?: number | undefined;
4101
4104
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4102
4105
  } | undefined;
4103
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4106
+ type?: any;
4104
4107
  table?: {
4105
4108
  table?: boolean | undefined;
4106
4109
  minWidth?: any;
@@ -4528,7 +4531,7 @@ declare var __VLS_1: {}, __VLS_7: {
4528
4531
  row?: number | undefined;
4529
4532
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4530
4533
  } | undefined;
4531
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4534
+ type?: any;
4532
4535
  table?: {
4533
4536
  table?: boolean | undefined;
4534
4537
  minWidth?: any;
@@ -4580,15 +4583,15 @@ declare var __VLS_1: {}, __VLS_7: {
4580
4583
  formMaxSpan: number;
4581
4584
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
4582
4585
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
4583
- on: Record<string, any>;
4584
- label: string;
4585
- value: any;
4586
- itemFields: import("./indexType").CurdSelectData[];
4587
- inputWidth: any;
4588
- inputClass: string;
4589
- }> | Partial<{
4590
4586
  [key: string]: any;
4591
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
+ }>;
4592
4595
  }>;
4593
4596
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
4594
4597
  getOptions: <T = any>(key: string) => {
@@ -4600,9 +4603,10 @@ declare var __VLS_1: {}, __VLS_7: {
4600
4603
  getApiData: (form: any) => any;
4601
4604
  };
4602
4605
  view: {};
4603
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
4606
+ openLoading: boolean;
4607
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
4604
4608
  validate: () => Promise<true | undefined>;
4605
- submit: () => void;
4609
+ submit: () => Promise<void>;
4606
4610
  close: () => void;
4607
4611
  };
4608
4612
  }, __VLS_276: {
@@ -4989,7 +4993,7 @@ declare var __VLS_1: {}, __VLS_7: {
4989
4993
  row?: number | undefined;
4990
4994
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
4991
4995
  } | undefined;
4992
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
4996
+ type?: any;
4993
4997
  table?: {
4994
4998
  table?: boolean | undefined;
4995
4999
  minWidth?: any;
@@ -5417,7 +5421,7 @@ declare var __VLS_1: {}, __VLS_7: {
5417
5421
  row?: number | undefined;
5418
5422
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
5419
5423
  } | undefined;
5420
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
5424
+ type?: any;
5421
5425
  table?: {
5422
5426
  table?: boolean | undefined;
5423
5427
  minWidth?: any;
@@ -5469,15 +5473,15 @@ declare var __VLS_1: {}, __VLS_7: {
5469
5473
  formMaxSpan: number;
5470
5474
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
5471
5475
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
5472
- on: Record<string, any>;
5473
- label: string;
5474
- value: any;
5475
- itemFields: import("./indexType").CurdSelectData[];
5476
- inputWidth: any;
5477
- inputClass: string;
5478
- }> | Partial<{
5479
5476
  [key: string]: any;
5480
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
+ }>;
5481
5485
  }>;
5482
5486
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
5483
5487
  getOptions: <T = any>(key: string) => {
@@ -5489,9 +5493,10 @@ declare var __VLS_1: {}, __VLS_7: {
5489
5493
  getApiData: (form: any) => any;
5490
5494
  };
5491
5495
  view: {};
5492
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
5496
+ openLoading: boolean;
5497
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
5493
5498
  validate: () => Promise<true | undefined>;
5494
- submit: () => void;
5499
+ submit: () => Promise<void>;
5495
5500
  close: () => void;
5496
5501
  };
5497
5502
  };
@@ -6027,7 +6032,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6027
6032
  row?: number | undefined;
6028
6033
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6029
6034
  } | undefined;
6030
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6035
+ type?: any;
6031
6036
  table?: {
6032
6037
  table?: boolean | undefined;
6033
6038
  minWidth?: any;
@@ -6455,7 +6460,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6455
6460
  row?: number | undefined;
6456
6461
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6457
6462
  } | undefined;
6458
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6463
+ type?: any;
6459
6464
  table?: {
6460
6465
  table?: boolean | undefined;
6461
6466
  minWidth?: any;
@@ -6507,15 +6512,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6507
6512
  formMaxSpan: number;
6508
6513
  getDisabled: (item: import("./indexType").CurdConfigColumn, isTable?: boolean) => any;
6509
6514
  getBind: (item: import("./indexType").CurdConfigColumn) => Partial<{
6510
- on: Record<string, any>;
6511
- label: string;
6512
- value: any;
6513
- itemFields: import("./indexType").CurdSelectData[];
6514
- inputWidth: any;
6515
- inputClass: string;
6516
- }> | Partial<{
6517
6515
  [key: string]: any;
6518
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
+ }>;
6519
6524
  }>;
6520
6525
  getOn: (item: import("./indexType").CurdConfigColumn, row?: any) => Record<string, any>;
6521
6526
  getOptions: <T = any>(key: string) => {
@@ -6527,9 +6532,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6527
6532
  getApiData: (form: any) => any;
6528
6533
  };
6529
6534
  view: {};
6530
- open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => void;
6535
+ openLoading: boolean;
6536
+ open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
6531
6537
  validate: () => Promise<true | undefined>;
6532
- submit: () => void;
6538
+ submit: () => Promise<void>;
6533
6539
  close: () => void;
6534
6540
  };
6535
6541
  export: {
@@ -6928,7 +6934,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
6928
6934
  row?: number | undefined;
6929
6935
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
6930
6936
  } | undefined;
6931
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
6937
+ type?: any;
6932
6938
  table?: {
6933
6939
  table?: boolean | undefined;
6934
6940
  minWidth?: any;
@@ -7390,7 +7396,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7390
7396
  row?: number | undefined;
7391
7397
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
7392
7398
  } | undefined;
7393
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
7399
+ type?: any;
7394
7400
  table?: {
7395
7401
  table?: boolean | undefined;
7396
7402
  minWidth?: any;
@@ -7870,7 +7876,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7870
7876
  row?: number | undefined;
7871
7877
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
7872
7878
  } | undefined;
7873
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
7879
+ type?: any;
7874
7880
  table?: {
7875
7881
  table?: boolean | undefined;
7876
7882
  minWidth?: any;
@@ -7974,6 +7980,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7974
7980
  closeBefore?: ((data: any) => any) | undefined;
7975
7981
  submitBefore?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
7976
7982
  submitAfter?: ((form: any, update: import(".").curdConfType["conf"]["update"]) => any) | undefined;
7983
+ error?: ((key: string, item: import("./indexType").CurdConfigColumn) => string) | undefined;
7977
7984
  } | undefined;
7978
7985
  column: {
7979
7986
  key: string;
@@ -8348,7 +8355,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
8348
8355
  row?: number | undefined;
8349
8356
  tipText?: string | ((row: any, type: keyof typeof TSys.EDialog) => string) | undefined;
8350
8357
  } | undefined;
8351
- type?: "input" | "select" | "switch" | "radio" | "checkbox" | "date" | "time" | "datetime" | "number" | "color" | "icon" | "slider" | "upload" | "editor" | "tree" | "treeSelect" | "list" | undefined;
8358
+ type?: any;
8352
8359
  table?: {
8353
8360
  table?: boolean | undefined;
8354
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
  */
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import TFormConfig from './utils/TFormConfig';
12
12
  import TFormI18n from './utils/TFormI18n';
13
13
  import TSys from './utils/TSys';
14
14
  import TFile from './utils/TFile';
15
+ import TObj from './utils/TObj';
15
16
  /**
16
17
  * 安装 cc1-form 插件,注册全局组件 `TCurd`、`TFormList`、`TColumn`
17
18
  *
@@ -46,7 +47,7 @@ export declare const install: (app: App, options?: {
46
47
  [key: string]: any;
47
48
  };
48
49
  }) => void;
49
- export { ArrUtil, ExcelUtil, TColumn, TCurd, TForm, TFormList, TFormI18n, TSys, TFile, TFormConfig, type CurdConfig, type CurdConfigColumn, type CurdOption, type curdConfType };
50
+ export { ArrUtil, ExcelUtil, TColumn, TCurd, TForm, TFormList, TFormI18n, TSys, TFile, TFormConfig, type CurdConfig, type CurdConfigColumn, type CurdOption, type curdConfType, TObj };
50
51
  declare const _default: {
51
52
  install: (app: App, options?: {
52
53
  /**