bigscreenCenter.ts
2.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { defHttp } from '/@/utils/http/axios';
import type {
queryPageParams,
BigScreenCenterParams,
ConfigurationCenterInfo,
BigScreenCenterItemsModel,
BigScreenInterfaceParams,
} from './model/bigscreenCenterModel';
import { getPageData } from '../../base';
import { FileUploadResponse } from '../../oem/model';
enum API {
basicUrl = '/data_view',
UPLOAD = '/oss/upload',
//大屏公共接口
DATA_VIEW_INTERFACE = '/data_view_interface',
}
export const getPage = (params: queryPageParams) => {
return getPageData<BigScreenCenterItemsModel>(params, API.basicUrl);
};
export const saveConfigurationCenter = (params: BigScreenCenterParams) => {
return defHttp.post({
url: API.basicUrl,
data: params,
});
};
export const updateConfigurationCenter = (params: BigScreenCenterParams) => {
return defHttp.put({
url: API.basicUrl,
data: params,
});
};
export const deleteBigScreenenter = (ids: string[]) => {
return defHttp.delete({
url: API.basicUrl,
data: {
ids: ids,
},
});
};
export const saveOrUpdateBigScreenCenter = (params: ConfigurationCenterInfo, isUpdate: boolean) => {
return isUpdate ? updateConfigurationCenter(params) : saveConfigurationCenter(params);
};
export const uploadThumbnail = (file: FormData) => {
return defHttp.post<FileUploadResponse>({ url: API.UPLOAD, params: file });
};
export const bigScreenPublish = (id) => {
return defHttp.get({
url: API.basicUrl + '/publish/' + id,
});
};
export const bigScreenCancelPublish = (id) => {
return defHttp.get({
url: API.basicUrl + '/cancel_publish/' + id,
});
};
/**
* 大屏公共接口
*/
export const getDataViewInterfacePage = (params: queryPageParams) => {
return getPageData<BigScreenCenterItemsModel>(params, API.DATA_VIEW_INTERFACE);
};
export const saveDataViewInterface = (params: BigScreenInterfaceParams) => {
return defHttp.post({
url: API.DATA_VIEW_INTERFACE,
data: params,
});
};
export const updateDataViewInterface = (params: BigScreenInterfaceParams) => {
return defHttp.put({
url: API.DATA_VIEW_INTERFACE,
data: params,
});
};
export const deleteBigViewInterface = (ids: string[]) => {
return defHttp.delete({
url: API.DATA_VIEW_INTERFACE,
data: {
ids: ids,
},
});
};
export const getPublish = (id) => {
return defHttp.get({
url: API.DATA_VIEW_INTERFACE + '/publish/' + id,
});
};
export const getCancelPublish = (id) => {
return defHttp.get({
url: API.DATA_VIEW_INTERFACE + '/cancel_publish/' + id,
});
};