/** @format */

import * as React from 'react';
import Select, {SelectProps} from './select';
import {useQueryTypeList} from '../../service/configQueryType';
interface Iprops extends SelectProps {
    data_api_id?: number | '';
}
export default React.forwardRef((props: Iprops, ref) => {
    const {data_api_id, ...rest} = props;
    const [listState, requestList] = useQueryTypeList();
    React.useEffect(() => {
        if (data_api_id) {
            requestList(data_api_id);
        }
    }, [data_api_id]);
    return <Select ref={ref} options={listState.dataSource} placeholder='请选择查询方式' {...rest} />;
});
