text: var dtGridColumns = [{
      id : 'id',
      title : '编号',
      type : 'number',
      columnClass : 'text-center',
      hideType : 'xs',
      headerClass : 'dlshouwen-grid-header'
  }, {
      id : 'accountName',
      title : '账户名',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      resolution : function(value, record, column, grid, dataNo, columnNo) {
          return '<a href="mailto:'+value+'">'+value+'</a>';
      }
  }, {
      id : 'userName',
      title : '姓名',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header'
  }, {
      id : 'roleName',
      title : '所属角色',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'xs',
      resolution : function(value, record, column, grid, dataNo, columnNo) {
          if (/*typeof(value) == "undefined" ||*/ "" == value || null == value) {
              return '未指定';
          } else {
              return value;
          }
      }
  }, {
      id : 'deleteStatus',
      title : '是否删除',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'sm|xs',
      resolution : function(value, record, column, grid, dataNo, columnNo) {
          if (value == 0) {
              return '<span class="label label-sm label-success arrowed arrowed-righ">正常</span>';
          } else {
              return '<span class="label label-sm label-warning arrowed arrowed-righ">已删除</span>';
          }
      }
  }, {
      id : 'locked',
      title : '是否锁定',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'sm|xs',
      resolution : function(value, record, column, grid, dataNo, columnNo) {
          if (value == 0) {
              return '<span class="label label-sm label-success arrowed arrowed-righ">正常</span>';
          } else {
              return '<span class="label label-sm label-warning arrowed arrowed-righ">锁定</span>';
          }
      }
  }, {
      id : 'creatorName',
      title : '创建者',
      type : 'string',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'sm|xs'
  }, {
      id : 'createTime',
      title : '创建时间',
      type : 'date',
      format : 'yyyy-MM-dd HH:mm:ss',
      otype : 'string',
      oformat : 'yyyy-MM-dd HH:mm:ss',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'sm|xs'
  }, {
      id : 'updateTime',
      title : '更新时间',
      type : 'date',
      format : 'yyyy-MM-dd HH:mm:ss',
      otype : 'string',
      oformat : 'yyyy-MM-dd HH:mm:ss',
      columnClass : 'text-center',
      headerClass : 'dlshouwen-grid-header',
      hideType : 'sm|xs|md',
      resolution : function(value, record, column, grid, dataNo, columnNo) {
          if (value == null) {
              return '';
          } else {
              return value;
          }
      }
  }];
  
  //动态设置jqGrid的rowNum
  var pageSize = $("#pageSize").val();
  pageSize = pageSize == 0 || pageSize == "" ? sys.pageNum : pageSize;
  
  var dtGridOption = {
      lang : 'zh-cn',
      ajaxLoad : true,
      check : true,
      checkWidth :'37px',
      extraWidth : '37px',
      loadURL : sys.rootPath + '/user/list.html',
      columns : dtGridColumns,
      gridContainer : 'dtGridContainer',
      toolbarContainer : 'dtGridToolBarContainer',
      tools : 'refresh|print|export[excel,csv,pdf,txt]',
      exportFileName : '用户信息',
      pageSize : pageSize,
      pageSizeLimit : [10, 20, 30]
  };
  
  var grid = $.fn.dlshouwen.grid.init(dtGridOption);
  $(function() {
      if(null != $("#orderByColumn").val() && '' != $("#orderByColumn").val())
      {
          grid.sortParameter.columnId = $("#orderByColumn").val();
          grid.sortParameter.sortType = $("#orderByType").val();
      }
      grid.load();
      $("#btnSearch").click(customSearch);
      
      //注册回车键事件
      document.onkeypress = function(e){
      var ev = document.all ? window.event : e;
          if(ev.keyCode==13) {
              customSearch();
          }
      };
      
  });
  
  /**
   * 自定义查询
   * 这里不传入分页信息，防止删除记录后重新计算的页码比当前页码小而导致计算异常
   */
  function customSearch() {
      grid.parameters = new Object();
      grid.parameters['userName'] = $("#searchKey").val();
      grid.refresh(true);
  }
  
  /**
   *重置密码
   */
  function resetPWDModel() {
      var rows = grid.getCheckedRecords();
      if (rows.length == 1) {
  	    if (rows[0].role.key == 'administrator') {
  	        layer.msg('该用户为超级管理员,不能重置密码!', {
  	            icon : 0
  	        });
  	        return false;
  	    }
          var index;
          $.ajax({
              type : "POST",
              url : sys.rootPath + '/user/resetPassword.html',
              data : {
                  "id" : rows[0].id,
                  "accountName" : rows[0].accountName,
                  "userName" : rows[0].userName
              },
              dataType : "json",
              beforeSend : function()
              {
                  index = layer.load();
              },
              success : function(resultdata) {
                  layer.close(index);
                  if (resultdata.success) {
                      layer.msg(resultdata.message, {
                          icon : 1
                      });
                  } else {
                      layer.msg(resultdata.message, {
                          icon : 5
                      });
                  }
              },
              error : function(data, errorMsg) {
                  layer.close(index);
                  layer.msg(data.responseText, {icon : 2});
              }
          });
      } else {
          layer.msg("你没有选择行或选择了多行数据", {
              icon : 0
          });
      }
  }
  
  /**
   *锁定
   */
  function lockModel(url) {
      var rows = grid.getCheckedRecords();
      if (rows.length == 1) {
      	if (url == '/user/lock.html' || url == '/user/unlock.html') {
  	        if (rows[0].role.key == 'administrator') {
  	            layer.msg('该用户为超级管理员,不能锁定或解锁!', {
  	                icon : 0
  	            });
  	            return false;
  	        }
  	    }
          var index;
          $.ajax({
              type : "POST",
              url : sys.rootPath + url,
              data : {
                  "id" : rows[0].id
              },
              dataType : "json",
              beforeSend : function()
              {
                  index = layer.load();
              },
              success : function(resultdata) {
                  layer.close(index);
                  if (resultdata.success) {
                      layer.msg(resultdata.message, {
                          icon : 1
                      });
                      webside.common.loadPage("/user/listUI.html");
                  } else {
                      layer.msg(resultdata.message, {
                          icon : 5
                      });
                  }
              },
              error : function(data, errorMsg) {
                  layer.close(index);
                  layer.msg(data.responseText, {icon : 2});
              }
          });
      } else {
          layer.msg("你没有选择行或选择了多行数据", {
              icon : 0
          });
      }
  }
  
  