From c4069314007a3fc2e9df208034732a0d4b66281b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 15 May 2024 11:16:42 +0800 Subject: [PATCH] master --- src/pages/salaryFileTable/index.tsx | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/pages/salaryFileTable/index.tsx b/src/pages/salaryFileTable/index.tsx index 30dd86c..7508dd7 100644 --- a/src/pages/salaryFileTable/index.tsx +++ b/src/pages/salaryFileTable/index.tsx @@ -26,6 +26,7 @@ const Index: FunctionComponent = (props) => { const [runStatuses, setRunStatuses] = useState(""); const [showOperateBtn, setShowOperateBtn] = useState(false); const [showDelSalaryFileBtn, setShowDelSalaryFileBtn] = useState(false);//待定薪、停薪员工 是否允许删除薪资档案 + const [DCChiefPermission, setDCChiefPermission] = useState(undefined);//二开权限(大成) useEffect(() => { window.parent.postMessage({ type: "init" }, "*"); @@ -40,7 +41,7 @@ const Index: FunctionComponent = (props) => { if (!_.isEmpty(data)) { const { columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, - selectedKey, showOperateBtn, showDelSalaryFileBtn + selectedKey, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission } = data; setShowOperateBtn(showOperateBtn); setRunStatuses(selectedKey); @@ -50,6 +51,7 @@ const Index: FunctionComponent = (props) => { setSelectedRowKeys(selectedRowKeys); setColumns(columns); setShowDelSalaryFileBtn(showDelSalaryFileBtn); + setDCChiefPermission(DCChiefPermission); } }; const onChange = (current: number, pageSize: number) => { @@ -115,7 +117,12 @@ const Index: FunctionComponent = (props) => { ]; !showDelSalaryFileBtn && (items = _.dropRight(items)); return ( - + { + _.isNil(DCChiefPermission) ? + : + + } @@ -139,8 +146,13 @@ const Index: FunctionComponent = (props) => { ]; return ( - + { + ((_.isNil(DCChiefPermission) && runStatuses === "fixed") || runStatuses === "ext") ? + : + + } + { + (DCChiefPermission && (runStatuses === "pending" || runStatuses === "fixed")) ? + : + + } ) @@ -223,7 +240,7 @@ const Index: FunctionComponent = (props) => { } else { return []; } - }, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn]); + }, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission]); return (