移除无用日志

This commit is contained in:
ChenYi 2025-07-17 14:14:04 +08:00
parent 0ce33054d8
commit 8b24e4219e
2 changed files with 4 additions and 80 deletions

View File

@ -49,27 +49,11 @@ const fetchDeviceOptions = async () => {
// ID
const getDeviceInfoById = (deviceId: string) => {
console.log('getDeviceInfoById 调用:', { deviceId, deviceOptionsLength: deviceOptions.value?.length });
if (!deviceId || !deviceOptions.value || deviceOptions.value.length === 0) {
console.log('getDeviceInfoById 返回 null - 条件不满足');
return null;
}
//
console.log('前3构:', deviceOptions.value.slice(0, 3).map(device => ({
id: device.id,
meterName: device.meterName,
meterId: device.meterId,
focusId: device.focusId,
systemName: device.systemName,
keys: Object.keys(device),
fullDevice: JSON.parse(JSON.stringify(device)) //
})));
const device = deviceOptions.value.find((device) => device.id === deviceId);
console.log('查找结果:', device);
return device;
};
@ -88,7 +72,6 @@ const getDeviceInfoFromRef = async () => {
typeof deviceSelectRef.value.getSelectedDevice === 'function'
) {
const deviceInfo = deviceSelectRef.value.getSelectedDevice();
console.log('从 ref 获取设备信息:', deviceInfo);
return deviceInfo;
}
return null;
@ -100,15 +83,9 @@ const formOptions: VbenFormProps = {
submitOnChange: false,
//
handleValuesChange: async (values, changedFields) => {
console.log('handleValuesChange 被触发:', { values, changedFields });
console.log('当前所有表单值:', values);
console.log('DeviceType:', values.DeviceType);
console.log('IoTDataType:', values.IoTDataType);
// DeviceId selectedDeviceInfo
if (changedFields.includes('DeviceId')) {
const deviceId = values.DeviceId;
console.log('DeviceId 变化:', deviceId);
if (deviceId) {
// deviceOptions
@ -123,13 +100,12 @@ const formOptions: VbenFormProps = {
device = deviceSelectRef.getSelectedDevice();
}
} catch (error) {
console.log('获取组件实例失败:', error);
//
}
}
if (device) {
selectedDeviceInfo.value = device;
console.log('handleValuesChange 更新设备信息:', device);
} else {
//
setTimeout(() => {
@ -139,11 +115,10 @@ const formOptions: VbenFormProps = {
const delayedDevice = deviceSelectRef.getSelectedDevice();
if (delayedDevice) {
selectedDeviceInfo.value = delayedDevice;
console.log('延迟获取设备信息成功:', delayedDevice);
}
}
} catch (error) {
console.log('延迟获取组件实例失败:', error);
//
}
}, 100);
}
@ -201,24 +176,15 @@ const gridOptions: VxeGridProps<any> = {
// formValuesAPI
const currentFormValues = formValues || (gridApi?.formApi ? await gridApi.formApi.getValues() : {}) || {};
console.log('查询时的 formValues:', formValues);
console.log('查询时的 currentFormValues:', currentFormValues);
//
let deviceId = currentFormValues.DeviceId || '';
let systemName = '';
const deviceType = currentFormValues.DeviceType || '';
console.log('查询参数:', { deviceId, deviceType, currentFormValues });
console.log('currentFormValues.DeviceId:', currentFormValues.DeviceId);
console.log('currentFormValues.DeviceType:', currentFormValues.DeviceType);
console.log('currentFormValues.IoTDataType:', currentFormValues.IoTDataType);
// 使
const deviceInfo = selectedDeviceInfo.value || (currentFormValues.DeviceId && deviceOptions.value.length > 0 ? getDeviceInfoById(currentFormValues.DeviceId) : null);
if (deviceInfo) {
console.log('使用设备信息:', deviceInfo);
systemName = deviceInfo.systemName || '';
// id
if (Number(deviceType) === 10) {
@ -228,8 +194,6 @@ const gridOptions: VxeGridProps<any> = {
// 使 meterId
deviceId = deviceInfo.meterId || deviceId;
}
} else {
console.log('没有找到设备信息,使用原始 deviceId:', deviceId);
}
//
@ -246,8 +210,6 @@ const gridOptions: VxeGridProps<any> = {
FocusAddress: currentFormValues.FocusAddress || '',
};
console.log('最终查询参数:', queryParams);
if (DeviceType) queryParams.DeviceType = DeviceType;
if (DeviceId) queryParams.DeviceId = DeviceId;
const { data } = await postCTWingLogInfoPage({

View File

@ -49,27 +49,11 @@ const fetchDeviceOptions = async () => {
// ID
const getDeviceInfoById = (deviceId: string) => {
console.log('getDeviceInfoById 调用:', { deviceId, deviceOptionsLength: deviceOptions.value?.length });
if (!deviceId || !deviceOptions.value || deviceOptions.value.length === 0) {
console.log('getDeviceInfoById 返回 null - 条件不满足');
return null;
}
//
console.log('前3构:', deviceOptions.value.slice(0, 3).map(device => ({
id: device.id,
meterName: device.meterName,
meterId: device.meterId,
focusId: device.focusId,
systemName: device.systemName,
keys: Object.keys(device),
fullDevice: JSON.parse(JSON.stringify(device)) //
})));
const device = deviceOptions.value.find((device) => device.id === deviceId);
console.log('查找结果:', device);
return device;
};
@ -87,7 +71,6 @@ const getDeviceInfoFromRef = async () => {
typeof deviceSelectRef.value.getSelectedDevice === 'function'
) {
const deviceInfo = deviceSelectRef.value.getSelectedDevice();
console.log('从 ref 获取设备信息:', deviceInfo);
return deviceInfo;
}
return null;
@ -99,15 +82,9 @@ const formOptions: VbenFormProps = {
submitOnChange: false,
//
handleValuesChange: async (values, changedFields) => {
console.log('handleValuesChange 被触发:', { values, changedFields });
console.log('当前所有表单值:', values);
console.log('DeviceType:', values.DeviceType);
console.log('IoTDataType:', values.IoTDataType);
// DeviceId selectedDeviceInfo
if (changedFields.includes('DeviceId')) {
const deviceId = values.DeviceId;
console.log('DeviceId 变化:', deviceId);
if (deviceId) {
// deviceOptions
@ -122,13 +99,12 @@ const formOptions: VbenFormProps = {
device = deviceSelectRef.getSelectedDevice();
}
} catch (error) {
console.log('获取组件实例失败:', error);
//
}
}
if (device) {
selectedDeviceInfo.value = device;
console.log('handleValuesChange 更新设备信息:', device);
} else {
//
setTimeout(() => {
@ -138,11 +114,10 @@ const formOptions: VbenFormProps = {
const delayedDevice = deviceSelectRef.getSelectedDevice();
if (delayedDevice) {
selectedDeviceInfo.value = delayedDevice;
console.log('延迟获取设备信息成功:', delayedDevice);
}
}
} catch (error) {
console.log('延迟获取组件实例失败:', error);
//
}
}, 100);
}
@ -200,24 +175,15 @@ const gridOptions: VxeGridProps<any> = {
// formValuesAPI
const currentFormValues = formValues || (gridApi?.formApi ? await gridApi.formApi.getValues() : {}) || {};
console.log('查询时的 formValues:', formValues);
console.log('查询时的 currentFormValues:', currentFormValues);
//
let deviceId = currentFormValues.DeviceId || '';
let systemName = '';
const deviceType = currentFormValues.DeviceType || '';
console.log('查询参数:', { deviceId, deviceType, currentFormValues });
console.log('currentFormValues.DeviceId:', currentFormValues.DeviceId);
console.log('currentFormValues.DeviceType:', currentFormValues.DeviceType);
console.log('currentFormValues.IoTDataType:', currentFormValues.IoTDataType);
// 使
const deviceInfo = selectedDeviceInfo.value || (currentFormValues.DeviceId && deviceOptions.value.length > 0 ? getDeviceInfoById(currentFormValues.DeviceId) : null);
if (deviceInfo) {
console.log('使用设备信息:', deviceInfo);
systemName = deviceInfo.systemName || '';
// id
if (Number(deviceType) === 10) {
@ -227,8 +193,6 @@ const gridOptions: VxeGridProps<any> = {
// 使 meterId
deviceId = deviceInfo.meterId || deviceId;
}
} else {
console.log('没有找到设备信息,使用原始 deviceId:', deviceId);
}
//
@ -244,8 +208,6 @@ const gridOptions: VxeGridProps<any> = {
EndCreationTime: formatDate(currentFormValues.EndCreationTime),
};
console.log('最终查询参数:', queryParams);
if (DeviceType) queryParams.DeviceType = DeviceType;
if (DeviceId) queryParams.DeviceId = DeviceId;
const { data } = await postOneNETLogInfoPage({