cc1-form 1.2.24 → 1.2.25
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/dist/cc1-form.css +1 -1
- package/dist/cc1-form.js +1752 -1784
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +837 -2123
- package/dist/components/TCurd/com/form/field.vue.d.ts +62 -0
- package/dist/components/TCurd/com/form/layout.vue.d.ts +65 -0
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/com/form/shared.d.ts +77 -0
- package/dist/components/TCurd/core/boundForm.d.ts +13 -0
- package/dist/components/TCurd/core/export.d.ts +13 -0
- package/dist/components/TCurd/core/formRef.d.ts +7 -0
- package/dist/components/TCurd/core/init.d.ts +11 -0
- package/dist/components/TCurd/core/page.d.ts +16 -0
- package/dist/components/TCurd/core/remove.d.ts +12 -0
- package/dist/components/TCurd/core/search.d.ts +15 -0
- package/dist/components/TCurd/core/table.d.ts +45 -0
- package/dist/components/TCurd/core/types.d.ts +14 -0
- package/dist/components/TCurd/core/update.d.ts +49 -0
- package/dist/components/TCurd/index.d.ts +3 -2348
- package/dist/components/TCurd/index.vue.d.ts +28 -5120
- package/dist/components/TCurd/indexType.d.ts +23 -1
- package/package.json +3 -3
- package/dist/components/TCurd/formColumn.vue.d.ts +0 -2142
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import TForm from '../../../../utils/TForm';
|
|
2
|
+
import FormList from './list.vue';
|
|
3
|
+
import { ElDatePicker, ElFormItem, ElInput, ElOption, ElRadio, ElRadioGroup, ElSelect, ElSwitch, ElTreeSelect } from 'element-plus';
|
|
4
|
+
import type { CurdConfigColumn } from '../../indexType';
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
item: CurdConfigColumn;
|
|
7
|
+
form: Record<string, any>;
|
|
8
|
+
type: any;
|
|
9
|
+
labelWidth?: string;
|
|
10
|
+
getBind: (item: CurdConfigColumn) => any;
|
|
11
|
+
getOn: (item: CurdConfigColumn) => any;
|
|
12
|
+
getDisabled: (item: CurdConfigColumn) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
15
|
+
declare var __VLS_7: string, __VLS_8: {
|
|
16
|
+
row: Record<string, any>;
|
|
17
|
+
item: CurdConfigColumn<any>;
|
|
18
|
+
}, __VLS_11: string, __VLS_12: {
|
|
19
|
+
row: Record<string, any>;
|
|
20
|
+
item: CurdConfigColumn<any>;
|
|
21
|
+
}, __VLS_54: string, __VLS_55: {
|
|
22
|
+
row: Record<string, any>;
|
|
23
|
+
item: CurdConfigColumn<any>;
|
|
24
|
+
}, __VLS_58: string, __VLS_59: {
|
|
25
|
+
row: Record<string, any>;
|
|
26
|
+
item: CurdConfigColumn<any>;
|
|
27
|
+
}, __VLS_62: string, __VLS_63: {
|
|
28
|
+
row: Record<string, any>;
|
|
29
|
+
item: CurdConfigColumn<any>;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
32
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
33
|
+
} & {
|
|
34
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
35
|
+
} & {
|
|
36
|
+
[K in NonNullable<typeof __VLS_54>]?: (props: typeof __VLS_55) => any;
|
|
37
|
+
} & {
|
|
38
|
+
[K in NonNullable<typeof __VLS_58>]?: (props: typeof __VLS_59) => any;
|
|
39
|
+
} & {
|
|
40
|
+
[K in NonNullable<typeof __VLS_62>]?: (props: typeof __VLS_63) => any;
|
|
41
|
+
}>;
|
|
42
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
43
|
+
TForm: typeof TForm;
|
|
44
|
+
FormList: typeof FormList;
|
|
45
|
+
ElDatePicker: typeof ElDatePicker;
|
|
46
|
+
ElFormItem: typeof ElFormItem;
|
|
47
|
+
ElInput: typeof ElInput;
|
|
48
|
+
ElOption: typeof ElOption;
|
|
49
|
+
ElRadio: typeof ElRadio;
|
|
50
|
+
ElRadioGroup: typeof ElRadioGroup;
|
|
51
|
+
ElSelect: typeof ElSelect;
|
|
52
|
+
ElSwitch: typeof ElSwitch;
|
|
53
|
+
ElTreeSelect: typeof ElTreeSelect;
|
|
54
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
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>;
|
|
56
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import FormField from './field.vue';
|
|
2
|
+
import { getFormGridShowFlags, getFormStripeBand } from './shared';
|
|
3
|
+
import type { CurdConfigColumn, CurdFormGridCell } from '../../indexType';
|
|
4
|
+
declare const isFun: (fun: any, ...args: any[]) => any;
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
formGrid: CurdFormGridCell[];
|
|
7
|
+
maxSpan: number;
|
|
8
|
+
form: Record<string, any>;
|
|
9
|
+
type: any;
|
|
10
|
+
stripe?: boolean;
|
|
11
|
+
labelWidth?: string;
|
|
12
|
+
formOption?: {
|
|
13
|
+
maxSpan?: number;
|
|
14
|
+
defaultSpan?: number;
|
|
15
|
+
};
|
|
16
|
+
getBind: (item: CurdConfigColumn) => any;
|
|
17
|
+
getOn: (item: CurdConfigColumn) => any;
|
|
18
|
+
getDisabled: (item: CurdConfigColumn) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const visibleCells: import("vue").ComputedRef<CurdFormGridCell<any>[]>;
|
|
21
|
+
declare const gridStyle: import("vue").ComputedRef<{
|
|
22
|
+
gridTemplateColumns: string;
|
|
23
|
+
}>;
|
|
24
|
+
declare const isLastGridRow: (cell: CurdFormGridCell) => boolean;
|
|
25
|
+
/** 跨整行带高度(form.row >= 12),需撑满网格格以便标签分隔线与左侧两行等高 */
|
|
26
|
+
declare const isRowSpanCell: (cell: CurdFormGridCell) => boolean;
|
|
27
|
+
declare const getCellGridStyle: (cell: CurdFormGridCell) => {
|
|
28
|
+
gridRow: string;
|
|
29
|
+
gridColumn: string;
|
|
30
|
+
};
|
|
31
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
32
|
+
declare var __VLS_1: {
|
|
33
|
+
row: Record<string, any>;
|
|
34
|
+
}, __VLS_7: string | number, __VLS_8: {
|
|
35
|
+
row: Record<string, any>;
|
|
36
|
+
item: CurdConfigColumn<any>;
|
|
37
|
+
}, __VLS_10: {
|
|
38
|
+
row: Record<string, any>;
|
|
39
|
+
};
|
|
40
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
41
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
42
|
+
} & {
|
|
43
|
+
'form-start'?: (props: typeof __VLS_1) => any;
|
|
44
|
+
} & {
|
|
45
|
+
'form-end'?: (props: typeof __VLS_10) => any;
|
|
46
|
+
}>;
|
|
47
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
48
|
+
FormField: typeof FormField;
|
|
49
|
+
getFormGridShowFlags: typeof getFormGridShowFlags;
|
|
50
|
+
getFormStripeBand: typeof getFormStripeBand;
|
|
51
|
+
isFun: typeof isFun;
|
|
52
|
+
visibleCells: typeof visibleCells;
|
|
53
|
+
gridStyle: typeof gridStyle;
|
|
54
|
+
isLastGridRow: typeof isLastGridRow;
|
|
55
|
+
isRowSpanCell: typeof isRowSpanCell;
|
|
56
|
+
getCellGridStyle: typeof getCellGridStyle;
|
|
57
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
58
|
+
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>;
|
|
59
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
60
|
+
export default _default;
|
|
61
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -84,11 +84,11 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
84
84
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
85
85
|
}>, {
|
|
86
86
|
label: string;
|
|
87
|
+
row: any;
|
|
87
88
|
value: string;
|
|
88
89
|
itemFields: any[];
|
|
89
90
|
inputWidth: string;
|
|
90
91
|
inputClass: string;
|
|
91
|
-
row: any;
|
|
92
92
|
field: string;
|
|
93
93
|
addBottom: boolean;
|
|
94
94
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -148,11 +148,11 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
148
148
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
149
149
|
}>, {
|
|
150
150
|
label: string;
|
|
151
|
+
row: any;
|
|
151
152
|
value: string;
|
|
152
153
|
itemFields: any[];
|
|
153
154
|
inputWidth: string;
|
|
154
155
|
inputClass: string;
|
|
155
|
-
row: any;
|
|
156
156
|
field: string;
|
|
157
157
|
addBottom: boolean;
|
|
158
158
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import TSys from '../../../../utils/TSys';
|
|
2
|
+
import type { CurdConfigColumn, CurdFormColumn, CurdFormGridCell } from '../../indexType';
|
|
3
|
+
type DialogType = keyof typeof TSys.EDialog;
|
|
4
|
+
/** 表单行高栅格总数,与列 span 一致,默认占满一行 */
|
|
5
|
+
export declare const FORM_ROW_UNIT = 12;
|
|
6
|
+
export type FormGridOptions = {
|
|
7
|
+
maxSpan?: number;
|
|
8
|
+
defaultSpan?: number;
|
|
9
|
+
/** 表单整体布局:row 横向栅格,column 纵向独占行 */
|
|
10
|
+
layout?: 'row' | 'column';
|
|
11
|
+
};
|
|
12
|
+
export declare const setFormFlagRecursive: (col: CurdConfigColumn, value: boolean) => void;
|
|
13
|
+
export declare const shouldIncludeInForm: (item: CurdConfigColumn & {
|
|
14
|
+
isForm?: boolean;
|
|
15
|
+
}) => boolean;
|
|
16
|
+
export declare const normalizeFormSpan: (item: CurdConfigColumn, defaultSpan: number, layout?: "row" | "column") => number;
|
|
17
|
+
/** 字段占用的行高栅格数(form.row,默认 12) */
|
|
18
|
+
export declare const getFormRowUnits: (item: CurdConfigColumn) => number;
|
|
19
|
+
export declare const getFormStripeBand: (cell: Pick<CurdFormGridCell, "gridRow">) => number;
|
|
20
|
+
export declare const getFormDisabled: (item: CurdConfigColumn, type: DialogType, form: Record<string, any>) => any;
|
|
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
|
+
[key: string]: any;
|
|
30
|
+
on: any;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const getFormOn: (item: CurdConfigColumn, type: DialogType, appendArgs?: any[]) => Record<string, any>;
|
|
33
|
+
export declare const getFormColumnSpan: (column: CurdFormColumn, itemConfig: CurdFormColumn[] | CurdFormGridCell[], form: Record<string, any>, type: DialogType, formOption?: {
|
|
34
|
+
maxSpan?: number;
|
|
35
|
+
defaultSpan?: number;
|
|
36
|
+
}) => number;
|
|
37
|
+
/** 将栅格单元按行分组(兼容旧 formColumn 二维结构) */
|
|
38
|
+
export declare const cellsToFormRows: (cells: CurdFormGridCell[]) => CurdFormColumn[][];
|
|
39
|
+
export declare const getFormItemColClass: (column: CurdFormColumn, span: number) => string;
|
|
40
|
+
/** @deprecated 每格仅一个字段,保留兼容 */
|
|
41
|
+
export declare const getFormCellFields: (cell: CurdFormColumn) => CurdFormColumn[];
|
|
42
|
+
/** 扁平化表单列(children 仅用于表格分组,表单只收集叶子字段) */
|
|
43
|
+
export declare const flatFormColumns: (layout: CurdFormColumn[][] | CurdFormGridCell[]) => CurdFormColumn[];
|
|
44
|
+
/** 按 column 树深度优先收集可渲染的叶子表单字段 */
|
|
45
|
+
export declare const collectFormColumnEntries: (columns: CurdConfigColumn[], options?: FormGridOptions) => CurdFormColumn[];
|
|
46
|
+
/** CSS Grid 二维布局(form.span 列宽、form.row 行高,均为 12 栅格) */
|
|
47
|
+
export declare const buildFormGridLayout: (columns: CurdConfigColumn[], options?: FormGridOptions) => {
|
|
48
|
+
cells: CurdFormGridCell[];
|
|
49
|
+
maxSpan: number;
|
|
50
|
+
};
|
|
51
|
+
export declare const getFormRowShowFlags: (itemConfig: CurdFormColumn[]) => (boolean | ((data: any, type: keyof typeof TSys.EDialog) => boolean) | undefined)[];
|
|
52
|
+
export declare const getFormGridShowFlags: (cells: CurdFormGridCell[]) => (boolean | ((data: any, type: keyof typeof TSys.EDialog) => boolean) | undefined)[];
|
|
53
|
+
export declare const getNormalizedFormRules: (item: CurdConfigColumn, getRequiredMessage: (item: CurdConfigColumn) => string, transform?: (rule: any) => any) => any[] | undefined;
|
|
54
|
+
export declare const buildFormColumnEntry: (item: CurdConfigColumn & {
|
|
55
|
+
isForm?: boolean;
|
|
56
|
+
}, options: FormGridOptions) => CurdFormColumn | null;
|
|
57
|
+
export declare const appendFormColumnToRows: (rows: CurdFormColumn[][], currentRow: CurdFormColumn[], entry: CurdFormColumn, maxSpan: number) => CurdFormColumn<any>[];
|
|
58
|
+
export declare const buildFormColumnRows: (columns: CurdConfigColumn[], options?: FormGridOptions) => CurdFormColumn[][];
|
|
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;
|
|
61
|
+
export type StandaloneFormOption = {
|
|
62
|
+
maxSpan?: number;
|
|
63
|
+
defaultSpan?: number;
|
|
64
|
+
labelWidth?: string;
|
|
65
|
+
stripe?: boolean;
|
|
66
|
+
layout?: 'row' | 'column';
|
|
67
|
+
};
|
|
68
|
+
/** 独立表单(TColumn)初始化 */
|
|
69
|
+
export declare const initStandaloneFormState: (columns: CurdConfigColumn[], formOption: StandaloneFormOption | undefined, form: Record<string, any>) => {
|
|
70
|
+
formDefault: Record<string, any>;
|
|
71
|
+
rules: Record<string, any>;
|
|
72
|
+
formGrid: CurdFormGridCell<any>[];
|
|
73
|
+
formMaxSpan: number;
|
|
74
|
+
formColumn: CurdFormColumn<any>[][];
|
|
75
|
+
};
|
|
76
|
+
export declare const applyFormFieldMeta: (columns: CurdConfigColumn[], formDefault: Record<string, any>, rules: Record<string, any>, getRules: (item: CurdConfigColumn) => any) => void;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type BoundFormExternal = Record<string, any> | null | undefined | (() => Record<string, any> | null | undefined);
|
|
2
|
+
/**
|
|
3
|
+
* 外部传入 form 时直接读写该对象;未传入时使用内部 reactive,避免 watch 双向同步导致死循环
|
|
4
|
+
*/
|
|
5
|
+
export declare const createBoundFormAccessor: (external?: BoundFormExternal) => {
|
|
6
|
+
internal: Record<string, any>;
|
|
7
|
+
isExternal: () => boolean;
|
|
8
|
+
get(): Record<string, any>;
|
|
9
|
+
set(value: Record<string, any>): void;
|
|
10
|
+
merge(value: Record<string, any>): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CurdConfGetter, CurdProps } from './types';
|
|
2
|
+
export declare const createExportModule: (getConf: CurdConfGetter, props: CurdProps) => {
|
|
3
|
+
export: {
|
|
4
|
+
run: {
|
|
5
|
+
start: (command: any) => Promise<void>;
|
|
6
|
+
select: () => Promise<any>;
|
|
7
|
+
page: () => Promise<any>;
|
|
8
|
+
all: () => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
loading: boolean;
|
|
11
|
+
click: (command: any) => void;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CurdFormColumn } from '../indexType';
|
|
2
|
+
import type { CurdConfGetter, CurdProps, CurdRefs } from './types';
|
|
3
|
+
export declare const createInitModule: (getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
|
|
4
|
+
apiDataMap: Record<string, any>;
|
|
5
|
+
getColumnSpan: (column: CurdFormColumn, itemConfig?: CurdFormColumn[]) => number;
|
|
6
|
+
init: () => void;
|
|
7
|
+
initApiData: (tag: "update" | "init") => Promise<boolean>;
|
|
8
|
+
initCurdConfig: () => void;
|
|
9
|
+
initColumnOptions: () => void;
|
|
10
|
+
initColumnForm: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CurdConfGetter, CurdProps } from './types';
|
|
2
|
+
export declare const createPageModule: (getConf: CurdConfGetter, props: CurdProps) => {
|
|
3
|
+
page: {
|
|
4
|
+
num: number;
|
|
5
|
+
total: number;
|
|
6
|
+
layout: string;
|
|
7
|
+
showTools: boolean;
|
|
8
|
+
size: number;
|
|
9
|
+
sizeList: number[];
|
|
10
|
+
pagerCount: number;
|
|
11
|
+
getQuery: (param?: {
|
|
12
|
+
size?: number;
|
|
13
|
+
num?: number;
|
|
14
|
+
}) => any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CurdConfGetter, CurdProps } from './types';
|
|
2
|
+
export declare const createRemoveModule: (getConf: CurdConfGetter, props: CurdProps) => {
|
|
3
|
+
remove: {
|
|
4
|
+
title: string;
|
|
5
|
+
show: boolean;
|
|
6
|
+
items: any[];
|
|
7
|
+
loading: boolean;
|
|
8
|
+
close: () => void;
|
|
9
|
+
open: (items: any[]) => void;
|
|
10
|
+
submit: () => void;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CurdConfigColumn } from '../indexType';
|
|
2
|
+
import type { CurdConfGetter, CurdProps } from './types';
|
|
3
|
+
export declare const createSearchModule: (getConf: CurdConfGetter, props: CurdProps) => {
|
|
4
|
+
search: {
|
|
5
|
+
column: {
|
|
6
|
+
list: CurdConfigColumn[];
|
|
7
|
+
};
|
|
8
|
+
form: Record<string, any>;
|
|
9
|
+
formDefault: Record<string, any>;
|
|
10
|
+
getPlaceholder: (item: CurdConfigColumn, prefix?: string) => string;
|
|
11
|
+
getFormData: () => any;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
submit: () => void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CurdConfigColumn } from '../indexType';
|
|
2
|
+
import type { CurdConfGetter, CurdProps, CurdRefs } from './types';
|
|
3
|
+
export declare const createTableModule: (getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
|
|
4
|
+
table: {
|
|
5
|
+
op: {
|
|
6
|
+
width: (...bool: any[]) => number;
|
|
7
|
+
};
|
|
8
|
+
loading: boolean;
|
|
9
|
+
data: any[];
|
|
10
|
+
expand: {
|
|
11
|
+
isExpand: boolean;
|
|
12
|
+
rowKeys: any[];
|
|
13
|
+
change: (_row: any, _isExpand: boolean) => void;
|
|
14
|
+
all: () => void;
|
|
15
|
+
};
|
|
16
|
+
column: {
|
|
17
|
+
list: CurdConfigColumn[];
|
|
18
|
+
show: {
|
|
19
|
+
listSource: any[];
|
|
20
|
+
list: any[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
header: {
|
|
24
|
+
group: {
|
|
25
|
+
expand: boolean;
|
|
26
|
+
toggleExpandAll: () => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
getList: () => Promise<void>;
|
|
30
|
+
selection: {
|
|
31
|
+
list: any[];
|
|
32
|
+
change: (selection: any[]) => void;
|
|
33
|
+
setList: (list: any[], callback?: (item: any) => any) => void;
|
|
34
|
+
};
|
|
35
|
+
sort: {
|
|
36
|
+
prop: string;
|
|
37
|
+
order: string;
|
|
38
|
+
change: (row: {
|
|
39
|
+
column: any;
|
|
40
|
+
prop: string;
|
|
41
|
+
order: "ascending" | "descending" | null;
|
|
42
|
+
}) => void;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { FormInstance, TableInstance } from 'element-plus';
|
|
3
|
+
import type { CurdConfig } from '../indexType';
|
|
4
|
+
export type CurdProps = {
|
|
5
|
+
option: CurdConfig;
|
|
6
|
+
form?: any;
|
|
7
|
+
searchForm?: any;
|
|
8
|
+
};
|
|
9
|
+
export type CurdRefs = {
|
|
10
|
+
switchConfirmRef: Ref<any>;
|
|
11
|
+
ruleFormRef: Ref<FormInstance | undefined>;
|
|
12
|
+
tableRef: Ref<TableInstance | undefined>;
|
|
13
|
+
};
|
|
14
|
+
export type CurdConfGetter = () => Record<string, any>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CurdConfigColumn, CurdFormColumn, CurdFormGridCell } from '../indexType';
|
|
2
|
+
import type { CurdConfGetter, CurdProps, CurdRefs } from './types';
|
|
3
|
+
declare const EDialog: {
|
|
4
|
+
Add: any;
|
|
5
|
+
Update: any;
|
|
6
|
+
View: any;
|
|
7
|
+
Remove: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const createUpdateModule: (getConf: CurdConfGetter, props: CurdProps, refs: CurdRefs) => {
|
|
10
|
+
update: {
|
|
11
|
+
title: string;
|
|
12
|
+
rules: any;
|
|
13
|
+
show: boolean;
|
|
14
|
+
showContent: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
type: keyof typeof EDialog;
|
|
17
|
+
form: Record<string, any>;
|
|
18
|
+
formDefault: any;
|
|
19
|
+
formColumn: CurdFormColumn[][];
|
|
20
|
+
formGrid: CurdFormGridCell[];
|
|
21
|
+
formMaxSpan: number;
|
|
22
|
+
getDisabled: (item: CurdConfigColumn, isTable?: boolean) => any;
|
|
23
|
+
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
|
+
[key: string]: any;
|
|
32
|
+
on: any;
|
|
33
|
+
}>;
|
|
34
|
+
getOn: (item: CurdConfigColumn, row?: any) => Record<string, any>;
|
|
35
|
+
getOptions: <T = any>(key: string) => {
|
|
36
|
+
options: CurdConfigColumn<T>["options"];
|
|
37
|
+
bind: any;
|
|
38
|
+
};
|
|
39
|
+
edit: {
|
|
40
|
+
data: any;
|
|
41
|
+
getApiData: (form: any) => any;
|
|
42
|
+
};
|
|
43
|
+
view: {};
|
|
44
|
+
open: (type: keyof typeof EDialog, item?: any) => void;
|
|
45
|
+
submit: () => void;
|
|
46
|
+
close: () => void;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export {};
|