修改分页失效的问题
This commit is contained in:
parent
edc6241d7d
commit
d55e939e84
@ -219,20 +219,22 @@ const gridOptions: VxeGridProps<any> = {
|
||||
if (!page) {
|
||||
return { items: [], totalCount: 0 };
|
||||
}
|
||||
// 获取当前表单值,如果formValues为空则从表单API获取
|
||||
const currentFormValues = formValues || (gridApi?.formApi ? await gridApi.formApi.getValues() : {}) || {};
|
||||
// 处理DeviceType和IoTDataType,确保传递数字类型
|
||||
const deviceTypeValue = formValues.DeviceType || DeviceType;
|
||||
const deviceTypeValue = currentFormValues.DeviceType || DeviceType;
|
||||
const deviceTypeNumber = deviceTypeValue
|
||||
? Number(deviceTypeValue)
|
||||
: undefined;
|
||||
|
||||
const ioTDataTypeValue = formValues.IoTDataType;
|
||||
const ioTDataTypeValue = currentFormValues.IoTDataType;
|
||||
|
||||
// 处理DeviceId,当设备类型为集中器(10)时,使用focusId
|
||||
let finalDeviceId = formValues.DeviceId || DeviceId || '';
|
||||
let finalFocusAddress = formValues.FocusAddress || '';
|
||||
let finalDeviceId = currentFormValues.DeviceId || DeviceId || '';
|
||||
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) {
|
||||
finalFocusAddress = deviceInfo.focusAddress || '';
|
||||
@ -259,7 +261,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
DeviceId: finalDeviceId ? finalDeviceId.toString() : '',
|
||||
FocusAddress: finalFocusAddress || FocusAddress || '',
|
||||
// 添加其他表单参数
|
||||
SystemName: formValues.SystemName || SystemName || '',
|
||||
SystemName: currentFormValues.SystemName || SystemName || '',
|
||||
IoTDataType: ioTDataTypeValue || undefined,
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user