初始化
This commit is contained in:
106
api/oa/oaCompanyUser/index.ts
Normal file
106
api/oa/oaCompanyUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaCompanyUser, OaCompanyUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询成员管理
|
||||
*/
|
||||
export async function pageOaCompanyUser(params: OaCompanyUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaCompanyUser>>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成员管理列表
|
||||
*/
|
||||
export async function listOaCompanyUser(params?: OaCompanyUserParam) {
|
||||
const res = await request.get<ApiResult<OaCompanyUser[]>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加成员管理
|
||||
*/
|
||||
export async function addOaCompanyUser(data: OaCompanyUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成员管理
|
||||
*/
|
||||
export async function updateOaCompanyUser(data: OaCompanyUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成员管理
|
||||
*/
|
||||
export async function removeOaCompanyUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成员管理
|
||||
*/
|
||||
export async function removeBatchOaCompanyUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询成员管理
|
||||
*/
|
||||
export async function getOaCompanyUser(id: number) {
|
||||
const res = await request.get<ApiResult<OaCompanyUser>>(
|
||||
MODULES_API_URL + '/oa/oa-company-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
api/oa/oaCompanyUser/model/index.ts
Normal file
31
api/oa/oaCompanyUser/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 成员管理
|
||||
*/
|
||||
export interface OaCompanyUser {
|
||||
// 自增ID
|
||||
companyUserId?: number;
|
||||
// 角色,10体验成员 20开发者成员 30管理员
|
||||
role?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成员管理搜索条件
|
||||
*/
|
||||
export interface OaCompanyUserParam extends PageParam {
|
||||
companyUserId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user