изменены шаги графиков по времени для рапортов

This commit is contained in:
Alexey 2021-06-28 09:42:35 +05:00
parent a096f1c038
commit e29764576c

View File

@ -26,11 +26,20 @@ let reportDatesRange = {
to: moment("9999-12-31T23:59:59.9999999")
}
const timePeriodNames = {
600: '1 минута',
86400:'1 день',
604800:'1 неделя'
}
const timePeriodNames = [
{label: '1 секунда', value: 1},
{label: '10 секунд', value: 10},
{label: '1 минута', value: 60},
{label: '5 минут', value: 300},
{label: '30 минут', value: 1800},
{label: '1 час', value: 3600},
{label: '6 часов', value: 21600},
{label: '12 часов', value: 43200},
{label: '1 день', value: 86400},
{label: '1 неделя', value: 604800}
]
const firstStep = timePeriodNames[2]["value"]
const imgPaths = {
'.pdf': '/images/pdf.png',
@ -42,7 +51,7 @@ const imgPaths = {
export default function Report(props) {
const [rangeDate, setRangeDate] = useState([moment().subtract(1,'days'), moment()])
const [step, setStep] = useState(600)
const [step, setStep] = useState(firstStep)
const [format, setFormat] = useState(0)
const [approxPages, setPagesCount] = useState(0)
const [suitableReports, setSuitableReports] = useState([])
@ -51,6 +60,8 @@ export default function Report(props) {
let wellId = useParams().id;
const periods = timePeriodNames.map((line) => <Option key={line.value} value={line.value}>{line.label}</Option>)
const columns = [
{
title: '',
@ -244,15 +255,12 @@ export default function Report(props) {
<Form.Item
label="Шаг графиков"
name="step"
initialValue = {step}
initialValue={step}
className="ml-30px"
>
<Select
onChange={(value) => setStep(value)}
<Select onChange={setStep}
>
<Option value={600}>1 минута</Option>
<Option value={86400}>1 день</Option>
<Option value={604800}>1 неделя</Option>
{periods}
</Select>
</Form.Item>
<Form.Item