feature/核算表格双击编辑
黎永顺 9 months ago
parent 699d3323c4
commit fe86dd2cd6

@ -34,6 +34,16 @@ const index: FunctionComponent<Props> = (props) => {
if (!_.isEmpty(report?.columns)) {
window.document.body.innerHTML =
window.document.getElementById("print")!.innerHTML;
const styleTag = document.createElement("style");
styleTag.type = "text/css";
styleTag.innerHTML = `
.ant-table {
td, th, .ant-table-title, .ant-table-footer, table {
border-color: #333 !important;
}
}
`;
window.document.head.appendChild(styleTag);
window.print();
// window.location.reload();
}

@ -64,11 +64,12 @@ const index: FunctionComponent<Props> = (props) => {
setSelectedRowKeys(selectedRowKeys);
setTableScrollHeight(tableScrollHeight);
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 120,
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 220,
render: (__, record) => (<Space>
<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>
<Button type="link"
onClick={() => handleLockEmp(record)}>{record.lockStatus === "LOCK" ? i18nRes["解锁"] : i18nRes["锁定"]}</Button>
{record?.lockStatus === "LOCK" && <Text>{record?.lockTime}</Text>}
</Space>)
}]);
}

Loading…
Cancel
Save