Commit bde8c08a by zhaochengxiang

解决资产id重复的问题

parent 87a376ba
...@@ -262,7 +262,6 @@ class Org extends React.Component { ...@@ -262,7 +262,6 @@ class Org extends React.Component {
} }
} else if (model.dbType !== 'Root') { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
} }
......
...@@ -261,7 +261,6 @@ class Relation extends React.Component { ...@@ -261,7 +261,6 @@ class Relation extends React.Component {
} }
} else if (model.dbType !== 'Root') { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
} }
......
...@@ -223,7 +223,6 @@ class Tree extends React.Component { ...@@ -223,7 +223,6 @@ class Tree extends React.Component {
} }
} else if (model.dbType !== 'Root') { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
} }
......
...@@ -91,7 +91,7 @@ class MapContent extends React.Component { ...@@ -91,7 +91,7 @@ class MapContent extends React.Component {
}) })
} }
convertRemoteData = (data) => { convertRemoteData = (data, parentDirId='') => {
data.forEach((item, index) => { data.forEach((item, index) => {
if (item.dbType==='Dir') { if (item.dbType==='Dir') {
item.text = item.dirName||''; item.text = item.dirName||'';
...@@ -106,11 +106,11 @@ class MapContent extends React.Component { ...@@ -106,11 +106,11 @@ class MapContent extends React.Component {
}) })
item.text = assetCnName||''; item.text = assetCnName||'';
item.id = `t${item.id||''}`; item.id = `t${parentDirId}${item.id||''}`;
} }
if (item.children) { if (item.children) {
this.convertRemoteData(item.children); this.convertRemoteData(item.children, item.dirId||'');
} }
}) })
} }
...@@ -142,7 +142,7 @@ class MapContent extends React.Component { ...@@ -142,7 +142,7 @@ class MapContent extends React.Component {
payload: { dirId: item.dirId }, payload: { dirId: item.dirId },
callback: data => { callback: data => {
this.convertRemoteData(data||[]); this.convertRemoteData(data||[], item.dirId);
item.children = (data||[]); item.children = (data||[]);
this.setSquareGraphState(item); this.setSquareGraphState(item);
} }
...@@ -167,7 +167,7 @@ class MapContent extends React.Component { ...@@ -167,7 +167,7 @@ class MapContent extends React.Component {
type: 'map.getTableModelByDirIid', type: 'map.getTableModelByDirIid',
payload: { dirId }, payload: { dirId },
callback: data => { callback: data => {
this.convertRemoteData(data||[]); this.convertRemoteData(data||[], dirId);
this.setState({ this.setState({
parentNodeId: nodeId, parentNodeId: nodeId,
orgChildData: JSON.parse(JSON.stringify(data||[])), orgChildData: JSON.parse(JSON.stringify(data||[])),
......
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