修改分页失效的问题

This commit is contained in:
ChenYi 2025-07-17 08:48:10 +08:00
parent edc6241d7d
commit d55e939e84

View File

@ -219,20 +219,22 @@ const gridOptions: VxeGridProps<any> = {
if (!page) { if (!page) {
return { items: [], totalCount: 0 }; return { items: [], totalCount: 0 };
} }
// formValuesAPI
const currentFormValues = formValues || (gridApi?.formApi ? await gridApi.formApi.getValues() : {}) || {};
// DeviceTypeIoTDataType // DeviceTypeIoTDataType
const deviceTypeValue = formValues.DeviceType || DeviceType; const deviceTypeValue = currentFormValues.DeviceType || DeviceType;
const deviceTypeNumber = deviceTypeValue const deviceTypeNumber = deviceTypeValue
? Number(deviceTypeValue) ? Number(deviceTypeValue)
: undefined; : undefined;
const ioTDataTypeValue = formValues.IoTDataType; const ioTDataTypeValue = currentFormValues.IoTDataType;
// DeviceId(10)使focusId // DeviceId(10)使focusId
let finalDeviceId = formValues.DeviceId || DeviceId || ''; let finalDeviceId = currentFormValues.DeviceId || DeviceId || '';
let finalFocusAddress = formValues.FocusAddress || ''; let finalFocusAddress = currentFormValues.FocusAddress || '';
// 使 // 使
const deviceInfo = selectedDeviceInfo.value || (formValues.DeviceId && deviceOptions.value.length > 0 ? getDeviceInfoById(formValues.DeviceId) : null); const deviceInfo = selectedDeviceInfo.value || (currentFormValues.DeviceId && deviceOptions.value.length > 0 ? getDeviceInfoById(currentFormValues.DeviceId) : null);
if (deviceInfo) { if (deviceInfo) {
finalFocusAddress = deviceInfo.focusAddress || ''; finalFocusAddress = deviceInfo.focusAddress || '';
@ -259,7 +261,7 @@ const gridOptions: VxeGridProps<any> = {
DeviceId: finalDeviceId ? finalDeviceId.toString() : '', DeviceId: finalDeviceId ? finalDeviceId.toString() : '',
FocusAddress: finalFocusAddress || FocusAddress || '', FocusAddress: finalFocusAddress || FocusAddress || '',
// //
SystemName: formValues.SystemName || SystemName || '', SystemName: currentFormValues.SystemName || SystemName || '',
IoTDataType: ioTDataTypeValue || undefined, IoTDataType: ioTDataTypeValue || undefined,
}, },
}); });