jinlin
2025-03-21 77d58298d00c11ade8862ca8acb0fdef5a45322e
src/main/java/com/example/client/service/Level2ManageService.java
@@ -4,6 +4,7 @@
import com.example.client.dto.JComboBoxItem;
import com.example.client.model.TableButton;
import com.example.client.utils.CommonTable;
import com.example.client.utils.Compute;
import com.example.client.utils.GBC;
import com.example.server.progressTrack.model.DjJdgzNetworkLevel1;
import com.example.server.progressTrack.model.DjJdgzNetworkLevel2;
@@ -53,13 +54,13 @@
    public JPanel createTable(Integer width, Integer height, JFrame jFrame) {
        JPanel panel = new JPanel();
        JPanel panel = new JPanel(new BorderLayout());
        JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        topJpanel.setPreferredSize(new Dimension(width, 37));
        topJpanel.setPreferredSize(new Dimension(width, 40));
        topJpanel.setBackground(Color.WHITE);
        JPanel centerJpanel = new JPanel();
        centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100));
        centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame)));
        centerJpanel.setBackground(Color.WHITE);
        panel.add(topJpanel, BorderLayout.NORTH);
        panel.add(centerJpanel, BorderLayout.CENTER);
@@ -122,12 +123,14 @@
        btnInsert.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                jFrame.setEnabled(false);
                insert(jFrame);
            }
        });
        btnDown.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                jFrame.setEnabled(false);
                DownLoadTmpFile.down(tmpPath + "二级网络图导入模板.xlsx", jFrame);
            }
        });
@@ -135,8 +138,19 @@
        JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        scrollPane.setViewportView(table);
        scrollPane.getViewport().setBackground(Color.WHITE);
        scrollPane.setPreferredSize(new Dimension(width - 20, height - 100));
        scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,jFrame)));
        centerJpanel.add(scrollPane);
        jFrame.addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent e) {
                centerJpanel.setPreferredSize(new Dimension(width  - 20, Compute.ComputeHeight(40,jFrame)));
                scrollPane.setPreferredSize(new Dimension(width  - 20,Compute.ComputeHeightWithScroll(40,jFrame)));
                centerJpanel.revalidate();
                centerJpanel.repaint();
                scrollPane.revalidate();
                scrollPane.repaint();
            }
        });
        return panel;
    }
@@ -227,9 +241,9 @@
                Object newValue = table.getModel().getValueAt(row, column);
                // 输出变化信息
                if (newValue.equals("edit")) {
                    jFrame.setEnabled(false);
                    DjJdgzNetworkLevel2 data = list.get(row);
                    addOrUpdate.openDialog(data, jFrame);
                    jFrame.setEnabled(false);
                } else if (newValue.equals("del")) {
                    int n = JOptionPane.showConfirmDialog(null, "是否删除?", "提示", JOptionPane.YES_NO_OPTION);
                    if (n == 0) {