/**
?*?加載前預置
?*/
export?function?preList(list:?any,?Page:?any)?{
??list.loading?=?true
??list.reGet?=?false
??Page.data.busy?=?true
??return?list
}
/**
?*?數(shù)據(jù)條數(shù)等處理
?*/
export?function?afterList(list:?any,?Page:?any,?res:?any)?{
??list.total?=?Number(res.total)
??list.items?=?list.items.concat(res.items)
??list.pageCount?=?Math.ceil(list.total?/?list.query.pageSize)
??list.loading?=?false
??if?(list.total?===?0)?{
????list.haveAny?=?false
????list.haveMore?=?false
??}?else?{
????if?(list.query.pageIndex?>=?list.pageCount)?{
??????list.haveMore?=?false
????}?else?{
??????list.query.pageIndex++
????}
??}
??Page.data.busy?=?false
??return?list
}
/**
?*?發(fā)生錯誤時
?*/
export?function?errorList(list:?any,?Page:?any)?{
??list.loading?=?false
??list.reGet?=?true
??Page.data.busy?=?false
??return?list
}
/**
?*?初始化數(shù)據(jù)
?*/
export?function?initList(list:?any)?{
??list.items?=?[]
??list.total?=?0
??list.query?&&?(list.query.pageIndex?=?1)
??list.pageCount?=?0
??list.loading?=?false
??list.haveMore?=?true
??list.haveAny?=?true
??list.reGet?=?false
??return?list
}