天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2958|回复: 0

[函数] 无流程做待办任务【函数-noneFlowPadding】

[复制链接]
purple 发表于 2011-11-29 11:31:37 | 显示全部楼层 |阅读模式
本帖最后由 purple 于 2012-12-31 14:07 编辑

函数格式:
noneFlowPadding(paddingName, sql, fieldNames, width, height)
函数说明:
paddingName:待办任务名称
sql: SQL条件语句
fieldNames:名称
width:视图的宽度
height:视图的高度
示例:
实现noneFlowPadding(paddingName, sql, fieldNames, width, height)函数的应用
function noneFlowPadding(paddingName, sql, fieldNames, width, height) {
        var w = "320px";
        var h = "250px";
        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 class="table-text">' + '<td id="pd" nowrap="nowrap" onMouseOver="this.className=\'over\'" onMouseOut="this.className=\'out\'">' + '<img src="/obpm/resource/img/unRd.gif" alt="未读"  name="isUnRdImg" id="qq"/>' + '<a href="javaScript:viewDoc(\'' + doc.getId() + '\',\'' + doc.getFormid() + '\',' + null + ')">' + tempvalue + '&nbsp;&nbsp;&nbsp;</a></td></tr>';
                }
                value = '<div border=\'0\' style=\'margin-left:8px;background-color:white;height=' + h + '; width=' + w + ';overflow:auto\' ><link rel="stylesheet" href="/obpm/resource/css/main.css" type="text/css">' + '<div class="window list-table" style="margin:15px 10px 15px 10px;">' + '<div scope="col" class="column-head" 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/pending01.gif" />' + '<font style="font-size: 14px;cursor: context">' + paddingName + '</font>' + '</div><div class="context"><table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>' + temp + '</tr></table>' + '</div><div class="title" align="right">' + '<span align="right">' + '</SPAN>第1页/小计1页 </span>' + '</div></div>';
                value += '<script type="text/javascript">' + 'function viewDoc(docid, formid,reminderid) {' + 'if (docid && formid) {' + 'var viewDocURL = "/obpm/portal/dynaform/document/view.action?_currpage=1&amp;_backURL=%2Fobpm%2Fportal%2Fdispatch%2Fhomepage.jsp&amp;_rowcount=1&amp;_pagelines=10";' + 'viewDocURL += "&_docid=" + docid;' + 'viewDocURL += "&_formid=" + formid;' + 'viewDocURL += "&reminderid=" + reminderid;' + 'window.location.href = viewDocURL;' + '}' + '}' + '</script></div>';
        }
        return value;
}

本版积分规则

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

GMT+8, 2026-8-12 09:37

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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