From be826846222dea84a573478c00a797b613f1ab7d 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, 6 Dec 2023 11:16:44 +0800 Subject: [PATCH] master --- src/pages/atdTable/components/index.less | 16 +++++++++++++++- src/utils/common.js | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less index 7577694..8aa9522 100644 --- a/src/pages/atdTable/components/index.less +++ b/src/pages/atdTable/components/index.less @@ -165,6 +165,12 @@ } } + tr:hover .editable-cell { + padding: 4px 11px; + border: 1px solid #d9d9d9; + border-radius: 2px; + } + :global { .ant-btn-link { height: inherit !important; @@ -260,7 +266,15 @@ } th, td { - font-size: 12px + font-size: 12px; + + .ant-form-item { + margin-bottom: 0; + + .ant-input-number { + width: 100%; + } + } } } } diff --git a/src/utils/common.js b/src/utils/common.js index 5fcaa49..5096b1a 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -110,3 +110,16 @@ export const paginationAction = (pageInfo = {}, i18n = {}, onChange, onShowSizeC showSizeChanger: true }; }; +/* + * Author: 黎永顺 + * Description: + * Params: 格式化钱 + * Date: 2023/12/6 + */ +export const toDecimal_n = (num, decimalPlaces) => { + if (num === null || !isFinite(num)) return null + if (decimalPlaces < 0) return null; + const multiplier = Math.pow(10, decimalPlaces); + const roundedNum = Math.round(num * multiplier) / multiplier; + return roundedNum.toFixed(decimalPlaces); +};