function total_Infor(j, total_data, type) { initialTotalFormList = []; len = total_data.length //显示总信息 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 = 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') { initialFormData.totalVoltage = voltage; // 总电压 initialFormData.totalCurrent = current; // 总电流 initialFormData.totalPower = power; // 总功率 initialFormData.totalFrequency = freq; // 总频率 initialFormData.totalEnergy = consump; // 总耗电量 break } else { const initialChFormData = {}; initialChFormData.totalVoltage = voltage; // 总电压 initialChFormData.totalCurrent = current; // 总电流 initialChFormData.totalPower = power; // 总功率 initialChFormData.totalFrequency = freq; // 总频率 initialChFormData.totalEnergy = consump; // 总耗电量 initialTotalFormList.push(initialChFormData); } } } 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 / 10.0; // 自动生成电压上限列 initialChFormData.voltageUpperAction = channel_power_infro[j].thr.v_upper / 10.0; // 自动生成电压下限列 initialChFormData.voltageDownAction = channel_power_infro[j].thr.v_lower / 10.0; // 自动生成功率上限列 initialChFormData.powerUpperAction = channel_power_infro[j].thr.p_upper / 1000.0; // 自动生成耗电量上限列 initialChFormData.alarmContentUpperAction = channel_power_infro[j].thr.w_upper / 1000.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 initialYzFormList = []; let channel_power_infro1 = [];