| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- function editRow(orgin_data,threshold,index,channel_power_infro) {
- const current_upper = document.getElementById('current_upper');
- const voltage_upper = document.getElementById('voltage_upper');
- const voltage_lower = document.getElementById('voltage_lower');
- const p_upper = document.getElementById('p_upper');
- const c_upper = document.getElementById('c_upper');
- const updateRow = document.getElementById('updateRow')
- const closeModal = document.getElementById('closeModal')
-
- current_upper.value = threshold.c_upper.act_para[index];
- voltage_upper.value = threshold.v_upper.act_para[index];
- voltage_lower.value = threshold.v_lower.act_para[index];
- if(voltage_upper.value < voltage_lower.value){
- alert("电压上限值不能小于电压下限值")
- voltage_lower.value = 0
- }
- p_upper.value = threshold.p_upper.act_para[index];
- c_upper.value = threshold.w_upper.act_para[index];
-
- document.getElementById('editModal').style.display = 'block';
- updateRow.addEventListener('click',function(){
- const current_uppers = document.getElementById('current_upper').value;
- const voltage_uppers = document.getElementById('voltage_upper').value;
- const voltage_lowers = document.getElementById('voltage_lower').value;
- const p_uppers = document.getElementById('p_upper').value;
- const c_uppers = document.getElementById('c_upper').value;
- if(voltage_uppers >= voltage_lowers)
- {
- threshold.c_upper.act_para[index] = Number(current_uppers);
- threshold.v_upper.act_para[index] = Number(voltage_uppers);
- threshold.v_lower.act_para[index] = Number(voltage_lowers);
- threshold.p_upper.act_para[index] = Number(p_uppers);
- threshold.w_upper.act_para[index] = Number(c_uppers);
- channel_power_infro.thr = threshold
- orgin_data.powerc = channel_power_infro
- threshold_update(orgin_data)
- }else
- {
- alert("电压上限值不能小于下限值")
- voltage_upper.value = 0
- voltage_lower.value = 0
- }
- });
- closeModal.addEventListener('click',function(){
- document.getElementById('editModal').style.display = 'none';
- currentRowIndex = null;
- });
- }
|