forked from ddrilling/asb_cloud_front
Исправления по стилю кода
This commit is contained in:
parent
d36cd1acbd
commit
8825c4c26c
@ -17,10 +17,9 @@ import { invokeWebApiWrapperAsync, download } from '@components/factory'
|
|||||||
import { ProcessMapService, WellOperationService } from '@api'
|
import { ProcessMapService, WellOperationService } from '@api'
|
||||||
import { arrayOrDefault } from '@utils'
|
import { arrayOrDefault } from '@utils'
|
||||||
|
|
||||||
|
|
||||||
const ImportExportBar = memo(({ well: givenWell, disabled }) => {
|
|
||||||
const style = { margin: 4 }
|
const style = { margin: 4 }
|
||||||
|
|
||||||
|
const ImportExportBar = memo(({ well: givenWell, disabled }) => {
|
||||||
const [wellContext] = useWell()
|
const [wellContext] = useWell()
|
||||||
const well = useMemo(() => givenWell ?? wellContext, [givenWell, wellContext])
|
const well = useMemo(() => givenWell ?? wellContext, [givenWell, wellContext])
|
||||||
|
|
||||||
@ -73,19 +72,15 @@ export const DrillProcessFlow = memo(() => {
|
|||||||
const [well] = useWell()
|
const [well] = useWell()
|
||||||
const setTopRightBlock = useTopRightBlock()
|
const setTopRightBlock = useTopRightBlock()
|
||||||
|
|
||||||
const updateFlows = useCallback(
|
const updateFlows = useCallback(() => invokeWebApiWrapperAsync(
|
||||||
() =>
|
|
||||||
invokeWebApiWrapperAsync(
|
|
||||||
async () => {
|
async () => {
|
||||||
const flows = await ProcessMapService.getByIdWell(well.id)
|
const flows = await ProcessMapService.getByIdWell(well.id)
|
||||||
setFlows(arrayOrDefault(flows))
|
setFlows(arrayOrDefault(flows))
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowLoader,
|
||||||
`Не удалось загрузить режимно-технологическую карту`,
|
`Не удалось загрузить режимно-технологическую карту`,
|
||||||
{ actionName: 'Получение режимно-технологической карты', well }
|
{ actionName: 'Получение режимно-технологической карты', well },
|
||||||
),
|
), [well])
|
||||||
[well]
|
|
||||||
)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
@ -95,7 +90,7 @@ export const DrillProcessFlow = memo(() => {
|
|||||||
},
|
},
|
||||||
setShowLoader,
|
setShowLoader,
|
||||||
`Не удалось загрузить список конструкций секций`,
|
`Не удалось загрузить список конструкций секций`,
|
||||||
{ actionName: 'Получение списка конструкций секций', well }
|
{ actionName: 'Получение списка конструкций секций', well },
|
||||||
)
|
)
|
||||||
}, [well])
|
}, [well])
|
||||||
|
|
||||||
@ -103,7 +98,9 @@ export const DrillProcessFlow = memo(() => {
|
|||||||
updateFlows()
|
updateFlows()
|
||||||
}, [well])
|
}, [well])
|
||||||
|
|
||||||
useEffect(() => setTopRightBlock((well) => <ImportExportBar well={well} />), [setTopRightBlock])
|
useEffect(() => setTopRightBlock((well) => (
|
||||||
|
<ImportExportBar well={well} />
|
||||||
|
)), [setTopRightBlock])
|
||||||
|
|
||||||
const tableHandlers = useMemo(() => {
|
const tableHandlers = useMemo(() => {
|
||||||
const handlerProps = {
|
const handlerProps = {
|
||||||
|
Loading…
Reference in New Issue
Block a user