WmsApiLogList.jsp
12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%--
- Author(s): lty
- Date: 2024-04-02 15:33:18
- Description:
--%>
<head>
<title>
WmsApiLog查询
</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="<%= request.getContextPath() %>/common/nui/nui.js" type="text/javascript">
</script>
</head>
<body style="width:98%;height:95%;">
<div class="nui-panel" title="WmsApiLog查询" iconCls="icon-add" style="width:100%;height:15%;" showToolbar="false" showFooter="true">
<div id="form1" class="nui-form" align="center" style="height:100%">
<!-- 数据实体的名称 -->
<input class="nui-hidden" name="criteria/_entity" value="com.huaheng.wms.WmsApiLog.WmsApiLog">
<!-- 排序字段 -->
<input class="nui-hidden" name="criteria/_orderby[1]/_property" value="id">
<input class="nui-hidden" name="criteria/_orderby[1]/_sort" value="asc">
<table id="table1" class="table" style="height:100%">
<tr>
<td class="form_label">
接口名称:
</td>
<td colspan="3">
<input class="nui-textbox" name="criteria/_expr[1]/apiName"/>
<input class="nui-hidden" name="criteria/_expr[1]/_op" value="=">
</td>
</tr>
</table>
</div>
</div>
<!--footer-->
<div property="footer" align="center">
<a class="nui-button" onclick="search()">
查询
</a>
<a class="nui-button" onclick="reset()">
重置
</a>
</div>
<div class="nui-panel" title="WmsApiLog列表" iconCls="icon-add" style="width:100%;height:85%;" showToolbar="false" showFooter="false" >
<div class="nui-toolbar" style="border-bottom:0;padding:0px;">
<table style="width:100%;">
<tr>
<td style="width:100%;">
<a class="nui-button" iconCls="icon-add" onclick="add()">
增加
</a>
<a id="update" class="nui-button" iconCls="icon-edit" onclick="edit()">
编辑
</a>
<a class="nui-button" iconCls="icon-remove" onclick="remove()">
删除
</a>
</td>
</tr>
</table>
</div>
<div class="nui-fit">
<div id="datagrid1" dataField="wmsapilogs" class="nui-datagrid" style="width:100%;height:100%;" url="com.huaheng.wms.wmsapilogbiz.queryWmsApiLogs.biz.ext" pageSize="10" showPageIndex="true" multiSelect="true" onselectionchanged="selectionChanged" allowSortColumn="false">
<div property="columns">
<div type="indexcolumn">
</div>
<div type="checkcolumn">
</div>
<div field="id" headerAlign="center" allowSort="true" visible="false">
id
</div>
<div field="apiName" headerAlign="center" allowSort="true" >
接口名称
</div>
<div field="apiMethod" headerAlign="center" allowSort="true" >
请求类型
</div>
<div field="ip" headerAlign="center" allowSort="true" >
请求方地址
</div>
<div field="requestFrom" headerAlign="center" allowSort="true" >
请求方名称
</div>
<div field="responseBy" headerAlign="center" allowSort="true" >
响应方名称
</div>
<div field="url" headerAlign="center" allowSort="true" >
请求地址
</div>
<div field="requestTime" headerAlign="center" allowSort="true" >
请求时间
</div>
<div field="responseTime" headerAlign="center" allowSort="true" >
响应时间
</div>
<div field="requestHeader" headerAlign="center" allowSort="true" >
请求头
</div>
<div field="requestBody" headerAlign="center" allowSort="true" >
请求内容
</div>
<div field="responseHeader" headerAlign="center" allowSort="true" >
响应头
</div>
<div field="responseBody" headerAlign="center" allowSort="true" >
响应内容
</div>
<div field="duration" headerAlign="center" allowSort="true" >
响应耗时(毫秒)
</div>
<div field="httpCode" headerAlign="center" allowSort="true" >
HTTP状态码
</div>
<div field="retCode" headerAlign="center" allowSort="true" >
业务响应码
</div>
<div field="exception" headerAlign="center" allowSort="true" >
异常堆栈信息
</div>
<div field="createBy" headerAlign="center" allowSort="true" >
创建人
</div>
<div field="createTime" headerAlign="center" allowSort="true" >
创建日期
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
nui.parse();
var grid = nui.get("datagrid1");
var formData = new nui.Form("#form1").getData(false,false);
grid.load(formData);
//新增
function add() {
nui.open({
url: "WmsApiLogForm.jsp",
title: "新增记录", width: 600, height: 300,
onload: function () {//弹出页面加载完成
var iframe = this.getIFrameEl();
var data = {pageType:"add"};//传入页面的json数据
iframe.contentWindow.setFormData(data);
},
ondestroy: function (action) {//弹出页面关闭前
grid.reload();
}
});
}
//编辑
function edit() {
var row = grid.getSelected();
if (row) {
nui.open({
url: "WmsApiLogForm.jsp",
title: "编辑数据",
width: 600,
height: 300,
onload: function () {
var iframe = this.getIFrameEl();
var data = {pageType:"edit",record:{wmsapilog:row}};
//直接从页面获取,不用去后台获取
iframe.contentWindow.setFormData(data);
},
ondestroy: function (action) {
grid.reload();
}
});
} else {
nui.alert("请选中一条记录","提示");
}
}
//删除
function remove(){
var rows = grid.getSelecteds();
if(rows.length > 0){
nui.confirm("确定删除选中记录?","系统提示",
function(action){
if(action=="ok"){
var json = nui.encode({wmsapilogs:rows});
grid.loading("正在删除中,请稍等...");
$.ajax({
url:"com.huaheng.wms.wmsapilogbiz.deleteWmsApiLogs.biz.ext",
type:'POST',
data:json,
cache: false,
contentType:'text/json',
success:function(text){
var returnJson = nui.decode(text);
if(returnJson.exception == null){
grid.reload();
nui.alert("删除成功", "系统提示", function(action){
});
}else{
grid.unmask();
nui.alert("删除失败", "系统提示");
}
}
});
}
});
}else{
nui.alert("请选中一条记录!");
}
}
//重新刷新页面
function refresh(){
var form = new nui.Form("#form1");
var json = form.getData(false,false);
grid.load(json);//grid查询
nui.get("update").enable();
}
//查询
function search() {
var form = new nui.Form("#form1");
var json = form.getData(false,false);
grid.load(json);//grid查询
}
//重置查询条件
function reset(){
var form = new nui.Form("#form1");//将普通form转为nui的form
form.reset();
}
//enter键触发查询
function onKeyEnter(e) {
search();
}
//当选择列时
function selectionChanged(){
var rows = grid.getSelecteds();
if(rows.length>1){
nui.get("update").disable();
}else{
nui.get("update").enable();
}
}
</script>
</body>
</html>