| | |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel2; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel2List; |
| | | import com.example.server.progressTrack.service.*; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.utils.UserAndSiteUtils; |
| | | import com.mxgraph.swing.mxGraphComponent; |
| | | import com.mxgraph.view.mxGraph; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | List<TableButton> buttonList = new ArrayList<>(); |
| | | buttonList.add(new TableButton("del", "删除")); |
| | | |
| | | columnDto.add(new ColumnDto("序号", "", 50, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("序号", "", 50, "autoCreate", true, null,null)); |
| | | //columnDto.add(new ColumnDto("工程专业", "majorName", 180, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("节点名称", "ProcessName", 160, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("要求完成时间", "requiredCompletionTime", 120, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("节点名称", "ProcessName", 160, null, true, null,null)); |
| | | columnDto.add(new ColumnDto("要求完成时间", "requiredCompletionTime", 120, "selectDate", true, null,null)); |
| | | columnDto.add(new ColumnDto("操作", "", 85, "", true, buttonList,null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | |
| | | |
| | | mxGraph graph = new mxGraph(); |
| | | DjJdgzNetworkLevel2 djJdgzNetworkLevel2 = level2Service.get(data.getId()); |
| | | graph = netWorkDiagramService.getCsDiagram(graph,djJdgzNetworkLevel2.getContent(),null,diagram.getWidth(),diagram.getHeight()); |
| | | graph = netWorkDiagramService.getCsDiagram(graph,djJdgzNetworkLevel2.getContent(),null,diagram.getWidth(),diagram.getHeight(),null); |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | btnSave.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser user = (SysUser) UserAndSiteUtils.get("user","user"); |
| | | if (user==null){ |
| | | JOptionPane.showMessageDialog(null, "用户失效请退出并重新登录", "提示", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | if (subTable.isEditing()) { |
| | | subTable.getCellEditor().stopCellEditing(); |
| | | } |
| | | CommonTable.saveTableList(list,subTable,columnDto); |
| | | level2ListService.save(list,data.getId(),diagram, finalGraph); |
| | | JOptionPane.showMessageDialog(null, "保存成功", "提示", JOptionPane.WARNING_MESSAGE); |
| | | |
| | | } |
| | | }); |
| | | |