@flatbiz/antd 4.2.102 → 4.2.103
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/esm/drag-editable-table/index.css +0 -0
- package/esm/drag-editable-table/index.js +28 -0
- package/esm/drag-editable-table/index.js.map +1 -0
- package/esm/drag-table/index.js +1 -1
- package/esm/drag-table/index.js.map +1 -1
- package/esm/file-import/index.js.map +1 -1
- package/esm/index.js +13 -10
- package/esm/json-editor/index.css +0 -0
- package/esm/json-editor/index.js +5 -0
- package/esm/json-editor/index.js.map +1 -0
- package/esm/search-form/index.css +0 -0
- package/esm/search-form/index.js +5 -0
- package/esm/search-form/index.js.map +1 -0
- package/esm/search-menu/index.js +4 -1
- package/esm/search-menu/index.js.map +1 -1
- package/esm/table-cell-render/index.css +1 -1
- package/esm/table-cell-render/index.js +1 -1
- package/esm/table-cell-render/index.js.map +1 -1
- package/esm/table-scrollbar/index.js +1 -1
- package/esm/table-scrollbar/index.js.map +1 -1
- package/esm/text-css-ellipsis/index.js.map +1 -1
- package/esm/text-overflow/index.css +1 -0
- package/esm/text-overflow/index.js +6 -0
- package/esm/text-overflow/index.js.map +1 -0
- package/esm/text-overflow-render/index.js.map +1 -1
- package/esm/upload-wrapper/index.js +1 -1
- package/esm/upload-wrapper/index.js.map +1 -1
- package/index.d.ts +1035 -796
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -823,172 +823,6 @@ export type DragCollapseFormListProps = {
|
|
|
823
823
|
* ```
|
|
824
824
|
*/
|
|
825
825
|
export declare const DragCollapseFormList: (props: DragCollapseFormListProps) => import("react/jsx-runtime").JSX.Element;
|
|
826
|
-
export type DragFormListContentProps = {
|
|
827
|
-
/** Form.List item fieldData */
|
|
828
|
-
formListFieldData: FormListFieldData;
|
|
829
|
-
/**
|
|
830
|
-
* 当前阶段 完整 formItem name
|
|
831
|
-
* ```
|
|
832
|
-
* 1. 获取当前输入项Item数据
|
|
833
|
-
* form.getFieldValue(props.formStageCompleteName);
|
|
834
|
-
* 2. 获取当前输入项Item指定字段数据
|
|
835
|
-
* form.getFieldValue([...props.formStageCompleteName, 'key']);
|
|
836
|
-
* ```
|
|
837
|
-
*/
|
|
838
|
-
formStageCompleteName: (string | number)[];
|
|
839
|
-
/**
|
|
840
|
-
* formList上一级 formItem完整name
|
|
841
|
-
*/
|
|
842
|
-
prevCompleteName: (string | number)[];
|
|
843
|
-
/** Form.List 操作项 */
|
|
844
|
-
operation: FormListOperation;
|
|
845
|
-
/** 索引 */
|
|
846
|
-
index: number;
|
|
847
|
-
/** 获取当前FormList 内部 Form.Item name */
|
|
848
|
-
getInsideFormItemName: (key: string) => Array<string | number>;
|
|
849
|
-
/** 获取当前 FormList Item 数据 */
|
|
850
|
-
getInsideFormItemData: () => TPlainObject;
|
|
851
|
-
/** 唯一值字段Key */
|
|
852
|
-
uidKey: string;
|
|
853
|
-
};
|
|
854
|
-
export type DragFormListProps = {
|
|
855
|
-
className?: string;
|
|
856
|
-
style?: CSSProperties;
|
|
857
|
-
itemStyle?: CSSProperties;
|
|
858
|
-
/** formList item 数据中的唯一值,默认值:uid */
|
|
859
|
-
uidFieldName?: string;
|
|
860
|
-
/** formList name */
|
|
861
|
-
name: string | number | (string | number)[];
|
|
862
|
-
/**
|
|
863
|
-
* formList上一级 formItem完整name
|
|
864
|
-
* ```
|
|
865
|
-
* 1. 如果没有传 []
|
|
866
|
-
* 2. FormList内部通过 Form.useWatch 取值需要完整 name
|
|
867
|
-
* ```
|
|
868
|
-
*/
|
|
869
|
-
prevCompleteName: (string | number)[];
|
|
870
|
-
/** 拖拽回调 */
|
|
871
|
-
onDropChange?: (items: TPlainObject[]) => void;
|
|
872
|
-
/** 设置拖拽图标 */
|
|
873
|
-
dragIcon?: ReactElement;
|
|
874
|
-
/** 禁用拖拽,拖拽图标隐藏 */
|
|
875
|
-
dragDisabled?: boolean;
|
|
876
|
-
/** 设置item禁止拖拽 */
|
|
877
|
-
getItemDragDisabled?: (uid: string | number, index: number) => boolean;
|
|
878
|
-
/** 新增行默认值,自定义onTableAfterRender后失效 */
|
|
879
|
-
getAddRowDefaultValues?: () => TPlainObject;
|
|
880
|
-
/** 隐藏新增行按钮 */
|
|
881
|
-
hiddenAddRowButton?: boolean;
|
|
882
|
-
/** 自定义新增行按钮,getAddRowDefaultValues配置失效 */
|
|
883
|
-
onCustomAddRowButton?: (operation: FormListOperation) => ReactElement;
|
|
884
|
-
/** formListItem 内容 */
|
|
885
|
-
children: (data: DragFormListContentProps) => ReactElement;
|
|
886
|
-
/** 隐藏数据为空渲染 */
|
|
887
|
-
hiddenEmptyRender?: boolean;
|
|
888
|
-
/** formList内部渲染包装,多用于FormListWrapper嵌套布局 */
|
|
889
|
-
formListChildrenWrapper?: (props: {
|
|
890
|
-
children: ReactElement;
|
|
891
|
-
}) => ReactElement;
|
|
892
|
-
rules?: FormListProps["rules"];
|
|
893
|
-
};
|
|
894
|
-
/**
|
|
895
|
-
* 可拖拽FormList
|
|
896
|
-
* ```
|
|
897
|
-
* 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
|
|
898
|
-
* 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
|
|
899
|
-
* ```
|
|
900
|
-
*/
|
|
901
|
-
export declare const DragFormList: (props: DragFormListProps) => import("react/jsx-runtime").JSX.Element;
|
|
902
|
-
export type DragTableProps = Omit<TableProps<TPlainObject>, "dataSource"> & {
|
|
903
|
-
dragIcon?: boolean | ReactElement;
|
|
904
|
-
/** 表格数据唯一值字段Key */
|
|
905
|
-
uidFieldKey: string;
|
|
906
|
-
dataSource?: TPlainObject[];
|
|
907
|
-
/**
|
|
908
|
-
* 拖拽结束事件
|
|
909
|
-
* ```
|
|
910
|
-
* dataSource: 拖拽完成后的数据源
|
|
911
|
-
* dragData
|
|
912
|
-
* 1. activeId 拖拽ID
|
|
913
|
-
* 2. activeIndex 拖拽起始表格数组索引值
|
|
914
|
-
* 3. overIndex 拖拽结束表格数组索引值
|
|
915
|
-
* ```
|
|
916
|
-
*/
|
|
917
|
-
onDragChange?: (dataSource: TPlainObject[], dragData: {
|
|
918
|
-
activeId: string | number;
|
|
919
|
-
activeIndex: number;
|
|
920
|
-
overIndex: number;
|
|
921
|
-
}) => void;
|
|
922
|
-
};
|
|
923
|
-
/**
|
|
924
|
-
* 可拖拽表格
|
|
925
|
-
* ```
|
|
926
|
-
* 1. 必须设置唯一值字段 uidFieldKey
|
|
927
|
-
* 2. 如果拖拽显示异常,请检查 uidFieldKey 是否正确
|
|
928
|
-
* ```
|
|
929
|
-
*/
|
|
930
|
-
export declare const DragTable: (props: DragTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
931
|
-
export interface DrawerOperationProps {
|
|
932
|
-
loading?: boolean;
|
|
933
|
-
okText?: string;
|
|
934
|
-
cancelText?: string;
|
|
935
|
-
onOk?: () => void;
|
|
936
|
-
onCancel?: () => void;
|
|
937
|
-
hideOkBtn?: boolean;
|
|
938
|
-
okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
939
|
-
cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
940
|
-
}
|
|
941
|
-
export type DrawerWrapperStaticMethods = {
|
|
942
|
-
Content: typeof DrawerWrapperContent;
|
|
943
|
-
Footer: typeof DrawerWrapperFooter;
|
|
944
|
-
};
|
|
945
|
-
export type DrawerWrapperProps = {
|
|
946
|
-
className?: string;
|
|
947
|
-
/**
|
|
948
|
-
* 整个drawer页面级的spinning <Page loading />
|
|
949
|
-
*/
|
|
950
|
-
pageLoading?: boolean;
|
|
951
|
-
} & Omit<DrawerProps, "footer">;
|
|
952
|
-
declare const DrawerWrapperContent: (props: {
|
|
953
|
-
operationProps?: DrawerOperationProps;
|
|
954
|
-
children?: ReactNode;
|
|
955
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
956
|
-
declare const DrawerWrapperFooter: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
957
|
-
/**
|
|
958
|
-
* 弹窗机制
|
|
959
|
-
* @deprecated 已过时 4.3.0版本移除;请使用 const { appDialogModal } = FbaApp.useDialogModal();
|
|
960
|
-
* ```
|
|
961
|
-
* 1. 默认 destroyOnClose = true
|
|
962
|
-
* 2. 默认 forceRender = false
|
|
963
|
-
* 3. 如果设置 forceRender = true,会导致弹框中的接口提前调用
|
|
964
|
-
*
|
|
965
|
-
* 注意
|
|
966
|
-
* 1. <Drawer /> 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 destroyOnClose。
|
|
967
|
-
* 2. <Drawer /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Drawer 关闭时销毁表单字段数据,需要设置 <Form preserve={false} />。
|
|
968
|
-
*
|
|
969
|
-
* ```
|
|
970
|
-
*/
|
|
971
|
-
export declare const DrawerWrapper: FC<DrawerWrapperProps> & DrawerWrapperStaticMethods;
|
|
972
|
-
export type TDynamicNodeProps = {
|
|
973
|
-
className?: string;
|
|
974
|
-
getContainer?: HTMLElement | (() => HTMLElement) | string;
|
|
975
|
-
content?: ReactElement;
|
|
976
|
-
fixed?: boolean;
|
|
977
|
-
style?: CSSProperties;
|
|
978
|
-
};
|
|
979
|
-
/**
|
|
980
|
-
* 动态添加 element 元素
|
|
981
|
-
* ```
|
|
982
|
-
* 1. 默认添加到 body 下
|
|
983
|
-
* 2. 可通过 getContainer 参数设置添加位置
|
|
984
|
-
* ```
|
|
985
|
-
*/
|
|
986
|
-
export declare const dynamicNode: {
|
|
987
|
-
append: (props?: TDynamicNodeProps) => {
|
|
988
|
-
elementId: string;
|
|
989
|
-
};
|
|
990
|
-
remove: (elementId?: string) => void;
|
|
991
|
-
};
|
|
992
826
|
export type TipsWrapperProps = {
|
|
993
827
|
gap?: number;
|
|
994
828
|
className?: string;
|
|
@@ -1026,683 +860,649 @@ export type TipsWrapperProps = {
|
|
|
1026
860
|
* ```
|
|
1027
861
|
*/
|
|
1028
862
|
export declare const TipsWrapper: (props: TipsWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
1029
|
-
export type
|
|
863
|
+
export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
|
|
864
|
+
export type SelectorServiceConfig = {
|
|
865
|
+
params?: TPlainObject;
|
|
866
|
+
/** 与 params 配合使用 */
|
|
867
|
+
requiredParamsKeys?: string[];
|
|
868
|
+
onRequest?: (params?: TAny) => Promise<TAny>;
|
|
1030
869
|
/**
|
|
1031
|
-
*
|
|
870
|
+
* 响应数据适配器
|
|
871
|
+
*/
|
|
872
|
+
onRequestResultAdapter?: (respData: TAny) => TPlainObject[];
|
|
873
|
+
};
|
|
874
|
+
export type SelectorWrapperProps = Omit<SelectProps, "onSearch" | "notFoundContent" | "options" | "fieldNames" | "onChange" | "value" | "loading" | "mode"> & {
|
|
875
|
+
/** 不支持 tags 模式,tags模式请使用 SelectorWrapperSimple 组件 */
|
|
876
|
+
mode?: "multiple";
|
|
877
|
+
/** key值,相同的key 同页面可共用缓存数据 */
|
|
878
|
+
modelKey: string;
|
|
879
|
+
/**
|
|
880
|
+
* 参数Key映射
|
|
1032
881
|
* ```
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
882
|
+
* 1. 默认值:value=value、label=label、disabled=disabled
|
|
883
|
+
* 2. list 为 onRequest 返回数据中列表key值,可多级取值,例如: 'a.b.c'
|
|
884
|
+
* 3. 配置 serviceConfig.onRequestResultAdapter后,fieldNames.list配置失效
|
|
885
|
+
* 4. 如果没有配置list,可说明接口返回为数组
|
|
1036
886
|
* ```
|
|
1037
887
|
*/
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
888
|
+
fieldNames?: {
|
|
889
|
+
list?: string;
|
|
890
|
+
label?: string;
|
|
891
|
+
value?: string;
|
|
892
|
+
disabled?: string;
|
|
1042
893
|
};
|
|
1043
|
-
dataIndex?: keyof T | (string & {});
|
|
1044
894
|
/**
|
|
1045
|
-
*
|
|
895
|
+
* 请求服务需求的数据
|
|
896
|
+
*/
|
|
897
|
+
serviceConfig?: SelectorServiceConfig;
|
|
898
|
+
/**
|
|
899
|
+
* 同步设置选择器选项列表
|
|
1046
900
|
* ```
|
|
1047
|
-
* 1.
|
|
1048
|
-
* 2.
|
|
1049
|
-
* 3. 可为icon添加点击事件
|
|
901
|
+
* 1. 如果配置fieldNames,会转换后使用
|
|
902
|
+
* 2. 值为undefined、null不会更新,需要清空可传递空数组
|
|
1050
903
|
* ```
|
|
1051
904
|
*/
|
|
1052
|
-
|
|
1053
|
-
};
|
|
1054
|
-
export type EasyTableRefApi = {
|
|
1055
|
-
/** 外部发起请求服务 */
|
|
1056
|
-
onRequest: (params?: TPlainObject) => void;
|
|
1057
|
-
/** 获取请求参数 */
|
|
1058
|
-
getRequestParams: () => TPlainObject;
|
|
1059
|
-
/** 清楚查询条件 */
|
|
1060
|
-
clearQueryCondition: (values?: TPlainObject) => Promise<void>;
|
|
1061
|
-
form: FormInstance;
|
|
1062
|
-
/** 重置请求 */
|
|
1063
|
-
onResetRequest: (params?: TPlainObject) => void;
|
|
1064
|
-
/** 接口数据源 */
|
|
1065
|
-
getDataSource: () => TAny;
|
|
1066
|
-
/** 过滤表格数据源,不会触发 onDataSourceChange 函数 */
|
|
1067
|
-
onFilterDataSource: (dataSource: TPlainObject[]) => void;
|
|
1068
|
-
/** 清空表格数据 */
|
|
1069
|
-
onClearDataSource: () => void;
|
|
1070
|
-
/** 修改表格数据源,会触发onDataSourceChange函数 */
|
|
1071
|
-
onUpdateDataSource: (dataList: TPlainObject[]) => void;
|
|
1072
|
-
};
|
|
1073
|
-
export type EasyTableServiceConfig = {
|
|
1074
|
-
/** 接口配置 */
|
|
1075
|
-
onRequest: (params?: TPlainObject) => Promise<TPlainObject | TPlainObject[]>;
|
|
1076
|
-
/** 请求参数处理 */
|
|
1077
|
-
requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
|
|
905
|
+
selectorList?: TPlainObject[];
|
|
1078
906
|
/**
|
|
1079
|
-
*
|
|
1080
|
-
|
|
907
|
+
* select 数据源发生变更时触发,第一次不调用
|
|
908
|
+
*/
|
|
909
|
+
onSelectorListChange?: (dataList: TPlainObject[]) => void;
|
|
910
|
+
/** select 数据源发生变更时触发,每次都会调用 */
|
|
911
|
+
onSelectorListAllChange?: (dataList: TPlainObject[]) => void;
|
|
912
|
+
/**
|
|
913
|
+
* 通过服务获取数据异常回调
|
|
914
|
+
*/
|
|
915
|
+
onSelectorRequestError?: (error: Error) => void;
|
|
916
|
+
/**
|
|
917
|
+
* 添加全部选项
|
|
1081
918
|
* ```
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1084
|
-
* 2. 表格条数总数 - Number
|
|
1085
|
-
* 其中 字段key 命名会通过 fieldNames 进行转义
|
|
1086
|
-
* 例如:
|
|
1087
|
-
* fieldNames={{
|
|
1088
|
-
* list: 'aList',
|
|
1089
|
-
* total: 'aTotal',
|
|
1090
|
-
* }}
|
|
1091
|
-
* serviceConfig={{
|
|
1092
|
-
* url: '/v1/board/list',
|
|
1093
|
-
* requestResultAdapter: (respData) => {
|
|
1094
|
-
* return {
|
|
1095
|
-
* aList: respData.data.rows,
|
|
1096
|
-
* aTotal: respData.page.total,
|
|
1097
|
-
* };
|
|
1098
|
-
* },
|
|
1099
|
-
* }}
|
|
1100
|
-
* ```
|
|
1101
|
-
*/
|
|
1102
|
-
requestResultAdapter?: (params: TAny) => TPlainObject;
|
|
1103
|
-
/**
|
|
1104
|
-
* 动态列自定义渲染
|
|
1105
|
-
* ```
|
|
1106
|
-
* 1. respData: 接口返回数据
|
|
1107
|
-
* 2. columns: Table columns配置项
|
|
1108
|
-
* ```
|
|
1109
|
-
*
|
|
1110
|
-
*/
|
|
1111
|
-
dynamicColumsAdapter?: (respData?: TAny, columns?: TEasyTableTableColumn<TPlainObject>[]) => TEasyTableTableColumn<TPlainObject>[] | undefined;
|
|
1112
|
-
};
|
|
1113
|
-
export type EasyTableProps = {
|
|
1114
|
-
className?: string;
|
|
1115
|
-
style?: CSSProperties;
|
|
1116
|
-
children: ReactElement | ReactElement[] | ((dataSource?: TAny) => ReactElement);
|
|
1117
|
-
/**
|
|
1118
|
-
* EasyTable唯一值,可用于缓存查询条件
|
|
1119
|
-
* @deprecated 已过时,如果需要缓存数据请设置 cacheSwitch 参数
|
|
1120
|
-
*/
|
|
1121
|
-
modelKey?: string;
|
|
1122
|
-
/**
|
|
1123
|
-
* 缓存查询条件开关,默认false
|
|
1124
|
-
* ```
|
|
1125
|
-
* 是否缓存表格查询条件,在路由跳转回来时,不会丢失
|
|
919
|
+
* 1. 默认值label="全部",value=""
|
|
920
|
+
* 2. 可配置label、value
|
|
1126
921
|
* ```
|
|
1127
922
|
*/
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* 1. 查询条件Form initialValues
|
|
1133
|
-
* 2. 接口其他参数,例如常量类型
|
|
1134
|
-
*/
|
|
1135
|
-
initialValues?: TPlainObject;
|
|
1136
|
-
/**
|
|
1137
|
-
* 分页初始化参数,默认值: pageSize = 10
|
|
1138
|
-
* @deprecated 已过时 4.3.0版本移除,使用 pageSize 赋值
|
|
1139
|
-
*/
|
|
1140
|
-
initialPaginationParams?: {
|
|
1141
|
-
pageSize?: number;
|
|
923
|
+
showAllOption?: true | {
|
|
924
|
+
label: string;
|
|
925
|
+
value: string | number;
|
|
1142
926
|
};
|
|
1143
|
-
|
|
1144
|
-
|
|
927
|
+
onLabelRenderAdapter?: (dataItem: TPlainObject) => string | ReactElement;
|
|
928
|
+
onChange?: (value?: SelectorWrapperValue, selectedList?: TPlainObject[] | TPlainObject) => void;
|
|
929
|
+
showIcon?: boolean;
|
|
930
|
+
/** select option添加图标;与showIcon组合使用 */
|
|
931
|
+
icon?: (data: TPlainObject, index: number) => ReactElement;
|
|
932
|
+
requestMessageConfig?: TRequestStatusProps["messageConfig"];
|
|
1145
933
|
/**
|
|
1146
|
-
*
|
|
1147
|
-
|
|
1148
|
-
* 1.
|
|
1149
|
-
* 2.
|
|
934
|
+
* value格式
|
|
935
|
+
*```
|
|
936
|
+
* 1. string 、number
|
|
937
|
+
* 2. Array<string | number>
|
|
938
|
+
* 3. lableInValue = true,根据fieldNames配置格式
|
|
939
|
+
* 4. lableInValue = true,Array<fieldNames配置>
|
|
1150
940
|
* ```
|
|
1151
941
|
*/
|
|
1152
|
-
|
|
1153
|
-
list?: string;
|
|
1154
|
-
total?: string;
|
|
1155
|
-
pageNo?: string;
|
|
1156
|
-
pageSize?: string;
|
|
1157
|
-
};
|
|
1158
|
-
/** 初始化是否请求,默认值:true */
|
|
1159
|
-
initRequest?: boolean;
|
|
1160
|
-
onDataSourceChange?: (dataSource: TAny) => void;
|
|
1161
|
-
/** 如果自定义查询按钮,可设置 Form onFinish */
|
|
1162
|
-
onFormFinish?: (values?: TPlainObject) => void;
|
|
1163
|
-
/** 在父节点高度下,上下铺满;默认值:true */
|
|
1164
|
-
isFull?: boolean;
|
|
1165
|
-
/** 查询条件固定,不随滚动条滚动 */
|
|
1166
|
-
filterFixed?: boolean;
|
|
1167
|
-
/** 分页区域固定,不随滚动条滚动 */
|
|
1168
|
-
paginationFixed?: boolean;
|
|
1169
|
-
/**
|
|
1170
|
-
* 1. 配合paginationFixed=true一起使用有效果
|
|
1171
|
-
* 2. 当使用Table内的pagination时,在EasyTable.Table中配置分页属性
|
|
1172
|
-
*/
|
|
1173
|
-
pagination?: PaginationProps;
|
|
1174
|
-
/**
|
|
1175
|
-
* 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
|
|
1176
|
-
*/
|
|
1177
|
-
foldKeys?: string[];
|
|
1178
|
-
/**
|
|
1179
|
-
* 自定义处理服务异常
|
|
1180
|
-
* @param error
|
|
1181
|
-
* @returns
|
|
1182
|
-
*/
|
|
1183
|
-
onRequestErrorHandle?: (error: any) => void;
|
|
942
|
+
value?: SelectorWrapperValue;
|
|
1184
943
|
/**
|
|
1185
|
-
*
|
|
944
|
+
* 使用缓存,默认值:true
|
|
1186
945
|
* ```
|
|
1187
|
-
* 1.
|
|
1188
|
-
* 2.
|
|
946
|
+
* 1. true: 在 modelKey下使用请求参数缓存数据,如果相同modelKey、相同请求参数直接使用缓存数据
|
|
947
|
+
* 2. false: 每次都调用接口,不参与缓存数据、不使用缓存数据
|
|
948
|
+
* 3. useCache=false 在 serviceConfig.requiredParamsKeys.length > 0 有效
|
|
1189
949
|
* ```
|
|
1190
950
|
*/
|
|
1191
|
-
|
|
1192
|
-
/** Form 实例 */
|
|
1193
|
-
form?: FormInstance;
|
|
951
|
+
useCache?: boolean;
|
|
1194
952
|
};
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
953
|
+
/**
|
|
954
|
+
* 选择器包装组件
|
|
955
|
+
* ```
|
|
956
|
+
* 1. 不支持搜索 + 调用服务模式
|
|
957
|
+
* ```
|
|
958
|
+
*/
|
|
959
|
+
export declare const SelectorWrapper: (props: SelectorWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
960
|
+
export type SwitchWrapperValue = string | number | boolean;
|
|
961
|
+
export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange"> & {
|
|
962
|
+
value?: SwitchWrapperValue;
|
|
963
|
+
checkedValue: SwitchWrapperValue;
|
|
964
|
+
unCheckedValue: SwitchWrapperValue;
|
|
965
|
+
onChange?: (value: SwitchWrapperValue) => void;
|
|
966
|
+
tooltipProps?: Omit<TooltipProps, "title">;
|
|
967
|
+
tooltipTitle?: string | ((value?: SwitchWrapperValue) => string | undefined);
|
|
968
|
+
serviceConfig?: {
|
|
969
|
+
onRequest: (value: SwitchWrapperValue) => TAny;
|
|
970
|
+
message?: {
|
|
971
|
+
success?: string;
|
|
972
|
+
defaultError?: string;
|
|
973
|
+
};
|
|
974
|
+
};
|
|
1205
975
|
};
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
976
|
+
/**
|
|
977
|
+
* 解决Switch只能接收boolean的限制,与Form.Item结合使用最佳
|
|
978
|
+
* ```
|
|
979
|
+
* 1. value 为状态值,不局限于boolean,可以为 [string | number | boolean]
|
|
980
|
+
* 2. checkedValue 选中值
|
|
981
|
+
* 3. unCheckedValue 未选中值
|
|
982
|
+
* 4. 与 Form.Item 结合使用,不再需要配置 valuePropName
|
|
983
|
+
* <Form.Item name="fieldName">
|
|
984
|
+
* <SwitchWrapper checkedValue={2} unCheckedValue={1} />
|
|
985
|
+
* </Form.Item>
|
|
986
|
+
* 5. 可设置tooltip效果数据显示
|
|
987
|
+
* 6. 可设置 serviceConfig 配置服务调用交互
|
|
988
|
+
* ```
|
|
989
|
+
*/
|
|
990
|
+
export declare const SwitchWrapper: (props: SwitchWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
991
|
+
export type UploadWrapperFileItem = {
|
|
992
|
+
uid: string;
|
|
993
|
+
name: string;
|
|
994
|
+
url?: string;
|
|
1213
995
|
};
|
|
1214
|
-
export type
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
isPure?: boolean;
|
|
1220
|
-
/** 查询按钮配置 */
|
|
1221
|
-
queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
1222
|
-
text?: string;
|
|
1223
|
-
};
|
|
1224
|
-
/** 重置按钮配置 */
|
|
1225
|
-
resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
1226
|
-
text?: string;
|
|
1227
|
-
};
|
|
996
|
+
export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
|
|
997
|
+
value?: T[] | T;
|
|
998
|
+
onChange?: (value?: T[]) => void;
|
|
999
|
+
onUploadError?: (message?: string) => void;
|
|
1000
|
+
onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
|
|
1228
1001
|
/**
|
|
1229
|
-
*
|
|
1230
|
-
* default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
|
|
1231
|
-
* small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
|
|
1002
|
+
* 属性取值映射
|
|
1232
1003
|
*/
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
/** filter Form 外层 SimpleLayout className */
|
|
1239
|
-
filterWrapperClassName?: string;
|
|
1004
|
+
fieldNames?: {
|
|
1005
|
+
uid: string;
|
|
1006
|
+
name?: string;
|
|
1007
|
+
url?: string;
|
|
1008
|
+
};
|
|
1240
1009
|
/**
|
|
1241
|
-
*
|
|
1242
|
-
* 1. cover:覆盖内部查询重置按钮(默认值)
|
|
1243
|
-
* 2. beforeAppend:添加到【查询重置】按钮前面
|
|
1244
|
-
* 3. afterAppend:添加到【查询重置】按钮后面
|
|
1245
|
-
*
|
|
1246
|
-
* 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
|
|
1010
|
+
* 接口响应数据适配器,如果配置了fieldNames,适配器返回值会再进过fieldNames转换
|
|
1247
1011
|
*/
|
|
1248
|
-
|
|
1249
|
-
/**
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
children?: ReactElement | ReactElement[];
|
|
1012
|
+
onRequestResultAdapter?: (respData: TAny) => TPlainObject;
|
|
1013
|
+
/** 操作触发显示文本 */
|
|
1014
|
+
triggerText?: string;
|
|
1015
|
+
/** 超过maxCount 隐藏上传入口 */
|
|
1016
|
+
limitHidden?: boolean;
|
|
1254
1017
|
/**
|
|
1255
|
-
*
|
|
1018
|
+
* 自动提交,默认:true
|
|
1256
1019
|
* ```
|
|
1257
|
-
*
|
|
1258
|
-
* 1. 组件会判断表格列表数据第一条是否存在当前rowKey对象的数据,如果没有组件内部会动态添加唯一值
|
|
1259
|
-
* 2. 基于上一条的逻辑,如果表格数据没有唯一值,可指定 rowKey 值为table数据中不存在的字段名,例如:rowKey="_uid"
|
|
1260
|
-
* 3. 如果触发上述逻辑,表格数据中会多出rowKey对应的键值对数据
|
|
1020
|
+
* 1. 自定义beforeUpload配置后 autoSubmit 失效
|
|
1261
1021
|
* ```
|
|
1262
1022
|
*/
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
tableWrapperStyle?: CSSProperties;
|
|
1266
|
-
/** table Form 外层 SimpleLayout className */
|
|
1267
|
-
tableWrapperClassName?: string;
|
|
1268
|
-
columns: TEasyTableTableColumn<T>[];
|
|
1269
|
-
};
|
|
1023
|
+
autoSubmit?: boolean;
|
|
1024
|
+
} & Omit<UploadProps, "onChange" | "fileList">;
|
|
1270
1025
|
/**
|
|
1271
|
-
*
|
|
1026
|
+
* 文件上传
|
|
1272
1027
|
* ```
|
|
1273
|
-
* 1.
|
|
1274
|
-
* 2.
|
|
1275
|
-
*
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1279
|
-
*
|
|
1280
|
-
*
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1284
|
-
*
|
|
1028
|
+
* 1. 可通过配置children替换默认上传触发布局
|
|
1029
|
+
* 2. 接口返回结构:
|
|
1030
|
+
* formData上传接口返回值
|
|
1031
|
+
* {
|
|
1032
|
+
* code: '0000',
|
|
1033
|
+
* data: {
|
|
1034
|
+
* uid: '唯一值,可使用fileKey值'
|
|
1035
|
+
* name: '文件名称'
|
|
1036
|
+
* url: '预览地址'
|
|
1037
|
+
* }
|
|
1038
|
+
* }
|
|
1039
|
+
* 3. 如果接口返回的不是上面的字段名称,可通过fieldNames配置接口返回字段名称映射
|
|
1040
|
+
*
|
|
1041
|
+
* 4. 最佳使用方式,与Form结合使用
|
|
1042
|
+
* <Form.Item name="attachmentList" label="附件">
|
|
1043
|
+
* <UploadWrapper action={uploadUrl} />
|
|
1044
|
+
* </Form.Item>
|
|
1285
1045
|
* ```
|
|
1046
|
+
*
|
|
1286
1047
|
*/
|
|
1287
|
-
export declare const
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
*/
|
|
1332
|
-
useEasyTablRef: () => {
|
|
1333
|
-
current: EasyTableRefApi;
|
|
1334
|
-
};
|
|
1335
|
-
/** 在 EasyTable子组件内才可使用 */
|
|
1336
|
-
useEasyTable: () => EasyTableRefApi;
|
|
1048
|
+
export declare const UploadWrapper: (props: UploadWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
1049
|
+
export type EditableTableName = string | number | Array<string | number>;
|
|
1050
|
+
export type EditableTableRecordType = FormListFieldData & {
|
|
1051
|
+
operation: FormListOperation;
|
|
1052
|
+
};
|
|
1053
|
+
export type EditableInputConfig = {
|
|
1054
|
+
type: "input";
|
|
1055
|
+
editableComptProps?: InputProps;
|
|
1056
|
+
};
|
|
1057
|
+
export type EditableInputNumberConfig = {
|
|
1058
|
+
type: "inputNumber";
|
|
1059
|
+
editableComptProps?: InputNumberProps;
|
|
1060
|
+
};
|
|
1061
|
+
export type EditableSelectWrapperConfig = {
|
|
1062
|
+
type: "selectorWrapper";
|
|
1063
|
+
editableComptProps: SelectorWrapperProps;
|
|
1064
|
+
};
|
|
1065
|
+
export type EditableDatePickerWrapperConfig = {
|
|
1066
|
+
type: "datePickerWrapper";
|
|
1067
|
+
editableComptProps?: DatePickerWrapperProps;
|
|
1068
|
+
};
|
|
1069
|
+
export type EditableDateRangePickerWrapperConfig = {
|
|
1070
|
+
type: "dateRangePickerWrapper";
|
|
1071
|
+
editableComptProps?: DateRangePickerWrapperProps;
|
|
1072
|
+
};
|
|
1073
|
+
export type EditableCheckboxGroupConfig = {
|
|
1074
|
+
type: "checkboxGroup";
|
|
1075
|
+
editableComptProps: CheckboxGroupProps;
|
|
1076
|
+
};
|
|
1077
|
+
export type EditableRadioGroupConfig = {
|
|
1078
|
+
type: "radioGroup";
|
|
1079
|
+
editableComptProps: RadioGroupProps;
|
|
1080
|
+
};
|
|
1081
|
+
export type EditableTextareaConfig = {
|
|
1082
|
+
type: "textArea";
|
|
1083
|
+
editableComptProps: TextAreaProps;
|
|
1084
|
+
};
|
|
1085
|
+
export type EditableFileUploadConfig = {
|
|
1086
|
+
type: "uploadWrapper";
|
|
1087
|
+
editableComptProps: UploadWrapperProps;
|
|
1088
|
+
};
|
|
1089
|
+
export type EditableSwitchWrapperConfig = {
|
|
1090
|
+
type: "switchWrapper";
|
|
1091
|
+
editableComptProps: SwitchWrapperProps;
|
|
1337
1092
|
};
|
|
1338
|
-
export interface EditableFieldProps {
|
|
1339
|
-
className?: string;
|
|
1340
|
-
style?: CSSProperties;
|
|
1341
|
-
editRender: ReactElement | ((data: {
|
|
1342
|
-
value?: TAny;
|
|
1343
|
-
onChange?: (data?: TAny) => void;
|
|
1344
|
-
}) => ReactElement);
|
|
1345
|
-
viewRender?: (value?: TAny) => ReactNode;
|
|
1346
|
-
value?: TAny;
|
|
1347
|
-
onChange?: (data?: TAny) => void;
|
|
1348
|
-
placeholderValue?: string;
|
|
1349
|
-
/** edit 区域是否铺满,showEditableIcon=false 无效 */
|
|
1350
|
-
isEditFull?: boolean;
|
|
1351
|
-
/** 是否可编辑 */
|
|
1352
|
-
editable?: boolean;
|
|
1353
|
-
/** 是否显示编辑、确认、取消操作icon,默认值:true */
|
|
1354
|
-
showEditableIcon?: boolean;
|
|
1355
|
-
/** 点击编辑按钮,操作前,返回reject不会开启编辑效果 */
|
|
1356
|
-
onClickEditIconPre?: (value?: TAny) => Promise<void>;
|
|
1357
|
-
onEditCallback?: (value?: TAny) => void;
|
|
1358
|
-
/** 点击确定按钮,操作前,返回reject不会执行确定功能 */
|
|
1359
|
-
onClickConfirmIconPre?: (value?: TAny, preValue?: TAny) => Promise<void>;
|
|
1360
|
-
onConfirmCallback?: (value?: TAny, preValue?: TAny) => void;
|
|
1361
|
-
/** 组件操作Icon配置 */
|
|
1362
|
-
iconConfig?: {
|
|
1363
|
-
editIcon?: (options: {
|
|
1364
|
-
onClick: () => void;
|
|
1365
|
-
}) => ReactElement;
|
|
1366
|
-
confirmIcon?: (options: {
|
|
1367
|
-
onClick: () => void;
|
|
1368
|
-
}) => ReactElement;
|
|
1369
|
-
cancelIcon?: (options: {
|
|
1370
|
-
onClick: () => void;
|
|
1371
|
-
}) => ReactElement;
|
|
1372
|
-
};
|
|
1373
|
-
}
|
|
1374
1093
|
/**
|
|
1375
|
-
*
|
|
1376
|
-
* @param props
|
|
1377
|
-
* @returns
|
|
1378
|
-
* ```
|
|
1379
|
-
* 字段渲染有两种状态
|
|
1380
|
-
* 1. 只读:如果value类型为复杂格式,必须要通过【viewRender】来进行处理操作,转成简单数据类型
|
|
1381
|
-
* 2. 编辑:参数value的格式要求必须满足编辑组件入参value要求
|
|
1382
|
-
* 3. 可自定义编辑Icon、确定Icon、取消Icon
|
|
1383
|
-
* 4. 可拦截编辑操作、确定操作
|
|
1094
|
+
* 自定义编辑组件
|
|
1384
1095
|
* ```
|
|
1096
|
+
* 1.需要处理Form.Item
|
|
1097
|
+
* 2. 例如
|
|
1098
|
+
* editableConfig: {
|
|
1099
|
+
type: 'custom',
|
|
1100
|
+
editableComptProps: (props) => {
|
|
1101
|
+
return (
|
|
1102
|
+
<Form.Item name={props.name}>
|
|
1103
|
+
<Input />
|
|
1104
|
+
</Form.Item>
|
|
1105
|
+
);
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
```
|
|
1385
1109
|
*/
|
|
1386
|
-
export
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
* @param props
|
|
1395
|
-
* @returns
|
|
1396
|
-
*/
|
|
1397
|
-
export declare const EditableFieldProvider: (props: EditableFieldProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
1398
|
-
export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
|
|
1399
|
-
export type SelectorServiceConfig = {
|
|
1400
|
-
params?: TPlainObject;
|
|
1401
|
-
/** 与 params 配合使用 */
|
|
1402
|
-
requiredParamsKeys?: string[];
|
|
1403
|
-
onRequest?: (params?: TAny) => Promise<TAny>;
|
|
1404
|
-
/**
|
|
1405
|
-
* 响应数据适配器
|
|
1406
|
-
*/
|
|
1407
|
-
onRequestResultAdapter?: (respData: TAny) => TPlainObject[];
|
|
1110
|
+
export type EditableCustomConfig = {
|
|
1111
|
+
type: "custom";
|
|
1112
|
+
editableComptProps: (props: {
|
|
1113
|
+
name: Array<number | string>;
|
|
1114
|
+
editable?: boolean;
|
|
1115
|
+
completeName: Array<number | string>;
|
|
1116
|
+
tableRowIndex: number;
|
|
1117
|
+
}) => ReactElement;
|
|
1408
1118
|
};
|
|
1409
|
-
export type
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1119
|
+
export type EditableTypeConfig = EditableCustomConfig | EditableInputConfig | EditableSelectWrapperConfig | EditableDatePickerWrapperConfig | EditableDateRangePickerWrapperConfig | EditableCheckboxGroupConfig | EditableTextareaConfig | EditableInputNumberConfig | EditableRadioGroupConfig | EditableFileUploadConfig | EditableSwitchWrapperConfig;
|
|
1120
|
+
export type FieldSingleConfig = {
|
|
1121
|
+
editable?: boolean | ((data: {
|
|
1122
|
+
tableRowIndex: number;
|
|
1123
|
+
}) => boolean);
|
|
1124
|
+
editableConfig?: EditableTypeConfig;
|
|
1414
1125
|
/**
|
|
1415
|
-
*
|
|
1416
|
-
* ```
|
|
1417
|
-
* 1. 默认值:value=value、label=label、disabled=disabled
|
|
1418
|
-
* 2. list 为 onRequest 返回数据中列表key值,可多级取值,例如: 'a.b.c'
|
|
1419
|
-
* 3. 配置 serviceConfig.onRequestResultAdapter后,fieldNames.list配置失效
|
|
1420
|
-
* 4. 如果没有配置list,可说明接口返回为数组
|
|
1421
|
-
* ```
|
|
1126
|
+
* 当editableConfig type=custom时,此配置无效
|
|
1422
1127
|
*/
|
|
1423
|
-
|
|
1424
|
-
list?: string;
|
|
1425
|
-
label?: string;
|
|
1426
|
-
value?: string;
|
|
1427
|
-
disabled?: string;
|
|
1428
|
-
};
|
|
1128
|
+
formItemProps?: Omit<FormItemProps, "name">;
|
|
1429
1129
|
/**
|
|
1430
|
-
*
|
|
1130
|
+
* 自定义非编辑渲染
|
|
1131
|
+
* 1. 当editableConfig type=custom时,此配置无效
|
|
1132
|
+
* 2. 只在editable=false的情况下有效
|
|
1133
|
+
* 3. 同级配置 editableConfigList后,同级render配置失效
|
|
1134
|
+
* 4. checkboxGroup、radioGroup、selectorWrapper第二次参数为options数组
|
|
1431
1135
|
*/
|
|
1432
|
-
|
|
1136
|
+
render?: (params?: TAny, other?: TAny) => ReactNode;
|
|
1137
|
+
};
|
|
1138
|
+
export type FormListItemMethodOperateProps = {
|
|
1139
|
+
tableRowIndex: number;
|
|
1140
|
+
add: FormListOperation["add"];
|
|
1141
|
+
remove: () => void;
|
|
1142
|
+
formListItemIndex: number;
|
|
1143
|
+
value: TAny;
|
|
1144
|
+
};
|
|
1145
|
+
export type FormListMethodOperateProps = {
|
|
1146
|
+
tableRowIndex: number;
|
|
1147
|
+
add: FormListOperation["add"];
|
|
1148
|
+
value: TAny;
|
|
1149
|
+
};
|
|
1150
|
+
export type FormListConfig = {
|
|
1151
|
+
editableConfigList: Array<FieldSingleConfig & {
|
|
1152
|
+
fieldName: string;
|
|
1153
|
+
}>;
|
|
1154
|
+
onFormListBeforeRender?: (data: FormListMethodOperateProps) => ReactElement | null;
|
|
1155
|
+
onFormListAfterRender?: (data: FormListMethodOperateProps) => ReactElement | null;
|
|
1156
|
+
onFormListItemBeforeRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
|
|
1157
|
+
onFormListItemAfterRender?: (data: FormListItemMethodOperateProps) => ReactElement | null;
|
|
1158
|
+
deleteOperateRender?: (data: {
|
|
1159
|
+
remove: () => void;
|
|
1160
|
+
formListItemIndex: number;
|
|
1161
|
+
}) => ReactElement;
|
|
1162
|
+
};
|
|
1163
|
+
export type fieldConfigFunctionParams = {
|
|
1164
|
+
tableRowIndex: number;
|
|
1165
|
+
name: EditableTableName;
|
|
1166
|
+
tableRowName: EditableTableName;
|
|
1167
|
+
getTableRowData: () => TPlainObject;
|
|
1168
|
+
};
|
|
1169
|
+
/**
|
|
1170
|
+
* antd 默认render功能此处不能使用
|
|
1171
|
+
*/
|
|
1172
|
+
export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
|
|
1433
1173
|
/**
|
|
1434
|
-
*
|
|
1174
|
+
* @description 请使用 tipsWrapperProps 属性配置
|
|
1435
1175
|
* ```
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1176
|
+
* 会在 title 之后展示一个 icon,hover 之后提示一些信息
|
|
1177
|
+
* 1. title为string类型、ReactElement有效
|
|
1178
|
+
* 2. hoverArea 默认值:icon
|
|
1438
1179
|
* ```
|
|
1439
1180
|
*/
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
/** select 数据源发生变更时触发,每次都会调用 */
|
|
1446
|
-
onSelectorListAllChange?: (dataList: TPlainObject[]) => void;
|
|
1447
|
-
/**
|
|
1448
|
-
* 通过服务获取数据异常回调
|
|
1449
|
-
*/
|
|
1450
|
-
onSelectorRequestError?: (error: Error) => void;
|
|
1181
|
+
tooltip?: string | {
|
|
1182
|
+
content: string;
|
|
1183
|
+
icon?: ReactElement;
|
|
1184
|
+
hoverArea?: "icon" | "all";
|
|
1185
|
+
};
|
|
1451
1186
|
/**
|
|
1452
|
-
*
|
|
1187
|
+
* 会在 title 之后展示一个 icon
|
|
1453
1188
|
* ```
|
|
1454
|
-
* 1.
|
|
1455
|
-
* 2.
|
|
1189
|
+
* 1. title为string类型有效
|
|
1190
|
+
* 2. 可为icon添加提示效果
|
|
1191
|
+
* 3. 可为icon添加点击事件
|
|
1456
1192
|
* ```
|
|
1457
1193
|
*/
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1194
|
+
tipsWrapperProps?: string | TipsWrapperProps;
|
|
1195
|
+
dataIndex?: string;
|
|
1196
|
+
fieldConfig?: FieldSingleConfig | FormListConfig | ((data: fieldConfigFunctionParams) => FieldSingleConfig | FormListConfig);
|
|
1197
|
+
/** 隐藏域字段 */
|
|
1198
|
+
hiddenField?: {
|
|
1199
|
+
dataIndex: string;
|
|
1461
1200
|
};
|
|
1462
|
-
onLabelRenderAdapter?: (dataItem: TPlainObject) => string | ReactElement;
|
|
1463
|
-
onChange?: (value?: SelectorWrapperValue, selectedList?: TPlainObject[] | TPlainObject) => void;
|
|
1464
|
-
showIcon?: boolean;
|
|
1465
|
-
/** select option添加图标;与showIcon组合使用 */
|
|
1466
|
-
icon?: (data: TPlainObject, index: number) => ReactElement;
|
|
1467
|
-
requestMessageConfig?: TRequestStatusProps["messageConfig"];
|
|
1468
1201
|
/**
|
|
1469
|
-
*
|
|
1470
|
-
|
|
1471
|
-
* 1.
|
|
1472
|
-
* 2.
|
|
1473
|
-
* 3.
|
|
1474
|
-
* 4.
|
|
1202
|
+
* 渲染中间件,如果renderMiddleware返回值为ReactElement格式,则会终止后续逻辑,fieldConfig配置将失效
|
|
1203
|
+
* ```
|
|
1204
|
+
* 1. tableRowIndex: 当前row的索引值
|
|
1205
|
+
* 2. name: 当前table单元格的form.item的name值
|
|
1206
|
+
* 3. operation Form.List的操作函数
|
|
1207
|
+
* 4. 对 table children column渲染无效
|
|
1475
1208
|
* ```
|
|
1476
1209
|
*/
|
|
1477
|
-
|
|
1210
|
+
renderMiddleware?: (item: {
|
|
1211
|
+
tableRowIndex: number;
|
|
1212
|
+
name: EditableTableName;
|
|
1213
|
+
tableRowName: EditableTableName;
|
|
1214
|
+
operation: FormListOperation;
|
|
1215
|
+
index: number;
|
|
1216
|
+
}) => ReactElement | null;
|
|
1217
|
+
/** table datasource children column 自定义渲染 */
|
|
1218
|
+
tableChildrenColumnRender?: (value: TAny, record: TPlainObject, index: number) => ReactElement | null;
|
|
1219
|
+
};
|
|
1220
|
+
export type EditableTableProps = {
|
|
1221
|
+
name: EditableTableName;
|
|
1478
1222
|
/**
|
|
1479
|
-
* 使用缓存,默认值:true
|
|
1480
1223
|
* ```
|
|
1481
|
-
*
|
|
1482
|
-
*
|
|
1483
|
-
* 3. useCache=false 在 serviceConfig.requiredParamsKeys.length > 0 有效
|
|
1224
|
+
* antd table属性
|
|
1225
|
+
* 1. 新增cellVerticalAlign,单元格竖直方向对齐方式,设置table column onCell属性后失效
|
|
1484
1226
|
* ```
|
|
1485
1227
|
*/
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
/**
|
|
1489
|
-
* 选择器包装组件
|
|
1490
|
-
* ```
|
|
1491
|
-
* 1. 不支持搜索 + 调用服务模式
|
|
1492
|
-
* ```
|
|
1493
|
-
*/
|
|
1494
|
-
export declare const SelectorWrapper: (props: SelectorWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
1495
|
-
export type SwitchWrapperValue = string | number | boolean;
|
|
1496
|
-
export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange"> & {
|
|
1497
|
-
value?: SwitchWrapperValue;
|
|
1498
|
-
checkedValue: SwitchWrapperValue;
|
|
1499
|
-
unCheckedValue: SwitchWrapperValue;
|
|
1500
|
-
onChange?: (value: SwitchWrapperValue) => void;
|
|
1501
|
-
tooltipProps?: Omit<TooltipProps, "title">;
|
|
1502
|
-
tooltipTitle?: string | ((value?: SwitchWrapperValue) => string | undefined);
|
|
1503
|
-
serviceConfig?: {
|
|
1504
|
-
onRequest: (value: SwitchWrapperValue) => TAny;
|
|
1505
|
-
message?: {
|
|
1506
|
-
success?: string;
|
|
1507
|
-
defaultError?: string;
|
|
1508
|
-
};
|
|
1228
|
+
tableProps?: Omit<TableProps<EditableTableRecordType>, "dataSource" | "columns" | "rowKey"> & {
|
|
1229
|
+
cellVerticalAlign?: "baseline" | "middle" | "top" | "bottom";
|
|
1509
1230
|
};
|
|
1231
|
+
columns: EditableTableColumn[];
|
|
1232
|
+
onTableBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
|
|
1233
|
+
/**
|
|
1234
|
+
* 设置后,将覆盖底部`新增`按钮
|
|
1235
|
+
*/
|
|
1236
|
+
onTableAfterRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
|
|
1237
|
+
rules?: FormListProps["rules"];
|
|
1238
|
+
/** 隐藏底部`新增`按钮,设置 onTableAfterRender后 失效 */
|
|
1239
|
+
hiddenFooterBtn?: boolean;
|
|
1240
|
+
/** 新增行默认值,自定义onTableAfterRender后失效 */
|
|
1241
|
+
getAddRowDefaultValues?: () => TPlainObject;
|
|
1242
|
+
};
|
|
1243
|
+
export type EditableTableRefApi = {
|
|
1244
|
+
/** 可用于表格行选择操作时,获取操作列数据 */
|
|
1245
|
+
getTableItemDataByFormListItemKey: (key: number) => TPlainObject;
|
|
1510
1246
|
};
|
|
1511
1247
|
/**
|
|
1512
|
-
*
|
|
1248
|
+
* 可编辑表格
|
|
1249
|
+
* demo:https://fex.qa.tcshuke.com/docs/admin/main/table/row-editable1
|
|
1250
|
+
* @param props
|
|
1513
1251
|
* ```
|
|
1514
|
-
* 1.
|
|
1515
|
-
* 2.
|
|
1516
|
-
* 3.
|
|
1517
|
-
* 4.
|
|
1518
|
-
*
|
|
1519
|
-
* <SwitchWrapper checkedValue={2} unCheckedValue={1} />
|
|
1520
|
-
* </Form.Item>
|
|
1521
|
-
* 5. 可设置tooltip效果数据显示
|
|
1522
|
-
* 6. 可设置 serviceConfig 配置服务调用交互
|
|
1252
|
+
* 1. 通过 tableProps 设置Table属性,table size默认:small
|
|
1253
|
+
* 2. Table children column 不可编辑
|
|
1254
|
+
* 3. 当存在折叠children数据时,组件会在children中内置_isChildrenItem字段
|
|
1255
|
+
* 4. 可通过tableChildrenColumnRender自定义渲染 table children column 显示
|
|
1256
|
+
* 5. 设置 rowSelection 后,rowSelection.onChange 通过 ref 的 getTableItemDataByFormListItemKey获取数据
|
|
1523
1257
|
* ```
|
|
1524
1258
|
*/
|
|
1525
|
-
export declare const
|
|
1526
|
-
export type
|
|
1527
|
-
uid: string;
|
|
1528
|
-
name: string;
|
|
1529
|
-
url?: string;
|
|
1530
|
-
};
|
|
1531
|
-
export type UploadWrapperProps<T extends TPlainObject = TPlainObject> = {
|
|
1532
|
-
value?: T[] | T;
|
|
1533
|
-
onChange?: (value?: T[]) => void;
|
|
1534
|
-
onUploadError?: (message?: string) => void;
|
|
1535
|
-
onUploadChange?: (info: UploadChangeParam<UploadFile>) => void;
|
|
1259
|
+
export declare const EditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & import("react").RefAttributes<EditableTableRefApi>>;
|
|
1260
|
+
export type DragEditableTableProps = EditableTableProps & {
|
|
1536
1261
|
/**
|
|
1537
|
-
*
|
|
1262
|
+
* 拖拽图标自定义,默认使用 DragOutlined 图标
|
|
1538
1263
|
*/
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
url?: string;
|
|
1543
|
-
};
|
|
1264
|
+
dragIcon?: ReactElement;
|
|
1265
|
+
/** 禁用拖拽 */
|
|
1266
|
+
disabledDrag?: boolean;
|
|
1544
1267
|
/**
|
|
1545
|
-
*
|
|
1268
|
+
* 表格数据唯一值字段Key
|
|
1269
|
+
* ```
|
|
1270
|
+
* ```
|
|
1546
1271
|
*/
|
|
1547
|
-
|
|
1548
|
-
/**
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1272
|
+
uidFieldKey: string;
|
|
1273
|
+
/**
|
|
1274
|
+
* 拖拽结束事件
|
|
1275
|
+
* ```
|
|
1276
|
+
* dataSource: 拖拽完成后的数据源
|
|
1277
|
+
* dragData
|
|
1278
|
+
* 1. activeId 拖拽ID
|
|
1279
|
+
* 2. activeIndex 拖拽起始表格数组索引值
|
|
1280
|
+
* 3. overIndex 拖拽结束表格数组索引值
|
|
1281
|
+
* ```
|
|
1282
|
+
*/
|
|
1283
|
+
onDragChange?: (dataSource: TPlainObject[], dragData: {
|
|
1284
|
+
activeId: string | number;
|
|
1285
|
+
activeIndex: number;
|
|
1286
|
+
overIndex: number;
|
|
1287
|
+
}) => void;
|
|
1288
|
+
};
|
|
1553
1289
|
/**
|
|
1554
|
-
*
|
|
1290
|
+
* 可拖拽编辑表格
|
|
1555
1291
|
* ```
|
|
1556
|
-
* 1.
|
|
1557
|
-
* 2.
|
|
1558
|
-
* formData上传接口返回值
|
|
1559
|
-
* {
|
|
1560
|
-
* code: '0000',
|
|
1561
|
-
* data: {
|
|
1562
|
-
* uid: '唯一值,可使用fileKey值'
|
|
1563
|
-
* name: '文件名称'
|
|
1564
|
-
* url: '预览地址'
|
|
1565
|
-
* }
|
|
1566
|
-
* }
|
|
1567
|
-
* 3. 如果接口返回的不是上面的字段名称,可通过fieldNames配置接口返回字段名称映射
|
|
1568
|
-
*
|
|
1569
|
-
* 4. 最佳使用方式,与Form结合使用
|
|
1570
|
-
* <Form.Item name="attachmentList" label="附件">
|
|
1571
|
-
* <UploadWrapper action={uploadUrl} />
|
|
1572
|
-
* </Form.Item>
|
|
1292
|
+
* 1. 表格数据必须要有唯一值字段,通过参数 uidFieldKey 告诉组件
|
|
1293
|
+
* 2. Table 参数 components.body.row 被组件内部使用
|
|
1573
1294
|
* ```
|
|
1574
|
-
*
|
|
1575
1295
|
*/
|
|
1576
|
-
export declare const
|
|
1577
|
-
|
|
1578
|
-
|
|
1296
|
+
export declare const DragEditableTable: import("react").ForwardRefExoticComponent<EditableTableProps & {
|
|
1297
|
+
/**
|
|
1298
|
+
* 拖拽图标自定义,默认使用 DragOutlined 图标
|
|
1299
|
+
*/
|
|
1300
|
+
dragIcon?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
1301
|
+
/** 禁用拖拽 */
|
|
1302
|
+
disabledDrag?: boolean | undefined;
|
|
1303
|
+
/**
|
|
1304
|
+
* 表格数据唯一值字段Key
|
|
1305
|
+
* ```
|
|
1306
|
+
* ```
|
|
1307
|
+
*/
|
|
1308
|
+
uidFieldKey: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* 拖拽结束事件
|
|
1311
|
+
* ```
|
|
1312
|
+
* dataSource: 拖拽完成后的数据源
|
|
1313
|
+
* dragData
|
|
1314
|
+
* 1. activeId 拖拽ID
|
|
1315
|
+
* 2. activeIndex 拖拽起始表格数组索引值
|
|
1316
|
+
* 3. overIndex 拖拽结束表格数组索引值
|
|
1317
|
+
* ```
|
|
1318
|
+
*/
|
|
1319
|
+
onDragChange?: ((dataSource: TPlainObject[], dragData: {
|
|
1320
|
+
activeId: string | number;
|
|
1321
|
+
activeIndex: number;
|
|
1322
|
+
overIndex: number;
|
|
1323
|
+
}) => void) | undefined;
|
|
1324
|
+
} & import("react").RefAttributes<EditableTableRefApi>>;
|
|
1325
|
+
export type DragFormListContentProps = {
|
|
1326
|
+
/** Form.List item fieldData */
|
|
1327
|
+
formListFieldData: FormListFieldData;
|
|
1328
|
+
/**
|
|
1329
|
+
* 当前阶段 完整 formItem name
|
|
1330
|
+
* ```
|
|
1331
|
+
* 1. 获取当前输入项Item数据
|
|
1332
|
+
* form.getFieldValue(props.formStageCompleteName);
|
|
1333
|
+
* 2. 获取当前输入项Item指定字段数据
|
|
1334
|
+
* form.getFieldValue([...props.formStageCompleteName, 'key']);
|
|
1335
|
+
* ```
|
|
1336
|
+
*/
|
|
1337
|
+
formStageCompleteName: (string | number)[];
|
|
1338
|
+
/**
|
|
1339
|
+
* formList上一级 formItem完整name
|
|
1340
|
+
*/
|
|
1341
|
+
prevCompleteName: (string | number)[];
|
|
1342
|
+
/** Form.List 操作项 */
|
|
1579
1343
|
operation: FormListOperation;
|
|
1344
|
+
/** 索引 */
|
|
1345
|
+
index: number;
|
|
1346
|
+
/** 获取当前FormList 内部 Form.Item name */
|
|
1347
|
+
getInsideFormItemName: (key: string) => Array<string | number>;
|
|
1348
|
+
/** 获取当前 FormList Item 数据 */
|
|
1349
|
+
getInsideFormItemData: () => TPlainObject;
|
|
1350
|
+
/** 唯一值字段Key */
|
|
1351
|
+
uidKey: string;
|
|
1580
1352
|
};
|
|
1581
|
-
export type
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1353
|
+
export type DragFormListProps = {
|
|
1354
|
+
className?: string;
|
|
1355
|
+
style?: CSSProperties;
|
|
1356
|
+
itemStyle?: CSSProperties;
|
|
1357
|
+
/** formList item 数据中的唯一值,默认值:uid */
|
|
1358
|
+
uidFieldName?: string;
|
|
1359
|
+
/** formList name */
|
|
1360
|
+
name: string | number | (string | number)[];
|
|
1361
|
+
/**
|
|
1362
|
+
* formList上一级 formItem完整name
|
|
1363
|
+
* ```
|
|
1364
|
+
* 1. 如果没有传 []
|
|
1365
|
+
* 2. FormList内部通过 Form.useWatch 取值需要完整 name
|
|
1366
|
+
* ```
|
|
1367
|
+
*/
|
|
1368
|
+
prevCompleteName: (string | number)[];
|
|
1369
|
+
/** 拖拽回调 */
|
|
1370
|
+
onDropChange?: (items: TPlainObject[]) => void;
|
|
1371
|
+
/** 设置拖拽图标 */
|
|
1372
|
+
dragIcon?: ReactElement;
|
|
1373
|
+
/** 禁用拖拽,拖拽图标隐藏 */
|
|
1374
|
+
dragDisabled?: boolean;
|
|
1375
|
+
/** 设置item禁止拖拽 */
|
|
1376
|
+
getItemDragDisabled?: (uid: string | number, index: number) => boolean;
|
|
1377
|
+
/** 新增行默认值,自定义onTableAfterRender后失效 */
|
|
1378
|
+
getAddRowDefaultValues?: () => TPlainObject;
|
|
1379
|
+
/** 隐藏新增行按钮 */
|
|
1380
|
+
hiddenAddRowButton?: boolean;
|
|
1381
|
+
/** 自定义新增行按钮,getAddRowDefaultValues配置失效 */
|
|
1382
|
+
onCustomAddRowButton?: (operation: FormListOperation) => ReactElement;
|
|
1383
|
+
/** formListItem 内容 */
|
|
1384
|
+
children: (data: DragFormListContentProps) => ReactElement;
|
|
1385
|
+
/** 隐藏数据为空渲染 */
|
|
1386
|
+
hiddenEmptyRender?: boolean;
|
|
1387
|
+
/** formList内部渲染包装,多用于FormListWrapper嵌套布局 */
|
|
1388
|
+
formListChildrenWrapper?: (props: {
|
|
1389
|
+
children: ReactElement;
|
|
1390
|
+
}) => ReactElement;
|
|
1391
|
+
rules?: FormListProps["rules"];
|
|
1620
1392
|
};
|
|
1621
1393
|
/**
|
|
1622
|
-
*
|
|
1394
|
+
* 可拖拽FormList
|
|
1395
|
+
* ```
|
|
1396
|
+
* 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置
|
|
1397
|
+
* 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list
|
|
1623
1398
|
* ```
|
|
1624
|
-
* 1.需要处理Form.Item
|
|
1625
|
-
* 2. 例如
|
|
1626
|
-
* editableConfig: {
|
|
1627
|
-
type: 'custom',
|
|
1628
|
-
editableComptProps: (props) => {
|
|
1629
|
-
return (
|
|
1630
|
-
<Form.Item name={props.name}>
|
|
1631
|
-
<Input />
|
|
1632
|
-
</Form.Item>
|
|
1633
|
-
);
|
|
1634
|
-
},
|
|
1635
|
-
},
|
|
1636
|
-
```
|
|
1637
1399
|
*/
|
|
1638
|
-
export
|
|
1639
|
-
|
|
1640
|
-
editableComptProps: (props: {
|
|
1641
|
-
name: Array<number | string>;
|
|
1642
|
-
editable?: boolean;
|
|
1643
|
-
completeName: Array<number | string>;
|
|
1644
|
-
tableRowIndex: number;
|
|
1645
|
-
}) => ReactElement;
|
|
1646
|
-
};
|
|
1647
|
-
export type EditableTypeConfig = EditableCustomConfig | EditableInputConfig | EditableSelectWrapperConfig | EditableDatePickerWrapperConfig | EditableDateRangePickerWrapperConfig | EditableCheckboxGroupConfig | EditableTextareaConfig | EditableInputNumberConfig | EditableRadioGroupConfig | EditableFileUploadConfig | EditableSwitchWrapperConfig;
|
|
1648
|
-
export type FieldSingleConfig = {
|
|
1649
|
-
editable?: boolean | ((data: {
|
|
1650
|
-
tableRowIndex: number;
|
|
1651
|
-
}) => boolean);
|
|
1652
|
-
editableConfig?: EditableTypeConfig;
|
|
1400
|
+
export declare const DragFormList: (props: DragFormListProps) => import("react/jsx-runtime").JSX.Element;
|
|
1401
|
+
export type DragTableProps = Omit<TableProps<TPlainObject>, "dataSource"> & {
|
|
1653
1402
|
/**
|
|
1654
|
-
*
|
|
1403
|
+
* ```
|
|
1404
|
+
* 1. 可自定义拖拽图标
|
|
1405
|
+
* 2. dragIcon = false,可设置表格行拖拽
|
|
1406
|
+
* ```
|
|
1655
1407
|
*/
|
|
1656
|
-
|
|
1408
|
+
dragIcon?: false | ReactElement;
|
|
1409
|
+
/** 表格数据唯一值字段Key,未填或者无法唯一,都不能拖拽能力 */
|
|
1410
|
+
uidFieldKey: string;
|
|
1411
|
+
dataSource?: TPlainObject[];
|
|
1412
|
+
/** 禁用拖拽 */
|
|
1413
|
+
disabledDrag?: boolean;
|
|
1657
1414
|
/**
|
|
1658
|
-
*
|
|
1659
|
-
*
|
|
1660
|
-
*
|
|
1661
|
-
*
|
|
1662
|
-
*
|
|
1415
|
+
* 拖拽结束事件
|
|
1416
|
+
* ```
|
|
1417
|
+
* dataSource: 拖拽完成后的数据源
|
|
1418
|
+
* dragData
|
|
1419
|
+
* 1. activeId 拖拽ID
|
|
1420
|
+
* 2. activeIndex 拖拽起始表格数组索引值
|
|
1421
|
+
* 3. overIndex 拖拽结束表格数组索引值
|
|
1422
|
+
* ```
|
|
1663
1423
|
*/
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
remove: () => void;
|
|
1670
|
-
formListItemIndex: number;
|
|
1671
|
-
value: TAny;
|
|
1672
|
-
};
|
|
1673
|
-
export type FormListMethodOperateProps = {
|
|
1674
|
-
tableRowIndex: number;
|
|
1675
|
-
add: FormListOperation["add"];
|
|
1676
|
-
value: TAny;
|
|
1424
|
+
onDragChange?: (dataSource: TPlainObject[], dragData: {
|
|
1425
|
+
activeId: string | number;
|
|
1426
|
+
activeIndex: number;
|
|
1427
|
+
overIndex: number;
|
|
1428
|
+
}) => void;
|
|
1677
1429
|
};
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1430
|
+
/**
|
|
1431
|
+
* 可拖拽表格
|
|
1432
|
+
* ```
|
|
1433
|
+
* 1. 必须设置唯一值字段 uidFieldKey
|
|
1434
|
+
* 2. 如果拖拽显示异常,请检查 uidFieldKey 是否正确
|
|
1435
|
+
* 3. Table 参数 components.body.row 被组件内部使用
|
|
1436
|
+
* ```
|
|
1437
|
+
*/
|
|
1438
|
+
export declare const DragTable: (props: DragTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
1439
|
+
export interface DrawerOperationProps {
|
|
1440
|
+
loading?: boolean;
|
|
1441
|
+
okText?: string;
|
|
1442
|
+
cancelText?: string;
|
|
1443
|
+
onOk?: () => void;
|
|
1444
|
+
onCancel?: () => void;
|
|
1445
|
+
hideOkBtn?: boolean;
|
|
1446
|
+
okButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
1447
|
+
cancelButtonProps?: Omit<ButtonProps, "onClick" | "loading" | "className">;
|
|
1448
|
+
}
|
|
1449
|
+
export type DrawerWrapperStaticMethods = {
|
|
1450
|
+
Content: typeof DrawerWrapperContent;
|
|
1451
|
+
Footer: typeof DrawerWrapperFooter;
|
|
1690
1452
|
};
|
|
1691
|
-
export type
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1453
|
+
export type DrawerWrapperProps = {
|
|
1454
|
+
className?: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* 整个drawer页面级的spinning <Page loading />
|
|
1457
|
+
*/
|
|
1458
|
+
pageLoading?: boolean;
|
|
1459
|
+
} & Omit<DrawerProps, "footer">;
|
|
1460
|
+
declare const DrawerWrapperContent: (props: {
|
|
1461
|
+
operationProps?: DrawerOperationProps;
|
|
1462
|
+
children?: ReactNode;
|
|
1463
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
1464
|
+
declare const DrawerWrapperFooter: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
1465
|
+
/**
|
|
1466
|
+
* 弹窗机制
|
|
1467
|
+
* @deprecated 已过时 4.3.0版本移除;请使用 const { appDialogModal } = FbaApp.useDialogModal();
|
|
1468
|
+
* ```
|
|
1469
|
+
* 1. 默认 destroyOnClose = true
|
|
1470
|
+
* 2. 默认 forceRender = false
|
|
1471
|
+
* 3. 如果设置 forceRender = true,会导致弹框中的接口提前调用
|
|
1472
|
+
*
|
|
1473
|
+
* 注意
|
|
1474
|
+
* 1. <Drawer /> 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 destroyOnClose。
|
|
1475
|
+
* 2. <Drawer /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Drawer 关闭时销毁表单字段数据,需要设置 <Form preserve={false} />。
|
|
1476
|
+
*
|
|
1477
|
+
* ```
|
|
1478
|
+
*/
|
|
1479
|
+
export declare const DrawerWrapper: FC<DrawerWrapperProps> & DrawerWrapperStaticMethods;
|
|
1480
|
+
export type TDynamicNodeProps = {
|
|
1481
|
+
className?: string;
|
|
1482
|
+
getContainer?: HTMLElement | (() => HTMLElement) | string;
|
|
1483
|
+
content?: ReactElement;
|
|
1484
|
+
fixed?: boolean;
|
|
1485
|
+
style?: CSSProperties;
|
|
1696
1486
|
};
|
|
1697
1487
|
/**
|
|
1698
|
-
*
|
|
1488
|
+
* 动态添加 element 元素
|
|
1489
|
+
* ```
|
|
1490
|
+
* 1. 默认添加到 body 下
|
|
1491
|
+
* 2. 可通过 getContainer 参数设置添加位置
|
|
1492
|
+
* ```
|
|
1699
1493
|
*/
|
|
1700
|
-
export
|
|
1494
|
+
export declare const dynamicNode: {
|
|
1495
|
+
append: (props?: TDynamicNodeProps) => {
|
|
1496
|
+
elementId: string;
|
|
1497
|
+
};
|
|
1498
|
+
remove: (elementId?: string) => void;
|
|
1499
|
+
};
|
|
1500
|
+
export type TEasyTableTableColumn<T> = ColumnsType<T>[0] & {
|
|
1701
1501
|
/**
|
|
1702
1502
|
* @description 请使用 tipsWrapperProps 属性配置
|
|
1703
1503
|
* ```
|
|
1704
1504
|
* 会在 title 之后展示一个 icon,hover 之后提示一些信息
|
|
1705
|
-
* 1. title为string
|
|
1505
|
+
* 1. title为string类型有效
|
|
1706
1506
|
* 2. hoverArea 默认值:icon
|
|
1707
1507
|
* ```
|
|
1708
1508
|
*/
|
|
@@ -1711,6 +1511,7 @@ export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
|
|
|
1711
1511
|
icon?: ReactElement;
|
|
1712
1512
|
hoverArea?: "icon" | "all";
|
|
1713
1513
|
};
|
|
1514
|
+
dataIndex?: keyof T | (string & {});
|
|
1714
1515
|
/**
|
|
1715
1516
|
* 会在 title 之后展示一个 icon
|
|
1716
1517
|
* ```
|
|
@@ -1720,71 +1521,351 @@ export type EditableTableColumn = Omit<ColumnsType["0"], "render"> & {
|
|
|
1720
1521
|
* ```
|
|
1721
1522
|
*/
|
|
1722
1523
|
tipsWrapperProps?: string | TipsWrapperProps;
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
/**
|
|
1726
|
-
|
|
1727
|
-
|
|
1524
|
+
};
|
|
1525
|
+
export type EasyTableRefApi = {
|
|
1526
|
+
/** 外部发起请求服务 */
|
|
1527
|
+
onRequest: (params?: TPlainObject) => void;
|
|
1528
|
+
/** 获取请求参数 */
|
|
1529
|
+
getRequestParams: () => TPlainObject;
|
|
1530
|
+
/** 清楚查询条件 */
|
|
1531
|
+
clearQueryCondition: (values?: TPlainObject) => Promise<void>;
|
|
1532
|
+
form: FormInstance;
|
|
1533
|
+
/** 重置请求 */
|
|
1534
|
+
onResetRequest: (params?: TPlainObject) => void;
|
|
1535
|
+
/** 接口数据源 */
|
|
1536
|
+
getDataSource: () => TAny;
|
|
1537
|
+
/** 过滤表格数据源,不会触发 onDataSourceChange 函数 */
|
|
1538
|
+
onFilterDataSource: (dataSource: TPlainObject[]) => void;
|
|
1539
|
+
/** 清空表格数据 */
|
|
1540
|
+
onClearDataSource: () => void;
|
|
1541
|
+
/** 修改表格数据源,会触发onDataSourceChange函数 */
|
|
1542
|
+
onUpdateDataSource: (dataList: TPlainObject[]) => void;
|
|
1543
|
+
};
|
|
1544
|
+
export type EasyTableServiceConfig = {
|
|
1545
|
+
/** 接口配置 */
|
|
1546
|
+
onRequest: (params?: TPlainObject) => Promise<TPlainObject | TPlainObject[]>;
|
|
1547
|
+
/** 请求参数处理 */
|
|
1548
|
+
requestParamsAdapter?: (params: TPlainObject) => TPlainObject;
|
|
1549
|
+
/**
|
|
1550
|
+
* 接口相应数据处理
|
|
1551
|
+
* @param params
|
|
1552
|
+
* ```
|
|
1553
|
+
* 返回数据为对象,包含两个字段
|
|
1554
|
+
* 1. 表格列表数据 - Array
|
|
1555
|
+
* 2. 表格条数总数 - Number
|
|
1556
|
+
* 其中 字段key 命名会通过 fieldNames 进行转义
|
|
1557
|
+
* 例如:
|
|
1558
|
+
* fieldNames={{
|
|
1559
|
+
* list: 'aList',
|
|
1560
|
+
* total: 'aTotal',
|
|
1561
|
+
* }}
|
|
1562
|
+
* serviceConfig={{
|
|
1563
|
+
* url: '/v1/board/list',
|
|
1564
|
+
* requestResultAdapter: (respData) => {
|
|
1565
|
+
* return {
|
|
1566
|
+
* aList: respData.data.rows,
|
|
1567
|
+
* aTotal: respData.page.total,
|
|
1568
|
+
* };
|
|
1569
|
+
* },
|
|
1570
|
+
* }}
|
|
1571
|
+
* ```
|
|
1572
|
+
*/
|
|
1573
|
+
requestResultAdapter?: (params: TAny) => TPlainObject;
|
|
1574
|
+
/**
|
|
1575
|
+
* 动态列自定义渲染
|
|
1576
|
+
* ```
|
|
1577
|
+
* 1. respData: 接口返回数据
|
|
1578
|
+
* 2. columns: Table columns配置项
|
|
1579
|
+
* ```
|
|
1580
|
+
*
|
|
1581
|
+
*/
|
|
1582
|
+
dynamicColumsAdapter?: (respData?: TAny, columns?: TEasyTableTableColumn<TPlainObject>[]) => TEasyTableTableColumn<TPlainObject>[] | undefined;
|
|
1583
|
+
};
|
|
1584
|
+
export type EasyTableProps = {
|
|
1585
|
+
className?: string;
|
|
1586
|
+
style?: CSSProperties;
|
|
1587
|
+
children: ReactElement | ReactElement[] | ((dataSource?: TAny) => ReactElement);
|
|
1588
|
+
/**
|
|
1589
|
+
* EasyTable唯一值,可用于缓存查询条件
|
|
1590
|
+
* @deprecated 已过时,如果需要缓存数据请设置 cacheSwitch 参数
|
|
1591
|
+
*/
|
|
1592
|
+
modelKey?: string;
|
|
1593
|
+
/**
|
|
1594
|
+
* 缓存查询条件开关,默认false
|
|
1595
|
+
* ```
|
|
1596
|
+
* 是否缓存表格查询条件,在路由跳转回来时,不会丢失
|
|
1597
|
+
* ```
|
|
1598
|
+
*/
|
|
1599
|
+
cacheSwitch?: boolean;
|
|
1600
|
+
/** 接口数据配置 */
|
|
1601
|
+
serviceConfig: EasyTableServiceConfig;
|
|
1602
|
+
/**
|
|
1603
|
+
* 1. 查询条件Form initialValues
|
|
1604
|
+
* 2. 接口其他参数,例如常量类型
|
|
1605
|
+
*/
|
|
1606
|
+
initialValues?: TPlainObject;
|
|
1607
|
+
/**
|
|
1608
|
+
* 分页初始化参数,默认值: pageSize = 10
|
|
1609
|
+
* @deprecated 已过时 4.3.0版本移除,使用 pageSize 赋值
|
|
1610
|
+
*/
|
|
1611
|
+
initialPaginationParams?: {
|
|
1612
|
+
pageSize?: number;
|
|
1613
|
+
};
|
|
1614
|
+
/** 分页单页条数,默认值:10 */
|
|
1615
|
+
pageSize?: number;
|
|
1616
|
+
/**
|
|
1617
|
+
* 字段映射,默认值:{ list:'list', total:'total', pageNo:'pageNo', pageSize:'pageSize' }
|
|
1618
|
+
* ```
|
|
1619
|
+
* 1. list、total用于解析接口响应数据,可以配置多级,例如:{ list: 'data.rows', total: 'page.total' }
|
|
1620
|
+
* 2. pageNo、pageSize用于接口分页入参Key定义,只能一级,例如:pageNo: 'page'
|
|
1621
|
+
* ```
|
|
1622
|
+
*/
|
|
1623
|
+
fieldNames?: {
|
|
1624
|
+
list?: string;
|
|
1625
|
+
total?: string;
|
|
1626
|
+
pageNo?: string;
|
|
1627
|
+
pageSize?: string;
|
|
1628
|
+
};
|
|
1629
|
+
/** 初始化是否请求,默认值:true */
|
|
1630
|
+
initRequest?: boolean;
|
|
1631
|
+
onDataSourceChange?: (dataSource: TAny) => void;
|
|
1632
|
+
/** 如果自定义查询按钮,可设置 Form onFinish */
|
|
1633
|
+
onFormFinish?: (values?: TPlainObject) => void;
|
|
1634
|
+
/** 在父节点高度下,上下铺满;默认值:true */
|
|
1635
|
+
isFull?: boolean;
|
|
1636
|
+
/** 查询条件固定,不随滚动条滚动 */
|
|
1637
|
+
filterFixed?: boolean;
|
|
1638
|
+
/** 分页区域固定,不随滚动条滚动 */
|
|
1639
|
+
paginationFixed?: boolean;
|
|
1640
|
+
/**
|
|
1641
|
+
* 1. 配合paginationFixed=true一起使用有效果
|
|
1642
|
+
* 2. 当使用Table内的pagination时,在EasyTable.Table中配置分页属性
|
|
1643
|
+
*/
|
|
1644
|
+
pagination?: PaginationProps;
|
|
1645
|
+
/**
|
|
1646
|
+
* 查询条件展开、收起,被收起key数组;数组内容为EasyTable.Filter 子节点key值
|
|
1647
|
+
*/
|
|
1648
|
+
foldKeys?: string[];
|
|
1649
|
+
/**
|
|
1650
|
+
* 自定义处理服务异常
|
|
1651
|
+
* @param error
|
|
1652
|
+
* @returns
|
|
1653
|
+
*/
|
|
1654
|
+
onRequestErrorHandle?: (error: any) => void;
|
|
1655
|
+
/**
|
|
1656
|
+
* 是否inline模式
|
|
1657
|
+
* ```
|
|
1658
|
+
* 1. 缩短 EasyTable.Filter 与 EasyTable.Table 之间的距离
|
|
1659
|
+
* 2. 取消内边距
|
|
1660
|
+
* ```
|
|
1661
|
+
*/
|
|
1662
|
+
isInline?: boolean;
|
|
1663
|
+
/** Form 实例 */
|
|
1664
|
+
form?: FormInstance;
|
|
1665
|
+
};
|
|
1666
|
+
export type FormOperateColProps = {
|
|
1667
|
+
className?: string;
|
|
1668
|
+
leftList?: Array<ReactElement | null>;
|
|
1669
|
+
rightList?: Array<ReactElement | null>;
|
|
1670
|
+
justify?: RowProps["justify"];
|
|
1671
|
+
/** 强制单独一行 */
|
|
1672
|
+
forceAloneRow?: boolean;
|
|
1673
|
+
hidden?: boolean;
|
|
1674
|
+
leftSpaceProps?: SpaceProps;
|
|
1675
|
+
rightSpaceProps?: SpaceProps;
|
|
1676
|
+
};
|
|
1677
|
+
export type FormRowProps = RowProps & {
|
|
1678
|
+
children?: ReactNode | ReactNode[];
|
|
1679
|
+
/**
|
|
1680
|
+
* default = { xs: 24, sm: 12, md: 8, lg: 8, xl: 8, xxl: 6 };
|
|
1681
|
+
* small = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };
|
|
1682
|
+
*/
|
|
1683
|
+
gridSize?: "default" | "small";
|
|
1684
|
+
};
|
|
1685
|
+
export type EasyTableFilterProps = {
|
|
1686
|
+
children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
|
|
1687
|
+
/** isPure = true时无效 */
|
|
1688
|
+
filterOperate?: (form: FormInstance) => FormOperateColProps;
|
|
1689
|
+
/** 是否为纯净模式(查询条件布局是否自定义), */
|
|
1690
|
+
isPure?: boolean;
|
|
1691
|
+
/** 查询按钮配置 */
|
|
1692
|
+
queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
1693
|
+
text?: string;
|
|
1694
|
+
};
|
|
1695
|
+
/** 重置按钮配置 */
|
|
1696
|
+
resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
1697
|
+
text?: string;
|
|
1728
1698
|
};
|
|
1729
1699
|
/**
|
|
1730
|
-
*
|
|
1700
|
+
* 网格布局设置
|
|
1701
|
+
* default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
|
|
1702
|
+
* small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
|
|
1703
|
+
*/
|
|
1704
|
+
formGridSize?: FormRowProps["gridSize"];
|
|
1705
|
+
formClassName?: string;
|
|
1706
|
+
formStyle?: CSSProperties;
|
|
1707
|
+
/** filter Form 外层 SimpleLayout style */
|
|
1708
|
+
filterWrapperStyle?: CSSProperties;
|
|
1709
|
+
/** filter Form 外层 SimpleLayout className */
|
|
1710
|
+
filterWrapperClassName?: string;
|
|
1711
|
+
/**
|
|
1712
|
+
* 自定义 filterOperate.rightList 后 默认【查询、重置】按钮处理逻辑
|
|
1713
|
+
* 1. cover:覆盖内部查询重置按钮(默认值)
|
|
1714
|
+
* 2. beforeAppend:添加到【查询重置】按钮前面
|
|
1715
|
+
* 3. afterAppend:添加到【查询重置】按钮后面
|
|
1716
|
+
*
|
|
1717
|
+
* 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
|
|
1718
|
+
*/
|
|
1719
|
+
rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
|
|
1720
|
+
/** 默认重启按钮触发请求,默认值:true */
|
|
1721
|
+
defaultResetButtonTriggerRequest?: boolean;
|
|
1722
|
+
};
|
|
1723
|
+
export type EasyTableTableProps<T> = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey" | "columns"> & {
|
|
1724
|
+
children?: ReactElement | ReactElement[];
|
|
1725
|
+
/**
|
|
1726
|
+
* 表格行 key 的取值,
|
|
1731
1727
|
* ```
|
|
1732
|
-
*
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1728
|
+
* 如果 rowKey 为string类型
|
|
1729
|
+
* 1. 组件会判断表格列表数据第一条是否存在当前rowKey对象的数据,如果没有组件内部会动态添加唯一值
|
|
1730
|
+
* 2. 基于上一条的逻辑,如果表格数据没有唯一值,可指定 rowKey 值为table数据中不存在的字段名,例如:rowKey="_uid"
|
|
1731
|
+
* 3. 如果触发上述逻辑,表格数据中会多出rowKey对应的键值对数据
|
|
1736
1732
|
* ```
|
|
1737
1733
|
*/
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}) => ReactElement | null;
|
|
1745
|
-
/** table datasource children column 自定义渲染 */
|
|
1746
|
-
tableChildrenColumnRender?: (value: TAny, record: TPlainObject, index: number) => ReactElement | null;
|
|
1734
|
+
rowKey: TableProps<TAny>["rowKey"];
|
|
1735
|
+
/** table Form 外层 SimpleLayout className */
|
|
1736
|
+
tableWrapperStyle?: CSSProperties;
|
|
1737
|
+
/** table Form 外层 SimpleLayout className */
|
|
1738
|
+
tableWrapperClassName?: string;
|
|
1739
|
+
columns: TEasyTableTableColumn<T>[];
|
|
1747
1740
|
};
|
|
1748
|
-
|
|
1749
|
-
|
|
1741
|
+
/**
|
|
1742
|
+
* 对 查询条件+表格数据 进行深度封装,内置数据交互处理
|
|
1743
|
+
* ```
|
|
1744
|
+
* 1. 废弃modelKey参数
|
|
1745
|
+
* 2. 如果需要在路由跳转回退中缓存查询条件,设置cacheSwitch=true
|
|
1746
|
+
* 3. 需要获取查询条件、主动发起请求等可通过ref、useEasyTable操作
|
|
1747
|
+
* 4. 可通过属性 initRequest 设置初始化是否请求数据
|
|
1748
|
+
* 5. 可通过属性 fieldNames 来设置自定义变量,默认值为:list、total、pageNo、pageSize
|
|
1749
|
+
* 6. isFull=true,设置【在父节点高度下,上下铺满】(默认值:true)
|
|
1750
|
+
* 7. filterFixed=true,设置查询条件固定,不随滚动条滚动
|
|
1751
|
+
* 8. paginationFixed=true,可设置分页条件在底部固定,不随滚动条滚动
|
|
1752
|
+
* 9. foldKeys=string[],查询条件展开、收起,被收起数组内容为EasyTable.Filter 子节点key值
|
|
1753
|
+
* 10. windows环境下,会在EasyTable.Table外部包装一下 TableScrollbar,提示高windows下table左右滚动体验
|
|
1754
|
+
*
|
|
1755
|
+
* Demo https://fex.qa.tcshuke.com/docs/admin/main/crud/easy-table
|
|
1756
|
+
* ```
|
|
1757
|
+
*/
|
|
1758
|
+
export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>> & {
|
|
1759
|
+
/**
|
|
1760
|
+
* 过滤条件
|
|
1761
|
+
* @param props
|
|
1762
|
+
* @returns
|
|
1763
|
+
*
|
|
1764
|
+
*```
|
|
1765
|
+
*1. 用法1
|
|
1766
|
+
* -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
|
|
1767
|
+
* <EasyTable.Filter>
|
|
1768
|
+
* <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
1769
|
+
* </EasyTable.Filter>
|
|
1770
|
+
*
|
|
1771
|
+
* -- 自定义网格布局 使用 FormCol组件包装 Form.Item
|
|
1772
|
+
* <EasyTable.Filter>
|
|
1773
|
+
* <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
|
|
1774
|
+
* </EasyTable.Filter>
|
|
1775
|
+
*
|
|
1776
|
+
* -- children 可为 function
|
|
1777
|
+
* <EasyTable.Filter>
|
|
1778
|
+
* {(form) => {
|
|
1779
|
+
* return <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
1780
|
+
* }}
|
|
1781
|
+
* </EasyTable.Filter>
|
|
1782
|
+
*2. 用户2(自定义布局)
|
|
1783
|
+
* EasyTable.Filter设置 isPure = true,FormItem无布局规则
|
|
1784
|
+
*3. EasyTable.Filter中内置了 Form 标签,当children为函数时,可获取form实例
|
|
1785
|
+
*4. 默认布局下,可通过设置 filterOperate 设置操作按钮
|
|
1786
|
+
*5. Filter 子节点包含 hidden = true 会被忽略
|
|
1787
|
+
*6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
|
|
1788
|
+
*```
|
|
1789
|
+
*/
|
|
1790
|
+
Filter: (props: EasyTableFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
1750
1791
|
/**
|
|
1792
|
+
* 表格渲染
|
|
1793
|
+
* @param props
|
|
1751
1794
|
* ```
|
|
1752
|
-
* antd table
|
|
1753
|
-
*
|
|
1795
|
+
* 1. 继承了 TableProps 可设置antd table功能
|
|
1796
|
+
* 2. 分页功能已内置处理,不调用 onChange
|
|
1754
1797
|
* ```
|
|
1755
1798
|
*/
|
|
1756
|
-
|
|
1757
|
-
cellVerticalAlign?: "baseline" | "middle" | "top" | "bottom";
|
|
1758
|
-
};
|
|
1759
|
-
columns: EditableTableColumn[];
|
|
1760
|
-
onTableBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
|
|
1799
|
+
Table: <T extends import("@flatbiz/utils").TPlainObject>(props: EasyTableTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
1761
1800
|
/**
|
|
1762
|
-
*
|
|
1801
|
+
* @deprecated 已过时 4.3.0版本移除,请使用 useEasyTable
|
|
1763
1802
|
*/
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
getAddRowDefaultValues?: () => TPlainObject;
|
|
1770
|
-
};
|
|
1771
|
-
export type EditableTableRefApi = {
|
|
1772
|
-
/** 可用于表格行选择操作时,获取操作列数据 */
|
|
1773
|
-
getTableItemDataByFormListItemKey: (key: number) => TPlainObject;
|
|
1803
|
+
useEasyTablRef: () => {
|
|
1804
|
+
current: EasyTableRefApi;
|
|
1805
|
+
};
|
|
1806
|
+
/** 在 EasyTable子组件内才可使用 */
|
|
1807
|
+
useEasyTable: () => EasyTableRefApi;
|
|
1774
1808
|
};
|
|
1809
|
+
export interface EditableFieldProps {
|
|
1810
|
+
className?: string;
|
|
1811
|
+
style?: CSSProperties;
|
|
1812
|
+
editRender: ReactElement | ((data: {
|
|
1813
|
+
value?: TAny;
|
|
1814
|
+
onChange?: (data?: TAny) => void;
|
|
1815
|
+
}) => ReactElement);
|
|
1816
|
+
viewRender?: (value?: TAny) => ReactNode;
|
|
1817
|
+
value?: TAny;
|
|
1818
|
+
onChange?: (data?: TAny) => void;
|
|
1819
|
+
placeholderValue?: string;
|
|
1820
|
+
/** edit 区域是否铺满,showEditableIcon=false 无效 */
|
|
1821
|
+
isEditFull?: boolean;
|
|
1822
|
+
/** 是否可编辑 */
|
|
1823
|
+
editable?: boolean;
|
|
1824
|
+
/** 是否显示编辑、确认、取消操作icon,默认值:true */
|
|
1825
|
+
showEditableIcon?: boolean;
|
|
1826
|
+
/** 点击编辑按钮,操作前,返回reject不会开启编辑效果 */
|
|
1827
|
+
onClickEditIconPre?: (value?: TAny) => Promise<void>;
|
|
1828
|
+
onEditCallback?: (value?: TAny) => void;
|
|
1829
|
+
/** 点击确定按钮,操作前,返回reject不会执行确定功能 */
|
|
1830
|
+
onClickConfirmIconPre?: (value?: TAny, preValue?: TAny) => Promise<void>;
|
|
1831
|
+
onConfirmCallback?: (value?: TAny, preValue?: TAny) => void;
|
|
1832
|
+
/** 组件操作Icon配置 */
|
|
1833
|
+
iconConfig?: {
|
|
1834
|
+
editIcon?: (options: {
|
|
1835
|
+
onClick: () => void;
|
|
1836
|
+
}) => ReactElement;
|
|
1837
|
+
confirmIcon?: (options: {
|
|
1838
|
+
onClick: () => void;
|
|
1839
|
+
}) => ReactElement;
|
|
1840
|
+
cancelIcon?: (options: {
|
|
1841
|
+
onClick: () => void;
|
|
1842
|
+
}) => ReactElement;
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1775
1845
|
/**
|
|
1776
|
-
*
|
|
1777
|
-
* demo:https://fex.qa.tcshuke.com/docs/admin/main/table/row-editable1
|
|
1846
|
+
* 可编辑字段组件
|
|
1778
1847
|
* @param props
|
|
1848
|
+
* @returns
|
|
1779
1849
|
* ```
|
|
1780
|
-
*
|
|
1781
|
-
*
|
|
1782
|
-
*
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1850
|
+
* 字段渲染有两种状态
|
|
1851
|
+
* 1. 只读:如果value类型为复杂格式,必须要通过【viewRender】来进行处理操作,转成简单数据类型
|
|
1852
|
+
* 2. 编辑:参数value的格式要求必须满足编辑组件入参value要求
|
|
1853
|
+
* 3. 可自定义编辑Icon、确定Icon、取消Icon
|
|
1854
|
+
* 4. 可拦截编辑操作、确定操作
|
|
1785
1855
|
* ```
|
|
1786
1856
|
*/
|
|
1787
|
-
export declare const
|
|
1857
|
+
export declare const EditableField: (props: EditableFieldProps) => any;
|
|
1858
|
+
export interface EditableFieldProviderProps {
|
|
1859
|
+
children: ReactElement;
|
|
1860
|
+
editable?: boolean;
|
|
1861
|
+
showEditableIcon?: boolean;
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* EditableFieldProvider 控制内部使有的 EditableField 状态
|
|
1865
|
+
* @param props
|
|
1866
|
+
* @returns
|
|
1867
|
+
*/
|
|
1868
|
+
export declare const EditableFieldProvider: (props: EditableFieldProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
1788
1869
|
export type EditorWrapperProps = {
|
|
1789
1870
|
onChange?: (data?: string) => void;
|
|
1790
1871
|
value?: string;
|
|
@@ -1983,6 +2064,7 @@ export declare const fbaUtils: {
|
|
|
1983
2064
|
getModelKey: () => string;
|
|
1984
2065
|
};
|
|
1985
2066
|
export type FileImportProps = {
|
|
2067
|
+
/** 上传文件接口返回处理 */
|
|
1986
2068
|
onImportFinish: (data?: TAny) => void;
|
|
1987
2069
|
buttonName?: string | ReactElement;
|
|
1988
2070
|
children?: React.ReactNode | ((data: {
|
|
@@ -2743,6 +2825,98 @@ export type RuleDescribeProps = {
|
|
|
2743
2825
|
ruleItemDescStyle?: CSSProperties;
|
|
2744
2826
|
};
|
|
2745
2827
|
export declare const RuleDescribe: (props: RuleDescribeProps) => import("react/jsx-runtime").JSX.Element;
|
|
2828
|
+
export type SearchFormProps = {
|
|
2829
|
+
children: ReactElement | ReactElement[] | ((form: FormInstance) => ReactElement);
|
|
2830
|
+
/** isPure = true时无效 */
|
|
2831
|
+
searchOperate?: (form: FormInstance) => FormOperateColProps;
|
|
2832
|
+
/** 是否为纯净模式(查询条件布局是否自定义), */
|
|
2833
|
+
isPure?: boolean;
|
|
2834
|
+
/** 查询按钮配置 */
|
|
2835
|
+
queryButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
2836
|
+
text?: string;
|
|
2837
|
+
};
|
|
2838
|
+
/** 重置按钮配置 */
|
|
2839
|
+
resetButtonProps?: Omit<ButtonWrapperProps, "onClick"> & {
|
|
2840
|
+
text?: string;
|
|
2841
|
+
};
|
|
2842
|
+
/**
|
|
2843
|
+
* 网格布局设置
|
|
2844
|
+
* default = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };
|
|
2845
|
+
* small = { xs: 24, sm: 8, md: 8, lg: 6, xl: 6, xxl: 6 };
|
|
2846
|
+
*/
|
|
2847
|
+
formGridSize?: FormRowProps["gridSize"];
|
|
2848
|
+
formClassName?: string;
|
|
2849
|
+
formStyle?: CSSProperties;
|
|
2850
|
+
/**
|
|
2851
|
+
* 自定义 searchOperate.rightList 后 默认【查询、重置】按钮处理逻辑
|
|
2852
|
+
* 1. cover:覆盖内部查询重置按钮(默认值)
|
|
2853
|
+
* 2. beforeAppend:添加到【查询重置】按钮前面
|
|
2854
|
+
* 3. afterAppend:添加到【查询重置】按钮后面
|
|
2855
|
+
*
|
|
2856
|
+
* 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
|
|
2857
|
+
*/
|
|
2858
|
+
rightOperateAreaAppendType?: "cover" | "beforeAppend" | "afterAppend";
|
|
2859
|
+
/** 默认重启按钮触发请求,默认值:true */
|
|
2860
|
+
defaultResetButtonTriggerRequest?: boolean;
|
|
2861
|
+
foldKeys?: string[];
|
|
2862
|
+
formInitialValues?: TPlainObject;
|
|
2863
|
+
/**
|
|
2864
|
+
* 按钮提交事件
|
|
2865
|
+
* 如果需要自定义回车提交事件,需要自定义提交按钮
|
|
2866
|
+
*/
|
|
2867
|
+
onFormFinish?: (values?: TPlainObject) => void;
|
|
2868
|
+
/** 重置按钮 */
|
|
2869
|
+
onReset?: () => void;
|
|
2870
|
+
/** 查询按钮 */
|
|
2871
|
+
onQuery?: (values: TPlainObject) => void;
|
|
2872
|
+
/**
|
|
2873
|
+
* 是否缓存查询数据,默认值:true
|
|
2874
|
+
* ```
|
|
2875
|
+
* 1. 一般首页可缓存,二级、三级等页面不能缓存
|
|
2876
|
+
* ```
|
|
2877
|
+
*/
|
|
2878
|
+
cacheSwitch?: boolean;
|
|
2879
|
+
/** 初始化是否请求,默认值:true */
|
|
2880
|
+
initRequest?: boolean;
|
|
2881
|
+
};
|
|
2882
|
+
export type SearchFormRefApi = {
|
|
2883
|
+
onQuery: (values?: TPlainObject) => void;
|
|
2884
|
+
form: FormInstance;
|
|
2885
|
+
};
|
|
2886
|
+
/**
|
|
2887
|
+
* 搜索表单
|
|
2888
|
+
*
|
|
2889
|
+
*```
|
|
2890
|
+
* 1. 用法1
|
|
2891
|
+
* -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
|
|
2892
|
+
* <SearchForm>
|
|
2893
|
+
* <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
2894
|
+
* </SearchForm>
|
|
2895
|
+
*
|
|
2896
|
+
* -- 自定义网格布局 使用 FormCol组件包装 Form.Item
|
|
2897
|
+
* <SearchForm>
|
|
2898
|
+
* <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
|
|
2899
|
+
* </SearchForm>
|
|
2900
|
+
*
|
|
2901
|
+
* -- children 可为 function
|
|
2902
|
+
* <SearchForm>
|
|
2903
|
+
* {(form) => {
|
|
2904
|
+
* return <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
2905
|
+
* }}
|
|
2906
|
+
* </SearchForm>
|
|
2907
|
+
*
|
|
2908
|
+
* 2. 用户2(自定义布局)
|
|
2909
|
+
* SearchForm设置 isPure = true,FormItem无布局规则
|
|
2910
|
+
* 3. SearchForm中内置了 Form 标签,当children为函数时,可获取form实例
|
|
2911
|
+
* 4. 默认布局下,可通过设置 searchOperate 设置操作按钮
|
|
2912
|
+
* 5. SearchForm 子节点包含 hidden = true 会被忽略
|
|
2913
|
+
* 6. 如果想隐藏【查询、重置】按钮中的某一个,可设置 queryButtonProps.hidden、resetButtonProps.hidden
|
|
2914
|
+
* 7. 通过设置 defaultResetButtonTriggerRequest,可在右侧按钮区域新增自定义按钮
|
|
2915
|
+
* 8. 可设置 cacheSwitch 来控制是否缓存查询数据(一般一级页面可缓存,二级、三级等不能缓存),
|
|
2916
|
+
* 缓存数据存储在内存中,react路由跳转可正常读取缓存,浏览器刷新后缓存丢失
|
|
2917
|
+
*```
|
|
2918
|
+
*/
|
|
2919
|
+
export declare const SearchForm: import("react").ForwardRefExoticComponent<SearchFormProps & import("react").RefAttributes<SearchFormRefApi>>;
|
|
2746
2920
|
export interface ISearchMenuProps {
|
|
2747
2921
|
/**
|
|
2748
2922
|
* 如果传了value,就变成受控组件
|
|
@@ -3201,6 +3375,7 @@ export declare const tableCellRender: {
|
|
|
3201
3375
|
* 可配置
|
|
3202
3376
|
* 1. separator:是否显示千分位分隔符,默认值:false
|
|
3203
3377
|
* 2. defaultValue:当值为空默认展示
|
|
3378
|
+
* 3. hideBgColor:隐藏背景颜色
|
|
3204
3379
|
*
|
|
3205
3380
|
* 例如:
|
|
3206
3381
|
* fen2yuanCell()(100090) => 1000.90
|
|
@@ -3215,6 +3390,35 @@ export declare const tableCellRender: {
|
|
|
3215
3390
|
/** 是否显示分隔符,默认值:false */
|
|
3216
3391
|
separator?: boolean;
|
|
3217
3392
|
defaultValue?: string | number;
|
|
3393
|
+
/** 隐藏背景颜色 */
|
|
3394
|
+
hideBgColor?: boolean;
|
|
3395
|
+
}) => (value?: string | number) => string | number | import("react/jsx-runtime").JSX.Element | undefined;
|
|
3396
|
+
/**
|
|
3397
|
+
* 分金额展示,入参分,显示万元(默认添加千分位)
|
|
3398
|
+
* ```
|
|
3399
|
+
* 可配置
|
|
3400
|
+
* 1. separator:是否显示千分位分隔符,默认值:false
|
|
3401
|
+
* 2. defaultValue:当值为空默认展示
|
|
3402
|
+
* 3. showBgColor:隐藏背景颜色
|
|
3403
|
+
* 4. removeTailZero:移除小数点后末尾零
|
|
3404
|
+
*
|
|
3405
|
+
* 例如:
|
|
3406
|
+
* fen2yuanCell()(1000900000) => 1000.90
|
|
3407
|
+
* fen2yuanCell({separator: true})(1000900000) => 1,000.90
|
|
3408
|
+
* fen2yuanCell()('abc') => abc
|
|
3409
|
+
* fen2yuanCell({defaultValue: '--'})('') => --
|
|
3410
|
+
* fen2yuanCell()('') => undefined
|
|
3411
|
+
* fen2yuanCell({ defaultValue: 0 })('') => 0.00
|
|
3412
|
+
* ```
|
|
3413
|
+
*/
|
|
3414
|
+
fen2wanCell: (options?: {
|
|
3415
|
+
/** 是否显示分隔符,默认值:false */
|
|
3416
|
+
separator?: boolean;
|
|
3417
|
+
defaultValue?: string | number;
|
|
3418
|
+
/** 隐藏背景颜色,默认:false */
|
|
3419
|
+
showBgColor?: boolean;
|
|
3420
|
+
/** 移除小数点后末尾零 */
|
|
3421
|
+
removeTailZero?: boolean;
|
|
3218
3422
|
}) => (value?: string | number) => string | number | import("react/jsx-runtime").JSX.Element | undefined;
|
|
3219
3423
|
/**
|
|
3220
3424
|
* 单元格徽标展示数据
|
|
@@ -3336,6 +3540,7 @@ export type CssTextEllipsisProps = {
|
|
|
3336
3540
|
};
|
|
3337
3541
|
/**
|
|
3338
3542
|
* 内容超过宽度截取,并在尾部添加...,被截取的添加Tooltip显示完整数据
|
|
3543
|
+
* @deprecated 已过期,请使用 TextOverflow 组件
|
|
3339
3544
|
* ```
|
|
3340
3545
|
* 1. 如果配置 width,则使用文本长度与width进行比较
|
|
3341
3546
|
* 2. 如果没有配置 width,则使用文本长度与当前节点父节点宽度进行比较
|
|
@@ -3346,6 +3551,39 @@ export type CssTextEllipsisProps = {
|
|
|
3346
3551
|
* ```
|
|
3347
3552
|
*/
|
|
3348
3553
|
export declare const TextCssEllipsis: (props: CssTextEllipsisProps) => import("react/jsx-runtime").JSX.Element;
|
|
3554
|
+
export type TextOverflowProps = {
|
|
3555
|
+
text: string;
|
|
3556
|
+
/** 最大显示宽度 */
|
|
3557
|
+
maxWidth?: number;
|
|
3558
|
+
/** 最大显示字数 */
|
|
3559
|
+
maxLength?: number;
|
|
3560
|
+
/** 隐藏tips */
|
|
3561
|
+
hideTips?: boolean;
|
|
3562
|
+
onClick?: (e: any) => void;
|
|
3563
|
+
};
|
|
3564
|
+
/**
|
|
3565
|
+
* 内容溢出截取,并在尾部添加...,被截取的添加Tooltip显示完整数据
|
|
3566
|
+
* ```
|
|
3567
|
+
* 控制文本显示三种方式
|
|
3568
|
+
* 1. 通过 maxLength 控制超长
|
|
3569
|
+
* 2. 通过 maxWidth 控制超长
|
|
3570
|
+
* 3. 与父节点宽度比较,控制超长
|
|
3571
|
+
*
|
|
3572
|
+
* 注意:
|
|
3573
|
+
* 1. 当前节点父节点需要添加 overflow-x: hidden;
|
|
3574
|
+
* 2. 如果父节点设置flex-shrink会有影响,可复写flex-shrink: initial;
|
|
3575
|
+
* 3. 与 Table columns render结合使用,需要配置ellipsis=true
|
|
3576
|
+
* 例如:<Table columns={[{
|
|
3577
|
+
...
|
|
3578
|
+
render: (value) => {
|
|
3579
|
+
return <TextOverflow text={value} />;
|
|
3580
|
+
},
|
|
3581
|
+
ellipsis: true,
|
|
3582
|
+
}]} />
|
|
3583
|
+
4. 与 Table columns render结合使用,如果Table配置了 scroll={{ x: 'max-content' }}后,TextOverflow功能失效
|
|
3584
|
+
* ```
|
|
3585
|
+
*/
|
|
3586
|
+
export declare const TextOverflow: (props: TextOverflowProps) => import("react/jsx-runtime").JSX.Element;
|
|
3349
3587
|
export type TextOverflowRenderProps = {
|
|
3350
3588
|
/** width 宽度控制超长 */
|
|
3351
3589
|
width?: number;
|
|
@@ -3361,6 +3599,7 @@ export type TextOverflowRenderProps = {
|
|
|
3361
3599
|
};
|
|
3362
3600
|
/**
|
|
3363
3601
|
* 文本显示超出截取,被截取的添加Tooltip显示完整数据
|
|
3602
|
+
* @deprecated 已过期,请使用 TextOverflow 组件
|
|
3364
3603
|
* ```
|
|
3365
3604
|
* 控制文本显示两种方式
|
|
3366
3605
|
* 1. 通过 maxLength 控制超长
|