refactor(inspection): 优化检测列表数据获取与计数逻辑
- 将 useTable 初始化移至 useEffect 之后,确保依赖顺序合理 - 在表格数据获取前清空统计计数,避免显示旧数据 - 修正获取查询时间区间时的字段访问错误 - 调整 getCount 调用时机,确保数据同步更新 - 删除冗余的 useEffect 调用,简化组件逻辑master
parent
9b7cca22a5
commit
83efa00486
|
|
@ -60,7 +60,12 @@ function List(props) {
|
||||||
corpId: query.corpId,
|
corpId: query.corpId,
|
||||||
},
|
},
|
||||||
onBefore: () => {
|
onBefore: () => {
|
||||||
setCount({});
|
setCount({
|
||||||
|
inspectCount: 0,
|
||||||
|
hiddenCount: 0,
|
||||||
|
safetyCount: 0,
|
||||||
|
environmentalCount: 0,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
getCount();
|
getCount();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue