Ldc
2024-04-07 0652600959e5e3b5796fb6e8da129704ca95347a
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
/**
 * 开发进程
 * Created by weidy on 2018/5/2.
 */
 
layui.define(['layer','table'],function(exports){
 
    var Dev = function(){
        this.url = 'devLogController/getLogData';
    };
    Dev.prototype.getContent = function(){
        var that = this;
        return '<table id="table_devlog_' + that.id + '" lay-filter="' + that.id +'"></table><script type="text/html" id="toolbar_devlog_' + that.id + '" >s</script>';
    };
    Dev.prototype.getTableColumns = function(){
        var that =this;
        var table = layui.table;
        var cols = [{
            field:'version',
            title:'版本号',
            width:80,
        },{
            field:'content',
            title:'主要内容',
            width:200,
        },{
            field:'options',
            title:'操作',
            width:150,
            toolbar:'#toolbar_devlog_' + that.id
        }];
        return cols;
    };
    Dev.prototype.getToolbarHtml = function(){
        var that =this;
        var html = "";
        html += '<a class="layui-btn layui-btn-xs" lay-event="viewbug">修复列表</a>';
        html += '<a class="layui-btn layui-btn-xs" lay-event="viewdoc">部署文档</a>';
        return html;
    };
    Dev.prototype.init = function(){
        var that = this;
        var table = layui.table;
        //先初始化工具栏的html
        $('#toolbar_devlog_' + that.id).html(that.getToolbarHtml());
        //初始化列表
        table.render({
            elem:'#table_devlog_' + that.id ,
            data:[],
            page:{
                limit:that.limit,
                page:1
            },
            width:'100%',
            height:200,
            cols:[that.getTableColumns()],
            done:function(res,curr,count){
                //不清楚工具栏的监听是否在表格加载完成之前有影响,因此只能在加载完成后添加监听
                table.on('tool(' + that.id + ')',function(obj){
                    var data = obj.data;//当前选择行的数据
                    var layEvent = obj.event;//点的是什么按钮
                    if(layEvent == 'viewbug'){
                        //直接弹出窗口
                        // that.doProcess(data);
                    }else if(layEvent == 'viewdoc'){
                        //that.viewData(data);
                    }
                });
            }
        });
    };
    var dev = new Dev();
   exports('portal/vciBaseDevPortlet',dev);
});