From 5d74a1e992f17a13010b5e8dfdeaa2a201237b0a Mon Sep 17 00:00:00 2001 From: zhaobing Date: Tue, 27 Jun 2023 08:35:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9F=A5=E8=AF=A2=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9+=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=94=99=E8=AF=AF+?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../facility/components/serverInfoModal.jsx | 2 +- .../facility/containers/maintenanceRecords.jsx | 16 +++++++++++++--- .../service/containers/maintenanceRecords.jsx | 2 +- .../service/containers/serviceRecord.jsx | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/web/client/src/sections/facility/components/serverInfoModal.jsx b/web/client/src/sections/facility/components/serverInfoModal.jsx index 56e61d6..de2f457 100644 --- a/web/client/src/sections/facility/components/serverInfoModal.jsx +++ b/web/client/src/sections/facility/components/serverInfoModal.jsx @@ -66,7 +66,7 @@ const ServerInfoModal = (props) => { getFormApi={(formApi) => (api.current = formApi)} labelPosition='left' > - + {pepList?.map((item) => { diff --git a/web/client/src/sections/facility/containers/maintenanceRecords.jsx b/web/client/src/sections/facility/containers/maintenanceRecords.jsx index 5d7d8c5..2ef5815 100644 --- a/web/client/src/sections/facility/containers/maintenanceRecords.jsx +++ b/web/client/src/sections/facility/containers/maintenanceRecords.jsx @@ -30,7 +30,17 @@ const MaintenanceRecords = (props) => { const delHandler=(record)=>{ dispatch(facility.delServerInfoMaintenanceRecord(record.id)).then((res)=>{ if(res.success) { - getServerInfo({startTime,endTime,pageIndex:1,pageSize}) + const query={startTime,endTime,pageIndex,pageSize} + dispatch(facility.getServerInfoMaintenanceRecord(query)).then((res)=>{ + if(res.success) { + setRecordList(res.payload.data.responseRes);setTotal(res?.payload.data.count) + //再用当前页去查询,判断结果是否为空(删除某一页的唯一元素时,再次请求结果为空),为空且当前页不是第一页,当前页-1,再查询一遍。 + if(res?.payload.data.responseRes.length===0&&pageIndex!==1){ + getServerInfo({startTime,endTime,pageIndex:pageIndex-1,pageSize}) + setPageIndex(pageIndex-1) + } + } + }) setPageIndex(1) } @@ -164,14 +174,14 @@ const MaintenanceRecords = (props) => {
- 上报时间 + 维护开始时间 { setStartTime(dateTime[0]+'') setEndTime(dateTime[1]+'') }} onClear={clearHandler}>
- +
diff --git a/web/client/src/sections/service/containers/maintenanceRecords.jsx b/web/client/src/sections/service/containers/maintenanceRecords.jsx index f732015..7cdd4b6 100644 --- a/web/client/src/sections/service/containers/maintenanceRecords.jsx +++ b/web/client/src/sections/service/containers/maintenanceRecords.jsx @@ -183,7 +183,7 @@ const MaintenanceRecords = (props) => { {timeHandler(e)}} onClear={()=>{setStartTime('1970-1-1');setEndTime('2099-12-31')}}>
- +
diff --git a/web/client/src/sections/service/containers/serviceRecord.jsx b/web/client/src/sections/service/containers/serviceRecord.jsx index cf5f374..3003912 100644 --- a/web/client/src/sections/service/containers/serviceRecord.jsx +++ b/web/client/src/sections/service/containers/serviceRecord.jsx @@ -208,7 +208,7 @@ const addHandler=()=>{ { setStartTime((e[0])+'');setEndTime(e[1]+'') }} onClear={()=>{setStartTime('1970-1-1');setEndTime('2099-12-31')}} /> -