Commit 2acef775 by zhaochengxiang

去掉不用的代码

parent 3cae61f7
...@@ -8,7 +8,7 @@ import { dispatch } from '../../../model' ...@@ -8,7 +8,7 @@ import { dispatch } from '../../../model'
import Table from '../ResizeableTable' import Table from '../ResizeableTable'
import { isSzseEnv, showMessage } from "../../../util" import { isSzseEnv, showMessage } from "../../../util"
import { AssetItem } from "../AssetManage/Component/AssetTable" import { AssetItem } from "../AssetManage/Component/AssetTable"
import { recommandEnglishWords } from "../../../service/datamodeler" import UpdateAsset from "./update"
const isAdmin = false const isAdmin = false
const specialCol = ['数据关键用户', '业务数据owner', 'it责任人', '创建人', '更新人'] const specialCol = ['数据关键用户', '业务数据owner', 'it责任人', '创建人', '更新人']
...@@ -29,6 +29,11 @@ const FC = (props) => { ...@@ -29,6 +29,11 @@ const FC = (props) => {
const [data, setData] = React.useState() const [data, setData] = React.useState()
const [users, setUsers] = React.useState() const [users, setUsers] = React.useState()
const [row, setRow] = React.useState() const [row, setRow] = React.useState()
const [updateAssetParams, setUpdateAssetParams] = React.useState({
visible: false,
action: undefined,
item: undefined,
})
const [modal, contextHolder] = Modal.useModal(); const [modal, contextHolder] = Modal.useModal();
...@@ -284,7 +289,11 @@ const FC = (props) => { ...@@ -284,7 +289,11 @@ const FC = (props) => {
} }
const onEditClick = (record) => { const onEditClick = (record) => {
setUpdateAssetParams({
visible: true,
action: 'edit',
item: record
})
} }
const onDeleteClick = (record) => { const onDeleteClick = (record) => {
...@@ -378,6 +387,11 @@ const FC = (props) => { ...@@ -378,6 +387,11 @@ const FC = (props) => {
return { return {
onClick: (e) => { onClick: (e) => {
setRow(record) setRow(record)
setUpdateAssetParams({
visible: true,
action: 'detail',
item: record
})
} }
} }
}} }}
...@@ -404,6 +418,16 @@ const FC = (props) => { ...@@ -404,6 +418,16 @@ const FC = (props) => {
showTotal={total => ` ${total} `} showTotal={total => ` ${total} `}
/> />
</div> </div>
<UpdateAsset
{...updateAssetParams}
onCancel={() => {
setUpdateAssetParams({
visible: false,
action: undefined,
item: undefined,
})
}}
/>
{contextHolder} {contextHolder}
</div> </div>
) )
......
import React from "react"
import { Drawer } from "antd"
const FC = (props) => {
const { visible, item, action, onCancel } = props
return (
<Drawer
visible={visible}
title='资产目录详情'
width='80%'
placement="right"
closable
destroyOnClose
onClose={() => {
onCancel?.()
}}
>
<Basic action={action} item={item} />
</Drawer>
)
}
export default FC
const Basic = ({ action, item }) => {
return (
<div>
basic
</div>
)
}
\ No newline at end of file
...@@ -10,7 +10,6 @@ import { highlightSearchContentByTerms, showMessage, paginate } from '../../../. ...@@ -10,7 +10,6 @@ import { highlightSearchContentByTerms, showMessage, paginate } from '../../../.
import { AppContext, appId } from '../../../../App'; import { AppContext, appId } from '../../../../App';
import Tag from '../../Tag'; import Tag from '../../Tag';
import Separate from './Separate'; import Separate from './Separate';
import AssetTagModal from './AssetTagModal';
import { AnchorId, AnchorDirId, AssetManageReference, AssetRecycleReference } from '../../../../util/constant'; import { AnchorId, AnchorDirId, AssetManageReference, AssetRecycleReference } from '../../../../util/constant';
import IndexCode from './IndexCode'; import IndexCode from './IndexCode';
import Upload from './Upload'; import Upload from './Upload';
...@@ -38,7 +37,6 @@ const AssetAction = (props) => { ...@@ -38,7 +37,6 @@ const AssetAction = (props) => {
const [ confirmLoading, setConfirmLoading ] = useState(false); const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false); const [ fullScreen, setFullScreen ] = useState(false);
const [ assetPaths, setAssetPaths ] = useState([]); const [ assetPaths, setAssetPaths ] = useState([]);
const [ resourceRelations, setResourceRelations ] = useState([]);
const { assets, attributes, attributesFoldMap } = assetParams; const { assets, attributes, attributesFoldMap } = assetParams;
const [ assetTagModalVisible, setAssetTagModalVisible ] = useState(false); const [ assetTagModalVisible, setAssetTagModalVisible ] = useState(false);
const [ selectTag, setSelectTag ] = useState({}); const [ selectTag, setSelectTag ] = useState({});
...@@ -221,7 +219,6 @@ const AssetAction = (props) => { ...@@ -221,7 +219,6 @@ const AssetAction = (props) => {
if ((id||'')!=='') { if ((id||'')!=='') {
setPagination({...pagination, pageNum: 1}); setPagination({...pagination, pageNum: 1});
getAssetPaths(); getAssetPaths();
getResourceRelations();
checkDataAssetEditable(); checkDataAssetEditable();
getAsset(); getAsset();
...@@ -373,32 +370,6 @@ const AssetAction = (props) => { ...@@ -373,32 +370,6 @@ const AssetAction = (props) => {
}) })
} }
const getResourceRelations = () => {
dispatch({
type: 'assetmanage.getResourceRelations',
payload: {
dataAssetId: id,
},
callback: data => {
setResourceRelations(data||[]);
}
});
}
const getUserElements = () => {
setLoading(true);
dispatch({
type: 'assetmanage.listUserElements',
callback: data => {
setLoading(false);
getAsset(data||[]);
},
error: () => {
setLoading(false);
}
})
}
const checkDataAssetEditable = () => { const checkDataAssetEditable = () => {
dispatch({ dispatch({
type: 'assetmanage.checkDataAssetEditable', type: 'assetmanage.checkDataAssetEditable',
...@@ -413,7 +384,7 @@ const AssetAction = (props) => { ...@@ -413,7 +384,7 @@ const AssetAction = (props) => {
}) })
} }
const getAsset = (userElements=null) => { const getAsset = () => {
setLoading(true); setLoading(true);
dispatch({ dispatch({
type: 'assetmanage.getDataAssetDetail', type: 'assetmanage.getDataAssetDetail',
...@@ -438,17 +409,6 @@ const AssetAction = (props) => { ...@@ -438,17 +409,6 @@ const AssetAction = (props) => {
} }
} }
if (userElements) {
const userElementIds = [];
(userElements||[]).forEach(element => {
userElementIds.push(element?.id);
});
const filterElements = (data?.elements||[]).filter(element => userElementIds.indexOf(element?.id) !== -1);
data = { ...data, elements: filterElements };
}
setElements(data?.elements||[]); setElements(data?.elements||[]);
onElementsChange && onElementsChange(data?.elements||[]); onElementsChange && onElementsChange(data?.elements||[]);
...@@ -679,13 +639,6 @@ const AssetAction = (props) => { ...@@ -679,13 +639,6 @@ const AssetAction = (props) => {
} }
} }
// const onFoldButtonClick = (attribute, fold) => {
// let newAttributesFoldMap = {...attributesFoldMap};
// newAttributesFoldMap[attribute] = fold;
// setAssetParams({...assetParams, attributesFoldMap: newAttributesFoldMap});
// }
const onFullScreenClick = () => { const onFullScreenClick = () => {
setFullScreen(!fullScreen); setFullScreen(!fullScreen);
} }
...@@ -710,23 +663,6 @@ const AssetAction = (props) => { ...@@ -710,23 +663,6 @@ const AssetAction = (props) => {
}) })
} }
const onAssetTag = (value) => {
setSelectTag(value);
setAssetTagModalVisible(true);
}
const onAssetTagModalCancel = (refresh = false) => {
setAssetTagModalVisible(false);
if (refresh) {
getResourceRelations();
let event = new Event('storage');
event.key = 'tagChange';
window?.dispatchEvent(event);
}
}
// const formItemLayout = { // const formItemLayout = {
// labelCol: { // labelCol: {
// xs: { span: 24 }, // xs: { span: 24 },
...@@ -979,29 +915,6 @@ const AssetAction = (props) => { ...@@ -979,29 +915,6 @@ const AssetAction = (props) => {
} }
</div> </div>
</Descriptions.Item> </Descriptions.Item>
{/* <Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 90 }}>资产目录标签</div>} style={{ paddingBottom: 15 }}>
<AppContext.Consumer>
{
value => {
return (currentAction==='add'||currentAction==='edit')?<Tag styleType='complex' id={id} creator={value?.user?.userName||''} onAssetTag={onAssetTag} />:<Tag id={id} creator={value?.user?.userName||''} />
}
}
</AppContext.Consumer>
</Descriptions.Item> */}
{/* <Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 80 }}>关联关系</div>}
style={{ paddingBottom: 0 }}
>
<div className='flex' style={{ flexDirection: 'column' }}>
{
(resourceRelations||[]).map((item, key) => {
return (
<a key={key} onClick={() => { jumpToRelation(item); }}>{item?.dataAssetName||''}</a>
);
})
}
</div>
</Descriptions.Item> */}
</Descriptions> </Descriptions>
</div> </div>
</div> </div>
...@@ -1181,24 +1094,6 @@ const AssetAction = (props) => { ...@@ -1181,24 +1094,6 @@ const AssetAction = (props) => {
}, },
}} }}
/> />
{/* <Upload ref={uploadRef} accept={'.xls,.xlsx'} upload={(files) => {
dispatch({
type: 'assetmanage.importMetadataAttributes',
payload: {
fileList: [files[0]],
params: {
catalog: app?.env?.domainId||LocalStorage.get('assetsEnv'),
}
},
callback: (data) => {
getMetadataAttributes();
},
error: () => {
}
})
}} /> */}
<SelectStandard <SelectStandard
visible={selectStandardParam.visible} visible={selectStandardParam.visible}
...@@ -1212,21 +1107,6 @@ const AssetAction = (props) => { ...@@ -1212,21 +1107,6 @@ const AssetAction = (props) => {
onCancel={onAttributeMaintainCancel} onCancel={onAttributeMaintainCancel}
onChange={onAttributeMaintainChange} onChange={onAttributeMaintainChange}
/> />
<AppContext.Consumer>
{
value => {
return (
<AssetTagModal
visible={assetTagModalVisible}
id={id}
tag={selectTag}
creator={value?.user?.userName||''}
onCancel={onAssetTagModalCancel}
/>
);
}
}
</AppContext.Consumer>
{contextHolder} {contextHolder}
</div> </div>
) )
......
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