function total_Infor(j, total_data, type) { initialTotalFormList = []; len = total_data.length let totalVoltageAll = 0.00; let totalCurrentAll = 0.00; let totalPowerAll = 0.00; let totalFrequencyAll = 0.00; let totalEnergyAll = 0.00; //显示总信息 for (let i = 0; i <= len - 1; i++) { num = i + 1 voltage = total_data[i].voltage.toFixed(2) current = total_data[i].current.toFixed(2) power = total_data[i].power power /= 10 power = power / 100.0 power = power.toFixed(3) consump = total_data[i].consump.toFixed(2) // if (consump <= 0) { // consump = 0 // } // consump = consump / 1000 // consump = consump.toFixed(3) freq = total_data[i].freq.toFixed(2) if (type == '0' || type == '1') { initialFormData.totalVoltage = voltage; // 总电压 initialFormData.totalCurrent = current; // 总电流 initialFormData.totalPower = power; // 总功率 initialFormData.totalFrequency = freq; // 总频率 initialFormData.totalEnergy = consump; // 总耗电量 initialFormData.threeType = ""; // 相序 break } else { const initialChFormData = {}; initialChFormData.totalVoltage = voltage; // 总电压 initialChFormData.totalCurrent = current; // 总电流 initialChFormData.totalPower = power; // 总功率 initialChFormData.totalFrequency = freq; // 总频率 initialChFormData.totalEnergy = consump; // 总耗电量 initialChFormData.threeType = ""; // 相序 if (Number(voltage) > totalVoltageAll) { totalVoltageAll = Number(voltage); } totalCurrentAll = totalCurrentAll + Number(current); totalPowerAll = totalPowerAll + Number(power); totalFrequencyAll = totalFrequencyAll + Number(freq); totalEnergyAll = totalEnergyAll + Number(consump); initialTotalFormList.push(initialChFormData); } } // 合并总数 initialAllFormData.totalVoltage = (totalVoltageAll*1.732).toFixed(2); // 总电压 initialAllFormData.totalCurrent = totalCurrentAll.toFixed(2); // 总电流 initialAllFormData.totalPower = totalPowerAll.toFixed(2); // 总功率 initialAllFormData.totalFrequency = totalFrequencyAll.toFixed(2); // 总频率 initialAllFormData.totalEnergy = totalEnergyAll.toFixed(2); // 总耗电量 initialAllFormData.threeType = ""; // 相序 console.log(initialAllFormData) } function Channel_Info(j_data, channel_power_infro) { channel_length = channel_power_infro.length channel_display(j_data, channel_power_infro, channel_infro) } function threshold_mannage(orgin_data, channel_power_infro) { // 获取要插入新行的DOM元素 // const dataList = document.getElementById('threshold_mannage'); // // 清空现有的列表项 // dataList.innerHTML = ''; initialYzFormList = []; channel_length = channel_power_infro.length //遍历数据数组 for (let j = 1; j < channel_length; j++) { const initialChFormData = {}; //自动生成名称列 initialChFormData.productChName = "CH" + j; //自动生成编号列 initialChFormData.productChId = j; //自动生成电流上限列 initialChFormData.currentUpperAction = channel_power_infro[j].thr.c_upper / 100.0; // 自动生成电压上限列 initialChFormData.voltageUpperAction = channel_power_infro[j].thr.v_upper / 100.0; // 自动生成电压下限列 initialChFormData.voltageDownAction = channel_power_infro[j].thr.v_lower / 100.0; // 自动生成功率上限列 val = channel_power_infro[j].thr.p_upper / 100.0 / 1000.0 initialChFormData.powerUpperAction = val.toFixed(2); // 自动生成耗电量上限列 initialChFormData.alarmContentUpperAction = channel_power_infro[j].thr.w_upper / 100.0; initialChFormData.channel_power_infro = channel_power_infro[j] initialYzFormList.push(initialChFormData); } } function now_time() { const now = new Date(); // 获取年、月、日、小时、分钟和秒 const year = now.getFullYear(); const month = now.getMonth() + 1; const day = now.getDate(); const hours = now.getHours(); const minutes = now.getMinutes(); const seconds = now.getSeconds(); formattedTime = `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day} ${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`; return formattedTime } // 三相总体状态集合 let initialTotalFormList = []; // 单项总体监控对象 let initialFormData = { }; // 三相总体监控对象 let initialAllFormData = { }; // 阈值设置集合 let initialYzFormList = []; let channel_power_infro1 = [];