找回密码
 注册成为天翎用户
楼主: jianjia

主页出现问题

[复制链接]
 楼主| jianjia 发表于 2012-11-23 11:13:05 | 显示全部楼层
回复 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)+"&nbsp;&nbsp;";                           }
                }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
                                + '&#160;&#160;&#160;</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()+'&amp;_currpage=1&amp;_backURL=%2Fobpm%2Fportal%2Fdispatch%2Fhomepage.jsp&amp;_rowcount=1&amp;_pagelines=10";'
                        +'var viewDocURL = "/obpm/portal/dynaform/document/view.action?application='+getApplication()+'&amp;_currpage=1&amp;_rowcount=1&amp;_pagelines=10&amp;_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;
}
回复

使用道具 举报

spiral 发表于 2012-11-23 11:19:45 | 显示全部楼层
本帖最后由 shary 于 2012-11-23 11:22 编辑

您好,您可以尝试在每句脚本后添加不同内容的打印语句在debug模式的控制台根据打印语句去判断哪条脚本出了问题,我估计是这个函数返回值拼接的内容有问题,所以计算脚本看上去就没有显示出来
回复

使用道具 举报

 楼主| jianjia 发表于 2012-11-23 11:43:55 | 显示全部楼层
回复 11# jianjia

函数有返回值呀!
     return value;
回复

使用道具 举报

shary 发表于 2012-11-23 11:49:58 | 显示全部楼层
楼上同事帖子里说的是您返回的值对应的内容拼接有问题。麻烦按照楼上同事提供给你的方法检查确认一遍。有问题再沟通。谢谢
回复

使用道具 举报

 楼主| jianjia 发表于 2012-11-26 14:42:22 | 显示全部楼层
回复 10# spiral


    解决了。函数库里面的函数出现错误。
回复

使用道具 举报

purple 发表于 2012-11-26 14:54:37 | 显示全部楼层
回复 15# jianjia


    好的,感谢楼主反馈。
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 13:44

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表