初始化

This commit is contained in:
2026-08-08 18:28:49 +08:00
parent 9bef4420e0
commit f082037a6e
854 changed files with 217171 additions and 11 deletions
+19
View File
@@ -0,0 +1,19 @@
</section>
</div>
<footer class="main-footer">
<div class="pull-right hidden-xs"><b>Version</b> 1.0.0</div>
<strong>&copy;2026深圳市云创芯电子有限公司版权所有</strong><br>
<span class="beian">备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备16118477号-1</a></span>
<span class="beian">公安网备:<a href="https://beian.mps.gov.cn/#/query/webSearch?code=44030002015390" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:4px;"><img src="<?php echo BASE_URL; ?>/static/images/gongan_badge.png" width="16" height="17" alt="公安网备" loading="lazy" style="vertical-align:middle;" onerror="this.onerror=null;this.outerHTML='<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;17&quot; viewBox=&quot;0 0 24 24&quot;><path d=&quot;M12 2l8 3v6c0 5-4 9-8 11-4-2-8-6-8-11V5l8-3z&quot; fill=&quot;#1a3a8f&quot; stroke=&quot;#d4af37&quot; stroke-width=&quot;1&quot;/><polygon points=&quot;12,7 13.5,10.5 17,10.5 14,12.8 15,16.5 12,14.5 9,16.5 10,12.8 7,10.5 10.5,10.5&quot; fill=&quot;#ffffff&quot;/></svg>'">粤公网安备44030002015390号</a></span>
</footer>
<div class="control-sidebar-bg"></div>
</div>
<script src="<?php echo BASE_URL; ?>/static/js/bootstrap.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/plugins/fastclick/fastclick.js"></script>
<script src="<?php echo BASE_URL; ?>/static/js/app.min.js"></script>
</body>
</html>
+340
View File
@@ -0,0 +1,340 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title><?php echo htmlspecialchars($title); ?> - MES 后台管理</title>
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/font-awesome.min.css">
<!-- Ionicons(已本地化,P3-14 消除外部 CDN 供应链风险) -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/AdminLTE.min.css">
<!-- AdminLTE Skins -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/skins/_all-skins.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/iCheck/flat/blue.css">
<!-- Morris chart -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/morris/morris.css">
<!-- jvectormap -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<!-- Date Picker -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/datepicker/datepicker3.css">
<!-- Daterange picker -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/daterangepicker/daterangepicker-bs3.css">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<style>
/* 全局表格居中 */
.table th,
.table td {
text-align: center !important;
vertical-align: middle !important;
}
/* ========== 类型卡片 Grid 并列布局 (productModel) ========== */
.type-grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(2, 1fr); /* 默认2列 */
}
.type-grid[data-columns="1"] { grid-template-columns: 1fr; }
.type-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.type-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.type-grid[data-columns="auto"] { grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); }
.type-grid-item {
margin-bottom: 0 !important;
display: flex;
flex-direction: column;
}
.type-grid-item .box-body {
flex: 1;
}
/* 列数调节按钮激活态 */
.column-adjuster .col-btn.active {
background-color: #3c8dbc !important;
color: #fff !important;
border-color: #367fa9 !important;
}
/* 移动端降级 */
@media (max-width: 992px) {
.type-grid[data-columns="2"],
.type-grid[data-columns="3"],
.type-grid[data-columns="auto"] {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.type-grid,
.type-grid[data-columns="2"],
.type-grid[data-columns="3"],
.type-grid[data-columns="auto"] {
grid-template-columns: 1fr;
}
}
</style>
<script src="<?php echo BASE_URL; ?>/static/js/jquery-3.7.1.min.js"></script>
<?php // v3-P2 CSP:全局事件委托(替代内联 onclick 等),配合 nonce 实现无 unsafe-inline ?>
<script src="<?php echo BASE_URL; ?>/static/js/csp_global.js" nonce="<?php echo csp_nonce(); ?>"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="<?php echo BASE_URL; ?>/static/js/html5shiv.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<header class="main-header">
<a href="<?php echo BASE_URL; ?>/Admin/index" class="logo">
<span class="logo-mini"><b>MES</b></span>
<span class="logo-lg"><b>MES</b> 后台管理</span>
</a>
<nav class="navbar navbar-static-top">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">切换导航</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li>
<a href="<?php echo BASE_URL; ?>/Dashboard/index"><i class="fa fa-tachometer"></i> <span class="hidden-xs">工位看板</span></a>
</li>
<li>
<a href="<?php echo BASE_URL; ?>/Front/index"><i class="fa fa-desktop"></i> <span class="hidden-xs">前台工位</span></a>
</li>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user"></i>
<span class="hidden-xs"><?php echo htmlspecialchars($user['emp_name']); ?></span>
</a>
<ul class="dropdown-menu">
<li class="user-header" style="background:#3c8dbc; color:#fff; padding:10px; text-align:center;">
<p><?php echo htmlspecialchars($user['emp_name']); ?><br>
<small><?php
$roleNames = \core\base\Controller::ROLE_NAMES;
echo htmlspecialchars($roleNames[$user['role']] ?? $user['role']);
?></small></p>
</li>
<li class="user-footer">
<div class="pull-right">
<a href="<?php echo BASE_URL; ?>/Login/logout" class="btn btn-default btn-flat"><i class="fa fa-power-off"></i> 退出登录</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar">
<section class="sidebar">
<div class="user-panel" style="padding:10px; color:#fff; text-align:center; border-bottom:1px solid #4b646f;">
<p style="margin:0;"><i class="fa fa-circle text-success"></i> <?php echo htmlspecialchars($user['emp_name']); ?></p>
<small style="color:#b8c7ce;">
<?php
$roleNames = \core\base\Controller::ROLE_NAMES;
echo htmlspecialchars($roleNames[$user['role']] ?? $user['role']);
?>
</small>
</div>
<ul class="sidebar-menu" data-widget="tree">
<li class="header">导航菜单</li>
<?php
$role = $user['role'];
$category = $user['category'] ?? 'mes';
$ROLE_SUPER_ADMIN = \core\base\Controller::ROLE_SUPER_ADMIN;
$ROLE_ADMIN = \core\base\Controller::ROLE_ADMIN;
$isSuperAdmin = ($role === $ROLE_SUPER_ADMIN);
$isMESAdmin = ($isSuperAdmin || ($role === $ROLE_ADMIN && $category === \core\base\Controller::CATEGORY_MES));
$isInventoryAdmin = ($isSuperAdmin || ($role === $ROLE_ADMIN && $category === \core\base\Controller::CATEGORY_INVENTORY));
$isFinanceAdmin = ($isSuperAdmin || ($role === $ROLE_ADMIN && $category === \core\base\Controller::CATEGORY_FINANCE));
$isGeneralAdmin = ($isSuperAdmin || ($role === $ROLE_ADMIN && $category === \core\base\Controller::CATEGORY_GENERAL));
$catNames = \core\base\Controller::CATEGORY_NAMES;
$catIcons = \core\base\Controller::CATEGORY_ICONS;
$currentCat = isset($_GET['cat']) ? $_GET['cat'] : ($category === 'all' ? 'mes' : $category);
?>
<?php if ($isSuperAdmin): ?>
<!-- 超级管理员:类目切换菜单 -->
<li class="header">管理类目切换</li>
<li class="<?php echo $currentCat === 'mes' ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/index?cat=mes">
<i class="fa <?php echo $catIcons['mes']; ?>"></i>
<span><?php echo htmlspecialchars($catNames['mes']); ?></span>
</a>
</li>
<li class="<?php echo $currentCat === 'inventory' ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/index?cat=inventory">
<i class="fa <?php echo $catIcons['inventory']; ?>"></i>
<span><?php echo htmlspecialchars($catNames['inventory']); ?></span>
</a>
</li>
<li class="<?php echo $currentCat === 'finance' ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/index?cat=finance">
<i class="fa <?php echo $catIcons['finance']; ?>"></i>
<span><?php echo htmlspecialchars($catNames['finance']); ?></span>
</a>
</li>
<li class="<?php echo $currentCat === 'general' ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/General/index?cat=general">
<i class="fa <?php echo $catIcons['general']; ?>"></i>
<span><?php echo htmlspecialchars($catNames['general']); ?></span>
</a>
</li>
<li class="header">全局管理</li>
<?php endif; ?>
<!-- ========== MES 类目菜单 ========== -->
<?php if ($isMESAdmin): ?>
<li class="header"><?php echo htmlspecialchars($catNames['mes']); ?></li>
<li class="<?php echo (!isset($activeMenu) || $activeMenu === 'index') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/index"><i class="fa fa-dashboard"></i> <span>控制台</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'customer') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/customer"><i class="fa fa-building"></i> <span>客户管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'productModel') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/productModel"><i class="fa fa-cube"></i> <span>产品型号</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'workstation') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/workstation"><i class="fa fa-th"></i> <span>工位管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'config') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/config"><i class="fa fa-cog"></i> <span>系统配置</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'productSearch') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/productSearch"><i class="fa fa-search"></i> <span>产品追溯</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'asdTestData') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/asdTestData"><i class="fa fa-flask"></i> <span>测试数据</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'asdDeviceDebug') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/asdDeviceDebug"><i class="fa fa-plug"></i> <span>设备调试</span></a>
</li>
<?php if ($isSuperAdmin): ?>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'import') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/import"><i class="fa fa-upload"></i> <span>批量导入</span></a>
</li>
<?php endif; ?>
<?php endif; ?>
<!-- ========== 进销存类目菜单 ========== -->
<?php if ($isInventoryAdmin): ?>
<li class="header"><?php echo htmlspecialchars($catNames['inventory']); ?></li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'inventory_dashboard') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/index"><i class="fa fa-dashboard"></i> <span>进销存概览</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'purchase') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/purchase"><i class="fa fa-truck"></i> <span>采购管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'stock') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/stock"><i class="fa fa-archive"></i> <span>库存管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'sales') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/sales"><i class="fa fa-shopping-cart"></i> <span>销售管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'supplier') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Inventory/supplier"><i class="fa fa-address-book"></i> <span>供应商管理</span></a>
</li>
<?php endif; ?>
<!-- ========== 财务管理类目菜单 ========== -->
<?php if ($isFinanceAdmin): ?>
<li class="header"><?php echo htmlspecialchars($catNames['finance']); ?></li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'finance_dashboard') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/index"><i class="fa fa-dashboard"></i> <span>财务概览</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'accounts') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/accounts"><i class="fa fa-book"></i> <span>账务管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'receivable') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/receivable"><i class="fa fa-arrow-down"></i> <span>应收账款</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'payable') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/payable"><i class="fa fa-arrow-up"></i> <span>应付账款</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'report') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Finance/report"><i class="fa fa-bar-chart"></i> <span>财务报表</span></a>
</li>
<?php endif; ?>
<!-- ========== 综合管理类目菜单 ========== -->
<?php if ($isGeneralAdmin): ?>
<li class="header"><?php echo htmlspecialchars($catNames['general']); ?></li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'general_dashboard') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/General/index"><i class="fa fa-dashboard"></i> <span>综合概览</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'hr') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/General/hr"><i class="fa fa-id-card"></i> <span>人事管理</span></a>
</li>
<?php if ($isSuperAdmin): ?>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'employee') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/employee"><i class="fa fa-users"></i> <span>账号管理</span></a>
</li>
<?php endif; ?>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'asset') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/General/asset"><i class="fa fa-laptop"></i> <span>资产管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'document') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/General/document"><i class="fa fa-file-text"></i> <span>文档管理</span></a>
</li>
<?php endif; ?>
<?php if ($isSuperAdmin): ?>
<li class="header">系统工具</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'database') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/database"><i class="fa fa-database"></i> <span>数据库管理</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'databaseBackup') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/databaseBackup"><i class="fa fa-save"></i> <span>备份与恢复</span></a>
</li>
<li class="<?php echo (isset($activeMenu) && $activeMenu === 'databaseUpgrade') ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Admin/databaseUpgrade"><i class="fa fa-wrench"></i> <span>数据库升级</span></a>
</li>
<?php endif; ?>
<li class="header">账户</li>
<li>
<a href="<?php echo BASE_URL; ?>/Login/logout" class="confirm-link" data-confirm="确定要退出登录吗?">
<i class="fa fa-power-off text-red"></i> <span>退出登录</span>
</a>
</li>
</ul>
</section>
</aside>
<div class="content-wrapper">
<section class="content-header">
<h1><?php echo htmlspecialchars($title); ?><small> MES</small></h1>
<ol class="breadcrumb">
<li><a href="<?php echo BASE_URL; ?>/Admin/index"><i class="fa fa-dashboard"></i> 控制台</a></li>
<li class="active"><?php echo htmlspecialchars($title); ?></li>
</ol>
</section>
<section class="content">
<!-- 公司名称 - 所有页面居中加高显示 -->
<?php
if (!isset($sysConfig)) {
$cfgModel = new app\models\SysConfig();
$sysConfig = $cfgModel->getConfig();
}
?>
<div style="text-align:center; margin-bottom:20px;">
<h2 style="font-size:48px; font-weight:bold; color:#3c8dbc; margin:0; line-height:1.5;">
<i class="fa fa-industry"></i> <?php echo htmlspecialchars($sysConfig['company_name'] ?? 'MES'); ?>
</h2>
<?php if (!empty($sysConfig['mes_name'])): ?>
<p style="font-size:20px; color:#999; margin-top:5px;"><?php echo htmlspecialchars($sysConfig['mes_name']); ?></p>
<?php endif; ?>
</div>
+19
View File
@@ -0,0 +1,19 @@
</section>
</div>
<footer class="main-footer">
<div class="pull-right hidden-xs"><b>Version</b> 1.0.0</div>
<strong>&copy;2026深圳市云创芯电子有限公司版权所有</strong><br>
<span class="beian">备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备16118477号-1</a></span>
<span class="beian">公安网备:<a href="https://beian.mps.gov.cn/#/query/webSearch?code=44030002015390" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:4px;"><img src="<?php echo BASE_URL; ?>/static/images/gongan_badge.png" width="16" height="17" alt="公安网备" loading="lazy" style="vertical-align:middle;" onerror="this.onerror=null;this.outerHTML='<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;17&quot; viewBox=&quot;0 0 24 24&quot;><path d=&quot;M12 2l8 3v6c0 5-4 9-8 11-4-2-8-6-8-11V5l8-3z&quot; fill=&quot;#1a3a8f&quot; stroke=&quot;#d4af37&quot; stroke-width=&quot;1&quot;/><polygon points=&quot;12,7 13.5,10.5 17,10.5 14,12.8 15,16.5 12,14.5 9,16.5 10,12.8 7,10.5 10.5,10.5&quot; fill=&quot;#ffffff&quot;/></svg>'">粤公网安备44030002015390号</a></span>
</footer>
<div class="control-sidebar-bg"></div>
</div>
<script src="<?php echo BASE_URL; ?>/static/js/bootstrap.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/plugins/fastclick/fastclick.js"></script>
<script src="<?php echo BASE_URL; ?>/static/js/app.min.js"></script>
</body>
</html>
+147
View File
@@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title><?php echo htmlspecialchars($title); ?> - MES 前台工位</title>
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/font-awesome.min.css">
<!-- Ionicons(已本地化,P3-14 消除外部 CDN 供应链风险) -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/AdminLTE.min.css">
<!-- AdminLTE Skins -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/skins/_all-skins.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/iCheck/flat/blue.css">
<!-- Morris chart -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/morris/morris.css">
<!-- jvectormap -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<!-- Date Picker -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/datepicker/datepicker3.css">
<!-- Daterange picker -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/daterangepicker/daterangepicker-bs3.css">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<style>
/* 全局表格居中 */
.table th,
.table td {
text-align: center !important;
vertical-align: middle !important;
}
/* 工位记录表 - 分色 */
.record-table th,
.record-table td {
text-align: center !important;
vertical-align: middle !important;
}
.record-table thead th {
background: #3c8dbc !important;
color: #fff !important;
}
.record-table tbody td:nth-child(1) { background: #FCE4EC; } /* 浅粉 */
.record-table tbody td:nth-child(2) { background: #E3F2FD; } /* 浅蓝 */
.record-table tbody td:nth-child(3) { background: #E8F5E9; } /* 浅绿 */
.record-table tbody td:nth-child(4) { background: #FFF3E0; } /* 浅橙 */
.record-table tbody td:nth-child(5) { background: #F3E5F5; } /* 浅紫 */
.record-table tbody td:nth-child(6) { background: #E0F7FA; } /* 浅青 */
.record-table tbody td:nth-child(7) { background: #FFF9C4; } /* 浅黄 */
.record-table tbody td:nth-child(8) { background: #E8EAF6; } /* 靛蓝 */
.record-table tbody td:nth-child(9) { background: #EFEBE9; } /* 浅棕 */
</style>
<script src="<?php echo BASE_URL; ?>/static/js/jquery-3.7.1.min.js"></script>
<?php // v3-P2 CSP:全局事件委托(替代内联 onclick 等),配合 nonce 实现无 unsafe-inline ?>
<script src="<?php echo BASE_URL; ?>/static/js/csp_global.js" nonce="<?php echo csp_nonce(); ?>"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="<?php echo BASE_URL; ?>/static/js/html5shiv.min.js"></script>
<script src="<?php echo BASE_URL; ?>/static/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<header class="main-header">
<a href="<?php echo BASE_URL; ?>/Front/index" class="logo">
<span class="logo-mini"><b>MES</b></span>
<span class="logo-lg"><b>MES</b> 前台工位</span>
</a>
<nav class="navbar navbar-static-top">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">切换导航</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li>
<a href="<?php echo BASE_URL; ?>/Admin/index"><i class="fa fa-arrow-left"></i> <span class="hidden-xs">返回后台</span></a>
</li>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user"></i>
<span class="hidden-xs"><?php echo htmlspecialchars($user['emp_name']); ?></span>
</a>
<ul class="dropdown-menu">
<li class="user-header" style="background:#3c8dbc; color:#fff; padding:10px; text-align:center;">
<p><?php echo htmlspecialchars($user['emp_name']); ?></p>
</li>
<li class="user-footer">
<div class="pull-right">
<a href="<?php echo BASE_URL; ?>/Login/logout" class="btn btn-default btn-flat"><i class="fa fa-power-off"></i> 退出登录</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar">
<section class="sidebar">
<ul class="sidebar-menu" data-widget="tree">
<li class="header">工位导航</li>
<?php
$stationIcons = [
'inbound' => 'fa-sign-in',
'pcb_test' => 'fa-microchip',
'battery' => 'fa-battery-full',
'assembly' => 'fa-cogs',
'finished_test' => 'fa-check-circle',
'warehouse' => 'fa-warehouse',
'delivery' => 'fa-truck'
];
// 工位显示名称映射
$stationNameMap = [
'inbound' => '半成品入库',
'warehouse' => '成品入库',
];
foreach ($stations as $station):
$icon = isset($stationIcons[$station['station_type']]) ? $stationIcons[$station['station_type']] : 'fa-circle-o';
$displayName = isset($stationNameMap[$station['station_type']]) ? $stationNameMap[$station['station_type']] : $station['station_name'];
?>
<li class="<?php echo (isset($activeStation) && $activeStation === $station['station_type']) ? 'active' : ''; ?>">
<a href="<?php echo BASE_URL; ?>/Front/<?php echo $station['station_type']; ?>">
<i class="fa <?php echo $icon; ?>"></i>
<span><?php echo htmlspecialchars($displayName); ?></span>
</a>
</li>
<?php endforeach; ?>
</ul>
</section>
</aside>
<div class="content-wrapper">
<section class="content-header">
<h1><?php echo htmlspecialchars($title); ?><small> 前台工位</small></h1>
<ol class="breadcrumb">
<li><a href="<?php echo BASE_URL; ?>/Front/index"><i class="fa fa-th"></i> 工位选择</a></li>
<li class="active"><?php echo htmlspecialchars($title); ?></li>
</ol>
</section>
<section class="content">
+173
View File
@@ -0,0 +1,173 @@
<?php
// 防御性检查:防止 footer 被重复 include
if (!empty($GLOBALS['_station_footer_rendered'])) {
error_log('[station_footer] WARNING: Already rendered, skipping duplicate include.');
return;
}
$GLOBALS['_station_footer_rendered'] = true;
?><div class="footer">
&copy;2026深圳市云创芯电子有限公司版权所有
<br><span class="beian">备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备16118477号-1</a></span>
<br><span class="beian">公安网备:<a href="https://beian.mps.gov.cn/#/query/webSearch?code=44030002015390" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:4px;"><img src="<?php echo BASE_URL; ?>/static/images/gongan_badge.png" width="16" height="17" alt="公安网备" loading="lazy" style="vertical-align:middle;" onerror="this.onerror=null;this.outerHTML='<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;17&quot; viewBox=&quot;0 0 24 24&quot;><path d=&quot;M12 2l8 3v6c0 5-4 9-8 11-4-2-8-6-8-11V5l8-3z&quot; fill=&quot;#1a3a8f&quot; stroke=&quot;#d4af37&quot; stroke-width=&quot;1&quot;/><polygon points=&quot;12,7 13.5,10.5 17,10.5 14,12.8 15,16.5 12,14.5 9,16.5 10,12.8 7,10.5 10.5,10.5&quot; fill=&quot;#ffffff&quot;/></svg>'">粤公网安备44030002015390号</a></span>
</div>
<script>
// ========== 实时时钟 ==========
function updateClock() {
var now = new Date();
var str = now.getFullYear() + '-' +
String(now.getMonth() + 1).padStart(2, '0') + '-' +
String(now.getDate()).padStart(2, '0') + ' ' +
String(now.getHours()).padStart(2, '0') + ':' +
String(now.getMinutes()).padStart(2, '0') + ':' +
String(now.getSeconds()).padStart(2, '0');
var el = document.getElementById('liveClock');
if (el) el.textContent = str;
}
setInterval(updateClock, 1000);
updateClock();
// ========== 工位网格列数调节(Front/index ==========
(function() {
var $grid = $('#stationGrid');
if (!$grid.length) return;
var COL_KEY = 'station_grid_cols';
function applyColumns(cols) {
$grid.attr('data-columns', cols);
$('.column-adjuster .col-btn').removeClass('active');
$('.column-adjuster .col-btn[data-cols="' + cols + '"]').addClass('active');
try { localStorage.setItem(COL_KEY, cols); } catch(e) {}
}
var savedCols = localStorage.getItem(COL_KEY) || 'auto';
applyColumns(savedCols);
$('.column-adjuster .col-btn').click(function() {
applyColumns($(this).data('cols'));
});
})();
// ========== 表格列选择器 ==========
(function() {
var STORAGE_PREFIX = 'table_cols_';
function initColSelector(pageKey, allCols) {
var $dropdown = $('#colDropdown_' + pageKey);
var $btn = $('#colSelectBtn_' + pageKey);
if (!$dropdown.length || !$btn.length) return;
var storageKey = STORAGE_PREFIX + pageKey;
var defaultVisible = {};
allCols.forEach(function(c) { defaultVisible[c.key] = true; });
// 读取保存的偏好
var saved = null;
try { saved = JSON.parse(localStorage.getItem(storageKey)); } catch(e) {}
function getVisible() {
if (saved && typeof saved === 'object') {
var merged = {};
allCols.forEach(function(c) {
merged[c.key] = (saved[c.key] !== undefined) ? saved[c.key] : true;
});
return merged;
}
return $.extend({}, defaultVisible);
}
function saveVisible(visible) {
try { localStorage.setItem(storageKey, JSON.stringify(visible)); } catch(e) {}
}
function applyVisible(visible) {
// 更新表头
$('table.table thead th').each(function() {
var col = $(this).data('col');
if (col && visible[col] === false) {
$(this).addClass('col-hidden');
} else {
$(this).removeClass('col-hidden');
}
});
// 更新表体
$('table.table tbody td').each(function() {
var col = $(this).data('col');
if (col && visible[col] === false) {
$(this).addClass('col-hidden');
} else {
$(this).removeClass('col-hidden');
}
});
// 更新复选框状态
$dropdown.find('.col-check-item').each(function() {
var col = $(this).data('col');
$(this).prop('checked', visible[col] !== false);
});
$dropdown.find('.col-check-all').prop('checked',
allCols.every(function(c) { return visible[c.key] !== false; })
);
}
function refreshUI() {
var visible = getVisible();
applyVisible(visible);
}
// 初始化
refreshUI();
// 全选/取消全选
$dropdown.find('.col-check-all').on('change', function() {
var checked = $(this).prop('checked');
var visible = getVisible();
allCols.forEach(function(c) { visible[c.key] = checked; });
saveVisible(visible);
applyVisible(visible);
});
// 单项切换
$dropdown.find('.col-check-item').on('change', function() {
var col = $(this).data('col');
var checked = $(this).prop('checked');
var visible = getVisible();
visible[col] = checked;
saveVisible(visible);
applyVisible(visible);
});
// 恢复默认
$dropdown.find('.col-reset-btn').on('click', function() {
var visible = $.extend({}, defaultVisible);
saveVisible(visible);
applyVisible(visible);
});
// 按钮点击切换面板显示
$btn.on('click', function(e) {
e.stopPropagation();
$dropdown.toggle();
});
// 点击面板外部关闭
$(document).on('click', function(e) {
if (!$btn.is(e.target) && $btn.has(e.target).length === 0 &&
!$dropdown.is(e.target) && $dropdown.has(e.target).length === 0) {
$dropdown.hide();
}
});
}
// 处理队列中的列选择器初始化(延迟到 DOM 完全就绪)
$(function() {
if (window._colSelectorQueue && window._colSelectorQueue.length) {
window._colSelectorQueue.forEach(function(item) {
initColSelector(item.pageKey, item.cols);
});
window._colSelectorQueue = [];
}
});
})();
</script>
</body>
</html>
+764
View File
@@ -0,0 +1,764 @@
<?php
// 防御性检查:防止 header 被重复 include
if (!empty($GLOBALS['_station_header_rendered'])) {
error_log('[station_header] WARNING: Already rendered, skipping duplicate include.');
return;
}
$GLOBALS['_station_header_rendered'] = true;
?><!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title><?php echo htmlspecialchars($title); ?> - <?php echo htmlspecialchars($sysConfig['company_name'] ?? 'MES'); ?> 工位看板</title>
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/static/css/font-awesome.min.css">
<style>
:root {
--bg: #0f1923;
--card-bg: #1a2736;
--text: #c8d6e5;
--text-light: #8395a7;
--primary: #0abde3;
--success: #10ac84;
--warning: #feca57;
--danger: #ee5253;
--border: #2d3a4a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
height: 100%;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
background: var(--bg);
color: var(--text);
overflow-x: hidden;
-webkit-tap-highlight-color: transparent;
-webkit-text-size-adjust: 100%;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* ========== 顶部导航栏 ========== */
.topbar {
background: var(--card-bg);
border-bottom: 1px solid var(--border);
padding: 10px 16px;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
top: 0;
z-index: 100;
flex-wrap: wrap;
gap: 6px;
}
.topbar .topbar-left {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
.topbar .logo {
font-size: 16px;
font-weight: bold;
color: var(--primary);
text-decoration: none;
white-space: nowrap;
}
.topbar .logo i { margin-right: 4px; }
.topbar .logo-sep {
color: var(--text-light);
font-size: 13px;
display: inline;
}
.topbar .user-info {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.topbar .clock {
font-size: 15px;
font-weight: bold;
color: var(--text);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.topbar .user-name {
color: var(--primary);
white-space: nowrap;
font-size: 13px;
}
.topbar .btn-top {
color: var(--text-light);
text-decoration: none;
padding: 4px 10px;
border: 1px solid var(--border);
border-radius: 4px;
font-size: 12px;
transition: all 0.3s;
white-space: nowrap;
}
.topbar .btn-top:hover {
color: var(--primary);
border-color: var(--primary);
text-decoration: none;
}
.topbar .btn-top i { margin-right: 3px; }
.topbar .btn-logout {
color: var(--danger);
border-color: rgba(238,82,83,0.3);
}
/* ========== 返回按钮 ========== */
.back-link {
display: inline-flex;
align-items: center;
gap: 4px;
color: var(--text-light);
text-decoration: none;
font-size: 13px;
margin-bottom: 16px;
transition: color 0.2s;
}
.back-link:hover { color: var(--primary); text-decoration: none; }
/* ========== 内容区 ========== */
.content {
padding: 16px;
max-width: 1200px;
margin: 0 auto;
flex: 1 0 auto;
width: 100%;
min-height: 0;
}
/* ========== 页面标题区 ========== */
.page-title-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
flex-wrap: wrap;
gap: 8px;
}
.page-title-bar h1 {
font-size: 18px;
color: var(--text);
margin: 0;
}
.page-title-bar h1 i { color: var(--primary); margin-right: 6px; }
/* ========== 卡片容器 ========== */
.card {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 8px;
margin-bottom: 16px;
}
.card-header {
padding: 12px 16px;
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.card-header h3 {
font-size: 15px;
color: var(--text);
margin: 0;
}
.card-header h3 i { color: var(--primary); margin-right: 6px; }
.card-header .badge {
display: inline-block;
background: rgba(10, 189, 227, 0.15);
color: var(--primary);
padding: 3px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: bold;
}
.card-body {
padding: 16px;
}
.card-body.no-padding { padding: 0; }
/* ========== 表单样式 ========== */
.form-row {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.form-group {
flex: 1;
min-width: 180px;
margin-bottom: 12px;
}
.form-group label {
display: block;
font-size: 12px;
color: var(--text-light);
margin-bottom: 4px;
font-weight: 500;
}
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-group label .hint { font-weight: normal; font-size: 10px; color: var(--text-light); }
.form-control {
width: 100%;
padding: 8px 12px;
background: rgba(255,255,255,0.05);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text);
font-size: 14px;
transition: all 0.3s;
outline: none;
line-height: 1.5;
}
.form-control:focus {
border-color: var(--primary);
background: rgba(10, 189, 227, 0.05);
box-shadow: 0 0 0 3px rgba(10, 189, 227, 0.1);
}
.form-control::placeholder { color: rgba(255,255,255,0.2); }
select.form-control {
cursor: pointer;
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238395a7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
padding-right: 30px;
}
select.form-control option { background: var(--card-bg); color: var(--text); }
.form-control:disabled { opacity: 0.6; cursor: not-allowed; }
.input-error, .input-error:focus {
border-color: #d9534f !important;
box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.25) !important;
animation: shake 0.4s ease-in-out;
}
.input-warning {
border-color: #e67e22 !important;
box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2) !important;
}
.input-valid {
border-color: #27ae60 !important;
box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2) !important;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
20% { transform: translateX(-6px); }
40% { transform: translateX(6px); }
60% { transform: translateX(-4px); }
80% { transform: translateX(4px); }
}
.field-error-tip {
animation: fadeInDown 0.25s ease-out;
}
@keyframes fadeInDown {
from { opacity: 0; transform: translateY(-6px); }
to { opacity: 1; transform: translateY(0); }
}
.form-actions {
margin-top: 12px;
display: flex;
gap: 8px;
justify-content: flex-end;
flex-wrap: wrap;
}
/* ========== 按钮样式 ========== */
.btn {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 8px 16px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
white-space: nowrap;
line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0cb0d6; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0d9e78; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: #1a2736; }
.btn-warning:hover { background: #f5c24e; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e14849; transform: translateY(-1px); }
.btn-info {
background: rgba(10, 189, 227, 0.15);
color: var(--primary);
border: 1px solid rgba(10, 189, 227, 0.3);
}
.btn-info:hover { background: rgba(10, 189, 227, 0.25); }
.btn-lg { padding: 10px 22px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
/* ========== 表格样式 ========== */
.table-wrap {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
min-width: 600px;
}
.table thead th {
background: rgba(10, 189, 227, 0.1);
color: var(--primary);
padding: 8px 10px;
text-align: center;
font-weight: 500;
border-bottom: 2px solid var(--border);
white-space: nowrap;
}
.table tbody td {
padding: 8px 10px;
text-align: center;
border-bottom: 1px solid var(--border);
color: var(--text);
font-size: 12px;
}
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table code {
background: rgba(10, 189, 227, 0.1);
color: var(--primary);
padding: 2px 6px;
border-radius: 3px;
font-size: 11px;
}
.table .label {
display: inline-block;
padding: 2px 8px;
border-radius: 10px;
font-size: 10px;
font-weight: bold;
}
.table .label-success { background: rgba(16, 172, 132, 0.2); color: var(--success); }
.table .label-danger { background: rgba(238, 82, 83, 0.2); color: var(--danger); }
.table .label-warning { background: rgba(254, 202, 87, 0.2); color: var(--warning); }
.table .label-info { background: rgba(10, 189, 227, 0.2); color: var(--primary); }
.text-muted { color: var(--text-light); }
/* ========== 工位选择网格 (Front/index) ========== */
.station-grid {
display: grid;
gap: 12px;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 默认自适应 */
}
.station-grid[data-columns="1"] { grid-template-columns: 1fr; }
.station-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.station-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.station-grid[data-columns="auto"] { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.station-card {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 20px 16px;
text-align: center;
cursor: pointer;
transition: all 0.3s;
text-decoration: none;
color: var(--text);
display: block;
-webkit-tap-highlight-color: transparent;
}
.station-card:hover {
border-color: var(--primary);
transform: translateY(-2px);
box-shadow: 0 4px 20px rgba(10, 189, 227, 0.15);
text-decoration: none;
color: var(--text);
}
.station-card:active { transform: translateY(0); }
.station-card .station-icon {
width: 52px;
height: 52px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
font-size: 24px;
}
.station-card .station-name {
font-size: 14px;
font-weight: bold;
margin-bottom: 4px;
}
.station-card .station-code {
font-size: 10px;
color: var(--text-light);
}
.station-card .station-status {
margin-top: 8px;
font-size: 10px;
}
/* ========== 今日计数徽章 ========== */
.today-count-badge {
display: inline-flex;
align-items: center;
gap: 4px;
background: linear-gradient(135deg, rgba(10,189,227,0.2), rgba(16,172,132,0.2));
border: 1px solid rgba(10,189,227,0.3);
padding: 5px 14px;
border-radius: 20px;
font-size: 12px;
flex-wrap: wrap;
}
.today-count-badge .count-num {
font-size: 18px;
font-weight: bold;
color: var(--primary);
}
/* ========== 提示信息 ========== */
.alert {
padding: 10px 14px;
border-radius: 6px;
margin-bottom: 14px;
font-size: 13px;
line-height: 1.5;
}
.alert-info {
background: rgba(10, 189, 227, 0.1);
border: 1px solid rgba(10, 189, 227, 0.25);
color: var(--primary);
}
.alert-success {
background: rgba(16, 172, 132, 0.1);
border: 1px solid rgba(16, 172, 132, 0.25);
color: var(--success);
}
.alert-danger {
background: rgba(238, 82, 83, 0.1);
border: 1px solid rgba(238, 82, 83, 0.25);
color: var(--danger);
}
/* ========== 筛选激活状态 ========== */
.filter-active .card-header {
background: rgba(10, 189, 227, 0.05);
border-bottom: 2px solid var(--primary);
}
/* ========== 空状态 ========== */
.empty-state {
text-align: center;
padding: 32px 16px;
color: var(--text-light);
}
.empty-state i { font-size: 40px; margin-bottom: 10px; opacity: 0.3; }
.empty-state p { font-size: 13px; }
/* ========== 自适应表单网格 ========== */
.station-fields-grid {
display: grid;
gap: 12px;
grid-template-columns: repeat(3, 1fr); /* 默认3列 */
}
.station-fields-grid[data-columns="1"] { grid-template-columns: 1fr; }
.station-fields-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.station-fields-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.station-fields-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.station-fields-grid[data-columns="auto"] {
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.station-field-item {
min-width: 0; /* 防止 grid 溢出 */
}
.station-field-item label {
display: block;
font-size: 12px;
color: var(--text-light);
margin-bottom: 4px;
font-weight: 500;
}
.station-field-item label .required { color: var(--danger); margin-left: 2px; }
.station-field-item label .hint { font-weight: normal; font-size: 10px; color: var(--text-light); }
.station-field-item .form-control {
width: 100%;
}
/* 扫描字段网格 */
.station-scan-grid {
display: grid;
gap: 12px;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.station-scan-item {
min-width: 0;
}
/* ========== 列数调节器 ========== */
.column-adjuster {
display: flex;
align-items: center;
gap: 3px;
flex-shrink: 0;
}
.column-adjuster .col-btn {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 4px 8px;
border: 1px solid var(--border);
border-radius: 4px;
background: transparent;
color: var(--text-light);
cursor: pointer;
font-size: 11px;
transition: all 0.2s;
white-space: nowrap;
line-height: 1.4;
}
.column-adjuster .col-btn:hover {
border-color: var(--primary);
color: var(--primary);
}
.column-adjuster .col-btn.active {
background: rgba(10, 189, 227, 0.15);
border-color: var(--primary);
color: var(--primary);
}
.column-adjuster .col-btn i { font-size: 11px; }
/* ========== 表格列选择器下拉面板 ========== */
.table-column-selector {
position: relative;
display: inline-flex;
}
.table-column-selector .col-btn-dropdown {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
border: 1px solid var(--border);
border-radius: 4px;
background: transparent;
color: var(--text-light);
cursor: pointer;
font-size: 11px;
transition: all 0.2s;
white-space: nowrap;
line-height: 1.4;
}
.table-column-selector .col-btn-dropdown:hover {
border-color: var(--primary);
color: var(--primary);
}
.col-dropdown-panel {
position: absolute;
top: 100%;
right: 0;
margin-top: 4px;
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 6px;
min-width: 180px;
max-height: 320px;
overflow-y: auto;
z-index: 200;
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.col-dropdown-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
font-size: 11px;
color: var(--text-light);
}
.col-dropdown-header label {
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
font-size: 11px;
color: var(--text-light);
}
.col-reset-btn {
background: none;
border: none;
color: var(--text-light);
cursor: pointer;
font-size: 12px;
padding: 2px 6px;
border-radius: 3px;
transition: all 0.2s;
}
.col-reset-btn:hover {
color: var(--warning);
background: rgba(254,202,87,0.1);
}
.col-dropdown-list {
padding: 4px 0;
}
.col-dropdown-list label {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 12px;
font-size: 12px;
color: var(--text);
cursor: pointer;
transition: background 0.15s;
white-space: nowrap;
}
.col-dropdown-list label:hover {
background: rgba(255,255,255,0.04);
}
.col-dropdown-list input[type="checkbox"] {
accent-color: var(--primary);
width: 14px;
height: 14px;
cursor: pointer;
}
.col-dropdown-header input[type="checkbox"] {
accent-color: var(--primary);
width: 14px;
height: 14px;
cursor: pointer;
}
/* 被隐藏的表格列 */
.table th.col-hidden,
.table td.col-hidden {
display: none;
}
/* ========== 底部 ========== */
.footer {
text-align: center;
padding: 12px 16px;
color: var(--text-light);
font-size: 11px;
border-top: 1px solid var(--border);
flex-shrink: 0;
margin-top: auto;
}
/* ========== 动画 ========== */
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.refreshing { animation: pulse 0.6s ease-in-out; }
/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
.topbar {
padding: 8px 12px;
flex-direction: column;
gap: 4px;
}
.topbar .topbar-left { width: 100%; justify-content: space-between; }
.topbar .logo { font-size: 14px; }
.topbar .logo-sep { display: none; }
.topbar .user-info {
width: 100%;
justify-content: space-between;
}
.topbar .clock { font-size: 13px; }
.topbar .btn-top { font-size: 11px; padding: 3px 8px; }
.content { padding: 10px; }
.page-title-bar { flex-direction: column; align-items: flex-start; }
.page-title-bar h1 { font-size: 16px; }
.card-header { padding: 10px 12px; }
.card-header h3 { font-size: 14px; }
.card-body { padding: 12px; }
.form-group { min-width: 100%; flex: 1 1 100%; }
.form-row { gap: 8px; }
.form-actions { flex-direction: column; }
.form-actions .btn { width: 100%; justify-content: center; }
.station-fields-grid { gap: 8px; }
.station-fields-grid[data-columns="3"],
.station-fields-grid[data-columns="4"] { grid-template-columns: repeat(2, 1fr); }
.station-fields-grid[data-columns="auto"] { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.station-scan-grid { grid-template-columns: 1fr; }
.station-grid {
gap: 8px;
}
.station-grid[data-columns="3"],
.station-grid[data-columns="auto"] { grid-template-columns: repeat(2, 1fr); }
.station-card { padding: 14px 10px; }
.station-card .station-icon { width: 42px; height: 42px; font-size: 20px; }
.station-card .station-name { font-size: 13px; }
.today-count-badge { font-size: 11px; }
.today-count-badge .count-num { font-size: 16px; }
.table { font-size: 11px; }
.table thead th { padding: 6px 8px; font-size: 11px; }
.table tbody td { padding: 6px 8px; font-size: 11px; }
.btn { font-size: 13px; padding: 7px 14px; }
.btn-lg { font-size: 14px; padding: 9px 18px; }
.alert { font-size: 12px; padding: 8px 12px; }
}
@media (max-width: 400px) {
.station-grid { gap: 6px; }
.station-grid[data-columns="2"],
.station-grid[data-columns="3"],
.station-grid[data-columns="auto"] { grid-template-columns: repeat(2, 1fr); }
.station-card { padding: 12px 8px; }
.station-card .station-icon { width: 36px; height: 36px; font-size: 18px; }
.station-card .station-name { font-size: 12px; }
.topbar .user-info { flex-wrap: wrap; gap: 4px; }
.topbar .btn-top { font-size: 10px; padding: 2px 6px; }
.topbar .clock { font-size: 12px; }
.station-fields-grid[data-columns="2"],
.station-fields-grid[data-columns="3"],
.station-fields-grid[data-columns="4"] { grid-template-columns: 1fr; }
.station-fields-grid[data-columns="auto"] { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
</style>
<script src="<?php echo BASE_URL; ?>/static/js/jquery-3.7.1.min.js"></script>
<?php // v3-P2 CSP:全局事件委托(替代内联 onclick 等),配合 nonce 实现无 unsafe-inline ?>
<script src="<?php echo BASE_URL; ?>/static/js/csp_global.js" nonce="<?php echo csp_nonce(); ?>"></script>
</head>
<body>
<!-- 顶部导航 -->
<div class="topbar">
<div class="topbar-left">
<a href="<?php echo BASE_URL; ?>/Front/index" class="logo">
<i class="fa fa-industry"></i>
<?php echo htmlspecialchars($sysConfig['company_name'] ?? 'MES'); ?>
</a>
<span class="logo-sep">| 工位看板</span>
</div>
<div class="user-info">
<span class="clock" id="liveClock"><?php echo date('Y-m-d H:i:s'); ?></span>
<span class="user-name"><i class="fa fa-user"></i> <?php echo htmlspecialchars($user['emp_name']); ?></span>
<a href="<?php echo BASE_URL; ?>/Dashboard/index" class="btn-top"><i class="fa fa-tachometer"></i> 看板</a>
<a href="<?php echo BASE_URL; ?>/Admin/index" class="btn-top"><i class="fa fa-cog"></i> 后台</a>
<a href="<?php echo BASE_URL; ?>/Front/index" class="btn-top"><i class="fa fa-th"></i> 工位</a>
<a href="<?php echo BASE_URL; ?>/Login/logout" class="btn-top btn-logout confirm-link" data-confirm="确定退出?"><i class="fa fa-sign-out"></i> 退出</a>
</div>
</div>