无关风月
2025-02-25 cc175f25cbd953fc2c3623495c1f4b8e0efec4ee
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
77
/**
 * 用户管理管理初始化
 */
var TUser = {
    id: "TUserTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
 
/**
 * 鼠标悬停提示框 class .toolTip 为无效样式,作用于个别选择器使用
 */
TUser.tooltip = function(){
    $(".toolTip").tooltip();
};
 
/**
 * 初始化表格的列
 */
TUser.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '邀请人', field: 'inviteUserName', visible: false, align: 'center', valign: 'middle',width:'8%'},
        {title: '被邀请用户', field: 'nickName', visible: true, align: 'center', valign: 'middle',width:'8%'},
        {title: '被邀请用户手机号', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%'},
        {title: '被邀请用户ID', field: 'userId', visible: true, align: 'center', valign: 'middle',width:'8%'},
        {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',width:'10%',
            formatter: function (value, row) {
                var btn = "";
                if(row.insertTime != '' && row.insertTime != null) {
                    var time = row.insertTime.replace(" ",'<br>');
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.registerTime + '" onfocus="TUser.tooltip()">' + time + '</p>']
                }
                return btn;
            }
        },
    ];
};
 
/**
 * 检查是否选中
 */
TUser.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TUser.seItem = selected[0];
        return true;
    }
};
 
/**
 * 查询用户管理列表
 */
TUser.search = function () {
    var queryData = {};
    queryData['time'] = $("#time").val();
    queryData['uid'] = $("#id").val();
    queryData['userName'] = $("#userName").val();
    TUser.table.refresh({query: queryData});
};
TUser.resetSearch = function () {
    $("#time").val("");
    $("#userName").val("");
    TUser.search();
};
$(function () {
    var defaultColunms = TUser.initColumn();
    var table = new BSTable(TUser.id, "/tDriver/inviteList", defaultColunms);
    // 设置物理分页server(逻辑分页client)
    table.setPaginationType("server");
    TUser.table = table.init();
    TUser.search();
});