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,13 +67,15 @@
<template #reference> <template #reference>
<el-button icon="Operation" circle /> <el-button icon="Operation" circle />
</template> </template>
<template v-for="col in cols" :key="col"> <el-scrollbar max-height="350px">
<el-checkbox <template v-for="col in cols" :key="col">
v-if="col.prop" <el-checkbox
v-model="col.show" v-if="col.prop"
:label="col.label" v-model="col.show"
/> :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");