feat: filter form for table
This commit is contained in:
@@ -59,6 +59,7 @@ import {
|
||||
ModelInstanceListItem,
|
||||
SourceType
|
||||
} from '../config/types';
|
||||
import Filters from '../filters';
|
||||
import useEditDeployment from '../hooks/use-edit-deployment';
|
||||
import useFilterStatus from '../hooks/use-filter-status';
|
||||
import useFormInitialValues from '../hooks/use-form-initial-values';
|
||||
@@ -649,7 +650,7 @@ const Models: React.FC<ModelsProps> = ({
|
||||
options={statusOptions}
|
||||
onChange={handleStatusChange}
|
||||
></BaseSelect>
|
||||
{/* <Filters
|
||||
<Filters
|
||||
initialValues={{
|
||||
cluster_id: undefined,
|
||||
state: undefined,
|
||||
@@ -657,7 +658,7 @@ const Models: React.FC<ModelsProps> = ({
|
||||
}}
|
||||
clusterList={clusterList}
|
||||
onValuesChange={onFilterChange}
|
||||
></Filters> */}
|
||||
></Filters>
|
||||
<Button
|
||||
type="text"
|
||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||
|
||||
@@ -2,7 +2,6 @@ import BaseSelect from '@/components/seal-form/base/select';
|
||||
import FilterForm from '@/pages/_components/filter-form';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import styled from 'styled-components';
|
||||
import { modelCategories } from '../config';
|
||||
import useFilterStatus from '../hooks/use-filter-status';
|
||||
@@ -25,12 +24,10 @@ const FilterFormContent: React.FC<FilterFormContentProps> = ({
|
||||
onValuesChange
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const form = Form.useFormInstance();
|
||||
const { labelRender, optionRender, statusOptions } = useFilterStatus();
|
||||
|
||||
const handleOnValuesChange = (changedValues: any, allValues: any) => {
|
||||
const query = _.pickBy(allValues, (value: any) => !!value);
|
||||
onValuesChange?.(query);
|
||||
onValuesChange?.(allValues);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user