mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-28 13:31:04 +00:00
fix(实物订单): 重置搜索后同步重置状态选项卡
Tab 选中态由 OrderTable 组件内部维护,父级 onReset 只清了自己的 statusTab,导致重置后列表已查全部订单而 Tab 仍停留在原状态(如待支付)。 - OrderTable 新增 resetTab() 并 defineExpose,重置 Tab 选中态与分页到第一页 - 列表页 onReset 调用 resetTab 同步;onTabChange 切换状态时同步把 请求页码归 1,避免子组件已回第一页而请求仍取旧页码
This commit is contained in:
parent
e6876435fd
commit
6ca46b0e1d
@ -350,6 +350,8 @@ function onSearch(params) {
|
||||
function onReset() {
|
||||
searchParams.value = {};
|
||||
statusTab.value = '';
|
||||
// Tab 选中态在 OrderTable 组件内部,需同步重置,否则列表已查全部而 Tab 仍停在原状态
|
||||
tableRef.value?.resetTab();
|
||||
getList();
|
||||
getStatistics();
|
||||
}
|
||||
@ -358,6 +360,8 @@ function onReset() {
|
||||
|
||||
function onTabChange(tab) {
|
||||
statusTab.value = tab;
|
||||
// 切换状态后回到第一页(OrderTable 内部已把分页归 1,这里同步请求参数)
|
||||
searchParams.value.page = 1;
|
||||
getList();
|
||||
getStatistics();
|
||||
}
|
||||
|
||||
@ -603,7 +603,15 @@ function formatTime(ts) {
|
||||
return `${y}/${m}/${day} ${h}:${min}:${s}`;
|
||||
}
|
||||
|
||||
defineExpose({ selectedIds, page });
|
||||
/**
|
||||
* 重置选项卡与分页(父级重置搜索时调用,保证 Tab 选中态与列表数据一致)
|
||||
*/
|
||||
function resetTab() {
|
||||
currentTab.value = '';
|
||||
page.page = 1;
|
||||
}
|
||||
|
||||
defineExpose({ selectedIds, page, resetTab });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user