From d30e385951ce03335a5023f0775fd144da3c0b88 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 18 三月 2025 11:18:31 +0800
Subject: [PATCH] 修改
---
src/main/java/com/example/client/service/SubunitService.java | 50 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/example/client/service/SubunitService.java b/src/main/java/com/example/client/service/SubunitService.java
index d77b425..e6161b0 100644
--- a/src/main/java/com/example/client/service/SubunitService.java
+++ b/src/main/java/com/example/client/service/SubunitService.java
@@ -3,6 +3,7 @@
import com.example.client.dto.ColumnDto;
import com.example.client.dto.JComboBoxItem;
import com.example.client.utils.CommonTable;
+import com.example.client.utils.Compute;
import com.example.client.utils.GBC;
import com.example.server.cabin.service.CabinService;
import com.example.server.progressTrack.model.DjJdgzNetworkLevel3;
@@ -47,11 +48,16 @@
JPanel jLeft = new JPanel(new BorderLayout());
JPanel top = new JPanel();
+ JPanel center = new JPanel();
GridBagLayout layout = new GridBagLayout();
top.setLayout(layout);
- jLeft.setPreferredSize(new Dimension(width / 2 - 20, height));
top.setPreferredSize(new Dimension(width / 2 - 20, 100));
+ jLeft.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(0,frame)));
+ center.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(100,frame)));
+
+ jLeft.add(center,BorderLayout.CENTER);
+
// 鍒涘缓宸︿晶琛ㄦ牸
@@ -60,7 +66,7 @@
JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null);
JComboBoxItem[] cabinList = cabinService.getList();
String[] typeList = new String[]{
- "鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�"
+ "鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�",""
};
List<DjJdgzShip> shipList = djJdgzShipService.getList();
Map<String, Long> shipMap = new HashMap<>();
@@ -117,15 +123,15 @@
list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null);
columnDto.add(new ColumnDto("搴忓彿", "", 60, "autoCreate", false, null, null));
- columnDto.add(new ColumnDto("璁惧鍚嶇О", "name", 180, null, false, null, null));
- columnDto.add(new ColumnDto("閮ㄩ棬", "deptId", 180, "dict", false, null, deptList));
- columnDto.add(new ColumnDto("涓撲笟", "teamgroupId", 180, "dict", false, null, teamList));
- columnDto.add(new ColumnDto("鑸卞", "cabinId", 180, "dict", false, null, cabinList));
- columnDto.add(new ColumnDto("绫诲埆", "type", 180, null, false, null, null));
+ columnDto.add(new ColumnDto("璁惧鍚嶇О", "name", 152, null, false, null, null));
+ columnDto.add(new ColumnDto("閮ㄩ棬", "deptId", 152, "dict", false, null, deptList));
+ columnDto.add(new ColumnDto("涓撲笟", "teamgroupId", 152, "dict", false, null, teamList));
+ columnDto.add(new ColumnDto("鑸卞", "cabinId", 150, "dict", false, null, cabinList));
+ columnDto.add(new ColumnDto("绫诲埆", "type", 150, null, false, null, null));
JTable subTable = CommonTable.createCommonTable(list, columnDto);
subTable.setRowHeight(25);
- subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
+ subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
comboBox.addItemListener(new ItemListener() {
public void itemStateChanged(final ItemEvent event) {
@@ -140,7 +146,6 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -179,7 +184,7 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
+
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -209,7 +214,7 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
+
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -237,7 +242,7 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
+
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -265,7 +270,7 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
+
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -288,7 +293,7 @@
CommonTable.refreshTable(list, columnDto, subTable);
subTable.setRowHeight(25);
- subTable.setAutoCreateRowSorter(true);
+
subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
subTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
@@ -306,7 +311,22 @@
JScrollPane scrollTable = new JScrollPane(subTable);
- jLeft.add(scrollTable, BorderLayout.CENTER);
+ scrollTable.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeightWithScroll(100,frame)));
+ center.add(scrollTable);
+ frame.addComponentListener(new ComponentAdapter() {
+ @Override
+ public void componentResized(ComponentEvent e) {
+ jLeft.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(0,frame)));
+ center.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(100,frame)));
+ scrollTable.setPreferredSize(new Dimension(width / 2 - 20,Compute.ComputeHeightWithScroll(100,frame)));
+ jLeft.revalidate();
+ jLeft.repaint();
+ center.revalidate();
+ center.repaint();
+ scrollTable.revalidate();
+ scrollTable.repaint();
+ }
+ });
JPanel track = addOrUpdate.createTrack(width / 2, height, list.get(0), frame);
--
Gitblit v1.9.1