|
|
回复 10# spiral
主页还是显示不出来。
在计算脚本写代码:
#include "flow";
var sql = "select * from tlk_公告栏表单 ORDER BY `ITEM_修改时间` DESC LIMIT 5 ";
noneFlowPadding("公告栏",sql,["标题","发表时间"]);
函数库flow:
/*无流程做待办任务**/
function noneFlowPadding(paddingName,sql,fieldNames,width,height){
var w = "100%";
var h = "100%";
if(width) w = width;
if(height) h = height;
var datas = queryBySQL(sql);
var temp = "";
var value = "";
var count = 1;
var tempvalue="";
if (datas.size() > 0) {
for ( var it = datas.iterator(); it.hasNext();) {
var doc = it.next();
if(fieldNames.constructor==Array){
count=fieldNames.length;
tempvalue="";
for(var i=0;i<count;i++){
tempvalue+=doc.getItemValueAsString(fieldNames)+" "; }
}else{
tempvalue=doc.getItemValueAsString(fieldNames);
}
temp += '<tr>'
+'<td id="pd" onMouseOver="this.className='over'" onMouseOut="this.className='out'" style="margin-top:2px;">'
+'<img src="/obpm/resource/img/unRd.gif" alt="未读" name="isUnRdImg"/>'
+'<a style="width:85%" href="javaScript:viewDoc(''
+ doc.getId()
+ '',''
+ doc.getFormid()
+ '','
//+ null
+false
+ ')">'
+ tempvalue
+ '   </a></td></tr>';
}
}
value = '<div class='ElementDiv' border='0' style='padding:5px;background-color:white;height='+h+'; width='+w+';overflow:auto' >'
+'<div scope="col" class="column-head3" scope="row" id="header" style="border: 0px solid #ffcc00;font-size: 13px;cursor:move;" background="">'
+'<img alt="pending-head" id="image1" src="/obpm/resource/imgnew/pending_head.gif" />'
+'<font style="font-size: 14px;cursor: context">'+paddingName+'</font>'
+'</div><div class="context" style="margin-top:5px;" ><table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-homepage">'
+ temp
+'</table>'
+'</div><div align="left">'
+'</div>';
value += '<script type="text/javascript">'
+'function viewDoc(docid, formid,reminderid) {'
+'if (docid && formid) {'
//+'var viewDocURL = "/obpm/portal/dynaform/document/view.action?application='+getApplication()+'&_currpage=1&_backURL=%2Fobpm%2Fportal%2Fdispatch%2Fhomepage.jsp&_rowcount=1&_pagelines=10";'
+'var viewDocURL = "/obpm/portal/dynaform/document/view.action?application='+getApplication()+'&_currpage=1&_rowcount=1&_pagelines=10&_backURL=%2Fobpm%2Fportal%2Fdispatch%2Fhomepage.jsp?application='+getApplication()+'";'
+'viewDocURL += "&_docid=" + docid;'
+'viewDocURL += "&_formid=" + formid;'
+'viewDocURL += "&reminderid=" + reminderid;'
+'window.location.href = viewDocURL;'
+'}'
+'}'
+'</script></div>';
return value;
} |
|