修复bug
This commit is contained in:
parent
a5781829e9
commit
a532440685
@ -172,28 +172,20 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
|
|
||||||
// 处理DeviceId,当设备类型为集中器(10)时,使用focusId
|
// 处理DeviceId,当设备类型为集中器(10)时,使用focusId
|
||||||
let finalDeviceId = formValues.DeviceId || DeviceId;
|
let finalDeviceId = formValues.DeviceId || DeviceId;
|
||||||
|
let finalFocusAddress = formValues.FocusAddress;
|
||||||
if (formValues.DeviceId) {
|
if (formValues.DeviceId) {
|
||||||
const deviceInfo = getDeviceInfoById(formValues.DeviceId);
|
const deviceInfo = getDeviceInfoById(formValues.DeviceId);
|
||||||
if (deviceInfo) {
|
if (deviceInfo) {
|
||||||
|
finalFocusAddress = deviceInfo.focusAddress;
|
||||||
if (deviceTypeNumber === 10) {
|
if (deviceTypeNumber === 10) {
|
||||||
// 集中器类型使用focusId
|
// 集中器类型使用focusId
|
||||||
if (deviceInfo.focusId) {
|
if (deviceInfo.focusId) {
|
||||||
finalDeviceId = deviceInfo.focusId;
|
finalDeviceId = deviceInfo.focusId;
|
||||||
console.log('设备类型为集中器,使用focusId:', {
|
|
||||||
originalDeviceId: formValues.DeviceId,
|
|
||||||
focusId: deviceInfo.focusId,
|
|
||||||
deviceInfo: deviceInfo,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 其他设备类型使用meterId
|
// 其他设备类型使用meterId
|
||||||
if (deviceInfo.meterId) {
|
if (deviceInfo.meterId) {
|
||||||
finalDeviceId = deviceInfo.meterId;
|
finalDeviceId = deviceInfo.meterId;
|
||||||
console.log('设备类型为非集中器,使用meterId:', {
|
|
||||||
originalDeviceId: formValues.DeviceId,
|
|
||||||
meterId: deviceInfo.meterId,
|
|
||||||
deviceInfo: deviceInfo,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,8 +197,8 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
// 优先使用表单中的值,如果没有则使用路由参数
|
// 优先使用表单中的值,如果没有则使用路由参数
|
||||||
DeviceType: deviceTypeNumber,
|
DeviceType: deviceTypeNumber,
|
||||||
DeviceId: finalDeviceId,
|
DeviceId: finalDeviceId.toString(),
|
||||||
FocusAddress: formValues.FocusAddress || FocusAddress,
|
FocusAddress: finalFocusAddress || FocusAddress,
|
||||||
// 添加其他表单参数
|
// 添加其他表单参数
|
||||||
SystemName: formValues.SystemName || SystemName,
|
SystemName: formValues.SystemName || SystemName,
|
||||||
IoTDataType: ioTDataTypeValue,
|
IoTDataType: ioTDataTypeValue,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user