fhmodel_list.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  3. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  4. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme() + "://"
  8. + request.getServerName() + ":" + request.getServerPort()
  9. + path + "/";
  10. %>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <base href="<%=basePath%>">
  15. <!-- jsp文件头和头部 -->
  16. <%@ include file="../../system/index/top.jsp"%>
  17. </head>
  18. <body class="no-skin">
  19. <!-- /section:basics/navbar.layout -->
  20. <div class="main-container" id="main-container">
  21. <!-- /section:basics/sidebar -->
  22. <div class="main-content">
  23. <div class="main-content-inner">
  24. <div class="page-content">
  25. <div class="row">
  26. <div class="col-xs-12">
  27. <!-- 检索 -->
  28. <form action="fhmodel/list.do" method="post" name="Form" id="Form">
  29. <table style="margin-top:5px;">
  30. <tr>
  31. <td>
  32. <div class="nav-search">
  33. <span class="input-icon">
  34. <input type="text" placeholder="这里输入模型名称" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/>
  35. <i class="ace-icon fa fa-search nav-search-icon"></i>
  36. </span>
  37. </div>
  38. </td>
  39. <td style="vertical-align:top;padding-left:2px">
  40. <select name="category" id="category" title="模型分类" style="width:100px;">
  41. </select>
  42. </td>
  43. <c:if test="${QX.cha == 1 }">
  44. <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
  45. </c:if>
  46. </tr>
  47. </table>
  48. <!-- 检索 -->
  49. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  50. <thead>
  51. <tr>
  52. <th class="center" style="width:35px;">
  53. <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
  54. </th>
  55. <th class="center" style="width:50px;">序号</th>
  56. <th class="center">模型名称</th>
  57. <th class="center">分类</th>
  58. <th class="center"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>创建时间</th>
  59. <th class="center"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>最后更新时间</th>
  60. <th class="center">版本</th>
  61. <th class="center">操作</th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. <!-- 开始循环 -->
  66. <c:choose>
  67. <c:when test="${not empty varList}">
  68. <c:if test="${QX.cha == 1 }">
  69. <c:forEach items="${varList}" var="var" varStatus="vs">
  70. <tr>
  71. <td class='center'>
  72. <label class="pos-rel"><input type='checkbox' name='ids' value="${var.ID_}" class="ace" /><span class="lbl"></span></label>
  73. </td>
  74. <td class='center' style="width: 30px;" id="F${var.ID_}">${page.showCount*(page.currentPage-1)+vs.index+1}</td>
  75. <td class='center'>${var.NAME_}</td>
  76. <td class='center'>${var.DNAME}
  77. <span class="green" style="cursor: pointer;">
  78. <i class="ace-icon fa fa-pencil-square-o bigger-100" title="修改" onclick="goEditType('${var.ID_}');"></i>
  79. </span>
  80. </td>
  81. <td class='center'>${fn:substring(var.CREATE_TIME_ ,0,19)}</td>
  82. <td class='center'>${fn:substring(var.LAST_UPDATE_TIME_ ,0,19)}</td>
  83. <td class='center'>v.${var.VERSION_}</td>
  84. <td class="center">
  85. <c:if test="${QX.edit != 1 && QX.del != 1 }">
  86. <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  87. </c:if>
  88. <div class="hidden-sm hidden-xs btn-group">
  89. <c:if test="${QX.edit == 1 }">
  90. <a class="btn btn-xs btn-purple" title="流程设计器" onclick="editor('${var.ID_}');">
  91. 流程设计器
  92. </a>
  93. <a class="btn btn-xs btn-success" title="部署" onclick="deployment('${var.ID_}','F${var.ID_}');">
  94. 部署
  95. </a>
  96. <a class="btn btn-xs btn-warning" title="预览" onclick="view('${var.ID_}','F${var.ID_}');">
  97. 预览
  98. </a>
  99. <a class="btn btn-xs btn-info" title="导出" onclick="exportXml('${var.ID_}','F${var.ID_}');">
  100. 导出
  101. </a>
  102. </c:if>
  103. <c:if test="${QX.del == 1 }">
  104. <a class="btn btn-xs btn-danger" onclick="del('${var.ID_}');">
  105. <i class="ace-icon fa fa-trash-o bigger-110" title="删除"></i>
  106. </a>
  107. </c:if>
  108. </div>
  109. <div class="hidden-md hidden-lg">
  110. <div class="inline pos-rel">
  111. <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  112. <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  113. </button>
  114. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  115. <c:if test="${QX.edit == 1 }">
  116. <li>
  117. <a style="cursor:pointer;" onclick="editor('${var.ID_}');" class="tooltip-success" data-rel="tooltip" title="流程设计器">
  118. <span class="purple">
  119. <i class="ace-icon glyphicon glyphicon-move bigger-120"></i>
  120. </span>
  121. </a>
  122. </li>
  123. <li>
  124. <a style="cursor:pointer;" onclick="deployment('${var.ID_}','F${var.ID_}');" class="tooltip-success" data-rel="tooltip" title="部署">
  125. <span class="blue">
  126. <i class="ace-icon fa fa-gavel"></i>
  127. </span>
  128. </a>
  129. </li>
  130. <li>
  131. <a style="cursor:pointer;" onclick="view('${var.ID_}','F${var.ID_}');" class="tooltip-success" data-rel="tooltip" title="预览">
  132. <span class="black">
  133. <i class="ace-icon fa fa-eye"></i>
  134. </span>
  135. </a>
  136. </li>
  137. <li>
  138. <a style="cursor:pointer;" onclick="exportXml('${var.ID_}','F${var.ID_}');" class="tooltip-success" data-rel="tooltip" title="导出">
  139. <span class="green">
  140. <i class="ace-icon fa fa-cloud-download"></i>
  141. </span>
  142. </a>
  143. </li>
  144. </c:if>
  145. <c:if test="${QX.del == 1 }">
  146. <li>
  147. <a style="cursor:pointer;" onclick="del('${var.ID_}');" class="tooltip-error" data-rel="tooltip" title="删除">
  148. <span class="red">
  149. <i class="ace-icon fa fa-trash-o bigger-110"></i>
  150. </span>
  151. </a>
  152. </li>
  153. </c:if>
  154. </ul>
  155. </div>
  156. </div>
  157. </td>
  158. </tr>
  159. </c:forEach>
  160. </c:if>
  161. <c:if test="${QX.cha == 0 }">
  162. <tr>
  163. <td colspan="100" class="center">您无权查看</td>
  164. </tr>
  165. </c:if>
  166. </c:when>
  167. <c:otherwise>
  168. <tr class="main_info">
  169. <td colspan="100" class="center" >没有相关数据</td>
  170. </tr>
  171. </c:otherwise>
  172. </c:choose>
  173. </tbody>
  174. </table>
  175. <div class="page-header position-relative">
  176. <table style="width:100%;">
  177. <tr>
  178. <td style="vertical-align:top;">
  179. <c:if test="${QX.add == 1 }">
  180. <a class="btn btn-mini btn-success" onclick="add();">新增</a>
  181. </c:if>
  182. <c:if test="${QX.del == 1 }">
  183. <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
  184. </c:if>
  185. </td>
  186. <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
  187. </tr>
  188. </table>
  189. </div>
  190. </form>
  191. </div>
  192. <!-- /.col -->
  193. </div>
  194. <!-- /.row -->
  195. </div>
  196. <!-- /.page-content -->
  197. </div>
  198. </div>
  199. <!-- /.main-content -->
  200. <!-- 返回顶部 -->
  201. <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  202. <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  203. </a>
  204. </div>
  205. <!-- /.main-container -->
  206. <!-- basic scripts -->
  207. <!-- 页面底部js¨ -->
  208. <%@ include file="../../system/index/foot.jsp"%>
  209. <!-- 删除时确认窗口 -->
  210. <script src="static/ace/js/bootbox.js"></script>
  211. <!-- ace scripts -->
  212. <script src="static/ace/js/ace/ace.js"></script>
  213. <!--提示框-->
  214. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  215. <script type="text/javascript">
  216. $(top.hangge());//关闭加载状态
  217. //检索
  218. function tosearch(){
  219. top.jzts();
  220. $("#Form").submit();
  221. }
  222. $(function() {
  223. //复选框全选控制
  224. var active_class = 'active';
  225. $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
  226. var th_checked = this.checked;//checkbox inside "TH" table header
  227. $(this).closest('table').find('tbody > tr').each(function(){
  228. var row = this;
  229. if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
  230. else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
  231. });
  232. });
  233. var category = "${pd.category}";
  234. $.ajax({
  235. type: "POST",
  236. url: '<%=basePath%>dictionaries/getLevels.do?tm='+new Date().getTime(),
  237. data: {DICTIONARIES_ID:'act001'},//act001 为工作流分类
  238. dataType:'json',
  239. cache: false,
  240. success: function(data){
  241. $("#category").html('<option value="" >请选择分类</option>');
  242. $.each(data.list, function(i, dvar){
  243. if(category == dvar.BIANMA){
  244. $("#category").append("<option value="+dvar.BIANMA+" selected='selected'>"+dvar.NAME+"</option>");
  245. }else{
  246. $("#category").append("<option value="+dvar.BIANMA+">"+dvar.NAME+"</option>");
  247. }
  248. });
  249. }
  250. });
  251. });
  252. //新增
  253. function add(){
  254. top.jzts();
  255. var diag = new top.Dialog();
  256. diag.Drag=true;
  257. diag.Title ="新增模型";
  258. diag.URL = '<%=basePath%>fhmodel/goAdd.do';
  259. diag.Width = 500;
  260. diag.Height = 400;
  261. diag.Modal = false; //有无遮罩窗口
  262. diag. ShowMaxButton = true; //最大化按钮
  263. diag.ShowMinButton = true; //最小化按钮
  264. diag.CancelEvent = function(){ //关闭事件
  265. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  266. var sunval = diag.innerFrame.contentWindow.document.getElementById('sunval').value;
  267. editor(sunval);//打开流程编辑器
  268. tosearch();
  269. }
  270. diag.close();
  271. };
  272. diag.show();
  273. }
  274. //打开流程设计器
  275. function editor(modelId){
  276. var diag = new top.Dialog();
  277. diag.Drag=true;
  278. diag.Title ="流程设计器";
  279. diag.URL = '<%=basePath%>fhmodel/editor.do?modelId='+modelId;
  280. diag.Width = 1230;
  281. diag.Height = 700;
  282. diag.Modal = false; //有无遮罩窗口
  283. diag. ShowMaxButton = true; //最大化按钮
  284. diag.ShowMinButton = true; //最小化按钮
  285. diag.CancelEvent = function(){ //关闭事件
  286. diag.close();
  287. };
  288. diag.show();
  289. }
  290. //打开修改类型页面
  291. function goEditType(ID_){
  292. top.jzts();
  293. var diag = new top.Dialog();
  294. diag.Drag=true;
  295. diag.Title ="修改类型";
  296. diag.URL = '<%=basePath%>fhmodel/goEdit.do?ID_='+ID_;
  297. diag.Width = 300;
  298. diag.Height = 130;
  299. diag.Modal = false; //有无遮罩窗口
  300. diag. ShowMaxButton = false; //最大化按钮
  301. diag.ShowMinButton = false; //最小化按钮
  302. diag.CancelEvent = function(){ //关闭事件
  303. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  304. tosearch();
  305. }
  306. diag.close();
  307. };
  308. diag.show();
  309. }
  310. //部署流程定义
  311. function deployment(modelId,id){
  312. top.jzts();
  313. $.ajax({
  314. type: "POST",
  315. url: '<%=basePath%>fhmodel/deployment.do?tm='+new Date().getTime(),
  316. data: {modelId:modelId},
  317. dataType:'json',
  318. cache: false,
  319. success: function(data){
  320. top.hangge();
  321. if("error" == data.result){
  322. $("#"+id).tips({
  323. side:2,
  324. msg:'部署失败! 检查下是否已经画正确的流程图了?',
  325. bg:'#F50100',
  326. time:15
  327. });
  328. }else{
  329. $("#"+id).tips({
  330. side:2,
  331. msg:'部署成功! 可到流程管理中查看',
  332. bg:'#87B87F',
  333. time:15
  334. });
  335. }
  336. }
  337. });
  338. }
  339. //导出模型xml
  340. function exportXml(modelId,id){
  341. top.jzts();
  342. $.ajax({
  343. type: "POST",
  344. url: '<%=basePath%>fhmodel/isCanexportXml.do?tm='+new Date().getTime(),
  345. data: {modelId:modelId},
  346. dataType:'json',
  347. cache: false,
  348. success: function(data){
  349. top.hangge();
  350. if("error" == data.result){
  351. $("#"+id).tips({
  352. side:2,
  353. msg:'导出失败! 检查下是否已经画正确的流程图了?',
  354. bg:'#F50100',
  355. time:8
  356. });
  357. }else{
  358. window.location.href='<%=basePath%>fhmodel/exportXml.do?modelId='+modelId;
  359. }
  360. }
  361. });
  362. }
  363. //预览
  364. function view(modelId,id){
  365. top.jzts();
  366. $.ajax({
  367. type: "POST",
  368. url: '<%=basePath%>fhmodel/isCanexportXml.do?tm='+new Date().getTime(),
  369. data: {modelId:modelId},
  370. dataType:'json',
  371. cache: false,
  372. success: function(data){
  373. top.hangge();
  374. if("error" == data.result){
  375. $("#"+id).tips({
  376. side:2,
  377. msg:'预览失败! 检查下是否已经画正确的流程图了?',
  378. bg:'#F50100',
  379. time:8
  380. });
  381. }else{
  382. var diag = new top.Dialog();
  383. diag.Drag=true;
  384. diag.Title ="预览XML";
  385. diag.URL = '<%=basePath%>fhmodel/goView.do?modelId='+modelId;
  386. diag.Width = 1000;
  387. diag.Height = 608;
  388. diag.Modal = false; //有无遮罩窗口
  389. diag.ShowMinButton = true; //最小化按钮
  390. diag.CancelEvent = function(){ //关闭事件
  391. diag.close();
  392. };
  393. diag.show();
  394. }
  395. }
  396. });
  397. }
  398. //删除
  399. function del(Id){
  400. bootbox.confirm("确定要删除吗?", function(result) {
  401. if(result) {
  402. top.jzts();
  403. var url = "<%=basePath%>fhmodel/delete.do?ID_="+Id+"&tm="+new Date().getTime();
  404. $.get(url,function(data){
  405. tosearch();
  406. });
  407. }
  408. });
  409. }
  410. //批量操作
  411. function makeAll(msg){
  412. bootbox.confirm(msg, function(result) {
  413. if(result) {
  414. var str = '';
  415. for(var i=0;i < document.getElementsByName('ids').length;i++){
  416. if(document.getElementsByName('ids')[i].checked){
  417. if(str=='') str += document.getElementsByName('ids')[i].value;
  418. else str += ',' + document.getElementsByName('ids')[i].value;
  419. }
  420. }
  421. if(str==''){
  422. bootbox.dialog({
  423. message: "<span class='bigger-110'>您没有选择任何内容!</span>",
  424. buttons:
  425. { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  426. });
  427. $("#zcheckbox").tips({
  428. side:1,
  429. msg:'点这里全选',
  430. bg:'#AE81FF',
  431. time:8
  432. });
  433. return;
  434. }else{
  435. if(msg == '确定要删除选中的数据吗?'){
  436. top.jzts();
  437. $.ajax({
  438. type: "POST",
  439. url: '<%=basePath%>fhmodel/deleteAll.do?tm='+new Date().getTime(),
  440. data: {DATA_IDS:str},
  441. dataType:'json',
  442. //beforeSend: validateData,
  443. cache: false,
  444. success: function(data){
  445. $.each(data.list, function(i, list){
  446. tosearch();
  447. });
  448. }
  449. });
  450. }
  451. }
  452. }
  453. });
  454. };
  455. </script>
  456. </body>
  457. </html>