// 获取控件对象 var equipControl = contentPane.getWidgetByName('euip'); var taskCodeControl = contentPane.getWidgetByName('txttaskcode'); // 检查控件是否存在 if (equipControl && taskCodeControl) { // 获取设备编码当前值并处理 var equipValue = equipControl.getValue() || ''; equipValue = equipValue.toString().trim(); // 同步设备编码值到任务编码 taskCodeControl.setValue(equipValue); // 输出调试信息 console.log('设备编码值变更为: ', equipValue); console.log('任务编码已同步更新为: ', taskCodeControl.getValue()); } else { console.error('控件不存在 - 设备编码控件:', !!equipControl, '任务编码控件:', !!taskCodeControl); } |