forked from ddrilling/asb_cloud_front
Кнопка отправить заблокирована при отсутствии уставок
This commit is contained in:
parent
b94561aa62
commit
fcb264b122
@ -37,20 +37,19 @@ export const SetpointSender = memo(({ idWell, onClose, visible, setpointNames })
|
||||
|
||||
const onAdd = useCallback(async (sp) => setSetpoints((prevSp) => {
|
||||
sp.key = Date.now()
|
||||
prevSp.push(sp)
|
||||
return prevSp
|
||||
return [...prevSp, sp]
|
||||
}), [])
|
||||
|
||||
const onEdit = useCallback(async (sp) => setSetpoints((prevSp) => {
|
||||
const idx = prevSp.findIndex((val) => val.key === sp.key)
|
||||
prevSp[idx] = sp
|
||||
return prevSp
|
||||
return [...prevSp]
|
||||
}), [])
|
||||
|
||||
const onDelete = useCallback(async (sp) => setSetpoints((prevSp) => {
|
||||
const idx = prevSp.findIndex((val) => val.key === sp.key)
|
||||
prevSp.splice(idx, 1)
|
||||
return prevSp
|
||||
return [...prevSp]
|
||||
}), [])
|
||||
|
||||
const onModalOk = useCallback(() => invokeWebApiWrapperAsync(
|
||||
@ -81,6 +80,7 @@ export const SetpointSender = memo(({ idWell, onClose, visible, setpointNames })
|
||||
onCancel={onClose}
|
||||
onOk={onModalOk}
|
||||
okText={'Отправить'}
|
||||
okButtonProps={{ disabled: setpoints.length <= 0 }}
|
||||
>
|
||||
<LoaderPortal show={isLoading}>
|
||||
<Grid>
|
||||
|
Loading…
Reference in New Issue
Block a user