forked from ddrilling/asb_cloud_front
fix Archive page
This commit is contained in:
parent
7435bb86b5
commit
ca9ffe3bd9
@ -5,7 +5,6 @@ import {
|
|||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
Tooltip} from 'antd'
|
Tooltip} from 'antd'
|
||||||
import { useParams } from 'react-router-dom'
|
|
||||||
import { DataService } from '../services/api'
|
import { DataService } from '../services/api'
|
||||||
import {generateUUID} from '../services/UidGenerator'
|
import {generateUUID} from '../services/UidGenerator'
|
||||||
import { ArchiveColumn } from '../components/ArchiveColumn'
|
import { ArchiveColumn } from '../components/ArchiveColumn'
|
||||||
@ -25,8 +24,7 @@ const LoadObject = (key) => {
|
|||||||
return json ? JSON.parse(json) : null
|
return json ? JSON.parse(json) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Archive() {
|
export default function Archive({idWell}) {
|
||||||
let { id } = useParams();
|
|
||||||
const [saubData, setSaubData] = useState([])
|
const [saubData, setSaubData] = useState([])
|
||||||
const [chartsCfgs, setChartsCfgs] = useState([])
|
const [chartsCfgs, setChartsCfgs] = useState([])
|
||||||
const [rangeDate, setRangeDate] = useState([moment().subtract(3,'hours'), moment()])
|
const [rangeDate, setRangeDate] = useState([moment().subtract(3,'hours'), moment()])
|
||||||
@ -96,14 +94,14 @@ export default function Archive() {
|
|||||||
let startDate = rangeDate[0].toISOString()
|
let startDate = rangeDate[0].toISOString()
|
||||||
|
|
||||||
setLoader(true)
|
setLoader(true)
|
||||||
DataService.getData(id, startDate, interval, 2048)
|
DataService.getData(idWell, startDate, interval, 2048)
|
||||||
.then(handleReceiveDataSaub)
|
.then(handleReceiveDataSaub)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
notify(`Не удалось загрузить данные по скважине (${id}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error')
|
notify(`Не удалось загрузить данные по скважине (${idWell}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error')
|
||||||
console.error(error)
|
console.error(error)
|
||||||
})
|
})
|
||||||
.finally(()=>setLoader(false))
|
.finally(()=>setLoader(false))
|
||||||
}, [id, rangeDate]);
|
}, [idWell, rangeDate]);
|
||||||
|
|
||||||
let charts = null
|
let charts = null
|
||||||
if(chartsCfgs.length > 0){
|
if(chartsCfgs.length > 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user