| | |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.service.*; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.utils.UserAndSiteUtils; |
| | | import com.example.server.utils.DownLoadTmpFile; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.awt.*; |
| | | import java.awt.datatransfer.DataFlavor; |
| | | import java.awt.datatransfer.Transferable; |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.awt.event.ItemEvent; |
| | | import java.awt.event.ItemListener; |
| | | import java.awt.event.*; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | private String tmpPath; |
| | | |
| | | public void FileUpload(List<ColumnDto> columnDto, JTable subTable, JFrame jFrame) { |
| | | frame = new JFrame("导入"); |
| | | frame = new JFrame("导入三级网络图"); |
| | | frame.setSize(900, 600); |
| | | frame.setResizable(true); |
| | | frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | | frame.setLocationRelativeTo(null); |
| | | frame.setVisible(true); |
| | | frame.addWindowListener(new WindowAdapter() { |
| | | //添加第二个界面的关闭事件: |
| | | public void windowClosing(WindowEvent e) { |
| | | //添加事件: |
| | | jFrame.setEnabled(true);//将主界面再设置为可操作的 |
| | | } |
| | | }); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | frame.setLayout(layout); |
| | | |
| | |
| | | JLabel label0 = new JLabel("工程"); |
| | | JComboBox<JComboBoxItem> comboBox0 = new JComboBox<>(projectList); |
| | | |
| | | JLabel label1 = new JLabel("二级网络图"); |
| | | JLabel label1 = new JLabel("一级网络图节点"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(); |
| | | comboBox1.setModel(new DefaultComboBoxModel<>(level2List)); |
| | | |
| | |
| | | @Override |
| | | public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
| | | super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
| | | setText(truncateText(value.toString(), 15)); // 截断文本 |
| | | if(value!=null){ |
| | | setText(truncateText(value.toString(), 15)); // 截断文本 |
| | | }else{ |
| | | setText(""); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | SysUser user = (SysUser) UserAndSiteUtils.get("user","user"); |
| | | if (user==null){ |
| | | JOptionPane.showMessageDialog(null, "用户失效请退出并重新登录", "提示", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | |
| | | model.setDataVector(data, columnIdentifiers); |
| | | table.setModel(model); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(600); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(100); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(550); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(150); |
| | | |
| | | |
| | | table.getColumnModel().getColumn(0).setCellRenderer(new TableViewRenderer()); |
| | |
| | | if (uploadSucceeded.equals("true")) { |
| | | waitUtil.dispose(); |
| | | frame.dispose(); |
| | | jFrame.setEnabled(true);//将主界面再设置为可操作的 |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "改装", "加装", "换装", "改进性修理" |
| | | }; |
| | | List<DjJdgzNetworkLevel3> list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | "","改换装","修理","改进性修理","不复装设备" |
| | | }; |
| | | List<DjJdgzNetworkLevel3> list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],0,0,null); |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | level3ManageService.tableModelListener(list, subTable, jFrame); |
| | | System.out.println("导入成功时间" + new Date()); |
| | |
| | | JOptionPane.showMessageDialog(null, "只能上传.xlsx或.xls的文件,且不超过2G\"", "提示", JOptionPane.WARNING_MESSAGE); |
| | | return flag; |
| | | } |
| | | |
| | | SysUser user = (SysUser) UserAndSiteUtils.get("user","user"); |
| | | if (user==null){ |
| | | flag = false; |
| | | JOptionPane.showMessageDialog(null, "用户失效请退出并重新登录", "提示", JOptionPane.WARNING_MESSAGE); |
| | | return flag; |
| | | } |
| | | |
| | | model.setDataVector(data, columnIdentifiers); |
| | | table.setModel(model); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(650); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(80); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(550); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(150); |
| | | |
| | | table.getColumnModel().getColumn(0).setCellRenderer(new TableViewRenderer()); |
| | | table.getColumnModel().getColumn(1).setCellRenderer(new TableCellRendererButton()); |