Commit ace79f59 by zhaochengxiang

关联关系定位

parent 4738f2ed
...@@ -236,8 +236,6 @@ const AssetTable = (props) => { ...@@ -236,8 +236,6 @@ const AssetTable = (props) => {
dirId: remoteRelationRef.current?.dirId, dirId: remoteRelationRef.current?.dirId,
}, },
callback: data => { callback: data => {
remoteRelationRef.current = null;
const anchorLocation = data.offset; const anchorLocation = data.offset;
const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1)); const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1));
setPagination({ ...pagination, pageNum: _pageNum }); setPagination({ ...pagination, pageNum: _pageNum });
...@@ -436,7 +434,19 @@ const AssetTable = (props) => { ...@@ -436,7 +434,19 @@ const AssetTable = (props) => {
setAssets(_assets); setAssets(_assets);
if (reference === AssetManageReference) { if (reference === AssetManageReference) {
if ((selectItem?.id||'') !=='') { if (remoteRelationRef.current) {
const index = _assets.findIndex((asset) => asset.id === remoteRelationRef.current.dataAssetId);
remoteRelationRef.current = null;
if (index === -1) {
setSelectItem(_assets.length>0?_assets[0]:{});
onSelect && onSelect(_assets.length>0?_assets[0].id:'', _assets.length>0?_assets[0].dirId:'');
} else {
setSelectItem(_assets[index]);
onSelect && onSelect(_assets[index].id, _assets[index].dirId);
}
} else if ((selectItem?.id||'') !=='') {
const index = _assets.findIndex((asset) => asset.id === selectItem?.id); const index = _assets.findIndex((asset) => asset.id === selectItem?.id);
if (index === -1) { if (index === -1) {
......
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