91 lines
3.1 KiB
JavaScript
91 lines
3.1 KiB
JavaScript
|
|
import React, { useEffect,useState } from 'react';
|
||
|
|
import { Form, Input, Button, DatePicker, Select } from 'antd';
|
||
|
|
import { DownOutlined, UpOutlined } from '@ant-design/icons'
|
||
|
|
|
||
|
|
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 [showGj , setShowGj] =useState(false)
|
||
|
|
const onFinish = (values) => {
|
||
|
|
let dataSo;
|
||
|
|
if (values.tm) {
|
||
|
|
dataSo = {
|
||
|
|
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||
|
|
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
|
||
|
|
}
|
||
|
|
}
|
||
|
|
delete values.tm
|
||
|
|
setSearchVal({...values, dataSo});
|
||
|
|
}
|
||
|
|
|
||
|
|
const opntios=[
|
||
|
|
{label:'宪法',value:'宪法'},
|
||
|
|
{label:'法律',value:'法律'},
|
||
|
|
{label:'行政法规',value:'行政法规'},
|
||
|
|
{label:'督察法规',value:'督察法规'},
|
||
|
|
{label:'司法解释',value:'司法解释'},
|
||
|
|
{label:'地方性法规',value:'地方性法规'},
|
||
|
|
]
|
||
|
|
const styles={
|
||
|
|
fontFamily: '微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif',
|
||
|
|
fontWeight: '700',
|
||
|
|
fontStyle: 'normal',
|
||
|
|
fontSize: '16px'
|
||
|
|
}
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||
|
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||
|
|
<div style={{display:'flex'}}>
|
||
|
|
<Form.Item label="标题" name="name">
|
||
|
|
<Input allowClear style={{width:'150px'}}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item label="制定机关" name="name">
|
||
|
|
<Input allowClear style={{width:'150px'}}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item label="制定机关" name="name">
|
||
|
|
<Select allowClear style={{width:'150px'}} options={opntios}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item>
|
||
|
|
<Button type="primary" htmlType="submit">查询</Button>
|
||
|
|
</Form.Item>
|
||
|
|
|
||
|
|
<Form.Item>
|
||
|
|
<Button onClick={() => form.resetFields()}>重置</Button>
|
||
|
|
</Form.Item>
|
||
|
|
|
||
|
|
{
|
||
|
|
(onSave) ?
|
||
|
|
<Form.Item>
|
||
|
|
<Button onClick={onSave}>新增</Button>
|
||
|
|
</Form.Item>
|
||
|
|
:null
|
||
|
|
}
|
||
|
|
<Form.Item>
|
||
|
|
<div style={styles} onClick={()=>setShowGj(!showGj)}>高级搜索 {!showGj&&<DownOutlined />} {showGj&&<UpOutlined />}</div>
|
||
|
|
</Form.Item>
|
||
|
|
</div>
|
||
|
|
{showGj&&<div style={{display:'flex'}}>
|
||
|
|
<Form.Item label="时效性" name="name">
|
||
|
|
<Select allowClear style={{width:'150px'}} options={opntios}/>
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item label="公布日期" name="name">
|
||
|
|
<RangePicker allowClear />
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item label="施行日期" name="name">
|
||
|
|
<RangePicker allowClear />
|
||
|
|
</Form.Item>
|
||
|
|
<Form.Item label="上传时间" name="name">
|
||
|
|
<RangePicker allowClear />
|
||
|
|
</Form.Item>
|
||
|
|
</div>}
|
||
|
|
</Form>
|
||
|
|
</div>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default ToolBar;
|