コード例 #1
0
 /** 获取列 */
 public STableColumn[] getColumns() {
   ArrayList<STableColumn> columnList = new ArrayList<STableColumn>();
   LoginInfo loginInfo = getContext().find(LoginInfo.class);
   // 是否总经理或经理
   boolean isManager =
       loginInfo.hasAuth(Auth.Boss)
           || loginInfo.hasAuth(Auth.AccountManager)
           || loginInfo.hasAuth(Auth.SalesManager)
           || loginInfo.hasAuth(Auth.PurchaseManager)
           || loginInfo.hasAuth(Auth.StoreKeeperManager);
   //
   STableColumn titleColumn = new STableColumn("noticeTitle", 200, JWT.LEFT, "公告标题");
   titleColumn.setGrab(true);
   titleColumn.setSortable(true);
   columnList.add(titleColumn);
   // 发布日期
   STableColumn publishTimeColumn = new STableColumn("publishTime", 150, JWT.CENTER, "发布日期");
   publishTimeColumn.setSortable(true);
   columnList.add(publishTimeColumn);
   //		//只有总经理或经理显示该列
   //		if(isManager){
   //			//撤消日期
   //			STableColumn cancelTimeColumn = new STableColumn("cancelTime", 150, JWT.CENTER, "撤消日期");
   //			cancelTimeColumn.setSortable(true);
   //			columnList.add(cancelTimeColumn);
   //		}
   STableColumn createPersonColumn = new STableColumn("createPerson", 150, JWT.CENTER, "创建人");
   createPersonColumn.setSortable(true);
   columnList.add(createPersonColumn);
   // 只有总经理或经理显示该列
   if (isManager) {
     //			//发布范围
     //			STableColumn deptNameStrColumn = new STableColumn("deptNameStr", 300, JWT.CENTER,
     // "发布范围");
     //			deptNameStrColumn.setSortable(true);
     //			deptNameStrColumn.setGrab(true);
     //			columnList.add(deptNameStrColumn);
     // 置顶
     STableColumn isTopColumn = new STableColumn("isTop", 50, JWT.CENTER, "置顶");
     isTopColumn.setSortable(true);
     columnList.add(isTopColumn);
   }
   return columnList.toArray(new STableColumn[columnList.size()]);
 }
コード例 #2
0
 /** 获取列 */
 public STableColumn[] getColumns() {
   ArrayList<STableColumn> columnList = new ArrayList<STableColumn>();
   // 公告标题
   STableColumn titleColumn = new STableColumn("noticeTitle", 200, JWT.LEFT, "公告标题");
   titleColumn.setGrab(true);
   titleColumn.setSortable(true);
   columnList.add(titleColumn);
   // 发布日期
   STableColumn publishTimeColumn = new STableColumn("publishTime", 150, JWT.CENTER, "发布日期");
   publishTimeColumn.setSortable(true);
   columnList.add(publishTimeColumn);
   // 撤消日期
   STableColumn cancelTimeColumn = new STableColumn("cancelTime", 150, JWT.CENTER, "撤消日期");
   cancelTimeColumn.setSortable(true);
   columnList.add(cancelTimeColumn);
   // 只有总经理显示该列
   if (getContext().find(LoginInfo.class).hasAuth(Auth.Boss)) {
     STableColumn createPersonColumn = new STableColumn("createPerson", 150, JWT.CENTER, "创建人");
     createPersonColumn.setSortable(true);
     columnList.add(createPersonColumn);
   }
   // 发布范围
   STableColumn deptNameStrColumn = new STableColumn("deptNameStr", 300, JWT.CENTER, "发布范围");
   deptNameStrColumn.setSortable(true);
   deptNameStrColumn.setGrab(true);
   columnList.add(deptNameStrColumn);
   // 置顶
   STableColumn isTopColumn = new STableColumn("isTop", 50, JWT.CENTER, "置顶");
   isTopColumn.setSortable(true);
   columnList.add(isTopColumn);
   return columnList.toArray(new STableColumn[columnList.size()]);
 }