Merge pull request #106 from cshaptx4869/patch-68

refactor(PageContent): ♻️ 点击表格刷新按钮不重置页码
This commit is contained in:
Ray Hao
2024-05-20 11:35:26 +08:00
committed by GitHub

View File

@@ -67,6 +67,7 @@
<template #reference> <template #reference>
<el-button icon="Operation" circle /> <el-button icon="Operation" circle />
</template> </template>
<el-scrollbar max-height="350px">
<template v-for="col in cols" :key="col"> <template v-for="col in cols" :key="col">
<el-checkbox <el-checkbox
v-if="col.prop" v-if="col.prop"
@@ -74,6 +75,7 @@
:label="col.label" :label="col.label"
/> />
</template> </template>
</el-scrollbar>
</el-popover> </el-popover>
</template> </template>
<!-- 搜索 --> <!-- 搜索 -->
@@ -433,7 +435,7 @@ function handleSelectionChange(selection: any[]) {
} }
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
fetchPageData({}, true); fetchPageData(lastFormData);
} }
// 删除 // 删除
function handleDelete(id?: number | string) { function handleDelete(id?: number | string) {
@@ -451,7 +453,7 @@ function handleDelete(id?: number | string) {
if (props.contentConfig.deleteAction) { if (props.contentConfig.deleteAction) {
props.contentConfig.deleteAction(ids).then(() => { props.contentConfig.deleteAction(ids).then(() => {
ElMessage.success("删除成功"); ElMessage.success("删除成功");
handleRefresh(); fetchPageData({}, true);
}); });
} else { } else {
ElMessage.error("未配置deleteAction"); ElMessage.error("未配置deleteAction");