Commit eeb2d8d1 authored by 莫林毅's avatar 莫林毅

监控运营 ->告警关联诊断 '新建指标' 界面

修改 '权值和>1'bug
parent 13a2555f
......@@ -388,6 +388,8 @@
if (pro > 0) {
if (initK >= pro) {
$(e).parent().prev()[0].innerHTML = parseFloat(pro.toFixed(2));
var clz=$(e).parent().parent().attr("class");
$(e).parent().parent()[0].setAttribute("class",clz.substring(0,clz.lastIndexOf('_')+1)+parseFloat(pro.toFixed(2)));
sumkpiWeightTdVal -= parseFloat(initK.toFixed(2));
sumkpiWeightTdVal += parseFloat(pro.toFixed(2));
var maxV = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
......@@ -397,6 +399,8 @@
var k = sumkpiWeightTdVal - initK + pro;
if (k <= 1.00) {
$(e).parent().prev()[0].innerHTML = parseFloat(pro.toFixed(2));//.toFixed(2);
var clz=$(e).parent().parent().attr("class");
$(e).parent().parent()[0].setAttribute("class",clz.substring(0,clz.lastIndexOf('_')+1)+parseFloat(pro.toFixed(2)));
sumkpiWeightTdVal -= parseFloat(initK.toFixed(2));
sumkpiWeightTdVal += parseFloat(pro.toFixed(2));
var maxV = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
......@@ -415,7 +419,7 @@
//删除一条参数
function deleteRow(e) {
var v = $(e).parent().prev().text();
sumkpiWeightTdVal = sumkpiWeightTdVal - parseFloat(Number(v).toFixed(2));
sumkpiWeightTdVal = parseFloat((sumkpiWeightTdVal - parseFloat(Number(v).toFixed(2))).toFixed(2));
$("#kpiWeightTd").val((1.00 - sumkpiWeightTdVal) === 0?'':parseFloat((1.00 - sumkpiWeightTdVal).toFixed(2)));
var id = Number(e.title);
dimKpiSelected.splice($.inArray(id, dimKpiSelected), 1);
......
......@@ -350,7 +350,7 @@
// 更新
$("#updateAnaInfo").click(function () {
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
var kk=parseFloat((sumkpiWeightTdVal).toFixed(2));
if( kk <1.00){
......@@ -704,9 +704,7 @@
var k=sumkpiWeightTdVal-initK;
k=k+pro;
if(k <= 1.00){
// $(e).parent().prev()[0].innerHTML=pro.toFixed(2);
$(e).parent().prev()[0].innerHTML=parseFloat(pro.toFixed(2));
// alert("---"+pro.toFixed(2));
sumkpiWeightTdVal-=initK;
sumkpiWeightTdVal+=pro;
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
......@@ -755,7 +753,6 @@
var kpiId_Name=getkpiid_NameOfNamedimKpiCheck();
for(var i=0;i<kpiId_Name.length;i++){
var id_name=kpiId_Name[i];
//alert("id_name "+id_name);
var addRow = $("<tr class='"+id_name.split("_")[0]+"' id='dimKpiCheck_"+id_name.split("_")[0]+"'><td>"+id_name.split("_")[1].split(" ")[0]+"</td><td>"+id_kpiWeightTd_value+"</td><td><a href='javascript:;' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>");
$("#addTr").append(addRow);
$("input[name='dimKpiCheck']").each(function (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment