feat(PageContent): 支持后端文件导入

This commit is contained in:
cshaptx4869
2024-06-17 11:23:39 +08:00
parent 2854b36598
commit e2e70e647c
4 changed files with 53 additions and 16 deletions

View File

@@ -25,6 +25,9 @@ const contentConfig: IContentConfig<UserQuery> = {
return UserAPI.getPage(params);
},
deleteAction: UserAPI.deleteByIds,
importAction(file) {
return UserAPI.import(1, file);
},
exportAction: UserAPI.export,
importsTemplate: UserAPI.downloadTemplate,
importsAction(data) {
@@ -42,13 +45,8 @@ const contentConfig: IContentConfig<UserQuery> = {
toolbar: [
"add",
"delete",
"import",
"export",
{
name: "import",
icon: "upload",
text: "导入",
auth: "import",
},
{
name: "custom1",
icon: "plus",

View File

@@ -113,8 +113,8 @@ async function handleEditClick(row: IObject) {
// 其他工具栏
function handleToolbarClick(name: string) {
console.log(name);
if (name === "import") {
ElMessage.success("点击了导入按钮");
if (name === "custom1") {
ElMessage.success("点击了自定义1按钮");
}
}
// 其他操作列