Commit acd0736c by zhaochengxiang

资产详情去掉关联标准

parent 3bedb9f0
......@@ -57,7 +57,6 @@ const AssetAction = (props) => {
const [loadingMetadataColumnList, setLoadingMetadataColumnList] = useState(false);
const [metadataColumnList, setMetadataColumnList] = useState(undefined);
const [selectStandardParam, setSelectStandardParam] = useState({ visible: false, id: undefined });
const [standardList, setStandardList] = useState(undefined);
const [attributeMaintainParam, setAttributeMaintainParam] = useState({
visible: false,
metadataId: undefined
......@@ -142,69 +141,25 @@ const AssetAction = (props) => {
width: 60,
ellipsis: true,
},
{
title: '引用标准',
dataIndex: 'standard',
ellipsis: true,
render: (_, record) => {
return <AppContext.Consumer>
{
appValue => <a onClick={() => {
appValue?.setGlobalState && appValue?.setGlobalState({
message: 'data-govern-show-index-detail-message',
data: { id: record.standard?.standardId }
})
}}>
<span>{record.standard?.standardName}</span>
</a>
}
</AppContext.Consumer>
}
},
{
title: '操作',
dataIndex: 'action',
width: 170,
fixed: 'right',
render: (_, record) => {
return (reference===AssetManageReference||canEdit) ? <Space>
<Button
size='small'
onClick={() => {
setSelectStandardParam({ visible: true, id: record._id });
}}
>
关联标准
</Button>
{
record.standard?.standardId && <Button
size='small'
onClick={() => {
modal.confirm({
title: '您确定要取消关联标准吗?',
onOk: () => {
dispatch({
type: 'assetmanage.deleteStandardBatchMetadata',
payload: {
params: {
ids: record.standard?.id
}
},
callback: () => {
showMessage("success","取消成功");
getMetadataStandardList();
}
})
}
})
}}
>
取消关联
</Button>
}
</Space>: null;
}
}
// {
// title: '引用标准',
// dataIndex: 'standard',
// ellipsis: true,
// render: (_, record) => {
// return <AppContext.Consumer>
// {
// appValue => <a onClick={() => {
// appValue?.setGlobalState && appValue?.setGlobalState({
// message: 'data-govern-show-index-detail-message',
// data: { id: record.standard?.standardId }
// })
// }}>
// <span>{record.standard?.standardName}</span>
// </a>
// }
// </AppContext.Consumer>
// }
// },
];
useEffect(() => {
......@@ -262,7 +217,7 @@ const AssetAction = (props) => {
}, [currentDomainGroup, currentBussinessDomain, treeDataMap])
const tableData = useMemo(() => {
if (metadataColumnList && standardList) {
if (metadataColumnList) {
const newMetadataColumnList = [];
metadataColumnList.filter(item => {
......@@ -272,21 +227,13 @@ const AssetAction = (props) => {
|| (item.cnName??'').indexOf(keyword)!==-1
|| (item.businessRules??'').indexOf(keyword)!==-1
)
}).forEach(item => {
const index = standardList?.findIndex(_item => _item.metadataId === item._id);
let newItem = {...item};
if (index !== -1) {
newItem.standard = standardList[index];
}
newMetadataColumnList.push(newItem);
});
})
return paginate(newMetadataColumnList, pageNum, pageSize);
}
return [];
}, [metadataColumnList, standardList, pagination, keyword])
}, [metadataColumnList, pagination, keyword])
const getPermission = () => {
dispatch({
......@@ -446,7 +393,6 @@ const AssetAction = (props) => {
try {
setMetadata(JSON.parse(metadataValue));
getMetadataAttributes();
getMetadataStandardList();
} catch(error) {
}
......@@ -543,30 +489,6 @@ const AssetAction = (props) => {
})
}
const getMetadataStandardList = () => {
setMetadata(prevMetadata => {
if (prevMetadata.metadataTableId) {
dispatch({
type: 'assetmanage.getMetadataStandardList',
payload: {
data: {
parentMetadataId: prevMetadata.metadataTableId
},
params: {
page: 1,
size: 999999
}
},
callback: data => {
setStandardList(data?.content);
},
});
}
return prevMetadata;
})
}
const onCancelButtonClick = () => {
setCurrentAction('detail');
getAsset();
......@@ -883,23 +805,18 @@ const AssetAction = (props) => {
})
}
const onSelectStandardCancel = (refresh = false) => {
setSelectStandardParam({ visible: false, id: undefined });
refresh && getMetadataStandardList();
}
const onAttributeMaintainCancel = () => {
setAttributeMaintainParam({visible: false, metadataId: undefined});
}
// const onAttributeMaintainCancel = () => {
// setAttributeMaintainParam({visible: false, metadataId: undefined});
// }
const onAttributeMaintainChange = (catalogId) => {
if (catalogId === '1') {
setPagination({...pagination, pageNum: 1});
getMetadataAttributes();
} else {
getMetadataStandardList();
}
}
// const onAttributeMaintainChange = (catalogId) => {
// if (catalogId === '1') {
// setPagination({...pagination, pageNum: 1});
// getMetadataAttributes();
// } else {
// getMetadataStandardList();
// }
// }
const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('主题域分组')) {
......@@ -1094,7 +1011,7 @@ const AssetAction = (props) => {
</div>
<Space style={{ marginLeft: 'auto' }}>
{
{/* {
(reference===AssetManageReference||canEdit) && <Button
type='primary'
onClick={() => {
......@@ -1110,7 +1027,7 @@ const AssetAction = (props) => {
>
字段级维护
</Button>
}
} */}
{/* <Dropdown overlay={
<Menu onClick={({ key })=>{
if (key === 'lineage') {
......@@ -1204,19 +1121,13 @@ const AssetAction = (props) => {
}
})
}} /> */}
<SelectStandard
visible={selectStandardParam.visible}
id={selectStandardParam.id}
onCancel={onSelectStandardCancel}
/>
<AttributeMaintain
{/* <AttributeMaintain
visible={attributeMaintainParam.visible}
metadataId={attributeMaintainParam.metadataId}
onCancel={onAttributeMaintainCancel}
onChange={onAttributeMaintainChange}
/>
/> */}
<AppContext.Consumer>
{
value => {
......
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