可以正常发起请求

This commit is contained in:
ChenYi 2025-07-14 09:09:44 +08:00
parent 31c6a15aae
commit 598f0d8399
2 changed files with 12 additions and 56 deletions

View File

@ -165,61 +165,17 @@ const gridOptions: VxeGridProps<any> = {
? Number(deviceTypeValue) ? Number(deviceTypeValue)
: undefined; : undefined;
const ioTDataTypeValue = formValues.IoTDataType; const ioTDataTypeValue = formValues.IoTDataType;
const ioTDataTypeNumber = ioTDataTypeValue
? Number(ioTDataTypeValue) console.log('=== API调用开始 ===2', ioTDataTypeValue);
: undefined;
// DeviceId(10)使focusId // DeviceId(10)使focusId
let finalDeviceId = formValues.DeviceId || DeviceId; let finalDeviceId = 0;
if (deviceTypeNumber === 10 && formValues.DeviceId) { const deviceInfo = getDeviceInfoById(formValues.DeviceId);
const deviceInfo = getDeviceInfoById(formValues.DeviceId); finalDeviceId =
if (deviceInfo && deviceInfo.focusId) { deviceTypeNumber === 10 && deviceInfo
finalDeviceId = deviceInfo.focusId; ? deviceInfo.focusId
console.log('设备类型为集中器使用focusId:', { : deviceInfo.meterId;
originalDeviceId: formValues.DeviceId,
focusId: deviceInfo.focusId,
deviceInfo,
});
}
}
console.log('请求参数:', {
page,
formValues,
routeParams: { DeviceType, DeviceId, FocusAddress },
typeConversions: {
deviceType: {
originalValue: deviceTypeValue,
convertedValue: deviceTypeNumber,
type: typeof deviceTypeNumber,
},
ioTDataType: {
originalValue: ioTDataTypeValue,
convertedValue: ioTDataTypeNumber,
type: typeof ioTDataTypeNumber,
},
deviceId: {
originalValue: formValues.DeviceId || DeviceId,
finalValue: finalDeviceId,
isFocusId:
deviceTypeNumber === 10 &&
formValues.DeviceId &&
getDeviceInfoById(formValues.DeviceId)?.focusId,
},
},
finalParams: {
...formValues,
pageIndex: page.currentPage,
pageSize: page.pageSize,
DeviceType: deviceTypeNumber,
DeviceId: finalDeviceId,
FocusAddress: formValues.FocusAddress || FocusAddress,
SystemName: formValues.SystemName,
IoTDataType: ioTDataTypeNumber,
},
});
try { try {
const { data } = await postTreeModelDeviceDataInfoPage({ const { data } = await postTreeModelDeviceDataInfoPage({
body: { body: {
@ -232,7 +188,7 @@ const gridOptions: VxeGridProps<any> = {
FocusAddress: formValues.FocusAddress || FocusAddress, FocusAddress: formValues.FocusAddress || FocusAddress,
// //
SystemName: formValues.SystemName, SystemName: formValues.SystemName,
IoTDataType: ioTDataTypeNumber, IoTDataType: ioTDataTypeValue,
}, },
}); });

View File

@ -50,8 +50,8 @@ export const querySchema = computed(() => [
TypeName: 'MeterTypeEnum', TypeName: 'MeterTypeEnum',
}, },
}, },
labelField: 'secondValue', labelField: 'value',
valueField: 'value', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
afterFetch: (res: any) => { afterFetch: (res: any) => {