refactor: ♻️ 添加CURD导入示例

This commit is contained in:
cshaptx4869
2024-06-10 12:20:44 +08:00
parent 5b66c33ef1
commit 19e7bbf7cb

View File

@@ -26,9 +26,16 @@ const contentConfig: IContentConfig<UserQuery> = {
}, },
deleteAction: UserAPI.deleteByIds, deleteAction: UserAPI.deleteByIds,
exportAction: UserAPI.export, exportAction: UserAPI.export,
importsTemplate: UserAPI.downloadTemplate,
importsAction(data) {
// 模拟导入数据
console.log("importsAction", data);
return Promise.resolve();
},
exportsAction: async function (params) { exportsAction: async function (params) {
// 模拟获取全量数据 // 模拟获取到的是全量数据
const res = await UserAPI.getPage(params); const res = await UserAPI.getPage(params);
console.log("exportsAction", res.list);
return res.list; return res.list;
}, },
pk: "id", pk: "id",
@@ -43,6 +50,7 @@ const contentConfig: IContentConfig<UserQuery> = {
auth: "import", auth: "import",
}, },
], ],
defaultToolbar: ["refresh", "filter", "imports", "exports", "search"],
cols: [ cols: [
{ type: "selection", width: 50, align: "center" }, { type: "selection", width: 50, align: "center" },
{ label: "编号", align: "center", prop: "id", width: 100, show: false }, { label: "编号", align: "center", prop: "id", width: 100, show: false },