jeecgDemoList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
  5. <div class="easyui-layout" fit="true">
  6. <div region="center" style="padding: 0px; border: 0px">
  7. <div id="container" style="display: none;">
  8. <div class="lightbox"></div>
  9. <div id="pop" class="pop">
  10. <canvas id="the-canvas"></canvas>
  11. </div>
  12. </div>
  13. <!-- 通过隐藏文本,记录动态列的一级标题 -->
  14. <input hidden="" id = 'headerlist' value="${headerlist}">
  15. <t:datagrid name="jeecgDemoList" checkbox="true"
  16. onLoadSuccess="callbackTeacherSelect" sortName="birthday,name"
  17. pagination="true" fitColumns="false" title="jeecg_demo"
  18. actionUrl="jeecgListDemoController.do?datagrid" idField="id"
  19. fit="true" queryMode="group">
  20. <t:dgCol title="id" field="id" hidden="true" queryMode="group"
  21. width="120"></t:dgCol>
  22. <t:dgCol title="名称" field="name" query="true" rowspan="2"
  23. autocomplete="true" width="120"></t:dgCol>
  24. <t:dgCol title="年龄" extend="{style:'width:50px'}"
  25. style="background-color:#3a87ad_50,background-color:#f89406_100"
  26. editor="numberbox" field="age" query="true" width="120"></t:dgCol>
  27. <t:dgCol title="生日" hidden="true"
  28. field="birthday" formatter="yyyy-MM-dd" queryMode="group"
  29. width="120"></t:dgCol>
  30. <t:dgCol title="部门" field="depId" query="true"
  31. queryMode="single" dictionary="t_s_depart,id,departname, and org_type != '1' " width="120"></t:dgCol>
  32. <t:dgCol title="部门code" field="extField" ></t:dgCol>
  33. <t:dgCol title="性别" field="sex" query="true" dictionary="sex"
  34. width="120" extendParams="styler:fmtype"></t:dgCol>
  35. <!-- 遍历动态列,将动态列添加至此 -->
  36. <c:forEach items="${titlelist}" var="temp">
  37. <t:dgCol title="${temp.title}" field="${temp.field}"></t:dgCol>
  38. </c:forEach>
  39. <t:dgCol title="操作" field="opt" rowspan="2"></t:dgCol>
  40. <t:dgDelOpt title="删除" url="jeecgListDemoController.do?doDel&id={id}"
  41. urlclass="ace_button" urlfont="fa-trash-o" />
  42. <t:dgFunOpt exp="status#eq#N" title="审核" funname="szqm(id)"
  43. urlclass="ace_button" urlfont="fa-check" />
  44. <t:dgFunOpt title="头像管理" funname="showfujian(id)"
  45. urlclass="ace_button" urlfont="fa-check" />
  46. <t:dgFunOpt title="显示报表" funname="testTarget(id)"
  47. urlclass="ace_button" urlfont="fa-check" />
  48. <t:dgToolBar id="addbtn" title="录入" icon="icon-add" operationCode="add"
  49. url="jeecgListDemoController.do?goAdd" funname="add" width="770"
  50. height="500"></t:dgToolBar>
  51. <t:dgToolBar id="addbtn" title="pdf预览" icon="icon-add" operationCode="add"
  52. url="tSysFileController.do?showpdfview&fileUrl=touxiang/157c6443-eb54-4fa7-a258-d26d0bd5ba3c.pdf" funname="add" width="770"
  53. height="500"></t:dgToolBar>
  54. <t:dgToolBar title="录入-提交按钮" icon="icon-add" operationCode="add"
  55. url="jeecgListDemoController.do?addWithbtn" funname="addWithbtn"
  56. width="770"></t:dgToolBar>
  57. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit"
  58. funname="dialogwithoutsavebtn" width="770"></t:dgToolBar>
  59. <t:dgToolBar title="批量删除" icon="icon-remove" operationCode="remove"
  60. url="jeecgListDemoController.do?doBatchDel"
  61. funname="deleteALLSelect"></t:dgToolBar>
  62. <t:dgToolBar title="查看" icon="icon-search"
  63. url="jeecgListDemoController.do?goUpdate" funname="detail"
  64. width="770"></t:dgToolBar>
  65. <t:dgToolBar title="附件列表" icon="icon-search" funname="fujianliebiao"
  66. width="770"></t:dgToolBar>
  67. <t:dgToolBar title="导入" icon="icon-putout" operationCode="put" funname="ImportXls"></t:dgToolBar>
  68. <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
  69. <t:dgToolBar title="模板下载" icon="icon-putout" operationCode="putout" funname="ExportXlsByT"></t:dgToolBar>
  70. <t:dgToolBar operationCode="print" title="打印" icon="icon-print" operationCode="print"
  71. url="jeecgListDemoController.do?print" funname="detail" width="610"
  72. height="330"></t:dgToolBar>
  73. <t:dgToolBar title="加载百度" icon="icon-print" operationCode="print" url="#"
  74. funname="testReloadPage"></t:dgToolBar>
  75. <%-- <t:dgToolBar title="加载新页面" icon="icon-print" operationCode="print" funname="addNewPage(id)"></t:dgToolBar> --%>
  76. </t:datagrid>
  77. </div>
  78. </div>
  79. <div id="frReportDiv" style="display: none"></div>
  80. <script type="text/javascript">
  81. $(function(){
  82. dateGridTitleMerge();
  83. });
  84. //列表字段颜色 demo,逻辑判断函数
  85. function fmtype(val, row, index) {
  86. //可添加更多CSS样式
  87. var s1 = 'background-color:#f89406;color:#FFF;';
  88. var s2 = 'background-color:#3a87ad;color:#FFF;';
  89. var s3 = 'background-color:#21B9BB;';
  90. if (val == '1') {
  91. return s1
  92. }
  93. if (val == '0') {
  94. return s2
  95. }
  96. return s3
  97. }
  98. function rowclick(rowIndex, rowData) {
  99. tip(rowIndex);
  100. $('#addbtn').attr("disabled", true);
  101. }
  102. function callbackTeacherSelect() {
  103. var mergeFileds = [ {
  104. mergeFiled : "age"
  105. }, //合并列的field数组及对应前提条件filed(为空则直接内容合并)
  106. {
  107. mergeFiled : "depId",
  108. premiseFiled : "age"
  109. }, //合并列的field数组及对应前提条件filed(为空则直接内容合并)
  110. {
  111. mergeFiled : "sex",
  112. premiseFiled : "age"
  113. }, {
  114. mergeFiled : "status",
  115. premiseFiled : "age"
  116. }, {
  117. mergeFiled : "extField"
  118. } ];
  119. commonMergeCells("jeecgDemoList", mergeFileds);
  120. }
  121. function fujianliebiao() {
  122. var rowsData = $("#jeecgDemoList").datagrid('getSelections');
  123. if (!rowsData || rowsData.length == 0) {
  124. tip('请选择一行');
  125. return;
  126. }
  127. if (rowsData.length > 1) {
  128. tip('Please select an item to view');
  129. return;
  130. }
  131. var busiTable = 'jeecg_demo';
  132. var tagetType = 'fujian';
  133. var busiId = rowsData[0].id;
  134. ;
  135. var remark = '';
  136. var webUpload = {
  137. busiTable : busiTable,
  138. busiId : busiId,
  139. extensions : 'doc,docx',
  140. bizType : tagetType,
  141. remark : remark
  142. };
  143. showFileList(webUpload);
  144. }
  145. function testReloadPage() {
  146. }
  147. function dateGridTitleMerge() {
  148. var dg = $('#jeecgDemoList');
  149. var mycolumes = [];
  150. mycolumes[0] = [];
  151. //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为一二级标题的列 或者是已知的一级标题 添加至此------
  152. mycolumes[0].push(dg.datagrid("getColumnOption", "name"));
  153. mycolumes[0].push( {title : '个人信息',colspan : 2});
  154. mycolumes[0].push( {title : '公司信息',colspan : 2});
  155. //--author:zhaohualong-----end----date:2017年9月8日--------for:将固定列 且固定列为一二级标题的列 或者是已知的一级标题 添加至此------
  156. //--author:zhaohualong-----start----date:2017年9月8日--------for:遍历由后台传来的一级标题,将其添加至此------
  157. var headerlist= $('#headerlist').val().split(",");
  158. for(var i = 0; i < headerlist.length; i++){
  159. mycolumes[0].push({title : headerlist[i],colspan : 2});
  160. }
  161. //--author:zhaohualong-----end----date:2017年9月8日--------for:遍历由后台传来的一级标题,将其添加至此------
  162. mycolumes[0].push(dg.datagrid("getColumnOption", "opt"));
  163. mycolumes[1] = [];
  164. //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为二级标题的列 添加至此------
  165. mycolumes[1].push(dg.datagrid("getColumnOption", "age"));
  166. mycolumes[1].push(dg.datagrid("getColumnOption", "sex"));
  167. mycolumes[1].push(dg.datagrid("getColumnOption", "depId"));
  168. mycolumes[1].push(dg.datagrid("getColumnOption", "extField"));
  169. //--author:zhaohualong-----start----date:2017年9月8日--------for:将固定列 且固定列为二级标题的列 添加至此------
  170. //通过getColumnFields 获取所有的列名称, 通过列名称首字符筛选动态列,遍历获取所有的动态列,将其添加至此------
  171. var fields = dg.datagrid("getColumnFields");
  172. for(var i = 0; i < fields.length; i++){
  173. if(fields[i].substr(0,12)=='dynamicfield')
  174. mycolumes[1].push(dg.datagrid("getColumnOption", fields[i]));
  175. }
  176. //重新初始化列表,实现动态列表头合并
  177. dg.datagrid({columns : mycolumes});
  178. }
  179. function showfujian(id) {
  180. var webUpload = {
  181. busiTable : 'jeecg_demo',
  182. busiId : id,
  183. extensions : '',
  184. createrDelete : "true",
  185. bizType : 'touxiang',
  186. remark : '赵华龙'
  187. };
  188. showFileList(webUpload);
  189. }
  190. function szqm(id) {
  191. $.dialog({
  192. content : 'url:jeecgListDemoController.do?goCheck&id=' + id,
  193. zIndex : getzIndex(),
  194. title : 'View The Files',//选择框标题
  195. lock : true,//是否锁定 当为true 时 下层有蒙版,不允许用户在弹出窗口以外有其它操作
  196. width : '800px',// 选择框宽度
  197. height : '350px',//选择框高度
  198. opacity : 0.4,//透明度 (经过测试 效果好像不太明显 )
  199. button : [ {
  200. name : 'close',
  201. focus : true,
  202. callback : function() {
  203. }
  204. }, {
  205. name : 'close',
  206. focus : true,
  207. callback : function() {
  208. }
  209. } ]
  210. }).zindex();
  211. /* createwindow('审核入职', 'jeecgListDemoController.do?goCheck&id=' + id,
  212. 320, 180); */
  213. }
  214. function addNewPage(id) {
  215. addOneTab("TAB方式添加", "jeecgListDemoController.do?addTab&type=table&id="
  216. + id);
  217. }
  218. function addWithbtn(title, addurl, gname, width, height) {
  219. //createdetailwindow("添加", addurl,770);
  220. openwindow("添加", addurl, gname, 770, 500);
  221. }
  222. //导入
  223. function ImportXls() {
  224. openuploadwin('Excel导入', 'jeecgListDemoController.do?upload',
  225. "jeecgDemoList");
  226. }
  227. //导出
  228. function ExportXls() {
  229. JeecgExcelExport("jeecgListDemoController.do?exportXls",
  230. "jeecgDemoList");
  231. }
  232. function showmmmmmm(data) {
  233. alert('<t:mutiLang langKey="add.failed"/>');
  234. console.log(data);
  235. }
  236. function wwww(data) {
  237. alert("这是父页面wwww");
  238. console.log(data);
  239. }
  240. //模板下载
  241. function ExportXlsByT() {
  242. JeecgExcelExport("jeecgListDemoController.do?exportXlsByT",
  243. "jeecgDemoList");
  244. }
  245. function createwindow_form(title, addurl, width, height) {
  246. //width = width?width:700;
  247. //height = height?height:400;
  248. //if(width=="100%" || height=="100%"){
  249. // width = window.top.document.body.offsetWidth;
  250. // height =window.top.document.body.offsetHeight-100;
  251. //}
  252. width = window.top.document.body.offsetWidth;
  253. height = window.top.document.body.offsetHeight - 100;
  254. if (typeof (windowapi) == 'undefined') {
  255. $.dialog({
  256. content : 'url:' + addurl,
  257. lock : true,
  258. zIndex : getzIndex(),
  259. width : width,
  260. height : height,
  261. title : title,
  262. opacity : 0.3,
  263. cache : false,
  264. cancelVal : '',
  265. cancel : true
  266. /*为true等价于function(){}*/
  267. });
  268. } else {
  269. W.$.dialog({
  270. content : 'url:' + addurl,
  271. lock : true,
  272. width : width,
  273. zIndex : getzIndex(),
  274. height : height,
  275. parent : windowapi,
  276. title : title,
  277. opacity : 0.3,
  278. cache : false,
  279. cancelVal : '',
  280. cancel : true
  281. /*为true等价于function(){}*/
  282. });
  283. }
  284. }
  285. function dialogwithoutsavebtn() {
  286. var rowsData = $("#jeecgDemoList").datagrid('getSelections');
  287. if (!rowsData || rowsData.length == 0) {
  288. tip('请选择一行');
  289. return;
  290. }
  291. if (rowsData.length > 1) {
  292. tip('请选择一行');
  293. return;
  294. }
  295. var busiId = rowsData[0].id;
  296. createwindowWithoutSavebtn("修改", "jeecgListDemoController.do?goUpdate"
  297. + '&id=' + busiId);
  298. }
  299. function testTarget(id){
  300. //window.top.location="http://localhost:8080/jeecg-bpm/cusprint2.html";
  301. /*var html = "<form action='pubController.do?showFrReport' id='frReportForm' method='post' target='_blank'>";
  302. var jsons = {reportlet:"test_log.cpt",note:"172.16.0.88",loglevel:1};
  303. for(var key in jsons){
  304. html+="<input name='"+key+"' value='"+jsons[key]+"'/>";
  305. //alert("key="+key+";value="+jsons[key]);
  306. }
  307. html+="</form>";
  308. //console.log(html);
  309. //return;
  310. $("#frReportDiv").html(html);
  311. $("#frReportForm").submit();*/
  312. var jsons = {reportlet:"test_log.cpt",note:"172.16.0.88",loglevel:1};
  313. showReport("frReportDiv",jsons);
  314. //window.open("http://localhost:8080/jeecg-bpm/cusprint2.html","_blank");
  315. }
  316. </script>