初始版本提交
This commit is contained in:
99
src/api/system/oa/index.ts
Normal file
99
src/api/system/oa/index.ts
Normal file
@ -0,0 +1,99 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
import { ListModel, OaBasicPageParams, Params } from './model';
|
||||
|
||||
enum Api {
|
||||
Oa = '/oa/news',
|
||||
Info = '/oa/news/info',
|
||||
ChangeStatus = '/oa/news/change-status',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取(分页)
|
||||
*/
|
||||
export async function getList(params?: OaBasicPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<ListModel>(
|
||||
{
|
||||
url: Api.Oa,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除(批量删除)
|
||||
*/
|
||||
export async function deleteOa(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.delete<number>(
|
||||
{
|
||||
url: Api.Oa,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增
|
||||
*/
|
||||
export async function add(params: Params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<number>(
|
||||
{
|
||||
url: Api.Oa,
|
||||
data: params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 编辑
|
||||
*/
|
||||
export async function edit(params: Params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put<number>(
|
||||
{
|
||||
url: Api.Oa,
|
||||
data: params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取详情信息
|
||||
*/
|
||||
export async function getInfo(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 发布或者下架
|
||||
*/
|
||||
export async function changeStatus(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put<string>(
|
||||
{
|
||||
url: Api.ChangeStatus,
|
||||
data: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
34
src/api/system/oa/model/index.ts
Normal file
34
src/api/system/oa/model/index.ts
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @description: Request list interface parameters
|
||||
*/
|
||||
|
||||
import { OaType } from '/@/enums/oa';
|
||||
export interface OaBasicPageParams {
|
||||
limit: number;
|
||||
size: number;
|
||||
type: OaType;
|
||||
keyword?: string;
|
||||
}
|
||||
export interface ListModel {
|
||||
id: number;
|
||||
code: string;
|
||||
name: string;
|
||||
currentNumber: string;
|
||||
formatJson: string;
|
||||
sortCode: number;
|
||||
description: string;
|
||||
createDate: string;
|
||||
createUserName: string;
|
||||
}
|
||||
|
||||
export interface Params {
|
||||
authorName: String; //作者
|
||||
briefHead: String; //标题
|
||||
category: String; //栏目
|
||||
compileName: String; //编辑
|
||||
keyword: String; //关键字
|
||||
newsContent: String; //内容
|
||||
releaseTime: String; //发布时间
|
||||
tagWord: String; //tag词
|
||||
typeId: OaType;
|
||||
}
|
||||
Reference in New Issue
Block a user