bigscreenCenter.ts
1.29 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
import { defHttp } from '/@/utils/http/axios';
import type {
queryPageParams,
BigScreenCenterParams,
ConfigurationCenterInfo,
BigScreenCenterItemsModal,
} from './model/bigscreenCenterModal';
import { getPageData } from '../../base';
import { FileUploadResponse } from '../../oem/model';
enum API {
basicUrl = '/data_view',
UPLOAD = '/oss/upload',
}
export const getPage = (params: queryPageParams) => {
return getPageData<BigScreenCenterItemsModal>(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 });
};