<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>江苏省OPO可视化调度指挥平台 - 终版V4</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* ==================== 1. 全局定义 ==================== */
:root {
--primary-blue: #007aff;
--tech-cyan: #00f0ff;
--tech-bg: #050b16;
--card-bg: rgba(16, 36, 68, 0.85); /* 稍微加深背景 */
--border-color: rgba(64, 116, 180, 0.4);
--text-main: #ffffff;
--text-sub: #8fb4d9;
--status-pending: #ff9f0a;
--status-approved: #30d158;
--status-rejected: #ff453a;
--panel-width: 440px; /* 加宽一点以容纳图表 */
}
body {
margin: 0; padding: 0;
background-color: var(--tech-bg);
font-family: "Microsoft YaHei", sans-serif;
color: var(--text-main);
height: 100vh; width: 100vw;
overflow: hidden;
display: flex;
justify-content: space-between; /* 左右布局 */
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.3); border-radius: 2px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
/* ==================== 2. 地图层样式 ==================== */
.map-viewport {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
background-image: radial-gradient(circle at 50% 50%, #112240 0%, #02050a 100%),
url('https://api.mapbox.com/styles/v1/mapbox/dark-v10/static/118.78,32.07,7,0/1600x1200?access_token=pk.eyJ1IjoiZGVtb3VzZXIiLCJhIjoiY2x4eH..."');
background-size: cover; background-position: center;
overflow: hidden; z-index: 0;
}
.map-layer { width: 100%; height: 100%; position: absolute; top: 0; left: 0; transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1); }
/* ========== 地图点位 (交互修改:仅高亮) ========== */
.map-point {
position: absolute; transform: translate(-50%, -100%);
display: flex; flex-direction: column; align-items: center;
z-index: 10; cursor: pointer; transition: 0.3s;
}
/* 选中状态:整体放大,层级提高 */
.map-point.active { z-index: 20; transform: translate(-50%, -100%) scale(1.1); }
/* 预览卡片 (HUD) */
.point-hud { margin-bottom: 8px; transition: all 0.3s ease; }
.hud-card {
background: rgba(8, 20, 40, 0.9);
border: 1px solid var(--tech-cyan);
border-radius: 4px;
padding: 6px 10px;
box-shadow: 0 4px 15px rgba(0,0,0,0.6);
backdrop-filter: blur(4px);
min-width: 140px;
transition: 0.3s;
}
/* 紧急/活跃状态 */
.map-point.urgent .hud-card { border-color: var(--status-pending); box-shadow: 0 0 15px rgba(255,159,10,0.4); }
/* 选中状态:HUD 高亮 */
.map-point.active .hud-card { background: rgba(0, 50, 100, 0.95); border-color: #fff; box-shadow: 0 0 20px rgba(0,240,255,0.5); }
.map-point.active.urgent .hud-card { border-color: #fff; box-shadow: 0 0 20px rgba(255,159,10,0.6); }
.hud-title { font-size: 13px; font-weight: bold; color: #fff; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; margin-bottom: 4px; }
.hud-grid { display: flex; justify-content: space-around; text-align: center; }
.hud-item { display: flex; flex-direction: column; }
.hud-num { font-family: Impact, sans-serif; font-size: 16px; color: var(--tech-cyan); line-height: 1.2; }
.hud-lbl { font-size: 10px; color: var(--text-sub); transform: scale(0.9); }
.map-point.urgent .hud-num.active { color: var(--status-pending); animation: flash 1.5s infinite; }
/* 呼吸光圈 */
.pulse-ring {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
width: 40px; height: 40px; border-radius: 50%;
border: 1px solid var(--status-pending);
opacity: 0; z-index: 1; pointer-events: none;
}
.map-point.urgent .pulse-ring { animation: ripple 2s infinite; }
/* 图标底座 */
.point-icon {
width: 36px; height: 36px;
background: #050b16;
border: 2px solid var(--tech-cyan);
border-radius: 50%;
display: flex; justify-content: center; align-items: center;
color: var(--tech-cyan); font-size: 16px;
position: relative; z-index: 2;
box-shadow: 0 0 10px var(--tech-cyan);
transition: 0.3s;
}
.map-point.urgent .point-icon { border-color: var(--status-pending); color: var(--status-pending); box-shadow: 0 0 20px var(--status-pending); }
.map-point.active .point-icon { background: var(--tech-cyan); color: #000; box-shadow: 0 0 25px var(--tech-cyan); }
.map-point.active.urgent .point-icon { background: var(--status-pending); color: #000; box-shadow: 0 0 25px var(--status-pending); }
@keyframes flash { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
@keyframes ripple { 0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; } }
/* ==================== 3. 通用面板样式 (左右复用) ==================== */
.panel-container {
width: var(--panel-width); height: 95vh;
background: rgba(8, 26, 54, 0.95);
border: 1px solid var(--border-color);
box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
display: flex; flex-direction: column;
backdrop-filter: blur(12px);
z-index: 50;
margin-top: 2.5vh;
transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s ease;
}
.panel-header { height: 44px; background: linear-gradient(90deg, rgba(0,76,163,0.6) 0%, rgba(0,0,0,0) 100%); display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.header-icon { width: 4px; height: 18px; background: var(--tech-cyan); margin-right: 10px; box-shadow: 0 0 8px var(--tech-cyan); }
.panel-title { font-size: 18px; font-weight: bold; letter-spacing: 1px; flex: 1; color: #fff; }
/* 列表容器 */
.list-content { flex: 1; overflow-y: auto; padding: 12px 12px; }
/* ==================== 4. 左侧详情面板 (新增) ==================== */
.left-panel {
position: absolute; left: 20px;
transform: translateX(-120%); /* 默认隐藏在左侧屏幕外 */
opacity: 0;
}
.left-panel.show { transform: translateX(0); opacity: 1; }
.lp-section { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.lp-section:last-child { border-bottom: none; }
/* 态势总结 */
.summary-box {
background: rgba(0,0,0,0.3); border-radius: 4px; padding: 10px; margin-bottom: 10px;
border-left: 3px solid #666; font-size: 13px; color: #ddd;
}
.summary-box.urgent { border-left-color: var(--status-pending); color: #fff; background: rgba(255,159,10,0.1); }
/* 线索小卡片 (左侧面板用) */
.lp-clue { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 4px; padding: 8px 12px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.lp-clue-id { color: var(--tech-cyan); font-weight: bold; font-size: 13px; }
.lp-clue-name { color: #aaa; font-size: 12px; margin-left: 5px; }
.lp-timer { font-family: monospace; font-size: 12px; padding: 1px 5px; border-radius: 2px; }
/* 协调员 */
.lp-coord-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; margin-bottom: 4px; background: rgba(255,255,255,0.02); border-radius: 3px; font-size: 12px; }
.lp-btn { background: var(--primary-blue); color: #fff; padding: 2px 10px; border-radius: 2px; font-size: 11px; cursor: pointer; transition: 0.2s; }
.lp-btn:hover { background: var(--tech-cyan); color: #000; }
/* --- 下部分:图表分析区 --- */
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chart-title { font-size: 14px; font-weight: bold; color: #fff; border-left: 3px solid var(--tech-cyan); padding-left: 8px; }
.chart-toggles { display: flex; background: rgba(255,255,255,0.1); border-radius: 3px; padding: 2px; }
.chart-btn { padding: 2px 8px; font-size: 11px; color: #aaa; cursor: pointer; border-radius: 2px; }
.chart-btn.active { background: var(--tech-cyan); color: #000; font-weight: bold; }
.chart-container { height: 160px; width: 100%; position: relative; border-left: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); margin-top: 10px; }
/* SVG 简易图表样式 */
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.line-path { fill: none; stroke-width: 2; stroke-linecap: round; transition: d 0.5s ease; }
.line-clues { stroke: var(--status-pending); filter: drop-shadow(0 0 4px var(--status-pending)); }
.line-donations { stroke: var(--status-approved); filter: drop-shadow(0 0 4px var(--status-approved)); }
.chart-legend { display: flex; justify-content: flex-end; gap: 15px; font-size: 10px; color: #aaa; margin-top: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
/* ==================== 5. 右侧面板样式 (保持不变) ==================== */
.right-panel { position: absolute; right: 20px; } /* 固定右侧 */
/* 复用原有卡片样式 ... */
.kpi-section { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 10px; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.kpi-item { background: rgba(255,255,255,0.03); border: 1px solid transparent; border-radius: 4px; padding: 8px 0; text-align: center; cursor: pointer; transition: all 0.3s; position: relative; }
.kpi-item.active { background: rgba(0, 122, 255, 0.15); border-color: var(--primary-blue); box-shadow: inset 0 0 10px rgba(0, 122, 255, 0.2); }
.kpi-num { font-size: 20px; font-weight: bold; font-family: Impact, sans-serif; display: block; margin-bottom: 2px;}
.kpi-label { font-size: 11px; color: var(--text-sub); }
.filter-row { padding: 10px 12px; border-bottom: 1px solid var(--border-color); background: rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.card { background: var(--card-bg); border: 1px solid rgba(0, 240, 255, 0.1); border-left: 3px solid #888; border-radius: 6px; margin-bottom: 14px; padding: 12px; position: relative; cursor: pointer; }
.card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.3); background: rgba(20, 45, 85, 0.8); }
.card.active-select { border: 1px solid var(--tech-cyan); background: rgba(20, 45, 85, 1); box-shadow: inset 0 0 15px rgba(0,240,255,0.15); transform: scale(1.02); }
.card.pending { border-left-color: var(--status-pending); }
.card.approved { border-left-color: var(--status-approved); }
.c-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.c-id { font-size: 14px; font-weight: bold; color: var(--tech-cyan); }
.c-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.pending .c-status { color: var(--status-pending); background: rgba(255, 159, 10, 0.15); border: 1px solid rgba(255, 159, 10, 0.3); }
.approved .c-status { color: var(--status-approved); background: rgba(48, 209, 88, 0.15); border: 1px solid rgba(48, 209, 88, 0.3); }
.c-hospital-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,0.1); font-size: 12px; }
.hospital-name { color: #fff; font-weight: 500; } .admission-time { color: var(--text-sub); }
.vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.vital-box { background: rgba(255,255,255,0.05); padding: 5px 8px; border-radius: 4px; font-size: 11px; display: flex; justify-content: space-between; align-items: center; }
.vital-label { color: var(--text-sub); } .vital-val { font-weight: bold; color: #fff; }
</style>
</head>
<body>
<!-- 1. GIS 地图层 -->
<div class="map-viewport" id="mapContainer">
<div class="map-layer" id="mapLayer"></div>
</div>
<!-- 2. 左侧详情面板 (新增,默认隐藏) -->
<div class="panel-container left-panel" id="leftPanel">
<div class="panel-header">
<div class="header-icon"></div>
<div class="panel-title" id="lpTitle">医院详情</div>
</div>
<div class="list-content">
<!-- 上部分:实时态势 -->
<div class="lp-section">
<div id="lpSummary" class="summary-box">
<!-- JS 填充 -->
</div>
<div style="font-size:12px; color:#aaa; margin-bottom:8px;" id="lpListTitle">待审批线索</div>
<div id="lpClueList">
<!-- JS 填充线索列表或历史记录 -->
</div>
<div style="font-size:12px; color:#aaa; margin:15px 0 8px 0;">附近协调员</div>
<div id="lpCoordList">
<!-- JS 填充协调员 -->
</div>
</div>
<!-- 下部分:OPO工作分析 (图表) -->
<div class="lp-section" style="border-top: 1px solid rgba(255,255,255,0.1);">
<div class="chart-header">
<div class="chart-title">OPO工作配合度分析</div>
<div class="chart-toggles">
<div class="chart-btn active" onclick="switchChart('month', this)">月度</div>
<div class="chart-btn" onclick="switchChart('year', this)">年度</div>
</div>
</div>
<div class="chart-container">
<!-- SVG 图表容器 -->
<svg class="chart-svg" viewBox="0 0 100 50" preserveAspectRatio="none">
<!-- 虚线网格 -->
<line x1="0" y1="12.5" x2="100" y2="12.5" stroke="rgba(255,255,255,0.05)" stroke-width="0.5" />
<line x1="0" y1="25" x2="100" y2="25" stroke="rgba(255,255,255,0.05)" stroke-width="0.5" />
<line x1="0" y1="37.5" x2="100" y2="37.5" stroke="rgba(255,255,255,0.05)" stroke-width="0.5" />
<!-- 曲线 -->
<path id="lineReported" class="line-path line-clues" d="" />
<path id="lineDonated" class="line-path line-donations" d="" />
</svg>
</div>
<div class="chart-legend">
<div><span class="legend-dot" style="background:var(--status-pending)"></span>上报线索</div>
<div><span class="legend-dot" style="background:var(--status-approved)"></span>捐赠案例</div>
</div>
</div>
</div>
</div>
<!-- 3. 右侧线索列表面板 (原有) -->
<div class="panel-container right-panel">
<div class="panel-header">
<div class="header-icon"></div>
<div class="panel-title">线索管理</div>
</div>
<!-- KPI -->
<div class="kpi-section">
<div class="kpi-item active"><span class="kpi-num" style="color:#fff">28</span><span class="kpi-label">线索总数</span></div>
<div class="kpi-item"><span class="kpi-num" style="color:var(--status-approved)">12</span><span class="kpi-label">已通过</span></div>
<div class="kpi-item"><span class="kpi-num" style="color:var(--status-pending)">4</span><span class="kpi-label">待审核</span></div>
<div class="kpi-item"><span class="kpi-num" style="color:var(--status-rejected)">12</span><span class="kpi-label">未通过</span></div>
</div>
<!-- 筛选 -->
<div class="filter-row">
<div class="date-range-display"><span class="date-icon">📅</span><span class="date-text">2023-11-20 ~ 2023-11-26</span></div>
<div class="time-btn-group"><button class="time-btn active">本周</button><button class="time-btn">本月</button></div>
</div>
<!-- 列表 -->
<div class="list-content">
<div class="card pending" onclick="focusHospital('H001', this)">
<div class="c-header"><div class="c-id">JSCZ00042 <span style="font-size:12px; color:#aaa; font-weight:normal">| 赵**</span></div><div class="c-status">待审核</div></div>
<div class="c-hospital-row"><span class="hospital-name">徐州医科大附院</span><span class="admission-time">2023-11-26</span></div>
<div class="vital-grid">
<div class="vital-box"><span class="vital-label">GCS</span><span class="vital-val">3分</span></div>
<div class="vital-box"><span class="vital-label">自主呼吸</span><span class="vital-val">无</span></div>
</div>
</div>
<div class="card pending" onclick="focusHospital('H002', this)">
<div class="c-header"><div class="c-id">JSCZ00039 <span style="font-size:12px; color:#aaa; font-weight:normal">| 覃**</span></div><div class="c-status">待审核</div></div>
<div class="c-hospital-row"><span class="hospital-name">南京市鼓楼医院</span><span class="admission-time">2023-11-25</span></div>
<div class="vital-grid">
<div class="vital-box"><span class="vital-label">GCS</span><span class="vital-val">3分</span></div>
<div class="vital-box"><span class="vital-label">自主呼吸</span><span class="vital-val">无</span></div>
</div>
</div>
<div class="card approved" onclick="focusHospital('H003', this)">
<div class="c-header"><div class="c-id">JSCZ00040 <span style="font-size:12px; color:#aaa; font-weight:normal">| 李**</span></div><div class="c-status">已通过</div></div>
<div class="c-hospital-row"><span class="hospital-name">江苏省人民医院</span><span class="admission-time">2023-11-24</span></div>
<div class="vital-grid">
<div class="vital-box"><span class="vital-label">GCS</span><span class="vital-val">3分</span></div>
<div class="vital-box"><span class="vital-label">自主呼吸</span><span class="vital-val">微弱</span></div>
</div>
</div>
</div>
</div>
<script>
// ==================== 数据模拟 ====================
// 增加 chartData 模拟图表数据 (0-50的数值)
const hospitals = {
'H001': {
id: 'H001', name: '徐州医科大附院', x: 25, y: 30, total: 86,
activeClues: [
{ code: 'JSCZ00042', name: '赵**', timeMins: 135 },
{ code: 'JSCZ00045', name: '孙*', timeMins: 40 }
],
coordinators: [
{ name: '刘伟', status: 'avail', dist: '1.2km' },
{ name: '陈静', status: 'busy', dist: '8.5km' }
],
chartData: {
month: { reported: [10, 25, 18, 30, 22, 40], donated: [5, 12, 8, 15, 12, 20] }, // 近6月
year: { reported: [15, 20, 25, 22, 30, 45], donated: [8, 10, 15, 12, 18, 28] } // 近6年
}
},
'H002': {
id: 'H002', name: '南京市鼓楼医院', x: 50, y: 60, total: 156,
activeClues: [{ code: 'JSCZ00039', name: '覃**', timeMins: 20 }],
coordinators: [{ name: '王强', status: 'avail', dist: '2.0km' }],
chartData: {
month: { reported: [30, 35, 28, 45, 38, 42], donated: [20, 25, 18, 30, 28, 32] },
year: { reported: [40, 42, 45, 38, 50, 48], donated: [30, 32, 35, 28, 40, 38] }
}
},
'H003': {
id: 'H003', name: '江苏省人民医院', x: 55, y: 55, total: 203,
activeClues: [],
history: [
{ code: 'JSCZ00040', approver: '张三', time: '11-26 09:30', status: 'pass' },
{ code: 'JSCZ00038', approver: '李四', time: '11-25 14:10', status: 'pass' },
{ code: 'JSCZ00021', approver: '王五', time: '11-20 18:20', status: 'fail' }
],
chartData: {
month: { reported: [40, 30, 20, 10, 15, 20], donated: [35, 25, 15, 8, 12, 15] },
year: { reported: [50, 45, 40, 35, 30, 25], donated: [45, 40, 35, 30, 25, 20] }
}
}
};
let currentHospitalId = null;
// ==================== 初始化 ====================
const mapLayer = document.getElementById('mapLayer');
const leftPanel = document.getElementById('leftPanel');
function initMap() {
for (let key in hospitals) {
const h = hospitals[key];
const isUrgent = h.activeClues && h.activeClues.length > 0;
const el = document.createElement('div');
el.className = `map-point ${isUrgent ? 'urgent' : ''}`;
el.style.left = h.x + '%';
el.style.top = h.y + '%';
el.id = `pt-${h.id}`;
el.onclick = (e) => { e.stopPropagation(); focusHospital(h.id); };
const hudHTML = `
<div class="point-hud">
<div class="hud-card">
<div class="hud-title">${h.name}</div>
<div class="hud-grid">
<div class="hud-item">
<span class="hud-num ${isUrgent?'active':''}">${isUrgent ? h.activeClues.length : 0}</span>
<span class="hud-lbl">活跃线索</span>
</div>
<div class="hud-item">
<span class="hud-num" style="color:#aaa">${h.total}</span>
<span class="hud-lbl">累计线索</span>
</div>
</div>
</div>
</div>
<div class="pulse-ring"></div>
<div class="point-icon"><i class="fas fa-hospital"></i></div>
`;
el.innerHTML = hudHTML;
mapLayer.appendChild(el);
}
}
initMap();
// ==================== 交互逻辑 ====================
function focusHospital(hId, cardEl) {
currentHospitalId = hId;
const h = hospitals[hId];
// 1. 地图移动与点位高亮
const moveX = 50 - h.x;
const moveY = 50 - h.y;
mapLayer.style.transform = `translate(${moveX}%, ${moveY}%) scale(1.1)`;
document.querySelectorAll('.map-point').forEach(p => p.classList.remove('active'));
const pt = document.getElementById(`pt-${hId}`);
if(pt) pt.classList.add('active');
// 2. 右侧卡片高亮
document.querySelectorAll('.card').forEach(c => c.classList.remove('active-select'));
if(cardEl) cardEl.classList.add('active-select');
// 3. 渲染左侧面板并滑入
renderLeftPanel(h);
leftPanel.classList.add('show');
}
function resetMap(e) {
if(e) e.stopPropagation();
mapLayer.style.transform = `translate(0, 0) scale(1)`;
document.querySelectorAll('.map-point').forEach(p => p.classList.remove('active'));
document.querySelectorAll('.card').forEach(c => c.classList.remove('active-select'));
leftPanel.classList.remove('show'); // 隐藏左侧面板
}
// ==================== 左侧面板渲染 ====================
function renderLeftPanel(h) {
document.getElementById('lpTitle').innerText = h.name;
// --- 上部分:实时态势 ---
const isUrgent = h.activeClues && h.activeClues.length > 0;
const summaryBox = document.getElementById('lpSummary');
const clueList = document.getElementById('lpClueList');
const coordList = document.getElementById('lpCoordList');
const listTitle = document.getElementById('lpListTitle');
// 1. 态势总结
if(isUrgent) {
summaryBox.className = 'summary-box urgent';
summaryBox.innerHTML = `当前待审批线索 <span style="font-weight:bold; font-size:16px">${h.activeClues.length}</span> 条,请立即调度。`;
listTitle.innerText = "待审批线索";
// 2. 线索列表
clueList.innerHTML = h.activeClues.map(clue => {
const hrs = Math.floor(clue.timeMins / 60);
const mins = clue.timeMins % 60;
let tColor = clue.timeMins > 120 ? '#ff453a' : (clue.timeMins > 30 ? '#ff9f0a' : '#30d158');
return `
<div class="lp-clue">
<div><span class="lp-clue-id">${clue.code}</span><span class="lp-clue-name">| ${clue.name}</span></div>
<div class="lp-timer" style="color:${tColor}; border:1px solid ${tColor}">${hrs>0?hrs+'h ':''}${mins}m</div>
</div>
`;
}).join('');
// 3. 协调员
coordList.innerHTML = (h.coordinators || []).map(c => `
<div class="lp-coord-row">
<div class="flex items-center">
<span style="width:6px;height:6px;border-radius:50%;margin-right:6px;background:${c.status==='avail'?'#30d158':'#ff453a'}"></span>
<span style="color:#fff">${c.name}</span>
<span style="color:#888;margin-left:5px;font-size:10px">${c.dist}</span>
</div>
<div class="lp-btn">调度</div>
</div>
`).join('');
} else {
summaryBox.className = 'summary-box';
summaryBox.innerHTML = `当前无待审批线索,点位运行正常。`;
listTitle.innerText = "最近审批记录";
// 历史记录
clueList.innerHTML = (h.history || []).map(his => `
<div class="lp-clue">
<div><span class="lp-clue-id" style="color:#aaa">${his.code}</span></div>
<div class="text-xs text-gray-400">${his.time} <span style="color:${his.status==='pass'?'#30d158':'#ff453a'}">[${his.status==='pass'?'通过':'驳回'}]</span></div>
</div>
`).join('');
coordList.innerHTML = `<div style="color:#666; font-size:12px; font-style:italic">暂无需调度资源</div>`;
}
// --- 下部分:图表初始化 (默认月度) ---
switchChart('month', document.querySelector('.chart-btn.active'));
}
// ==================== 图表逻辑 (SVG 绘制) ====================
function switchChart(type, btn) {
if(!currentHospitalId) return;
// 按钮样式
document.querySelectorAll('.chart-btn').forEach(b => b.classList.remove('active'));
if(btn) btn.classList.add('active');
const h = hospitals[currentHospitalId];
const data = h.chartData[type];
if(!data) return;
// 生成 SVG Path D属性
// ViewBox: 0 0 100 50. X轴步长=100/(N-1), Y轴比例: val/50 * 50 (高度50代表数值50)
const generatePath = (arr) => {
const step = 100 / (arr.length - 1);
return arr.map((val, i) => {
const x = i * step;
const y = 50 - val; // 坐标系倒置
return (i === 0 ? 'M' : 'L') + `${x} ${y}`;
}).join(' ');
};
const pathReported = generatePath(data.reported);
const pathDonated = generatePath(data.donated);
document.getElementById('lineReported').setAttribute('d', pathReported);
document.getElementById('lineDonated').setAttribute('d', pathDonated);
}
document.getElementById('mapContainer').addEventListener('click', resetMap);
</script>
</body>
</html>
index.html
style.css
index.js
index.html