forked from ddrilling/asb_cloud_front
Исправлена ошибка отображения при отсутствии данных на странице операций
This commit is contained in:
parent
765e2e820e
commit
ba843f0fde
@ -69,9 +69,17 @@ const Operations = memo(() => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
const categories = arrayOrDefault(await DetectedOperationService.getCategories(idWell))
|
const categories = arrayOrDefault(await DetectedOperationService.getCategories())
|
||||||
setCategories(categories.map(({ id, name }) => ({ value: id, label: name })))
|
setCategories(categories.map(({ id, name }) => ({ value: id, label: name })))
|
||||||
|
},
|
||||||
|
setIsLoading,
|
||||||
|
'Не удалось загрзуить категории операций'
|
||||||
|
)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
const dates = await TelemetryDataSaubService.getDataDatesRange(idWell)
|
const dates = await TelemetryDataSaubService.getDataDatesRange(idWell)
|
||||||
if (dates) {
|
if (dates) {
|
||||||
const dt = [moment(dates.from), moment(dates.to)]
|
const dt = [moment(dates.from), moment(dates.to)]
|
||||||
@ -131,11 +139,11 @@ const Operations = memo(() => {
|
|||||||
<div className={'page-main'}>
|
<div className={'page-main'}>
|
||||||
<OperationsChart
|
<OperationsChart
|
||||||
category={categories?.[selectedCategory]}
|
category={categories?.[selectedCategory]}
|
||||||
data={data.operations}
|
data={data?.operations}
|
||||||
height={'50vh'}
|
height={'50vh'}
|
||||||
yDomain={yDomain}
|
yDomain={yDomain}
|
||||||
/>
|
/>
|
||||||
<OperationsTable data={data.stats} height={'20vh'} />
|
<OperationsTable data={data?.stats} height={'20vh'} />
|
||||||
</div>
|
</div>
|
||||||
</LoaderPortal>
|
</LoaderPortal>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user