add.jsp
8.23 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
<%@ page import="com.api.integration.esb.bean.PublishBean" %>
<%@ page import="com.api.integration.esb.service.PublishService" %>
<%@ page import="com.api.integration.esb.constant.EsbConstant" %>
<%--
Created by IntelliJ IDEA.
User: SJZ
Date: 2017/9/19
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea" %>
<%
if (!HrmUserVarify.checkUserRight(EsbConstant.ESB_RIGHT_KEY, user)) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String titlename = SystemEnv.getHtmlLabelName(132135, user.getLanguage());
String operate = Util.null2String(request.getParameter("operate"));
PublishBean publishBean;
if ("edit".equalsIgnoreCase(operate)) {
String publishId = Util.null2String(request.getParameter("publishId"));
PublishService publishService = new PublishService(user);
publishBean = publishService.queryById(publishId);
if (publishBean == null) {
%>
<script>
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(129113,user.getLanguage())%>", function () {
var parentWin = parent.parent.getParentWindow(parent.window);
parentWin.closeDlgARfsh();
});
</script>
<%
return;
}
} else {
publishBean = new PublishBean();
}
%>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<link rel="stylesheet" href="/wui/theme/ecology8/weaveredittable/css/WeaverEditTable_wev8.css">
<script src="/wui/theme/ecology8/weaveredittable/js/WeaverEditTable_wev8.js"></script>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDialog_wev8.js"></script>
<script language="javascript" src="/wui/theme/ecology8/jquery/js/zDrag_wev8.js"></script>
</head>
<body>
<div class="zDialog_div_content" style="height:580px;overflow:auto;">
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if (HrmUserVarify.checkUserRight(EsbConstant.ESB_RIGHT_KEY, user)) {
RCMenu += "{" + SystemEnv.getHtmlLabelName(86, user.getLanguage()) + ",javascript:submitData(),_self} ";
RCMenuHeight += RCMenuHeightStep;
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<%if (HrmUserVarify.checkUserRight(EsbConstant.ESB_RIGHT_KEY, user)) {%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(86 ,user.getLanguage()) %>" class="e8_btn_top"
onclick="submitData()"/>
<%}%>
<span id="advancedSearch" class="advancedSearch"
style='display:none;'><%=SystemEnv.getHtmlLabelName(21995, user.getLanguage()) %></span>
<span title="<%=SystemEnv.getHtmlLabelName(23036 ,user.getLanguage()) %>" class="cornerMenu"></span>
</td>
</tr>
</table>
<div id="tabDiv">
<span style="font-size:14px;font-weight:bold;"><%=titlename%></span>
</div>
<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv" style='display:none;'></div>
<FORM id="addFrmMain" name="addFrmMain" method=post>
<input type="hidden" name="operate" value="<%=operate%>">
<wea:layout>
<wea:group context='<%=SystemEnv.getHtmlLabelName(82743,user.getLanguage())%>'
attributes="{'samePair':'BaseInfo','groupOperDisplay':'none'}">
<%--是否启用--%>
<wea:item><%=SystemEnv.getHtmlLabelName(26472, user.getLanguage()) %>
</wea:item>
<wea:item>
<input class="inputstyle" type=checkbox tzCheckbox='true' id="state" name="state"
<%if(1==publishBean.getState())out.println("checked");%> value="1">
</wea:item>
<%--标识--%>
<wea:item><%=SystemEnv.getHtmlLabelName(84, user.getLanguage()) %>
</wea:item>
<wea:item>
<% if ("edit".equalsIgnoreCase(operate)) { %>
<input type="hidden" name="publishId" id="publishId" value="<%=publishBean.getPublishId()%>" />
<span><%=publishBean.getPublishId()%></span>
<% } else { %>
<wea:required id="publishIdimage" required="true" value="<%=publishBean.getPublishId()%>">
<input class="inputstyle" style='width:235px!important;' type=text size=50 maxLength="100"
id="publishId" name="publishId" value="<%=publishBean.getPublishId()%>"
onchange='checkinput("publishId","publishIdimage")' _noMultiLang='true' />
</wea:required>
<% } %>
</wea:item>
<%--名称--%>
<wea:item><%=SystemEnv.getHtmlLabelName(33439, user.getLanguage()) %>
</wea:item>
<wea:item>
<wea:required id="publishNameimage" required="true" value="<%=publishBean.getPublishName()%>">
<input class="inputstyle" style='width:235px!important;' type=text size=50 maxLength="100"
id="publishName" name="publishName" value="<%=publishBean.getPublishName()%>"
onchange='checkinput("publishName","publishNameimage")' />
</wea:required>
</wea:item>
</wea:group>
</wea:layout>
</FORM>
</div>
<br/><br/><br/><br/>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="">
<wea:item type="toolbar">
<input class="zd_btn_cancle" type="submit" id="btnClose" onclick="closeWin();"
value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>"/><!-- 取消 -->
</wea:item>
</wea:group>
</wea:layout>
</div>
</body>
</HTML>
<script>
/**
* 表单数据提交
*/
function submitData() {
try {
forbiddenPage();
var checkField = "publishId,publishName";
if (check_form(addFrmMain, checkField)) {
var url = "/api/integration/esb/publish/add";
if("edit"=="<%=operate%>"){
url = "/api/integration/esb/publish/edit";
}
$.ajax({
type: "post",
url: url,
data: $("#addFrmMain").serialize(),
success: function (data) {
releasePage();
data = jQuery.parseJSON(data);
//code == 100表示保存成功,其它都是失败。
if ("100" == data.code) {
closeWinAFrsh();
} else {
if(data["description"]){
top.Dialog.alert(data.description);
} else {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(132169,user.getLanguage())%>");
}
}
},
error: function (jqXHR) {
releasePage();
top.Dialog.alert(jqXHR.statusText);
}
});
} else {
releasePage();
}
} catch (e) {
console.log(e);
}
}
function forbiddenPage() {
parent.forbiddenPage();
}
function releasePage() {
parent.releasePage();
}
function closeWin(){
var parentWin = parent.parent.getParentWindow(parent.window);
parentWin.closeDialog();
}
function closeWinAFrsh() {
var parentWin = parent.parent.getParentWindow(parent.window);
parentWin.closeDlgARfsh();
}
</script>