Списки мемоизированы, изменено название окон согласования/отклонения

This commit is contained in:
Александр Сироткин 2022-03-29 16:09:47 +05:00
parent 66ba02c14a
commit 0d6e46d91f

View File

@ -45,6 +45,8 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist
} = partData ?? {}
const uploadUrl = useMemo(() => `/api/well/${idWell}/drillingProgram/part/${idFileCategory}`, [idWell, idFileCategory])
const approvedMarks = useMemo(() => file?.fileMarks?.filter((mark) => mark.idMarkType === 1), [file])
const rejectMarks = useMemo(() => file?.fileMarks?.filter((mark) => mark.idMarkType === 0), [file])
const [isUploading, setIsUploading] = useState(false)
const [isDeleting, setIsDeleting] = useState(false)
@ -149,13 +151,13 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist
{permissionToApprove && (
<CommentPrompt isRequired={false} text={'Согласовать'} title={'Согласование документа'} onDone={onApprove(true)} />
)}
<MarksCard title={'Согласовано'} className={'approve_panel'} marks={file?.fileMarks?.filter((mark) => mark.idMarkType === 1)} />
<MarksCard title={'Список согласовавших'} className={'approve_panel'} marks={approvedMarks} />
</div>
<div className={'reject_list'}>
{permissionToApprove && (
<CommentPrompt text={'Отклонить'} title={'Отклонение документа'} onDone={onApprove(false)} />
)}
<MarksCard title={'Отклонено'} className={'reject_panel'} marks={file?.fileMarks?.filter((mark) => mark.idMarkType === 0)} />
<MarksCard title={'Список отклонивших'} className={'reject_panel'} marks={rejectMarks} />
</div>
</>
)}