可以正常发起请求

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

@ -166,60 +166,16 @@ const gridOptions: VxeGridProps<any> = {
: undefined;
const ioTDataTypeValue = formValues.IoTDataType;
const ioTDataTypeNumber = ioTDataTypeValue
? Number(ioTDataTypeValue)
: undefined;
console.log('=== API调用开始 ===2', ioTDataTypeValue);
// DeviceId(10)使focusId
let finalDeviceId = formValues.DeviceId || DeviceId;
if (deviceTypeNumber === 10 && formValues.DeviceId) {
let finalDeviceId = 0;
const deviceInfo = getDeviceInfoById(formValues.DeviceId);
if (deviceInfo && deviceInfo.focusId) {
finalDeviceId = deviceInfo.focusId;
console.log('设备类型为集中器使用focusId:', {
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,
},
});
finalDeviceId =
deviceTypeNumber === 10 && deviceInfo
? deviceInfo.focusId
: deviceInfo.meterId;
try {
const { data } = await postTreeModelDeviceDataInfoPage({
body: {
@ -232,7 +188,7 @@ const gridOptions: VxeGridProps<any> = {
FocusAddress: formValues.FocusAddress || FocusAddress,
//
SystemName: formValues.SystemName,
IoTDataType: ioTDataTypeNumber,
IoTDataType: ioTDataTypeValue,
},
});

View File

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