|
@@ -5,38 +5,31 @@ import { auth } from '/@/utils/authFunction';
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
return await api.GetList(query);
|
|
return await api.GetList(query);
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
const getDetail = async ({ row }: InfoReq) => {
|
|
const getDetail = async ({ row }: InfoReq) => {
|
|
return await api.GetObj(row.id);
|
|
return await api.GetObj(row.id);
|
|
};
|
|
};
|
|
|
|
|
|
- // const editRequest = async ({ form, row }: EditReq) => {
|
|
|
|
- // form.id = row.id;
|
|
|
|
- // return await api.UpdateObj(form);
|
|
|
|
- // };
|
|
|
|
- // const delRequest = async ({ row }: DelReq) => {
|
|
|
|
- // return await api.DelObj(row.id);
|
|
|
|
- // };
|
|
|
|
|
|
+ const editRequest = async ({ form, row }: EditReq) => {
|
|
|
|
+ form.id = row.id;
|
|
|
|
+ return await api.UpdateObj(form);
|
|
|
|
+ };
|
|
|
|
+ const delRequest = async ({ row }: DelReq) => {
|
|
|
|
+ return await api.DelObj(row.id);
|
|
|
|
+ };
|
|
const addRequest = async ({ form }: AddReq) => {
|
|
const addRequest = async ({ form }: AddReq) => {
|
|
return await api.AddObj(form);
|
|
return await api.AddObj(form);
|
|
};
|
|
};
|
|
|
|
|
|
- /**
|
|
|
|
- * 懒加载
|
|
|
|
- * @param row
|
|
|
|
- * @returns {Promise<unknown>}
|
|
|
|
- */
|
|
|
|
- // const loadContentMethod = (tree: any, treeNode: any, resolve: Function) => {
|
|
|
|
- // pageRequest({ pcode: tree.code }).then((res: APIResponseData) => {
|
|
|
|
- // resolve(res.data);
|
|
|
|
- // });
|
|
|
|
- // };
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
crudOptions: {
|
|
crudOptions: {
|
|
request: {
|
|
request: {
|
|
pageRequest,
|
|
pageRequest,
|
|
|
|
+ editRequest,
|
|
|
|
+ delRequest,
|
|
addRequest,
|
|
addRequest,
|
|
getDetail,
|
|
getDetail,
|
|
},
|
|
},
|
|
@@ -92,6 +85,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写昵称' },
|
|
component: { placeholder: '请填写昵称' },
|
|
rules: [{ required: true, message: '请填写昵称' }],
|
|
rules: [{ required: true, message: '请填写昵称' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
name: {
|
|
name: {
|
|
title: '名称',
|
|
title: '名称',
|
|
@@ -124,6 +120,12 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写密码' },
|
|
component: { placeholder: '请填写密码' },
|
|
rules: [{ required: true, message: '请填写密码' }],
|
|
rules: [{ required: true, message: '请填写密码' }],
|
|
},
|
|
},
|
|
|
|
+ editForm:{
|
|
|
|
+ show:false,
|
|
|
|
+ },
|
|
|
|
+ viewForm:{
|
|
|
|
+ show:false,
|
|
|
|
+ }
|
|
},
|
|
},
|
|
email:{
|
|
email:{
|
|
title: '邮箱',
|
|
title: '邮箱',
|
|
@@ -136,6 +138,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写邮箱' },
|
|
component: { placeholder: '请填写邮箱' },
|
|
rules: [{ required: false, message: '请填写邮箱' }],
|
|
rules: [{ required: false, message: '请填写邮箱' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mobile:{
|
|
mobile:{
|
|
title: '手机号',
|
|
title: '手机号',
|
|
@@ -148,6 +153,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写手机号' },
|
|
component: { placeholder: '请填写手机号' },
|
|
rules: [{ required: true, message: '请填写手机号' }],
|
|
rules: [{ required: true, message: '请填写手机号' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
gender:{
|
|
gender:{
|
|
title: '性别',
|
|
title: '性别',
|
|
@@ -166,6 +174,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请选择性别' },
|
|
component: { placeholder: '请选择性别' },
|
|
rules: [{ required: true, message: '请选择性别' }],
|
|
rules: [{ required: true, message: '请选择性别' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
user_type:{
|
|
user_type:{
|
|
title: '用户类型',
|
|
title: '用户类型',
|
|
@@ -178,9 +189,11 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
{ label: '学生', value: 0 },
|
|
{ label: '学生', value: 0 },
|
|
{ label: '教师', value: 1 },
|
|
{ label: '教师', value: 1 },
|
|
{ label: '校外团体', value: 2 },
|
|
{ label: '校外团体', value: 2 },
|
|
|
|
+ { label: '学院领导', value: 3 },
|
|
],
|
|
],
|
|
}),
|
|
}),
|
|
form: {
|
|
form: {
|
|
|
|
+ value:1,
|
|
component: { placeholder: '请填写租户' },
|
|
component: { placeholder: '请填写租户' },
|
|
rules: [{ required: false, message: '请填写租户' }],
|
|
rules: [{ required: false, message: '请填写租户' }],
|
|
},
|
|
},
|
|
@@ -196,6 +209,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写学院' },
|
|
component: { placeholder: '请填写学院' },
|
|
rules: [{ required: false, message: '请填写学院' }],
|
|
rules: [{ required: false, message: '请填写学院' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
sub_organization:{
|
|
sub_organization:{
|
|
title: '专业',
|
|
title: '专业',
|
|
@@ -208,30 +224,39 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
component: { placeholder: '请填写专业' },
|
|
component: { placeholder: '请填写专业' },
|
|
rules: [{ required: false, message: '请填写专业' }],
|
|
rules: [{ required: false, message: '请填写专业' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
grade_or_level:{
|
|
grade_or_level:{
|
|
title: '年级',
|
|
title: '年级',
|
|
type: 'input',
|
|
type: 'input',
|
|
column: {
|
|
column: {
|
|
- show: true,
|
|
|
|
|
|
+ show: false,
|
|
minWidth: 120,
|
|
minWidth: 120,
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
component: { placeholder: '请填写年级' },
|
|
component: { placeholder: '请填写年级' },
|
|
rules: [{ required: false, message: '请填写年级' }],
|
|
rules: [{ required: false, message: '请填写年级' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
class_or_group:{
|
|
class_or_group:{
|
|
title: '班级',
|
|
title: '班级',
|
|
type: 'input',
|
|
type: 'input',
|
|
column: {
|
|
column: {
|
|
- show: true,
|
|
|
|
|
|
+ show: false,
|
|
minWidth: 120,
|
|
minWidth: 120,
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
component: { placeholder: '请填写班级' },
|
|
component: { placeholder: '请填写班级' },
|
|
rules: [{ required: false, message: '请填写班级' }],
|
|
rules: [{ required: false, message: '请填写班级' }],
|
|
},
|
|
},
|
|
|
|
+ viewForm:{
|
|
|
|
+ component: { placeholder: '' },
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|