fix: 更新健康监测和体重管理相关页面,新增食谱记录页面

This commit is contained in:
liuyunqin
2026-07-06 16:49:01 +08:00
parent 0f28887062
commit 8e2737be4a
95 changed files with 645 additions and 392 deletions
@@ -675,7 +675,7 @@ body {
<div class="calorie-goal">
<div class="calorie-goal__header">
<span class="calorie-goal__label">每日推荐摄入</span>
<span class="calorie-goal__bmr" id="calorieBmr">BMR 1900 × 活动系数 1.55</span>
<span class="calorie-goal__bmr" id="calorieBmr"></span>
</div>
<div class="calorie-goal__val" id="calorieVal">2645<span class="calorie-goal__unit">千卡</span></div>
<div class="calorie-goal__sub" id="calorieSub">今日已摄入 1486 千卡,还可摄入 1159 千卡(热量缺口 300kcal</div>
@@ -1165,7 +1165,7 @@ function renderCalorie() {
var remaining = cal - consumed;
var pct = Math.round(consumed / cal * 1000) / 10;
document.getElementById('calorieBmr').textContent = 'BMR 1900 × 活动系数 ' + bmrF + '' + bmrLabelMap.manual_labor + '';
document.getElementById('calorieBmr').textContent = '';
document.getElementById('calorieVal').innerHTML = cal + '<span class="calorie-goal__unit">千卡</span>';
document.getElementById('calorieSub').textContent = '今日已摄入 ' + consumed + ' 千卡,还可摄入 ' + remaining + ' 千卡(热量缺口 300kcal';
@@ -95,13 +95,13 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
.custom-avoid-sheet__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.custom-avoid-sheet__quick-tag { font-size: 12px; padding: 5px 12px; border-radius: 16px; border: 1px solid #e0e0e0; color: #666; background: #fafafa; cursor: pointer; transition: all .2s; }
.custom-avoid-sheet__quick-tag:hover { border-color: #b7eb8f; background: #f6ffed; }
.custom-avoid-sheet__quick-tag--added { border-color: #ffa39e; background: #fff1f0; color: #cf1322; }
.custom-avoid-sheet__quick-tag--added { border-color: #52c41a; background: #f6ffed; color: #52c41a; }
.custom-avoid-sheet__quick-tag--added::after { content: ' ✓'; }
/* ===== 自定义食材标签 ===== */
.questionnaire__custom-avoid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.questionnaire__custom-tag { font-size: 13px; padding: 8px 14px; border-radius: 20px; font-weight: 600; cursor: pointer; border: 1.5px solid #ffa39e; color: #cf1322; background: #fff1f0; transition: all .2s; display: flex; align-items: center; gap: 6px; }
.questionnaire__custom-tag:hover { background: #ffe9e7; }
.questionnaire__custom-tag { font-size: 13px; padding: 8px 14px; border-radius: 20px; font-weight: 600; cursor: pointer; border: 1.5px solid #52c41a; color: #52c41a; background: #f6ffed; transition: all .2s; display: flex; align-items: center; gap: 6px; }
.questionnaire__custom-tag:hover { background: #e6f7df; }
.questionnaire__custom-tag::after { content: '✕'; font-size: 10px; opacity: 0.7; }
.questionnaire__chip--add { border-style: dashed !important; color: #bbb !important; border-color: #d0d0d0 !important; background: #fafafa !important; }
.questionnaire__chip--add:hover { border-color: #52c41a !important; color: #52c41a !important; background: #f6ffed !important; }
@@ -220,7 +220,7 @@ body { background: #f0f2f5; display: flex; justify-content: center; align-items:
<div class="custom-avoid-sheet" id="customAvoidSheet">
<div class="custom-avoid-sheet__head">
<span class="custom-avoid-sheet__cancel" onclick="closeCustomAvoidInput()">取消</span>
<span class="custom-avoid-sheet__title">添加规避食材</span>
<span class="custom-avoid-sheet__title">添加禁忌</span>
<span class="custom-avoid-sheet__submit" onclick="confirmCustomAvoid()">确定</span>
</div>
<div class="custom-avoid-sheet__body">
@@ -245,11 +245,10 @@ var userPreferences = {
/* 长庆油田工作区域:省 → 地级市 */
var REGION_DATA = [
{ name: '陕西省', cities: ['西安市','延安市','榆林市','咸阳市'] },
{ name: '甘肃省', cities: ['庆阳市','平凉市'] },
{ name: '宁夏回族自治区', cities: ['银川市','吴忠市'] },
{ name: '内蒙古自治区', cities: ['鄂尔多斯市'] },
{ name: '山西省', cities: ['吕梁市','临汾市'] }
{ name: '陕西省', cities: ['西安市','铜川市','宝鸡市','咸阳市','渭南市','延安市','汉中市','榆林市','安康市','商洛市'] },
{ name: '甘肃省', cities: ['兰州市','嘉峪关市','金昌市','白银市','天水市','武威市','张掖市','平凉市','酒泉市','庆阳市','定西市','陇南市','临夏回族自治州','甘南藏族自治州'] },
{ name: '宁夏回族自治区', cities: ['银川市','石嘴山市','吴忠市','固原市','中卫市'] },
{ name: '内蒙古自治区', cities: ['呼和浩特市','包头市','乌海市','赤峰市','通辽市','鄂尔多斯市','呼伦贝尔市','巴彦淖尔市','乌兰察布市','兴安盟','锡林郭勒盟','阿拉善盟'] }
];
var REGION_OTHER = '其他地区';
@@ -445,7 +444,7 @@ function submitQuestionnaire() {
/* ================================================================
自定义规避食材 — 底部输入 Sheet
================================================================ */
var CUSTOM_AVOID_QUICK = ['苦瓜','芹菜','茄子','胡萝卜','青椒','香菇','洋葱','韭菜','虾皮','豆腐','西红柿','土豆','山药','冬瓜','南瓜','菜','菜','豆芽','海带','竹笋'];
var CUSTOM_AVOID_QUICK = ['猪肉','牛肉','羊肉','鸡肉','鸭肉','鱼肉','','','鸡蛋','牛奶','洋葱','香菜','','','','菜','菜','虾皮'];
var customAvoidSheetTimer = null;
function openCustomAvoidInput() {
@@ -130,7 +130,7 @@
<nav class="top-bar__nav">
<a href="archive-personal.html" class="active">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -163,7 +163,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html" class="active">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -98,7 +98,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html" class="active">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -86,7 +86,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -77,7 +77,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html" class="active">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -94,7 +94,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -77,7 +77,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html" class="active">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
+1 -1
View File
@@ -97,7 +97,7 @@ tbody tr.stat-row:hover{background:#E6F0FF;}
<div class="top-bar__nav">
<a class="active" href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -53,7 +53,7 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html" class="active">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
@@ -53,7 +53,7 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html" class="active">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html">异常事件</a>
+2 -2
View File
@@ -1662,9 +1662,9 @@ Tab标签:总览、心率、血氧、压力、睡眠、体温、锻炼、步
**功能说明:** 汇总展示各业务模块产生的结果异常数据,支持多维度筛选。
**筛选条件:** 员工名称(输入框)、员工编号(输入框)、单位部门(下拉)、业务模块(下拉:全部/健康排查/穿戴监测/体重监测/环境监测)、异常等级(下拉:全部/严重/中等/轻微)、年份(下拉)
**筛选条件:** 员工名称(输入框)、员工编号(输入框)、单位部门(下拉)、业务模块(下拉:全部/穿戴监测/环境监测)、年份(下拉)
**表格列:** 员工、员工编号、单位名称、部门名称、业务模块、异常指标、异常值、异常等级、发现时间
**表格列:** 员工、员工编号、单位名称、部门名称、业务模块、异常指标、异常值、异常等级、异常时间
**业务规则:**
- 异常等级标签:严重(红色)、中等(橙色)、轻微(绿色)
@@ -91,7 +91,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -116,7 +116,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -93,7 +93,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -105,7 +105,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -136,7 +136,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -78,7 +78,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -79,7 +79,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -71,7 +71,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -83,7 +83,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -85,7 +85,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -105,7 +105,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -89,7 +89,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -100,7 +100,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -125,7 +125,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -76,7 +76,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -77,7 +77,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -71,7 +71,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -82,7 +82,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -85,7 +85,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -108,7 +108,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -88,7 +88,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -100,7 +100,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -125,7 +125,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -76,7 +76,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -69,7 +69,7 @@
<div class="top-bar">
<div class="top-bar__logo"><svg viewBox="0 0 28 28" fill="none"><rect width="28" height="28" rx="6" fill="#1890FF"/><path d="M7 14h14M14 7v14" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/></svg> 健康监测</div>
<nav class="top-bar__nav"><a href="../archive-personal.html">档案</a><a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../health-checkup/survey-manage.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a><a href="../exception-dirty.html">异常事件</a></nav>
<div class="top-bar__right"><a class="btn-back" href="../../../index.html"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg> 返回首页</a><div class="avatar"></div><span style="color:rgba(255,255,255,0.65);">系统管理员 ▾</span></div>
</div>
@@ -63,7 +63,7 @@
<div class="top-bar">
<div class="top-bar__logo"><svg viewBox="0 0 28 28" fill="none"><rect width="28" height="28" rx="6" fill="#1890FF"/><path d="M7 14h14M14 7v14" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/></svg> 健康监测</div>
<nav class="top-bar__nav"><a href="../archive-personal.html">档案</a><a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../health-checkup/survey-manage.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a><a href="../exception-dirty.html">异常事件</a></nav>
<div class="top-bar__right"><a class="btn-back" href="../../../index.html"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg> 返回首页</a><div class="avatar"></div><span style="color:rgba(255,255,255,0.65);">系统管理员 ▾</span></div>
</div>
@@ -73,7 +73,7 @@
<div class="top-bar">
<div class="top-bar__logo"><svg viewBox="0 0 28 28" fill="none"><rect width="28" height="28" rx="6" fill="#1890FF"/><path d="M7 14h14M14 7v14" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/></svg> 健康监测</div>
<nav class="top-bar__nav"><a href="../archive-personal.html">档案</a><a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../health-checkup/survey-manage.html">健康排查</a><a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a><a href="../exception-dirty.html">异常事件</a></nav>
<div class="top-bar__right"><a class="btn-back" href="../../../index.html"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg> 返回首页</a><div class="avatar"></div><span style="color:rgba(255,255,255,0.65);">系统管理员 ▾</span></div>
</div>
@@ -85,7 +85,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -105,7 +105,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -85,7 +85,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -100,7 +100,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -125,7 +125,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -76,7 +76,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -77,7 +77,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -71,7 +71,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -78,7 +78,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html" class="active">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -96,7 +96,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html" class="active">异常事件</a>
@@ -91,7 +91,7 @@ tbody tr:hover{background:#F8FBFF;}
<nav class="top-bar__nav">
<a href="archive-personal.html">档案</a>
<a href="crowd-status-employee.html">健康现状</a>
<a href="health-checkup/survey-category.html">健康排查</a>
<a href="health-checkup/survey-manage.html">健康排查</a>
<a href="wearable/tool-manage.html">穿戴监测</a>
<a href="environment/indoor-device-list.html">健康环境</a>
<a href="exception-dirty.html" class="active">异常事件</a>
@@ -137,9 +137,7 @@ tbody tr:hover{background:#F8FBFF;}
<label>业务模块</label>
<select class="filter-select">
<option>全部</option>
<option>健康排查</option>
<option>穿戴监测</option>
<option>体重监测</option>
<option>环境监测</option>
</select>
</div>
@@ -174,7 +172,7 @@ tbody tr:hover{background:#F8FBFF;}
<th>业务模块</th>
<th>异常指标</th>
<th>异常值</th>
<th>发现时间</th>
<th>异常时间</th>
</tr>
</thead>
<tbody>
@@ -183,7 +181,7 @@ tbody tr:hover{background:#F8FBFF;}
<td>CQ001023</td>
<td>采油一厂</td>
<td>研发部</td>
<td>体重监测</td>
<td>穿戴监测</td>
<td>BMI异常</td>
<td>28.5</td>
<td>2026-05-14 10:30</td>
@@ -203,7 +201,7 @@ tbody tr:hover{background:#F8FBFF;}
<td>CQ002301</td>
<td>采气一厂</td>
<td>运营部</td>
<td>健康排查</td>
<td>穿戴监测</td>
<td>积分异常</td>
<td>0分</td>
<td>2026-05-12 09:15</td>
@@ -140,7 +140,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -190,7 +190,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -115,7 +115,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -339,7 +339,7 @@ function renderTable(data){
html += '<td>'+esc(a.org)+'</td>';
html += '<td>'+esc(a.dept)+'</td>';
html += '<td>'+a.dateFrom+' ~ '+a.dateTo+'</td>';
html += '<td><span class="link link-clickable" onclick="openPersonModal('+a.id+')">'+a.personType+''+a.personCount+'人</span></td>';
html += '<td><span class="link link-clickable" onclick="openPersonModal('+a.id+')">'+a.personCount+'人</span></td>';
html += '<td><span class="tag '+statusMap[a.status]+'">'+a.status+'</span></td>';
html += '<td>'+esc(a.leader)+'</td>';
html += '<td>'+a.phone+'</td>';
@@ -99,7 +99,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -1,282 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>健康监测 - 问题分类 | 健康CQ原型</title>
<style>
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;background:#F5F7FA;color:#333;min-width:1280px;}
:root{
--primary:#1890FF;--primary-light:#E6F7FF;--success:#52C41A;--warning:#FAAD14;--danger:#FF4D4F;
--text-primary:#333;--text-secondary:#666;--text-placeholder:#999;--border:#E8E8E8;--background:#F5F7FA;
--font-xs:11px;--font-sm:13px;--font-base:15px;--font-lg:17px;
--radius-sm:4px;--radius-md:8px;--radius-lg:12px;
--shadow-sm:0 1px 4px rgba(0,0,0,0.08);
}
.top-bar{display:flex;align-items:center;height:56px;background:#001529;padding:0 24px;position:fixed;top:0;left:0;right:0;z-index:100;}
.top-bar__logo{display:flex;align-items:center;gap:8px;color:#fff;font-size:var(--font-lg);font-weight:600;white-space:nowrap;width:240px;flex-shrink:0;}
.top-bar__logo svg{width:28px;height:28px;}
.top-bar__right{display:flex;align-items:center;gap:16px;color:rgba(255,255,255,0.65);font-size:var(--font-sm);}
.btn-back{color:rgba(255,255,255,0.65);cursor:pointer;display:flex;align-items:center;gap:4px;text-decoration:none;}
.btn-back:hover{color:#fff;}
.avatar{width:32px;height:32px;border-radius:50%;background:#1890FF;display:flex;align-items:center;justify-content:center;color:#fff;font-size:var(--font-sm);cursor:pointer;}
.top-bar__nav{display:flex;align-items:center;gap:4px;flex:1;}
.top-bar__nav a{color:rgba(255,255,255,0.65);text-decoration:none;padding:6px 16px;border-radius:var(--radius-sm);font-size:var(--font-sm);transition:all .2s;}
.top-bar__nav a:hover{color:#fff;background:rgba(255,255,255,0.08);}
.top-bar__nav a.active{color:#fff;background:var(--primary);}
.sidebar{position:fixed;top:56px;left:0;bottom:0;width:240px;background:#001529;overflow-y:auto;z-index:90;padding-top:8px;}
.sidebar-menu__title{color:rgba(255,255,255,0.35);font-size:var(--font-xs);padding:16px 24px 8px;letter-spacing:.5px;}
.sidebar-item{display:flex;align-items:center;gap:8px;padding:10px 24px;color:rgba(255,255,255,0.65);font-size:var(--font-sm);cursor:pointer;transition:all .15s;text-decoration:none;}
.sidebar-item:hover{color:#fff;background:rgba(255,255,255,0.06);}
.sidebar-item.active{color:#fff;background:var(--primary);}
.sidebar-subgroup__header{display:flex;align-items:center;gap:6px;padding:10px 24px;color:rgba(255,255,255,0.65);font-size:var(--font-sm);cursor:pointer;transition:all .15s;user-select:none;}
.sidebar-subgroup__header:hover{color:rgba(255,255,255,0.85);background:rgba(255,255,255,0.04);}
.sidebar-subgroup__header .arrow{width:10px;height:10px;transition:transform .2s;flex-shrink:0;}
.sidebar-subgroup__header .arrow path{stroke:rgba(255,255,255,0.45);}
.sidebar-subgroup.open>.sidebar-subgroup__header{color:rgba(255,255,255,0.85);}
.sidebar-subgroup.open>.sidebar-subgroup__header .arrow{transform:rotate(90deg);}
.sidebar-subgroup__body{display:none;padding-left:16px;}
.sidebar-subgroup.open>.sidebar-subgroup__body{display:block;}
.sidebar-subgroup__body .sidebar-item{padding-left:36px;font-size:12px;}
.main{margin-left:240px;margin-top:56px;padding:24px;min-height:calc(100vh - 56px);}
/* 筛选栏 */
.filter-bar{background:#fff;border-radius:var(--radius-md);padding:20px 24px;margin-bottom:16px;box-shadow:var(--shadow-sm);display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.filter-item{display:flex;align-items:center;gap:8px;}
.filter-item label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;}
.filter-input{height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);color:var(--text-primary);outline:none;background:#fff;min-width:200px;}
.filter-input:focus{border-color:var(--primary);}
/* 工具栏 */
.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:16px;}
.btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 16px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--font-sm);cursor:pointer;background:#fff;color:var(--text-primary);transition:all .15s;}
.btn--primary{background:var(--primary);color:#fff;border-color:var(--primary);}
.btn--primary:hover{background:#40a9ff;border-color:#40a9ff;}
/* 表格 */
.table-wrap{background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;}
.tree-table{width:100%;border-collapse:collapse;font-size:var(--font-sm);}
.tree-table th{background:#FAFBFC;font-weight:500;color:var(--text-secondary);text-align:left;padding:12px 16px;border-bottom:1px solid var(--border);}
.tree-table td{padding:12px 16px;border-bottom:1px solid #f0f0f0;vertical-align:middle;}
.tree-table tbody tr:hover{background:#FAFBFC;}
.col-expand{width:40px;}
.col-name{min-width:240px;}
.col-sort{width:200px;text-align:center!important;}
.col-action{width:220px;text-align:right!important;}
.tree-table td.col-sort{text-align:center;}
.tree-table td.col-action{text-align:right;}
/* 展开按钮 */
.expand-btn{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text-secondary);transition:transform .2s;border:none;background:none;font-size:16px;}
.expand-btn.open{transform:rotate(90deg);}
.expand-btn.hidden{visibility:hidden;}
/* 子行缩进 */
.row-child .cell-name{padding-left:32px;}
.row-child{display:none;}
.row-child.visible{display:table-row;}
/* 操作链接 */
.action-link{color:var(--primary);cursor:pointer;font-size:var(--font-sm);margin-left:16px;background:none;border:none;text-decoration:none;}
.action-link:hover{color:#40a9ff;}
.action-link.danger{color:var(--danger);}
.action-link.danger:hover{color:#ff7875;}
/* 弹窗 */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;display:none;align-items:center;justify-content:center;}
.modal-mask.show{display:flex;}
.modal{background:#fff;border-radius:var(--radius-md);width:480px;max-width:90vw;box-shadow:0 8px 32px rgba(0,0,0,.15);}
.modal__header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid var(--border);}
.modal__title{font-size:var(--font-base);font-weight:600;color:var(--text-primary);}
.modal__close{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:pointer;color:var(--text-placeholder);font-size:18px;transition:all .15s;border:none;background:none;}
.modal__close:hover{background:#f5f5f5;color:var(--text-primary);}
.modal__body{padding:24px;}
.modal__footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;}
.form-group{margin-bottom:16px;}
.form-group:last-child{margin-bottom:0;}
.form-group label{display:block;font-size:var(--font-sm);color:var(--text-secondary);margin-bottom:6px;}
.form-group label .required{color:var(--danger);margin-left:2px;}
.form-group .form-control{width:100%;height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);outline:none;box-sizing:border-box;}
.form-group .form-control:focus{border-color:var(--primary);}
.form-group select.form-control{appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 12px center;padding-right:32px;cursor:pointer;}
/* 分页 */
.pagination{display:flex;align-items:center;justify-content:flex-end;gap:16px;padding:16px 0;font-size:var(--font-sm);color:var(--text-secondary);}
.pagination__pages{display:flex;align-items:center;gap:4px;}
.page-item{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);cursor:pointer;transition:all .15s;}
.page-item:hover{color:var(--primary);}
.page-item.active{background:var(--primary);color:#fff;}
.pagination__size{cursor:pointer;}
.jump-input{width:40px;height:28px;border:1px solid var(--border);border-radius:var(--radius-sm);text-align:center;font-size:var(--font-sm);outline:none;}
.jump-input:focus{border-color:var(--primary);}
</style>
</head>
<body>
<div class="top-bar">
<div class="top-bar__logo"><svg viewBox="0 0 28 28" fill="none"><rect width="28" height="28" rx="6" fill="#1890FF"/><path d="M7 14h14M14 7v14" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/></svg> 健康监测</div>
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
</nav>
<div class="top-bar__right">
<a class="btn-back" href="../../../index.html">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
返回首页
</a>
<div class="avatar"></div>
<span style="color:rgba(255,255,255,0.65);">系统管理员 ▾</span>
</div>
</div>
<aside class="sidebar">
<div class="sidebar-menu__title">健康排查</div>
<a href="survey-manage.html" class="sidebar-item">问卷管理</a>
<a href="activity-manage.html" class="sidebar-item">活动管理</a>
<a href="activity-stat.html" class="sidebar-item">活动统计</a>
</aside>
<main class="main">
<!-- 筛选栏 -->
<div class="filter-bar">
<div class="filter-item">
<label>分类名称</label>
<input class="filter-input" placeholder="请输入分类名称">
</div>
<button class="btn btn--primary" onclick="alert('查询')"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><circle cx="6" cy="6" r="4.5" stroke="currentColor" stroke-width="1.5"/><path d="M10.5 10.5l2 2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg> 查询</button>
<button class="btn" onclick="alert('重置')">重置</button>
</div>
<!-- 操作栏 -->
<div class="toolbar">
<button class="btn btn--primary" onclick="openModal()"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1v12M1 7h12" stroke="#fff" stroke-width="1.8" stroke-linecap="round"/></svg> 新增</button>
</div>
<!-- 树状表格 -->
<div class="table-wrap">
<table class="tree-table">
<thead>
<tr>
<th class="col-expand"></th>
<th class="col-name">分类名称</th>
<th class="col-sort">分类排序</th>
<th class="col-action">操作</th>
</tr>
</thead>
<tbody id="treeBody"></tbody>
</table>
</div>
<!-- 分页 -->
<div class="pagination">
<span class="pagination__total">共 12 条数据</span>
<div class="pagination__pages">
<span class="page-item active">1</span>
<span class="page-item">2</span>
<span class="page-item next">></span>
</div>
<div class="pagination__size">10条/页 ▾</div>
<div class="pagination__jump">跳至 <input type="text" class="jump-input"></div>
</div>
</main>
<!-- 新增分类弹窗 -->
<div class="modal-mask" id="addModal">
<div class="modal">
<div class="modal__header">
<span class="modal__title">新增分类</span>
<button class="modal__close" onclick="closeModal()">&times;</button>
</div>
<div class="modal__body">
<div class="form-group">
<label>分类名称 <span class="required">*</span></label>
<input type="text" class="form-control" placeholder="请输入分类名称">
</div>
<div class="form-group">
<label>分类排序</label>
<input type="text" class="form-control" placeholder="请输入排序号">
</div>
<div class="form-group">
<label>所属分类</label>
<select class="form-control">
<option value="">无(作为一级分类)</option>
<option value="1">夯实四大健康基石</option>
<option value="2">提升健康素养</option>
<option value="3">监测重点指标</option>
<option value="4">参与单位活动</option>
<option value="5">消减危险因素</option>
<option value="6">控降风险级别</option>
<option value="7">消减异常源头</option>
<option value="8">控降异常结果</option>
<option value="9">慢病就诊用药</option>
<option value="10">控降慢病指标</option>
</select>
</div>
</div>
<div class="modal__footer">
<button class="btn" onclick="closeModal()">取消</button>
<button class="btn btn--primary" onclick="alert('保存成功');closeModal()">确定</button>
</div>
</div>
</div>
<script>
function toggleSubgroup(h){h.parentElement.classList.toggle('open');}
(function(){var a=document.querySelector('.sidebar-item.active');if(!a)return;var s=a.closest('.sidebar-subgroup');if(s)s.classList.add('open');})();
// 树状数据
var treeData = [
{id:1, name:'夯实四大健康基石', sort:1, children:[
{id:101, name:'合理膳食', sort:1},
{id:102, name:'适量运动', sort:2},
{id:103, name:'戒烟限酒', sort:3},
{id:104, name:'心理平衡', sort:4}
]},
{id:2, name:'提升健康素养', sort:2, children:[
{id:201, name:'健康知识掌握', sort:1},
{id:202, name:'健康行为养成', sort:2}
]},
{id:3, name:'监测重点指标', sort:3, children:[]},
{id:4, name:'参与单位活动', sort:4, children:[]},
{id:5, name:'消减危险因素', sort:5, children:[]},
{id:6, name:'控降风险级别', sort:6, children:[]},
{id:7, name:'消减异常源头', sort:7, children:[]},
{id:8, name:'控降异常结果', sort:8, children:[]},
{id:9, name:'慢病就诊用药', sort:9, children:[]},
{id:10, name:'控降慢病指标', sort:10, children:[]}
];
function renderTree(){
var tbody = document.getElementById('treeBody');
var html = '';
treeData.forEach(function(item){
var hasChild = item.children && item.children.length > 0;
html += '<tr class="row-parent" data-id="'+item.id+'">';
html += '<td class="col-expand"><button class="expand-btn'+(hasChild?'':' hidden')+'" onclick="toggleRow(this,'+item.id+')">+</button></td>';
html += '<td class="col-name">'+item.name+'</td>';
html += '<td class="col-sort">'+item.sort+'</td>';
html += '<td class="col-action">';
html += '<a class="action-link" onclick="alert(\'添加下级: '+item.name+'\')">添加下级</a>';
html += '<a class="action-link" onclick="alert(\'编辑: '+item.name+'\')">编辑</a>';
html += '<a class="action-link danger" onclick="alert(\'删除: '+item.name+'\')">删除</a>';
html += '</td></tr>';
if(hasChild){
item.children.forEach(function(child){
html += '<tr class="row-child" data-parent="'+item.id+'">';
html += '<td class="col-expand"></td>';
html += '<td class="col-name"><span class="cell-name">'+child.name+'</span></td>';
html += '<td class="col-sort">'+child.sort+'</td>';
html += '<td class="col-action">';
html += '<a class="action-link" onclick="alert(\'编辑: '+child.name+'\')">编辑</a>';
html += '<a class="action-link danger" onclick="alert(\'删除: '+child.name+'\')">删除</a>';
html += '</td></tr>';
});
}
});
tbody.innerHTML = html;
}
function toggleRow(btn, parentId){
var isOpen = btn.classList.toggle('open');
btn.textContent = isOpen ? '' : '+';
var rows = document.querySelectorAll('tr[data-parent="'+parentId+'"]');
rows.forEach(function(r){ r.classList.toggle('visible', isOpen); });
}
function openModal(){ document.getElementById('addModal').classList.add('show'); }
function closeModal(){ document.getElementById('addModal').classList.remove('show'); }
renderTree();
</script>
</body>
</html>
@@ -233,7 +233,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -143,7 +143,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html" class="active">健康排查</a>
<a href="survey-manage.html" class="active">健康排查</a>
<a href="../wearable/tool-manage.html">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -82,7 +82,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -92,7 +92,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -131,7 +131,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -103,7 +103,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -126,7 +126,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -115,7 +115,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -112,7 +112,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -112,7 +112,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -112,7 +112,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -112,7 +112,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -109,7 +109,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -106,7 +106,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -102,7 +102,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -108,7 +108,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -99,7 +99,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -106,7 +106,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -113,7 +113,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -111,7 +111,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -106,7 +106,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -131,7 +131,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -131,7 +131,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -120,7 +120,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -106,7 +106,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -119,7 +119,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -112,7 +112,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -92,7 +92,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -127,7 +127,7 @@
<nav class="top-bar__nav">
<a href="../../archive-personal.html">档案</a>
<a href="../../crowd-status-employee.html">健康现状</a>
<a href="../../health-checkup/survey-category.html">健康排查</a>
<a href="../../health-checkup/survey-manage.html">健康排查</a>
<a href="../tool-manage.html" class="active">穿戴监测</a>
<a href="../../environment/indoor-device-list.html">健康环境</a>
<a href="../../exception-dirty.html">异常事件</a>
@@ -87,7 +87,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -173,7 +173,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -135,7 +135,7 @@
<nav class="top-bar__nav">
<a href="../archive-personal.html">档案</a>
<a href="../crowd-status-employee.html">健康现状</a>
<a href="../health-checkup/survey-category.html">健康排查</a>
<a href="../health-checkup/survey-manage.html">健康排查</a>
<a href="tool-manage.html" class="active">穿戴监测</a>
<a href="../environment/indoor-device-list.html">健康环境</a>
<a href="../exception-dirty.html">异常事件</a>
@@ -153,6 +153,7 @@ tbody tr:hover td:nth-child(1){background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item active">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->
@@ -188,6 +188,7 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item active">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->
+14 -6
View File
@@ -287,6 +287,7 @@ tbody tr:hover td:nth-child(3){background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->
<main class="main">
@@ -1163,7 +1164,7 @@ function buildMeasureData(){
var data = {weight:[], diet:[], exercise:[]};
var types = ['weight','diet','exercise'];
var monthAgo = new Date(); monthAgo.setMonth(monthAgo.getMonth()-3);
var yesterday = new Date(); yesterday.setDate(yesterday.getDate()-1);
var today = new Date();
baseEmployees.forEach(function(e,i){
// 部分员工未参加干预计划
var noPlan = i % 6 === 0;
@@ -1174,14 +1175,19 @@ function buildMeasureData(){
types.forEach(function(t){
var hasRecord = i % 5 !== 4;
var count = hasRecord ? (t==='weight' ? Math.floor(Math.random()*12)+2 : Math.floor(Math.random()*50)+10) : 0;
var firstDay = new Date(yesterday); firstDay.setDate(firstDay.getDate()-daysSinceStart);
var lastDay = hasRecord ? new Date(yesterday) : null;
var firstDay = new Date(today); firstDay.setDate(firstDay.getDate()-daysSinceStart);
var lastDay = hasRecord ? new Date(today) : null;
var fd = firstDay.getFullYear()+'-'+('0'+(firstDay.getMonth()+1)).slice(-2)+'-'+('0'+firstDay.getDate()).slice(-2);
var ld = lastDay ? lastDay.getFullYear()+'-'+('0'+(lastDay.getMonth()+1)).slice(-2)+'-'+('0'+lastDay.getDate()).slice(-2) : '-';
var source = '';
if(t === 'weight' && hasRecord){
var sources = ['体重秤','蓝牙称','体脂仪','自记'];
source = sources[Math.floor(Math.random()*sources.length)];
}
data[t].push({
planId: planIdVal, planName: planNameVal, org: e.org, dept: e.dept,
name: e.name, empId: e.empId, gender: e.gender, age: e.age,
measureType: t, checkinCount: count, firstDate: fd, lastDate: ld, hasRecord: hasRecord
measureType: t, checkinCount: count, firstDate: fd, lastDate: ld, hasRecord: hasRecord, source: source
});
});
});
@@ -1631,7 +1637,7 @@ function renderOverviewHeader(){
html += sortTh;
html += '<th rowspan="2">首次记录日期</th>';
html += '<th rowspan="2">末次记录日期</th>';
html += '<th colspan="5">末次记录数据</th>';
html += '<th colspan="6">末次记录数据</th>';
html += '</tr>';
html += '<tr>';
html += '<th>身高</th>';
@@ -1639,6 +1645,7 @@ function renderOverviewHeader(){
html += '<th>BMI</th>';
html += '<th>体脂</th>';
html += '<th>腰围</th>';
html += '<th>记录来源</th>';
html += '</tr>';
} else {
html += '<tr>';
@@ -1666,7 +1673,7 @@ function renderOverviewTable(){
document.getElementById('pageInfo1').textContent = '显示 ' + pageData.length + ' 条,共 ' + filteredData.length + ' 条记录';
document.getElementById('pageNum1').textContent = '第 ' + (currentPage + 1) + '/' + totalPages + ' 页';
var isWeight = currentSubTab === 'weight';
var colCount = isWeight ? 15 : 10;
var colCount = isWeight ? 16 : 10;
if(filteredData.length === 0){
tbody.innerHTML = '<tr><td colspan="'+colCount+'" class="td-empty">暂无匹配数据</td></tr>';
return;
@@ -1691,6 +1698,7 @@ function renderOverviewTable(){
html += '<td>'+(emp.bmi?emp.bmi.toFixed(1):'-')+'</td>';
html += '<td>'+(emp.fat?emp.fat.toFixed(1):'-')+'</td>';
html += '<td>'+(emp.waist||'-')+'</td>';
html += '<td>'+esc(d.source||'-')+'</td>';
}
html += '</tr>';
});
@@ -176,6 +176,7 @@ tbody tr:hover td:nth-child(2){background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item active">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->
@@ -229,6 +229,7 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->
@@ -0,0 +1,525 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>食谱记录 | 体重管理</title>
<style>
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;background:#F5F7FA;color:#333;min-width:1280px;}
:root{
--primary:#1890FF;--primary-light:#E6F7FF;--success:#52C41A;--warning:#FAAD14;--danger:#FF4D4F;
--text-primary:#333;--text-secondary:#666;--text-placeholder:#999;--border:#E8E8E8;--background:#F5F7FA;
--font-xs:11px;--font-sm:13px;--font-base:15px;--font-lg:17px;
--radius-sm:4px;--radius-md:8px;--radius-lg:12px;
--shadow-sm:0 1px 4px rgba(0,0,0,0.08);--shadow-md:0 4px 12px rgba(0,0,0,0.10);
}
/* 顶部导航栏 */
.top-bar{display:flex;align-items:center;height:56px;background:#001529;padding:0 24px;position:fixed;top:0;left:0;right:0;z-index:100;}
.top-bar__logo{display:flex;align-items:center;gap:8px;color:#fff;font-size:var(--font-lg);font-weight:600;white-space:nowrap;width:240px;flex-shrink:0;}
.top-bar__logo svg{width:28px;height:28px;}
.top-bar__nav{display:flex;align-items:center;gap:4px;flex:1;}
.top-bar__nav a{color:rgba(255,255,255,0.65);text-decoration:none;padding:6px 16px;border-radius:var(--radius-sm);font-size:var(--font-sm);transition:all .2s;}
.top-bar__nav a:hover{color:#fff;background:rgba(255,255,255,0.08);}
.top-bar__nav a.active{color:#fff;background:var(--primary);}
.top-bar__right{display:flex;align-items:center;gap:16px;color:rgba(255,255,255,0.65);font-size:var(--font-sm);}
.btn-back{color:rgba(255,255,255,0.65);cursor:pointer;display:flex;align-items:center;gap:4px;text-decoration:none;}
.btn-back:hover{color:#fff;}
.avatar{width:32px;height:32px;border-radius:50%;background:#1890FF;display:flex;align-items:center;justify-content:center;color:#fff;font-size:var(--font-sm);cursor:pointer;}
/* 侧边栏 */
.sidebar{position:fixed;top:56px;left:0;bottom:0;width:240px;background:#001529;overflow-y:auto;z-index:90;padding-top:8px;}
.sidebar-menu__title{color:rgba(255,255,255,0.35);font-size:var(--font-xs);padding:16px 24px 8px;letter-spacing:.5px;}
.sidebar-item{display:flex;align-items:center;gap:8px;padding:10px 24px;color:rgba(255,255,255,0.65);font-size:var(--font-sm);cursor:pointer;transition:all .15s;text-decoration:none;}
.sidebar-item:hover{color:#fff;background:rgba(255,255,255,0.06);}
.sidebar-item.active{color:#fff;background:var(--primary);}
/* 主内容区 */
.main{margin-left:240px;margin-top:56px;padding:24px;min-height:calc(100vh - 56px);}
/* 页面标题 */
.page-header{margin-bottom:16px;}
.page-header__breadcrumb{font-size:var(--font-sm);color:var(--text-placeholder);}
.page-header__breadcrumb span{color:var(--text-primary);}
/* 筛选栏 */
.filter-bar{background:#fff;padding:16px 24px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;border-radius:var(--radius-md) var(--radius-md) 0 0;box-shadow:var(--shadow-sm);}
.filter-item{display:flex;align-items:center;gap:8px;}
.filter-item label{font-size:var(--font-xs);color:var(--text-secondary);white-space:nowrap;}
.filter-input{height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 10px;font-size:var(--font-xs);outline:none;transition:border-color .2s;box-sizing:border-box;min-width:120px;}
.filter-input:focus{border-color:var(--primary);}
.filter-select{height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 24px 0 10px;font-size:var(--font-xs);outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 8px center;appearance:none;cursor:pointer;min-width:100px;}
.filter-date{height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 10px;font-size:var(--font-xs);outline:none;transition:border-color .2s;box-sizing:border-box;min-width:130px;color:var(--text-primary);}
.filter-date:focus{border-color:var(--primary);}
/* 按钮 */
.btn{height:32px;padding:0 16px;border-radius:var(--radius-sm);font-size:var(--font-xs);cursor:pointer;border:none;transition:all .2s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.btn-primary{background:var(--primary);color:#fff;}.btn-primary:hover{background:#40a9ff;}
.btn-default{background:#fff;color:var(--text-primary);border:1px solid var(--border);}.btn-default:hover{color:var(--primary);border-color:var(--primary);}
.btn-export{background:#fff;color:var(--text-primary);border:1px solid var(--border);}.btn-export:hover{color:var(--primary);border-color:var(--primary);}
.btn-success{background:var(--success);color:#fff;}.btn-success:hover{background:#73d13d;}
/* 操作栏 */
.action-bar{display:flex;align-items:center;gap:8px;padding:16px 24px;background:#fff;border-top:1px solid var(--border);}
/* 表格卡片 */
.table-card{background:#fff;border-radius:0 0 var(--radius-md) var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;}
.table-card__content{overflow-x:auto;-webkit-overflow-scrolling:touch;}
table{width:100%;border-collapse:collapse;}
/* 表头 */
thead th{background:#FAFAFA;padding:10px 12px;text-align:center;font-size:var(--font-xs);color:var(--text-secondary);font-weight:500;border-bottom:1px solid var(--border);white-space:nowrap;}
/* 表体 */
tbody td{padding:10px 12px;text-align:center;font-size:var(--font-sm);color:var(--text-primary);border-bottom:1px solid #F0F0F0;white-space:nowrap;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:#F8FBFF;}
.td-empty{text-align:center;padding:48px 0;color:var(--text-placeholder);font-size:var(--font-sm);}
/* 分页 */
.pagination{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;gap:8px;border-top:1px solid var(--border);}
.pagination__left{display:flex;align-items:center;gap:8px;font-size:var(--font-sm);color:var(--text-secondary);}
.pagination__right{display:flex;align-items:center;gap:8px;}
.page-btn{width:32px;height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);background:#fff;cursor:pointer;font-size:var(--font-sm);display:inline-flex;align-items:center;justify-content:center;transition:all .2s;}
.page-btn:hover,.page-btn.active{background:var(--primary);color:#fff;border-color:var(--primary);}
/* Toast */
.toast{position:fixed;top:80px;left:50%;transform:translateX(-50%);background:#333;color:#fff;padding:10px 24px;border-radius:var(--radius-sm);font-size:var(--font-sm);z-index:9999;opacity:0;transition:opacity .2s;pointer-events:none;}
.toast.show{opacity:1;}
/* 弹窗 */
.record-overlay{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.45);z-index:1000;align-items:center;justify-content:center;}
.record-overlay.show{display:flex;}
.record-dialog{background:#fff;border-radius:var(--radius-lg);box-shadow:0 8px 40px rgba(0,0,0,0.18);width:560px;max-height:85vh;overflow:hidden;display:flex;flex-direction:column;}
.record-dialog__header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid var(--border);flex-shrink:0;}
.record-dialog__title{font-size:var(--font-lg);font-weight:600;}
.record-dialog__close{width:32px;height:32px;border:none;background:none;cursor:pointer;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;color:var(--text-secondary);font-size:20px;transition:all .15s;}
.record-dialog__close:hover{background:#F5F7FA;color:var(--text-primary);}
.record-dialog__body{padding:24px;overflow-y:auto;flex:1;min-height:0;}
.form-group{margin-bottom:16px;}
.form-group__label{display:block;font-size:var(--font-sm);color:var(--text-secondary);margin-bottom:6px;font-weight:500;}
.form-group__label .required{color:var(--danger);margin-left:2px;}
.form-input{width:100%;height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);outline:none;transition:border-color .2s;box-sizing:border-box;}
.form-input:focus{border-color:var(--primary);}
.form-select{width:100%;height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 24px 0 12px;font-size:var(--font-sm);outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 8px center;appearance:none;cursor:pointer;}
.form-date{width:100%;height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);outline:none;transition:border-color .2s;box-sizing:border-box;color:var(--text-primary);}
.form-date:focus{border-color:var(--primary);}
.dialog-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:24px;padding-top:16px;border-top:1px solid var(--border);}
/* 餐品列表项 */
.food-item{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
.food-item:last-child{margin-bottom:0;}
.food-item .form-input{flex:1;}
.food-item__remove{width:28px;height:28px;border:1px solid var(--border);border-radius:var(--radius-sm);background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text-placeholder);font-size:14px;flex-shrink:0;transition:all .15s;}
.food-item__remove:hover{color:var(--danger);border-color:var(--danger);}
.food-item:only-child .food-item__remove{display:none;}
</style>
</head>
<body>
<!-- 顶部导航栏 -->
<div class="top-bar">
<div class="top-bar__logo"><svg viewBox="0 0 28 28" fill="none"><rect width="28" height="28" rx="6" fill="#1890FF"/><path d="M7 14h14M14 7v14" stroke="#fff" stroke-width="2.5" stroke-linecap="round"/></svg> 体重管理</div>
<nav class="top-bar__nav">
<a href="archive-personal-weight-data.html">档案</a>
<a href="plan-list.html">计划管理</a>
<a href="registration-tracking.html">报名管理</a>
<a href="action-record.html" class="active">过程管理</a>
<a href="history-plan-list.html">历史干预</a>
<a href="personal-target-data.html">个人体重管理</a>
<a href="scale-device.html">设备管理</a>
<a href="exception-system-dirty.html">异常事件</a>
</nav>
<div class="top-bar__right">
<a class="btn-back" href="../../index.html"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg> 返回首页</a>
<div class="avatar"></div>
<span style="color:rgba(255,255,255,0.65);">系统管理员 ▾</span>
</div>
</div>
<!-- 侧边栏 -->
<aside class="sidebar">
<div class="sidebar-menu__title">过程管理</div>
<a href="action-record.html" class="sidebar-item">行动记录</a>
<a href="detail-data.html" class="sidebar-item">详细数据</a>
<a href="weight-ranking.html" class="sidebar-item">体重排名</a>
<a href="action-overview.html" class="sidebar-item">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item active">食谱记录</a>
</aside>
<!-- 主内容 -->
<main class="main">
<!-- 页面标题 -->
<div class="page-header">
<div class="page-header__breadcrumb">体重管理 / 过程管理 / <span>食谱记录</span></div>
</div>
<!-- 筛选栏 -->
<div class="filter-bar">
<div class="filter-item">
<label>食堂名称</label>
<input class="filter-input" id="filterCanteen" placeholder="请输入食堂名称" style="min-width:130px;">
</div>
<div class="filter-item">
<label>餐次</label>
<select class="filter-select" id="filterMeal">
<option value="">全部餐次</option>
<option value="早餐">早餐</option>
<option value="午餐">午餐</option>
<option value="晚餐">晚餐</option>
</select>
</div>
<div class="filter-item">
<label>日期范围</label>
<input class="filter-date" type="date" id="filterDateFrom">
<span style="font-size:var(--font-xs);color:var(--text-placeholder);"></span>
<input class="filter-date" type="date" id="filterDateTo">
</div>
<div class="filter-item">
<label>餐品名称</label>
<input class="filter-input" id="filterFood" placeholder="请输入餐品名称" style="min-width:130px;">
</div>
<button class="btn btn-primary" onclick="applyFilter()">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><circle cx="6" cy="6" r="4.5" stroke="#fff" stroke-width="1.3"/><path d="M9.5 9.5L13 13" stroke="#fff" stroke-width="1.3" stroke-linecap="round"/></svg>查询
</button>
<button class="btn btn-default" onclick="resetFilter()">重置</button>
</div>
<!-- 操作按钮区 -->
<div class="action-bar">
<button class="btn btn-success" onclick="openAddDialog()">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 2v10M2 7h10" stroke="#fff" stroke-width="1.5" stroke-linecap="round"/></svg>新增记录
</button>
<button class="btn btn-default" onclick="showToast('批量导入功能开发中')">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M2 10v2h10v-2M7 2v7M4.5 6.5L7 9l2.5-2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>批量导入
</button>
<button class="btn btn-default" onclick="showToast('导入任务列表开发中')">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><rect x="2" y="2" width="10" height="10" rx="1.5" stroke="currentColor" stroke-width="1.4"/><path d="M4 5h6M4 7.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>查看导入任务
</button>
<button class="btn btn-export" onclick="showToast('导出列表数据功能开发中')">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M2 10v2h10v-2M7 2v7M4.5 6.5L7 9l2.5-2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>导出列表数据
</button>
<button class="btn btn-default" onclick="showToast('导出任务列表开发中')">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><rect x="2" y="2" width="10" height="10" rx="1.5" stroke="currentColor" stroke-width="1.4"/><path d="M4 5h6M4 7.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>查看导出任务
</button>
<span style="font-size:var(--font-xs);color:var(--text-secondary);margin-left:auto;" id="tableCount">共 0 条记录</span>
</div>
<!-- 数据表格 -->
<div class="table-card">
<div class="table-card__content">
<table>
<thead>
<tr>
<th>单位</th>
<th>食堂名称</th>
<th>用餐日期</th>
<th>餐次</th>
<th>餐品名称</th>
</tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
</div>
<div class="pagination">
<div class="pagination__left">
<span id="pageInfo">显示 0 条记录</span>
</div>
<div class="pagination__right">
<button class="page-btn" onclick="goPage(-1)"></button>
<span id="pageNum" style="font-size:var(--font-sm);color:var(--text-secondary);">第 1 页</span>
<button class="page-btn" onclick="goPage(1)"></button>
</div>
</div>
</div>
</main>
<!-- Toast -->
<div class="toast" id="toast"></div>
<!-- [弹窗] 新增食谱记录 -->
<div class="record-overlay" id="addOverlay">
<div class="record-dialog">
<div class="record-dialog__header">
<span class="record-dialog__title">新增食谱记录</span>
<button class="record-dialog__close" onclick="closeAddDialog()"></button>
</div>
<div class="record-dialog__body">
<div class="form-group">
<label class="form-group__label">单位<span class="required">*</span></label>
<select class="form-select" id="addUnit">
<option value="">请选择单位</option>
<option value="第四采油厂">第四采油厂</option>
<option value="采油一厂">采油一厂</option>
<option value="采油二厂">采油二厂</option>
<option value="采气一厂">采气一厂</option>
</select>
</div>
<div class="form-group">
<label class="form-group__label">食堂名称<span class="required">*</span></label>
<select class="form-select" id="addCanteen">
<option value="">请选择食堂</option>
<option value="第一食堂">第一食堂</option>
<option value="第二食堂">第二食堂</option>
<option value="职工餐厅">职工餐厅</option>
<option value="营养餐厅">营养餐厅</option>
</select>
</div>
<div class="form-group">
<label class="form-group__label">用餐日期<span class="required">*</span></label>
<input class="form-date" type="date" id="addDate">
</div>
<div class="form-group">
<label class="form-group__label">餐次<span class="required">*</span></label>
<select class="form-select" id="addMeal">
<option value="">请选择餐次</option>
<option value="早餐">早餐</option>
<option value="午餐">午餐</option>
<option value="晚餐">晚餐</option>
</select>
</div>
<div class="form-group">
<label class="form-group__label">餐品名称<span class="required">*</span></label>
<div id="foodList">
<div class="food-item">
<input class="form-input" placeholder="请输入餐品名称">
<button type="button" class="food-item__remove" onclick="removeFoodItem(this)" title="删除"></button>
</div>
</div>
<button type="button" class="btn btn-default" onclick="addFoodItem()" style="margin-top:8px;">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 2v10M2 7h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>添加餐品
</button>
</div>
<div class="dialog-footer">
<button class="btn btn-default" onclick="closeAddDialog()">取消</button>
<button class="btn btn-primary" onclick="submitAdd()">确定</button>
</div>
</div>
</div>
</div>
<script>
/* ===== 侧边栏当前页高亮 ===== */
(function(){
var current = location.pathname.split('/').pop();
document.querySelectorAll('.sidebar-item').forEach(function(item){
var href = item.getAttribute('href');
item.classList.toggle('active', href === current);
});
})();
/* ===== Mock数据 ===== */
// 单位、食堂、餐次组合
var canteens = ['第一食堂','第二食堂','职工餐厅','营养餐厅'];
var meals = ['早餐','午餐','晚餐'];
// 各餐次的典型餐品
var foodMap = {
'早餐': ['小米粥','馒头','鸡蛋','豆浆','花卷','牛奶','包子','油条','蒸饺','燕麦粥','全麦面包','煮玉米'],
'午餐': ['红烧肉','清蒸鱼','番茄炒蛋','青椒肉丝','宫保鸡丁','麻婆豆腐','蒜蓉西兰花','糖醋排骨','回锅肉','鱼香茄子','干煸四季豆','香菇青菜'],
'晚餐': ['清炒时蔬','紫菜蛋汤','凉拌黄瓜','芹菜香干','冬瓜排骨汤','蒜泥白肉','清蒸鲈鱼','醋溜白菜','酸辣土豆丝','西红柿蛋汤','白灼虾','上汤娃娃菜']
};
function buildMockData(){
var data = [];
var units = ['第四采油厂','采油一厂','采油二厂','采气一厂'];
// 生成近7天的食谱记录
var today = new Date();
for(var d=0;d<7;d++){
var date = new Date(today);
date.setDate(date.getDate()-d);
var dateStr = date.getFullYear()+'-'+('0'+(date.getMonth()+1)).slice(-2)+'-'+('0'+date.getDate()).slice(-2);
units.forEach(function(unit){
// 每个单位随机1~2个食堂
var canteenCount = 1 + Math.floor(Math.random()*2);
var shuffledCanteens = canteens.slice().sort(function(){return Math.random()-0.5;});
for(var c=0;c<canteenCount;c++){
meals.forEach(function(meal){
// 每餐随机2~4道菜,逗号分隔
var foodCount = 2 + Math.floor(Math.random()*3);
var foods = foodMap[meal];
var shuffledFoods = foods.slice().sort(function(){return Math.random()-0.5;});
var foodStr = shuffledFoods.slice(0, foodCount).join('、');
data.push({
unit: unit,
canteen: shuffledCanteens[c],
date: dateStr,
meal: meal,
food: foodStr
});
});
}
});
}
return data;
}
var allData = buildMockData();
var filteredData = allData.slice();
var pageSize = 10;
var currentPage = 0;
/* ===== 筛选 ===== */
function applyFilter(){
var canteen = document.getElementById('filterCanteen').value.trim();
var meal = document.getElementById('filterMeal').value;
var dateFrom = document.getElementById('filterDateFrom').value;
var dateTo = document.getElementById('filterDateTo').value;
var food = document.getElementById('filterFood').value.trim();
filteredData = allData.filter(function(d){
if(canteen && d.canteen.indexOf(canteen) === -1) return false;
if(meal && d.meal !== meal) return false;
if(dateFrom && d.date < dateFrom) return false;
if(dateTo && d.date > dateTo) return false;
if(food && d.food.indexOf(food) === -1) return false;
return true;
});
currentPage = 0;
renderTable();
}
function resetFilter(){
document.getElementById('filterCanteen').value = '';
document.getElementById('filterMeal').value = '';
// 重置日期范围为本周
var now = new Date();
var day = now.getDay(); day = day === 0 ? 7 : day;
var mon = new Date(now); mon.setDate(now.getDate() - day + 1);
var sun = new Date(now); sun.setDate(now.getDate() - day + 7);
document.getElementById('filterDateFrom').value = mon.getFullYear()+'-'+('0'+(mon.getMonth()+1)).slice(-2)+'-'+('0'+mon.getDate()).slice(-2);
document.getElementById('filterDateTo').value = sun.getFullYear()+'-'+('0'+(sun.getMonth()+1)).slice(-2)+'-'+('0'+sun.getDate()).slice(-2);
document.getElementById('filterFood').value = '';
applyFilter();
}
/* ===== 渲染表格 ===== */
function renderTable(){
var tbody = document.getElementById('tableBody');
var start = currentPage * pageSize;
var pageData = filteredData.slice(start, start + pageSize);
var totalPages = Math.ceil(filteredData.length / pageSize) || 1;
document.getElementById('pageInfo').textContent = '显示 ' + pageData.length + ' 条,共 ' + filteredData.length + ' 条记录';
document.getElementById('tableCount').textContent = '共 ' + filteredData.length + ' 条记录';
document.getElementById('pageNum').textContent = '第 ' + (currentPage + 1) + '/' + totalPages + ' 页';
if(filteredData.length === 0){
tbody.innerHTML = '<tr><td colspan="5" class="td-empty">暂无匹配数据</td></tr>';
return;
}
var html = '';
pageData.forEach(function(d){
html += '<tr>';
html += '<td>'+esc(d.unit)+'</td>';
html += '<td>'+esc(d.canteen)+'</td>';
html += '<td>'+d.date+'</td>';
html += '<td>'+d.meal+'</td>';
html += '<td>'+esc(d.food)+'</td>';
html += '</tr>';
});
tbody.innerHTML = html;
}
/* ===== 翻页 ===== */
function goPage(delta){
var totalPages = Math.ceil(filteredData.length / pageSize);
var newPage = currentPage + delta;
if(newPage < 0 || newPage >= totalPages) return;
currentPage = newPage;
renderTable();
}
/* ===== 新增记录弹窗 ===== */
function openAddDialog(){
// 预填日期为今天
var today = new Date();
document.getElementById('addDate').value = today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2);
// 重置餐品列表为1个空项
resetFoodList();
document.getElementById('addOverlay').classList.add('show');
}
function closeAddDialog(){
document.getElementById('addOverlay').classList.remove('show');
// 清空表单
document.getElementById('addUnit').value = '';
document.getElementById('addCanteen').value = '';
document.getElementById('addDate').value = '';
document.getElementById('addMeal').value = '';
resetFoodList();
}
/* 餐品动态列表操作 */
function resetFoodList(){
var list = document.getElementById('foodList');
list.innerHTML = '<div class="food-item"><input class="form-input" placeholder="请输入餐品名称"><button type="button" class="food-item__remove" onclick="removeFoodItem(this)" title="删除"></button></div>';
}
function addFoodItem(){
var list = document.getElementById('foodList');
var div = document.createElement('div');
div.className = 'food-item';
div.innerHTML = '<input class="form-input" placeholder="请输入餐品名称"><button type="button" class="food-item__remove" onclick="removeFoodItem(this)" title="删除"></button>';
list.appendChild(div);
// 聚焦新输入框
div.querySelector('input').focus();
}
function removeFoodItem(btn){
var list = document.getElementById('foodList');
var items = list.querySelectorAll('.food-item');
if(items.length <= 1) return; // 至少保留一个
btn.parentElement.remove();
}
function submitAdd(){
var unit = document.getElementById('addUnit').value;
var canteen = document.getElementById('addCanteen').value;
var date = document.getElementById('addDate').value;
var meal = document.getElementById('addMeal').value;
if(!unit){ showToast('请选择单位'); return; }
if(!canteen){ showToast('请选择食堂名称'); return; }
if(!date){ showToast('请选择用餐日期'); return; }
if(!meal){ showToast('请选择餐次'); return; }
// 收集所有非空餐品
var foods = [];
var inputs = document.querySelectorAll('#foodList .form-input');
inputs.forEach(function(inp){
var v = inp.value.trim();
if(v) foods.push(v);
});
if(foods.length === 0){ showToast('请输入至少一个餐品名称'); return; }
// 多个餐品用顿号合并为一条记录
allData.unshift({unit:unit, canteen:canteen, date:date, meal:meal, food:foods.join('、')});
closeAddDialog();
applyFilter();
showToast('新增记录成功');
}
document.getElementById('addOverlay').addEventListener('click',function(e){
if(e.target === this) closeAddDialog();
});
/* ===== 工具函数 ===== */
function esc(s){return String(s||'').replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
function showToast(msg){
var t=document.getElementById('toast');t.textContent=msg;t.classList.add('show');
setTimeout(function(){t.classList.remove('show');},1500);
}
/* ===== 初始化 ===== */
(function init(){
// 设置默认日期范围为本周
var now = new Date();
var day = now.getDay(); day = day === 0 ? 7 : day;
var mon = new Date(now); mon.setDate(now.getDate() - day + 1);
var sun = new Date(now); sun.setDate(now.getDate() - day + 7);
document.getElementById('filterDateFrom').value = mon.getFullYear()+'-'+('0'+(mon.getMonth()+1)).slice(-2)+'-'+('0'+mon.getDate()).slice(-2);
document.getElementById('filterDateTo').value = sun.getFullYear()+'-'+('0'+(sun.getMonth()+1)).slice(-2)+'-'+('0'+sun.getDate()).slice(-2);
applyFilter();
})();
</script>
</body>
</html>
@@ -270,6 +270,7 @@ tbody tr:hover{background:#F8FBFF;}
<a href="weight-ranking.html" class="sidebar-item active">体重排名</a>
<a href="action-overview.html" class="sidebar-item">活动总览</a>
<a href="activity-statistics.html" class="sidebar-item">活动统计</a>
<a href="recipe-record.html" class="sidebar-item">食谱记录</a>
</aside>
<!-- 主内容 -->