Commit 00ef24a3 by zhaochengxiang

重定向到资产问题

parent 65b166ad
...@@ -28,8 +28,6 @@ export default class App extends React.Component { ...@@ -28,8 +28,6 @@ export default class App extends React.Component {
id = params.id||''; id = params.id||'';
} }
console.log('params', params);
if (message === 'showDataModelDetail') { if (message === 'showDataModelDetail') {
return ( return (
<ImportModal <ImportModal
......
...@@ -43,14 +43,20 @@ const AssetTable = (props) => { ...@@ -43,14 +43,20 @@ const AssetTable = (props) => {
const timestamp = getQueryParam(AnchorTimestamp, props.location.search); const timestamp = getQueryParam(AnchorTimestamp, props.location.search);
const shouldScrollRef = useRef(false); const shouldScrollRef = useRef(false);
const urlChangeRef = useRef(false);
useEffect(() => { useEffect(() => {
if ((nodeId||'') !== '' ) { if ((nodeId||'') !== '' ) {
if (shouldScrollRef.current === true) { if (shouldScrollRef.current === true) {
urlChangeRef.current = false;
getDataAssetLocation(); getDataAssetLocation();
} else if (urlChangeRef.current) {
urlChangeRef.current = false;
} else { } else {
setPagination({ ...pagination, pageNum: 1 }); setPagination({ ...pagination, pageNum: 1 });
...@@ -68,6 +74,7 @@ const AssetTable = (props) => { ...@@ -68,6 +74,7 @@ const AssetTable = (props) => {
if ((anchorId||'') !== '') { if ((anchorId||'') !== '') {
shouldScrollRef.current = true; shouldScrollRef.current = true;
urlChangeRef.current = true;
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
...@@ -88,9 +95,8 @@ const AssetTable = (props) => { ...@@ -88,9 +95,8 @@ const AssetTable = (props) => {
if (shouldScrollRef.current) { if (shouldScrollRef.current) {
SmoothScroll('a[href*="#"]'); SmoothScroll('a[href*="#"]');
const _id = getQueryParam(AnchorId, props.location.search);
var scroll = new SmoothScroll(); var scroll = new SmoothScroll();
var anchor = document.querySelector(`#data-asset-${_id}`); var anchor = document.querySelector(`#data-asset-${anchorId}`);
if (anchor) { if (anchor) {
shouldScrollRef.current = false; shouldScrollRef.current = false;
......
...@@ -114,8 +114,7 @@ const ImportAction = (props) => { ...@@ -114,8 +114,7 @@ const ImportAction = (props) => {
setTemplate(data.easyDataModelerModelingTemplate||{}); setTemplate(data.easyDataModelerModelingTemplate||{});
onChange && onChange(data||{}); onChange && onChange(data||{});
getSupportedDatatypes(); getSupportedDatatypes();
validateDataModel(data||{});
if (action === 'edit') { if (action === 'edit') {
form.setFieldsValue({ form.setFieldsValue({
cnName: data.cnName||'', cnName: data.cnName||'',
...@@ -124,6 +123,8 @@ const ImportAction = (props) => { ...@@ -124,6 +123,8 @@ const ImportAction = (props) => {
easyDataModelerModelingTemplate: data.easyDataModelerModelingTemplate||'' easyDataModelerModelingTemplate: data.easyDataModelerModelingTemplate||''
}); });
} }
validateDataModel(data||{});
}, },
error: () => { error: () => {
setLoading(false); setLoading(false);
......
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