测点:接口调整
量测:接口返回数据调整
This commit is contained in:
parent
c371c4c5c2
commit
ea4f50f775
@ -120,7 +120,7 @@ export const saveMappingListReq = (data: any) => {
|
||||
|
||||
export const bindDeviceMeasReq = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/api/node/link/bindDeviceMeas',
|
||||
url: '/api/node/link/bindDevices',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
|
@ -155,8 +155,10 @@ const getCompleteData = () => {
|
||||
return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data)
|
||||
})
|
||||
.then((realData: any) => {
|
||||
console.log(realData);
|
||||
|
||||
const data = realData.list.map((item: any) => {
|
||||
const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode]
|
||||
const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode?.toLowerCase()]
|
||||
return {
|
||||
...item,
|
||||
realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-',
|
||||
|
@ -334,13 +334,14 @@ const okEdit = (data: any) => {
|
||||
const submitcorrectionDevice = () => {
|
||||
const bindDevice = correctionDevice.value.map((item: any, index) => {
|
||||
return {
|
||||
equipmentId: item.id,
|
||||
id: item.id,
|
||||
iotAddr: item.iotAddr,
|
||||
porder: index + 1,
|
||||
name: item.name,
|
||||
iotModelId: item.iotModelId,
|
||||
}
|
||||
})
|
||||
|
||||
bindDeviceMeasReq({ equipmentId: bindDevice, linkId: route.query.id }).then((res) => {
|
||||
bindDeviceMeasReq({ equipmentList: bindDevice, linkId: route.query.id }).then((res) => {
|
||||
ElMessage.success('关联成功!')
|
||||
closecorrectionDevice()
|
||||
resetExcel()
|
||||
@ -379,10 +380,10 @@ const getBindDeviceTree = () => {
|
||||
if (res.data) {
|
||||
correctionDevice.value = res.data.map((item: any) => {
|
||||
return {
|
||||
id: item.equipmentId,
|
||||
name: item.equipmentName,
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
iotAddr: item.iotAddr,
|
||||
porder: item.porder,
|
||||
iotModelId: item.iotModelId,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user