|
@ -4,84 +4,84 @@ import { basicAction } from '@peace/utils'; |
|
|
import { ApiTable } from '$utils'; |
|
|
import { ApiTable } from '$utils'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getOrganizationsStruc (id) { |
|
|
export function getOrganizationsStruc (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'GET_ORGANIZATIONS_STRUC', |
|
|
actionType: 'GET_ORGANIZATIONS_STRUC', |
|
|
url: `${ApiTable.organizationsStruc.replace('{pepProjectId}', id)}`, |
|
|
url: `${ApiTable.organizationsStruc.replace('{pepProjectId}', id)}?token=${token}`, |
|
|
msg: { error: '获取项目下的结构物信息失败' }, |
|
|
msg: { error: '获取项目下的结构物信息失败' }, |
|
|
reducer: { name: 'organizationsStruc' } |
|
|
reducer: { name: 'organizationsStruc' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getThingsDeploy (id) { |
|
|
export function getThingsDeploy (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'GET_THINGS_DEPLOY', |
|
|
actionType: 'GET_THINGS_DEPLOY', |
|
|
url: `${ApiTable.thingsDeploy.replace('{iotaThingId}', id)}`, |
|
|
url: `${ApiTable.thingsDeploy.replace('{iotaThingId}', id)}?token=${token}`, |
|
|
msg: { error: '获取设备部署信息失败' }, |
|
|
msg: { error: '获取设备部署信息失败' }, |
|
|
reducer: { name: 'deviceList' } |
|
|
reducer: { name: 'deviceList' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getDeviceMetaDeployed (id) { |
|
|
export function getDeviceMetaDeployed (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'GET_DEVIC_META_DEPLOYED', |
|
|
actionType: 'GET_DEVIC_META_DEPLOYED', |
|
|
url: `${ApiTable.deviceMetaDeployed.replace('{iotaThingId}', id)}`, |
|
|
url: `${ApiTable.deviceMetaDeployed.replace('{iotaThingId}', id)}?token=${token}`, |
|
|
msg: { error: '获取部署设备原型失败' }, |
|
|
msg: { error: '获取部署设备原型失败' }, |
|
|
reducer: { name: 'deviceMeta' } |
|
|
reducer: { name: 'deviceMeta' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getIotaThingsLlinkStatus (id) { |
|
|
export function getIotaThingsLlinkStatus (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'GET_IOTA_ThINGS_LINK_STATUS', |
|
|
actionType: 'GET_IOTA_ThINGS_LINK_STATUS', |
|
|
url: `${ApiTable.getIotaThingsLlinkStatus.replace('{iotaThingId}', id)}`, |
|
|
url: `${ApiTable.getIotaThingsLlinkStatus.replace('{iotaThingId}', id)}?token=${token}`, |
|
|
msg: { error: '获取设备在线状态/以结构物id集体获取失败' }, |
|
|
msg: { error: '获取设备在线状态/以结构物id集体获取失败' }, |
|
|
reducer: { name: '' } |
|
|
reducer: { name: '' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
export function findDeviceMetaDeployed (id) { |
|
|
export function findDeviceMetaDeployed (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'FIND_DEVICE_META_DEPLOYED', |
|
|
actionType: 'FIND_DEVICE_META_DEPLOYED', |
|
|
url: `${ApiTable.findDeviceMetaDeployed.replace('{iotaThingId}', id)}`, |
|
|
url: `${ApiTable.findDeviceMetaDeployed.replace('{iotaThingId}', id)}?token=${token}`, |
|
|
msg: { error: '获取单个结构物的设备信息失败' }, |
|
|
msg: { error: '获取单个结构物的设备信息失败' }, |
|
|
reducer: { name: 'deviceMetaDeployed', params: { noClear: true } }, |
|
|
reducer: { name: 'deviceMetaDeployed', params: { noClear: true } }, |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function findSensorLastData (data) { |
|
|
export function findSensorLastData (data, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'post', |
|
|
type: 'post', |
|
|
data, |
|
|
data, |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'FIND_SENSOR_LAST_DATA', |
|
|
actionType: 'FIND_SENSOR_LAST_DATA', |
|
|
url: `${ApiTable.findSensorLastData}`, |
|
|
url: `${ApiTable.findSensorLastData}?token=${token}`, |
|
|
msg: { error: '原始数据查询失败' }, |
|
|
msg: { error: '原始数据查询失败' }, |
|
|
reducer: { name: 'sensorLastData' } |
|
|
reducer: { name: 'sensorLastData' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function getDevicesAlarms (deviceIds, query) { |
|
|
export function getDevicesAlarms (deviceIds, query, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'post', |
|
|
type: 'post', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
data: deviceIds, |
|
|
data: deviceIds, |
|
|
query: query, |
|
|
query: query, |
|
|
actionType: 'REQUEST_POST_DEVICES_ALARMS', |
|
|
actionType: 'REQUEST_POST_DEVICES_ALARMS', |
|
|
url: `${ApiTable.getDevicesAlarms}?state=new`, |
|
|
url: `${ApiTable.getDevicesAlarms}?state=new&token=${token}`, |
|
|
msg: { |
|
|
msg: { |
|
|
error: '获取设备告警信息失败' |
|
|
error: '获取设备告警信息失败' |
|
|
}, |
|
|
}, |
|
@ -92,13 +92,13 @@ export function getDevicesAlarms (deviceIds, query) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function findDevicesCardStatus (deviceIds) { |
|
|
export function findDevicesCardStatus (deviceIds, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'post', |
|
|
type: 'post', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
data: deviceIds, |
|
|
data: deviceIds, |
|
|
actionType: 'FIND_DEVICES_CARD_STATUS', |
|
|
actionType: 'FIND_DEVICES_CARD_STATUS', |
|
|
url: `${ApiTable.findDevicesCardStatus}`, |
|
|
url: `${ApiTable.findDevicesCardStatus}?token=${token}`, |
|
|
msg: { |
|
|
msg: { |
|
|
error: '获取物联网卡信息失败' |
|
|
error: '获取物联网卡信息失败' |
|
|
}, |
|
|
}, |
|
@ -108,25 +108,25 @@ export function findDevicesCardStatus (deviceIds) { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function getDevicesLlinkStatus (id) { |
|
|
export function getDevicesLlinkStatus (id, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
actionType: 'GET_DEVICES_LINK_STATUS', |
|
|
actionType: 'GET_DEVICES_LINK_STATUS', |
|
|
url: `${ApiTable.getDevicesLlinkStatus.replace('{deviceId}', id)}`, |
|
|
url: `${ApiTable.getDevicesLlinkStatus.replace('{deviceId}', id)}?token=${token}`, |
|
|
msg: { error: '获取设备在线状态/以设备id单个获取' }, |
|
|
msg: { error: '获取设备在线状态/以设备id单个获取' }, |
|
|
reducer: { name: '' } |
|
|
reducer: { name: '' } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function findAlarmsDevice (deviceIds, query) { |
|
|
export function findAlarmsDevice (deviceIds, query, token) { |
|
|
return dispatch => basicAction({ |
|
|
return dispatch => basicAction({ |
|
|
type: 'get', |
|
|
type: 'get', |
|
|
dispatch: dispatch, |
|
|
dispatch: dispatch, |
|
|
query: query, |
|
|
query: query, |
|
|
actionType: 'GET_FIND_ALARM_DEVICES', |
|
|
actionType: 'GET_FIND_ALARM_DEVICES', |
|
|
url: `device/${deviceIds}/alarms`, |
|
|
url: `device/${deviceIds}/alarms?token=${token}`, |
|
|
msg: { |
|
|
msg: { |
|
|
error: '获取设备告警信息失败' |
|
|
error: '获取设备告警信息失败' |
|
|
}, |
|
|
}, |
|
|