feature/2.9.42310.01-薪资项目拓扑图

去掉固定根节点
release/2.19.1.2503.01-业务线个税
黎永顺 1 year ago
parent f7cd8f8cbc
commit 81a30417a9

@ -48,18 +48,19 @@ const Index: React.FC = () => {
const dataSource: any = useMemo(() => {
return {
rootId: "0",
nodes: [{ id: "0", text: i18n["薪资项目"] }, ..._.map(extractTree(itemsTree), o => ({
// { id: "0", text: i18n["薪资项目"] },
nodes: [..._.map(extractTree(itemsTree), o => ({
id: o.salaryItemId,
text: o.salaryItemName, data: { ...o }
}))],
lines: _.map(extractTree(itemsTree), o => ({
from: o.parentId ? o.parentId : "0",
to: o.salaryItemId
}))
})).filter(g => g.from !== "0")
};
}, [itemsTree, i18n]);
useEffect(() => {
if (!_.isEmpty(dataSource.nodes) && !_.isEmpty(dataSource.lines)) {
if (!_.isEmpty(dataSource.nodes)) {
const init = showGraph();
}
}, [dataSource]);
@ -103,7 +104,7 @@ const Index: React.FC = () => {
const { formula: description } = formula;
notification.open({
message: i18n["公式"],
duration: null,
duration: 5,
description,
style: { maxWidth: 600 }
});

@ -57,7 +57,7 @@ const index: FunctionComponent<Props> = (props) => {
const { formula: description } = formula;
notification.open({
message: i18n["公式"],
duration: null,
duration: 5,
description,
style: { maxWidth: 600 }
});

Loading…
Cancel
Save