Jiarenxiang | 38dcb05 | 2025-03-13 16:40:09 +0800 | [diff] [blame^] | 1 | import { request } from '@umijs/max'; |
| 2 | import { downLoadXlsx } from '@/utils/downloadfile'; |
| 3 | |
| 4 | // 查询通知公告列表 |
| 5 | export async function getNoticeList(params?: API.System.NoticeListParams) { |
| 6 | return request<API.System.NoticePageResult>('/api/system/notice/list', { |
| 7 | method: 'GET', |
| 8 | headers: { |
| 9 | 'Content-Type': 'application/json;charset=UTF-8', |
| 10 | }, |
| 11 | params |
| 12 | }); |
| 13 | } |
| 14 | |
| 15 | // 查询通知公告详细 |
| 16 | export function getNotice(noticeId: number) { |
| 17 | return request<API.System.NoticeInfoResult>(`/api/system/notice/${noticeId}`, { |
| 18 | method: 'GET' |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | // 新增通知公告 |
| 23 | export async function addNotice(params: API.System.Notice) { |
| 24 | return request<API.Result>('/api/system/notice', { |
| 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 updateNotice(params: API.System.Notice) { |
| 35 | return request<API.Result>('/api/system/notice', { |
| 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 removeNotice(ids: string) { |
| 46 | return request<API.Result>(`/api/system/notice/${ids}`, { |
| 47 | method: 'DELETE' |
| 48 | }); |
| 49 | } |