index.ts 1004 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import request from '@/utils/request';
  2. import { NoticeForm, NoticeQuery, NoticeVO } from './types';
  3. import { AxiosPromise } from 'axios';
  4. // 查询公告列表
  5. export function listNotice(query: NoticeQuery): AxiosPromise<NoticeVO[]> {
  6. return request({
  7. url: '/api/notice/list',
  8. method: 'get',
  9. params: query
  10. });
  11. }
  12. // 查询公告详细
  13. export function getNotice(noticeId: string | number): AxiosPromise<NoticeVO> {
  14. return request({
  15. url: '/system/notice/' + noticeId,
  16. method: 'get'
  17. });
  18. }
  19. // 新增公告
  20. export function addNotice(data: NoticeForm) {
  21. return request({
  22. url: '/system/notice',
  23. method: 'post',
  24. data: data
  25. });
  26. }
  27. // 修改公告
  28. export function updateNotice(data: NoticeForm) {
  29. return request({
  30. url: '/system/notice',
  31. method: 'put',
  32. data: data
  33. });
  34. }
  35. // 删除公告
  36. export function delNotice(noticeId: string | number | Array<string | number>) {
  37. return request({
  38. url: '/system/notice/' + noticeId,
  39. method: 'delete'
  40. });
  41. }