From 0ee5cbc1dde56dfa61ebf3c679e792b1d30c76b6 Mon Sep 17 00:00:00 2001 From: fengxiang <361798944@qq.com> Date: Mon, 22 Jan 2024 14:02:42 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 14 ++++++++++++-- src/config/utils.js | 2 +- src/router/index.jsx | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index c330558..172703b 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -456,6 +456,16 @@ const TableModule = forwardRef((props, ref) => { //setPlateValue(e); setFormData({ ...formData, plateValue: e?.label || '', plate2: newValue }) }; + const handleNumInput = (key, val) => { + // console.log(key, val); + const obj = {[key]: val.replace(/[^\d]/g,'').replace(/0*(\d+)/,'$1') }; + // console.log(obj); + searchForm.setFieldsValue(obj); + setFormData({ ...formData, ...obj }); + if (valueChange) { + valueChange(v); + } + }; // useEffect(() => { // console.log(deftime.startDateTime); // if (deftime.startDateTime) { @@ -839,14 +849,14 @@ const TableModule = forwardRef((props, ref) => { case "stopTime": children = ( - + handleNumInput(item.name, e.target.value)} /> ); break; case "stopMoney": children = ( - + handleNumInput(item.name, e.target.value)} /> ); break; diff --git a/src/config/utils.js b/src/config/utils.js index bae3108..0237b8c 100644 --- a/src/config/utils.js +++ b/src/config/utils.js @@ -488,7 +488,7 @@ const utils = { } else { scroll = document.querySelector(".yisa-table-scroll .ant-table-container .ant-table-body "); } - console.log(scroll); + // console.log(scroll); if(!scroll) return scroll.scrollTop = 0; } diff --git a/src/router/index.jsx b/src/router/index.jsx index 579c6a4..4f34175 100644 --- a/src/router/index.jsx +++ b/src/router/index.jsx @@ -23,7 +23,7 @@ function RouterMap(props) { {!storeRoutes.includes(route.name) ? ( ) : ( - + route.component?:
 页面开发中...
)} )