测点:接口调整

量测:接口返回数据调整
This commit is contained in:
高云鹏 2024-10-25 15:46:05 +08:00
parent c371c4c5c2
commit ea4f50f775
3 changed files with 11 additions and 8 deletions

View File

@ -120,7 +120,7 @@ export const saveMappingListReq = (data: any) => {
export const bindDeviceMeasReq = (data: any) => { export const bindDeviceMeasReq = (data: any) => {
return createAxios({ return createAxios({
url: '/api/node/link/bindDeviceMeas', url: '/api/node/link/bindDevices',
method: 'post', method: 'post',
data: data, data: data,
}) })

View File

@ -155,8 +155,10 @@ const getCompleteData = () => {
return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data) return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data)
}) })
.then((realData: any) => { .then((realData: any) => {
console.log(realData);
const data = realData.list.map((item: any) => { 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 { return {
...item, ...item,
realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-', realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-',

View File

@ -334,13 +334,14 @@ const okEdit = (data: any) => {
const submitcorrectionDevice = () => { const submitcorrectionDevice = () => {
const bindDevice = correctionDevice.value.map((item: any, index) => { const bindDevice = correctionDevice.value.map((item: any, index) => {
return { return {
equipmentId: item.id, id: item.id,
iotAddr: item.iotAddr, 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('关联成功!') ElMessage.success('关联成功!')
closecorrectionDevice() closecorrectionDevice()
resetExcel() resetExcel()
@ -379,10 +380,10 @@ const getBindDeviceTree = () => {
if (res.data) { if (res.data) {
correctionDevice.value = res.data.map((item: any) => { correctionDevice.value = res.data.map((item: any) => {
return { return {
id: item.equipmentId, id: item.id,
name: item.equipmentName, name: item.name,
iotAddr: item.iotAddr, iotAddr: item.iotAddr,
porder: item.porder, iotModelId: item.iotModelId,
} }
}) })
} }