可以正常发起请求
This commit is contained in:
parent
31c6a15aae
commit
598f0d8399
@ -166,60 +166,16 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
: 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,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -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) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user