用户列表新增导出功能
This commit is contained in:
@@ -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" },
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user