Commit dce4bc47 by zhaochengxiang

优化关系图

parent a06a1b59
...@@ -260,7 +260,7 @@ class Org extends React.Component { ...@@ -260,7 +260,7 @@ class Org extends React.Component {
if (!children && loadMoreData) { if (!children && loadMoreData) {
loadMoreData(model.dirId||'', nodeId); loadMoreData(model.dirId||'', nodeId);
} }
} else { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId // model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
......
...@@ -155,17 +155,11 @@ class Relation extends React.Component { ...@@ -155,17 +155,11 @@ class Relation extends React.Component {
], ],
}, },
layout: { layout: {
type: 'compactBox', type: 'dendrogram',
direction: 'RL', direction: 'RL',
getId: function getId(d) { getId: function getId(d) {
return d.id; return d.id;
}, },
getHeight: () => {
return 26;
},
getWidth: () => {
return 26;
},
getVGap: () => { getVGap: () => {
return 20; return 20;
}, },
...@@ -185,13 +179,6 @@ class Relation extends React.Component { ...@@ -185,13 +179,6 @@ class Relation extends React.Component {
type: 'cubic-horizontal', type: 'cubic-horizontal',
size: 2, size: 2,
color: '#e2e2e2', color: '#e2e2e2',
// style: {
// endArrow: {
// path: 'M 0,0 L 12, 6 L 9,0 L 12, -6 Z',
// fill: '#91d5ff',
// d: -40,
// },
// }
}, },
}); });
...@@ -230,12 +217,13 @@ class Relation extends React.Component { ...@@ -230,12 +217,13 @@ class Relation extends React.Component {
const nodeId = node.get('id'); const nodeId = node.get('id');
const model = node.getModel(); const model = node.getModel();
console.log('model', model);
if (model.dbType==='Dir') { if (model.dbType==='Dir') {
const children = model.children; const children = model.children;
if (!children && loadMoreData) { if (!children && loadMoreData) {
loadMoreData(model.dirId||'', nodeId); loadMoreData(model.dirId||'', nodeId);
} }
} else { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId // model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
......
...@@ -221,7 +221,7 @@ class Tree extends React.Component { ...@@ -221,7 +221,7 @@ class Tree extends React.Component {
if (!children && loadMoreData) { if (!children && loadMoreData) {
loadMoreData(model.dirId||'', nodeId); loadMoreData(model.dirId||'', nodeId);
} }
} else { } else if (model.dbType !== 'Root') {
//通过资产id跳转到资产详情页 //通过资产id跳转到资产详情页
// model.tableModelId // model.tableModelId
// history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
......
...@@ -79,7 +79,7 @@ class MapContent extends React.Component { ...@@ -79,7 +79,7 @@ class MapContent extends React.Component {
return { return {
text: topic.name||'', text: topic.name||'',
id: `t${topic.id}`, id: `t${topic.id}`,
dbType: 'Dir', dbType: 'Root',
children: data children: 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