Commit 2acef775 by zhaochengxiang

去掉不用的代码

parent 3cae61f7
......@@ -8,7 +8,7 @@ import { dispatch } from '../../../model'
import Table from '../ResizeableTable'
import { isSzseEnv, showMessage } from "../../../util"
import { AssetItem } from "../AssetManage/Component/AssetTable"
import { recommandEnglishWords } from "../../../service/datamodeler"
import UpdateAsset from "./update"
const isAdmin = false
const specialCol = ['数据关键用户', '业务数据owner', 'it责任人', '创建人', '更新人']
......@@ -29,6 +29,11 @@ const FC = (props) => {
const [data, setData] = React.useState()
const [users, setUsers] = React.useState()
const [row, setRow] = React.useState()
const [updateAssetParams, setUpdateAssetParams] = React.useState({
visible: false,
action: undefined,
item: undefined,
})
const [modal, contextHolder] = Modal.useModal();
......@@ -284,7 +289,11 @@ const FC = (props) => {
}
const onEditClick = (record) => {
setUpdateAssetParams({
visible: true,
action: 'edit',
item: record
})
}
const onDeleteClick = (record) => {
......@@ -378,6 +387,11 @@ const FC = (props) => {
return {
onClick: (e) => {
setRow(record)
setUpdateAssetParams({
visible: true,
action: 'detail',
item: record
})
}
}
}}
......@@ -404,6 +418,16 @@ const FC = (props) => {
showTotal={total => ` ${total} `}
/>
</div>
<UpdateAsset
{...updateAssetParams}
onCancel={() => {
setUpdateAssetParams({
visible: false,
action: undefined,
item: undefined,
})
}}
/>
{contextHolder}
</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 '../../../.
import { AppContext, appId } from '../../../../App';
import Tag from '../../Tag';
import Separate from './Separate';
import AssetTagModal from './AssetTagModal';
import { AnchorId, AnchorDirId, AssetManageReference, AssetRecycleReference } from '../../../../util/constant';
import IndexCode from './IndexCode';
import Upload from './Upload';
......@@ -38,7 +37,6 @@ const AssetAction = (props) => {
const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false);
const [ assetPaths, setAssetPaths ] = useState([]);
const [ resourceRelations, setResourceRelations ] = useState([]);
const { assets, attributes, attributesFoldMap } = assetParams;
const [ assetTagModalVisible, setAssetTagModalVisible ] = useState(false);
const [ selectTag, setSelectTag ] = useState({});
......@@ -221,7 +219,6 @@ const AssetAction = (props) => {
if ((id||'')!=='') {
setPagination({...pagination, pageNum: 1});
getAssetPaths();
getResourceRelations();
checkDataAssetEditable();
getAsset();
......@@ -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 = () => {
dispatch({
type: 'assetmanage.checkDataAssetEditable',
......@@ -413,7 +384,7 @@ const AssetAction = (props) => {
})
}
const getAsset = (userElements=null) => {
const getAsset = () => {
setLoading(true);
dispatch({
type: 'assetmanage.getDataAssetDetail',
......@@ -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||[]);
onElementsChange && onElementsChange(data?.elements||[]);
......@@ -679,13 +639,6 @@ const AssetAction = (props) => {
}
}
// const onFoldButtonClick = (attribute, fold) => {
// let newAttributesFoldMap = {...attributesFoldMap};
// newAttributesFoldMap[attribute] = fold;
// setAssetParams({...assetParams, attributesFoldMap: newAttributesFoldMap});
// }
const onFullScreenClick = () => {
setFullScreen(!fullScreen);
}
......@@ -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 = {
// labelCol: {
// xs: { span: 24 },
......@@ -979,29 +915,6 @@ const AssetAction = (props) => {
}
</div>
</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>
</div>
</div>
......@@ -1182,24 +1095,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
visible={selectStandardParam.visible}
id={selectStandardParam.id}
......@@ -1212,21 +1107,6 @@ const AssetAction = (props) => {
onCancel={onAttributeMaintainCancel}
onChange={onAttributeMaintainChange}
/>
<AppContext.Consumer>
{
value => {
return (
<AssetTagModal
visible={assetTagModalVisible}
id={id}
tag={selectTag}
creator={value?.user?.userName||''}
onCancel={onAssetTagModalCancel}
/>
);
}
}
</AppContext.Consumer>
{contextHolder}
</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