From 6606e798b29fbcc885578246f295ba269ad5c2b3 Mon Sep 17 00:00:00 2001 From: wangchunxiang Date: Mon, 29 Dec 2025 15:38:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(platform):=20=E6=B7=BB=E5=8A=A0=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E9=80=89=E6=8B=A9=E9=A1=B5=E9=9D=A2=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA=E5=92=8C=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20Priority=20=E5=AF=BC=E5=85=A5=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B8=83=E5=B1=80=E6=9D=83=E9=87=8D=E5=88=86=E9=85=8D?= =?UTF-8?q?=20-=20=E9=87=8D=E6=9E=84=E9=A1=B6=E9=83=A8=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=B8=83=E5=B1=80=EF=BC=8C=E5=88=9B=E5=BB=BA=20HBox=20?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=88=86=E7=A6=BB=E6=A0=87=E9=A2=98=E5=92=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=8C=BA=E5=9F=9F=20-=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=9F=E6=88=B7=E5=90=8D=E7=A7=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E7=99=BB=E5=BD=95=E7=A7=9F=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=20-=20=E5=AE=9E=E7=8E=B0=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=8A=E5=85=B6=E6=A0=B7=E5=BC=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=20-=20=E6=B7=BB=E5=8A=A0=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=B8=85=E7=A9=BA=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20-=20=E5=AE=9E=E7=8E=B0=E9=80=80=E5=87=BA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E8=B7=B3=E8=BD=AC=E5=88=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD=20-=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B9=B3=E5=8F=B0=E9=80=89=E9=A1=B9=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E7=9A=84=E5=86=85=E8=BE=B9=E8=B7=9D=E5=92=8C=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantaibao/page/PlatformSelectionView.java | 67 +++++++++++++++---- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/fantaibao/page/PlatformSelectionView.java b/src/main/java/com/fantaibao/page/PlatformSelectionView.java index d268aea..bc51856 100644 --- a/src/main/java/com/fantaibao/page/PlatformSelectionView.java +++ b/src/main/java/com/fantaibao/page/PlatformSelectionView.java @@ -12,6 +12,7 @@ import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.stage.Stage; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -29,21 +30,45 @@ public class PlatformSelectionView { // 设置窗口标题 primaryStage.setTitle("中差评采集工具"); - // 主容器 - VBox root = new VBox(); - root.setAlignment(Pos.CENTER); - root.setSpacing(30); - root.setPadding(new Insets(40)); - - // 标题 + // 顶部区域容器 + HBox topContainer = new HBox(); + topContainer.setPadding(new Insets(10, 20, 10, 20)); + + // 左侧标题 + VBox titleContainer = new VBox(); Label titleLabel = new Label("请选择采集平台"); titleLabel.setStyle("-fx-font-size: 20px; -fx-font-weight: bold;"); - // 描述信息 Label infoLabel = new Label("连接您的电商平台,智能化采集中差评数据"); - infoLabel.setStyle("-fx-font-size: 14px; -fx-padding: 0 0 10 0;"); - + infoLabel.setStyle("-fx-font-size: 14px; -fx-padding: 5 0 0 0;"); + + titleContainer.getChildren().addAll(titleLabel, infoLabel); + HBox.setHgrow(titleContainer, Priority.ALWAYS); + + // 右侧用户信息区域 + HBox userInfoContainer = new HBox(); + userInfoContainer.setAlignment(Pos.CENTER_RIGHT); + userInfoContainer.setSpacing(10); + + // 显示租户名称 + Label tenantNameLabel = new Label("当前租户: " + (GlobalConfig.tenantName != null ? GlobalConfig.tenantName : "未登录")); + tenantNameLabel.setStyle("-fx-font-size: 14px; -fx-text-fill: #333; -fx-font-weight: bold;"); + + // 退出登录按钮 + Button logoutButton = new Button("退出登录"); + logoutButton.setStyle("-fx-background-color: #f44336; -fx-text-fill: white; -fx-border-radius: 4px; -fx-background-radius: 4px;"); + logoutButton.setCursor(javafx.scene.Cursor.HAND); + + userInfoContainer.getChildren().addAll(tenantNameLabel, logoutButton); + + topContainer.getChildren().addAll(titleContainer, userInfoContainer); + // 平台选项容器 + VBox platformOptionsContainer = new VBox(); + platformOptionsContainer.setAlignment(Pos.CENTER); + platformOptionsContainer.setSpacing(30); + platformOptionsContainer.setPadding(new Insets(20, 40, 40, 40)); + HBox platformOptions = new HBox(); platformOptions.setAlignment(Pos.CENTER); platformOptions.setSpacing(60); @@ -70,14 +95,32 @@ public class PlatformSelectionView { ); platformOptions.getChildren().addAll(meituanOption, meituanFirstOption, meituanCrawlOption); + platformOptionsContainer.getChildren().addAll(platformOptions); - // 添加组件到主容器 - root.getChildren().addAll(titleLabel, infoLabel, platformOptions); + // 主容器 + VBox root = new VBox(); + root.getChildren().addAll(topContainer, platformOptionsContainer); // 设置场景并显示窗口 Scene scene = new Scene(root, 800, 600); primaryStage.setScene(scene); primaryStage.show(); + + // 退出登录按钮事件处理 + logoutButton.setOnAction(event -> { + // 清空租户信息和相关配置 + GlobalConfig.tenantId = null; + GlobalConfig.tenantName = null; + GlobalConfig.mtShopListInterfaceAddress = null; + GlobalConfig.mtDianPingInterfaceAddress = null; + GlobalConfig.mtDaZhInterfaceAddress = null; + GlobalConfig.dyPingJiaInterfaceAddress = null; + GlobalConfig.mtLoginPage = null; + GlobalConfig.dyLoginPage = null; + + // 返回登录页面 + new LoginView(primaryStage); + }); } private VBox createPlatformMtOption(String title, Image imageUrl, String buttonColor,String beanName) {