From 81a30417a93f53ab434e095c692333c97bd55483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 11 Jan 2024 15:49:55 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8B=93=E6=89=91=E5=9B=BE=20=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=9B=BA=E5=AE=9A=E6=A0=B9=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ledgerSalaryItemDiagram/index.tsx | 9 +++++---- src/pages/salaryItemDiagram/index.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/ledgerSalaryItemDiagram/index.tsx b/src/pages/ledgerSalaryItemDiagram/index.tsx index 38fe574..bf8afc7 100644 --- a/src/pages/ledgerSalaryItemDiagram/index.tsx +++ b/src/pages/ledgerSalaryItemDiagram/index.tsx @@ -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 } }); diff --git a/src/pages/salaryItemDiagram/index.tsx b/src/pages/salaryItemDiagram/index.tsx index 4b29c25..d43aed9 100644 --- a/src/pages/salaryItemDiagram/index.tsx +++ b/src/pages/salaryItemDiagram/index.tsx @@ -57,7 +57,7 @@ const index: FunctionComponent = (props) => { const { formula: description } = formula; notification.open({ message: i18n["公式"], - duration: null, + duration: 5, description, style: { maxWidth: 600 } });