|
@@ -0,0 +1,50 @@
|
|
|
+import {FilterButtonGroup, FilterSelect} from '@components';
|
|
|
+import {useContextSection, useFilterField} from '@hooks';
|
|
|
+import {Card, Row} from 'antd';
|
|
|
+import {FC} from 'react';
|
|
|
+import {searchContext} from '../context';
|
|
|
+import {useSearch} from './hooks';
|
|
|
+
|
|
|
+const interfaceOptions = [
|
|
|
+ {label: '全部', value: ''},
|
|
|
+ {label: '质检信息', value: '质检信息'},
|
|
|
+ {label: '字典信息', value: '字典信息'},
|
|
|
+ {label: '采购信息', value: '采购信息'},
|
|
|
+ {label: '生产领料信息', value: '生产领料信息'},
|
|
|
+ {label: '非生产领料信息', value: '非生产领料信息'},
|
|
|
+ {label: '报工单', value: '报工单'},
|
|
|
+ {label: '交货单', value: '交货单'},
|
|
|
+ {label: '移库单', value: '移库单'},
|
|
|
+ {label: '入库回传', value: '入库回传'},
|
|
|
+ {label: '出库回传', value: '出库回传'},
|
|
|
+];
|
|
|
+
|
|
|
+const Filter: FC = function () {
|
|
|
+ const [{type, accessType}, onChange] = useFilterField({type: '', accessType: ''});
|
|
|
+ const {refetch, isSearching} = useContextSection(searchContext, state => state[0]);
|
|
|
+ const onSearch = useSearch(type, accessType);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Card>
|
|
|
+ <Row>
|
|
|
+ <FilterSelect
|
|
|
+ name='dictionaryName'
|
|
|
+ label='接口名称'
|
|
|
+ value={type}
|
|
|
+ onChange={onChange('type')}
|
|
|
+ options={interfaceOptions}
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
+
|
|
|
+ <FilterButtonGroup
|
|
|
+ isSearching={isSearching}
|
|
|
+ onSearch={onSearch}
|
|
|
+ onRefresh={refetch}
|
|
|
+ offset={12}
|
|
|
+ />
|
|
|
+ </Row>
|
|
|
+ </Card>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Filter;
|