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