页面通用标签
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util,weaver.hrm.common.*,weaver.conn.*" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix=“brow”%>
引入标准jsp标签页
< script language= javascript src= "/js/ecology8/docs/docSearchInit_wev8.js" > < / script>
< % @ include file= "/systeminfo/RightClickMenuConent_wev8.jsp" % >
< % @ include file= "/systeminfo/RightClickMenu_wev8.jsp" % >
< % @ include file= "/systeminfo/init.jsp" % >
< ! -- 引入系统页面,用于判断是否登录,以及获取user对象-- >
< % @ include file= "/systeminfo/init_wev8.jsp" % >
引入产品标准功能代码
< %
if ( HrmUserVarify . checkUserRight ( "HrmCountriesAdd:Add" , user) ) {
RCMenu += "{" + SystemEnv . getHtmlLabelName ( 82 , user. getLanguage ( ) ) + ",javascript:doAdd();,_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
% >
< %= SystemEnv . getHtmlLabelName ( 21995 , user. getLanguage ( ) ) % >
21995 :高级搜索
user. getLanguage ( ) :存储设置的语言格式
铺助脚本
HtmlLabelIndex:预算流程初始化定义表- HtmlLabelIndex
HtmlLabelInfo:预算流程初始化定义表
systemrightdetail:系统权限详细表
systemrightslanguage: 系统权限语言表
systemrights:系统权限表
systemrightdetail:系统权限详细表
控件
浏览按钮
< brow: browser
name= “workflowid”
viewType= “0 ”
hasBrowser= “true ”
hasAdd= “false ”
browserUrl= "/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowBrowser_frm.jsp"
isMustInput= “2 ”
isSingle= “true ”
hasInput= “true ”
completeUrl= "/data.jsp?type=workflowBrowser&isTemplate=0"
width= “300px”
browserValue= ""
browserSpanValue= ""
onPropertyChange= ""
_callback= ""
_callbackParams= ""
/ >
< brow: browser
viewType= "0"
id= "pName"
name= "pName"
browserValue= ""
browserUrl= "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp?selectedids="
hasInput= "true"
isSingle= "true"
hasBrowser= "true"
isMustInput= '1'
completeUrl= "/data.jsp"
linkUrl= "javascript:openhrm($id$)"
width= "165px"
browserSpanValue= "" / >
< brow: browser
name= "userid"
viewType= "0"
hasBrowser= "true"
hasAdd= "false"
browserUrl= '<%="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp" %>'
isMustInput= "2"
isSingle= "false"
hasInput= "true"
completeUrl= "/data.jsp?type=1"
width= "300px"
browserValue= ''
browserSpanValue= '' / >
布局控件
/*布局控件*/
< wea: layout type = " diycol" >
< wea: group context = " 历史请假查询" >
< wea: item attributes = " {' isTableList' :' true' ,' colspan' :' full' }" >
< wea: SplitPageTag tableString = " <%=tableString%>" mode = " run" />
</ wea: item>
</ wea: group>
</ wea: layout>
必填校验
< wea: required id = " aaspan" required = " true" >
下拉组件
/*下拉组件*/
< select name = " LeaveType" id = " LeaveType" >
< option value = " " > </ option>
<%for(String key:map.keySet()){ %>
< option value = " <%=key+" -"+map.get(key) % > "
<%if(LeaveType.equals(key+"-"+map.get(key))){ %> selected <%} %>><%=key+"-"+map.get(key) %>
</ option>
<%} %>
</ select>
编辑表格与分页表格报表
/*可编辑表格*/
var option = {
basictitle:"可编辑表格标题。。。",
optionHeadDisplay:"none",
colItems:items,
container:"#FieldList", //显示容器的id
configCheckBox:true,
usesimpledata:true, //true|fase 当值为true时,则该可编辑表格默认以初始化数据初始化,初始化的具体数据配置详见initdatas
initdatas:initjsondatas,
canDrag:true,
orderField:'orderid',
//addrowCallBack:marcallback,//添加行时,回调的方法
checkBoxItem:{"itemhtml":'< input name = " id" class = " groupselectbox" type = " checkbox" value = " -1" > ',width:"5%"}
};
-- 填充数据
var initjsondatas = [[{'name': 'id', 'value': '11','iseditable': 'true','type': 'checkbox'},
{'name': 'fieldid', 'value': '3', 'label': '程序媛', 'iseditable': 'true','type': 'browser'},
{'name': 'wb','value': '程序媛','iseditable': true, 'type': 'input' },
{'name': 'xlk','value': '1', 'iseditable': true, 'type': 'select'},
{'name': 'orderid','value': '1', 'iseditable': true, 'type': 'input'}
], [{'name': 'id', 'value': '12','iseditable': 'true','type': 'checkbox'},
{'name': 'fieldid', 'value': '14', 'label': 'cjr', 'iseditable': true, 'type': 'browser'},
{'name': 'wb','value': 'cjr','iseditable': true,'type': 'input'},
{'name': 'xlk','value': '2','iseditable': true, 'type': 'select'},
{'name': 'orderid','value': '2', 'iseditable': 'true', 'type': 'input'}]]
--编辑表格表头设置
var items=[
{width:"10%",colname:"浏览按钮<SPAN class=\".e8tips\" style=\"CURSOR: hand\" id=remind_m title=\"<%=tiptitle %>\"><IMG id=ext-gen124 align=absMiddle src=\"/images/remind_wev8.png\"></ SPAN> ",itemhtml:item_browser},
{width:"20%",colname:"文本框",itemhtml:"< input name = ' wb' id = ' wb' type = ' text' value = ' 默认值' /> "},
{width:"20%",colname:"下拉框",itemhtml:"< select name = ' xlk' id = ' xlk' > < option value = ' ' > 全部</ option> < option value = ' 1' > AA</ option> < option value = ' 2' > BB</ option> </ select> "},
{width:"20%",display:'none',colname:"排序",itemhtml:"< input name = ' orderid' id = ' orderid' type = ' text' /> "}
];
--浏览框指定页面填充
var item_browser = "< span class = ' browser' viewType = ' 0' _callback = ' UserCallBack' _callbackParams = ' _#rowIndex#' hasInput = ' true' name = ' fieldid' getBrowserUrlFn = ' getBrowserUrlFn' isMustInput = ' 1' isSingle = ' false' completeUrl = ' /data.jsp' > </ span> " ;
--功能显示
groupAction=new WeaverEditTable(option);
jQuery("#FieldList").append(groupAction.getContainer());
--数据删除
function deleteAction(){
//top.Dialog.confirm("<%=SystemEnv.getHtmlLabelNames("15097",user.getLanguage())%>",function(){
groupAction.deleteRows();
//});
内部数据
< form id = " frmmain" name = frmmain method = post action = " HisList.jsp" >
</ form>
< wea: item attributes = " {' isTableList' :' true' ,' colspan' :' full' }" >
<%
String backfields =" * ";
String fromSql = " JD_LeaveHistory ";
String orderby = " startDateLeave ";
//out.print("select "+backfields+fromSql+sqlWhere);
String tableString =" <table pagesize=\""+perpage+"\" tabletype=\"checkbox\">"+
" <sql backfields=\""+backfields+"\" "+
" sqlform=\""+fromSql+"\" sqlwhere=\""+sqlWhere+"\" sqlorderby=\""+orderby+"\" sqlprimarykey=\"id\" sqlsortway=\"desc\" sqlisdistinct=\"false\"/>"+
" < head> "+
"<col width=\"100px\" text=\"单据编号\" column=\"receipt\" />"+
"<col width=\"80px\" text=\"假期类型编码\" column=\"vacationType\" />"+
"<col width=\"100px\" text=\"假期类型名称\" column=\"holidayType\" />"+
"<col width=\"100px\" text=\"请假开始日期\" column=\"startDateLeave\" />"+
"<col width=\"100px\" text=\"开始时间\" column=\"startAfternoon\" />"+
"<col width=\"100px\" text=\"请假结束日期\" column=\"endDateLeave\" />"+
"<col width=\"100px\" text=\"结束时间\" column=\"endUpperAfternoon\" />"+
"<col width=\"100px\" text=\"请假时长\" column=\"leavetime\" />"+
"<col width=\"100px\" text=\"单据状态\" column=\"documentsState\" />"+
"<col width=\"100px\" text=\"业务状态\" column=\"businessState\" />"+
"</ head> "+
"</ table> ";
%>
< wea: SplitPageTag tableString = " <%=tableString%>" mode = " run" />
</ wea: item>
tableString:执行脚本和对应的字段显示题头
外部数据源
< form action = " demo_edittableoperation.jsp" method = " post" id = " weaver" name = " weaver" >
< wea: layout type = " fourCol" >
< wea: group context = " 数据列表" >
< wea: item attributes = " {' isTableList' :' true' ,' colspan' :' full' }" >
<%
String tableString = ""; //定义表格xml数据
// 指定分页条数和初始化 id以及是否有复选框 以及数据来源 datasource表示数据来源 sourceparams表示传入参数参数格式为"name:value+name1:value1"多个参数用加号连接
tableString = " <table instanceid=\"ds_list\" tabletype=\"checkbox\" datasource=\"weaver.oatest.DemoUtil.getDemoData\" sourceparams=\"loginid:"
+ user.getUID() + "+departmentid:" + user.getUserDepartment() + "\" pagesize=\"5\" >"
+ " <checkboxpopedom id=\"checkbox\" popedompara=\"column:id\" showmethod=\"weaver.oatest.DemoUtil.getCanCheck\" />"
+ //用于控制checkbox 框是否可用
" <sql backfields=\"*\" sqlform=\"tmptable\" sqlwhere=\"\" sqlorderby=\"\" sqlprimarykey=\"id\" sqlsortway=\"asc\" sqlisdistinct=\"false\" />"
+ " < head> " + " <col width=\"10%\" text=\"数据ID\" column=\"id\" orderkey=\"id\" />"
+ " <col width=\"20%\" text=\"数据名称\" column=\"lastname\" />"
+ " <col width=\"20%\" text=\"用户名称\" column=\"loginid\" />" + " </ head> " + " < operates> "
+ //相关操作
" <popedom column=\"id\" otherpara=\"column:loginid\" transmethod=\"weaver.oatest.DemoUtil.getCanOperation\"></ popedom> "
+ //用于控制操作菜单是否可用
" <operate href=\"javascript:onDel();\" text=\""
+ SystemEnv.getHtmlLabelName(91, user.getLanguage())
+ "\" otherpara=\"column:loginid\" target=\"_self\" index=\"0\"/>"
+ " <operate href=\"javascript:onshowlog();\" text=\""
+ SystemEnv.getHtmlLabelName(83, user.getLanguage())
+ "\" otherpara=\"column:loginid\" target=\"_self\" index=\"1\"/>" + " </ operates> "
+ " </ table> ";
%>
< wea: SplitPageTag tableString = ' <%=tableString%>' mode = " run" />
</ wea: item>
</ wea: group>
</ wea: layout>
</ form>
action:这里有点不同,是指当前页面的文件名称
</ span>
弹出框组件
< script language = " javascript" src = " /wui/theme/ecology8/jquery/js/zDialog_wev8.js" > </ script>
< script language = " javascript" type = " text/javascript" >
function openDialog ( title, url ) {
var dlg = new window. top. Dialog ( ) ;
dialog. currentWindow = window;
dlg. Model = true ;
dlg. Width = 500 ;
dlg. Height = 400 ;
dlg. URL = url;
dlg. Title = title;
dlg. show ( ) ;
}
</ script>
右键菜单
< % @ include file= "/systeminfo/RightClickMenuConent_wev8.jsp" % >
< %
RCMenu += "{提交表单,javascript:doSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{返回,/main.jsp,_self} " ;
RCMenuHeight += RCMenuHeightStep;
% >
< % @ include file= "/systeminfo/RightClickMenu_wev8.jsp" % >
weaverTree树形组件
< link rel= "stylesheet" href= "/css/ecology8/request/leftNumMenu_wev8.css" type= "text/css" / >
< script type= "text/javascript" src= "/js/ecology8/request/leftNumMenu_wev8.js" > < / script>
< link rel= "stylesheet" href= "/wui/common/jquery/plugin/zTree/css/zTreeStyle/zTreeStyle_wev8.css" type= "text/css" >
< script type= "text/javascript" src= "/wui/common/jquery/plugin/zTree/js/jquery.ztree.core_wev8.js" > < / script>
< % @ include file= "/systeminfo/leftMenuCommon.jsp" % >
$ ( ".ulDiv" ) . leftNumMenu ( demoLeftMenus, {
numberTypes : {
flowNew : {
hoverColor : "#EDCEAF" ,
color : "#FFA302" ,
title : "新的流程"
} ,
flowResponse : { hoverColor : "#C0D8B8" , color : "#486C3E" , title : "超时的流程" } ,
flowOut : { hoverColor : "#DAC0E3" , color : "#C325FF" , title : "有反馈的流程" } ,
flowAll : { hoverColor : "#A6A6A6" , color : "black" , title : "全部流程" }
} ,
} ) ;
showZero : false ,
日期控件
< span class = " wuiDateSpan" selectId = " dateselect" selectValue = " " >
< input class = wuiDateSel type = " hidden" id = " datefrom" name = " datefrom" value = " " >
< input class = wuiDateSel type = " hidden" id = " dateto" name = " dateto" value = " " >
1、class=" wuiDate" 这个是必须要写的
2、_ callback:指选中完后调用的回调函数
开关组件
< link href = " /js/checkbox/jquery.tzCheckbox_wev8.css" type = text/css rel = STYLESHEET>
< script type = " text/javascript" src = " /js/ecology8/jNice/jNice/jquery.jNice_wev8.js" > </ script>
注意tzCheckbox="true"是固定的,不能随意改动!
菜单的点击事件
示例:
clickFunction : function ( attr, level, numberType ) {
var v = '' ;
if ( level== 1 ) {
v = attr. typeid;
} else {
v = attr. workflowid;
}
parent. jQuery ( "#contentframe" ) . attr ( "src" , "/gsoa/oaproject/weavertree/body.jsp?level=" + level+ "&value=" + v) ;
} } ) ;