用户列表新增导出功能

This commit is contained in:
gyq
2026-01-28 16:16:04 +08:00
parent ca182dc325
commit 71bec03475
6 changed files with 34 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ const contentConfig: IContentConfig<any> = {
// // return shopUserApi.edit(data);
// },
pk: "id",
toolbar: ["add"],
toolbar: ["add", 'export'],
defaultToolbar: ["refresh", "filter", "search"],
cols: [
{ type: "selection", width: 50, align: "center" },

View File

@@ -158,6 +158,7 @@ import { returnOptionsLabel } from "./config/config";
import shopUserApi from "@/api/account/shopUser";
import { useRoute } from 'vue-router'
import { ElNotification } from 'element-plus'
import { downloadFile } from "@/utils/index";
const editMoneyModalRef = ref(null);
const userCouponDialogRef = ref(null);
const GiveCouponRef = ref(null);
@@ -175,7 +176,7 @@ const {
// handleAddClick,
// handleEditClick,
handleSubmitClick,
handleExportClick,
// handleExportClick,
handleSearchClick,
handleFilterChange,
} = usePage();
@@ -217,6 +218,16 @@ function formDataChange(type, val) {
}
}
// 导出
async function handleExportClick() {
try {
const file = await shopUserApi.export(searchRef.value.getQueryParams());
downloadFile(file, "用户列表", "xlsx");
} catch (error) {
console.log(error);
}
}
// 新增
async function handleAddClick() {
addModalRef.value?.setModalVisible();