|
|
|
const schema = {
|
|
|
|
title: "用户",
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
userName: {
|
|
|
|
title: "用户名",
|
|
|
|
type: "string",
|
|
|
|
readOnly: true, //
|
|
|
|
showForList: true,
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
max: 64,
|
|
|
|
message: "用户名的最大长度为 64",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
password: {
|
|
|
|
title: "密码",
|
|
|
|
type: "string",
|
|
|
|
input: "password",
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
title: "姓名",
|
|
|
|
type: "string",
|
|
|
|
showForList: true,
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
phoneNumber: {
|
|
|
|
title: "电话",
|
|
|
|
type: "string",
|
|
|
|
showForList: true,
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
email: {
|
|
|
|
title: "邮箱",
|
|
|
|
type: "string",
|
|
|
|
showForList: true,
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
roleNames: {
|
|
|
|
title: "角色",
|
|
|
|
type: "array",
|
|
|
|
input: "select",
|
|
|
|
multiple: true,
|
|
|
|
url: "identity/roles/all",
|
|
|
|
value: "name",
|
|
|
|
label: "name",
|
|
|
|
items: {
|
|
|
|
type: "string",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const url = "base/user";
|
|
|
|
const createUrl = url;
|
|
|
|
const updateUrl = url;
|
|
|
|
const deleteUrl = "api/identity/users";
|
|
|
|
const method = "get";
|
|
|
|
const createMethod = "post";
|
|
|
|
const updateMethod = "put";
|
|
|
|
const deleteMethod = "delete";
|
|
|
|
|
|
|
|
export default function () {
|
|
|
|
return {
|
|
|
|
query: {
|
|
|
|
url,
|
|
|
|
method,
|
|
|
|
schema: {
|
|
|
|
title: "用户",
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
filter: {
|
|
|
|
title: "用户名",
|
|
|
|
type: "string",
|
|
|
|
},
|
|
|
|
skipCount: {
|
|
|
|
hidden: true,
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
maxResultCount: {
|
|
|
|
hidden: true,
|
|
|
|
default: 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
table: {
|
|
|
|
schema: schema,
|
|
|
|
selectable: (o) => o.name !== "admin",
|
|
|
|
},
|
|
|
|
edit: {
|
|
|
|
createUrl,
|
|
|
|
updateUrl,
|
|
|
|
deleteUrl,
|
|
|
|
createMethod,
|
|
|
|
updateMethod,
|
|
|
|
deleteMethod,
|
|
|
|
schema: schema,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|