109 lines
3.7 KiB
JavaScript
109 lines
3.7 KiB
JavaScript
import axios from 'axios'
|
|
// if (process.env.NODE_ENV === 'development') {
|
|
// axios.defaults.baseURL = '/api'
|
|
// } else if (process.env.NODE_ENV === 'production') {
|
|
// axios.defaults.baseURL = '/api'
|
|
// }
|
|
// 设置请求头参数 common 为设置所有的接口 post为设置post请求的接口
|
|
// axios.defaults.headers.common['Authorization'] = `Bearer ${localStorage.getItem('access_token')}`;
|
|
|
|
//根据等级获取报警数据
|
|
export const GetLevelAlarm = (params) => {
|
|
return axios.get('aps/GetLevelAlarm', {
|
|
params,
|
|
// timeout:5000
|
|
})
|
|
};
|
|
//获取昨天、今天报警数量
|
|
export const getSecurityAlarmCount = (params) => {
|
|
return axios.get('aps/GetSecurityAlarmCount', {
|
|
params,
|
|
// timeout:5000
|
|
})
|
|
};
|
|
//获取报警统计接口
|
|
export const getAlarmStatistics = (params) => {
|
|
return axios.get('aps/GetAlarmStatistics', {
|
|
params,
|
|
// timeout:5000
|
|
})
|
|
};
|
|
// 获取建筑信息接口
|
|
export const getBuildinginfos = (params) => {
|
|
return axios.get('ecs-server/services/getBuildinginfos', {
|
|
params,
|
|
// timeout:5000
|
|
})
|
|
};
|
|
// 获取分项用能信息接口
|
|
export const getSubitemList = (data) => {
|
|
return axios.post('ecs-server/services/ecm/subitemList',
|
|
data,
|
|
)
|
|
};
|
|
// 获取所有设备信息
|
|
export const getAllDevices = (params) => {
|
|
return axios.get('ecs-server/services/getAllDevices', {
|
|
params,
|
|
// timeout:5000
|
|
})
|
|
};
|
|
// 获取设备实时数据信息
|
|
export const getRealData = (data) => {
|
|
return axios.post('ecs-server/services/getRealData',
|
|
data,
|
|
)
|
|
};
|
|
// 获取区域用能数据信息
|
|
export const getAreaList = (data) => {
|
|
return axios.post('ecs-server/services/ecm/areaList',
|
|
data
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
//运维模块获取登录token账号
|
|
export const getToken = (data) => {
|
|
return axios.post('api/login/api-login',
|
|
data
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
//获取运维列表数据
|
|
export const getRecordlist = (data) => {
|
|
let token = JSON.parse(sessionStorage.getItem("token"))
|
|
// axios.defaults.headers.common['Blade-Auth'] = token
|
|
return axios.post('api/order-record/list',
|
|
data, {headers:{'Content-Type':'appliction/json','Authorization':'Bearer '+token}}
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
//获取运维左侧数据
|
|
//报警数量
|
|
export const getAlarmData = (data) => {
|
|
let token = JSON.parse(sessionStorage.getItem("token"))
|
|
// axios.defaults.headers.common['Blade-Auth'] = token
|
|
return axios.post('api/maps/alarm-count-by-date',
|
|
data, {headers:{'Content-Type':'appliction/json','Authorization':'Bearer '+token}}
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
//巡检工单数量
|
|
export const getCheckData = (data) => {
|
|
let token = JSON.parse(sessionStorage.getItem("token"))
|
|
// axios.defaults.headers.common['Blade-Auth'] = token
|
|
return axios.post('api/maps/check-count-by-date',
|
|
data, {headers:{'Content-Type':'appliction/json','Authorization':'Bearer '+token}}
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
//获取处理人数据
|
|
export const getUser = (data) => {
|
|
let token = JSON.parse(sessionStorage.getItem("token"))
|
|
// axios.defaults.headers.common['Blade-Auth'] = token
|
|
return axios.post('api/user/list',
|
|
data, {headers:{'Content-Type':'appliction/json','Authorization':'Bearer '+token}}
|
|
// headers:{'Content-Type':'application/json;charset=utf-8'}
|
|
)
|
|
};
|
|
|