Commit 84dee46d by zhaochengxiang

bug fix

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