123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <!--#include file="common/_header.html"-->
- <style>
- .center{
- text-align: center !important;
- }
- </style>
- <title>流程实例列表</title>
- </head>
- <body>
- <nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页 <span class="c-gray en">></span> 流程管理 <span class="c-gray en">></span> 流程实例管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a></nav>
- <div class="page-container">
- <div class="container mb-10">
- <form>
- <div class="row mb-10">
- <input type="text" class="input-text" style="width:250px" placeholder="输入项目名称" id="projectName">
- <button id="btnSearch" type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont"></i> 查询</button>
- <button id="btnReset" type="reset" class="btn btn-default"><i class="Hui-iconfont"></i> 重置</button>
- </div>
- </form>
- </div>
- <table id="procInstList" class="table table-border table-bordered table-bg" style="width:100%;">
- <thead>
- <tr>
- <th scope="col" colspan="9">流程列表</th>
- </tr>
- <tr class="text-c">
- <th width="100">流程编号</th>
- <th width="150">项目名称</th>
- <th width="100">流程名称</th>
- <th width="100">采用模板</th>
- <th width="130">启动时间</th>
- <th width="130">结束时间</th>
- <th width="130">状态</th>
- <th width="100">操作</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- <!--#include file="common/_footer.html"-->
- <!--请在下方写此页面业务相关的脚本-->
- <script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
- <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
- <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
- <script id="rowTmpl" type="text/template">
- {{if status=='已暂停'}}
- <a href="javascript:activate('{{procInstId}}')" class="ml-5" style="text-decoration:none;"><i class="Hui-iconfont"></i>激活</a>
- {{/if}}
- {{if status=='运行中'}}
- <a href="javascript:suspend('{{procInstId}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i>暂停</a>
- {{/if}}
- </script>
- <script type="text/javascript" src="scripts/global.js"></script>
- <script type="text/javascript">
- function activate(procInstId,name){
- $.get(global_backend_url + "/procInst/activate?procInstId=" + procInstId,null,function(json){
- if(json.result){
- layer.msg("激活成功!",{icon:1,time:2000});
- $("#btnSearch").click();
- }
- else{
- layer.msg("激活失败!" + json.message);
- }
- });
- }
- function suspend(procInstId,name){
- $.get(global_backend_url + "/procInst/suspend?procInstId=" + procInstId,null,function(json){
- if(json.result){
- layer.msg("暂停成功!",{icon:1,time:2000});
- $("#btnSearch").click();
- }
- else{
- layer.msg("暂停失败!" + json.message);
- }
- });
- }
- $(document).ready(function(){
- var loadingIndex = -1;
-
- $('#procInstList').dataTable({
- ajax: {
- url: global_backend_url + "/procInst/list",
- type: 'post',
- dataFilter: function(responseText){
- var jsonData = JSON.parse(responseText);
- if(loadingIndex!=-1){
- top.layer.close(loadingIndex);
- }
- // 处理返回json
- if(jsonData.result){
- return JSON.stringify(jsonData.data);
- }
- else{
- processError(jsonData);
- return null;
- }
- },
- data: function(searchParams){
- // 查询json
- searchParams["projectName"] = $("#projectName").val();
-
- loadingIndex = top.layer.load(0, {shade: [0.1,'#fff']});
- }
- },
- serverSide: true,
- searching : false,
- ordering: false,
- columns: [
- {"data": "procInstId"},
- {"data": "projectName"},
- {"data": "processName"},
- {"data": "templateName"},
- {"data": "startTime"},
- {"data": "endTime"},
- {"data": "status"},
- {"data":null}
- ],
- columnDefs: [{
- targets:7,
- sClass:'center',
- bSortable:false,
- render: function (data, type, row) {
- return template("rowTmpl",row);
- }
- }
- ]
- });
-
- $("#checkAll").change(function(){
- var checked = $(this).is(':checked');
-
- $("input[name='checkItems']").each(function(){
- $(this).attr("checked",checked);
- });
- });
- $("#btnSearch").click(function(){
- event.preventDefault();
-
- var table = $('#procInstList').DataTable();
- table.ajax.reload();
- });
- });
- </script>
- </body>
- </html>
|