DefaultView.jsp
9.35 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/page/maint/common/initNoCache.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@ page import="weaver.general.*"%>
<%@ page import="weaver.docs.docs.DocImageManager"%>
<%
String userid = user.getUID()+"";
String hrmid = Util.null2String(request.getParameter("hrmid"));
if(hrmid.equals("")) hrmid = userid;
/**
String sql = "select top 10 t1.id,t1.content,t1.hrmid,t1.docids,t1.wfids,t1.crmids,t1.projectids,t1.meetingids,
t1.fileids,t1.createdate,t1.createtime,t2.id as taskid,t2.name "
+",(select top 1 tlog.operatedate+' '+tlog.operatetime from TM_TaskLog tlog where tlog.taskid=t2.id
and tlog.type=0 and tlog.operator="+userid+" order by tlog.operatedate desc,tlog.operatetime desc)
as lastviewdate"
+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
+" and (t2.creater="+userid+" or t2.principalid="+userid+"
or exists (select 1 from TM_TaskPartner tp where tp.taskid=t2.id and tp.partnerid="+userid+"))"
+" and t1.hrmid<>"+userid
+" order by t1.createdate desc,t1.createtime desc";
//System.out.println(sql);
*/
%>
<style type="text/css">
.datatable{width: 100%;}
.datatable td{padding-top:1px;padding-bottom:1px;text-align: left;}
.datatable td.title{color: #999999;vertical-align: top;padding-top: 7px;padding-bottom: 7px;
padding-left: 20px;background: #F6F6F6;border-top: 1px #F6F6F6 solid;border-bottom: 1px #F6F6F6 solid;}
.datatable td.data{vertical-align: middle;border-top: 1px #fff solid;border-bottom: 1px #E8E8E8 dashed;
padding-bottom: 10px;}
#rightinfo a,#rightinfo a:active,#rightinfo a:visited{text-decoration: none;color: #000000;}
#rightinfo a:hover{text-decoration: underline;color: #0080FF;}
.feedbackshow{width: 90%;margin-left: 20px;margin-top: 5px;overflow: hidden;background:#fff;}
.fbtime{
float:none;
}
.feedbackinfo{width: auto;line-height: 24px;color: #808080;}
.feedbackinfo a,.feedbackinfo a:active,.feedbackinfo a:visited{
text-decoration: none !important;color: #808080 !important;}
.feedbackinfo a:hover{text-decoration: underline !important;color: #0080FF !important;}
.feedbackrelate{width: auto;line-height: 24px;background: #F9F9F9;overflow:hidden;);
}
.feedbackrelate .relatetitle{color: #808080}
.feedbackrelate a,.feedbackrelate a:active,.feedbackrelate a:visited{
text-decoration: none !important;color: #1D76A4 !important;}
.feedbackrelate a:hover{text-decoration: underline !important;color: #FF0000 !important;}
.feedbackshow p{padding: 0px;margin: 0px;line-height: 20px !important;}
.dtab{line-height: 25px;float:left;margin-left: 5px;margin-top: 4px;font-weight: bold;
width: 65px;text-align: center;font-family: 微软雅黑;color: #9D9D9D;cursor: pointer;}
.dtab_hover{background: #E0E0E0;}
.dtab_click{color:#000;}
.fbreply{
margin-right:20px;
margin-bottom:20px;
}
</STYLE>
<div id="rightinfo" style="width: 100%;height: 100%;position: relative;overflow: hidden;background: #f7f7f7 !important;">
<div style="width: 100%;height: 40px;position: relative;">
<div style="position: absolute;top: 3px;left:0px;height: 23px;width: 100%;">
<div class="dtab dtab_click" _infoid="maininfo" style="margin-left:10px;">最新反馈</div>
<div class="dtab" _infoid="mainiframe"></div>
<div id="blogmore" style="float: right;margin-top: 8px;margin-right: 8px;cursor: pointer;
font-style: italic;font-family: Arial;color: #959595;display:none;" title="我的微博"
onclick="openFullWindowHaveBar('/blog/blogView.jsp')">more</div>
</div>
</div>
<%
int _pagesize = 10;
int _total = 0;//总数
String sql = "";
int ifMySelf = 0;//0是查看自己 1不是
if(userid.equals(hrmid)){
sql = "select count(distinct t1.id) "
+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
+" and (t2.creater="+userid+" or t2.principalid="+userid
+" or exists (select 1 from TM_TaskPartner tp where tp.taskid=t2.id and tp.partnerid="+userid+")"
+" or exists (select 1 from TM_TaskSharer ts where ts.taskid=t2.id and ts.sharerid="+userid+"))"
+" and t1.hrmid<>"+userid;
//System.out.println(sql);
}else{
String currentDate = TimeUtil.getCurrentDateString();
String sevenDay = TimeUtil.dateAdd(currentDate,-6);
sql = "select count(distinct t1.id) "
+" from TM_TaskFeedback t1,TM_TaskInfo t2 "
+" where t1.taskid=t2.id and (t2.deleted=0 or t2.deleted is null)"
+" and t1.hrmid="+hrmid
+" and t1.createdate>='"+sevenDay+"' and t1.createdate <= '"+currentDate+"'";
ifMySelf = 1;
}
rs.executeSql(sql);
if(rs.next()){
_total = rs.getInt(1);
}
//System.out.println("_total:"+_total);
%>
<div id="maininfo" style="width:100%;height: auto;position:absolute;top:40px;left:0px;bottom:0px;
line-height: 40px;font-size: 14px;" class="scroll1 datainfo" align="center">
<table id="feedbacktable" class="datatable" style="width: 100%;margin: 0px auto;text-align: left;"
cellpadding="0" cellspacing="0" border="0">
<%if(_total==0){ %>
<tr>
<td class="">
<div class="feedbackshow" style="border:1px solid #e4e4e4;">
<div class="feedbackinfo" style="font-style:italic;color:#999999;height:30px;line-height:30px;padding-left:18px;">
暂无相关反馈信息!
</div>
</div>
</td>
</tr>
<%} %>
</table>
<div id="btn_more" class="" style="display:none;margin-bottom: 10px;cursor:pointer;color:#696969;"
_currentpage="0"
_pagesize="<%=_pagesize %>" _total="<%=_total %>" onclick="getList(this)" title="显示更多数据">更多</div>
</div>
<iframe id="mainiframe" name="mainiframe" class="datainfo" style="width: 100%;height:100%;display:none"
src="" frameborder="0"></iframe>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#maininfo').perfectScrollbar({"wheelSpeed": 40});
<%if(_total>0){ %>getList($("#btn_more"))<%}%>
$("div.dtab").bind("mouseover",function(){
$(this).addClass("dtab_hover");
}).bind("mouseout",function(){
$(this).removeClass("dtab_hover");
}).bind("click",function(){
$("div.dtab").removeClass("dtab_click");
$(this).addClass("dtab_click");
var _infoid = $(this).attr("_infoid");
$(".datainfo").hide();
$("#"+_infoid).show();
if(_infoid=="mainiframe"){
$("#blogmore").show();
if($("#mainiframe").attr("src")=="")
$("#mainiframe").attr("src","/blog/viewBlog.jsp?blogid=<%=hrmid %>");
}else{
$("#blogmore").hide();
}
});
$("#blogmore").bind("mouseover",function(){
$(this).css("color","#747474");
}).bind("mouseout",function(){
$(this).css("color","#959595");
});
var iframe1 = document.getElementById("mainiframe");
if (iframe1.attachEvent){
iframe1.attachEvent("onload", function(){
setHidden();
});
} else {
iframe1.onload = function(){
setHidden()
};
}
});
function setHidden(){
//alert($(window.frames["mainiframe"].document).find("div.TopTitle").html());
$(window.frames["mainiframe"].document).find("div.TopTitle").hide();
}
function displayLoading(){
}
function getList(obj){
var _currentpage = parseInt($(obj).attr("_currentpage"))+1;
var _pagesize = $(obj).attr("_pagesize");
var _total = $(obj).attr("_total");
$(obj).html("<img src='/workrelate/task/images/loading2.gif' style='margin-top:3px;' align='absMiddle'/>");
$.ajax({
type: "post",
url: "Operation.jsp",
data:{"operation":"get_more_fb","currentpage":_currentpage,"hrmid":"<%=hrmid%>",
"pagesize":_pagesize,"total":_total,"ifMySelf":"<%=ifMySelf%>"},
contentType : "application/x-www-form-urlencoded;charset=UTF-8",
complete: function(data){
var records = $.trim(data.responseText);
$("#feedbacktable").append(records);
if("<%=ifMySelf%>"==0){
if(_currentpage*_pagesize>=_total){
$("#btn_more").hide();
}else{
$(obj).attr("_currentpage",_currentpage).html("显示更多");
$("#btn_more").show();
}
}
$('#maininfo').perfectScrollbar("update");
}
});
}
</script>
<%!
public String getFileDoc(String ids,String taskId) throws Exception{
String returnstr = "";
String docid = "";
String docImagefileid = "";
int docImagefileSize = 0;
String docImagefilename = "";
DocImageManager DocImageManager = null;
if(ids != null && !"".equals(ids)){
List idList = Util.TokenizerString(ids, ",");
for (int i = 0; i < idList.size(); i++) {
docid = Util.null2String((String)idList.get(i));
if(!docid.equals("")){
DocImageManager = new DocImageManager();
DocImageManager.resetParameter();
DocImageManager.setDocid(Integer.parseInt((String)idList.get(i)));
DocImageManager.selectDocImageInfo();
DocImageManager.next();
docImagefileid = DocImageManager.getImagefileid();
docImagefileSize = DocImageManager.getImageFileSize(Util.getIntValue(docImagefileid));
docImagefilename = DocImageManager.getImagefilename();
returnstr += "<a href=javaScript:openFullWindowHaveBar('/workrelate/task/util/ViewDoc.jsp?id="
+docid+"&taskId="+taskId+"') >"+docImagefilename+"</a>";
returnstr += " <a href='/workrelate/task/util/ViewDoc.jsp?id="
+docid+"&taskId="+taskId+"&fileid="+docImagefileid+"'>下载("+docImagefileSize/1000+"K)</a> ";
}
}
}
return returnstr;
}
%>