antd-vue-dbthor 1.0.0
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/components/components.d.ts +2 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/layout/silder-layout/index.d.ts +3 -0
- package/dist/components/table/control.d.ts +37 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/index.type.d.ts +203 -0
- package/dist/components/table/table.vue.d.ts +166 -0
- package/dist/components/table/useCU.d.ts +48 -0
- package/dist/components/table/useColumns.d.ts +87 -0
- package/dist/components/table/useDataSource.d.ts +25 -0
- package/dist/components/table/useDetail.d.ts +32 -0
- package/dist/components/table/useExport.d.ts +4 -0
- package/dist/components/table/useImport.d.ts +4 -0
- package/dist/components/table/usePagination.d.ts +12 -0
- package/dist/components/table/useParams.d.ts +20 -0
- package/dist/components/table/useQueryForm.d.ts +72 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/examples/app.vue.d.ts +3 -0
- package/dist/examples/boot.d.ts +1 -0
- package/dist/examples/page/home/index.vue.d.ts +3 -0
- package/dist/examples/router/index.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/lib/index.es.js +2535 -0
- package/dist/lib/index.es.js.gz +0 -0
- package/dist/lib/index.umd.js +52 -0
- package/dist/lib/index.umd.js.gz +0 -0
- package/dist/main.d.ts +6 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/type.d.ts +56 -0
- package/package.json +79 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const Comp: DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default Comp;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CheckboxGroupProps, CheckboxProps, DatePickerProps, InputNumberProps, InputProps, RadioGroupProps, RadioProps, SelectProps } from 'ant-design-vue';
|
|
2
|
+
import { RangePickerProps } from 'ant-design-vue/es/date-picker';
|
|
3
|
+
|
|
4
|
+
export declare enum ControlMapType {
|
|
5
|
+
Input = "Input",
|
|
6
|
+
InputNumber = "InputNumber",
|
|
7
|
+
Select = "Select",
|
|
8
|
+
DatePicker = "DatePicker",
|
|
9
|
+
RangePicker = "RangePicker",
|
|
10
|
+
Checkbox = "Checkbox",
|
|
11
|
+
CheckboxGroup = "CheckboxGroup",
|
|
12
|
+
Radio = "Radio",
|
|
13
|
+
RadioGroup = "RadioGroup"
|
|
14
|
+
}
|
|
15
|
+
export interface ControlMapProps {
|
|
16
|
+
Input: InputProps;
|
|
17
|
+
InputNumberProps: InputNumberProps;
|
|
18
|
+
Select: SelectProps;
|
|
19
|
+
DatePicker: DatePickerProps;
|
|
20
|
+
RangePicker: RangePickerProps;
|
|
21
|
+
Checkbox: CheckboxProps;
|
|
22
|
+
CheckboxGroup: CheckboxGroupProps;
|
|
23
|
+
Radio: RadioProps;
|
|
24
|
+
RadioGroup: RadioGroupProps;
|
|
25
|
+
}
|
|
26
|
+
declare const Control: ({ type, ...props }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
27
|
+
export default Control;
|
|
28
|
+
export declare enum FormItemControlModelFields {
|
|
29
|
+
Input = "value",
|
|
30
|
+
InputNumber = "value",
|
|
31
|
+
Select = "value",
|
|
32
|
+
Checkbox = "checked",
|
|
33
|
+
CheckboxGroup = "value",
|
|
34
|
+
Radio = "checked",
|
|
35
|
+
RadioGroup = "value"
|
|
36
|
+
}
|
|
37
|
+
export declare const FormItemControl: ({ type, model, name, customControl, ...props }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { TableProps as ATableProps, ButtonProps, FormProps, PaginationProps } from 'ant-design-vue';
|
|
2
|
+
import { ColumnType } from 'ant-design-vue/es/table';
|
|
3
|
+
import { RenderExpandIconProps } from 'ant-design-vue/es/vc-table/interface';
|
|
4
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
5
|
+
import { Ref, SetupContext, VNode } from 'vue';
|
|
6
|
+
import { TableColumnCustomRenderArgs, TableColumnProps, TableUseColumnsProps } from './useColumns';
|
|
7
|
+
import { TableUseCUFormProps } from './useCU';
|
|
8
|
+
import { TableUseDataSourceProps } from './useDataSource';
|
|
9
|
+
import { TableUseDetailProps } from './useDetail';
|
|
10
|
+
import { TableQueryFormInstance, TableQueryFormItemProps, TableQueryFormProps } from './useQueryForm';
|
|
11
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
type TableFieldNames = string | string[];
|
|
14
|
+
export interface OwnBtnProps extends ButtonProps {
|
|
15
|
+
children?: string | VNode | JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export type ownBtnProps = OwnBtnProps | false;
|
|
18
|
+
export type TablePropsApi = (params?: AxiosRequestConfig['params'], config?: AxiosRequestConfig) => Promise<any>;
|
|
19
|
+
export type RequestParams = {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
export type RequestParamsFormatter = (params: RequestParams) => RequestParams;
|
|
23
|
+
export type CRUDRequestFinish = (res: AxiosResponse, info?: any) => boolean | void;
|
|
24
|
+
export type ParamsFormatter = (vals: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
} | unknown) => Promise<{
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
} | unknown>;
|
|
29
|
+
export type TableTextConfig = Partial<{
|
|
30
|
+
modalTitle: {
|
|
31
|
+
create: string;
|
|
32
|
+
update: string;
|
|
33
|
+
detail: string;
|
|
34
|
+
};
|
|
35
|
+
message: {
|
|
36
|
+
createSuccess: string;
|
|
37
|
+
createError: string;
|
|
38
|
+
updateSuccess: string;
|
|
39
|
+
updateError: string;
|
|
40
|
+
deleteSuccess: string;
|
|
41
|
+
deleteError: string;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
export type ciesBtnsVNode = Ref<Partial<{
|
|
45
|
+
CreateBtn: VNode | JSX.Element;
|
|
46
|
+
ImportBtn: VNode | JSX.Element;
|
|
47
|
+
ExportBtn: VNode | JSX.Element;
|
|
48
|
+
}>>;
|
|
49
|
+
export interface TableProps extends Omit<ATableProps, 'columns'> {
|
|
50
|
+
full?: boolean;
|
|
51
|
+
tableTextConfig?: TableTextConfig;
|
|
52
|
+
/**
|
|
53
|
+
* 额外的请求参数
|
|
54
|
+
* 会覆盖重名的参数
|
|
55
|
+
*/
|
|
56
|
+
params?: {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* 列配置
|
|
61
|
+
*/
|
|
62
|
+
columns?: TableColumnProps[];
|
|
63
|
+
columnsTitleNoWrap?: TableUseColumnsProps['columnsTitleNoWrap'];
|
|
64
|
+
indexColumn?: TableUseColumnsProps['indexColumn'];
|
|
65
|
+
controlColumn?: TableUseColumnsProps['controlColumn'];
|
|
66
|
+
columnsAlign?: TableColumnProps['align'];
|
|
67
|
+
columnsTimeFormat?: TableUseColumnsProps['columnsTimeFormat'];
|
|
68
|
+
columnsEmptyText?: TableUseColumnsProps['columnsEmptyText'];
|
|
69
|
+
controlColumnBtns?: TableUseColumnsProps['controlColumnBtns'];
|
|
70
|
+
/**
|
|
71
|
+
* api 请求配置
|
|
72
|
+
*/
|
|
73
|
+
apis?: Partial<{
|
|
74
|
+
list: TablePropsApi;
|
|
75
|
+
details: TablePropsApi;
|
|
76
|
+
create: TablePropsApi;
|
|
77
|
+
update: TablePropsApi;
|
|
78
|
+
delete: TablePropsApi;
|
|
79
|
+
export: TablePropsApi;
|
|
80
|
+
import: TablePropsApi;
|
|
81
|
+
}>;
|
|
82
|
+
requestParamsFormatter?: RequestParamsFormatter;
|
|
83
|
+
onSourceSuccess?: TableUseDataSourceProps['onSourceSuccess'];
|
|
84
|
+
onSourceError?: TableUseDataSourceProps['onSourceError'];
|
|
85
|
+
onGetRowDetail?: (res: AxiosResponse) => Promise<{
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}>;
|
|
88
|
+
onBeforeCuFormSubmit?: ParamsFormatter;
|
|
89
|
+
onBeforeRowEditBackFill?: TableUseColumnsProps['onBeforeRowEditBackFill'];
|
|
90
|
+
onCuFormSubmitSuccess?: CRUDRequestFinish;
|
|
91
|
+
onCuFormSubmitError?: CRUDRequestFinish;
|
|
92
|
+
onBeforeRowDelete?: ParamsFormatter;
|
|
93
|
+
onRowDeleteSuccess?: CRUDRequestFinish;
|
|
94
|
+
onRowDeleteError?: CRUDRequestFinish;
|
|
95
|
+
fieldsNames?: Partial<{
|
|
96
|
+
page: string;
|
|
97
|
+
pageSize: string;
|
|
98
|
+
list: TableFieldNames;
|
|
99
|
+
total: TableFieldNames;
|
|
100
|
+
detail: TableFieldNames;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* 分页配置
|
|
104
|
+
*/
|
|
105
|
+
ownPagin?: boolean;
|
|
106
|
+
ownPaginProps?: Partial<PaginationProps>;
|
|
107
|
+
showOwnPagination?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* 内置查询表单配置
|
|
110
|
+
*/
|
|
111
|
+
queryForm?: boolean;
|
|
112
|
+
queryFormProps?: FormProps;
|
|
113
|
+
queryFormItem?: TableQueryFormItemProps[];
|
|
114
|
+
queryFormRowProps?: TableQueryFormProps['queryFormRowProps'];
|
|
115
|
+
queryFormColProps?: TableQueryFormProps['queryFormColProps'];
|
|
116
|
+
queryFormFlexProps?: TableQueryFormProps['queryFormFlexProps'];
|
|
117
|
+
queryFormSubmitBtn?: TableQueryFormProps['queryFormSubmitBtn'];
|
|
118
|
+
queryFormSubmitBtnProps?: TableQueryFormProps['queryFormSubmitBtnProps'];
|
|
119
|
+
queryFormResetBtn?: TableQueryFormProps['queryFormResetBtn'];
|
|
120
|
+
queryFormResetBtnProps?: TableQueryFormProps['queryFormResetBtnProps'];
|
|
121
|
+
queryFormSubmitWithReset?: TableQueryFormProps['queryFormSubmitWithReset'];
|
|
122
|
+
/**
|
|
123
|
+
* 新增 编辑表单配置
|
|
124
|
+
*/
|
|
125
|
+
cuFormProps?: TableUseCUFormProps['cuFormProps'];
|
|
126
|
+
cuUseFormOptions?: TableUseCUFormProps['cuUseFormOptions'];
|
|
127
|
+
cuFormRules?: TableUseCUFormProps['cuFormRules'];
|
|
128
|
+
cuFormModalProps?: TableUseCUFormProps['cuFormModalProps'];
|
|
129
|
+
cuFormRowProps?: TableUseCUFormProps['cuFormRowProps'];
|
|
130
|
+
cuFormColProps?: TableUseCUFormProps['cuFormColProps'];
|
|
131
|
+
cuFormBackFillByGetDetail?: TableUseColumnsProps['cuFormBackFillByGetDetail'];
|
|
132
|
+
/**
|
|
133
|
+
* 详情 描述列表配置
|
|
134
|
+
*/
|
|
135
|
+
detailBackFillByGetDetail?: TableUseColumnsProps['detailBackFillByGetDetail'];
|
|
136
|
+
detailDescItemEmptyText?: TableUseDetailProps['detailDescItemEmptyText'];
|
|
137
|
+
detailDescItemProps?: TableUseDetailProps['detailDescItemProps'];
|
|
138
|
+
detailDescItemTimeFormat?: TableUseDetailProps['detailDescItemTimeFormat'];
|
|
139
|
+
ciesBtns?: boolean;
|
|
140
|
+
ciesBtnsInQueryForm?: boolean;
|
|
141
|
+
createBtn?: TableUseCUFormProps['createBtn'];
|
|
142
|
+
importBtn?: false | (ButtonProps & {
|
|
143
|
+
children?: string | VNode;
|
|
144
|
+
});
|
|
145
|
+
exportBtn?: false | (ButtonProps & {
|
|
146
|
+
children?: string | VNode;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
export type TableSlots = {
|
|
150
|
+
emptyText?: any;
|
|
151
|
+
expandIcon?: RenderExpandIconProps<any>;
|
|
152
|
+
title?: any;
|
|
153
|
+
footer?: any;
|
|
154
|
+
summary?: any;
|
|
155
|
+
expandedRowRender?: any;
|
|
156
|
+
expandColumnTitle?: any;
|
|
157
|
+
bodyCell?: (props: {
|
|
158
|
+
text: any;
|
|
159
|
+
value: any;
|
|
160
|
+
record: Record<string, any>;
|
|
161
|
+
index: number;
|
|
162
|
+
column: ColumnType;
|
|
163
|
+
}) => void;
|
|
164
|
+
headerCell?: (props: {
|
|
165
|
+
title: any;
|
|
166
|
+
column: ColumnType;
|
|
167
|
+
}) => void;
|
|
168
|
+
customFilterIcon?: any;
|
|
169
|
+
customFilterDropdown?: any;
|
|
170
|
+
default?: any;
|
|
171
|
+
queryFormExtraLeft?: (form: TableQueryFormInstance) => VNode[] | JSX.Element[];
|
|
172
|
+
queryFormExtraCenter?: (form: TableQueryFormInstance) => VNode[] | JSX.Element[];
|
|
173
|
+
queryFormExtraRight?: (form: TableQueryFormInstance) => VNode[] | JSX.Element[];
|
|
174
|
+
controlColumnBtnExtraDetailStart?: (obj: {
|
|
175
|
+
opt: TableColumnCustomRenderArgs;
|
|
176
|
+
metaColumn: TableColumnProps;
|
|
177
|
+
}) => VNode[] | JSX.Element[];
|
|
178
|
+
controlColumnBtnExtraEditLeft?: (obj: {
|
|
179
|
+
opt: TableColumnCustomRenderArgs;
|
|
180
|
+
metaColumn: TableColumnProps;
|
|
181
|
+
}) => VNode[] | JSX.Element[];
|
|
182
|
+
controlColumnBtnExtraEditRight?: (obj: {
|
|
183
|
+
opt: TableColumnCustomRenderArgs;
|
|
184
|
+
metaColumn: TableColumnProps;
|
|
185
|
+
}) => VNode[] | JSX.Element[];
|
|
186
|
+
controlColumnBtnExtraEnd?: (obj: {
|
|
187
|
+
opt: TableColumnCustomRenderArgs;
|
|
188
|
+
metaColumn: TableColumnProps;
|
|
189
|
+
}) => VNode[] | JSX.Element[];
|
|
190
|
+
customCiesBtns?: (orgNode: {
|
|
191
|
+
CreateBtn: VNode;
|
|
192
|
+
ImportBtn: VNode;
|
|
193
|
+
ExportBtn: VNode;
|
|
194
|
+
}) => VNode | JSX.Element;
|
|
195
|
+
};
|
|
196
|
+
export declare const ATableSlotsWhiteList: string[];
|
|
197
|
+
export interface TableSetupCtx extends Omit<SetupContext, 'slots'> {
|
|
198
|
+
slots: TableSlots;
|
|
199
|
+
}
|
|
200
|
+
export declare const mergeConfigProps: <T>(props: T) => {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
};
|
|
203
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { TableProps, TableSlots, TablePropsApi } from './index.type';
|
|
2
|
+
import { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { TableQueryFormInstance, TableQueryFormProps } from './useQueryForm';
|
|
4
|
+
import { ToRawRefs } from '@vue-macros/reactivity-transform/macros';
|
|
5
|
+
import { TableUseColumnsProps } from './useColumns';
|
|
6
|
+
|
|
7
|
+
declare function __VLS_template(): Readonly<TableSlots> & TableSlots;
|
|
8
|
+
declare const __VLS_component: DefineComponent<TableProps, {
|
|
9
|
+
QueryForm: Ref<() => import("vue/jsx-runtime").JSX.Element, () => import("vue/jsx-runtime").JSX.Element>;
|
|
10
|
+
QueryFormInstance: ComputedRef<TableQueryFormInstance>;
|
|
11
|
+
updateSource: any;
|
|
12
|
+
Pagination: ToRawRefs<() => import("vue/jsx-runtime").JSX.Element>;
|
|
13
|
+
cuModalFormIsEdit: Ref<Ref<boolean, boolean>, Ref<boolean, boolean>>;
|
|
14
|
+
CreateBtn: Ref<() => import("vue/jsx-runtime").JSX.Element, () => import("vue/jsx-runtime").JSX.Element>;
|
|
15
|
+
ImportBtn: Ref<() => import("vue/jsx-runtime").JSX.Element, () => import("vue/jsx-runtime").JSX.Element>;
|
|
16
|
+
ExportBtn: Ref<() => import("vue/jsx-runtime").JSX.Element, () => import("vue/jsx-runtime").JSX.Element>;
|
|
17
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<TableProps> & Readonly<{}>, {
|
|
18
|
+
queryFormSubmitBtn: TableQueryFormProps["queryFormSubmitBtn"];
|
|
19
|
+
queryFormResetBtn: TableQueryFormProps["queryFormResetBtn"];
|
|
20
|
+
apis: Partial<{
|
|
21
|
+
list: TablePropsApi;
|
|
22
|
+
details: TablePropsApi;
|
|
23
|
+
create: TablePropsApi;
|
|
24
|
+
update: TablePropsApi;
|
|
25
|
+
delete: TablePropsApi;
|
|
26
|
+
export: TablePropsApi;
|
|
27
|
+
import: TablePropsApi;
|
|
28
|
+
}>;
|
|
29
|
+
params: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
indexColumn: TableUseColumnsProps["indexColumn"];
|
|
33
|
+
controlColumn: TableUseColumnsProps["controlColumn"];
|
|
34
|
+
full: boolean;
|
|
35
|
+
ownPagin: boolean;
|
|
36
|
+
queryForm: boolean;
|
|
37
|
+
ciesBtns: boolean;
|
|
38
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
40
|
+
export default _default;
|
|
41
|
+
export declare const __VLS_globalTypesStart: {};
|
|
42
|
+
declare global {
|
|
43
|
+
type __VLS_IntrinsicElements = __VLS_PickNotAny<import('vue/jsx-runtime').JSX.IntrinsicElements, __VLS_PickNotAny<globalThis.JSX.IntrinsicElements, Record<string, any>>>;
|
|
44
|
+
type __VLS_Element = __VLS_PickNotAny<import('vue/jsx-runtime').JSX.Element, globalThis.JSX.Element>;
|
|
45
|
+
type __VLS_GlobalComponents = __VLS_PickNotAny<import('vue').GlobalComponents, {}> & __VLS_PickNotAny<import('@vue/runtime-core').GlobalComponents, {}> & __VLS_PickNotAny<import('@vue/runtime-dom').GlobalComponents, {}> & Pick<typeof import('vue'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;
|
|
46
|
+
type __VLS_BuiltInPublicProps = __VLS_PickNotAny<import('vue').VNodeProps, {}> & __VLS_PickNotAny<import('vue').AllowedComponentProps, {}> & __VLS_PickNotAny<import('vue').ComponentCustomProps, {}>;
|
|
47
|
+
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
|
48
|
+
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
49
|
+
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
|
|
50
|
+
function __VLS_getVForSourceType(source: number): [number, number, number][];
|
|
51
|
+
function __VLS_getVForSourceType(source: string): [string, number, number][];
|
|
52
|
+
function __VLS_getVForSourceType<T extends any[]>(source: T): [
|
|
53
|
+
item: T[number],
|
|
54
|
+
key: number,
|
|
55
|
+
index: number
|
|
56
|
+
][];
|
|
57
|
+
function __VLS_getVForSourceType<T extends {
|
|
58
|
+
[Symbol.iterator](): Iterator<any>;
|
|
59
|
+
}>(source: T): [
|
|
60
|
+
item: T extends {
|
|
61
|
+
[Symbol.iterator](): Iterator<infer T1>;
|
|
62
|
+
} ? T1 : never,
|
|
63
|
+
key: number,
|
|
64
|
+
index: undefined
|
|
65
|
+
][];
|
|
66
|
+
function __VLS_getVForSourceType<T extends number | {
|
|
67
|
+
[Symbol.iterator](): Iterator<any>;
|
|
68
|
+
}>(source: T): [
|
|
69
|
+
item: number | (Exclude<T, number> extends {
|
|
70
|
+
[Symbol.iterator](): Iterator<infer T1>;
|
|
71
|
+
} ? T1 : never),
|
|
72
|
+
key: number,
|
|
73
|
+
index: undefined
|
|
74
|
+
][];
|
|
75
|
+
function __VLS_getVForSourceType<T>(source: T): [
|
|
76
|
+
item: T[keyof T],
|
|
77
|
+
key: keyof T,
|
|
78
|
+
index: number
|
|
79
|
+
][];
|
|
80
|
+
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
|
|
81
|
+
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
|
|
82
|
+
function __VLS_directiveFunction<T>(dir: T): T extends import('vue').ObjectDirective<infer E, infer V> | import('vue').FunctionDirective<infer E, infer V> ? (value: V) => void : T;
|
|
83
|
+
function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
|
|
84
|
+
function __VLS_makeOptional<T>(t: T): {
|
|
85
|
+
[K in keyof T]?: T[K];
|
|
86
|
+
};
|
|
87
|
+
type __VLS_SelfComponent<N, C> = string extends N ? {} : N extends string ? {
|
|
88
|
+
[P in N]: C;
|
|
89
|
+
} : {};
|
|
90
|
+
type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
91
|
+
[K in N0]: LocalComponents[N1];
|
|
92
|
+
} : N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
93
|
+
[K in N0]: LocalComponents[N2];
|
|
94
|
+
} : N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
95
|
+
[K in N0]: LocalComponents[N3];
|
|
96
|
+
} : N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
97
|
+
[K in N0]: __VLS_GlobalComponents[N1];
|
|
98
|
+
} : N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
99
|
+
[K in N0]: __VLS_GlobalComponents[N2];
|
|
100
|
+
} : N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
101
|
+
[K in N0]: __VLS_GlobalComponents[N3];
|
|
102
|
+
} : {
|
|
103
|
+
[K in N0]: unknown;
|
|
104
|
+
};
|
|
105
|
+
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K): T extends new (...args: any) => any ? (props: (K extends {
|
|
106
|
+
$props: infer Props;
|
|
107
|
+
} ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
|
|
108
|
+
__ctx?: {
|
|
109
|
+
attrs?: any;
|
|
110
|
+
slots?: K extends {
|
|
111
|
+
$slots: infer Slots;
|
|
112
|
+
} ? Slots : any;
|
|
113
|
+
emit?: K extends {
|
|
114
|
+
$emit: infer Emit;
|
|
115
|
+
} ? Emit : any;
|
|
116
|
+
} & {
|
|
117
|
+
props?: (K extends {
|
|
118
|
+
$props: infer Props;
|
|
119
|
+
} ? Props : any) & Record<string, unknown>;
|
|
120
|
+
expose?(exposed: K): void;
|
|
121
|
+
};
|
|
122
|
+
} : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T> : T extends (...args: any) => any ? T : (_: {} & Record<string, unknown>, ctx?: any) => {
|
|
123
|
+
__ctx?: {
|
|
124
|
+
attrs?: any;
|
|
125
|
+
expose?: any;
|
|
126
|
+
slots?: any;
|
|
127
|
+
emit?: any;
|
|
128
|
+
props?: {} & Record<string, unknown>;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
|
|
132
|
+
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): Parameters<T>['length'] extends 2 ? [any] : [];
|
|
133
|
+
function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): __VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
|
|
134
|
+
__ctx?: infer Ctx;
|
|
135
|
+
} ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>;
|
|
136
|
+
type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
|
|
137
|
+
__ctx?: {
|
|
138
|
+
props?: infer P;
|
|
139
|
+
};
|
|
140
|
+
} ? NonNullable<P> : never : T extends (props: infer P, ...args: any) => any ? P : {};
|
|
141
|
+
type __VLS_AsFunctionOrAny<F> = unknown extends F ? any : ((...args: any) => any) extends F ? F : any;
|
|
142
|
+
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
|
|
143
|
+
/**
|
|
144
|
+
* emit
|
|
145
|
+
*/
|
|
146
|
+
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
|
147
|
+
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R ? U extends T ? never : __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R) : never;
|
|
148
|
+
type __VLS_OverloadUnion<T> = Exclude<__VLS_OverloadUnionInner<(() => never) & T>, T extends () => never ? never : () => never>;
|
|
149
|
+
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F ? F extends (event: infer E, ...args: infer A) => any ? {
|
|
150
|
+
[K in E & string]: (...args: A) => void;
|
|
151
|
+
} : never : never;
|
|
152
|
+
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<__VLS_UnionToIntersection<__VLS_ConstructorOverloads<T> & {
|
|
153
|
+
[K in keyof T]: T[K] extends any[] ? {
|
|
154
|
+
(...args: T[K]): void;
|
|
155
|
+
} : never;
|
|
156
|
+
}>>;
|
|
157
|
+
type __VLS_PrettifyGlobal<T> = {
|
|
158
|
+
[K in keyof T]: T[K];
|
|
159
|
+
} & {};
|
|
160
|
+
}
|
|
161
|
+
export declare const __VLS_globalTypesEnd: {};
|
|
162
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
163
|
+
new (): {
|
|
164
|
+
$slots: S;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FormItemProps as AFormItemProps, ColProps, FormItemProps, FormProps, ModalProps, RowProps } from 'ant-design-vue';
|
|
2
|
+
import { Reactive, Ref, VNode } from 'vue';
|
|
3
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
4
|
+
import { ControlMapProps } from './control';
|
|
5
|
+
import { ownBtnProps, TableProps, TableTextConfig } from './index.type';
|
|
6
|
+
import { FormInstance, UseFormOptions } from './useQueryForm';
|
|
7
|
+
|
|
8
|
+
export interface TableCUFormInstance extends FormInstance {
|
|
9
|
+
}
|
|
10
|
+
export interface TableUseCUReturnOptions {
|
|
11
|
+
CreateBtn: () => JSX.Element;
|
|
12
|
+
CUModalForm: () => JSX.Element;
|
|
13
|
+
cuFormModel: Reactive<{
|
|
14
|
+
values: any;
|
|
15
|
+
}>;
|
|
16
|
+
cuModalLoading: Ref<boolean>;
|
|
17
|
+
submitBtnLoading: Ref<boolean>;
|
|
18
|
+
cuModalFormIsEdit: Ref<boolean>;
|
|
19
|
+
openCUModalForm: (isEdit: boolean) => void;
|
|
20
|
+
CUModalFormInstance: TableCUFormInstance;
|
|
21
|
+
}
|
|
22
|
+
export interface TableUseCUFormProps {
|
|
23
|
+
apis?: TableProps['apis'];
|
|
24
|
+
createBtn?: ownBtnProps;
|
|
25
|
+
columns?: TableProps['columns'];
|
|
26
|
+
cuFormProps?: FormProps;
|
|
27
|
+
cuFormRules?: FormItemProps['rules'];
|
|
28
|
+
cuUseFormOptions?: UseFormOptions;
|
|
29
|
+
cuFormModalProps?: ModalProps;
|
|
30
|
+
cuFormRowProps?: RowProps;
|
|
31
|
+
cuFormColProps?: ColProps;
|
|
32
|
+
tableTextConfig?: TableTextConfig;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface TableUseCUFormItemProps<T extends keyof ControlMapProps = keyof ControlMapProps> extends AFormItemProps {
|
|
36
|
+
control?: T;
|
|
37
|
+
colProps?: ColProps;
|
|
38
|
+
controlProps?: ControlMapProps[T];
|
|
39
|
+
customControl?: (props: {
|
|
40
|
+
label: string;
|
|
41
|
+
name: string | string[];
|
|
42
|
+
title: string;
|
|
43
|
+
dataIndex: string | string[];
|
|
44
|
+
}, model: Reactive<any>) => VNode | JSX.Element;
|
|
45
|
+
customRender?: (model: Reactive<any>, form: TableCUFormInstance) => VNode | JSX.Element;
|
|
46
|
+
}
|
|
47
|
+
declare const _default: (props: TableUseCUFormProps) => TableUseCUReturnOptions;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { TableColumnProps as ATableColumnProps, ButtonProps } from 'ant-design-vue';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
import { default as Big } from 'big.js';
|
|
4
|
+
import { default as numeral } from 'numeral';
|
|
5
|
+
import { EmitFn, Reactive, Ref, VNode } from 'vue';
|
|
6
|
+
import { TableProps, TableSlots, TableTextConfig } from './index.type';
|
|
7
|
+
import { TableUseCUFormItemProps, TableUseCUReturnOptions } from './useCU';
|
|
8
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
9
|
+
import { TableDescItemsProps } from './useDetail';
|
|
10
|
+
|
|
11
|
+
export declare const formatterObjValueWithDate: (obj: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}, columns: TableColumnProps[]) => {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
export type TableColumnType = 'index' | 'control' | 'date' | 'number';
|
|
17
|
+
export interface TableColumnProps extends ATableColumnProps {
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
type?: TableColumnType;
|
|
20
|
+
nowrap?: boolean;
|
|
21
|
+
emptyText?: VNode | string;
|
|
22
|
+
timeFormat?: string;
|
|
23
|
+
numberFormat?: numeral.Numeral | ((val: numeral.Numeral, local: string | number) => string | number | VNode);
|
|
24
|
+
numberComputed?: (val: Big.Big, Big: Big) => number;
|
|
25
|
+
formItemProps?: TableUseCUFormItemProps;
|
|
26
|
+
descItemProps?: TableDescItemsProps;
|
|
27
|
+
}
|
|
28
|
+
export type TableColumnCustomRenderArgs = {
|
|
29
|
+
value: any;
|
|
30
|
+
text: any;
|
|
31
|
+
record: any;
|
|
32
|
+
index: number;
|
|
33
|
+
renderIndex: number;
|
|
34
|
+
column: ATableColumnProps;
|
|
35
|
+
};
|
|
36
|
+
export type TableColumnRowMethods = {
|
|
37
|
+
editRow: (record: any) => Promise<void>;
|
|
38
|
+
deleteRow: (record: any) => Promise<void>;
|
|
39
|
+
openRowDetails: (record: any) => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
export interface TableUseColumnsProps {
|
|
42
|
+
apis?: TableProps['apis'];
|
|
43
|
+
columns?: TableColumnProps[];
|
|
44
|
+
columnsAlign?: TableColumnProps['align'];
|
|
45
|
+
indexColumn?: boolean;
|
|
46
|
+
controlColumn?: boolean;
|
|
47
|
+
pagination?: Ref<{
|
|
48
|
+
page: number;
|
|
49
|
+
pageSize: number;
|
|
50
|
+
}>;
|
|
51
|
+
columnsTimeFormat?: string;
|
|
52
|
+
columnsEmptyText?: VNode | string;
|
|
53
|
+
columnsTitleNoWrap?: boolean;
|
|
54
|
+
controlColumnBtns?: {
|
|
55
|
+
detail: false | (ButtonProps & {
|
|
56
|
+
children?: VNode | string;
|
|
57
|
+
});
|
|
58
|
+
edit: false | (ButtonProps & {
|
|
59
|
+
children?: VNode | string;
|
|
60
|
+
});
|
|
61
|
+
delete: false | (ButtonProps & {
|
|
62
|
+
children?: VNode | string;
|
|
63
|
+
});
|
|
64
|
+
} | ((orgNode: {
|
|
65
|
+
DetailBtn: VNode;
|
|
66
|
+
EditBtn: VNode;
|
|
67
|
+
DeleteBtn: VNode;
|
|
68
|
+
}, methods: TableColumnRowMethods) => VNode | JSX.Element);
|
|
69
|
+
slots?: TableSlots;
|
|
70
|
+
openCUModalForm?: TableUseCUReturnOptions['openCUModalForm'] | any;
|
|
71
|
+
updateSource?: () => Promise<void>;
|
|
72
|
+
cuFormModel?: TableUseCUReturnOptions['cuFormModel'];
|
|
73
|
+
emits?: EmitFn;
|
|
74
|
+
onBeforeRowEditBackFill?: (res: AxiosResponse | any, record?: any) => Promise<{
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}>;
|
|
77
|
+
cuFormBackFillByGetDetail?: boolean;
|
|
78
|
+
cuModalLoading?: Ref<boolean> | Reactive<boolean>;
|
|
79
|
+
detailModalLoading?: Ref<boolean> | Reactive<boolean>;
|
|
80
|
+
detailBackFillByGetDetail?: boolean;
|
|
81
|
+
tableTextConfig?: TableTextConfig;
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}
|
|
84
|
+
declare const _default: (props: TableUseColumnsProps) => {
|
|
85
|
+
resColumns: Ref<any[], any[]>;
|
|
86
|
+
};
|
|
87
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { EmitFn, Ref } from 'vue';
|
|
3
|
+
import { TableProps } from './index.type';
|
|
4
|
+
|
|
5
|
+
export interface TableSourceResult {
|
|
6
|
+
total: number;
|
|
7
|
+
list: any[] | null;
|
|
8
|
+
page?: number | string;
|
|
9
|
+
pageSize?: number | string;
|
|
10
|
+
}
|
|
11
|
+
export interface TableUseDataSourceProps {
|
|
12
|
+
api: any;
|
|
13
|
+
fieldsNames: TableProps['fieldsNames'];
|
|
14
|
+
params: TableProps['params'];
|
|
15
|
+
onSourceSuccess: (res: AxiosResponse) => Promise<TableSourceResult>;
|
|
16
|
+
onSourceError: (err: Error) => void;
|
|
17
|
+
emits?: EmitFn;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: (props: TableUseDataSourceProps) => {
|
|
20
|
+
source: Ref<any[], any[]>;
|
|
21
|
+
loading: Ref<boolean, boolean>;
|
|
22
|
+
total: Ref<number, number>;
|
|
23
|
+
updateSource: () => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModalProps } from 'ant-design-vue';
|
|
2
|
+
import { DescriptionsItemProp, DescriptionsProps } from 'ant-design-vue/es/descriptions';
|
|
3
|
+
import { Reactive, Ref, VNode } from 'vue';
|
|
4
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
5
|
+
import { TableTextConfig } from './index.type';
|
|
6
|
+
import { TableColumnProps } from './useColumns';
|
|
7
|
+
|
|
8
|
+
export interface TableUseDetailProps {
|
|
9
|
+
columns?: TableColumnProps[];
|
|
10
|
+
detailDescItemEmptyText?: VNode | string;
|
|
11
|
+
detailDescItemProps?: TableDescItemsProps;
|
|
12
|
+
detailDescItemTimeFormat?: string;
|
|
13
|
+
tableTextConfig?: TableTextConfig;
|
|
14
|
+
detailModalProps?: ModalProps;
|
|
15
|
+
detailDescProps?: DescriptionsProps;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export interface TableDescItemsProps extends DescriptionsItemProp {
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
render?: (_: any, record: any, column: TableColumnProps, index: number) => VNode | JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export interface TableUseDetailReturnOptions {
|
|
23
|
+
openDetailModal: () => void;
|
|
24
|
+
DetailModal: () => JSX.Element;
|
|
25
|
+
detailsDataSource: Reactive<{
|
|
26
|
+
values: any;
|
|
27
|
+
}>;
|
|
28
|
+
detailModalLoading: Ref<boolean>;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
declare const _default: (props: TableUseDetailProps) => TableUseDetailReturnOptions;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { TableProps } from './index.type';
|
|
3
|
+
|
|
4
|
+
declare const _default: (props: {
|
|
5
|
+
pagination: Ref<{
|
|
6
|
+
page: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
}>;
|
|
9
|
+
total: any;
|
|
10
|
+
ownPaginProps: TableProps["ownPaginProps"];
|
|
11
|
+
}) => () => import("vue/jsx-runtime").JSX.Element;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TableProps, RequestParams } from './index.type';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface TableUseParmasProps {
|
|
5
|
+
ownPagin: boolean;
|
|
6
|
+
queryFormParams: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
fieldsNames: TableProps['fieldsNames'];
|
|
10
|
+
params: TableProps['params'];
|
|
11
|
+
requestParamsFormatter: TableProps['requestParamsFormatter'];
|
|
12
|
+
}
|
|
13
|
+
declare const _default: (props: TableUseParmasProps) => {
|
|
14
|
+
resultParams: ComputedRef<RequestParams>;
|
|
15
|
+
pagination: {
|
|
16
|
+
page: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|