2021-05-19 16:05:01 +05:00
|
|
|
import React from "react"; // , { useState }
|
2021-05-13 13:50:25 +05:00
|
|
|
import {
|
|
|
|
DatePicker,
|
|
|
|
Radio,
|
|
|
|
ConfigProvider,
|
|
|
|
Button,
|
|
|
|
Select,
|
|
|
|
Checkbox,
|
|
|
|
} from 'antd';
|
|
|
|
import 'moment/locale/ru';
|
|
|
|
import locale from 'antd/lib/locale/ru_RU';
|
2021-05-19 16:05:01 +05:00
|
|
|
import moment from "moment";
|
2021-05-12 17:53:35 +05:00
|
|
|
|
2021-05-13 13:50:25 +05:00
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
const { Option } = Select;
|
2021-05-12 17:53:35 +05:00
|
|
|
|
|
|
|
|
2021-05-19 16:05:01 +05:00
|
|
|
|
|
|
|
|
2021-05-13 13:50:25 +05:00
|
|
|
// Расширение файла для составленного рапорта
|
2021-05-19 16:05:01 +05:00
|
|
|
const ExceptionFileChecker = () => {
|
2021-05-13 13:50:25 +05:00
|
|
|
const [value, setValue] = React.useState(1);
|
|
|
|
const onChange = e => {
|
|
|
|
console.log('radio checked', e.target.value);
|
|
|
|
setValue(e.target.value);
|
|
|
|
}
|
2021-05-12 17:53:35 +05:00
|
|
|
|
2021-05-13 13:50:25 +05:00
|
|
|
return (<Radio.Group onChange={onChange} value={value}>
|
|
|
|
<Radio value={1}>PDF</Radio>
|
|
|
|
<Radio value={2}>LAS</Radio>
|
|
|
|
</Radio.Group>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Выбор периода времени
|
|
|
|
const PeriodOfTime = () => {
|
2021-05-19 16:05:01 +05:00
|
|
|
function disabledDate(current) {
|
|
|
|
return current && current < moment().subtract(3, 'days'); // Наверно, не надо)
|
|
|
|
}
|
|
|
|
// const [startDate, setStartDate] = useState(new Date());
|
|
|
|
|
2021-05-13 13:50:25 +05:00
|
|
|
|
|
|
|
return (
|
2021-05-19 16:05:01 +05:00
|
|
|
<ConfigProvider locale={locale}
|
|
|
|
disabledDate>
|
2021-05-13 13:50:25 +05:00
|
|
|
<RangePicker
|
|
|
|
showTime
|
2021-05-19 16:05:01 +05:00
|
|
|
disabledDate={disabledDate}
|
2021-05-13 13:50:25 +05:00
|
|
|
/>
|
|
|
|
</ConfigProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Выбор содержимого
|
|
|
|
const ContentSelection = () => {
|
|
|
|
function onChange(e) {
|
|
|
|
console.log(`checked = ${e.target.checked}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (<>
|
|
|
|
<Checkbox onChange={onChange}>Графики</Checkbox>
|
|
|
|
<Checkbox onChange={onChange}>Сообщения</Checkbox>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Выбор шага графика
|
|
|
|
const GraphicStep = () => {
|
|
|
|
function handleChange(value) {
|
|
|
|
console.log(`selected ${value}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-05-19 16:05:01 +05:00
|
|
|
<Select defaultValue="1 minute"
|
|
|
|
style={{ width: 100 }}
|
|
|
|
onChange={handleChange}>
|
2021-05-13 13:50:25 +05:00
|
|
|
<Option value="1 minute">1 минута</Option>
|
|
|
|
<Option value="1 day">1 день</Option>
|
|
|
|
<Option value="1 week">1 неделя</Option>
|
|
|
|
</Select>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Экспорт рендера
|
|
|
|
export default function Report(props) {
|
|
|
|
return (<>
|
2021-05-12 17:53:35 +05:00
|
|
|
<h2>Рапорт</h2>
|
2021-05-13 13:50:25 +05:00
|
|
|
<hr />
|
2021-05-12 17:53:35 +05:00
|
|
|
<h3>Выбор за период времени и расширение файла</h3>
|
|
|
|
<PeriodOfTime />
|
2021-05-13 13:50:25 +05:00
|
|
|
<h3>Шаг графиков</h3>
|
|
|
|
<GraphicStep />
|
2021-05-19 16:05:01 +05:00
|
|
|
<h3>Содержимое отчёта</h3>
|
|
|
|
<ContentSelection />
|
2021-05-13 13:50:25 +05:00
|
|
|
<div></div>
|
2021-05-19 16:05:01 +05:00
|
|
|
<ExceptionFileChecker />
|
2021-05-13 13:50:25 +05:00
|
|
|
<p>*Предполагаемое колличество страниц</p>
|
|
|
|
<hr />
|
|
|
|
<div>
|
2021-05-19 16:05:01 +05:00
|
|
|
<Button type="primary" style={{
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
padding: '20px',
|
|
|
|
borderRadius: '5px'
|
|
|
|
}}>Получить рапорт</Button>
|
2021-05-13 13:50:25 +05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO ограничить датапикер по дате за 3 дня до
|