Commit e7d58cfe by zhaochengxiang

bug fix

parent 262546b7
...@@ -5,9 +5,17 @@ import AssetAction from './AssetAction'; ...@@ -5,9 +5,17 @@ import AssetAction from './AssetAction';
const AssetDetailDrawer = (props) => { const AssetDetailDrawer = (props) => {
const { onCancel, visible, id, dirId, reference, readonly = false } = props; const { onCancel, visible, id, dirId, reference, readonly = false } = props;
const [animated, setAnimated] = React.useState(true)
const [ form ] = Form.useForm(); const [ form ] = Form.useForm();
React.useEffect(() => {
if (visible) {
setTimeout(() => {
setAnimated(false)
}, 300)
}
}, [visible])
return ( return (
<Drawer <Drawer
visible={ visible } visible={ visible }
...@@ -17,11 +25,12 @@ const AssetDetailDrawer = (props) => { ...@@ -17,11 +25,12 @@ const AssetDetailDrawer = (props) => {
closable={ true } closable={ true }
destroyOnClose destroyOnClose
onClose={() => { onClose={() => {
setAnimated(true);
onCancel && onCancel(); onCancel && onCancel();
}} }}
> >
{ {
visible && <AssetAction reference={reference} form={form} id={id} dirId={dirId} action='detail' readonly={readonly} onChange={() => { visible && !animated && <AssetAction reference={reference} form={form} id={id} dirId={dirId} action='detail' readonly={readonly} onChange={() => {
onCancel?.(true); onCancel?.(true);
}} /> }} />
} }
......
...@@ -264,6 +264,7 @@ const FC = React.forwardRef(function ({ item, reference, action }, ref) { ...@@ -264,6 +264,7 @@ const FC = React.forwardRef(function ({ item, reference, action }, ref) {
</div> </div>
<div className='mt-3'> <div className='mt-3'>
<Table <Table
extraColWidth={32}
rowKey={activeKey==='asset'?'relatedAssetId':'relatedServiceId'} rowKey={activeKey==='asset'?'relatedAssetId':'relatedServiceId'}
loading={loadingAssets||loadingServices} loading={loadingAssets||loadingServices}
columns={activeKey==='asset'?assetCols:seriveCols} columns={activeKey==='asset'?assetCols:seriveCols}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment