Commit 937b63c5 authored by 莫林毅's avatar 莫林毅

监控运营 -> 告警关联诊断 '创建&修改关联指标' 界面

1 去除 权值和为 1 功能 [权值默认都为 1] 2 隐藏 '权值' 列
parent 74f32667
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
$.dialog({ $.dialog({
title:"", title:"",
content:"<div id='paramList'>"+ content:"<div id='paramList'>"+
"<div class='col-xs-12'><div class='panel panel-default' ><div class='panel-heading' >指标列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='20%'>指标ID</th><th width='30%'>指标编码</th> <th width='30%' >指标名称</th> <th width='20%'>指标权值</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+ "<div class='col-xs-12'><div class='panel panel-default' ><div class='panel-heading' >指标列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='20%'>指标ID</th><th width='30%'>指标编码</th> <th width='30%' >指标名称</th> <th width='20%' style='display: none'>指标权值</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>", "</div>",
lock:true, lock:true,
width:700, width:700,
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
paramTbody.append($("<tr></tr>").append("<td>"+kpiId+"</td>") paramTbody.append($("<tr></tr>").append("<td>"+kpiId+"</td>")
.append("<td>"+jsonDa.code+"</td>") .append("<td>"+jsonDa.code+"</td>")
.append("<td>"+jsonDa.name+"</td>") .append("<td>"+jsonDa.name+"</td>")
.append("<td>"+kpiWeight+"</td>")); .append("<td style='display: none'>"+kpiWeight+"</td>"));
} }
}); });
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<thead> <thead>
<tr> <tr>
<th>指标名称</th> <th>指标名称</th>
<th>权重值</th> <th style="display: none">权重值</th>
<th><a href="javascript:deleteAllTr()">删除所有</a></th> <th><a href="javascript:deleteAllTr()">删除所有</a></th>
</tr> </tr>
</thead> </thead>
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr style="display:none;">
<td>权重(<font color="red">必填</font>):</td> <td>权重(<font color="red">必填</font>):</td>
<td><input type="number" step="0.01" class="form-control" name="descTd" <td><input type="number" step="0.01" class="form-control" name="descTd"
id="kpiWeightTd" value="1" style="display: inline;"/> id="kpiWeightTd" value="1" style="display: inline;"/>
...@@ -269,26 +269,13 @@ ...@@ -269,26 +269,13 @@
} }
}); });
$("input[name='provinceDetail'][value='3000']").click(function () { $("input[name='provinceDetail'][value='3000']").click(function () {
/*alert($("input[name='provinceDetail'][value='32']").text());
alert($("input[name='provinceDetail'][value='32']").html());*/
if ($("input[name='provinceDetail'][value='32']").attr("checked") == "checked") {
/*$("#provinceDetailAll").next().hide();
$("#provinceDetailAll").hide();
$("input[name='provinceDetail'][value!='32']").next().hide(); if ($("input[name='provinceDetail'][value='32']").attr("checked") == "checked") {
$("input[name='provinceDetail'][value!='32']").hide();
*/
$("#provinceDetailAll").prop("disabled", "disabled"); $("#provinceDetailAll").prop("disabled", "disabled");
$("input[name='provinceDetail'][value!='32']").prop("disabled", "disabled"); $("input[name='provinceDetail'][value!='32']").prop("disabled", "disabled");
} else { } else {
/* $("#provinceDetailAll").next().show();
$("#provinceDetailAll").show();
$("input[name='provinceDetail'][value!='32']").next().show();
$("input[name='provinceDetail'][value!='32']").show();*/
$("#provinceDetailAll").removeAttr("disabled"); $("#provinceDetailAll").removeAttr("disabled");
$("input[name='provinceDetail'][value!='32']").removeAttr("disabled"); $("input[name='provinceDetail'][value!='32']").removeAttr("disabled");
} }
...@@ -419,8 +406,8 @@ ...@@ -419,8 +406,8 @@
//删除一条参数 //删除一条参数
function deleteRow(e) { function deleteRow(e) {
var v = $(e).parent().prev().text(); var v = $(e).parent().prev().text();
sumkpiWeightTdVal = parseFloat((sumkpiWeightTdVal - parseFloat(Number(v).toFixed(2))).toFixed(2)); /*sumkpiWeightTdVal = parseFloat((sumkpiWeightTdVal - parseFloat(Number(v).toFixed(2))).toFixed(2));
$("#kpiWeightTd").val((1.00 - sumkpiWeightTdVal) === 0?'':parseFloat((1.00 - sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val((1.00 - sumkpiWeightTdVal) === 0?'':parseFloat((1.00 - sumkpiWeightTdVal).toFixed(2)));*/
var id = Number(e.title); var id = Number(e.title);
dimKpiSelected.splice($.inArray(id, dimKpiSelected), 1); dimKpiSelected.splice($.inArray(id, dimKpiSelected), 1);
$(e).parent().parent().remove(); $(e).parent().parent().remove();
...@@ -448,10 +435,10 @@ ...@@ -448,10 +435,10 @@
//form表单提交 //form表单提交
$("#modelSubmit").click(function () { $("#modelSubmit").click(function () {
if (sumkpiWeightTdVal < 1.00) { /*if (sumkpiWeightTdVal < 1.00) {
$.alert("权限总和需 为 1"); $.alert("权限总和需 为 1");
return; return;
} }*/
var anainfoShallSaveArr = getAnainfoShallSave(); var anainfoShallSaveArr = getAnainfoShallSave();
var arrDimKpiChecked = getArrDimKpiChecked(); var arrDimKpiChecked = getArrDimKpiChecked();
var provinceDetailChecked = getDetailProvinceCheckedValues(); var provinceDetailChecked = getDetailProvinceCheckedValues();
...@@ -733,7 +720,7 @@ ...@@ -733,7 +720,7 @@
return; return;
} }
var kpiWeightTdVal = $.trim($("#kpiWeightTd").val()); var kpiWeightTdVal = $.trim($("#kpiWeightTd").val());
if (kpiWeightTdVal == "" || parseFloat(Number(kpiWeightTdVal).toFixed(2)) == 0) { /*if (kpiWeightTdVal == "" || parseFloat(Number(kpiWeightTdVal).toFixed(2)) == 0) {
$.alert("权重不能为空"); $.alert("权重不能为空");
var mmm_1 = (1 - Number(sumkpiWeightTdVal)).toFixed(2); var mmm_1 = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmm_1 === '0.00'?'':parseFloat(mmm_1)); $("#kpiWeightTd").val(mmm_1 === '0.00'?'':parseFloat(mmm_1));
...@@ -756,13 +743,12 @@ ...@@ -756,13 +743,12 @@
tt += parseFloat(Number(kpiWeightTdVal).toFixed(2)); tt += parseFloat(Number(kpiWeightTdVal).toFixed(2));
} }
var k = sumkpiWeightTdVal + tt; var k = sumkpiWeightTdVal + tt;
//var k=sumkpiWeightTdVal+Number(kpiWeightTdVal);
if (k > 1.00) { if (k > 1.00) {
$.alert("权重和 超值 1"); $.alert("权重和 超值 1");
var mm = (1 - Number(sumkpiWeightTdVal)).toFixed(2); var mm = (1 - Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(parseFloat(mm)); $("#kpiWeightTd").val(parseFloat(mm));
return; return;
} }*/
// 勾选指标 的 名称 和 value // 勾选指标 的 名称 和 value
var arrDimKpiidAndNameChecked = getArrDimKpiidAndNameChecked(); var arrDimKpiidAndNameChecked = getArrDimKpiidAndNameChecked();
...@@ -770,7 +756,7 @@ ...@@ -770,7 +756,7 @@
kpiWeightTdVal=parseFloat(Number(kpiWeightTdVal).toFixed(2)); kpiWeightTdVal=parseFloat(Number(kpiWeightTdVal).toFixed(2));
for (var i = 0; i < arrDimKpiidAndNameChecked.length; i++) { for (var i = 0; i < arrDimKpiidAndNameChecked.length; i++) {
var id_name = arrDimKpiidAndNameChecked[i]; var id_name = arrDimKpiidAndNameChecked[i];
var addRow = $("<tr class='" + id_name.split("_")[0] + "_" + kpiWeightTdVal + "'><td>" + id_name.split("_")[1] + "</td><td>" + kpiWeightTdVal + "</td><td><a href='javascript:;' title='" + id_name.split("_")[0] + "' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td></tr>"); var addRow = $("<tr class='" + id_name.split("_")[0] + "_" + kpiWeightTdVal + "'><td>" + id_name.split("_")[1] + "</td><td style='display:none;'>" + kpiWeightTdVal + "</td><td><a href='javascript:;' title='" + id_name.split("_")[0] + "' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;</td></tr>");//<a href='javascript:;' onclick='updateRow(this)'>修改</a>
$("#addTr").append(addRow); $("#addTr").append(addRow);
dimKpiSelected.push(Number(id_name.split("_")[0])); dimKpiSelected.push(Number(id_name.split("_")[0]));
} }
...@@ -786,9 +772,9 @@ ...@@ -786,9 +772,9 @@
} }
}); });
sumkpiWeightTdVal += tt; /*sumkpiWeightTdVal += tt;
var maxV = parseFloat((1 - Number(sumkpiWeightTdVal)).toFixed(2)); var maxV = parseFloat((1 - Number(sumkpiWeightTdVal)).toFixed(2));
$("#kpiWeightTd").val(maxV === 0?'':parseFloat(maxV)); $("#kpiWeightTd").val(maxV === 0?'':parseFloat(maxV));*/
}); });
dimKpiSelected = new Array(); dimKpiSelected = new Array();
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<tr> <tr>
<input type="hidden" class="btn btn-default" id="modelReset2"/> <input type="hidden" class="btn btn-default" id="modelReset2"/>
<th>指标名称</th><th>权重值</th><th><a href="javascript:deleteAllTr()">删除所有</a></th> <th>指标名称</th><th style="display: none">权重值</th><th><a href="javascript:deleteAllTr()">删除所有</a></th>
</tr> </tr>
</thead> </thead>
...@@ -150,11 +150,11 @@ ...@@ -150,11 +150,11 @@
<c:forEach items="${anaInfo.items}" var="ite"> <c:forEach items="${anaInfo.items}" var="ite">
<c:if test="${ite.kpiId == dimKpi.kpiId}"> <c:if test="${ite.kpiId == dimKpi.kpiId}">
<%--<td>${ite.kpiWeight}</td>--%> <%--<td>${ite.kpiWeight}</td>--%>
<td><fmt:formatNumber type="number" value="${ite.kpiWeight}" pattern="0.00" maxFractionDigits="1"/></td> <td style="display: none"><fmt:formatNumber type="number" value="${ite.kpiWeight}" pattern="0.00" maxFractionDigits="1"/></td>
</c:if> </c:if>
</c:forEach> </c:forEach>
<td><a href='javascript:void(0);' id="deleteRow" title='${dimKpi.kpiId}' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;<a href='javascript:;' onclick='updateRow(this)'>修改</a></td> <td><a href='javascript:void(0);' id="deleteRow" title='${dimKpi.kpiId}' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;</td><%-- <a href='javascript:;' onclick='updateRow(this)'>修改</a> --%>
</tr> </tr>
</c:forEach> </c:forEach>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
</td> </td>
</tr> </tr>
<tr id="tr_id_weight"> <tr id="tr_id_weight" style="display: none">
<td>权重(<font color="red">必填</font>):</td> <td>权重(<font color="red">必填</font>):</td>
<td><input type="number" step="0.01" class="form-control" name="descTd" id="kpiWeightTd" style="display: inline;" /> <td><input type="number" step="0.01" class="form-control" name="descTd" id="kpiWeightTd" style="display: inline;" />
<span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td> <span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td>
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
// $("#kpiWeightTd").val(1-Number(sumkpiWeightTdVal)); // $("#kpiWeightTd").val(1-Number(sumkpiWeightTdVal));
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
$("#tr_id_dimkpi").show(); $("#tr_id_dimkpi").show();
$("#tr_id_weight").show(); //$("#tr_id_weight").show();
$("#addAnaInfo").show(); $("#addAnaInfo").show();
$("#modelReset").show(); $("#modelReset").show();
...@@ -353,10 +353,10 @@ ...@@ -353,10 +353,10 @@
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
var kk=parseFloat((sumkpiWeightTdVal).toFixed(2)); var kk=parseFloat((sumkpiWeightTdVal).toFixed(2));
if( kk <1.00){ /*if( kk <1.00){
$.alert("权值总和必须为1"); $.alert("权值总和必须为1");
return; return;
} }*/
var kpiId_weight=getkpiIDAndWeightShallSave(); var kpiId_weight=getkpiIDAndWeightShallSave();
var associationId = $("#associationId").val(); var associationId = $("#associationId").val();
...@@ -727,7 +727,7 @@ ...@@ -727,7 +727,7 @@
} }
id_kpiWeightTd_value=getValueBykpiWeightTd(); id_kpiWeightTd_value=getValueBykpiWeightTd();
if(parseFloat(id_kpiWeightTd_value.toFixed(2)) == 0||isNaN(id_kpiWeightTd_value)){ /*if(parseFloat(id_kpiWeightTd_value.toFixed(2)) == 0||isNaN(id_kpiWeightTd_value)){
$.alert("权值不能为空 或 0"); $.alert("权值不能为空 或 0");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)) === 0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return; return;
...@@ -738,8 +738,6 @@ ...@@ -738,8 +738,6 @@
return; return;
} }
var curm01=0.00; var curm01=0.00;
for(var jj=0;jj<arrdimKpiChecked.length;jj++){ for(var jj=0;jj<arrdimKpiChecked.length;jj++){
curm01+=Number(id_kpiWeightTd_value); curm01+=Number(id_kpiWeightTd_value);
...@@ -748,12 +746,13 @@ ...@@ -748,12 +746,13 @@
$.alert("权值总和 不能大于 1"); $.alert("权值总和 不能大于 1");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return; return;
} }*/
id_kpiWeightTd_value=parseFloat(id_kpiWeightTd_value.toFixed(2)); id_kpiWeightTd_value=parseFloat(id_kpiWeightTd_value.toFixed(2));
id_kpiWeightTd_value=1;
var kpiId_Name=getkpiid_NameOfNamedimKpiCheck(); var kpiId_Name=getkpiid_NameOfNamedimKpiCheck();
for(var i=0;i<kpiId_Name.length;i++){ for(var i=0;i<kpiId_Name.length;i++){
var id_name=kpiId_Name[i]; var id_name=kpiId_Name[i];
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>"); var addRow = $("<tr class='"+id_name.split("_")[0]+"' id='dimKpiCheck_"+id_name.split("_")[0]+"'><td>"+id_name.split("_")[1].split(" ")[0]+"</td><td style='display: none'>"+id_kpiWeightTd_value+"</td><td><a href='javascript:;' onclick='deleteRow(this)'>删除</a>&nbsp;&nbsp;</td></tr>");//<a href='javascript:;' onclick='updateRow(this)'>修改</a>
$("#addTr").append(addRow); $("#addTr").append(addRow);
$("input[name='dimKpiCheck']").each(function (e) { $("input[name='dimKpiCheck']").each(function (e) {
if ($(this).attr("checked")) { if ($(this).attr("checked")) {
...@@ -762,8 +761,8 @@ ...@@ -762,8 +761,8 @@
} }
}); });
} }
sumkpiWeightTdVal=curm01+Number(sumkpiWeightTdVal); /*sumkpiWeightTdVal=curm01+Number(sumkpiWeightTdVal);
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))===0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))===0?'':parseFloat((1-sumkpiWeightTdVal).toFixed(2)));*/
}); });
...@@ -786,6 +785,7 @@ ...@@ -786,6 +785,7 @@
var val=$("#kpiWeightTd").val(); var val=$("#kpiWeightTd").val();
return parseFloat(val); return parseFloat(val);
} }
$("#modelReset").click(function(){ $("#modelReset").click(function(){
window.location.reload(); window.location.reload();
......
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