@ftjs/antd 0.0.2 → 0.1.1
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/README.md +2 -2
- package/dist/antd-table/column-edit.d.ts +1 -0
- package/dist/antd-table/define-table.d.ts +7 -12
- package/dist/form/components/auto-complete.d.ts +2 -2
- package/dist/form/components/cascader.d.ts +2 -2
- package/dist/form/components/checkbox.d.ts +2 -2
- package/dist/form/components/date-picker.d.ts +2 -2
- package/dist/form/components/input-number.d.ts +2 -2
- package/dist/form/components/input.d.ts +2 -2
- package/dist/form/components/mentions.d.ts +2 -2
- package/dist/form/components/radio.d.ts +2 -2
- package/dist/form/components/range-picker.d.ts +2 -2
- package/dist/form/components/rate.d.ts +2 -2
- package/dist/form/components/select.d.ts +2 -2
- package/dist/form/components/slider.d.ts +2 -2
- package/dist/form/components/switch.d.ts +2 -2
- package/dist/form/components/textarea.d.ts +2 -2
- package/dist/form/components/tree-select.d.ts +2 -2
- package/dist/form/components/upload.d.ts +2 -2
- package/dist/form/define-form.d.ts +11 -11
- package/dist/form/register.d.ts +19 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.js +44 -32
- package/dist/vxe-table/define-vxe-table.d.ts +7 -12
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @ftjs/antd
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ ant-design-vue 适配器
|
|
|
9
9
|
|
|
10
10
|
## 文档
|
|
11
11
|
|
|
12
|
-
请查看 [@ftjs/antd 文档](https://
|
|
12
|
+
请查看 [@ftjs/antd 文档](https://ftjs-docs.yhs.ink/@ftjs/antd/introduction.html)。
|
|
13
13
|
|
|
14
14
|
## 许可证
|
|
15
15
|
|
|
@@ -10,3 +10,4 @@ export interface EditMap<_TableData extends Record<string, any>> {
|
|
|
10
10
|
select: Edit<"select", SelectProps>;
|
|
11
11
|
}
|
|
12
12
|
export declare const editMap: Map<keyof EditMap<any>, Component>;
|
|
13
|
+
export declare const registerEdit: (type: keyof EditMap<any>, component: Component) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueOf,
|
|
1
|
+
import { ValueOf, FtTableColumn, FtTablePropsMap } from '@ftjs/core';
|
|
2
2
|
import { Table, TableColumnType, TableProps as AntTableProps } from 'ant-design-vue';
|
|
3
3
|
import { FormColumn, FormExposed } from '../form/register';
|
|
4
4
|
import { ComponentSlots } from 'vue-component-type-helpers';
|
|
@@ -55,7 +55,7 @@ interface TableExposed<TableData extends Record<string, any>, SearchData extends
|
|
|
55
55
|
/**
|
|
56
56
|
* 列定义
|
|
57
57
|
*/
|
|
58
|
-
interface TableColumn<TableData extends Record<string, any>> extends
|
|
58
|
+
interface TableColumn<TableData extends Record<string, any>> extends FtTableColumn<TableData>, Omit<TableColumnType<TableData>, "title" | "dataIndex"> {
|
|
59
59
|
/**
|
|
60
60
|
* 行内编辑
|
|
61
61
|
*/
|
|
@@ -92,11 +92,6 @@ interface ExtendedProps<TableData extends Record<string, any>, SearchData extend
|
|
|
92
92
|
* @default 210
|
|
93
93
|
*/
|
|
94
94
|
minHeight?: number;
|
|
95
|
-
/**
|
|
96
|
-
* 是否隐藏搜索
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
hideSearch?: boolean;
|
|
100
95
|
/**
|
|
101
96
|
* 是否隐藏分页
|
|
102
97
|
* @default false
|
|
@@ -120,11 +115,11 @@ interface Pagination {
|
|
|
120
115
|
page: number;
|
|
121
116
|
pageSize: number;
|
|
122
117
|
}
|
|
123
|
-
export declare const
|
|
118
|
+
export declare const FtTable: new <TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData>(props: ((import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & (ExtendedProps<TableData, SearchData> & ({
|
|
124
119
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
125
120
|
} | {
|
|
126
121
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
127
|
-
}))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').
|
|
122
|
+
}))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & (ExtendedProps<TableData, SearchData> & ({
|
|
128
123
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
129
124
|
} | {
|
|
130
125
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -135,10 +130,10 @@ export declare const TfTable: new <TableData extends Record<string, any>, Search
|
|
|
135
130
|
C: {};
|
|
136
131
|
M: {};
|
|
137
132
|
Defaults: {};
|
|
138
|
-
}, (import('@ftjs/core').
|
|
133
|
+
}, (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & ExtendedProps<TableData, SearchData> & {
|
|
139
134
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
140
|
-
}) | (import('@ftjs/core').
|
|
135
|
+
}) | (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "antd"> & ExtendedProps<TableData, SearchData> & {
|
|
141
136
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
142
137
|
}), {}, {}, {}, {}, {}>;
|
|
143
|
-
export type
|
|
138
|
+
export type FtTableProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> = FtTablePropsMap<TableData, SearchData, "antd">;
|
|
144
139
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { AutoCompleteProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnAutoComplete<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 自动补全
|
|
7
7
|
*/
|
|
8
8
|
type: "auto-complete";
|
|
9
9
|
props?: Refs<AutoCompleteProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnAutoComplete<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnAutoComplete<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { CascaderProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnCascader<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 级联选择器
|
|
7
7
|
*/
|
|
8
8
|
type: "cascader";
|
|
9
9
|
props?: Refs<CascaderProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnCascader<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnCascader<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { CheckboxGroupProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnCheckbox<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 复选框
|
|
7
7
|
*/
|
|
8
8
|
type: "checkbox";
|
|
9
9
|
props?: Refs<CheckboxGroupProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnCheckbox<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnCheckbox<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { DatePickerProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnDatePicker<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 日期选择器
|
|
7
7
|
*/
|
|
8
8
|
type: "date-picker";
|
|
9
9
|
props?: Refs<DatePickerProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnDatePicker<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnDatePicker<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { InputNumberProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnInputNumber<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框
|
|
7
7
|
*/
|
|
8
8
|
type: "input-number";
|
|
9
9
|
props?: Refs<InputNumberProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnInputNumber<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnInputNumber<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { InputProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnInput<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 输入框
|
|
7
7
|
*/
|
|
8
8
|
type: "input";
|
|
9
9
|
props?: Refs<InputProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnInput<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnInput<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { MentionsProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnMentions<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 提及
|
|
7
7
|
*/
|
|
8
8
|
type: "mentions";
|
|
9
9
|
props?: Refs<MentionsProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnMentions<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnMentions<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { RadioGroupProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnRadio<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 单选框
|
|
7
7
|
*/
|
|
8
8
|
type: "radio";
|
|
9
9
|
props?: Refs<RadioGroupProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnRadio<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnRadio<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { RangePickerProps } from 'ant-design-vue/es/date-picker';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnRangePicker<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 范围选择器
|
|
7
7
|
*/
|
|
8
8
|
type: "range-picker";
|
|
9
9
|
props?: Refs<RangePickerProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnRangePicker<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnRangePicker<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { RateProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnRate<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 评分
|
|
7
7
|
*/
|
|
8
8
|
type: "rate";
|
|
9
9
|
props?: Refs<RateProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnRate<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnRate<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { SelectProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnSelect<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 选择器
|
|
7
7
|
*/
|
|
8
8
|
type: "select";
|
|
9
9
|
props?: Refs<SelectProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnSelect<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnSelect<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { SliderProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnSlider<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 滑块
|
|
7
7
|
*/
|
|
8
8
|
type: "slider";
|
|
9
9
|
props?: Refs<SliderProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnSlider<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnSlider<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { SwitchProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnSwitch<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 开关
|
|
7
7
|
*/
|
|
8
8
|
type: "switch";
|
|
9
9
|
props?: Refs<SwitchProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnSwitch<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnSwitch<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { TextAreaProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnTextarea<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 文本域
|
|
7
7
|
*/
|
|
8
8
|
type: "textarea";
|
|
9
9
|
props?: Refs<TextAreaProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnTextarea<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnTextarea<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Refs } from '@ftjs/core';
|
|
2
2
|
import { TreeSelectProps } from 'ant-design-vue';
|
|
3
3
|
import { AntdColumnBase } from '../register';
|
|
4
|
-
export interface
|
|
4
|
+
export interface FtFormColumnTreeSelect<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
5
5
|
/**
|
|
6
6
|
* 树选择
|
|
7
7
|
*/
|
|
8
8
|
type: "tree-select";
|
|
9
9
|
props?: Refs<TreeSelectProps>;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
11
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnTreeSelect<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnTreeSelect<any>> & ({
|
|
12
12
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
13
13
|
} | {
|
|
14
14
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -2,7 +2,7 @@ import { Refs } from '@ftjs/core';
|
|
|
2
2
|
import { UploadProps } from 'ant-design-vue';
|
|
3
3
|
import { VNodeChild } from 'vue';
|
|
4
4
|
import { AntdColumnBase } from '../register';
|
|
5
|
-
export interface
|
|
5
|
+
export interface FtFormColumnUpload<T extends Record<string, any>> extends AntdColumnBase<T> {
|
|
6
6
|
/**
|
|
7
7
|
* 上传
|
|
8
8
|
*/
|
|
@@ -15,7 +15,7 @@ export interface TfFormColumnUpload<T extends Record<string, any>> extends AntdC
|
|
|
15
15
|
}) => VNodeChild;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<
|
|
18
|
+
declare const _default: import('vue').DefineSetupFnComponent<import('@ftjs/core').CommonFormItemProps<FtFormColumnUpload<any>>, import('vue').EmitsOptions, {}, import('@ftjs/core').CommonFormItemProps<FtFormColumnUpload<any>> & ({
|
|
19
19
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
20
20
|
} | {
|
|
21
21
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FtFormPropsMap } from '@ftjs/core';
|
|
2
2
|
export declare const useRules: () => {
|
|
3
3
|
rules: import('vue').ComputedRef<{}>;
|
|
4
4
|
};
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const FtForm: new <FormData extends Record<string, any>>(props: ((import('@ftjs/core').FtFormIntrinsicProps<FormData, "antd"> & ({
|
|
6
6
|
width?: string;
|
|
7
7
|
hideFooter?: boolean;
|
|
8
8
|
hideConfirm?: boolean;
|
|
@@ -15,7 +15,7 @@ export declare const TfForm: new <FormData extends Record<string, any>>(props: (
|
|
|
15
15
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
16
16
|
} | {
|
|
17
17
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
18
|
-
})))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').
|
|
18
|
+
})))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtFormIntrinsicProps<FormData, "antd"> & ({
|
|
19
19
|
width?: string;
|
|
20
20
|
hideFooter?: boolean;
|
|
21
21
|
hideConfirm?: boolean;
|
|
@@ -35,7 +35,7 @@ export declare const TfForm: new <FormData extends Record<string, any>>(props: (
|
|
|
35
35
|
C: {};
|
|
36
36
|
M: {};
|
|
37
37
|
Defaults: {};
|
|
38
|
-
}, (import('@ftjs/core').
|
|
38
|
+
}, (import('@ftjs/core').FtFormIntrinsicProps<FormData, "antd"> & {
|
|
39
39
|
width?: string;
|
|
40
40
|
hideFooter?: boolean;
|
|
41
41
|
hideConfirm?: boolean;
|
|
@@ -46,7 +46,7 @@ export declare const TfForm: new <FormData extends Record<string, any>>(props: (
|
|
|
46
46
|
columns: import('./register').FormColumn<FormData>[];
|
|
47
47
|
} & {
|
|
48
48
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
49
|
-
}) | (import('@ftjs/core').
|
|
49
|
+
}) | (import('@ftjs/core').FtFormIntrinsicProps<FormData, "antd"> & {
|
|
50
50
|
width?: string;
|
|
51
51
|
hideFooter?: boolean;
|
|
52
52
|
hideConfirm?: boolean;
|
|
@@ -58,7 +58,7 @@ export declare const TfForm: new <FormData extends Record<string, any>>(props: (
|
|
|
58
58
|
} & {
|
|
59
59
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
60
60
|
}), {}, {}, {}, {}, {}>;
|
|
61
|
-
export declare const
|
|
61
|
+
export declare const FtFormSearch: new <FormData extends Record<string, any>>(props: ((import('@ftjs/core').FtFormIntrinsicProps<FormData, "antdSearch"> & ({
|
|
62
62
|
exposed?: import('./register').FormExposed<FormData> | undefined;
|
|
63
63
|
"onUpdate:exposed"?: ((exposed: import('./register').FormExposed<FormData>) => void) | undefined;
|
|
64
64
|
} & ({
|
|
@@ -67,7 +67,7 @@ export declare const TfFormSearch: new <FormData extends Record<string, any>>(pr
|
|
|
67
67
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
68
68
|
} | {
|
|
69
69
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
70
|
-
})))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').
|
|
70
|
+
})))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtFormIntrinsicProps<FormData, "antdSearch"> & ({
|
|
71
71
|
exposed?: import('./register').FormExposed<FormData> | undefined;
|
|
72
72
|
"onUpdate:exposed"?: ((exposed: import('./register').FormExposed<FormData>) => void) | undefined;
|
|
73
73
|
} & ({
|
|
@@ -83,14 +83,14 @@ export declare const TfFormSearch: new <FormData extends Record<string, any>>(pr
|
|
|
83
83
|
C: {};
|
|
84
84
|
M: {};
|
|
85
85
|
Defaults: {};
|
|
86
|
-
}, (import('@ftjs/core').
|
|
86
|
+
}, (import('@ftjs/core').FtFormIntrinsicProps<FormData, "antdSearch"> & {
|
|
87
87
|
exposed?: import('./register').FormExposed<FormData> | undefined;
|
|
88
88
|
"onUpdate:exposed"?: ((exposed: import('./register').FormExposed<FormData>) => void) | undefined;
|
|
89
89
|
} & {
|
|
90
90
|
columns: import('./register').FormColumn<FormData>[];
|
|
91
91
|
} & {
|
|
92
92
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
93
|
-
}) | (import('@ftjs/core').
|
|
93
|
+
}) | (import('@ftjs/core').FtFormIntrinsicProps<FormData, "antdSearch"> & {
|
|
94
94
|
exposed?: import('./register').FormExposed<FormData> | undefined;
|
|
95
95
|
"onUpdate:exposed"?: ((exposed: import('./register').FormExposed<FormData>) => void) | undefined;
|
|
96
96
|
} & {
|
|
@@ -98,5 +98,5 @@ export declare const TfFormSearch: new <FormData extends Record<string, any>>(pr
|
|
|
98
98
|
} & {
|
|
99
99
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
100
100
|
}), {}, {}, {}, {}, {}>;
|
|
101
|
-
export type
|
|
102
|
-
export type
|
|
101
|
+
export type FtFormProps<FormData extends Record<string, any>> = FtFormPropsMap<FormData, "antd">;
|
|
102
|
+
export type FtFormSearchProps<FormData extends Record<string, any>> = FtFormPropsMap<FormData, "antdSearch">;
|
package/dist/form/register.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CommonFormItemProps, FormInject,
|
|
1
|
+
import { CommonFormItemProps, FormInject, FtFormColumnBase, ValueOf } from '@ftjs/core';
|
|
2
2
|
import { RuleType, StoreValue, ValidatorRule } from 'ant-design-vue/es/form/interface';
|
|
3
3
|
import { Component, MaybeRefOrGetter, VNode } from 'vue';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
4
|
+
import { FtFormColumnInput } from './components/input';
|
|
5
|
+
import { FtFormColumnSelect } from './components/select';
|
|
6
|
+
import { FtFormColumnDatePicker } from './components/date-picker';
|
|
7
|
+
import { FtFormColumnRangePicker } from './components/range-picker';
|
|
8
|
+
import { FtFormColumnRadio } from './components/radio';
|
|
9
|
+
import { FtFormColumnTextarea } from './components/textarea';
|
|
10
|
+
import { FtFormColumnUpload } from './components/upload';
|
|
11
|
+
import { FtFormColumnCascader } from './components/cascader';
|
|
12
|
+
import { FtFormColumnAutoComplete } from './components/auto-complete';
|
|
13
|
+
import { FtFormColumnCheckbox } from './components/checkbox';
|
|
14
|
+
import { FtFormColumnInputNumber } from './components/input-number';
|
|
15
|
+
import { FtFormColumnMentions } from './components/mentions';
|
|
16
|
+
import { FtFormColumnRate } from './components/rate';
|
|
17
|
+
import { FtFormColumnSlider } from './components/slider';
|
|
18
|
+
import { FtFormColumnSwitch } from './components/switch';
|
|
19
|
+
import { FtFormColumnTreeSelect } from './components/tree-select';
|
|
20
20
|
import { FormInstance, FormProps } from 'ant-design-vue';
|
|
21
21
|
export type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
22
22
|
export type VueNode = VNodeChildAtom | VNodeChildAtom[] | VNode;
|
|
@@ -26,7 +26,7 @@ export interface FormExposed<T extends Record<string, any>> {
|
|
|
26
26
|
setAsDefault: FormInject<T, "antd">["setAsDefault"];
|
|
27
27
|
formInstance: FormInstance;
|
|
28
28
|
}
|
|
29
|
-
export interface AntdColumnBase<FormData extends Record<string, any>> extends
|
|
29
|
+
export interface AntdColumnBase<FormData extends Record<string, any>> extends FtFormColumnBase<FormData> {
|
|
30
30
|
/**
|
|
31
31
|
* 校验规则
|
|
32
32
|
*/
|
|
@@ -40,7 +40,7 @@ export interface RegisterColumnMap<FormData extends Record<string, any>> {
|
|
|
40
40
|
/**
|
|
41
41
|
* 全部的 antd column 集合
|
|
42
42
|
*/
|
|
43
|
-
export type FormColumn<FormData extends Record<string, any>> =
|
|
43
|
+
export type FormColumn<FormData extends Record<string, any>> = FtFormColumnDatePicker<FormData> | FtFormColumnRangePicker<FormData> | FtFormColumnRadio<FormData> | FtFormColumnSelect<FormData> | FtFormColumnTextarea<FormData> | FtFormColumnInput<FormData> | FtFormColumnUpload<FormData> | FtFormColumnCascader<FormData> | FtFormColumnAutoComplete<FormData> | FtFormColumnCheckbox<FormData> | FtFormColumnInputNumber<FormData> | FtFormColumnMentions<FormData> | FtFormColumnRate<FormData> | FtFormColumnSlider<FormData> | FtFormColumnSwitch<FormData> | FtFormColumnTreeSelect<FormData> | ValueOf<RegisterColumnMap<FormData>>;
|
|
44
44
|
export declare const formRenderMap: Map<string, Component>;
|
|
45
45
|
export declare function registerForm<T extends keyof RegisterColumnMap<any>>(type: T, Component: Component<CommonFormItemProps<RegisterColumnMap<any>[T]>>): void;
|
|
46
46
|
declare module "@ftjs/core" {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, toValue, createVNode, mergeProps, unref, isVNode, ref, useId, Fragment, createTextVNode, watchEffect, onMounted, onUnmounted, nextTick, reactive, watch, h } from "vue";
|
|
2
2
|
import { SwapOutlined, SettingOutlined } from "@ant-design/icons-vue";
|
|
3
|
-
import { getField, defineFormComponent, useFormItem, unrefs,
|
|
4
|
-
import { FormItem, Input, Select, DatePicker, RangePicker, Radio, Textarea, Upload, Cascader, AutoComplete, CheckboxGroup, InputNumber, Mentions, Rate, Slider, Switch, TreeSelect, Modal, Tree, Button, Form, Table, Spin, Pagination } from "ant-design-vue";
|
|
3
|
+
import { getField, defineFormComponent, useFormItem, unrefs, defineFtForm, useFormInject, set, defineFtTable, useTableInject, get, cloneDeep } from "@ftjs/core";
|
|
4
|
+
import { FormItem, Input, Select, DatePicker, RangePicker, Radio, Textarea, Upload, Cascader, AutoComplete, CheckboxGroup, InputNumber, Mentions, Rate, Slider, Switch, TreeSelect, Modal, Tree, Button, Form, Divider, Table, Spin, Pagination } from "ant-design-vue";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import { VxeGrid } from "vxe-table";
|
|
7
7
|
const useFormItemProps = (column) => {
|
|
@@ -403,7 +403,7 @@ const useExposed = (formRef) => {
|
|
|
403
403
|
});
|
|
404
404
|
});
|
|
405
405
|
};
|
|
406
|
-
const
|
|
406
|
+
const FtForm = /* @__PURE__ */ defineFtForm((_, ctx) => {
|
|
407
407
|
const {
|
|
408
408
|
form,
|
|
409
409
|
width,
|
|
@@ -473,7 +473,7 @@ const TfForm = /* @__PURE__ */ defineTfForm((_, ctx) => {
|
|
|
473
473
|
}], ["hideReset", {
|
|
474
474
|
type: Boolean
|
|
475
475
|
}]]);
|
|
476
|
-
const
|
|
476
|
+
const FtFormSearch = /* @__PURE__ */ defineFtForm((_, ctx) => {
|
|
477
477
|
const {
|
|
478
478
|
form,
|
|
479
479
|
columnsChecked,
|
|
@@ -503,7 +503,7 @@ const TfFormSearch = /* @__PURE__ */ defineTfForm((_, ctx) => {
|
|
|
503
503
|
wrapperCol: {
|
|
504
504
|
style: {
|
|
505
505
|
// 这样定义宽度,可以方便后续修改
|
|
506
|
-
width: `var(--
|
|
506
|
+
width: `var(--ft-form-control-width, 200px)`
|
|
507
507
|
}
|
|
508
508
|
},
|
|
509
509
|
..._formProps.value,
|
|
@@ -655,7 +655,7 @@ const TfFormSearch = /* @__PURE__ */ defineTfForm((_, ctx) => {
|
|
|
655
655
|
}, ctx.attrs, formProps.value), {
|
|
656
656
|
default: () => [ctx.slots.formContent(), createVNode(FormItem, {
|
|
657
657
|
"style": {
|
|
658
|
-
"--
|
|
658
|
+
"--ft-form-control-width": "220px"
|
|
659
659
|
}
|
|
660
660
|
}, {
|
|
661
661
|
default: () => [createVNode("div", {
|
|
@@ -685,7 +685,10 @@ const editMap = /* @__PURE__ */ new Map([
|
|
|
685
685
|
["input", Input],
|
|
686
686
|
["select", Select]
|
|
687
687
|
]);
|
|
688
|
-
const
|
|
688
|
+
const registerEdit = (type, component) => {
|
|
689
|
+
editMap.set(type, component);
|
|
690
|
+
};
|
|
691
|
+
const FtTable = defineFtTable((_p, ctx) => {
|
|
689
692
|
const {
|
|
690
693
|
formColumns,
|
|
691
694
|
tableColumns,
|
|
@@ -700,7 +703,6 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
700
703
|
initSearch,
|
|
701
704
|
fitFlexHeight,
|
|
702
705
|
minHeight,
|
|
703
|
-
hideSearch,
|
|
704
706
|
hidePagination,
|
|
705
707
|
onSearch,
|
|
706
708
|
onChange,
|
|
@@ -717,7 +719,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
717
719
|
if (!pagination && !hidePagination.value) {
|
|
718
720
|
pagination = {
|
|
719
721
|
page: 1,
|
|
720
|
-
pageSize: defaultPageSize.value
|
|
722
|
+
pageSize: defaultPageSize.value
|
|
721
723
|
};
|
|
722
724
|
}
|
|
723
725
|
onSearch(formData, {
|
|
@@ -745,7 +747,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
745
747
|
bordered: true,
|
|
746
748
|
pagination: hidePagination.value ? false : {
|
|
747
749
|
total: total.value,
|
|
748
|
-
defaultPageSize: defaultPageSize.value
|
|
750
|
+
defaultPageSize: defaultPageSize.value,
|
|
749
751
|
current: currentPage.value,
|
|
750
752
|
onChange: (page, pageSize) => {
|
|
751
753
|
currentPage.value = page;
|
|
@@ -779,6 +781,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
779
781
|
};
|
|
780
782
|
let tableStyle;
|
|
781
783
|
const containerRef = ref();
|
|
784
|
+
const tableRef = ref();
|
|
782
785
|
const calcTableHeight = () => {
|
|
783
786
|
const container = containerRef.value;
|
|
784
787
|
const table = container == null ? void 0 : container.querySelector(".ant-table-wrapper");
|
|
@@ -789,7 +792,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
789
792
|
let y = table.clientHeight - // pagination不是立即渲染的,其高度为64
|
|
790
793
|
// 多减去2px,避免出现小数
|
|
791
794
|
64 - 2 - ((header == null ? void 0 : header.clientHeight) ?? 0) - ((footer == null ? void 0 : footer.clientHeight) ?? 0);
|
|
792
|
-
const minHeightValue = minHeight.value
|
|
795
|
+
const minHeightValue = minHeight.value;
|
|
793
796
|
if (y < minHeightValue) y = minHeightValue;
|
|
794
797
|
_scrollY.value = y;
|
|
795
798
|
};
|
|
@@ -807,6 +810,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
807
810
|
let prevHeight;
|
|
808
811
|
let timer;
|
|
809
812
|
onMounted(() => {
|
|
813
|
+
var _a;
|
|
810
814
|
resizeObserver = new ResizeObserver((entries) => {
|
|
811
815
|
const height = entries[0].contentRect.height;
|
|
812
816
|
if (prevHeight === height) return;
|
|
@@ -818,7 +822,7 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
818
822
|
calcTableHeight();
|
|
819
823
|
}, 100);
|
|
820
824
|
});
|
|
821
|
-
resizeObserver.observe(
|
|
825
|
+
resizeObserver.observe((_a = tableRef.value) == null ? void 0 : _a.$el);
|
|
822
826
|
});
|
|
823
827
|
onUnmounted(() => {
|
|
824
828
|
resizeObserver.disconnect();
|
|
@@ -871,13 +875,17 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
871
875
|
return createVNode("div", {
|
|
872
876
|
"ref": containerRef,
|
|
873
877
|
"style": containerStyle
|
|
874
|
-
}, [
|
|
878
|
+
}, [formColumns.value.length > 0 && createVNode(Fragment, null, [createVNode(FtFormSearch, mergeProps({
|
|
875
879
|
"exposed": formExposed.value,
|
|
876
880
|
"onUpdate:exposed": ($event) => formExposed.value = $event,
|
|
877
881
|
"cache": cache.value,
|
|
878
882
|
"columns": formColumns.value,
|
|
879
883
|
"onSubmit": () => handleSearch()
|
|
880
|
-
}, internalFormProps.value), null),
|
|
884
|
+
}, internalFormProps.value), null), createVNode(Divider, {
|
|
885
|
+
"dashed": true,
|
|
886
|
+
"style": "margin: 0"
|
|
887
|
+
}, null)]), (ctx.slots.buttons || ctx.slots.tools) && createVNode("div", null, [(_b = (_a = ctx.slots).buttons) == null ? void 0 : _b.call(_a), (_d = (_c = ctx.slots).tools) == null ? void 0 : _d.call(_c)]), createVNode(Table, mergeProps({
|
|
888
|
+
"ref": tableRef,
|
|
881
889
|
"style": tableStyle,
|
|
882
890
|
"columns": columns.value,
|
|
883
891
|
"loading": loading.value,
|
|
@@ -896,11 +904,12 @@ const TfTable = defineTfTable((_p, ctx) => {
|
|
|
896
904
|
}, ["onChange", "onExpand", "onExpandedRowsChange", "onResizeColumn", "onSearch", ["initSearch", {
|
|
897
905
|
type: Boolean,
|
|
898
906
|
default: true
|
|
899
|
-
}], "fitFlexHeight", "minHeight",
|
|
907
|
+
}], "fitFlexHeight", ["minHeight", {
|
|
908
|
+
type: Number,
|
|
909
|
+
default: 210
|
|
910
|
+
}], ["hidePagination", {
|
|
900
911
|
type: Boolean
|
|
901
|
-
}], "exposed", "onUpdate:exposed"
|
|
902
|
-
type: Boolean
|
|
903
|
-
}]]);
|
|
912
|
+
}], "exposed", "onUpdate:exposed"]);
|
|
904
913
|
function useEdit(tableData) {
|
|
905
914
|
const editRowMap = reactive(/* @__PURE__ */ new Map());
|
|
906
915
|
const createBodyCell = (bodyCellDefault) => {
|
|
@@ -929,7 +938,7 @@ function useEdit(tableData) {
|
|
|
929
938
|
if (component) {
|
|
930
939
|
return h(component, {
|
|
931
940
|
...edit.props,
|
|
932
|
-
class: "
|
|
941
|
+
class: "ft-table-edit",
|
|
933
942
|
value: get(scopeProps.record, field),
|
|
934
943
|
"onUpdate:value": (value) => {
|
|
935
944
|
set(scopeProps.record, field, value);
|
|
@@ -971,7 +980,7 @@ function useEdit(tableData) {
|
|
|
971
980
|
saveEditRow
|
|
972
981
|
};
|
|
973
982
|
}
|
|
974
|
-
const
|
|
983
|
+
const FtVxeTable = defineFtTable((_, ctx) => {
|
|
975
984
|
const {
|
|
976
985
|
formColumns,
|
|
977
986
|
tableColumns,
|
|
@@ -986,7 +995,6 @@ const TfVxeTable = defineTfTable((_, ctx) => {
|
|
|
986
995
|
initSearch,
|
|
987
996
|
fitFlexHeight,
|
|
988
997
|
minHeight,
|
|
989
|
-
hideSearch,
|
|
990
998
|
hidePagination,
|
|
991
999
|
rowConfig: _rowConfig,
|
|
992
1000
|
customConfig: _customConfig,
|
|
@@ -1005,7 +1013,7 @@ const TfVxeTable = defineTfTable((_, ctx) => {
|
|
|
1005
1013
|
if (!pagination && !hidePagination.value) {
|
|
1006
1014
|
pagination = {
|
|
1007
1015
|
page: 1,
|
|
1008
|
-
pageSize: defaultPageSize.value
|
|
1016
|
+
pageSize: defaultPageSize.value
|
|
1009
1017
|
};
|
|
1010
1018
|
}
|
|
1011
1019
|
await onSearch(formData, {
|
|
@@ -1138,13 +1146,16 @@ const TfVxeTable = defineTfTable((_, ctx) => {
|
|
|
1138
1146
|
return () => createVNode("div", {
|
|
1139
1147
|
"ref": containerRef,
|
|
1140
1148
|
"style": containerStyle
|
|
1141
|
-
}, [
|
|
1149
|
+
}, [formColumns.value.length > 0 && createVNode(Fragment, null, [createVNode(FtFormSearch, mergeProps({
|
|
1142
1150
|
"exposed": formExposed.value,
|
|
1143
1151
|
"onUpdate:exposed": ($event) => formExposed.value = $event,
|
|
1144
1152
|
"cache": cache.value,
|
|
1145
1153
|
"columns": formColumns.value,
|
|
1146
1154
|
"onSubmit": () => handleSearch()
|
|
1147
|
-
}, internalFormProps.value), null), createVNode(
|
|
1155
|
+
}, internalFormProps.value), null), createVNode(Divider, {
|
|
1156
|
+
"dashed": true,
|
|
1157
|
+
"style": "margin: 0"
|
|
1158
|
+
}, null)]), createVNode("div", {
|
|
1148
1159
|
"style": tableStyle
|
|
1149
1160
|
}, [createVNode(VxeGrid, mergeProps({
|
|
1150
1161
|
"ref": (ref2) => tableExposed.value = ref2,
|
|
@@ -1172,8 +1183,9 @@ const TfVxeTable = defineTfTable((_, ctx) => {
|
|
|
1172
1183
|
"onUpdate:current": ($event) => current.value = $event,
|
|
1173
1184
|
"showQuickJumper": true,
|
|
1174
1185
|
"showSizeChanger": true,
|
|
1186
|
+
"showLessItems": true,
|
|
1175
1187
|
"total": total.value,
|
|
1176
|
-
"defaultPageSize": defaultPageSize.value
|
|
1188
|
+
"defaultPageSize": defaultPageSize.value,
|
|
1177
1189
|
"showTotal": (total2) => {
|
|
1178
1190
|
if (total2 === 0) return null;
|
|
1179
1191
|
return `共 ${total2} 条数据`;
|
|
@@ -1198,14 +1210,14 @@ const TfVxeTable = defineTfTable((_, ctx) => {
|
|
|
1198
1210
|
default: true
|
|
1199
1211
|
}], "fitFlexHeight", "minHeight", ["hidePagination", {
|
|
1200
1212
|
type: Boolean
|
|
1201
|
-
}], "exposed", "onUpdate:exposed",
|
|
1202
|
-
type: Boolean
|
|
1203
|
-
}], "rowConfig", "treeConfig", "customConfig", "toolbarConfig", "columnConfig"]);
|
|
1213
|
+
}], "exposed", "onUpdate:exposed", "rowConfig", "treeConfig", "customConfig", "toolbarConfig", "columnConfig"]);
|
|
1204
1214
|
export {
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1215
|
+
FtForm,
|
|
1216
|
+
FtFormSearch,
|
|
1217
|
+
FtTable,
|
|
1218
|
+
FtVxeTable,
|
|
1219
|
+
editMap,
|
|
1220
|
+
registerEdit,
|
|
1209
1221
|
registerForm,
|
|
1210
1222
|
useRules
|
|
1211
1223
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FtTableColumn, FtTablePropsMap, ValueOf } from '@ftjs/core';
|
|
2
2
|
import { VxeGridProps, VxeGridSlots, VxeGridInstance, VxeGridPropTypes } from 'vxe-table';
|
|
3
3
|
import { FormColumn, FormExposed } from '../form/register';
|
|
4
4
|
import { EditMap } from '../antd-table/column-edit';
|
|
@@ -37,7 +37,7 @@ interface VxeTableExposed<TableData extends Record<string, any>, SearchData exte
|
|
|
37
37
|
/**
|
|
38
38
|
* 列定义
|
|
39
39
|
*/
|
|
40
|
-
type VxeTableColumn<TableData extends Record<string, any>> =
|
|
40
|
+
type VxeTableColumn<TableData extends Record<string, any>> = FtTableColumn<TableData> & Omit<VxeGridPropTypes.Column<TableData>, "title" | "editRender"> & {
|
|
41
41
|
/**
|
|
42
42
|
* 行内编辑
|
|
43
43
|
*/
|
|
@@ -92,11 +92,6 @@ interface VxeExtendedProps<TableData extends Record<string, any>, SearchData ext
|
|
|
92
92
|
* vxe-table 列配置
|
|
93
93
|
*/
|
|
94
94
|
columnConfig?: VxeGridProps<TableData>["columnConfig"];
|
|
95
|
-
/**
|
|
96
|
-
* 是否隐藏搜索
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
hideSearch?: boolean;
|
|
100
95
|
/**
|
|
101
96
|
* 是否隐藏分页
|
|
102
97
|
* @default false
|
|
@@ -112,11 +107,11 @@ interface VxePagination {
|
|
|
112
107
|
page: number;
|
|
113
108
|
pageSize: number;
|
|
114
109
|
}
|
|
115
|
-
export declare const
|
|
110
|
+
export declare const FtVxeTable: new <TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData>(props: ((import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & (VxeExtendedProps<TableData, SearchData> & ({
|
|
116
111
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
117
112
|
} | {
|
|
118
113
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
119
|
-
}))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').
|
|
114
|
+
}))) & import('vue').VNodeProps) & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps) => import('vue').CreateComponentPublicInstanceWithMixins<import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & (VxeExtendedProps<TableData, SearchData> & ({
|
|
120
115
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
121
116
|
} | {
|
|
122
117
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
@@ -130,10 +125,10 @@ export declare const TfVxeTable: new <TableData extends Record<string, any>, Sea
|
|
|
130
125
|
C: {};
|
|
131
126
|
M: {};
|
|
132
127
|
Defaults: {};
|
|
133
|
-
}, (import('@ftjs/core').
|
|
128
|
+
}, (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & VxeExtendedProps<TableData, SearchData> & {
|
|
134
129
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
135
|
-
}) | (import('@ftjs/core').
|
|
130
|
+
}) | (import('@ftjs/core').FtTableIntrinsicProps<TableData, SearchData, "vxe-table"> & VxeExtendedProps<TableData, SearchData> & {
|
|
136
131
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
137
132
|
}), {}, {}, {}, {}, {}>;
|
|
138
|
-
export type
|
|
133
|
+
export type FtVxeTableProps<TableData extends Record<string, any>, SearchData extends Record<string, any> = TableData> = FtTablePropsMap<TableData, SearchData, "vxe-table">;
|
|
139
134
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ftjs/antd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"dayjs": "^1.11.13",
|
|
24
24
|
"vue": "^3.5.13",
|
|
25
25
|
"vue-component-type-helpers": "^2.2.0",
|
|
26
|
-
"vxe-table": "4.11.
|
|
26
|
+
"vxe-table": "4.11.15",
|
|
27
27
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
28
28
|
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
|
29
29
|
"typescript": "^5.7.3",
|
|
30
30
|
"vite": "^6.1.0",
|
|
31
31
|
"vite-plugin-dts": "^4.5.0",
|
|
32
32
|
"vue-tsc": "2.2.0",
|
|
33
|
-
"@ftjs/core": "0.
|
|
33
|
+
"@ftjs/core": "0.1.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@ant-design/icons-vue": ">=7.0.0",
|
|
37
37
|
"vue": ">=3.3.0",
|
|
38
|
-
"@ftjs/core": ">=
|
|
38
|
+
"@ftjs/core": ">=0.0.1",
|
|
39
39
|
"ant-design-vue": ">=4.0.0",
|
|
40
40
|
"dayjs": ">=1.0.0",
|
|
41
41
|
"vxe-table": ">=4.0.0"
|