有分页的表格,搜索或重置的时候pageNum切换到第一页

This commit is contained in:
白菜
2025-07-02 17:44:14 +08:00
parent c53bc4dc45
commit 328f893da9
2 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,7 @@ export default {
}, },
// 搜索 // 搜索
onSearch(){ onSearch(){
this.pageNum =1//每次搜索从1开始搜索
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || []) const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
// 选中了时间范围 // 选中了时间范围
if(alarmStartTime && alarmStartTime){ if(alarmStartTime && alarmStartTime){
@ -175,6 +176,7 @@ export default {
onReset(){ onReset(){
this.search={deviceType:'',alarmLevel:''} this.search={deviceType:'',alarmLevel:''}
this.dateRange=[] this.dateRange=[]
this.pageNum =1//每次搜索从1开始搜索
this.getData() this.getData()
}, },
// 切换今日、历史告警 // 切换今日、历史告警

View File

@ -117,6 +117,7 @@ export default {
}, },
// 搜索 // 搜索
onSearch(){ onSearch(){
this.pageNum =1//每次搜索从1开始搜索
this.getTableData() this.getTableData()
}, },
// 重置 // 重置
@ -125,6 +126,7 @@ export default {
onReset(){ onReset(){
this.search={stackId:'',clusterId:''} this.search={stackId:'',clusterId:''}
this.clusterOptions=[] this.clusterOptions=[]
this.pageNum = 1
this.getTableData() this.getTableData()
}, },
changeStackId(val){ changeStackId(val){