forked from ddrilling/asb_cloud_front
комбинация map и flat заменена на flatMap
This commit is contained in:
parent
5eb66e5fbc
commit
0aeef42811
@ -10,7 +10,7 @@ export const View = memo(({ columns, item }) => !item || !columns?.length ? (
|
||||
<Empty key={'empty'} image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||
) : (
|
||||
<Grid>
|
||||
{columns.map((cols, i) => {
|
||||
{columns.flatMap((cols, i) => {
|
||||
const columnPosition = 1 + i * 2
|
||||
return cols.map((column, j) => (
|
||||
<Fragment key={column.key}>
|
||||
@ -46,6 +46,6 @@ export const View = memo(({ columns, item }) => !item || !columns?.length ? (
|
||||
</GridItem>
|
||||
</Fragment>
|
||||
))
|
||||
}).flat()}
|
||||
})}
|
||||
</Grid>
|
||||
))
|
||||
|
@ -33,7 +33,7 @@ export const calcFlowData = (dataSaub, flowChart) => {
|
||||
if (depth > maxDepth) maxDepth = depth
|
||||
return { date: new Date(row.date), depth: row.wellDepth }
|
||||
})
|
||||
const out = flowChart.map((flow) => {
|
||||
const out = flowChart.flatMap((flow) => {
|
||||
if (flow.depthStart > maxDepth || flow.depthEnd < minDepth) return []
|
||||
const out = []
|
||||
let i = 0, j = 0
|
||||
@ -50,7 +50,7 @@ export const calcFlowData = (dataSaub, flowChart) => {
|
||||
})
|
||||
}
|
||||
return out
|
||||
}).flat()
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ export const TLChart = memo(({
|
||||
invokeWebApiWrapperAsync(
|
||||
async () => {
|
||||
const { operations } = await DetectedOperationService.get(well.id)
|
||||
setData(operations.map((raw) => {
|
||||
setData(operations.flatMap((raw) => {
|
||||
const startTime = moment(raw.dateStart)
|
||||
const endTime = moment(raw.dateEnd)
|
||||
return splitByDate(startTime, endTime).map((dt) => ({
|
||||
@ -89,7 +89,7 @@ export const TLChart = memo(({
|
||||
startTime: dt.startTime,
|
||||
endTime: dt.endTime,
|
||||
}))
|
||||
}).flat())
|
||||
}))
|
||||
},
|
||||
setIsLoading,
|
||||
`Не удалось загрузить список операций`,
|
||||
|
Loading…
Reference in New Issue
Block a user