// 获取初始的列表数据----获取串口id async function GetSerID() { const SerIDList = await api.GetSerialId(); const { data: res } = SerIDList; const result = res.port_thruput.split(",").reduce((acc, curr, index, array) => { if (index % 3 === 0) { const [portId, rate, thruput] = array.slice(index, index + 3); const formattedPortId = parseInt(portId).toString(16).padStart(2, '0'); if (formattedPortId >= '01' && formattedPortId value !== 0) .map(([key, value]) => ({ key, value })); let formatted = filteredData.map(({ key, value }) => `${key.replace('_FREQ', '').toUpperCase()}/${value}`); // 将得到的报文/频率字段合并到之前的表格数据中 SerialForm.tableData = SerialForm.tableData.map(item => { if (item.portId === portId) { return { ...item, formattedFrequency: formatted.join('; ') }; } return item; }); }