impexpIframe.jsp
29.2 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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@page import="weaver.conn.RecordSet"%>
<%@page import="weaver.formmode.exttools.impexp.common.StringUtils"%>
<%@page import="weaver.systeminfo.SystemEnv"%>
<%@page import="weaver.hrm.resource.ResourceComInfo"%>
<%@page import="weaver.formmode.exttools.impexp.exp.service.ProgressStatus"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String modeid = StringUtils.null2String(request.getParameter("id"));//模块id
String appid = StringUtils.null2String(request.getParameter("appId"));//应用id
String subCompanyId = StringUtils.null2String(request.getParameter("subCompanyId"));
String sessionid = session.getId();
ResourceComInfo resourceComInfo = new ResourceComInfo();
String appname = "",modename = "";
RecordSet rs = new RecordSet();
boolean selectMode = false;
if(!"".equals(modeid)&&!"null".equals(modeid)){
selectMode = true;
}
if(!"".equals(appid)&&!"null".equals(appid)){
rs.executeSql("select treefieldname from modetreefield where id='"+appid+"'");
if(rs.next()){
appname = StringUtils.null2String(rs.getString(1));
}
}
if(!"".equals(modeid)&&!"null".equals(modeid)){
rs.executeSql("select modename from modeinfo where id='"+modeid+"'");
if(rs.next()){
modename = StringUtils.null2String(rs.getString(1));
}
}
String titlename = "";//appname +" / "+modename;
String startdate = StringUtils.null2String(request.getParameter("startdate"));
String enddate = StringUtils.null2String(request.getParameter("enddate"));
String operateType = StringUtils.null2String(request.getParameter("operateType"));
String dataType = StringUtils.null2String(request.getParameter("dataType"));
String objid = StringUtils.null2String(request.getParameter("objid"));
String operator = StringUtils.null2String(request.getParameter("operator"));
if(request.getParameter("dataType")==null){
if(selectMode){
dataType = "1";
}else{
dataType = "0";
}
}
if(request.getParameter("objid")==null){
if(selectMode){
objid = "mode_"+modeid;
}else{
objid = "app_"+appid;
}
}
if("".equals(modeid)) {
titlename = this.getHtmlLabelName(25432,user.getLanguage(),"应用")+":"+appname+" "+this.getHtmlLabelName(18596,user.getLanguage(),"导入")+"/"+this.getHtmlLabelName(17416,user.getLanguage(),"导出");
} else {
titlename = this.getHtmlLabelName(19049,user.getLanguage(),"模块")+":"+modename+" "+this.getHtmlLabelName(18596,user.getLanguage(),"导入")+"/"+this.getHtmlLabelName(17416,user.getLanguage(),"导出");
}
String pageid = "impexp:"+appid+"-"+StringUtils.getIntValue(modeid, 0);
//titlename = "应用:"+ap+pname+"/模块:"+modename+"导入";
%>
<%!
private String getHtmlLabelName(int id, int language, String def) {
String ret = SystemEnv.getHtmlLabelName(id, language);
if(ret == null || "".equals(ret)) {
ret = def;
}
return ret;
}
private String getHtmlLabelNames(String id, int language, String def) {
String ret = SystemEnv.getHtmlLabelNames(id, language);
if(ret == null || "".equals(ret)) {
ret = def;
}
return ret;
}
%>
<html>
<head>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<SCRIPT type="text/javascript" src="/formmode/js/WdatePicker/WdatePicker_wev8.js"></script>
<script src="/formmode/js/jquery/form/jquery.form_wev8.js"></script>
<LINK REL=stylesheet type=text/css HREF=/css/Weaver_wev8.css>
<link href="/formmode/css/formmode_wev8.css" type="text/css" rel="stylesheet" />
<style>
html,body{
height: 100%;
margin: 0px;
padding: 0px;
}
*{
font: 12px Microsoft YaHei;
}
ul{
list-style: none;
margin: 0px;
padding: 0px;
}
.e8_label_desc{
color: #aaa;
}
#appTable{
width: 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;
}
#progressTitle{
height:30px;position:absolute;top:42px;left:25px;z-index:999;font-size:12px;color:#f8f8f8;
}
#progressVal{
position: absolute;
top:60px;
left:25px;
height:30px;
color:#fff;
font-size:28px;
font-weight: bold;
z-index:999;
}
#progressContent{
position: absolute;
top:42px;
left:25px;
height:30px;
color:blue;
font-size:12px;
font-weight: bold;
z-index:999;
}
#progressGif{
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>
<style>
td.e8_tblForm_label{
vertical-align: middle !important;
}
</style>
</head>
<body>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+this.getHtmlLabelName(197,user.getLanguage(),"搜索")+",javascript:doSubmit(),_top} " ;//搜索
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+this.getHtmlLabelName(82176,user.getLanguage(),"清空条件")+",javascript:doClear(),_top} " ;//清空条件
RCMenuHeight += RCMenuHeightStep ;
if(!"".equals(appname)){
RCMenu += "{"+this.getHtmlLabelName(17416,user.getLanguage(),"导出")+this.getHtmlLabelName(25432,user.getLanguage(),"应用")+",javascript:doExp("+appid+",0),_self} " ;//导出应用
}
if(!"".equals(modename)){
RCMenu += "{"+this.getHtmlLabelName(17416,user.getLanguage(),"导出")+this.getHtmlLabelName(19049,user.getLanguage(),"模块")+",javascript:doExp("+modeid+",1),_self} " ;//导出模块
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table id="appTable">
<colgroup>
<col width="*"/>
</colgroup>
<tr>
<td>
<div id="appPart3" class="appPart">
<div class="elementPart">
<div class="content">
<div class="divProgress">
<div id="progressTitle">%COMPLETE</div>
<div id="progressVal">0%</div>
<div id="progressContent"></div>
<div id="progressGif"></div>
</div>
<div class="filecontent">
<FORM style="MARGIN-TOP: 0px" id="frmMain" name=frmMain method=post action="/formmode/exttools/impexpAction.jsp" enctype="multipart/form-data" target="upload_faceico">
<input 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="<%=appid%>"/>
</FORM>
<iframe id="upload_faceico" name="upload_faceico" style="display: none;"></iframe>
</div>
<%-- <div class="desc">
<INPUT class="inputstyle" type="checkbox" id="isadd" name="isadd" value="1" /><%=this.getHtmlLabelNames("83023,1421",user.getLanguage())%>
<font color="red"><%=this.getHtmlLabelName(127432,user.getLanguage())%><!-- 注:此选项勾选后,始终新增数据;不勾选首次导入新增,之后更新。 --></font>
</div> --%>
<div class="desc">
<ul>
<!-- <li>功能说明:</li> -->
<li><%=this.getHtmlLabelName(82012,user.getLanguage(),"1.有关人力资源等相关设置,请在导入后检查设置。")%><!-- 1.有关人力资源等相关设置,请在导入后检查设置。 --></li>
<li><%=this.getHtmlLabelName(127431,user.getLanguage(),"2.导入后权限相关设置如果涉及到人力资源、部门等基础数据,可能需要重新配置!")%><!-- 2.导入后权限相关设置如果涉及到人力资源、部门等基础数据,可能需要重新配置! --></li>
</ul>
<button id="uploadBtn" type="button" class="divBtn" onclick="importwf();"><%=this.getHtmlLabelName(25649,user.getLanguage(),"开始导入")%><img src="/formmode/images/downloadCloud_wev8.png" style="vertical-align: bottom;margin:0 0px 2px 4px;"/></button>
<button id="cancelExpBtn" type="button" class="divBtn" style="display: none;" onclick="cancelExp();">取消导出<img src="/formmode/images/downloadCloud_wev8.png" style="vertical-align: bottom;margin:0 0px 2px 4px;"/></button>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
<form name="frmSearch" method="post" action="/formmode/exttools/impexpIframe.jsp">
<input type="hidden" name="appId" value="<%=appid %>">
<input type="hidden" name="id" value="<%=modeid %>">
<input type="hidden" name="pageid" value="<%=pageid %>">
<table class="e8_tblForm">
<colgroup>
<col width="6%">
<col width="14%">
<col width="6%">
<col width="14%">
<col width="6%">
<col width="14%">
<col width="6%">
<col width="14%">
<col width="6%">
<col width="14%">
</colgroup>
<tr>
<td class="e8_tblForm_label"><%=this.getHtmlLabelName(17482,user.getLanguage(),"操作人")%><!-- 操作人 --></td>
<td class="e8_tblForm_field">
<brow:browser viewType="0" name="operator" browserValue='<%= ""+operator %>'
browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp"
hasInput="true" isSingle="true" hasBrowser = "true" isMustInput="1"
completeUrl="/data.jsp" linkUrl="javascript:void($id$)" width="178px"
browserDialogWidth="700px"
browserSpanValue='<%=resourceComInfo.getResourcename(""+operator)%>'
></brow:browser>
</td>
<td class="e8_tblForm_label"><%=this.getHtmlLabelName(15503,user.getLanguage(),"操作类型")%><!-- 操作类型 --></td>
<td class="e8_tblForm_field">
<select style="width: 100px;" id="operateType" name="operateType">
<option></option>
<option <%if("1".equals(operateType)){%>selected="selected"<%} %> value="1"><%=this.getHtmlLabelName(18596,user.getLanguage(),"导入") %></option>
<option <%if("0".equals(operateType)){%>selected="selected"<%} %> value="0"><%=this.getHtmlLabelName(17416,user.getLanguage(),"导出")%></option>
</select>
</td>
<td class="e8_tblForm_label"><%=this.getHtmlLabelName(125929,user.getLanguage(),"数据类型")%><!-- 数据类型 --></td>
<td class="e8_tblForm_field">
<select style="width: 100px;" id="dataType" name="dataType">
<option></option>
<%-- <%if(selectMode){ %> --%>
<option <%if("1".equals(dataType)){%>selected="selected"<%} %> value="1"><%=this.getHtmlLabelName(19049,user.getLanguage(),"应用") %></option>
<option <%if("0".equals(dataType)){%>selected="selected"<%} %> value="0"><%=this.getHtmlLabelName(25432,user.getLanguage(),"模块")%></option>
<%-- <%}else{ %>
<option <%if("0".equals(dataType)){%>selected="selected"<%} %> value="0"><%=this.getHtmlLabelName(25432,user.getLanguage())%></option>
<%} %> --%>
</select>
</td>
<td class="e8_tblForm_label"><%=this.getHtmlLabelName(19464,user.getLanguage(),"数据对象")%><!-- 数据对象 --></td>
<td class="e8_tblForm_field">
<select style="width: 100px;" id="objid" name="objid">
<option></option>
<%if("0".equals(dataType)&&!"".equals(appid)){%>
<option <%if(objid.equals("app_"+appid)){ %>selected="selected"<%} %> value="app_<%=appid %>"><%=appname %></option>
<%}else if("1".equals(dataType)&&!"".equals(modeid)){ %>
<option <%if(objid.equals("mode_"+modeid)){ %>selected="selected"<%} %> value="mode_<%=modeid %>"><%=modename %></option>
<%} %>
</select>
</td>
<td class="e8_tblForm_label" ><%=this.getHtmlLabelName(15502,user.getLanguage(),"操作时间")%><!-- 操作时间 --></td>
<td class="e8_tblForm_field">
<%=this.getHtmlLabelName(83838,user.getLanguage(),"")%>
<button class="calendar" onclick="onSearchWFQTDate(startdate_span,startdate)" type="button"></button>
<input type="hidden" class="calendar" id="startdate" name="startdate" onclick="WdatePicker()" value="<%=startdate %>"/>
<span id="startdate_span" name="startdate_span"><%=startdate %></span>
<%=this.getHtmlLabelName(33973,user.getLanguage(),"")%>
<button class="calendar" onclick="onSearchWFQTDate(enddate_span,enddate)" type="button"></button>
<input type="hidden" class="calendar" id="enddate" name="enddate" onclick="WdatePicker()" value="<%=enddate %>"/>
<span id="enddate_span" name="enddate_span"><%=enddate %></span>
</td>
</tr>
</table>
</form>
<%
String perpage = "10";
String backFields = "a.id,a.creator,a.createdate,a.createtime,a.type,a.datatype,a.fileid";
String sqlFrom = "from mode_impexp_log a";
String SqlWhere = " where 1=1 ";
if(!"".equals(startdate)){
SqlWhere += " and a.createdate>='"+startdate+"' ";
}
if(!"".equals(enddate)){
SqlWhere += " and a.createdate<='"+enddate+"' ";
}
if(!"".equals(operateType)){
SqlWhere += " and a.type='"+operateType+"' ";
}
if(!"".equals(dataType)){
SqlWhere += " and a.datatype='"+dataType+"' ";
}
if(!"".equals(objid)){
String objid_v = objid.replace("mode_","").replace("app_","");
SqlWhere += " and objid='"+objid_v+"' ";
}
if(!"".equals(operator)){
SqlWhere += " and operator='"+operator+"' ";
}
String tableString = ""+
"<table pagesize=\""+perpage+"\" tabletype=\"none\" >"+
"<sql backfields=\""+backFields+"\" sqlform=\""+sqlFrom+"\" sqlprimarykey=\"a.id\" sqlsortway=\"desc\" sqldistinct=\"true\" sqlwhere=\""+Util.toHtmlForSplitPage(SqlWhere)+"\"/>"+
"<head>"+
//操作人
"<col width=\"12%\" text=\""+this.getHtmlLabelName(17482,user.getLanguage(),"操作人")+"\" column=\"creator\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getCreator\"/>"+
//操作类型
"<col width=\"10%\" text=\""+this.getHtmlLabelName(15503,user.getLanguage(),"操作类型")+"\" column=\"type\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getType\"/>"+
//数据类型
"<col width=\"10%\" text=\""+this.getHtmlLabelName(125929,user.getLanguage(),"数据类型")+"\" column=\"datatype\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getDataType\"/>"+
//数据对象
"<col width=\"15%\" text=\""+this.getHtmlLabelName(19464,user.getLanguage(),"数据对象")+"\" column=\"id\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getObj\"/>"+
//操作日期
"<col width=\"12%\" text=\""+this.getHtmlLabelName(21663,user.getLanguage(),"操作日期")+"\" column=\"createdate\" orderkey=\"createdate\" />"+
//操作时间
"<col width=\"12%\" text=\""+this.getHtmlLabelName(18008,user.getLanguage(),"操作时间")+"\" column=\"createtime\" orderkey=\"createtime\" />"+
//操作
"<col width=\"10%\" text=\""+this.getHtmlLabelName(104,user.getLanguage(),"操作")+"\" column=\"id\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getOperate\"/>"+
//错误警告
"<col width=\"15%\" text=\""+this.getHtmlLabelNames("127353,127354",user.getLanguage(),"错误警告")+"\" column=\"id\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.exttools.impexp.log.LogTransferService.getDetail\"/>"+
"</head>"+
"</table>";
%>
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" isShowTopInfo="true"/>
</body>
<script type="text/javascript">
$(document).ready(function(){//onload事件
$("#dataType").change(function(){
var dataType = $("#dataType").val();
var objid = document.getElementById("objid");
clearObjid(objid);
if(dataType=='0'){
objid.options.add(new Option("",""));
<%if(!"".equals(appid)){%>
objid.options.add(new Option("<%=appname%>","app_<%=appid%>"));
<%}%>
}else if(dataType=='1'){
objid.options.add(new Option("",""));
<%if(!"".equals(modeid)&&!"null".equals(modeid)){%>
objid.options.add(new Option("<%=modename%>","mode_<%=modeid%>"));
<%}%>
}else{
objid.options.add(new Option("",""));
}
jQuery(objid).selectbox("detach");
beautySelect(objid);
});
setImpBtnDisable(true);
jQuery("#progressGif").css("background-image", "url(/formmode/images/animated-overlay_wev8.gif)");
jQuery("#progressVal").css("color", "#FD6500");
jQuery("#cancelExpBtn").show();
$(".loading", window.parent.document).hide(); //隐藏加载图片
doStatus(1);
})
function clearObjid(ctl){
for(var i=ctl.options.length-1; i>=0; i--){
ctl.remove(i);
}
}
function doExp(id,ptype){
//window.open("/formmode/exttools/impexpAction.jsp?id="+id+"&ptype="+ptype+"&type=0");
if(ptype==1){
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(384026,user.getLanguage())%>",function(){
expAjax(id,ptype,id);
},function(){
expAjax(id,ptype,"");
});
}else{
var url="/formmode/exttools/expDataSetSearch.jsp?appid="+id;
var diag_vote = new window.top.Dialog();
diag_vote.currentWindow = window;
diag_vote.Width = 900;
diag_vote.Height = 500;
diag_vote.Modal = true;
diag_vote.URL = url;
diag_vote.Title ="<%=SystemEnv.getHtmlLabelName(384027,user.getLanguage())%>";
diag_vote.callbackfun = function (paramobj, id1) {
expAjax(id,ptype,id1);
}
diag_vote.show();
}
}
function expAjax(id,ptype,modeids){
if(modeids==-1){modeids=""};
setImpBtnDisable(true);
jQuery("#cancelExpBtn").show();
jQuery("#progressGif").css("background-image", "url(/formmode/images/animated-overlay_wev8.gif)");
jQuery("#progressVal").css("color", "#FD6500");
$.ajax({
type:"post",
url:"/formmode/exttools/impexpAction.jsp",
data:{type:0,id:id,ptype:ptype,pageid:'<%=pageid%>',modeids:modeids},
dataType:"json",
success:function(data){
//location.href=data.downloadurl;
setTimeout(doStatus,200);
}
});
}
function cancelExp(){
$.ajax({
type:"post",
url:"/formmode/exttools/impexpAction.jsp",
data:{type:5,pageid:'<%=pageid%>'},
dataType:"json",
success:function(data){
//location.href=data.downloadurl;
setTimeout(doStatus,200);
}
});
}
/*设置导入按钮是否禁用*/
function setImpBtnDisable(f){
if(f){
jQuery("#uploadBtn").attr("disabled","disabled").addClass("divBtnDisabled");
}else{
jQuery("#uploadBtn").removeAttr("disabled").removeClass("divBtnDisabled");
}
}
function importwf(){
var filename = $("#filename").val();
if(filename==null||filename==''){
alert("请选择文件!");
setImpBtnDisable(false);
return;
}
var id = $("#appid").val();
$("#frmMain").ajaxSubmit({
type:"post",
url:"/formmode/exttools/impexpAction.jsp?id="+id+"&type=6",
enctype:"multipart/form-data",
dataType:"json",
success:function(data){
var haveData = data.haveData;
if(haveData==1){
var url="/formmode/exttools/workflowToModeSet.jsp?appid="+id;
var diag_vote = new window.top.Dialog();
diag_vote.currentWindow = window;
diag_vote.Width = 950;
diag_vote.Height = 500;
diag_vote.Modal = true;
diag_vote.URL = url;
diag_vote.Title ="<%=SystemEnv.getHtmlLabelName(384329,user.getLanguage())%>";
diag_vote.callbackfun = function (paramobj, id1) {
checkData();
}
diag_vote.show();
}else{
checkData();
}
}
});
}
function checkData(){
var id = $("#appid").val();
var ptype = $("#ptype").val();
var isadd = $("#isadd").attr("checked");
isadd = isadd?"1":"0";
$("#frmMain").ajaxSubmit({
type:"post",
url:"/formmode/exttools/impexpAction.jsp?id="+id+"&type=7",
enctype:"multipart/form-data",
dataType:"json",
success:function(data){
var haveData = data.haveData;
if(haveData==1){
var url="/formmode/exttools/impexpDataSet.jsp?appid="+id;
var diag_vote = new window.top.Dialog();
diag_vote.currentWindow = window;
diag_vote.Width = 900;
diag_vote.Height = 500;
diag_vote.Modal = true;
diag_vote.URL = url;
diag_vote.Title ="<%=SystemEnv.getHtmlLabelName(384024,user.getLanguage())%>";
diag_vote.callbackfun = function (paramobj, id1) {
impajax(id,isadd,'0',id1);
}
diag_vote.show();
}else{
impajax(id,isadd,'1','0');
}
}
});
}
function impajax(id,isadd,all,modeids){
setImpBtnDisable(true);
/*document.frmMain.action = "/formmode/exttools/impexpAction.jsp?id="+id+"&type=1&isadd="+isadd;
document.frmMain.submit();
*/
jQuery("#progressGif").css("background-image", "url(/formmode/images/animated-overlay_wev8.gif)");
jQuery("#progressVal").css("color", "#FD6500");
$("#frmMain").ajaxSubmit({
type:"post",
url:"/formmode/exttools/impexpAction.jsp?id="+id+"&type=1&isadd="+isadd+"&pageid=<%=pageid%>&subCompanyId=<%=subCompanyId%>&all="+all+"&modeids="+modeids,
enctype:"multipart/form-data",
dataType:"json",
success:function(data){
setTimeout(doStatus,200);
}
});
}
function onSearchWFQTDate(spanname,inputname){
var oncleaingFun = function(){
$(spanname).innerHTML = '';
inputname.value = '';
}
WdatePicker({el:spanname,onpicked:function(dp){
var returnvalue = dp.cal.getDateStr();
$dp.$(inputname).value = returnvalue;
},oncleared:oncleaingFun});
}
function doClear(){
$("#operator").val('');
$("#operatorspan").html('');
$("#startdate").val('');
$("#enddate").val('');
$("#startdate_span").html('');
$("#enddate_span").html('');
$(".sbSelector").html('');
$("#dataType").val('');
$("#operateType").val('');
$("#objid").val('');
}
function doSubmit(){
enableAllmenu();
document.frmSearch.submit();
}
function showDetail(logid,loglevel){
var title = "<%=this.getHtmlLabelNames("83,17463",user.getLanguage(),"日志明细")%>";
var url="/formmode/exttools/impexplogdetail.jsp?logid="+logid;
if(loglevel){
url += "&loglevel="+loglevel;
}
diag_vote = new window.top.Dialog();
diag_vote.currentWindow = window;
diag_vote.Width = 1000;
diag_vote.Height = 800;
diag_vote.Modal = true;
diag_vote.Title = title;
diag_vote.URL = url;
diag_vote.show();
}
function doStatus(){
$.ajax({
type:"post",
url:"/formmode/exttools/impexpAction.jsp",
data:{type:3,pageid:'<%=pageid%>'},
dataType:"json",
success:function(data){
var inprocess = data.inprocess;
if(inprocess){
var error = data.error;
if(error){
var logid = data.logid;
showDetail(logid);
return;
}
var process = data.process;
var ptype = data.ptype;
if(process!=100){
$("#progressVal").html(process+"%");
if(ptype==0){
var datatype = data.datatype;
if(datatype){
$("#progressContent").html("正在导出"+datatype+"...");
}else{
$("#progressContent").html("正在导出...");
}
}else if(ptype==1){
var datatype = data.datatype;
if(datatype){
$("#progressContent").html("正在导入"+datatype+"...");
}else{
$("#progressContent").html("正在导入...");
}
jQuery("#cancelExpBtn").hide();
}
setTimeout(doStatus,200);
}else{
$("#progressVal").html("0%");
$("#progressContent").html("");
jQuery("#progressGif").css("background-image", "");
jQuery("#progressVal").css("color", "#fff");
jQuery("#cancelExpBtn").hide();
jQuery("#filename").val("");
setImpBtnDisable(false);
if(ptype==0){
finishStatus();
var fileid = data.fileid;
var logid = data.logid;
var url = "/weaver/weaver.file.FileDownload?fileid=" + fileid + "&download=1";
location.href = url;
$("#"+logid+"_caozuo").attr("href",url);
$("#"+logid+"_caozuo").attr('onclick','').unbind('click');
}else{
finishStatus();
var logid = data.logid;
showDetail(logid);
}
}
}else{
finishStatus();
$("#progressVal").html("0%");
$("#progressContent").html("");
setImpBtnDisable(false);
jQuery("#cancelExpBtn").hide();
jQuery("#progressGif").css("background-image", "");
jQuery("#progressVal").css("color", "#fff");
}
}
});
}
function finishStatus(){
$.ajax({
type:"post",
url:"/formmode/exttools/impexpAction.jsp",
data:{type:4,pageid:'<%=pageid%>'}
});
}
function checkUndown(){
top.Dialog.alert("<%=SystemEnv.getHtmlNoteName(4835,user.getLanguage())%>");
}
function deleteModeTowfSet(logid,type){
$.ajax({
type:"post",
url:"/formmode/exttools/workflowToModeSetAction.jsp",
data:{operation:"deleteModeToWf",logid:logid,type:type},
success:function(data){
window.location.reload();
}
});
}
</script>
</html>