import { debounce } from 'lodash';
<Form.Item label="前置任务" vvspan={24} labelCol={{ md: 3 }} wrapperCol={{ md: 21 }}>
{getFieldDecorator('frontTaskId', {
initialValue: getPath(initInfo, 'frontTaskId', undefined)
})(
<Select
placeholder="请选择前置任务"
allowClear
showSearch
onSearch={handleSearchFront}
onChange={handleChangeFront}
filterOption={false}
>
{frontList.map(item => (
<Option key={item.taskId} value={item.taskId}>
{item.taskName}
</Option>
))}
</Select>
)}
</Form.Item>
// 前置任务列表搜索
const handleSearchFront = debounce(value => {
fetchFrontList(value);
}, 200);
// const handleSearchFront = value => {
// fetchFrontList(value);
// };
const handleChangeFront = debounce(value => {
if (value === undefined) {
fetchFrontList();
}
}, 200);
// const handleChangeFront = value => {
// if (value === undefined) {
// fetchFrontList();
// }
// };