исправления из хотфикса мастера

This commit is contained in:
Александр Сироткин 2022-03-29 14:25:31 +05:00
parent de59cc65ce
commit 66ba02c14a
4 changed files with 12 additions and 9 deletions

View File

@ -39,11 +39,10 @@ export const WellCompositeSections = memo(({ idWell, statsWells, selectedSection
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
const [isParamsModalVisible, setIsParamsModalVisible] = useState(false)
const [paramsColumns, setParamsColumns] = useState([])
const location = useLocation()
const paramsColumns = useMemo(async() => await getColumns(idWell), [idWell])
const rows = useMemo(() => {
const rows = []
statsWells?.forEach((well) => {
@ -102,6 +101,10 @@ export const WellCompositeSections = memo(({ idWell, statsWells, selectedSection
return rows
}, [statsWells])
useEffect(() => invokeWebApiWrapperAsync(
async () => setParamsColumns(await getColumns(idWell))
), [idWell])
useEffect(() => {
if (isOpsModalVisible || selectedWellId <= 0) return
invokeWebApiWrapperAsync(
@ -252,7 +255,7 @@ export const WellCompositeSections = memo(({ idWell, statsWells, selectedSection
width={1500}
footer={null}
>
<Tvd idWell={selectedWellId}/>
<Tvd idWell={selectedWellId} style={{ height: '80vh' }} />
</Modal>
<Modal

View File

@ -93,7 +93,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) =>
const changeUserStatus = useCallback((user, status) => invokeWebApiWrapperAsync(
async () => {
const userIdx = users?.findIndex(({ user: u }) => u.id === user.id)
if (!userIdx) return
if (userIdx <= -1) return
if (status === 0) {
await DrillingProgramService.removeUser(idWell, user.id, category.idFileCategory, users[userIdx].status)
@ -102,7 +102,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) =>
}
setUsers((prevUsers) => {
prevUsers[userIdx].status = status
return prevUsers
return [...prevUsers]
})
},
setShowLoader,

View File

@ -114,7 +114,7 @@ const makeDataset = (data, label, color, borderWidth = 1.5, borderDash) => ({
borderDash,
})
export const Tvd = memo(({ idWell, title }) => {
export const Tvd = memo(({ idWell, title, ...other }) => {
const [chart, setChart] = useState()
const [xLabel, setXLabel] = useState('day')
const [operations, setOperations] = useState({})
@ -187,7 +187,7 @@ export const Tvd = memo(({ idWell, title }) => {
chart.canvas.parentNode.style.width = '0'
chart.resize()
}
}, [chart, operations, xLabel, onPointClick])
}, [chart, operations, xLabel, onPointClick, other])
const toogleTable = useCallback(() => {
setOperations(pre => ({ ...pre }))
@ -195,7 +195,7 @@ export const Tvd = memo(({ idWell, title }) => {
}, [])
return (
<div className={'container tvd-page'}>
<div className={'container tvd-page'} {...other}>
<div className={'tvd-top'}>
<h2>{title || 'График Глубина-день'}</h2>
<div>

View File

@ -25,7 +25,7 @@
> div {
position: absolute;
//pointer-events: none;
transition: all .25s ease-out;
transition: opacity .25s ease-out;
opacity: 1;
&:hover {