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