From 26117e7254bc77e4cfe8376e1eed61acb58d9b30 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, 29 May 2024 10:36:46 +0800 Subject: [PATCH] master --- src/pages/calcTable/index.tsx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 61ebd38..785a4c5 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -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) => { setTableScrollHeight(tableScrollHeight); setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), { title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 120, - render: (__, record) => () + render: (__, record) => ( + + + ) }]); } }; @@ -78,11 +82,12 @@ const index: FunctionComponent = (props) => { ...item, title: , 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) => ( {text} { - item.lockStatus === "LOCK" ? : null + (item.lockStatus === "LOCK" || record.lockStatus === "LOCK") ? + : null } ) @@ -108,6 +113,15 @@ const index: FunctionComponent = (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) => {