Files
cashier-web/src/views/product/unitconfig/content.ts
2026-01-31 09:26:25 +08:00

72 lines
1.8 KiB
TypeScript

import UserAPI from "@/api/product/commonUnits";
import RoleAPI from "@/api/system/role";
import type { UserPageQuery } from "@/api/system/user";
import type { IContentConfig } from "@/components/CURD/types";
const contentConfig: IContentConfig<UserPageQuery> = {
pageName: "sys:user",
table: {
border: true,
highlightCurrentRow: true,
},
pagination: {
background: true,
layout: "prev,pager,next,jumper,total,sizes",
pageSize: 20,
pageSizes: [10, 20, 30, 50],
},
indexActionData: { name: "", orderBy: "" },
indexAction: function (params) {
return UserAPI.getPage(params);
},
deleteAction: UserAPI.deleteByIds,
// importAction(file) {
// return UserAPI.import(1, file);
// },
// exportAction: UserAPI.export,
// importTemplate: UserAPI.downloadTemplate,
importsAction(data) {
// 模拟导入数据
console.log("importsAction", data);
return Promise.resolve();
},
exportsAction: async function (params) {
// 模拟获取到的是全量数据
const res = await UserAPI.getPage(params);
console.log("exportsAction", res.list);
return res.list;
},
pk: "id",
toolbar: [
{
icon: "plus",
text: "新增",
type: "primary",
name: "add",
auth: "import",
},
{
icon: "Download",
text: "导出",
type: "",
name: "export",
auth: "import",
},
],
cols: [
// { type: "selection", width: 50, align: "center" },
{ label: "单位名称", align: "center", prop: "name" },
{ label: "排序", align: "center", prop: "id" },
{
label: "操作",
align: "center",
fixed: "right",
width: 280,
templet: "tool",
operat: [{ text: "编辑", icon: 'edit', name: "edit" }, { text: "删除", icon: 'delete', type: 'danger', name: "delete" }],
},
],
};
export default contentConfig;