fix: 重构通知公告页面,修复点击查询重置分页的问题

This commit is contained in:
valarchie
2023-07-13 12:14:52 +08:00
parent 7ff4936570
commit 5d81009f48
3 changed files with 116 additions and 49 deletions

View File

@@ -62,7 +62,7 @@ export const getDeptList = (data?: object) => {
export const getSystemNoticeListApi = (params?: SystemNoticeQuery) => {
return http.request<ResponseData<PageDTO<SystemNoticeDTO>>>(
"get",
"/system/notice/list",
"/system/notices",
{
params
}
@@ -71,21 +71,63 @@ export const getSystemNoticeListApi = (params?: SystemNoticeQuery) => {
/** 添加系统通知 */
export const addSystemNoticeApi = (data: SystemNoticeRequest) => {
return http.request<ResponseData<any>>("post", "/system/notice/", {
return http.request<ResponseData<void>>("post", "/system/notices", {
data
});
};
/** 修改系统通知 */
export const updateSystemNoticeApi = (data: SystemNoticeRequest) => {
return http.request<ResponseData<any>>("put", "/system/notice/", {
data
});
return http.request<ResponseData<void>>(
"put",
`/system/notices/${data.noticeId}`,
{
data
}
);
};
/** 删除系统通知 */
export const deleteSystemNoticeApi = (data: Array<number>) => {
return http.request<ResponseData<any>>("delete", `/system/notice/${data}`, {
data
return http.request<ResponseData<void>>("delete", "/system/notices", {
params: {
// 需要将数组转换为字符串 否则Axios会将参数变成 noticeIds[0]:1 noticeIds[1]:2 这种格式,后端接收参数不成功
noticeIds: data.toString()
}
});
};
type OperationLogDTO = {
operationId: number;
businessType: number;
businessTypeStr: string;
requestMethod: string;
requestModule: string;
requestUrl: string;
calledMethod: string;
operatorType: number;
operatorTypeStr: string;
userId: number;
username: string;
operatorIp: string;
operatorLocation: string;
deptId: number;
deptName: string;
operationParam: string;
operationResult: string;
status: number;
statusStr: string;
errorStack: string;
operationTime: Date;
};
/** 获取操作日志列表 */
export const getOperationLogListApi = (params?: SystemNoticeQuery) => {
return http.request<ResponseData<PageDTO<OperationLogDTO>>>(
"get",
"/operationLog/list",
{
params
}
);
};