49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
|
|
import React, { useEffect,useState } from 'react';
|
||
|
|
import { Form, Input, Button, DatePicker } from 'antd';
|
||
|
|
import moment from 'moment';
|
||
|
|
// import '../../../index.less'
|
||
|
|
|
||
|
|
|
||
|
|
const ToolBar = ({ setSearchVal, onSave }) => {
|
||
|
|
const [form] = Form.useForm();
|
||
|
|
// const [source,setSource] = useState([])
|
||
|
|
// const [sttp,setSttp] = useState([])
|
||
|
|
|
||
|
|
const onFinish = (val) => {
|
||
|
|
val.buildYear=val.buildYear?moment(val.buildYear).format('YYYY'):undefined
|
||
|
|
setSearchVal(val);
|
||
|
|
}
|
||
|
|
|
||
|
|
useEffect(()=>{
|
||
|
|
getSelect()
|
||
|
|
},[])
|
||
|
|
|
||
|
|
const getSelect = async()=>{
|
||
|
|
// setSource(await getDictService({dictType:'source'}))
|
||
|
|
// setSttp(await getDictService({dictType:'sttp'}))
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||
|
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||
|
|
<Form.Item label="用户" name="user">
|
||
|
|
<Input allowClear placeholder='请输入测站名称' style={{width:'180px'}}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item>
|
||
|
|
<Button type="primary" htmlType="submit">查询</Button>
|
||
|
|
</Form.Item>
|
||
|
|
|
||
|
|
<Form.Item>
|
||
|
|
<Button type="primary" htmlType="submit">添加已有用户</Button>
|
||
|
|
</Form.Item>
|
||
|
|
{/* <Form.Item>
|
||
|
|
<Button type="primary" >新建用户</Button>
|
||
|
|
</Form.Item> */}
|
||
|
|
</Form>
|
||
|
|
</div>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default ToolBar;
|