86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame] | 1 | import { request } from '@umijs/max'; |
| 2 | import { downLoadXlsx } from '@/utils/downloadfile'; |
| 3 | |
| 4 | // 查询操作日志记录列表 |
| 5 | export async function getOperlogList(params?: API.Monitor.OperlogListParams) { |
| 6 | return request<API.Monitor.OperlogPageResult>('/api/monitor/operlog/list', { |
| 7 | method: 'GET', |
| 8 | headers: { |
| 9 | 'Content-Type': 'application/json;charset=UTF-8', |
| 10 | }, |
| 11 | params |
| 12 | }); |
| 13 | } |
| 14 | |
| 15 | // 查询操作日志记录详细 |
| 16 | export function getOperlog(operId: number) { |
| 17 | return request<API.Monitor.OperlogInfoResult>(`/api/monitor/operlog/${operId}`, { |
| 18 | method: 'GET' |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | // 新增操作日志记录 |
| 23 | export async function addOperlog(params: API.Monitor.Operlog) { |
| 24 | return request<API.Result>('/api/monitor/operlog', { |
| 25 | method: 'POST', |
| 26 | headers: { |
| 27 | 'Content-Type': 'application/json;charset=UTF-8', |
| 28 | }, |
| 29 | data: params |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | // 修改操作日志记录 |
| 34 | export async function updateOperlog(params: API.Monitor.Operlog) { |
| 35 | return request<API.Result>('/api/monitor/operlog', { |
| 36 | method: 'PUT', |
| 37 | headers: { |
| 38 | 'Content-Type': 'application/json;charset=UTF-8', |
| 39 | }, |
| 40 | data: params |
| 41 | }); |
| 42 | } |
| 43 | |
| 44 | // 删除操作日志记录 |
| 45 | export async function removeOperlog(ids: string) { |
| 46 | return request<API.Result>(`/api/monitor/operlog/${ids}`, { |
| 47 | method: 'DELETE' |
| 48 | }); |
| 49 | } |
| 50 | |
| 51 | export async function cleanAllOperlog() { |
| 52 | return request<API.Result>(`/api/monitor/operlog/clean`, { |
| 53 | method: 'DELETE' |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | // 导出操作日志记录 |
| 58 | export function exportOperlog(params?: API.Monitor.OperlogListParams) { |
| 59 | return downLoadXlsx(`/api/monitor/operlog/export`, { params }, `operlog_${new Date().getTime()}.xlsx`); |
| 60 | } |