Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

孙龙 / note-library

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • note-library
  • public
  • js
  • web
  • cronLog.js
  • 孙龙's avatar
    init · 1f46a6ed
    孙龙 committed 5 years ago
    1f46a6ed
cronLog.js 2.06 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
layui.use(['form', 'table', 'laydate'], function(){
    var form = layui.form;
    var table = layui.table;
    var laydate = layui.laydate;

    laydate.render({
        elem: '#plan_begin_time' //指定元素
    });

    laydate.render({
        elem: '#plan_end_time' //指定元素
    });

    laydate.render({
        elem: 'schedule_#begin_time' //指定元素
    });

    laydate.render({
        elem: '#schedule_end_time' //指定元素
    });

    laydate.render({
        elem: '#exec_start_begin_time' //指定元素
    });

    laydate.render({
        elem: '#exec_start_end_time' //指定元素
    });

    laydate.render({
        elem: '#exec_end_begin_time' //指定元素
    });

    laydate.render({
        elem: '#exec_end_end_time' //指定元素
    });

    table.render({
        id: 'list'
        ,elem: '#cron_log'
        ,url: '/ajax/cronLogList' //数据接口
        ,method:'post'
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度
        ,page: true //开启分页
        ,where: {
            job_name: $('input[name=job_name]').val()
        }
        ,cols: [[ //表头
            {title: '序号', type: 'numbers', fixed: 'left', width: 80}
            ,{field: '_id', title: '节点ID', width: 220}
            ,{field: 'jobName', title: '任务名称'}
            ,{field: 'command', title: '脚本命令'}
            ,{field: 'err', title: '错误原因'}
            ,{field: 'output', title: '脚本输出'}
            ,{field: 'planTime', title: '计划开始时间', width: 160}
            ,{field: 'scheduleTime', title: '实际调度时间', width: 160}
            ,{field: 'startTime', title: '执行开始时间', width: 160}  
            ,{field: 'endTime', title: '执行结束时间', width: 160}  
        ]]
        ,limit: 10
        ,limits: [10, 20, 50,]
    });

    form.on('submit(load)', function(data) {         
        //执行重载
        table.reload('list', {
            page: {
                curr: 1
            }
            ,where: data.field
        });    

        return false;
    }); 

});