Commit 84dee46d by zhaochengxiang

bug fix

parent bc2e4988
......@@ -26,7 +26,7 @@ import AttributeMaintain from './AttributeMaintain';
import './AssetAction.less';
const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, reference, form, onMetadataChange, onElementsChange, readonly = false, permissionId } = props;
const { id, dirId, action, terms, onChange, reference, form, onMetadataChange, onElementsChange, readonly = false, permissionId, catalog } = props;
const [ currentAction, setCurrentAction ] = useState(action);
const [ assetParams, setAssetParams ] = useState({ assets: {}, attributes: [] });
......@@ -345,7 +345,7 @@ const AssetAction = (props) => {
dispatch({
type: 'assetmanage.getSystems',
payload: {
env: app?.env?.domainId||LocalStorage.get('assetsEnv'),
env: app?.env?.domainId||catalog||LocalStorage.get('assetsEnv'),
},
callback: data => {
setLoadingSystems(false);
......@@ -511,7 +511,7 @@ const AssetAction = (props) => {
payload: {
data: ids,
params: {
catalog: app?.env?.domainId||LocalStorage.get('assetsEnv'),
catalog: app?.env?.domainId||catalog||LocalStorage.get('assetsEnv'),
}
},
callback: data => {
......@@ -899,7 +899,7 @@ const AssetAction = (props) => {
const shareAsset = () => {
if ((assets?.dirIds??[]).length > 0) {
copy(`${window.location.origin}/center-home/asset-detail?id=${id}&dirId=${assets?.dirIds[0]}&isDraft=${reference===AssetDraftReference}`);
copy(`${window.location.origin}/center-home/asset-detail?id=${id}&dirId=${assets?.dirIds[0]}&isDraft=${reference===AssetDraftReference}&catalog=${app?.env?.domainId??''}`);
showMessage('success', '已复制到剪贴板');
}
}
......
......@@ -13,18 +13,19 @@ import { AssetBrowseReference, AssetDraftReference } from "../../../../util/cons
const AssetDetailPage = (props)=>{
const [ data, setData ] = useState({ id: '', dirId: '', isDraft: '' });
const [ data, setData ] = useState({ id: '', dirId: '', isDraft: '', catalog: '' });
const [loading, setLoading] = useState(false)
const [templateType, setTemplateType] = useState()
const { id, dirId, isDraft } = data;
const { id, dirId, isDraft, catalog } = data;
useEffect(() => {
const _id = getQueryParam('id', props.location.search);
const _dirId = getQueryParam('dirId', props.location.search);
const _isDraft = getQueryParam('isDraft', props.location.search);
const _id = getQueryParam('id', props.location?.search);
const _dirId = getQueryParam('dirId', props.location?.search);
const _isDraft = getQueryParam('isDraft', props.location?.search);
const _catalog = getQueryParam('catalog', props.location?.search);
setData({ id: _id, dirId: _dirId, isDraft: _isDraft });
setData({ id: _id, dirId: _dirId, isDraft: _isDraft, catalog: _catalog });
getDataAssetDetail()
//eslint-disable-next-line react-hooks/exhaustive-deps
......@@ -75,7 +76,7 @@ const AssetDetailPage = (props)=>{
<div className='detail-container'>
<div className='detail-container-card'>
{
templateType && <AssetAction id={id} dirId={dirId} reference={(isDraft==='true')?AssetDraftReference:AssetBrowseReference} action='detail' />
templateType && <AssetAction id={id} dirId={dirId} reference={(isDraft==='true')?AssetDraftReference:AssetBrowseReference} action='detail' catalog={catalog} />
}
</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