This commit is contained in:
2025-07-08 09:14:22 +08:00
parent aa71fd5c7e
commit 01f3339833
10 changed files with 122 additions and 31 deletions
@@ -52,6 +52,7 @@
showTotal: (total) => `${total}`,
onChange: pageChange,
});
const emit = defineEmits(['tableLoad']);
function pageChange(page, pageS) {
current.value = page;
@@ -74,6 +75,7 @@
async function getRecords() {
try {
tableLoading.value = true;
emit('tableLoad', true);
const { code, result } = await props.api({ ...props.apiParams, pageSize: pageSize.value, pageNo: current.value });
if (code == 200) {
if (props.afterFetch && isFunction(props.afterFetch)) {
@@ -86,9 +88,9 @@
}
} catch (e) {
dataSource.value = [];
tableLoading.value = false;
} finally {
tableLoading.value = false;
emit('tableLoad', false);
}
}