reportManager.ts
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { defHttp } from '/@/utils/http/axios';
import { ReportModel, ReportQueryParam } from './model/reportModel';
enum ReportManagerApi {
  GET_REPORT_API = '/report_form/config',
  POST_REPORT_API = '/report_form/config',
  DELETE_REPORT_API = '/report_form/config',
  PUT_REPORT_API = '/report_form/config',
  PUTID_REPORT_API = '/report_form',
}
//分页
export const reportPage = (params: ReportQueryParam) => {
  return defHttp.get<ReportQueryParam>({
    url: ReportManagerApi.GET_REPORT_API,
    params,
  });
};
//删除
export const deleteReportManage = (ids: string[]) => {
  return defHttp.delete({
    url: ReportManagerApi.DELETE_REPORT_API,
    data: {
      ids: ids,
    },
  });
};
// 创建
export const createOrEditReportManage = (data) => {
  return defHttp.post<ReportModel>({
    url: ReportManagerApi.POST_REPORT_API,
    data,
  });
};
// 编辑
export const putReportConfigManage = (data) => {
  return defHttp.put<ReportModel>({
    url: ReportManagerApi.PUT_REPORT_API,
    data
  });
};
// 修改状态 id status
export const putReportByidAndStatusManage = (id, status) => {
  return defHttp.put<ReportModel>({
    url: ReportManagerApi.PUTID_REPORT_API + '/config/' + id + '/' + status,
  });
};