|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
* Date: 2023/9/14
|
|
|
|
|
*/
|
|
|
|
|
import React, { FunctionComponent, useEffect, useState } from "react";
|
|
|
|
|
import { Button, Table, Typography } from "antd";
|
|
|
|
|
import { Button, Space, Table, Typography } from "antd";
|
|
|
|
|
import { LockOutlined } from "@ant-design/icons";
|
|
|
|
|
import CustomTableTitle from "@/pages/calcTable/customTableTitle";
|
|
|
|
|
import CalcExplainFooter from "@/pages/calcTable/calcExplainFooter";
|
|
|
|
@ -65,7 +65,11 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
setTableScrollHeight(tableScrollHeight);
|
|
|
|
|
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
|
|
|
|
|
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 120,
|
|
|
|
|
render: (__, record) => (<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>)
|
|
|
|
|
render: (__, record) => (<Space>
|
|
|
|
|
<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>
|
|
|
|
|
<Button type="link"
|
|
|
|
|
onClick={() => handleLockEmp(record)}>{record.lockStatus === "LOCK" ? i18nRes["解锁"] : i18nRes["锁定"]}</Button>
|
|
|
|
|
</Space>)
|
|
|
|
|
}]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -78,11 +82,12 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
...item, title: <CustomTableTitle {...item} onHandleFormulatd={handleFormulaTd}/>,
|
|
|
|
|
children: convertColumns(_.map(item.children, o => ({ ...o, i18n: item.i18n }))),
|
|
|
|
|
className: styles["td_odd"], i18n: item.i18n,
|
|
|
|
|
render: (text: string) => (
|
|
|
|
|
render: (text: string, record: any) => (
|
|
|
|
|
<span className={styles.contentSpan}>
|
|
|
|
|
<span title={text} className={styles.contentTitle}>{text}</span>
|
|
|
|
|
{
|
|
|
|
|
item.lockStatus === "LOCK" ? <LockOutlined title={i18n["锁定的项目值"]}/> : null
|
|
|
|
|
(item.lockStatus === "LOCK" || record.lockStatus === "LOCK") ?
|
|
|
|
|
<LockOutlined title={i18n["锁定的项目值"]}/> : null
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
@ -108,6 +113,15 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
const handleLockEmp = (record: any) => {
|
|
|
|
|
const { id, lockStatus } = record;
|
|
|
|
|
window.parent.postMessage({
|
|
|
|
|
type: "turn",
|
|
|
|
|
payload: { id: "LOCKEMP", params: { lockStatus: lockStatus === "UNLOCK" ? "LOCK" : "UNLOCK", acctEmpIds: [id] } }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
const sizeChange = (pageobj: IPage) => {
|
|
|
|
|
};
|
|
|
|
|
const onChange = (pageobj: IPage) => {
|
|
|
|
|