diff --git a/src/pages/calcTable/calcFixedTotal.tsx b/src/pages/calcTable/calcFixedTotal.tsx index 09ca74f..6e61bbd 100644 --- a/src/pages/calcTable/calcFixedTotal.tsx +++ b/src/pages/calcTable/calcFixedTotal.tsx @@ -61,7 +61,7 @@ const calcFixedTotal: FunctionComponent = (props) => { return { loading ? : - {sumRow[item.dataIndex] || "-"} + {!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"} } ; }) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index 34f839c..7d2db9c 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -50,7 +50,7 @@ const index: FunctionComponent = (props) => { const { columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail, - fixed = true, tableScrollHeight, sumRow + fixed = true, tableScrollHeight, sumRow, optWidth } = data; setSumRowlistUrl(sumRowlistUrl); setShowTotalCell(showTotalCell); @@ -64,7 +64,7 @@ const index: FunctionComponent = (props) => { setSelectedRowKeys(selectedRowKeys); setTableScrollHeight(tableScrollHeight); setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), { - title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 220, + title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: optWidth || 120, render: (__, record) => ( + + + ); + } + }]; } return initialState; }, [initialState, type, i18n, extraParams]);