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

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") to: moment("9999-12-31T23:59:59.9999999")
} }
const timePeriodNames = { const timePeriodNames = [
600: '1 минута', {label: '1 секунда', value: 1},
86400:'1 день', {label: '10 секунд', value: 10},
604800:'1 неделя' {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 = { const imgPaths = {
'.pdf': '/images/pdf.png', '.pdf': '/images/pdf.png',
@ -42,7 +51,7 @@ const imgPaths = {
export default function Report(props) { export default function Report(props) {
const [rangeDate, setRangeDate] = useState([moment().subtract(1,'days'), moment()]) 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 [format, setFormat] = useState(0)
const [approxPages, setPagesCount] = useState(0) const [approxPages, setPagesCount] = useState(0)
const [suitableReports, setSuitableReports] = useState([]) const [suitableReports, setSuitableReports] = useState([])
@ -51,6 +60,8 @@ export default function Report(props) {
let wellId = useParams().id; let wellId = useParams().id;
const periods = timePeriodNames.map((line) => <Option key={line.value} value={line.value}>{line.label}</Option>)
const columns = [ const columns = [
{ {
title: '', title: '',
@ -247,12 +258,9 @@ export default function Report(props) {
initialValue={step} initialValue={step}
className="ml-30px" className="ml-30px"
> >
<Select <Select onChange={setStep}
onChange={(value) => setStep(value)}
> >
<Option value={600}>1 минута</Option> {periods}
<Option value={86400}>1 день</Option>
<Option value={604800}>1 неделя</Option>
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item