76 lines
2.5 KiB
JavaScript
76 lines
2.5 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}>
|
|
<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 label="发布日期" name="name">
|
|
<RangePicker allowClear />
|
|
</Form.Item>
|
|
<Form.Item label="发布单位" name="name">
|
|
<Input allowClear style={{ width: '150px' }} />
|
|
</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>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default ToolBar; |