diff --git a/src/pages/calcTable/customTableTitle.tsx b/src/pages/calcTable/customTableTitle.tsx index cdcad41..c88df83 100644 --- a/src/pages/calcTable/customTableTitle.tsx +++ b/src/pages/calcTable/customTableTitle.tsx @@ -17,12 +17,13 @@ interface OwnProps { onHandleFormulatd?: any; i18n?: any; pattern?: number; + calcDetail?: boolean; //查看详情页面 } type Props = OwnProps; const customTableTitle: FunctionComponent = (props) => { - const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType } = props; + const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType, calcDetail } = props; const handleToggleSalaryItemVal = (salaryItemId: string, type: string, updateParams: any = {}) => { window.parent.postMessage( @@ -38,7 +39,7 @@ const customTableTitle: FunctionComponent = (props) => {
onHandleFormulatd(dataIndex)}>{title}
{ - !!lockStatus && + !!lockStatus && !calcDetail &&
handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/> diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index dca62f5..1a91f5a 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -46,6 +46,7 @@ const Index: FunctionComponent = (props) => { const [pageInfo, setPageInfo] = useState>({}); const [i18n, setI18n] = useState({}); const [showTotalCell, setShowTotalCell] = useState(false); + const [isDetailTable, setIsDetailTable] = useState(false); const [sumRowlistUrl, setSumRowlistUrl] = useState(""); const [payload, setPayload] = useState(""); const [form] = Form.useForm(); @@ -63,10 +64,11 @@ const Index: FunctionComponent = (props) => { if (!_.isEmpty(data)) { const { columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, - showTotalCell = false, sumRowlistUrl = "", payload = {} + showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail } = data; setSumRowlistUrl(sumRowlistUrl); setShowTotalCell(showTotalCell); + setIsDetailTable(calcDetail); setI18n(i18nRes); setPayload(payload); setPageInfo(pageInfo); @@ -203,9 +205,10 @@ const Index: FunctionComponent = (props) => { }; return (
} components={components} + columns={!isDetailTable ? columns : _.filter(columns, o => o.dataIndex !== "operate")} + footer={() => !isDetailTable ? : null} components={components} pagination={{ ...paginationFun(pageInfo, sizeChange, onChange, i18n), size: "default"