| | |
| | | |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | |
| | | JComboBoxItem[] boatList = boatFleetService.getBoatList(); |
| | | |
| | | columnDto = new ArrayList<>(); |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("序号", "", (width - 10) / 8, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("用户名", "username", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("昵称", "nickName", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("密码", "password", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("所属T队", "boatFleetId", (width - 10) / 8, "dict", true, null,boatList)); |
| | | columnDto.add(new ColumnDto("所属部门", "deptId", (width - 10) / 8, "dict", true, null,deptList)); |
| | | columnDto.add(new ColumnDto("所属专业", "teamgroupId", (width - 10) / 8, "dict", true, null,teamList)); |
| | | columnDto.add(new ColumnDto("操作", "", (width - 10) / 8, "", true, buttonList,null)); |
| | | columnDto.add(new ColumnDto("序号", "", (width - 10) / 7, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("用户名", "username", (width - 10) / 7, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("昵称", "nickName", (width - 10) / 7, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("密码", "password", (width - 10) / 7, null, false, null,null)); |
| | | //columnDto.add(new ColumnDto("所属T队", "boatFleetId", (width - 10) / 8, "dict", true, null,boatList)); |
| | | columnDto.add(new ColumnDto("所属部门", "deptId", (width - 10) / 7, "dict", true, null,deptList)); |
| | | columnDto.add(new ColumnDto("所属专业", "teamgroupId", (width - 10) / 7, "dict", true, null,teamList)); |
| | | columnDto.add(new ColumnDto("操作", "", (width - 10) / 7, "", true, buttonList,null)); |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table,jFrame,list); |
| | |
| | | btnInsert.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | jFrame.setEnabled(false); |
| | | SysUser data = new SysUser(); |
| | | addOrUpdate.openDialog(data,jFrame, columnDto,table); |
| | | jFrame.setEnabled(false); |
| | | } |
| | | }); |
| | | |
| | |
| | | Object newValue = table.getModel().getValueAt(row, column); |
| | | // 输出变化信息 |
| | | if (newValue.equals("edit")){ |
| | | jFrame.setEnabled(false); |
| | | SysUser data = list.get(row); |
| | | addOrUpdate.openDialog(data,jFrame, columnDto,table); |
| | | jFrame.setEnabled(false); |
| | | }else if(newValue.equals("del")) { |
| | | int n = JOptionPane.showConfirmDialog(null, "是否删除?", "提示", JOptionPane.YES_NO_OPTION); |
| | | if (n == 0) { |