Blame view

assets/syspages/js/loggingManage.js 4.87 KB
10646c94   Andy   add
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  /**
   * Created by mac on 17/5/18.
   */
  
  var TTDiy_select = new diy_select({ //参数可选
      TTContainer: 'diy_select', //控件的class
      TTDiy_select_input: 'diy_select_input', //用于提交表单的class
      TTDiy_select_txt: 'diy_select_txt', //diy_select用于显示当前选中内容的容器class
      TTDiy_select_btn: 'diy_select_btn', //diy_select的打开按钮
      TTDiv_select_list: 'diy_select_list', //要显示的下拉框内容列表class
      TTFcous: 'focus' //得到焦点时的class
  }); //如同时使用多个时请保持各class一致.
  
  //日历
  ;(function($){
      $.fn.fdatepicker.dates['zh-CN'] = {
          days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
          daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
          daysMin: ["日", "一", "二", "三", "四", "五", "六"],
          months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
          monthsShort: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
          // today: '今天'
      };
  }(jQuery));
  //设置前一个月显示默认时间
  function showpretime(){
      var mydate = new Date();
      var month = mydate.getMonth();
      var data = mydate.getDate();
      if(data<10){
          data='0'+data;
      };
      if(month=='0'){
          month='12';
      }
      if(month<10){
          month = '0'+month;
      };
  
      var str = "" + mydate.getFullYear() + "-";
      str += month + "-";
      str += data ;
      return str;
  };
  function shownowtime(){
      var mydate = new Date();
      var month = mydate.getMonth()+1;
      var data = mydate.getDate();
      if(data<10){
          data='0'+data;
      };
      if(month<10){
          month = '0'+month;
      };
  
      var str = "" + mydate.getFullYear() + "-";
      str += month + "-";
      str += data ;
      return str;
  }
  $('#prev_date').val(showpretime());
  $('#next_date').val(shownowtime());
  $('#prev_date').fdatepicker({
      format: 'yyyy-mm-dd',
      defaultDate: '-1M',
  });
  $('#next_date').fdatepicker({
      format: 'yyyy-mm-dd',
      defaultDate:  +7,
      // endDate:'+1',
  
  });
  
  $(function () {
      $('#loggingTable').bootstrapTable({
          striped:true,//表格显示条纹
          pagination: true, //启动分页
          pageNumber:1, //当前第几页
          pageSize: 10,  //每页显示的记录数
          pageList: [10,15,20],  //记录数可选列表
          sidePagination: 'server',//表示服务端分页
          queryParamsType: 'limit',
          method:'POST',//请求方法
          paginationPreText: '<',
          paginationNextText: '>',
          ajax:tableLoadRequest,//自定义ajax加载数据
          columns: [
              {field: 'id', title: 'ID', visible: false, align: 'center'},
              {field: 'loginCode', title: '用户名', width: '10%', align: 'center'},
              {field: 'opName', title: '姓名', width: '10%', align: 'center'},
              {field: 'roleName', title: '角色', width: '20%', align: 'center'},
              {field: 'OrgName', title: '所属部门', width: '20%', align: 'center'},
              {field: 'telephone', title: '手机号', width: '10%', align: 'center'},
              {field: 'email', title: '邮箱', width: '5%', align: 'center'},
              {field: 'dataState', title: '状态', width: '5%', align: 'center'},
              {field: 'oper', title: '操作', width: '20%', align: 'center'}
          ]
  
      });
  
      //操作显示
      /*operFormatter:function(value,row,index){
       var operStr = '<button href="#" modify data-value="'+row.id+'">修改</button>&nbsp;&nbsp;<button delete rolename="'+row.roleName+'" data-value="'+row.id+'">删除</button>';
       return operStr;
       },*/
  
      //如果data为空的时候处理
      $('.no-records-found td').append('<span>暂无信息,可使用 <a>“添加用户”</a> 按钮为系统添加职能信息</span>')
  
  
  
  
  
  
      /**
       * 自定义table AJAX请求
       * @param {Object} params
       */
      function tableLoadRequest(params){
          console.log(params);
          //测试使用
          // just use setTimeout
          /* setTimeout(function () {
           params.success({
           total: 100,
           rows: [{
           "id": 0,
           "roleName": "Item 0",
           "createEmpname": "$0"
           }]
           });
           }, 1000);*/
          //设置请求参数
          var pageNum = (params.data.offset/params.data.limit)+1;
          var req= {
              baseRequest:{
                  pageNum:pageNum,
                  pageSize:params.data.limit
              },
              sysCode:sysComm.sysCode
          };
          var easyUIOps = {
              method: params.type,
              url: dataUrl.util.getQueryUsersList,
              data: JSON.stringify(req),
              contentType: 'application/json; charset=utf-8',
              dataType:'json',
              success: params.success
          };
          sysAjax(easyUIOps);
      }
  
  
  });