From e2eb2f97a9c033cbbe396b8dda82312f91196e29 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 19 Jun 2025 09:10:07 +0800 Subject: [PATCH] =?UTF-8?q?feature/=E4=B8=9A=E5=8A=A1=E7=BA=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/calcTable/index.tsx | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 52e4e4e..10ea310 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -5,8 +5,7 @@ * Date: 2023/9/14 */ import React, { FunctionComponent, useEffect, useState } from "react"; -import type { MenuProps } from "antd"; -import { Button, Dropdown, Space, Table, Tooltip, Typography } from "antd"; +import { Button, Checkbox, Dropdown, MenuProps, 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"; @@ -124,7 +123,17 @@ const index: FunctionComponent = (props) => { const convertColumns: any = (cols: any[]) => { return _.map(cols, (item) => { if (_.isNaN(parseInt(item.dataIndex))) { - return { ...item }; + // 医博肛肠二开 + if (item.dataIndex === "ybgc-custom") { + return { + ...item, + render: (text: string, record: any) => { + return handlePassed(record, e.target.checked)} />; + } + }; + } else { + return { ...item }; + } } else { return { ...item, @@ -231,6 +240,19 @@ const index: FunctionComponent = (props) => { const handleSetFeedback = (params: any) => { window.parent.postMessage({ type: "turn", payload: { id: "SETFEEDBACK", params } }, "*"); }; + // 医博二开 + const handlePassed = (params: any, calculateStatus: boolean) => { + setDataSource((pre) => { + pre = _.map(pre, (o) => { + if (o.id === params.id) { + return { ...o, calculateStatus: calculateStatus ? "1" : "0" }; + } + return o; + }); + return pre; + }); + window.parent.postMessage({ type: "turn", payload: { id: "CUSTPASSED", params: { ...params, calculateStatus: calculateStatus ? "1" : "0" } } }, "*"); + }; const sizeChange = (pageobj: IPage) => {}; const onChange = (pageobj: IPage) => { setPageInfo(() => { @@ -240,8 +262,8 @@ const index: FunctionComponent = (props) => { }; const rowSelection = { columnWidth: 50, - columnTitle: isDetailTable && _.isNil(showSee) ? "序号" : "", - renderCell: (value: boolean, record: any, index: number, originNode: React.ReactNode) => (isDetailTable && _.isNil(showSee) ? {index + 1} : originNode), + columnTitle: isDetailTable && !showSee ? "序号" : "", + renderCell: (value: boolean, record: any, index: number, originNode: React.ReactNode) => (isDetailTable && !showSee ? {index + 1} : originNode), selectedRowKeys, preserveSelectedRowKeys: true, onChange: (rowKeys: React.Key[]) => {