mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-27 08:39:59 +08:00
commit
0fb888fff9
@ -32,7 +32,7 @@ const TableStateSpec = Type.Object({
|
||||
clickedRow: Type.Optional(Type.Any()),
|
||||
selectedRows: Type.Array(Type.Any()),
|
||||
selectedRowKeys: Type.Array(Type.String()),
|
||||
filterRule: Type.Any(),
|
||||
filterRule: Type.Record(Type.String(), Type.Array(Type.String())),
|
||||
sortRule: Type.Object({
|
||||
field: Type.Optional(Type.String()),
|
||||
direction: Type.Optional(Type.String()),
|
||||
@ -46,8 +46,6 @@ type SortRule = {
|
||||
direction?: 'ascend' | 'descend';
|
||||
};
|
||||
|
||||
type FilterRule = Partial<Record<string, string[]>>;
|
||||
|
||||
type ColumnProperty = Static<typeof ColumnSpec> & ColumnProps;
|
||||
|
||||
type filterDropdownParam = {
|
||||
@ -483,7 +481,7 @@ export const Table = implementRuntimeComponent({
|
||||
const handleChange = (
|
||||
pagination: PaginationProps,
|
||||
sorter: { field?: string; direction?: 'descend' | 'ascend' },
|
||||
filters: FilterRule,
|
||||
filters: Partial<Record<string, string[]>>,
|
||||
extra: { currentData: any[]; action: 'paginate' | 'sort' | 'filter' }
|
||||
) => {
|
||||
const { current } = pagination;
|
||||
@ -508,7 +506,7 @@ export const Table = implementRuntimeComponent({
|
||||
break;
|
||||
case 'filter':
|
||||
if (!useDefaultFilter) {
|
||||
mergeState({ filterRule: filters });
|
||||
mergeState({ filterRule: filters as Record<string, string[]> });
|
||||
callbackMap?.onFilter?.();
|
||||
}
|
||||
break;
|
||||
|
@ -20,7 +20,7 @@ declare module '../../types/widget' {
|
||||
|
||||
export const NumberField: React.FC<WidgetProps<NumberFieldType>> = props => {
|
||||
const { value, onChange } = props;
|
||||
const [stringValue, setStringValue] = React.useState('');
|
||||
const [stringValue, setStringValue] = React.useState(String(value));
|
||||
const numValue = useRef<number>(value);
|
||||
|
||||
useEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user