Parcourir la source

登录页优化

hou il y a 2 jours
Parent
commit
7f5a2ee7fa

BIN
image/background.png


+ 9 - 1
src/com/mes/ui/LoginFarme.java

@@ -22,7 +22,7 @@ public class LoginFarme extends JFrame {
     static JButton scanLoginButton = new JButton("扫  码  登  录");
 
     public LoginFarme(){
-        setTitle("MES系统客户端115:"+MesClient.mes_gw+" - "+MesClient.mes_gw_des);
+        setTitle("MES系统客户端BE14:"+MesClient.mes_gw+" - "+MesClient.mes_gw_des);
 
         ImageIcon bg = new ImageIcon(MesClient.class.getResource("/background.png"));
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@@ -31,6 +31,14 @@ public class LoginFarme extends JFrame {
         imgLabel.setBounds(0,0,bg.getIconWidth(), bg.getIconHeight());//设置背景标签的位置
         Container contentPane=getContentPane();
         contentPane.setLayout(null);//布局,很重要
+        if (MesClient.login_title != null && !MesClient.login_title.isEmpty()) {
+            JLabel titleLabel = new JLabel(MesClient.login_title, SwingConstants.CENTER);
+            titleLabel.setFont(new Font("微软雅黑", Font.BOLD, 28));
+            titleLabel.setForeground(Color.WHITE);
+            titleLabel.setOpaque(false);
+            titleLabel.setBounds(0, 18, 902, 50);
+            contentPane.add(titleLabel);
+        }
         JPanel welcomePanel = new JPanel();
         //welcomePanel.setLayout(new GridLayout(3, 1));
         welcomePanel.setLayout(null);

+ 8 - 1
src/com/mes/ui/MesClient.java

@@ -35,6 +35,7 @@ public class MesClient extends JFrame {
     public static String mes_server_ip = ""; // 服务器IP地址
     public static int mes_heart_icon_cycle = 1;
     public static String mes_line_sn = ""; // 产线编号
+    public static String login_title = "MES管理系统"; // 登录页顶部标题,来自配置文件
 
     //session
     public static String sessionid = "";
@@ -119,6 +120,12 @@ public class MesClient extends JFrame {
         mes_gw =  pro.getProperty("mes.gw");
         mes_server_ip = pro.getProperty("mes.server_ip");
         mes_line_sn = pro.getProperty("mes.line_sn");
+        String loginTitleFromCfg = pro.getProperty("mes.login.title");
+        if (loginTitleFromCfg == null) {
+            login_title = "MES管理系统";
+        } else {
+            login_title = loginTitleFromCfg.trim();
+        }
         mes_gw_des = OprnoUtil.getGwDes(mes_line_sn,mes_gw);
         log.info(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";");
     }
@@ -351,7 +358,7 @@ public class MesClient extends JFrame {
 
     public MesClient() {
         setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
-        setTitle("MES系统客户端115:"+mes_gw + "- " + mes_gw_des);
+        setTitle("MES系统客户端BE14:"+mes_gw + "- " + mes_gw_des);
 //        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setBounds(0, 0, 1024, 768);
 

+ 5 - 3
src/resources/config/config.properties

@@ -1,4 +1,6 @@
 mes.gw=OP010A
-#mes.server_ip=127.0.0.1
-mes.server_ip=192.168.9.180
-mes.line_sn=BE14XT
+mes.server_ip=127.0.0.1
+#mes.server_ip=192.168.9.180
+mes.line_sn=BE14XT
+# 登录页顶部标题(显示在背景图上方,不写在图片里)
+mes.login.title=安徽裕洋MES管理系统