|
|
|
@ -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,43 +131,81 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
className: styles["td_odd"],
|
|
|
|
|
i18n: item.i18n,
|
|
|
|
|
onCell: (record: any) => ({
|
|
|
|
|
className: !_.isEmpty(record[`${item.dataIndex}_feedback`]) && styles["feedbackBg"],
|
|
|
|
|
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: <LockOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleLockEmp({
|
|
|
|
|
lockStatus: "LOCK",
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: item.i18n["解锁"],
|
|
|
|
|
key: "UNLOCK",
|
|
|
|
|
icon: <UnlockOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleLockEmp({
|
|
|
|
|
lockStatus: "UNLOCK",
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
let items: MenuProps["items"] = !item.calcDetail
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
label: item.i18n["锁定"],
|
|
|
|
|
key: "LOCK",
|
|
|
|
|
icon: <LockOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleLockEmp({
|
|
|
|
|
lockStatus: "LOCK",
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: item.i18n["解锁"],
|
|
|
|
|
key: "UNLOCK",
|
|
|
|
|
icon: <UnlockOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleLockEmp({
|
|
|
|
|
lockStatus: "UNLOCK",
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
: [];
|
|
|
|
|
item.rightClickType &&
|
|
|
|
|
item.rightClickType.includes("DELFEEDBACK") &&
|
|
|
|
|
(items = [
|
|
|
|
|
...items,
|
|
|
|
|
{
|
|
|
|
|
label: item.i18n["删除反馈"],
|
|
|
|
|
key: "DELFEEDBACK",
|
|
|
|
|
icon: <DeleteOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleDelFeedback({
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
item.rightClickType &&
|
|
|
|
|
item.rightClickType.includes("SETFEEDBACK") &&
|
|
|
|
|
(items = [
|
|
|
|
|
...items,
|
|
|
|
|
{
|
|
|
|
|
label: item.i18n["设置反馈"],
|
|
|
|
|
key: "SETFEEDBACK",
|
|
|
|
|
icon: <SettingOutlined />,
|
|
|
|
|
onClick: () =>
|
|
|
|
|
handleSetFeedback({
|
|
|
|
|
acctEmpId: record?.id,
|
|
|
|
|
salaryItemId: item?.dataIndex
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
return (
|
|
|
|
|
<Dropdown menu={{ items: !item.calcDetail ? items : [] }} trigger={["contextMenu"]} overlayClassName={styles.contextMenu} destroyPopupOnHide>
|
|
|
|
|
<Dropdown menu={{ items: !item.calcDetail || item.rightClickType ? items : [] }} trigger={["contextMenu"]} overlayClassName={styles.contextMenu} destroyPopupOnHide>
|
|
|
|
|
<span className={styles.contentSpan}>
|
|
|
|
|
<span title={text} className={styles.contentTitle} style={{ color: `${record?.[item.dataIndex + "_color"]}` }}>
|
|
|
|
|
{text}
|
|
|
|
|
</span>
|
|
|
|
|
<Icon type="icon-piliangfenpei" title={i18n["查看拓扑图"]} className={styles.diagramIcon} onClick={() => handleDiagramTd(item?.dataIndex, record?.id)} />
|
|
|
|
|
{record.lockItems && record.lockItems.includes(item.dataIndex) ? <LockOutlined title={item.i18n["锁定的项目值"]} /> : null}
|
|
|
|
|
{!_.isEmpty(record[`${item.dataIndex}_feedback`]) ? (
|
|
|
|
|
<Tooltip title={record[`${item.dataIndex}_feedback`]}>
|
|
|
|
|
<QuestionCircleOutlined />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
) : null}
|
|
|
|
|
</span>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
);
|
|
|
|
@ -188,6 +226,13 @@ const index: FunctionComponent<Props> = (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(() => {
|
|
|
|
|