From 4ad2bc0eba4f90c94197ff8865a4a3f74b24463b Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 8 Jan 2025 18:21:19 +0800 Subject: [PATCH 1/4] master --- src/pages/atdTable/components/index.less | 2 +- src/pages/calcTable/calcExplainFooter.tsx | 18 +++-- src/pages/calcTable/index.tsx | 98 ++++++++++++++++------- 3 files changed, 83 insertions(+), 35 deletions(-) diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less index 4de9ec0..f50af10 100644 --- a/src/pages/atdTable/components/index.less +++ b/src/pages/atdTable/components/index.less @@ -41,7 +41,7 @@ } :global { - span.anticon-lock { + span.anticon-lock, span.anticon-question-circle { color: #5d9cec; } } diff --git a/src/pages/calcTable/calcExplainFooter.tsx b/src/pages/calcTable/calcExplainFooter.tsx index 59f780d..3853703 100644 --- a/src/pages/calcTable/calcExplainFooter.tsx +++ b/src/pages/calcTable/calcExplainFooter.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent } from "react"; import Icon from "@/lib/CustomIcon"; -import { LockOutlined, UnlockOutlined } from "@ant-design/icons"; +import { LockOutlined, UnlockOutlined, QuestionCircleOutlined } from "@ant-design/icons"; import styles from "@/pages/atdTable/components/index.less"; interface OwnProps { @@ -14,23 +14,29 @@ const CalcExplainFooter: FunctionComponent = (props) => { return (
- + {i18n["批量锁定"]}
- + {i18n["批量解锁"]}
- + {i18n["当前状态锁定,右击解锁"]}
- + {i18n["当前状态未锁定,右击锁定"]}
+ {(i18n["反馈信息,右击删除反馈信息"] || i18n["反馈信息,右击设置反馈信息"]) && ( +
+ + {i18n["反馈信息,右击删除反馈信息"] || i18n["反馈信息,右击设置反馈信息"]} +
+ )}
- + {i18n["批量更新"]}
diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 9ff298d..ec8dab6 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -6,8 +6,8 @@ */ import React, { FunctionComponent, useEffect, useState } from "react"; import type { MenuProps } from "antd"; -import { Button, Dropdown, Space, Table, Typography } from "antd"; -import { LockOutlined, UnlockOutlined } from "@ant-design/icons"; +import { Button, Dropdown, Space, Table, Tooltip, Typography } from "antd"; +import { DeleteOutlined, LockOutlined, QuestionCircleOutlined, SettingOutlined, UnlockOutlined } from "@ant-design/icons"; import CustomTableTitle from "@/pages/calcTable/customTableTitle"; import CalcExplainFooter from "@/pages/calcTable/calcExplainFooter"; import CaclFixedTotal from "./calcFixedTotal"; @@ -131,41 +131,76 @@ const index: FunctionComponent = (props) => { i18n: item.i18n, onCell: (record: any) => ({ onContextMenu: (e: any) => { - !item.calcDetail && e.preventDefault(); + (!item.calcDetail || item.rightClickType) && e.preventDefault(); } }), render: (text: string, record: any) => { - const items: MenuProps["items"] = [ - { - label: item.i18n["锁定"], - key: "LOCK", - icon: , - onClick: () => - handleLockEmp({ - lockStatus: "LOCK", - acctEmpId: record?.id, - salaryItemId: item?.dataIndex - }) - }, - { - label: item.i18n["解锁"], - key: "UNLOCK", - icon: , - onClick: () => - handleLockEmp({ - lockStatus: "UNLOCK", - acctEmpId: record?.id, - salaryItemId: item?.dataIndex - }) - } - ]; + let items: MenuProps["items"] = !item.calcDetail + ? [ + { + label: item.i18n["锁定"], + key: "LOCK", + icon: , + onClick: () => + handleLockEmp({ + lockStatus: "LOCK", + acctEmpId: record?.id, + salaryItemId: item?.dataIndex + }) + }, + { + label: item.i18n["解锁"], + key: "UNLOCK", + icon: , + onClick: () => + handleLockEmp({ + lockStatus: "UNLOCK", + acctEmpId: record?.id, + salaryItemId: item?.dataIndex + }) + } + ] + : []; + item.rightClickType === "DELFEEDBACK" && + (items = [ + ...items, + { + label: item.i18n["删除反馈"], + key: "DELFEEDBACK", + icon: , + onClick: () => + handleDelFeedback({ + acctEmpId: record?.id, + salaryItemId: item?.dataIndex + }) + } + ]); + item.rightClickType === "SETFEEDBACK" && + (items = [ + ...items, + { + label: item.i18n["设置反馈"], + key: "SETFEEDBACK", + icon: , + onClick: () => + handleSetFeedback({ + acctEmpId: record?.id, + salaryItemId: item?.dataIndex + }) + } + ]); return ( - + {text} {record.lockItems && record.lockItems.includes(item.dataIndex) ? : null} + {!_.isEmpty(record[`${item.dataIndex}_feedback`]) ? ( + + + + ) : null} ); @@ -183,6 +218,13 @@ const index: FunctionComponent = (props) => { const handleLockEmp = (params: any) => { window.parent.postMessage({ type: "turn", payload: { id: "LOCKEMP", params } }, "*"); }; + // 复旦大学附属医院二开-薪资核算项添加右击删除反馈的操作 + const handleDelFeedback = (params: any) => { + window.parent.postMessage({ type: "turn", payload: { id: "DELFEEDBACK", params } }, "*"); + }; + const handleSetFeedback = (params: any) => { + window.parent.postMessage({ type: "turn", payload: { id: "SETFEEDBACK", params } }, "*"); + }; const sizeChange = (pageobj: IPage) => {}; const onChange = (pageobj: IPage) => { setPageInfo(() => { From 2aeac6e713df8326488333ffd212aee1affebe4f Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 9 Jan 2025 11:15:27 +0800 Subject: [PATCH 2/4] master --- src/pages/atdTable/components/index.less | 4 ++++ src/pages/calcTable/index.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less index f50af10..733d611 100644 --- a/src/pages/atdTable/components/index.less +++ b/src/pages/atdTable/components/index.less @@ -80,6 +80,10 @@ } } + .feedbackBg { + background: #FF0; + } + .danger { font-size: var(--data-size); color: rgb(217, 0, 27) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index ec8dab6..4d162b4 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -130,6 +130,7 @@ const index: FunctionComponent = (props) => { className: styles["td_odd"], i18n: item.i18n, onCell: (record: any) => ({ + className: !_.isEmpty(record[`${item.dataIndex}_feedback`]) && styles["feedbackBg"], onContextMenu: (e: any) => { (!item.calcDetail || item.rightClickType) && e.preventDefault(); } From 0df94c42580ea098c20788127fa2ee49d833a252 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 10 Jan 2025 18:18:26 +0800 Subject: [PATCH 3/4] master --- src/pages/calcTable/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 4d162b4..0f111ea 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -162,7 +162,7 @@ const index: FunctionComponent = (props) => { } ] : []; - item.rightClickType === "DELFEEDBACK" && + item.rightClickType.includes("DELFEEDBACK") && (items = [ ...items, { @@ -176,7 +176,7 @@ const index: FunctionComponent = (props) => { }) } ]); - item.rightClickType === "SETFEEDBACK" && + item.rightClickType.includes("SETFEEDBACK") && (items = [ ...items, { From f85278b29f001de78f11b10545a7d6e7ba2f6bbe Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 14 Jan 2025 14:39:26 +0800 Subject: [PATCH 4/4] master --- src/pages/calcTable/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 0f111ea..c0a8417 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -162,7 +162,8 @@ const index: FunctionComponent = (props) => { } ] : []; - item.rightClickType.includes("DELFEEDBACK") && + item.rightClickType && + item.rightClickType.includes("DELFEEDBACK") && (items = [ ...items, { @@ -176,7 +177,8 @@ const index: FunctionComponent = (props) => { }) } ]); - item.rightClickType.includes("SETFEEDBACK") && + item.rightClickType && + item.rightClickType.includes("SETFEEDBACK") && (items = [ ...items, {