2024-09-24 16:52:53 +08:00
|
|
|
import React, { useEffect,useState } from 'react';
|
|
|
|
|
import { Form, Upload, Button,Row, Col, Input, DatePicker, message,Modal } from 'antd';
|
|
|
|
|
import NormalSelect from '../../../components/Form/NormalSelect';
|
2024-09-26 17:45:57 +08:00
|
|
|
import moment from 'moment';
|
2024-09-24 16:52:53 +08:00
|
|
|
|
|
|
|
|
const ToolBar = ({ setSearchVal }) => {
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
const types = [
|
|
|
|
|
{
|
2024-10-15 10:56:24 +08:00
|
|
|
label: '培训人次',
|
2024-09-24 16:52:53 +08:00
|
|
|
value: 1
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-10-15 10:56:24 +08:00
|
|
|
label: '培训期数',
|
2024-09-24 16:52:53 +08:00
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
]
|
2024-09-26 17:45:57 +08:00
|
|
|
const valuesChange = (e,allvalue) => {
|
|
|
|
|
setSearchVal({ ...allvalue,year:moment(allvalue.year).format("YYYY") })
|
|
|
|
|
}
|
2024-09-24 16:52:53 +08:00
|
|
|
|
2024-09-26 17:45:57 +08:00
|
|
|
useEffect(() => {
|
2024-11-15 14:04:53 +08:00
|
|
|
const value = {year:moment()}
|
2024-09-26 17:45:57 +08:00
|
|
|
form.setFieldsValue(value)
|
|
|
|
|
setSearchVal({...value,year:moment().format("YYYY")})
|
|
|
|
|
}, [])
|
|
|
|
|
|
2024-09-24 16:52:53 +08:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div style={{display:'flex',justifyContent:'space-between'}}>
|
2024-09-26 17:45:57 +08:00
|
|
|
<Form form={form} className='toolbarBox' layout="inline" onValuesChange={valuesChange}>
|
2024-11-15 14:04:53 +08:00
|
|
|
{/* <Form.Item label="统计维度" name="teamName">
|
2024-09-24 16:52:53 +08:00
|
|
|
<NormalSelect allowClear style={{ width: '150px' }} options={types} />
|
2024-11-15 14:04:53 +08:00
|
|
|
</Form.Item> */}
|
2024-09-26 17:45:57 +08:00
|
|
|
<Form.Item label="选择年份" name="year">
|
2024-09-24 16:52:53 +08:00
|
|
|
<DatePicker
|
|
|
|
|
allowClear
|
|
|
|
|
showTime
|
|
|
|
|
style={{ width: "150px" }}
|
|
|
|
|
picker='year'
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ToolBar;
|