Authored by qinchao

恶意ip界面具有优化

... ... @@ -150,6 +150,27 @@
"vertical-align" : "middle"
};
},
formatter:function(value,rowData,rowIndex){
var allReasonDiv = "<div name='allReasonDiv' style='display:none'><a onclick='showResons(this)' style='cursor:pointer' value='true' >";
allReasonDiv +=value;
allReasonDiv +="</a></div>";
var simpleReasonDiv = "<div name='simpleReasonDiv'>";
if(value != null && value.length > 0){
simpleReasonDiv += "<a onclick='showResons(this)' style='color:#333;cursor:pointer' value='true' >";
var str_array=value.split("<br>");
for (var i = 0; i < str_array.length; i ++){
if(i <=2 ){
simpleReasonDiv = simpleReasonDiv + str_array[i] + ";&nbsp;&nbsp;&nbsp;";
}
}
simpleReasonDiv+="......</a>";
}
simpleReasonDiv += "</div>";
return simpleReasonDiv + allReasonDiv;
},
align: "left"
... ... @@ -187,6 +208,31 @@
});
}
function showResons(elememt){
var that = elememt;
var btnText = $(that).attr("value");
if("true" == btnText){
var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
$(this).hide();//隐藏当前显示的(仅两个ip)
});
var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
$(this).show();//显示所有的ips
});
$(that).attr("value","false");
// $(that).text("隐藏详情");
}else{
var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
$(this).show();//隐藏当前显示的(仅两个ip)
});
var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
$(this).hide();//显示所有的ips
});
$(that).attr("value","true");
// $(that).text("显示详情");
}
}
function removeMips(mip){
if(confirm("是否确定要删除如下ip:\r\n" + mip)){
$.ajax({
... ...