初始化
This commit is contained in:
106
api/oa/oaTaskCount/index.ts
Normal file
106
api/oa/oaTaskCount/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OaTaskCount, OaTaskCountParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config';
|
||||
|
||||
/**
|
||||
* 分页查询数据统计
|
||||
*/
|
||||
export async function pageOaTaskCount(params: OaTaskCountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OaTaskCount>>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据统计列表
|
||||
*/
|
||||
export async function listOaTaskCount(params?: OaTaskCountParam) {
|
||||
const res = await request.get<ApiResult<OaTaskCount[]>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据统计
|
||||
*/
|
||||
export async function addOaTaskCount(data: OaTaskCount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据统计
|
||||
*/
|
||||
export async function updateOaTaskCount(data: OaTaskCount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据统计
|
||||
*/
|
||||
export async function removeOaTaskCount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数据统计
|
||||
*/
|
||||
export async function removeBatchOaTaskCount(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询数据统计
|
||||
*/
|
||||
export async function getOaTaskCount(id: number) {
|
||||
const res = await request.get<ApiResult<OaTaskCount>>(
|
||||
MODULES_API_URL + '/oa/oa-task-count/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
api/oa/oaTaskCount/model/index.ts
Normal file
45
api/oa/oaTaskCount/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 数据统计
|
||||
*/
|
||||
export interface OaTaskCount {
|
||||
// 自增ID
|
||||
taskCountId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 待处理数
|
||||
pending?: number;
|
||||
// 闲置的工单(废弃)
|
||||
unused?: number;
|
||||
// 已完成数(废弃)
|
||||
completed?: number;
|
||||
// 今天处理数
|
||||
today?: number;
|
||||
// 本月处理数
|
||||
month?: number;
|
||||
// 今年处理数
|
||||
year?: number;
|
||||
// 总工单数
|
||||
total?: number;
|
||||
// 部门ID
|
||||
organizationId?: number;
|
||||
// 角色ID
|
||||
roleId?: number;
|
||||
// 角色标识
|
||||
roleCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据统计搜索条件
|
||||
*/
|
||||
export interface OaTaskCountParam extends PageParam {
|
||||
taskCountId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user