From 22a5c3eac03b26c73b65062acdf9c71e0f2fad7e Mon Sep 17 00:00:00 2001 From: He Huan Date: Tue, 23 Jan 2024 16:51:39 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E4=BF=AE=E5=A4=8D=E7=89=A9=E7=90=86?= =?UTF-8?q?=E8=A3=85=E8=BE=93=E5=85=A5=E5=B0=8F=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/Tabs/index.jsx | 9 ++++++--- .../PhysicalPileManagement/index.scss | 13 ++++++++++++- .../PhysicalPileManagement/loadable.jsx | 21 ++++++++++++--------- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/components/layout/Tabs/index.jsx b/src/components/layout/Tabs/index.jsx index db7c0b9..d1d8fa1 100644 --- a/src/components/layout/Tabs/index.jsx +++ b/src/components/layout/Tabs/index.jsx @@ -44,11 +44,14 @@ export default function Tabs() { sessionStorage.removeItem(data.name + '_data1') sessionStorage.removeItem(data.name + '_data2') //data是点击关闭的 - if (data.path == location.pathname) { + var parts = data.path.split('?'); + // 如果存在问号,取第一个问号前面的部分的路由,去除参数 + var result = parts.length > 1 ? parts[0] : data.path; + if (result == location.pathname) { sessionStorage.removeItem(data.name) } - if (data.path != location.pathname) { - return + if (result != location.pathname) { + return } if (index + 1 == tabList.length && tabList.length == 1) { // navigate('/home') diff --git a/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/index.scss b/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/index.scss index da7212c..f017232 100644 --- a/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/index.scss +++ b/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/index.scss @@ -3,7 +3,18 @@ display: flex; justify-content: center; } - + .ant-input::-webkit-input-placeholder { + color: var(--color-placeholder); + } + .ant-input::-moz-placeholder{ + color: var(--color-placeholder); + } + .ant-input:-ms-input-placeholder{ + color: var(--color-placeholder); + } + .ant-input::placeholder{ + color: var(--color-placeholder); + } .form-container{ width: 400px; .cc-form-input,.cc-form-select{ diff --git a/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx b/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx index c805769..cb1abfe 100644 --- a/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx +++ b/src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx @@ -1,15 +1,9 @@ import React, { useState, useRef, useEffect } from "react"; -import { message, Pagination, Table, Space, Modal, Button ,Popover,Input,TimePicker,InputNumber} from "antd"; -// import { dictionary, utils } from "@/config/common"; -// import moment from 'moment' -// import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; +import { message, Modal, Button ,Input} from "antd"; import ajax from "@/services"; import { TableModule ,FormInput,FormSelect} from "@/components"; import "./index.scss"; -import moment from "moment"; -// import errorImg from "@/assets/images/layout/error.png" -// import { useLocation } from "react-router-dom"; -const { TextArea } = Input; + function PhysicalPileManagement() { const [selectData, setSelectData] = useState([]); const listData={ @@ -225,7 +219,16 @@ function PhysicalPileManagement() { type='number' value={rowData.muzzle_num} placeholder="请输入枪口数量" - onChange={e => { setRowData({ ...rowData, muzzle_num: e.target.value }) }} + onInput={e => { + setRowData({ ...rowData, muzzle_num: e.target.value }) } + } + onBlur={e => { + const value = rowData.muzzle_num; + if (/^[1-9]\d*$/.test(value) || value === '') { + setRowData({ ...rowData, muzzle_num: value }) }else{ + setRowData({ ...rowData, muzzle_num: "" }) + }} + } >