jinlin
2025-03-18 d30e385951ce03335a5023f0775fd144da3c0b88
src/main/java/com/example/client/service/Level3ManageService.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.client.utils.MultiSelectComboBox;
import com.example.server.cabin.service.CabinService;
@@ -57,6 +58,7 @@
    public JPanel createTable(Integer width, Integer height, JFrame jFrame) {
        JPanel panel = new JPanel();
        panel.setPreferredSize(new Dimension(width,height));
        JPanel topJpanel = new JPanel();
        GridBagLayout layout = new GridBagLayout();
@@ -65,7 +67,7 @@
        topJpanel.setBackground(Color.WHITE);
        JPanel centerJpanel = new JPanel();
        centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100));
        centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame)));
        centerJpanel.setBackground(Color.WHITE);
        panel.add(topJpanel, BorderLayout.NORTH);
        panel.add(centerJpanel, BorderLayout.CENTER);
@@ -170,11 +172,10 @@
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem();
                    if (selectedItem != null) {
                        long selectedId = selectedItem.getId();
                        Long selectedId = selectedItem.getId();
                        JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(selectedId);
                        comboBox2.setModel(new DefaultComboBoxModel<>(teamList));
                        comboBox2.setSelectedIndex(0);
                        String content = comboBox.getSelectedItem().toString();
                        JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem();
@@ -288,8 +289,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 - 120));
        scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,jFrame)));
        centerJpanel.add(scrollPane);
        jFrame.addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent e) {
                centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame)));
                scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(100,jFrame)));
                centerJpanel.revalidate();
                centerJpanel.repaint();
                scrollPane.revalidate();
                scrollPane.repaint();
            }
        });
        return panel;
    }