excelUploadFormula_DefFormEdit.jsp
8.11 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.workflow.exceldesign.ExcelFormula"%>
<%@ page import="weaver.workflow.exceldesign.SearchConditionOption"%>
<%
response.setContentType("text/html;charset=utf-8");
String id = Util.null2String(request.getParameter("id"));
String isEdit = Util.null2String(request.getParameter("isEdit"));
String name = "";
String desc = "";
String type = "";
String file = "";
if ("true".equals(isEdit)) {
Map<String, String> funcMap =ExcelFormula.getDefFunctionById(id);
name = funcMap.get("name");
desc = funcMap.get("desc");
type = funcMap.get("type");
file = funcMap.get("filename");
}
%>
<HTML><HEAD>
<script type="text/javascript">
var dialog;
var parentWin;
jQuery(document).ready(function(){
dialog = window.top.getDialog(window);
<%
String success = Util.null2String(request.getParameter("success"));
if ("1".equals(success)) {
%>
doClose();
<%
} else if ("0".equals(success)) {
String msg = Util.null2String(request.getParameter("msg"));
if (msg != null && !"".equals(msg)) {
%>
alert("<%=msg%>");
<%
}
}
%>
// check();
});
// function check() {
// var funname = $(".funname").val();
// if (funname) {
// $(".funnameimg").hide();
// } else {
// $(".funnameimg").show();
// }
// var fundesc = $(".fundesc").val();
// if (fundesc) {
// $(".fundescimg").hide();
// } else {
// $(".fundescimg").show();
// }
// }
function doSubmit() {
var funname = $(".funname").val();
var fundesc = $(".fundesc").val();
var alertString = "";
// if (!funname) {
// alertString += "<%=SystemEnv.getHtmlLabelNames("30686,195,18622",user.getLanguage())%>";
// }
// if (!fundesc) {
// if (alertString) {
// alertString += "\r\n";
// }
// alertString += "<%=SystemEnv.getHtmlLabelNames("160,85,18622",user.getLanguage())%>";
// }
<%
if ("false".equals(isEdit)) {
%>
var funfile = document.getElementById("funfile").files;
if (funfile.length == 0) {
if (alertString) {
alertString += "\r\n";
}
alertString += "<%=SystemEnv.getHtmlLabelNames("30686,345,18622",user.getLanguage())%>";
}
<%
}
%>
if (alertString) {
alert(alertString);
return;
}
$("#operate").val("save");
frmmain.submit();
}
function doDelete() {
if (confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>")==true){
$("#operate").val("delete");
frmmain.submit();
}
}
function doClose() {
console.log("close");
dialog.close();
dialog.currentWindow.location.reload();
}
</script>
</HEAD>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<BODY>
<form name="frmmain" id="frmmain" method="post" action="/workflow/exceldesign/excelUploadFormula_DefFormOperation.jsp" enctype="multipart/form-data">
<div>
<wea:layout type="twoCol">
<wea:group context="<%=SystemEnv.getHtmlLabelName(1361, user.getLanguage())%>">
<wea:item>
<div style="width:100%; height:248px;">
<table style="width:100%; " >
<!-- <tr>
<td style="width:30%">
<span><%=SystemEnv.getHtmlLabelNames("30686,195",user.getLanguage())%>:</span>
</td>
<td>
<input type="text" class="funname" name="funname" value="<%=name%>" style="width: 80%;border: 1px solid #e9e9e9;" onkeyup="check()"/>
<img class="funnameimg" style="padding-top:4px;" src="/images/BacoError_wev8.gif" align="absMiddle">
</td>
</tr>
<tr>
<td style="width:30%">
<span><%=SystemEnv.getHtmlLabelNames("160,85",user.getLanguage())%>:</span>
</td>
<td>
<textarea id="fundesc" class="fundesc" name="fundesc" style="font-size:14px; width:80%;height:99px;overflow: auto;border: 1px solid #e9e9e9;" onkeyup="check()" ><%=desc%></textarea>
<img class="fundescimg" style="padding-top:4px;" src="/images/BacoError_wev8.gif" align="absMiddle">
</td>
</tr> -->
<tr>
<td style="width:30%">
<!-- 所属分类 -->
<span><%=SystemEnv.getHtmlLabelNames("27117",user.getLanguage())%>:</span>
</td>
<td>
<select class="funtype" name="funtype" style="width:81%;overflow:auto; border: 1px solid #e9e9e9;" notBeauty=true>
<%
Map<String,Object> formulaTypes = ExcelFormula.getFormulaTypes(user);
if (formulaTypes != null) {
ArrayList<SearchConditionOption> alTypeOptions = (ArrayList<SearchConditionOption>)formulaTypes.get("typeOptionsInDB");
SearchConditionOption typeOption;
for (int i = 0; i < alTypeOptions.size(); i++) {
String selectedStr = "";
typeOption = alTypeOptions.get(i);
if (type.length() > 0 && type.equals(typeOption.getKey())) {
selectedStr = " selected ";
} else if (type.length() == 0 && "20".equals(typeOption.getKey())) {
selectedStr = " selected ";
}
out.println("<option value=\""+typeOption.getKey()+"\""+ selectedStr+" ><STRONG>"+typeOption.getShowname()+"</strong></option>");
}
}
%>
</select>
</td>
</tr>
<tr>
<td style="width:30%;vertical-align:top;">
<!-- 函数内容 -->
<span><%=SystemEnv.getHtmlLabelNames("30686,345",user.getLanguage())%>:</span>
</td>
<td>
<%
if (file.length() > 0) {
%>
<span name="funfile"><%=file%></span>
<%
} else {
%>
<input class=inputstyle style="width: 247px; border:1px solid #e9e9e9" type="file" id="funfile" name="funfile" accept="application/javascript" onchange='checkinput("funfile","funfilespan")'>
<SPAN id=funfilespan>
<IMG src="/images/BacoError_wev8.gif" align=absMiddle>
</SPAN>
<div style="margin-top:5px;">
<!-- 下载模板 -->
<a href='/workflow/exceldesign/js/formula/template.js' download="template.js" style="color: #30b5ff"><%=SystemEnv.getHtmlLabelName(28576,user.getLanguage())%></a>
</div>
<%
}
%>
</td>
</tr>
<input type="hidden" id="id" name="id" value="<%=id%>"/>
<input type="hidden" id="isEdit" name="isEdit" value="<%=isEdit%>"/>
<input type="hidden" id="operate" name="operate"/>
</table>
</div>
</wea:item>
</wea:group>
</wea:layout>
<jsp:include page="/systeminfo/commonTabFoot.jsp"></jsp:include>
</div>
</FORM>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="" attributes="{groupDisplay:none}">
<wea:item type="toolbar">
<input type="button" value="<%=SystemEnv.getHtmlLabelName(86, user.getLanguage())%>" id="btn_save" class="zd_btn_submit" onclick="doSubmit()">
<%
if ("true".equals(isEdit)) {
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(91, user.getLanguage())%>" id="btn_delete" class="zd_btn_cancle" onclick="doDelete()">
<%
}
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(201, user.getLanguage())%>" id="btn_cancel" class="zd_btn_cancle" onclick="dialog.close();">
</wea:item>
</wea:group>
</wea:layout>
</div>
</body>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
</BODY>
</HTML>