35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
|
|
import React, { useEffect,useState } from 'react';
|
||
|
|
import { Form, Input, Button, DatePicker } from 'antd';
|
||
|
|
|
||
|
|
import moment from 'moment';
|
||
|
|
const { RangePicker } = DatePicker;
|
||
|
|
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||
|
|
const addBtn = role?.rule?.find(item => item.menuName == "新增");
|
||
|
|
const [form] = Form.useForm();
|
||
|
|
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="name">
|
||
|
|
<Input allowClear style={{width:'150px'}}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item>
|
||
|
|
<Button type="primary" htmlType="submit">查询</Button>
|
||
|
|
</Form.Item>
|
||
|
|
{
|
||
|
|
(onSave && addBtn) ?
|
||
|
|
<Form.Item>
|
||
|
|
<Button onClick={onSave} >新增</Button>
|
||
|
|
</Form.Item>
|
||
|
|
:null
|
||
|
|
}
|
||
|
|
</Form>
|
||
|
|
</div>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default ToolBar;
|