| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
- <div class="easyui-layout" fit="true">
- <div region="center" style="padding: 0px; border: 0px">
-
-
- <div id="container" style="display: none;">
- <div class="lightbox"></div>
- <div id="pop" class="pop">
- <canvas id="the-canvas"></canvas>
- </div>
- </div>
- <!-- 通过隐藏文本,记录动态列的一级标题 -->
- <input hidden="" id = 'headerlist' value="${headerlist}">
- <t:datagrid name="jeecgDemoList" checkbox="true"
- onLoadSuccess="callbackTeacherSelect" sortName="birthday,name"
- pagination="true" fitColumns="false" title="jeecg_demo"
- actionUrl="jeecgListDemoController.do?datagrid" idField="id"
- fit="true" queryMode="group">
- <t:dgCol title="id" field="id" hidden="true" queryMode="group"
- width="120"></t:dgCol>
- <t:dgCol title="名称" field="name" query="true" rowspan="2"
- autocomplete="true" width="120"></t:dgCol>
- <t:dgCol title="年龄" extend="{style:'width:50px'}"
- style="background-color:#3a87ad_50,background-color:#f89406_100"
- editor="numberbox" field="age" query="true" width="120"></t:dgCol>
- <t:dgCol title="生日" hidden="true"
- field="birthday" formatter="yyyy-MM-dd" queryMode="group"
- width="120"></t:dgCol>
- <t:dgCol title="部门" field="depId" query="true"
- queryMode="single" dictionary="t_s_depart,id,departname, and org_type != '1' " width="120"></t:dgCol>
- <t:dgCol title="部门code" field="extField" ></t:dgCol>
- <t:dgCol title="性别" field="sex" query="true" dictionary="sex"
- width="120" extendParams="styler:fmtype"></t:dgCol>
- <!-- 遍历动态列,将动态列添加至此 -->
- <c:forEach items="${titlelist}" var="temp">
- <t:dgCol title="${temp.title}" field="${temp.field}"></t:dgCol>
- </c:forEach>
- <t:dgCol title="操作" field="opt" rowspan="2"></t:dgCol>
- <t:dgDelOpt title="删除" url="jeecgListDemoController.do?doDel&id={id}"
- urlclass="ace_button" urlfont="fa-trash-o" />
- <t:dgFunOpt exp="status#eq#N" title="审核" funname="szqm(id)"
- urlclass="ace_button" urlfont="fa-check" />
- <t:dgFunOpt title="头像管理" funname="showfujian(id)"
- urlclass="ace_button" urlfont="fa-check" />
- <t:dgFunOpt title="显示报表" funname="testTarget(id)"
- urlclass="ace_button" urlfont="fa-check" />
- <t:dgToolBar id="addbtn" title="录入" icon="icon-add" operationCode="add"
- url="jeecgListDemoController.do?goAdd" funname="add" width="770"
- height="500"></t:dgToolBar>
- <t:dgToolBar id="addbtn" title="pdf预览" icon="icon-add" operationCode="add"
- url="tSysFileController.do?showpdfview&fileUrl=touxiang/157c6443-eb54-4fa7-a258-d26d0bd5ba3c.pdf" funname="add" width="770"
- height="500"></t:dgToolBar>
- <t:dgToolBar title="录入-提交按钮" icon="icon-add" operationCode="add"
- url="jeecgListDemoController.do?addWithbtn" funname="addWithbtn"
- width="770"></t:dgToolBar>
- <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit"
- funname="dialogwithoutsavebtn" width="770"></t:dgToolBar>
- <t:dgToolBar title="批量删除" icon="icon-remove" operationCode="remove"
- url="jeecgListDemoController.do?doBatchDel"
- funname="deleteALLSelect"></t:dgToolBar>
- <t:dgToolBar title="查看" icon="icon-search"
- url="jeecgListDemoController.do?goUpdate" funname="detail"
- width="770"></t:dgToolBar>
- <t:dgToolBar title="附件列表" icon="icon-search" funname="fujianliebiao"
- width="770"></t:dgToolBar>
- <t:dgToolBar title="导入" icon="icon-putout" operationCode="put" funname="ImportXls"></t:dgToolBar>
- <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
- <t:dgToolBar title="模板下载" icon="icon-putout" operationCode="putout" funname="ExportXlsByT"></t:dgToolBar>
- <t:dgToolBar operationCode="print" title="打印" icon="icon-print" operationCode="print"
- url="jeecgListDemoController.do?print" funname="detail" width="610"
- height="330"></t:dgToolBar>
- <t:dgToolBar title="加载百度" icon="icon-print" operationCode="print" url="#"
- funname="testReloadPage"></t:dgToolBar>
- <%-- <t:dgToolBar title="加载新页面" icon="icon-print" operationCode="print" funname="addNewPage(id)"></t:dgToolBar> --%>
- </t:datagrid>
- </div>
- </div>
- <div id="frReportDiv" style="display: none"></div>
- <script type="text/javascript">
- $(function(){
- dateGridTitleMerge();
- });
-
-
- //列表字段颜色 demo,逻辑判断函数
- function fmtype(val, row, index) {
- //可添加更多CSS样式
- var s1 = 'background-color:#f89406;color:#FFF;';
- var s2 = 'background-color:#3a87ad;color:#FFF;';
- var s3 = 'background-color:#21B9BB;';
- if (val == '1') {
- return s1
- }
- if (val == '0') {
- return s2
- }
- return s3
- }
- function rowclick(rowIndex, rowData) {
- tip(rowIndex);
- $('#addbtn').attr("disabled", true);
- }
- function callbackTeacherSelect() {
- var mergeFileds = [ {
- mergeFiled : "age"
- }, //合并列的field数组及对应前提条件filed(为空则直接内容合并)
- {
- mergeFiled : "depId",
- premiseFiled : "age"
- }, //合并列的field数组及对应前提条件filed(为空则直接内容合并)
- {
- mergeFiled : "sex",
- premiseFiled : "age"
- }, {
- mergeFiled : "status",
- premiseFiled : "age"
- }, {
- mergeFiled : "extField"
- } ];
- commonMergeCells("jeecgDemoList", mergeFileds);
- }
- function fujianliebiao() {
- var rowsData = $("#jeecgDemoList").datagrid('getSelections');
- if (!rowsData || rowsData.length == 0) {
- tip('请选择一行');
- return;
- }
- if (rowsData.length > 1) {
- tip('Please select an item to view');
- return;
- }
- var busiTable = 'jeecg_demo';
- var tagetType = 'fujian';
- var busiId = rowsData[0].id;
- ;
- var remark = '';
- var webUpload = {
- busiTable : busiTable,
- busiId : busiId,
- extensions : 'doc,docx',
- bizType : tagetType,
- remark : remark
- };
- showFileList(webUpload);
- }
- function testReloadPage() {
- }
- function dateGridTitleMerge() {
- var dg = $('#jeecgDemoList');
-
- var mycolumes = [];
-
- mycolumes[0] = [];
- //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为一二级标题的列 或者是已知的一级标题 添加至此------
-
- mycolumes[0].push(dg.datagrid("getColumnOption", "name"));
- mycolumes[0].push( {title : '个人信息',colspan : 2});
- mycolumes[0].push( {title : '公司信息',colspan : 2});
- //--author:zhaohualong-----end----date:2017年9月8日--------for:将固定列 且固定列为一二级标题的列 或者是已知的一级标题 添加至此------
-
- //--author:zhaohualong-----start----date:2017年9月8日--------for:遍历由后台传来的一级标题,将其添加至此------
- var headerlist= $('#headerlist').val().split(",");
- for(var i = 0; i < headerlist.length; i++){
- mycolumes[0].push({title : headerlist[i],colspan : 2});
- }
- //--author:zhaohualong-----end----date:2017年9月8日--------for:遍历由后台传来的一级标题,将其添加至此------
- mycolumes[0].push(dg.datagrid("getColumnOption", "opt"));
- mycolumes[1] = [];
- //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为二级标题的列 添加至此------
- mycolumes[1].push(dg.datagrid("getColumnOption", "age"));
- mycolumes[1].push(dg.datagrid("getColumnOption", "sex"));
- mycolumes[1].push(dg.datagrid("getColumnOption", "depId"));
- mycolumes[1].push(dg.datagrid("getColumnOption", "extField"));
- //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为二级标题的列 添加至此------
-
-
- //通过getColumnFields 获取所有的列名称, 通过列名称首字符筛选动态列,遍历获取所有的动态列,将其添加至此------
- var fields = dg.datagrid("getColumnFields");
- for(var i = 0; i < fields.length; i++){
- if(fields[i].substr(0,12)=='dynamicfield')
- mycolumes[1].push(dg.datagrid("getColumnOption", fields[i]));
- }
-
- //重新初始化列表,实现动态列表头合并
- dg.datagrid({columns : mycolumes});
- }
- function showfujian(id) {
- var webUpload = {
- busiTable : 'jeecg_demo',
- busiId : id,
- extensions : '',
- createrDelete : "true",
- bizType : 'touxiang',
- remark : '赵华龙'
- };
- showFileList(webUpload);
- }
- function szqm(id) {
- $.dialog({
- content : 'url:jeecgListDemoController.do?goCheck&id=' + id,
- zIndex : getzIndex(),
- title : 'View The Files',//选择框标题
- lock : true,//是否锁定 当为true 时 下层有蒙版,不允许用户在弹出窗口以外有其它操作
- width : '800px',// 选择框宽度
- height : '350px',//选择框高度
- opacity : 0.4,//透明度 (经过测试 效果好像不太明显 )
- button : [ {
- name : 'close',
- focus : true,
- callback : function() {
- }
- }, {
- name : 'close',
- focus : true,
- callback : function() {
- }
- } ]
- }).zindex();
- /* createwindow('审核入职', 'jeecgListDemoController.do?goCheck&id=' + id,
- 320, 180); */
- }
- function addNewPage(id) {
- addOneTab("TAB方式添加", "jeecgListDemoController.do?addTab&type=table&id="
- + id);
- }
- function addWithbtn(title, addurl, gname, width, height) {
- //createdetailwindow("添加", addurl,770);
- openwindow("添加", addurl, gname, 770, 500);
- }
- //导入
- function ImportXls() {
- openuploadwin('Excel导入', 'jeecgListDemoController.do?upload',
- "jeecgDemoList");
- }
- //导出
- function ExportXls() {
- JeecgExcelExport("jeecgListDemoController.do?exportXls",
- "jeecgDemoList");
- }
- function showmmmmmm(data) {
- alert('<t:mutiLang langKey="add.failed"/>');
- console.log(data);
- }
- function wwww(data) {
- alert("这是父页面wwww");
- console.log(data);
- }
- //模板下载
- function ExportXlsByT() {
- JeecgExcelExport("jeecgListDemoController.do?exportXlsByT",
- "jeecgDemoList");
- }
- function createwindow_form(title, addurl, width, height) {
- //width = width?width:700;
- //height = height?height:400;
- //if(width=="100%" || height=="100%"){
- // width = window.top.document.body.offsetWidth;
- // height =window.top.document.body.offsetHeight-100;
- //}
- width = window.top.document.body.offsetWidth;
- height = window.top.document.body.offsetHeight - 100;
- if (typeof (windowapi) == 'undefined') {
- $.dialog({
- content : 'url:' + addurl,
- lock : true,
- zIndex : getzIndex(),
- width : width,
- height : height,
- title : title,
- opacity : 0.3,
- cache : false,
- cancelVal : '',
- cancel : true
- /*为true等价于function(){}*/
- });
- } else {
- W.$.dialog({
- content : 'url:' + addurl,
- lock : true,
- width : width,
- zIndex : getzIndex(),
- height : height,
- parent : windowapi,
- title : title,
- opacity : 0.3,
- cache : false,
- cancelVal : '',
- cancel : true
- /*为true等价于function(){}*/
- });
- }
- }
- function dialogwithoutsavebtn() {
- var rowsData = $("#jeecgDemoList").datagrid('getSelections');
- if (!rowsData || rowsData.length == 0) {
- tip('请选择一行');
- return;
- }
- if (rowsData.length > 1) {
- tip('请选择一行');
- return;
- }
- var busiId = rowsData[0].id;
- createwindowWithoutSavebtn("修改", "jeecgListDemoController.do?goUpdate"
- + '&id=' + busiId);
- }
-
- function testTarget(id){
- //window.top.location="http://localhost:8080/jeecg-bpm/cusprint2.html";
- /*var html = "<form action='pubController.do?showFrReport' id='frReportForm' method='post' target='_blank'>";
- var jsons = {reportlet:"test_log.cpt",note:"172.16.0.88",loglevel:1};
- for(var key in jsons){
- html+="<input name='"+key+"' value='"+jsons[key]+"'/>";
- //alert("key="+key+";value="+jsons[key]);
- }
- html+="</form>";
- //console.log(html);
- //return;
- $("#frReportDiv").html(html);
- $("#frReportForm").submit();*/
- var jsons = {reportlet:"test_log.cpt",note:"172.16.0.88",loglevel:1};
- showReport("frReportDiv",jsons);
- //window.open("http://localhost:8080/jeecg-bpm/cusprint2.html","_blank");
- }
- </script>
|