58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
|
|
import React, { useEffect,useState } from 'react';
|
||
|
|
import { Form, Input, Button, DatePicker } from 'antd';
|
||
|
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
||
|
|
import moment from 'moment';
|
||
|
|
const { RangePicker } = DatePicker;
|
||
|
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||
|
|
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
||
|
|
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
|
||
|
|
const [form] = Form.useForm();
|
||
|
|
const types = [
|
||
|
|
{
|
||
|
|
label: "枯",
|
||
|
|
value:1
|
||
|
|
},
|
||
|
|
{
|
||
|
|
label: "偏枯",
|
||
|
|
value:2
|
||
|
|
},
|
||
|
|
{
|
||
|
|
label: "平",
|
||
|
|
value:3
|
||
|
|
},
|
||
|
|
{
|
||
|
|
label: "偏丰",
|
||
|
|
value:4
|
||
|
|
},
|
||
|
|
{
|
||
|
|
label: "丰",
|
||
|
|
value:5
|
||
|
|
},
|
||
|
|
]
|
||
|
|
const onFinish = (values) => {
|
||
|
|
setSearchVal({...values});
|
||
|
|
}
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||
|
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||
|
|
<Form.Item label="丰平枯" name="status">
|
||
|
|
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
||
|
|
</Form.Item>
|
||
|
|
{searchBtn ? <Form.Item>
|
||
|
|
<Button type="primary" htmlType="submit">查询</Button>
|
||
|
|
</Form.Item> : null }
|
||
|
|
{
|
||
|
|
(onSave && addBtn) ?
|
||
|
|
<Form.Item>
|
||
|
|
<Button onClick={onSave}>新增</Button>
|
||
|
|
</Form.Item>
|
||
|
|
:null
|
||
|
|
}
|
||
|
|
</Form>
|
||
|
|
</div>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default ToolBar;
|