deviceConfigApi.ts
2.23 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
import { defHttp } from '/@/utils/http/axios';
import {
TDeviceConfigParams,
IDeviceConfigAddOrEditModel,
} from '/@/api/device/model/deviceConfigModel';
enum EDeviceConfigApi {
/**
* 设备配置URL
*/
DEVICE_CONFIG_GET_PAGE = '/deviceProfile',
DEVICE_CONFIG_POST_ADD_OR_EDIT = '/deviceProfile',
DEVICE_CONFIG_GET_DETAIL = '/deviceProfile/',
DEVICE_CONFIG_DELETE = '/deviceProfile',
DEVICE_CONFIG_GET_RULECHAIN = '/rulechain/me/list',
ALARM_CONTACT_GET_PAGE = '/alarmContact',
DEVICE_CONFIG_EXPORT = '/deviceProfile/export',
DEVICE_CONFIG_IMPORT = '/deviceProfile/import',
}
/**
* 设备配置详情
*/
export const deviceConfigGetDetail = (id: string) => {
return defHttp.get({
url: `${EDeviceConfigApi.DEVICE_CONFIG_GET_DETAIL}${id}`,
});
};
/**
* 获取规则链
*/
export const deviceConfigGetRuleChain = (params: {}) => {
return defHttp.get({
url: EDeviceConfigApi.DEVICE_CONFIG_GET_RULECHAIN,
params,
});
};
/**
* 获取告警联系人
*/
export const alarmContactGetPage = () => {
return defHttp.get({
url: `${EDeviceConfigApi.ALARM_CONTACT_GET_PAGE}?page=1&pageSize=10`,
});
};
/**
* 分页查询设备配置页面
*/
export const deviceConfigGetQuery = (params?: TDeviceConfigParams) => {
return defHttp.get({
url: EDeviceConfigApi.DEVICE_CONFIG_GET_PAGE,
params,
});
};
/**
* 新增或者编辑设备配置
*/
export const deviceConfigAddOrEdit = (params: IDeviceConfigAddOrEditModel) => {
return defHttp.post<IDeviceConfigAddOrEditModel>({
url: EDeviceConfigApi.DEVICE_CONFIG_POST_ADD_OR_EDIT,
params,
});
};
/**
* 删除设备配置
*/
export const deviceConfigDelete = (ids: string[]) => {
return defHttp.delete({
url: EDeviceConfigApi.DEVICE_CONFIG_DELETE,
data: {
ids: ids,
},
});
};
/**
* 导出设备配置
*/
export const deviceConfigExport = (params: IDeviceConfigAddOrEditModel) => {
return defHttp.post<IDeviceConfigAddOrEditModel>({
url: EDeviceConfigApi.DEVICE_CONFIG_EXPORT,
params,
});
};
/**
* 导入设备配置
*/
export const deviceConfigImport = (params: IDeviceConfigAddOrEditModel) => {
return defHttp.post<IDeviceConfigAddOrEditModel>({
url: EDeviceConfigApi.DEVICE_CONFIG_IMPORT,
params,
});
};