forked from ddrilling/asb_cloud_front
fix webApiClient method name
This commit is contained in:
parent
3a15744a7a
commit
0a1af2c293
@ -1,13 +1,13 @@
|
|||||||
import {Table, Select, DatePicker, ConfigProvider, Input} from 'antd';
|
import {Table, Select, DatePicker, ConfigProvider, Input} from 'antd';
|
||||||
import {MessageService} from '../services/api'
|
|
||||||
import {useState, useEffect} from 'react'
|
|
||||||
import {useParams} from 'react-router-dom'
|
|
||||||
import LoaderPortal from '../components/LoaderPortal'
|
|
||||||
import '../styles/message.css'
|
|
||||||
import notify from '../components/notify'
|
|
||||||
import locale from "antd/lib/locale/ru_RU";
|
import locale from "antd/lib/locale/ru_RU";
|
||||||
|
import {useState, useEffect} from 'react'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
|
import {MessageService} from '../services/api'
|
||||||
|
import LoaderPortal from '../components/LoaderPortal'
|
||||||
|
import notify from '../components/notify'
|
||||||
|
import '../styles/message.css'
|
||||||
|
|
||||||
const {Option} = Select
|
const {Option} = Select
|
||||||
const pageSize = 26
|
const pageSize = 26
|
||||||
const {RangePicker} = DatePicker;
|
const {RangePicker} = DatePicker;
|
||||||
@ -54,8 +54,7 @@ const filterOptions = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
// Данные для таблицы
|
// Данные для таблицы
|
||||||
export default function Messages() {
|
export default function Messages({idWell}) {
|
||||||
let {id} = useParams()
|
|
||||||
const [messages, setMessages] = useState([])
|
const [messages, setMessages] = useState([])
|
||||||
const [pagination, setPagination] = useState(null)
|
const [pagination, setPagination] = useState(null)
|
||||||
const [page, setPage] = useState(1)
|
const [page, setPage] = useState(1)
|
||||||
@ -90,7 +89,7 @@ export default function Messages() {
|
|||||||
begin = range[0].toISOString()
|
begin = range[0].toISOString()
|
||||||
end = range[1].toISOString()
|
end = range[1].toISOString()
|
||||||
}
|
}
|
||||||
let paginatedMessages = await MessageService.getMessage(`${id}`,
|
let paginatedMessages = await MessageService.getMessages(idWell,
|
||||||
(page - 1) * pageSize,
|
(page - 1) * pageSize,
|
||||||
pageSize,
|
pageSize,
|
||||||
categories,
|
categories,
|
||||||
@ -98,7 +97,7 @@ export default function Messages() {
|
|||||||
end,
|
end,
|
||||||
searchString)
|
searchString)
|
||||||
if (paginatedMessages === null){
|
if (paginatedMessages === null){
|
||||||
notify(`Данных по скважине "${id}" нет`, 'warning')
|
notify(`Данных по скважине "${idWell}" нет`, 'warning')
|
||||||
setLoader(false)
|
setLoader(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -118,12 +117,12 @@ export default function Messages() {
|
|||||||
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.log(ex)
|
console.log(ex)
|
||||||
notify(`Не удалось загрузить сообщения по скважине "${id}"`, 'error')
|
notify(`Не удалось загрузить сообщения по скважине "${idWell}"`, 'error')
|
||||||
}
|
}
|
||||||
setLoader(false)
|
setLoader(false)
|
||||||
}
|
}
|
||||||
GetMessages()
|
GetMessages()
|
||||||
}, [id, page, categories, range, searchString])
|
}, [idWell, page, categories, range, searchString])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user