FormmodeLogList.jsp
6.19 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
<%@page import="weaver.systeminfo.label.LabelComInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="weaver.formmode.log.FormmodeLog"%>
<%@page import="com.weaver.formmodel.util.DateHelper"%>
<%@page import="java.text.DecimalFormat"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="SubComanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%!
/**
* 获取目录下所有文件(按时间排序)
*
* @param path
* @return
*/
public List<File> getFileSort(String path) {
List<File> list = getFiles(path, new ArrayList<File>());
if (list != null && list.size() > 0) {
Collections.sort(list, new Comparator<File>() {
public int compare(File file, File newFile) {
if (file.lastModified() < newFile.lastModified()) {
return 1;
} else if (file.lastModified() == newFile.lastModified()) {
return 0;
} else {
return -1;
}
}
});
}
return list;
}
/**
*
* 获取目录下所有文件
*
* @param realpath
* @param files
* @return
*/
public List<File> getFiles(String realpath, List<File> files) {
File realFile = new File(realpath);
if (realFile.isDirectory()) {
File[] subfiles = realFile.listFiles();
for (File file : subfiles) {
if (!file.isDirectory()) {
if(file.getName().endsWith(".log")){
files.add(file);
}
}
}
}
return files;
}
%>
<%
if (!HrmUserVarify.checkUserRight("ModeSetting:All", user)) {
response.sendRedirect("/notice/noright.jsp");
return;
}
int modelId = Util.getIntValue(request.getParameter("modelId"), 0);
String titlename = SystemEnv.getHtmlLabelNames("129637",user.getLanguage()) ;//建模引擎设置
int formEngineSetid = Util.getIntValue(request.getParameter("formEngineSetid"),0);
String isEnFormModeReply = "";
RecordSet.executeSql("select * from formEngineSet where isdelete=0");
if(RecordSet.next()){
formEngineSetid = RecordSet.getInt("id");
isEnFormModeReply = RecordSet.getString("isEnFormModeReply");
}
String rootPath = GCONST.getRootPath()+"log"+File.separator+"formmode"+File.separator;
List<File> fileList = getFileSort(rootPath);
%>
<html>
<head>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<script language=javascript src="/js/checkbox/jquery.tzCheckbox_wev8.js"></script>
<script language=javascript src="/js/ecology8/hrm/HrmSearchInit_wev8.js"></script>
<script language=javascript src="/js/ecology8/hrm/e8Common_wev8.js"></script>
<script type="text/javascript">
$(function(){
$("#e8_tablogo").css({"background-image":"url(/js/tabs/images/nav/mnav2_wev8.png)"});
});
</script>
</head>
<body>
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="<%=modelId%>"/>
<jsp:param name="navName" value="<%=titlename%>"/>
</jsp:include>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<form style="margin-top: 0px" id="frmMain" name=frmMain method=post action="/formmode/setup/formEngineSetOperation.jsp">
<input type="hidden" id="formEngineSetid" name="formEngineSetid" value="<%=formEngineSetid%>"/>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right;">
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage())%>" class="cornerMenu"></span>
</td>
</tr>
</table>
<table id="logListTable">
<colgroup>
<col style="width: 50%; ">
<col style="width: 25%; ">
<col style="width: 25%; ">
</colgroup>
<tr>
<th><%=SystemEnv.getHtmlLabelName(84276,user.getLanguage())%></th>
<th><%=SystemEnv.getHtmlLabelName(723,user.getLanguage())%></th>
<th><%=SystemEnv.getHtmlLabelName(2036,user.getLanguage())%></th>
</tr>
<%
DecimalFormat df=new DecimalFormat("#.##");
for (int i = 0; i < fileList.size(); i++) {
File tempFile = fileList.get(i);
long t = tempFile.lastModified();
Date d = new Date(t);
String date = DateHelper.convertDateIntoYYYYMMDDStr(d);
long size = tempFile.length();
String sizeStr="";
if(size>(1024*1024))
sizeStr=df.format(size/(1024.0*1024.0))+"M";
else if(size>1024)
sizeStr=df.format(size/(1024.0))+"K";
else
sizeStr=size+"B";
%>
<tr>
<td style="padding-left: 30px;"><a href="/weaver/weaver.formmode.servelt.DownloadFile?filename=/log/formmode/<%=tempFile.getName() %>"><%=tempFile.getName()%></a></td>
<td align="center"><%=date%></td>
<td align="center"><%=sizeStr%></td>
</tr>
<%}%>
</table>
</form>
</body>
<script type="text/javascript">
function onSubmit(){
frmMain.submit();
}
function formCheckAll() {
if($G("isEnFormModeReply").checked) {
jQuery("#isEnFormModeReply").val(1);
}else{
jQuery("#isEnFormModeReply").val(0);
}
}
function openLogList(){
$("#rightMenu").css("visibility","hidden");
var h = $(window).height();
var w = $(window).width();
alert("==h=="+h+"===w==="+w);
var dialog = new window.top.Dialog();
dialog.currentWindow = window;
dialog.Width = w*0.8 ;
dialog.Height = h*0.8;
dialog.URL = "/formmode/setup/CustomTypeBrowser.jsp";
dialog.callbackfun = function (paramobj, id1) {
} ;
dialog.Title = "<%=SystemEnv.getHtmlLabelName(129637,user.getLanguage())%>";//提示信息
dialog.Drag = true;
dialog.show();
}
</script>
<style>
#logListTable{
width:100%;
border-collapse: collapse;
border: 1px solid #aaa;
}
#logListTable th{
padding: 5px 15px 5px 6px;
background-color: #d5d5d5;
border: 1px solid #aaa;
}
#logListTable td {
vertical-align: text-top;
padding: 6px 15px 6px 6px;
background-color: #efefef;
border: 1px solid #aaa;
}
</style>
</HTML>