feat: ✨ 增加CURD配置化实现
This commit is contained in:
95
src/views/demo/curd/config/content.ts
Normal file
95
src/views/demo/curd/config/content.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
const contentConfig = {
|
||||
pageName: "sys:user",
|
||||
indexAction: function (data: any) {
|
||||
console.log("index", data);
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
total: 2,
|
||||
list: [
|
||||
{
|
||||
id: 2,
|
||||
username: "admin",
|
||||
nickname: "系统管理员",
|
||||
mobile: "17621210366",
|
||||
genderLabel: "男",
|
||||
avatar:
|
||||
"https://oss.youlai.tech/youlai-boot/2023/05/16/811270ef31f548af9cffc026dfc3777b.gif",
|
||||
email: null,
|
||||
status: 1,
|
||||
deptName: "有来技术",
|
||||
roleNames: "系统管理员",
|
||||
createTime: "2019-10-10",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
username: "test",
|
||||
nickname: "测试小用户",
|
||||
mobile: "17621210366",
|
||||
genderLabel: "男",
|
||||
avatar:
|
||||
"https://oss.youlai.tech/youlai-boot/2023/05/16/811270ef31f548af9cffc026dfc3777b.gif",
|
||||
email: null,
|
||||
status: 1,
|
||||
deptName: "测试部门",
|
||||
roleNames: "访问游客",
|
||||
createTime: "2021-06-05",
|
||||
},
|
||||
],
|
||||
});
|
||||
}, 800);
|
||||
});
|
||||
},
|
||||
deleteAction: function (id: string) {
|
||||
console.log("delete", id);
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve("删除成功");
|
||||
});
|
||||
},
|
||||
pk: "id",
|
||||
toolbar: [
|
||||
"refresh",
|
||||
"add",
|
||||
"delete",
|
||||
"export",
|
||||
{
|
||||
name: "upload",
|
||||
icon: "upload",
|
||||
text: "导入",
|
||||
},
|
||||
],
|
||||
cols: [
|
||||
{ type: "selection", width: 50, align: "center" },
|
||||
{ label: "编号", align: "center", prop: "id", width: 100 },
|
||||
{ label: "用户名", align: "center", prop: "username" },
|
||||
{ label: "用户昵称", align: "center", prop: "nickname", width: 120 },
|
||||
{ label: "性别", align: "center", prop: "genderLabel", width: 100 },
|
||||
{ label: "部门", align: "center", prop: "deptName", width: 120 },
|
||||
{ label: "手机号码", align: "center", prop: "mobile", width: 120 },
|
||||
{
|
||||
label: "状态",
|
||||
align: "center",
|
||||
prop: "status",
|
||||
templet: "custom",
|
||||
},
|
||||
{ label: "创建时间", align: "center", prop: "createTime", width: 180 },
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 220,
|
||||
templet: "tool",
|
||||
operat: [
|
||||
{
|
||||
name: "reset_pwd",
|
||||
auth: "reset_pwd",
|
||||
icon: "refresh-left",
|
||||
text: "重置密码",
|
||||
},
|
||||
"edit",
|
||||
"delete",
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default contentConfig;
|
||||
Reference in New Issue
Block a user