|
|
|
@ -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 }
|
|
|
|
|
});
|
|
|
|
|