preimportapp.jsp
9 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<%@page import="com.weaver.formmodel.util.StringHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.systeminfo.*" %>
<%@ page import="weaver.general.*" %>
<%@ page import="oracle.sql.CLOB" %>
<%@ page import="java.io.Writer" %>
<%@ page import="weaver.formmode.service.*"%>
<jsp:useBean id="exports" class="weaver.formmode.exports.services.FormmodeDataService" scope="page"/>
<%@ include file="/formmode/pub.jsp"%>
<style>
html,body{
height: 100%;
margin: 0px;
padding: 0px;
}
*{
font: 12px Microsoft YaHei;
}
ul{
list-style: none;
margin: 0px;
padding: 0px;
}
.e8_tblForm{
width: 511px;
margin: 0 0;
border-collapse: collapse;
}
.e8_tblForm .e8_tblForm_label{
vertical-align: top;
border-bottom: 1px solid #e6e6e6;
padding: 5px 0;
}
.e8_tblForm .e8_tblForm_field{
border-bottom: 1px solid #e6e6e6;
padding: 5px 7px;
background-color: #f8f8f8;
vertical-align: top;
}
.e8_label_desc{
color: #aaa;
}
#appTable{
width: 100%;
height: 100%;
}
#appTable td{
vertical-align: top;
}
#appPart2TD{
background: url("/formmode/images/border_e9e9e9_wev8.png") no-repeat;
background-position: right 15px;
}
.appPart{
height: 100%;
padding-top: 15px;
}
#appPart1{
width: 530px;
}
#appPart2{
width: 280px;
}
#appPart3{
padding-left: 15px;
}
.appPart .elementPart{
padding-left: 0;
}
.appPart .elementPart .title{
font-weight: bold;
padding-bottom: 2px;
}
.appPart .elementPart .content{
padding-top: 0px;
padding-bottom: 15px;
}
.content .divProgress{
width: 280px;
background-color: #e9e9e9;
}
.appPart .elementPart .content .component{
height: 80px;
}
.appPart .elementPart .content .component li{
float: left;
height: 80px;
width: 80px;
margin-right: 6px;
background-position: center;
background-repeat: no-repeat;
position: relative;
cursor: pointer;
}
.appPart .elementPart .content .component li.color1{
background-color: #99B332;
}
.appPart .elementPart .content .component li.color2{
background-color: #0172C5;
}
.appPart .elementPart .content .component li .bottomInfo{
position: absolute;
left: 0px;
bottom: 0px;
width: 100%;
padding: 0px;
height: 26px;
background: url('/formmode/images/appbar/appbar_bottom_bg_wev8.png');
overflow: hidden;
}
.appPart .elementPart .content .component li .bottomInfo span{
}
.appPart .elementPart .content .component li .bottomInfo .label{
padding-top: 6px;
padding-left: 8px;
color: #f1f1f1;
font-size: 11px;
}
.appPart .elementPart .content .component li .bottomInfo .count{
margin-left: 4px;
color: #f1f1f1;
font-size: 11px;
}
.appPart .elementPart .content .complete{
background-color: #E9E9E9;
height: 80px;
width: 280px;
color: #FAFAFA;
padding: 3px 0px 0px 8px;
position: relative;
}
#progressTitle2{
height:30px;position:absolute;top:42px;left:25px;z-index:999;font-size:12px;color:#f8f8f8;
}
#progressVal2{
position: absolute;
top:75px;
left:25px;
height:30px;
color:#fff;
font-size:28px;
font-weight: bold;
z-index:999;
}
#progressGif2{
width:280px;height:80px;opacity:0.08;filter:alpha(opacity=8);
}
.appPart .elementPart .content .filecontent{
padding-top: 6px;
width: 280px;
}
.appPart .elementPart .content .desc{
padding-top: 8px;
}
.appPart .elementPart .content .desc ul{
list-style: none;
margin: 0px;
padding: 0px;
}
.appPart .elementPart .content .desc ul li{
padding-left: 2px;
line-height: 18px;
color: #666;
font-size: 11px;
}
#appStatistics{
margin-top: 8px;
vertical-align:bottom;
}
#appStatistics li{
height: 19px;
overflow: hidden;
}
#appStatistics span{
display: block;
height: 15px;
float: left;
line-height: 15px;
}
#appStatistics .label{
color: #909090;
font-size: 11px;
width: 48px;
font-style: italic;
}
#appStatistics .bar{
background-color: #E5E5E5;
}
#appStatistics .maxValBar{
background-color: #FF6600;
}
#appStatistics .nodata{
color: #909090;
font-size: 11px;
font-style: italic;
}
.divBtn{
width: 100px;
padding: 5px 0;
margin: 8px 0;
/*background-color: #2d89ef;*/
background-color: #2d89ef;
color: #fff;
font-family: Microsoft YaHei;
font-size: 12px;
line-height: 18px;
}
.divBtnDisabled{
background-color: #E9E9E9 !important;
}
</style>
<script type="text/javascript">
function importwf()
{
var parastr="filename";
var filename = document.frmMain.filename.value;
var pos = filename.length-4;
if(filename==null||filename==''){
alert("<%=SystemEnv.getHtmlLabelName(81991,user.getLanguage())%>");//选择文件!
}else{
if(filename.lastIndexOf(".zip")==pos)
{
jQuery("#upload_faceico").load(showUploadMessage);
document.frmMain.submit();
jQuery("#uploadBtn").attr("disabled","disabled").addClass("divBtnDisabled");
jQuery("#progressGif2").css("background-image", "url(/formmode/images/animated-overlay_wev8.gif)");
jQuery("#progressVal2").css("color", "#FD6500");
doStatus();
}
else
{
alert("<%=SystemEnv.getHtmlLabelName(81992,user.getLanguage())%>");//选择文件格式不正确,请选择xml文件25644
return;
}
}
}
function doStatus(){
var url = "/formmode/import/ProcessOperation.jsp?action=doStatus";
FormmodeUtil.doAjaxDataLoad(url, function(res){
if(jQuery.isEmptyObject(res)){
setTimeout("doStatus()",200);//定时调用
}else{
var isfinish=res.isfinish;
var total=res.total;
var successNum=res.successNum;
var percentComplete=parseInt(successNum*100/total);
$("#progressVal2").html(percentComplete+"%");
if(isfinish!=1){
setTimeout("doStatus()",200);//定时调用
}else{
jQuery("#uploadBtn").removeAttr("disabled").removeClass("divBtnDisabled");
jQuery("#progressGif2").css("background-image", "");
jQuery("#progressVal2").css("color", "#fff");
}
}
});
}
var uploadMessageDlg;
function showUploadMessage(){
var uploadFrame = document.getElementById("upload_faceico");
var uploadFrameDoc = uploadFrame.contentWindow.document;
var msg=uploadFrameDoc.body.innerHTML;
uploadMessageDlg = top.createTopDialog();//定义Dialog对象
uploadMessageDlg.Model = true;
uploadMessageDlg.Width = 960;//定义长度
uploadMessageDlg.Height = 650;
uploadMessageDlg.URL = "/formmode/setup/upload_faceico.jsp";
uploadMessageDlg.Title = "<%=SystemEnv.getHtmlLabelName(82207,user.getLanguage())%>";//应用导入信息
uploadMessageDlg.appImportMsg = msg;
uploadMessageDlg.show();
}
</script>
<%
if (!HrmUserVarify.checkUserRight("FORMMODEAPP:ALL", user)) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String pAppid = StringHelper.null2String(request.getParameter("appid"));
AppInfoService appInfoService = new AppInfoService();
Map<String, Object> appInfo = appInfoService.getAppInfoById(Util.getIntValue(pAppid));
String userRightStr = "FORMMODEAPP:ALL";
int subCompanyId = Util.getIntValue(Util.null2String(appInfo.get("subCompanyId")),-1);
Map rightMap = getCheckRightSubCompanyParam(userRightStr,user,fmdetachable ,subCompanyId,"",request,response,session);
subCompanyId = Util.getIntValue(Util.null2String(rightMap.get("subCompanyId")),-1);
int operatelevel = Util.getIntValue(Util.null2String(rightMap.get("operatelevel")),-1);
%>
<table id="appTable">
<colgroup>
<col width="130px"/>
<col width="80px"/>
<col width="*"/>
</colgroup>
<tr>
<td>
<div id="appPart3" class="appPart">
<div class="elementPart">
<div class="title"><%=SystemEnv.getHtmlLabelName(82208,user.getLanguage())%><!-- 应用导入 --></div>
<div class="content">
<div class="divProgress">
<div id="progressTitle2">%COMPLETE</div>
<div id="progressVal2">0%</div>
<div id="progressGif2"></div>
</div>
<div class="filecontent">
<FORM style="MARGIN-TOP: 0px" name=frmMain method=post action="/formmode/import/ModeImportOperation.jsp" enctype="multipart/form-data" target="upload_faceico">
<input <%if(operatelevel<1){%>disabled<%} %> class=InputStyle type=file name="filename" id="filename" style="width:280px;background-color:#fff;border:1px solid #eee;outline:none;">
<input type="hidden" id="appid" name="appid" value="<%=pAppid%>"/>
<input type="hidden" id="isAppImport" name="isAppImport" value="1"/>
</FORM>
<iframe id="upload_faceico" name="upload_faceico" style="display: none;"></iframe>
</div>
<div class="desc">
<ul>
<!-- <li>功能说明:</li> -->
<li><%=SystemEnv.getHtmlLabelName(82012,user.getLanguage())%><!-- 有关人力资源等相关设置,请在导入后检查设置。 --></li>
</ul>
<%if(operatelevel>0){%>
<button id="uploadBtn" type="button" class="divBtn" onclick="importwf();"><%=SystemEnv.getHtmlLabelName(32937,user.getLanguage())%><!-- 开始上传 --><img src="/formmode/images/downloadCloud_wev8.png" style="vertical-align: bottom;margin:0 0px 2px 4px;"/></button>
<%}else{%>
<%=SystemEnv.getHtmlLabelName(82209,user.getLanguage())%><!-- 不具有该应用的导入权限! -->
<%} %>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>