2024-12-11 17:56:03 +08:00
|
|
|
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 types = [
|
|
|
|
|
{
|
|
|
|
|
label: "设备维修",
|
|
|
|
|
value: 0
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "设备更换",
|
|
|
|
|
value: 1
|
|
|
|
|
},{
|
|
|
|
|
label: "结构加固",
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
|
|
|
|
const onFinish = (values) => {
|
2024-12-16 17:46:34 +08:00
|
|
|
let dateTimeRangeSo;
|
2024-12-11 17:56:03 +08:00
|
|
|
if (values.tm) {
|
2024-12-16 17:46:34 +08:00
|
|
|
dateTimeRangeSo = {
|
2026-01-05 17:34:06 +08:00
|
|
|
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
|
|
|
|
|
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
|
2024-12-11 17:56:03 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
delete values.tm
|
2024-12-16 17:46:34 +08:00
|
|
|
setSearchVal({...values, dateTimeRangeSo});
|
2024-12-11 17:56:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
|
|
|
|
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
2024-12-16 17:46:34 +08:00
|
|
|
<Form.Item label="项目名称" name="projectName">
|
2024-12-11 17:56:03 +08:00
|
|
|
<Input allowClear style={{width:'150px'}}/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="记录时间" name="tm">
|
|
|
|
|
<RangePicker
|
|
|
|
|
allowClear
|
2024-12-17 17:42:56 +08:00
|
|
|
style={{ width: "330px" }}
|
2026-01-05 17:34:06 +08:00
|
|
|
format="YYYY-MM-DD"
|
2024-12-11 17:56:03 +08:00
|
|
|
/>
|
|
|
|
|
</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;
|