|
@@ -120,14 +120,35 @@ |
|
@@ -120,14 +120,35 @@ |
120
|
columns: [
|
120
|
columns: [
|
121
|
{
|
121
|
{
|
122
|
title: "ip",
|
122
|
title: "ip",
|
123
|
- width: "100px",
|
123
|
+ width: "20%",
|
124
|
field: "ip"
|
124
|
field: "ip"
|
125
|
},
|
125
|
},
|
126
|
{
|
126
|
{
|
127
|
title: "reason",
|
127
|
title: "reason",
|
128
|
- width: "120px",
|
128
|
+ width: "60%",
|
129
|
field: "reason",
|
129
|
field: "reason",
|
130
|
- // align: "left",
|
130
|
+ align: "left",
|
|
|
131
|
+ formatter:function(value,rowData,rowIndex){
|
|
|
132
|
+ var allReasonDiv = "<div name='allReasonDiv' style='display:none'><a onclick='showResons(this)' style='color:#333;cursor:pointer' value='true' >";
|
|
|
133
|
+ allReasonDiv +=value;
|
|
|
134
|
+ allReasonDiv +="</a></div>";
|
|
|
135
|
+
|
|
|
136
|
+ var simpleReasonDiv = "<div name='simpleReasonDiv'>";
|
|
|
137
|
+ if(value != null && value.length > 0){
|
|
|
138
|
+ simpleReasonDiv += "<a onclick='showResons(this)' style='color:#333;cursor:pointer' value='true' >";
|
|
|
139
|
+ var str_array=value.split("<br>");
|
|
|
140
|
+ for (var i = 0; i < str_array.length; i ++){
|
|
|
141
|
+ if(i <=2 ){
|
|
|
142
|
+ simpleReasonDiv = simpleReasonDiv + str_array[i] + "; ";
|
|
|
143
|
+ }
|
|
|
144
|
+ }
|
|
|
145
|
+ simpleReasonDiv+="......</a>";
|
|
|
146
|
+ }
|
|
|
147
|
+ simpleReasonDiv += "</div>";
|
|
|
148
|
+
|
|
|
149
|
+
|
|
|
150
|
+ return simpleReasonDiv + allReasonDiv;
|
|
|
151
|
+ },
|
131
|
styler : function(value, rowData, rowIndex){
|
152
|
styler : function(value, rowData, rowIndex){
|
132
|
return {
|
153
|
return {
|
133
|
"vertical-align" : "middle"
|
154
|
"vertical-align" : "middle"
|
|
@@ -137,7 +158,7 @@ |
|
@@ -137,7 +158,7 @@ |
137
|
{
|
158
|
{
|
138
|
title: "时间",
|
159
|
title: "时间",
|
139
|
field: "createTime",
|
160
|
field: "createTime",
|
140
|
- width: "80px",
|
161
|
+ width: "20%",
|
141
|
formatter:function (value,rowData,rowIndex) {
|
162
|
formatter:function (value,rowData,rowIndex) {
|
142
|
if(value !=null && value!=""){
|
163
|
if(value !=null && value!=""){
|
143
|
return format(value);
|
164
|
return format(value);
|
|
@@ -150,6 +171,31 @@ |
|
@@ -150,6 +171,31 @@ |
150
|
});
|
171
|
});
|
151
|
}
|
172
|
}
|
152
|
|
173
|
|
|
|
174
|
+ function showResons(elememt){
|
|
|
175
|
+ var that = elememt;
|
|
|
176
|
+ var btnText = $(that).attr("value");
|
|
|
177
|
+ if("true" == btnText){
|
|
|
178
|
+ var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
|
|
|
179
|
+ $(this).hide();//隐藏当前显示的(仅两个ip)
|
|
|
180
|
+ });
|
|
|
181
|
+ var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
|
|
|
182
|
+ $(this).show();//显示所有的ips
|
|
|
183
|
+ });
|
|
|
184
|
+ $(that).attr("value","false");
|
|
|
185
|
+// $(that).text("隐藏详情");
|
|
|
186
|
+
|
|
|
187
|
+ }else{
|
|
|
188
|
+ var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
|
|
|
189
|
+ $(this).show();//隐藏当前显示的(仅两个ip)
|
|
|
190
|
+ });
|
|
|
191
|
+ var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
|
|
|
192
|
+ $(this).hide();//显示所有的ips
|
|
|
193
|
+ });
|
|
|
194
|
+ $(that).attr("value","true");
|
|
|
195
|
+// $(that).text("显示详情");
|
|
|
196
|
+ }
|
|
|
197
|
+ }
|
|
|
198
|
+
|
153
|
//timeValue---时间戳
|
199
|
//timeValue---时间戳
|
154
|
function format(timeValue){
|
200
|
function format(timeValue){
|
155
|
var time = new Date(timeValue);
|
201
|
var time = new Date(timeValue);
|