Commit fb513653 authored by 涂伟's avatar 涂伟

fix: 'tableRender条件筛选组件优化'

parent 6b1e72aa
......@@ -49,6 +49,7 @@ const SearchGroup = forwardRef((props, ref) => {
useImperativeHandle(ref, () => ({
getQueryInfo
}));
const [form] = Form.useForm();
// const {
// fieldSearch
......@@ -180,19 +181,32 @@ const SearchGroup = forwardRef((props, ref) => {
// getAccountData();
// }
setQueryInfo({...queryInfo,info: e})
getQueryInfo(form.getFieldsValue())
};
const getQueryInfo = () => {
return queryInfo
const onValuesChange = (values) => {
let keys = Object.keys(values)
if (keys.includes('info')) return
getQueryInfo(form.getFieldsValue())
}
const getQueryInfo = (data) => {
let params = {}
params.timeFrom = data.time&&data.time[0].format('YYYY-MM-DD HH:mm:ss') || ''
params.timeTo = data.time&&data.time[1].format('YYYY-MM-DD HH:mm:ss') || ''
params.info = data.info
console.log(params,'666666666666666');
props&&props.onChange(params)
return params
}
return (
<div className={styles.accountFlexWrapper}>
<Row className={styles.controlRow}>
<Form layout={'horizontal'}>
<Form layout={'horizontal'} form={form} onValuesChange={onValuesChange}>
<Space className={styles.controlRowLeft} wrap>
{showPicker ? (
<Form.Item label={`录入时间`} className={styles.noMarginBottom}>
<Form.Item label={`录入时间`} name='time' className={styles.noMarginBottom}>
<RangePicker
size='middle'
value={[...dateArray]}
......@@ -202,7 +216,7 @@ const SearchGroup = forwardRef((props, ref) => {
ranges={{ ...rangerOptions }}
format={formatterStr}
style={{ width: 300 }}
onChange={dateChange}
// onChange={dateChange}
/>
</Form.Item>
) : (
......@@ -224,7 +238,7 @@ const SearchGroup = forwardRef((props, ref) => {
</Select>
</Form.Item>
))} */}
<Form.Item label={'快捷搜索'} className={styles.noMarginBottom}>
<Form.Item label={'快捷搜索'} name='info' className={styles.noMarginBottom}>
{/* {searchKey && fieldSearch ? <Select
style={{ maxWidth: '112px' }}
placeholder='请选择字段'
......@@ -255,8 +269,8 @@ const SearchGroup = forwardRef((props, ref) => {
marginLeft: '10px'
}}
placeholder='请输入值'
value={searchValues}
onChange={e => setSearchValues(e.target.value)}
// value={searchValues}
// onChange={e => setSearchValues(e.target.value)}
onSearch={onSearch}
/>
</Form.Item>
......
......@@ -96,7 +96,7 @@ const TableRender = (props) => {
return (
<div className={styles.tableRender}>
<div className={styles.top}>
{/* <SearchGroup /> */}
<SearchGroup />
</div>
<div className={styles.bottom}>
<Table
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment