提交至:branch_zyx

pull/16/head
“郑亦歆” 9 months ago
parent e8dded798d
commit 826a686744

@ -122,6 +122,7 @@ public class ChangeStatusDialog extends JDialog implements ActionListener{ //
String catalog1 = (String) cb.getSelectedItem(); // 获取下拉框选中的项 String catalog1 = (String) cb.getSelectedItem(); // 获取下拉框选中的项
if (catalog1.equals("已入库")) { // 如果选中项为"已入库" if (catalog1.equals("已入库")) { // 如果选中项为"已入库"
catalog = 1; // 将分类标识设置为1 catalog = 1; // 将分类标识设置为1
} }
else if (catalog1.equals("待入库")) { // 如果选中项为"待入库" else if (catalog1.equals("待入库")) { // 如果选中项为"待入库"
catalog = 2; // 将分类标识设置为2 catalog = 2; // 将分类标识设置为2
@ -130,6 +131,7 @@ public class ChangeStatusDialog extends JDialog implements ActionListener{ //
} }
} }
} }

@ -18,6 +18,7 @@ import javax.swing.JPanel; // 导入面板组件类
import javax.swing.JTable; // 导入表格组件类 import javax.swing.JTable; // 导入表格组件类
import javax.swing.JTextField; // 导入文本框组件类 import javax.swing.JTextField; // 导入文本框组件类
import com.lingnan.supermarket.*; // 导入超市项目相关的所有类 import com.lingnan.supermarket.*; // 导入超市项目相关的所有类
import com.lingnan.supermarket.dao.UserService; // 导入用户服务接口 import com.lingnan.supermarket.dao.UserService; // 导入用户服务接口
import com.lingnan.supermarket.dao.impl.BufferImpl; // 导入缓冲区服务实现类 import com.lingnan.supermarket.dao.impl.BufferImpl; // 导入缓冲区服务实现类
@ -73,6 +74,7 @@ public class InDialog extends JDialog implements ActionListener{ // 定义一个
} }

@ -90,4 +90,6 @@ public class InRecordTM extends AbstractTableModel{ // 定义一个类,继承
} }

@ -66,4 +66,6 @@ public class ProdCatalogTM extends AbstractTableModel{ // 定义一个类,继
} }

@ -65,6 +65,7 @@ public class StorageRecordTM extends AbstractTableModel{ // 定义一个类,
@Override @Override
public String getColumnName(int column) { // 重写getColumnName方法返回指定列的列名 public String getColumnName(int column) { // 重写getColumnName方法返回指定列的列名
return columnName[column]; // 返回columnName数组中指定索引的值 return columnName[column]; // 返回columnName数组中指定索引的值
@ -72,4 +73,5 @@ public class StorageRecordTM extends AbstractTableModel{ // 定义一个类,
} }

@ -71,4 +71,6 @@ public class StorageTableModel extends AbstractTableModel{ // 定义一个类,
} }

@ -711,6 +711,8 @@ public class InView extends JPanel implements ActionListener{
JOptionPane.showConfirmDialog(null,"退出成功", "提示", JOptionPane.PLAIN_MESSAGE); JOptionPane.showConfirmDialog(null,"退出成功", "提示", JOptionPane.PLAIN_MESSAGE);
} }
} }
} }
} }

@ -1,5 +1,6 @@
package com.lingnan.supermarket.view; // 定义包名,所有视图相关的类都在这个包下 package com.lingnan.supermarket.view; // 定义包名,所有视图相关的类都在这个包下
import java.awt.event.ActionEvent; // 导入ActionEvent类用于监听动作事件 import java.awt.event.ActionEvent; // 导入ActionEvent类用于监听动作事件
import java.awt.event.ActionListener; // 导入ActionListener接口用于实现动作事件监听 import java.awt.event.ActionListener; // 导入ActionListener接口用于实现动作事件监听
import java.awt.event.MouseEvent; // 导入MouseEvent类用于监听鼠标事件 import java.awt.event.MouseEvent; // 导入MouseEvent类用于监听鼠标事件
@ -24,6 +25,7 @@ import javax.swing.JPanel; // 导入JPanel类用于创建面板
import javax.swing.JSplitPane; // 导入JSplitPane类用于创建分隔面板 import javax.swing.JSplitPane; // 导入JSplitPane类用于创建分隔面板
import javax.swing.Timer; // 导入Timer类用于实现定时器 import javax.swing.Timer; // 导入Timer类用于实现定时器
import com.lingnan.supermarket.componet.BGPanel; // 导入自定义的BGPanel类 import com.lingnan.supermarket.componet.BGPanel; // 导入自定义的BGPanel类
import com.lingnan.supermarket.dao.impl.BufferImpl; // 导入BufferImpl类可能是数据访问层的实现 import com.lingnan.supermarket.dao.impl.BufferImpl; // 导入BufferImpl类可能是数据访问层的实现
import com.lingnan.supermarket.dao.impl.inOrderServiceImpl; // 导入inOrderServiceImpl类可能是订单服务的实现 import com.lingnan.supermarket.dao.impl.inOrderServiceImpl; // 导入inOrderServiceImpl类可能是订单服务的实现
@ -38,8 +40,10 @@ import com.lingnan.supermarket.utils.DateUtil; // 导入DateUtil类可能是
import com.lingnan.supermarket.utils.FontUtil; // 导入FontUtil类可能是字体工具类 import com.lingnan.supermarket.utils.FontUtil; // 导入FontUtil类可能是字体工具类
import com.lingnan.supermarket.view.base.BaseView; // 导入BaseView类可能是视图基类 import com.lingnan.supermarket.view.base.BaseView; // 导入BaseView类可能是视图基类
import java.awt.*; // 导入awt包中的所有类 import java.awt.*; // 导入awt包中的所有类
// 主视图类继承自BaseView并实现多个事件监听接口 // 主视图类继承自BaseView并实现多个事件监听接口
public class MainView extends BaseView implements ActionListener, MouseListener,WindowListener{ public class MainView extends BaseView implements ActionListener, MouseListener,WindowListener{
@ -141,6 +145,8 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
} }
public static void refreshRemind() { public static void refreshRemind() {
Vector<InOrder> vInOrder; // 声明未确认订单的向量 Vector<InOrder> vInOrder; // 声明未确认订单的向量
vInOrder = inOrderImpl.findUnconfirmInOrder(); // 查找所有未确认的订单 vInOrder = inOrderImpl.findUnconfirmInOrder(); // 查找所有未确认的订单
@ -228,12 +234,14 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
leftPanel.add(homeMenuLabel); // 将首页菜单标签添加到左侧面板 leftPanel.add(homeMenuLabel); // 将首页菜单标签添加到左侧面板
/*菜单栏:人员管理*/ /*菜单栏:人员管理*/
userMenuLabel = new JLabel("人员管理", new ImageIcon("static\\icon\\user1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示人员管理菜单
userMenuLabel.setFont(FontUtil.menuFont); // 设置菜单标签的字体样式 userMenuLabel = new JLabel("人员管理",new ImageIcon("static\\icon\\user1.png"),JLabel.LEFT);
userMenuLabel.addMouseListener(this); // 为菜单标签添加鼠标事件监听器 userMenuLabel.setFont(FontUtil.menuFont);
userMenuLabel.setBounds(20, 300, 150, 32); // 设置菜单标签的位置和大小 userMenuLabel.addMouseListener(this);
userMenuLabel.setForeground(Color.white); // 设置菜单标签的前景色为白色 userMenuLabel.setBounds(20, 300,150,32);
leftPanel.add(userMenuLabel); // 将人员管理菜单标签添加到左侧面板 userMenuLabel.setForeground(Color.white);
leftPanel.add(userMenuLabel);/*添加用户选项到菜单栏*/
/*菜单栏:进货系统*/ /*菜单栏:进货系统*/
inMenuLabel = new JLabel("进货系统", new ImageIcon("static\\icon\\in1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示进货系统菜单 inMenuLabel = new JLabel("进货系统", new ImageIcon("static\\icon\\in1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示进货系统菜单
@ -243,13 +251,15 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
inMenuLabel.setForeground(Color.white); // 设置菜单标签的前景色为白色 inMenuLabel.setForeground(Color.white); // 设置菜单标签的前景色为白色
leftPanel.add(inMenuLabel); // 将进货系统菜单标签添加到左侧面板 leftPanel.add(inMenuLabel); // 将进货系统菜单标签添加到左侧面板
/*菜单栏:收银系统*/ /*菜单栏:收银系统*/
outMenuLabel = new JLabel("收银系统", new ImageIcon("static\\icon\\out1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示收银系统菜单 outMenuLabel = new JLabel("收银系统",new ImageIcon("static\\icon\\out1.png") ,JLabel.LEFT);
outMenuLabel.setFont(FontUtil.menuFont); // 设置菜单标签的字体样式 outMenuLabel.setFont(FontUtil.menuFont);
outMenuLabel.addMouseListener(this); // 为菜单标签添加鼠标事件监听器 outMenuLabel.addMouseListener(this);
outMenuLabel.setBounds(20, 400, 150, 32); // 设置菜单标签的位置和大小 outMenuLabel.setBounds(20, 400,150,32);
outMenuLabel.setForeground(Color.white); // 设置菜单标签的前景色为白色 outMenuLabel.setForeground(Color.white);
leftPanel.add(outMenuLabel); // 将收银系统菜单标签添加到左侧面板 leftPanel.add(outMenuLabel);
/*菜单栏:库存*/ /*菜单栏:库存*/
storageMenuLabel = new JLabel("商品库存", new ImageIcon("static\\icon\\storage1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示商品库存菜单 storageMenuLabel = new JLabel("商品库存", new ImageIcon("static\\icon\\storage1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示商品库存菜单
@ -268,12 +278,15 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
leftPanel.add(supplierMenuLabel); // 将供应商菜单标签添加到左侧面板 leftPanel.add(supplierMenuLabel); // 将供应商菜单标签添加到左侧面板
/*菜单栏:商品目录*/ /*菜单栏:商品目录*/
catalogMenuLabel = new JLabel("商品目录", new ImageIcon("static\\icon\\catalog1.png"), JLabel.LEFT); // 创建一个带有图标的JLabel用于表示商品目录菜单
catalogMenuLabel.setFont(FontUtil.menuFont); // 设置菜单标签的字体样式
catalogMenuLabel.addMouseListener(this); // 为菜单标签添加鼠标事件监听器
catalogMenuLabel.setBounds(20, 550, 150, 32); // 设置菜单标签的位置和大小 catalogMenuLabel = new JLabel("商品目录",new ImageIcon("static\\icon\\catalog1.png") ,JLabel.LEFT);
catalogMenuLabel.setForeground(Color.white); // 设置菜单标签的前景色为白色 catalogMenuLabel.setFont(FontUtil.menuFont);
leftPanel.add(catalogMenuLabel); // 将商品目录菜单标签添加到左侧面板 catalogMenuLabel.addMouseListener(this);
catalogMenuLabel.setBounds(20,550,150,32);
catalogMenuLabel.setForeground(Color.white);
leftPanel.add(catalogMenuLabel);
/*提醒进货确认模块*/ /*提醒进货确认模块*/
@ -284,7 +297,9 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
remindMenuLabel.setForeground(Color.white); // 设置提醒菜单标签的前景色为白色 remindMenuLabel.setForeground(Color.white); // 设置提醒菜单标签的前景色为白色
leftPanel.add(remindMenuLabel); // 将提醒菜单标签添加到左侧面板 leftPanel.add(remindMenuLabel); // 将提醒菜单标签添加到左侧面板
// 设置右侧面板的布局管理器为卡片布局 // 设置右侧面板的布局管理器为卡片布局
rightPanelLayout = new CardLayout(); rightPanelLayout = new CardLayout();
// 0.超市首页展示,创建并实例化首页视图面板 // 0.超市首页展示,创建并实例化首页视图面板
@ -522,10 +537,12 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
// 如果事件源是用户菜单标签,则改变前景色和图标 // 如果事件源是用户菜单标签,则改变前景色和图标
if(source==userMenuLabel) { if(source==userMenuLabel) {
userMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色 userMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色
userMenuLabel.setIcon(new ImageIcon("static\\icon\\user2.png")); // 设置鼠标进入时的图标 userMenuLabel.setIcon(new ImageIcon("static\\icon\\user2.png")); // 设置鼠标进入时的图标
} }
// 如果事件源是入库菜单标签,则改变前景色和图标 // 如果事件源是入库菜单标签,则改变前景色和图标
else if(source==inMenuLabel) { else if(source==inMenuLabel) {
inMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色 inMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色
@ -550,6 +567,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
supplierMenuLabel.setIcon(new ImageIcon("static\\icon\\supplier2.png")); // 设置鼠标进入时的图标 supplierMenuLabel.setIcon(new ImageIcon("static\\icon\\supplier2.png")); // 设置鼠标进入时的图标
} }
// 如果事件源是目录菜单标签,则改变前景色和图标 // 如果事件源是目录菜单标签,则改变前景色和图标
else if(source==catalogMenuLabel) { else if(source==catalogMenuLabel) {
catalogMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色 catalogMenuLabel.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色
@ -557,6 +575,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
} }
// 如果事件源是用户菜单标签1则改变前景色 // 如果事件源是用户菜单标签1则改变前景色
else if(source==userMenuLabel1) { else if(source==userMenuLabel1) {
userMenuLabel1.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色 userMenuLabel1.setForeground(new Color(18, 150, 219)); // 设置前景色为蓝色
// 注意:这里没有设置图标,可能是因为该标签没有对应的鼠标进入图标 // 注意:这里没有设置图标,可能是因为该标签没有对应的鼠标进入图标
@ -577,6 +596,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
homeMenuLabel.setIcon(new ImageIcon("static\\icon\\home1.png")); // 设置鼠标离开时的默认图标 homeMenuLabel.setIcon(new ImageIcon("static\\icon\\home1.png")); // 设置鼠标离开时的默认图标
} }
// 如果事件源是用户菜单标签,则恢复前景色和图标 // 如果事件源是用户菜单标签,则恢复前景色和图标
else if(source==userMenuLabel) { else if(source==userMenuLabel) {
userMenuLabel.setForeground(Color.white); // 恢复前景色为白色 userMenuLabel.setForeground(Color.white); // 恢复前景色为白色
@ -607,13 +627,11 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
supplierMenuLabel.setIcon(new ImageIcon("static\\icon\\supplier1.png")); // 设置鼠标离开时的默认图标 supplierMenuLabel.setIcon(new ImageIcon("static\\icon\\supplier1.png")); // 设置鼠标离开时的默认图标
} }
// 如果事件源是目录菜单标签,则恢复前景色和图标
else if(source==catalogMenuLabel) { else if(source==catalogMenuLabel) {
catalogMenuLabel.setForeground(Color.white); // 恢复前景色为白色 catalogMenuLabel.setForeground(Color.white);
catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog1.png")); // 设置鼠标离开时的默认图标 catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog1.png"));
} }
// 如果事件源不是上述任何一个标签则默认处理用户菜单标签1
else { else {
userMenuLabel1.setForeground(Color.white); // 恢复前景色为白色 userMenuLabel1.setForeground(Color.white); // 恢复前景色为白色
// 注意:这里没有设置图标,可能是因为该标签没有对应的鼠标离开图标 // 注意:这里没有设置图标,可能是因为该标签没有对应的鼠标离开图标

Loading…
Cancel
Save