WmsApiLogForm.jsp
9.76 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
<%@ 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:20
- 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>
<!-- 标识页面是查看(query)、修改(edit)、新增(add) -->
<input name="pageType" class="nui-hidden"/>
<div id="dataform1" style="padding-top:5px;">
<!-- hidden域 -->
<input class="nui-hidden" name="wmsapilog.id"/>
<table style="width:100%;height:100%;table-layout:fixed;" class="nui-form-table">
<tr>
<td class="form_label">
接口名称:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.apiName"/>
</td>
<td class="form_label">
请求类型:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.apiMethod"/>
</td>
</tr>
<tr>
<td class="form_label">
请求方地址:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.ip"/>
</td>
<td class="form_label">
请求方名称:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.requestFrom"/>
</td>
</tr>
<tr>
<td class="form_label">
响应方名称:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.responseBy"/>
</td>
<td class="form_label">
请求地址:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.url"/>
</td>
</tr>
<tr>
<td class="form_label">
请求时间:
</td>
<td colspan="1">
<input class="nui-datepicker" name="wmsapilog.requestTime"/>
</td>
<td class="form_label">
响应时间:
</td>
<td colspan="1">
<input class="nui-datepicker" name="wmsapilog.responseTime"/>
</td>
</tr>
<tr>
<td class="form_label">
请求头:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.requestHeader"/>
</td>
<td class="form_label">
请求内容:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.requestBody"/>
</td>
</tr>
<tr>
<td class="form_label">
响应头:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.responseHeader"/>
</td>
<td class="form_label">
响应内容:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.responseBody"/>
</td>
</tr>
<tr>
<td class="form_label">
响应耗时(毫秒):
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.duration"/>
</td>
<td class="form_label">
HTTP状态码:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.httpCode"/>
</td>
</tr>
<tr>
<td class="form_label">
业务响应码:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.retCode"/>
</td>
<td class="form_label">
异常堆栈信息:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.exception"/>
</td>
</tr>
<tr>
<td class="form_label">
创建人:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmsapilog.createBy"/>
</td>
<td class="form_label">
创建日期:
</td>
<td colspan="1">
<input class="nui-datepicker" name="wmsapilog.createTime"/>
</td>
</tr>
</table>
<div class="nui-toolbar" style="padding:0px;" borderStyle="border:0;">
<table width="100%">
<tr>
<td style="text-align:center;" colspan="4">
<a class="nui-button" iconCls="icon-save" onclick="onOk()">
保存
</a>
<span style="display:inline-block;width:25px;">
</span>
<a class="nui-button" iconCls="icon-cancel" onclick="onCancel()">
取消
</a>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
nui.parse();
function saveData(){
var form = new nui.Form("#dataform1");
form.setChanged(false);
//保存
var urlStr = "com.huaheng.wms.wmsapilogbiz.addWmsApiLog.biz.ext";
var pageType = nui.getbyName("pageType").getValue();//获取当前页面是编辑还是新增状态
//编辑
if(pageType=="edit"){
urlStr = "com.huaheng.wms.wmsapilogbiz.updateWmsApiLog.biz.ext";
}
form.validate();
if(form.isValid()==false) return;
var data = form.getData(false,true);
var json = nui.encode(data);
$.ajax({
url:urlStr,
type:'POST',
data:json,
cache:false,
contentType:'text/json',
success:function(text){
var returnJson = nui.decode(text);
if(returnJson.exception == null){
CloseWindow("saveSuccess");
}else{
nui.alert("保存失败", "系统提示", function(action){
if(action == "ok" || action == "close"){
//CloseWindow("saveFailed");
}
});
}
}
});
}
//页面间传输json数据
function setFormData(data){
//跨页面传递的数据对象,克隆后才可以安全使用
var infos = nui.clone(data);
//保存list页面传递过来的页面类型:add表示新增、edit表示编辑
nui.getbyName("pageType").setValue(infos.pageType);
//如果是点击编辑类型页面
if (infos.pageType == "edit") {
var json = infos.record;
var form = new nui.Form("#dataform1");//将普通form转为nui的form
form.setData(json);
form.setChanged(false);
}
}
//关闭窗口
function CloseWindow(action) {
if (action == "close" && form.isChanged()) {
if (confirm("数据被修改了,是否先保存?")) {
saveData();
}
}
if (window.CloseOwnerWindow)
return window.CloseOwnerWindow(action);
else window.close();
}
//确定保存或更新
function onOk() {
saveData();
}
//取消
function onCancel() {
CloseWindow("cancel");
}
</script>
</body>
</html>