From 793d7acefb8b690a05a753e43fe9e6a4736f4a50 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, 11 Sep 2024 10:10:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/salaryFileTable/index.tsx | 144 ++++++++++++++-------------- 1 file changed, 74 insertions(+), 70 deletions(-) diff --git a/src/pages/salaryFileTable/index.tsx b/src/pages/salaryFileTable/index.tsx index 6185926..bf2f81e 100644 --- a/src/pages/salaryFileTable/index.tsx +++ b/src/pages/salaryFileTable/index.tsx @@ -24,9 +24,7 @@ const Index: FunctionComponent = (props) => { const [pageInfo, setPageInfo] = useState>({}); const [i18n, setI18n] = useState({}); 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,10 +38,8 @@ const Index: FunctionComponent = (props) => { const data: any = exceptStr(event.data); if (!_.isEmpty(data)) { const { - columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, - selectedKey, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission + columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, selectedKey, showDelSalaryFileBtn } = data; - setShowOperateBtn(showOperateBtn); setRunStatuses(selectedKey); setI18n(i18nRes); setPageInfo(pageInfo); @@ -51,7 +47,6 @@ const Index: FunctionComponent = (props) => { setSelectedRowKeys(selectedRowKeys); setColumns(columns); setShowDelSalaryFileBtn(showDelSalaryFileBtn); - setDCChiefPermission(DCChiefPermission); } }; const onChange = (current: number, pageSize: number) => { @@ -116,19 +111,22 @@ const Index: FunctionComponent = (props) => { } ]; !showDelSalaryFileBtn && (items = _.dropRight(items)); - return ( - { - (_.isNil(DCChiefPermission) || DCChiefPermission) ? + return ( + record?.opts.includes("admin") ? + : - - } - - - + + + + + + ); } }; break; @@ -145,18 +143,20 @@ const Index: FunctionComponent = (props) => { } ]; return ( - - { - (((_.isNil(DCChiefPermission) || DCChiefPermission) && runStatuses === "fixed") || runStatuses === "ext") ? - : - - } - - + + + + ); } }; @@ -177,14 +177,23 @@ const Index: FunctionComponent = (props) => { onClick: () => handleSalaryFileOperate("log", record) } ]; - return ( - - - - + + + + + + ); } }; break; @@ -193,54 +202,49 @@ const Index: FunctionComponent = (props) => { ...opts, render: (__: any, record: any) => { let stopItems: MenuProps["items"] = [ - { - key: "Log", - label: i18n["操作日志"], - onClick: () => handleSalaryFileOperate("log", record) - }, { key: "CancelSuspension", label: i18n["删除档案"], onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id]) + }, + { + key: "Log", + label: i18n["操作日志"], + onClick: () => handleSalaryFileOperate("log", record) } ]; !showDelSalaryFileBtn && (stopItems = _.dropRight(stopItems)); - return ( - - - { - !_.isEmpty(stopItems) && - - + + { + !_.isEmpty(stopItems) && + + + + + ); } }; break; default: break; } - return showOperateBtn ? [..._.filter(columns, o => o.dataIndex !== "operate"), opts] : - [..._.filter(columns, o => o.dataIndex !== "operate"), { - ...opts, - render: (__: any, record: any) => ( - - { - (DCChiefPermission && (runStatuses === "pending" || runStatuses === "fixed")) ? - : - - } - - - ) - }]; + return [..._.filter(columns, o => o.dataIndex !== "operate"), opts]; } else { return []; } - }, [columns, runStatuses, i18n, showOperateBtn, showDelSalaryFileBtn, DCChiefPermission]); + }, [columns, runStatuses, i18n, showDelSalaryFileBtn]); return ( Date: Thu, 26 Sep 2024 16:16:01 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/salaryFileTable/index.tsx | 43 +++++++++++++--- src/pages/unitTable/renderColsOpts.tsx | 12 ++--- src/pages/welfareArchiveTable/index.tsx | 65 ++++++++++--------------- 3 files changed, 67 insertions(+), 53 deletions(-) diff --git a/src/pages/salaryFileTable/index.tsx b/src/pages/salaryFileTable/index.tsx index bf2f81e..1fc461a 100644 --- a/src/pages/salaryFileTable/index.tsx +++ b/src/pages/salaryFileTable/index.tsx @@ -124,7 +124,15 @@ const Index: FunctionComponent = (props) => { : - + handleSalaryFileOperate("log", record) + } + ] + }} placement="bottomRight"> + - + handleSalaryFileOperate("log", record) + } + ] + }} placement="bottomRight"> + - + handleSalaryFileOperate("log", record) + } + ] + }} placement="bottomRight"> + - + handleSalaryFileOperate("log", record) + } + ] + }} placement="bottomRight"> + ); + onClick={() => postMessageToParent((billStatus === "0" && record?.opts.includes("admin")) ? "CALC" : "VIEW", record)}>{text}); } }; break; @@ -72,15 +72,13 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject, return ( { - !extraParams?.permission ? + !record?.opts.includes("admin") ? postMessageToParent("log", record) - }] + items: [ + { key: "Log", label: i18n?.["操作日志"], onClick: () => postMessageToParent("log", record) } + ] }} placement="bottomRight"> + handleWelfareOperate("log", record) }] + }} placement="bottomRight"> + - - + + - - - ) - }]; - }, [columns, runStatuses, i18n, showOperateBtn]); + return [...columns, opts]; + }, [columns, runStatuses, i18n]); return (
); }; From 78faf02e22d431622b57d1f9a84727141b7e18c5 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 16 Oct 2024 11:21:12 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/unitTable/index.less | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/pages/unitTable/index.less b/src/pages/unitTable/index.less index 852cac3..9c68a13 100644 --- a/src/pages/unitTable/index.less +++ b/src/pages/unitTable/index.less @@ -106,6 +106,28 @@ } } } + + .ant-checkbox-inner { + width: 14px; + height: 14px; + } + + .ant-table-header { + .ant-checkbox-checked { + .ant-checkbox-inner:after { + width: 5px !important; + } + } + + .ant-checkbox-inner:after { + width: 8px !important; + } + } + + .ant-checkbox-inner:after { + width: 5px; + height: 8px; + } } } From 5f37df75cc777644337e8db5928bb105dffc020a Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 15 Nov 2024 15:49:13 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feature/=E4=B8=9A=E5=8A=A1=E7=BA=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/unitTable/renderColsOpts.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/unitTable/renderColsOpts.tsx b/src/pages/unitTable/renderColsOpts.tsx index c87fc0e..4c27bd9 100644 --- a/src/pages/unitTable/renderColsOpts.tsx +++ b/src/pages/unitTable/renderColsOpts.tsx @@ -404,13 +404,15 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject, onClick: () => postMessageToParent("log", record) } ]; - isSpecial && items.shift(); + (isSpecial || !record?.opts.includes("admin")) && items.shift(); return ( - - {isSpecial ? ( + {record?.opts.includes("admin") && ( + + )} + {isSpecial && record?.opts.includes("admin") ? ( From 8908b23300359138388754dce3325c12dc500b73 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 28 Feb 2025 13:38:35 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feature/=E4=B8=9A=E5=8A=A1=E7=BA=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/unitTable/renderColsOpts.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pages/unitTable/renderColsOpts.tsx b/src/pages/unitTable/renderColsOpts.tsx index 4c27bd9..b56b20f 100644 --- a/src/pages/unitTable/renderColsOpts.tsx +++ b/src/pages/unitTable/renderColsOpts.tsx @@ -359,12 +359,20 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject, render: (__: string, record: any) => { return ( - - + {record?.opts.includes("admin") ? ( + + + + + ) : ( + + )} ); }