websoft-uniapp仓库模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
1.4 KiB

import type { PageResult } from '@/api';
import request from '@/utils/request';
import { ApiResult } from '@/api';
import { NnReadNum, Notice, NoticeParam } from '@/api/oa/notice/model';
/**
* 分页查询通知
*/
export async function pageNotices(params: NoticeParam) {
params.type = 'notice';
const res = await request.get<ApiResult<PageResult<Notice>>>(
'/oa/notice/page',
{ params }
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询私信
*/
export async function pageLetters(params: NoticeParam) {
params.type = 'letter';
const res = await request.get<ApiResult<PageResult<Notice>>>(
'/oa/notice/page',
{ params }
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询代办
*/
export async function pageTodos(params: NoticeParam) {
params.type = 'todo';
const res = await request.get<ApiResult<PageResult<Notice>>>(
'/oa/notice/page',
{ params }
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询未读数量
*/
export async function getUnReadNum() {
const res = await request.get<ApiResult<NnReadNum>>(
'/oa/notice/getUnReadNum'
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}