2024-09-20 15:02:50 +08:00
|
|
|
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 }) => {
|
2024-09-23 13:49:58 +08:00
|
|
|
const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
2024-09-20 15:02:50 +08:00
|
|
|
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;
|