You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1705 lines
54 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>海上风电机组场景</title>
<script src="/models/chart.umd.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
background: #000;
font-family: Arial, sans-serif;
}
#container {
width: 100vw;
height: 100vh;
position: relative;
background: #000;
}
#info {
position: absolute;
top: 10px;
left: 10px;
color: white;
background: rgba(0, 0, 0, 0.5);
padding: 10px;
border-radius: 5px;
font-size: 14px;
z-index: 100;
}
#loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 18px;
z-index: 200;
}
.hidden {
display: none;
}
</style>
<style>
/* 面板基础样式修改 */
.panel {
position: absolute;
top: 20px;
width: 320px;
color: #e0f0ff;
z-index: 10;
height: calc(100vh - 40px);
display: flex;
flex-direction: column;
}
.left-panel {
left: 20px;
}
.right-panel {
right: 20px;
}
.panel-header {
border-bottom: 1px solid rgba(64, 156, 255, 0.4);
padding-bottom: 15px;
margin-bottom: 10px;
text-align: center;
}
.panel-header h3 {
margin: 0;
font-size: 22px;
font-weight: 600;
background: linear-gradient(90deg, #4fc3f7, #4abdf3);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}
.panel-content {
height: 100%;
overflow-y: auto;
padding-right: 5px;
display: flex;
flex-direction: column;
}
.panel-content::-webkit-scrollbar {
width: 2px;
}
.panel-content::-webkit-scrollbar-thumb {
background: rgba(64, 156, 255, 0.5);
border-radius: 2px;
}
.panel-content::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
}
.info-section,
.realtime-indicators,
.unit-status,
.environment-stats,
.power-generation,
.alert-stats {
margin-bottom: 25px;
background: rgba(25, 55, 95, 0.3);
border-radius: 10px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.2);
}
.info-section h4,
.realtime-indicators h4,
.unit-status h4,
.environment-stats h4,
.power-generation h4,
.alert-stats h4 {
margin: 0 0 15px 0;
font-size: 18px;
font-weight: 600;
color: #4fc3f7;
text-align: center;
position: relative;
padding-bottom: 8px;
}
.info-section h4::after,
.realtime-indicators h4::after,
.unit-status h4::after,
.environment-stats h4::after,
.power-generation h4::after,
.alert-stats h4::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 50px;
height: 2px;
background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
}
.info-item,
.indicator-item,
.status-item,
.env-item,
.gen-item,
.alert-item {
display: flex;
flex-wrap: wrap;
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 1px solid rgba(64, 156, 255, 0.2);
}
.info-item:last-child,
.indicator-item:last-child,
.status-item:last-child,
.env-item:last-child,
.gen-item:last-child,
.alert-item:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.info-item label,
.indicator-item label,
.status-item label,
.env-item label,
.gen-item label,
.alert-item label {
flex: 1;
font-size: 15px;
color: #cce0ff;
font-weight: 400;
}
.info-item .value,
.indicator-item .value,
.status-item .value,
.env-item .value,
.gen-item .value,
.alert-item .value {
font-weight: 700;
font-size: 16px;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.value.warning {
color: #ff9800;
text-shadow: 0 0 8px rgba(255, 152, 0, 0.7);
}
.value.critical {
color: #f44336;
text-shadow: 0 0 8px rgba(244, 67, 54, 0.7);
}
.value.normal {
color: #66bb6a;
text-shadow: 0 0 8px rgba(102, 187, 106, 0.7);
}
.progress-bar {
width: 100%;
height: 10px;
background: rgba(0, 0, 0, 0.3);
border-radius: 5px;
margin-top: 8px;
overflow: hidden;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.progress-fill {
height: 100%;
border-radius: 5px;
transition: width 1s ease-in-out;
box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}
.status-grid {
background: linear-gradient(90deg, #00B42A, #66bb6a);
}
.status-stopped {
background: linear-gradient(90deg, #86909C, #b0bec5);
}
.status-standby {
background: linear-gradient(90deg, #1890ff, #4fc3f7);
}
.status-maintenance {
background: linear-gradient(90deg, #FF7D00, #ffa726);
}
.status-offline {
background: linear-gradient(90deg, #faad14, #ffca28);
}
.status-fault {
background: linear-gradient(90deg, #F53F3F, #ef5350);
}
.chart-placeholder {
margin-top: 20px;
background: rgba(25, 55, 95, 0.3);
border-radius: 10px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.2);
}
.chart-placeholder h4 {
margin: 0 0 15px 0;
font-size: 18px;
font-weight: 600;
color: #4fc3f7;
text-align: center;
position: relative;
padding-bottom: 8px;
}
.chart-placeholder h4::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 50px;
height: 2px;
background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
}
/* 数值卡片样式 */
.value-card {
background: rgba(25, 55, 95, 0.4);
border-radius: 8px;
padding: 12px;
margin-bottom: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
}
.value-card:hover {
transform: translateY(-3px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
border-color: rgba(64, 156, 255, 0.6);
}
.value-card .label {
font-size: 14px;
color: #a0d2ff;
margin-bottom: 5px;
}
.value-card .value {
font-size: 24px;
font-weight: 700;
text-align: center;
}
/* 状态指示器 */
.status-indicator {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 8px;
}
.status-indicator.grid {
background: #00B42A;
}
.status-indicator.stopped {
background: #86909C;
}
.status-indicator.standby {
background: #1890ff;
}
.status-indicator.maintenance {
background: #FF7D00;
}
.status-indicator.offline {
background: #faad14;
}
.status-indicator.fault {
background: #F53F3F;
}
</style>
<style>
/* 修改关键指标网格布局 */
.key-indicators-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 10px;
}
.indicator-card {
background: rgba(25, 55, 95, 0.6);
border-radius: 8px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
display: flex;
align-items: center;
/* background-image: url('/assets/img/common/a.png');
background-size: 100% 100%; */
}
.card-icon {
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
/* margin-right: 12px; */
}
.card-info {
flex: 1;
}
.card-label {
font-size: 12px;
color: #a0d2ff;
margin: 0 0 5px 0;
}
.card-value {
font-size: 18px;
font-weight: bold;
color: #00b42a;
/* color: #4fc3f7; */
margin: 0;
}
/* 修改图表区域样式 */
.chart-section {
margin-bottom: 10px;
background: rgba(25, 55, 95, 0.6);
border-radius: 8px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
flex-shrink: 0;
}
.chart-section h4 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: 600;
color: #4fc3f7;
text-align: center;
padding-bottom: 8px;
border-bottom: 1px solid rgba(64, 156, 255, 0.3);
}
.chart-container {
height: 120px;
position: relative;
}
/* 环境参数网格 */
.environment-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 10px;
}
.env-card {
background: rgba(25, 55, 95, 0.6);
border-radius: 8px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
text-align: center;
}
.env-label {
font-size: 12px;
color: #a0d2ff;
margin: 0 0 5px 0;
}
.env-value {
font-size: 18px;
font-weight: bold;
color: #4fc3f7;
margin: 0 0 5px 0;
}
.env-status {
font-size: 12px;
margin: 0;
}
.text-success {
color: #66bb6a;
}
/* 统计数据网格 */
.stats-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-bottom: 25px;
}
.stat-item {
/* background: rgba(25, 55, 95, 0.6); */
/* border-radius: 8px; */
padding: 18px;
/* border: 1px solid rgba(64, 156, 255, 0.3); */
text-align: center;
/* background-image: url('/assets/img/icon/dz.png'); */
background-image: url('/assets/img/flood/base-active.png');
background-size: 100% 100%;
}
.stat-label {
font-size: 12px;
color: #a0d2ff;
margin: 0 0 5px 0;
}
.stat-value {
font-size: 18px;
font-weight: bold;
color: #4fc3f7;
margin: 0;
}
/* 预警统计 */
.alert-summary {
background: rgba(25, 55, 95, 0.6);
border-radius: 8px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
margin-bottom: 10px;
flex: 1;
display: flex;
flex-direction: column;
}
.alert-summary h4 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: 600;
color: #4fc3f7;
text-align: center;
padding-bottom: 8px;
border-bottom: 1px solid rgba(64, 156, 255, 0.3);
flex-shrink: 0;
}
.alert-stats-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 10px;
flex-shrink: 0;
/* margin-top: 20px; */
}
.alert-stat {
text-align: center;
background-image: url('/assets/img/common/bottomItemBg.png');
background-size: 100% 100%;
}
.alert-count {
font-size: 24px;
font-weight: bold;
margin: 15px 0 5px 0;
}
.alert-count.critical {
color: #f44336;
}
.alert-count.warning {
color: #ff9800;
}
.alert-count.normal {
color: #66bb6a;
}
.alert-type {
font-size: 12px;
color: #fffa18;
margin: 20px;
}
</style>
<style>
/* 运行统计区域 */
.stats-section {
margin-bottom: 25px;
background: rgba(25, 55, 95, 0.6);
border-radius: 8px;
padding: 15px;
border: 1px solid rgba(64, 156, 255, 0.3);
}
.stats-section h4 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: 600;
color: #4fc3f7;
text-align: center;
padding-bottom: 8px;
border-bottom: 1px solid rgba(64, 156, 255, 0.3);
}
.stats-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.stat-card {
background: rgba(16, 36, 62, 0.4);
border-radius: 6px;
padding: 12px;
text-align: center;
border: 1px solid rgba(64, 156, 255, 0.2);
}
.stat-title {
font-size: 12px;
color: #a0d2ff;
margin: 0 0 5px 0;
}
.stat-number {
font-size: 20px;
font-weight: bold;
color: #4fc3f7;
margin: 0 0 3px 0;
}
.stat-unit {
font-size: 14px;
color: #81d4fa;
}
.stat-desc {
font-size: 11px;
color: #81d4fa;
margin: 0;
}
/* 图表统计信息 */
.chart-stats {
display: flex;
justify-content: space-around;
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid rgba(64, 156, 255, 0.2);
}
.chart-stats .stat-item {
text-align: center;
}
.chart-stats .stat-label {
font-size: 12px;
color: #a0d2ff;
display: block;
margin-bottom: 5px;
}
.chart-stats .stat-value {
font-size: 16px;
font-weight: bold;
color: #e8ffdc;
}
/* 状态详情 */
.status-details {
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid rgba(64, 156, 255, 0.2);
}
.status-item {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}
.status-item:last-child {
margin-bottom: 0;
}
.status-label {
font-size: 13px;
color: #cce0ff;
display: flex;
align-items: center;
}
.status-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 8px;
}
.status-value {
font-size: 13px;
font-weight: bold;
color: #4fc3f7;
}
</style>
<style>
/* 预警统计详情 */
.alert-details {
/* margin-top: 20px; */
padding-top: 15px;
border-top: 1px solid rgba(64, 156, 255, 0.2);
flex: 1;
display: flex;
flex-direction: column;
}
.alert-details h5 {
font-size: 14px;
color: #4fc3f7;
margin: 0 0 12px 0;
text-align: center;
flex-shrink: 0;
}
.alert-list {
flex: 1;
overflow-y: auto;
padding-right: 5px;
}
/* 隐藏滚动条但保持滚动功能 */
.alert-list::-webkit-scrollbar {
width: 0;
background: transparent;
}
.alert-list::-webkit-scrollbar-thumb {
background: transparent;
}
/* Firefox */
.alert-list {
scrollbar-width: none;
}
/* IE/Edge */
.alert-list {
-ms-overflow-style: none;
}
.alert-item {
background: rgba(16, 36, 62, 0.4);
border-radius: 6px;
padding: 10px;
margin-bottom: 10px;
border-left: 3px solid;
}
.alert-item:last-child {
margin-bottom: 0;
}
.alert-item.critical {
border-left-color: #f44336;
}
.alert-item.warning {
border-left-color: #ff9800;
}
.alert-item.normal {
border-left-color: #66bb6a;
}
.alert-header {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.alert-icon {
font-size: 14px;
margin-right: 8px;
}
.alert-item.critical .alert-icon {
color: #f44336;
}
.alert-item.warning .alert-icon {
color: #ff9800;
}
.alert-item.normal .alert-icon {
color: #66bb6a;
}
.alert-title {
flex: 1;
font-size: 13px;
font-weight: 600;
color: #e0f0ff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.alert-time {
font-size: 11px;
color: #81d4fa;
}
.alert-content {
display: flex;
justify-content: space-between;
align-items: center;
}
.alert-desc {
font-size: 12px;
color: #a0d2ff;
flex: 1;
margin: 0 10px 0 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.alert-status {
flex-shrink: 0;
}
.status-tag {
font-size: 10px;
padding: 2px 6px;
border-radius: 10px;
font-weight: 600;
}
.status-tag.critical {
background: rgba(244, 67, 54, 0.2);
color: #f44336;
}
.status-tag.warning {
background: rgba(255, 152, 0, 0.2);
color: #ff9800;
}
.status-tag.normal {
background: rgba(102, 187, 106, 0.2);
color: #66bb6a;
}
.alert-footer {
text-align: center;
margin-top: 12px;
flex-shrink: 0;
}
.view-all-alerts {
font-size: 12px;
color: #4fc3f7;
text-decoration: none;
}
.view-all-alerts:hover {
text-decoration: underline;
}
</style>
<style>
.chart_title {
height: 5vh;
background: url('./assets/img/common/homeTitle.png') no-repeat;
background-position: center;
background-position-x: center;
background-position-y: center;
background-size: 108% 120%;
display: flex;
justify-content: center;
align-items: center;
}
.chart_title .title span {
font-size: 2.4vh;
letter-spacing: 0.2vh;
font-family: YouSheBiaoTiHei;
font-weight: 400;
color: #ffffff;
}
.tourButton {
background-image: url('./assets/img/common/b.png');
background-size: 100% 100%;
}
</style>
</head>
<body>
<div id="container">
<div id="loading">正在加载海上风电机组场景...</div>
</div>
<!-- 左侧面板 -->
<div id="left-panel" class="panel left-panel">
<div class="panel-content">
<!-- 关键指标卡片 -->
<div class="chart-section">
<div class="chart_title">
<span>关键指标</span>
</div>
<div class="key-indicators-grid">
<div class="indicator-card">
<div class="card-icon bg-primary/10">
<img src="/assets/img/icon/总装机容量.png" alt="">
</div>
<div class="card-info">
<p class="card-label">总装机容量</p>
<p class="card-value" id="totalCapacity">200 MW</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-success/10">
<img src="/assets/img/icon/发电机.png" alt="">
</div>
<div class="card-info">
<p class="card-label">运行机组</p>
<p class="card-value" id="operatingUnits" style="color: #d46115;">18 台</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-warning/10">
<img src="/assets/img/icon/今日发电量.png" alt="">
</div>
<div class="card-info">
<p class="card-label">今日发电量</p>
<p class="card-value" id="todayPower" style="color: #f4ea2a;">3,680 MWh</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-danger/10">
<img src="/assets/img/icon/报警.png" alt="">
</div>
<div class="card-info">
<p class="card-label">当前预警</p>
<p class="card-value" id="currentAlerts" style="color: #ef5350;">2 项</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-danger/10">
<img src="/assets/img/icon/累计发电量.png" alt="">
</div>
<div class="card-info">
<p class="card-label">累计发电量</p>
<p class="card-value" id="totalPower">1.28 GWh</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-danger/10">
<img src="/assets/img/icon/利用率.png" alt="">
</div>
<div class="card-info">
<p class="card-label">设备利用率</p>
<p class="card-value" id="utilizationRate" style="color:#cb601a ;">89 %</p>
</div>
</div>
</div>
</div>
<!-- 实时功率图表 -->
<div class="chart-section">
<div class="chart_title">
<span>实时功率</span>
</div>
<div class="chart-container">
<canvas id="realtimePowerChart"></canvas>
</div>
<div class="chart-stats">
<div class="stat-item">
<span class="stat-label">当前功率</span>
<span class="stat-value" id="currentPower">178 MW</span>
</div>
<div class="stat-item">
<span class="stat-label">峰值功率</span>
<span class="stat-value" id="peakPower">192 MW</span>
</div>
<div class="stat-item">
<span class="stat-label">平均功率</span>
<span class="stat-value" id="avgPower">165 MW</span>
</div>
</div>
</div>
<!-- 机组状态分布 -->
<div class="chart-section" style="flex: 1;display: flex;flex-direction: column;">
<div class="chart_title">
<span>机组状态分布</span>
</div>
<div class="chart-container">
<canvas id="unitStatusChart"></canvas>
</div>
<div class="status-details" id="unitStatusDetails">
<div class="status-item">
<span class="status-label">
<span class="status-dot status-grid"></span>
并网
</span>
<span class="status-value" id="gridConnected">18 台 (90%)</span>
</div>
<div class="status-item">
<span class="status-label">
<span class="status-dot status-maintenance"></span>
维护
</span>
<span class="status-value" id="maintenance">1 台 (5%)</span>
</div>
<div class="status-item">
<span class="status-label">
<span class="status-dot status-fault"></span>
故障
</span>
<span class="status-value" id="fault">1 台 (5%)</span>
</div>
</div>
</div>
</div>
</div>
<!-- 右侧面板 -->
<div id="right-panel" class="panel right-panel">
<div class="panel-content">
<!-- 环境参数 -->
<div class="chart-section">
<div class="chart_title">
<span>环境参数</span>
</div>
<div class="key-indicators-grid">
<div class="indicator-card">
<div class="card-icon bg-warning/10">
<img src="/assets/img/icon/风速.png" alt="">
</div>
<div class="card-info">
<p class="card-label">风速</p>
<p class="card-value" id="windSpeed" style="color: #e48527;">7.5 m/s</p>
<p class="env-status text-success" id="windStatus">适合发电</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-warning/10">
<img src="/assets/img/icon/风向.png" alt="">
</div>
<div class="card-info">
<p class="card-label">风向</p>
<p class="card-value" id="windDirection" style="color: #f4ea2a;">西南</p>
<p class="env-status" id="directionStatus">稳定</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-warning/10">
<img src="/assets/img/icon/温度.png" alt="">
</div>
<div class="card-info">
<p class="card-label">温度</p>
<p class="card-value" id="temperature">18°C</p>
<p class="env-status" id="tempStatus">适宜</p>
</div>
</div>
<div class="indicator-card">
<div class="card-icon bg-warning/10">
<img src="/assets/img/icon/海浪.png" alt="">
</div>
<div class="card-info">
<p class="card-label">海浪</p>
<p class="card-value" id="waveHeight">1.2 m</p>
<p class="env-status" id="waveStatus">正常</p>
</div>
</div>
</div>
</div>
<!-- 发电效率分析 -->
<div class="chart-section">
<div class="chart_title">
<span>发电效率分析</span>
</div>
<div class="chart-container">
<canvas id="efficiencyChartMini"></canvas>
</div>
</div>
<!-- 预警统计 -->
<div class="alert-summary" style="flex: 1; display: flex; flex-direction: column;">
<div class="chart_title">
<span>风机预警统计</span>
</div>
<div class="alert-stats-grid">
<div class="alert-stat">
<p class="alert-count critical" id="criticalAlerts">2</p>
<p class="alert-type">严重</p>
</div>
<div class="alert-stat">
<p class="alert-count warning" id="warningAlerts">5</p>
<p class="alert-type">重要</p>
</div>
<div class="alert-stat">
<p class="alert-count normal" id="normalAlerts">8</p>
<p class="alert-type">一般</p>
</div>
</div>
<!-- 详细预警信息 -->
<div class="alert-details" style="flex: 1; display: flex; flex-direction: column;">
<h5>最新预警</h5>
<div class="alert-list" style="flex: 1;" id="alertList">
<!-- 动态生成预警列表 -->
</div>
<div class="alert-footer">
<a href="#" class="view-all-alerts">查看全部预警 &gt;</a>
</div>
</div>
</div>
</div>
</div>
<!-- 在你的HTML文件中添加 -->
<div style="position: absolute; bottom: 20px; right: 350px; z-index: 100;">
<div id="tourButton" onclick="toggleAutoTour()" class="tourButton"
style="padding: 20px; color: white; border: none; border-radius: 5px; cursor: pointer;">
开始漫游
</div>
</div>
<!-- Three.js 核心库 -->
<script src="js/three.min.js"></script>
<!-- 引入RGBELoader -->
<script src="js/RGBELoader.js"></script>
<!-- <script src="https://unpkg.com/three@0.132.2/examples/js/loaders/RGBELoader.js"></script> -->
<!-- 本地Three.js扩展库 -->
<script src="js/OrbitControls.js"></script>
<!-- Water.js 水面效果 -->
<script src="js/Water.js"></script>
<!-- Sky.js 天空效果 -->
<script src="js/Sky.js"></script>
<!-- GLTF加载器 -->
<script src="js/GLTFLoader.js"></script>
<!-- DRACO解码器 - 使用本地版本 -->
<script src="js/DRACOLoader.js"></script>
<script src="draco/draco_decoder.js"></script>
<script src="draco/draco_wasm_wrapper.js"></script>
<!-- 主程序 -->
<script src="fengdian_main.js"></script>
<script>
// 模拟数据源
const windFarmData = {
// 关键指标
totalCapacity: 200, // MW
operatingUnits: 18, // 台
todayPower: 3680, // MWh
currentAlerts: 2, // 项
totalPower: 1280, // GWh (以 MWh 为单位存储,显示时转换)
utilizationRate: 89, // %
// 功率数据
currentPower: 178, // MW
peakPower: 192, // MW
avgPower: 165, // MW
// 机组状态
unitStatus: {
grid: 18, // 并网
maintenance: 1, // 维护
fault: 1, // 故障
standby: 0 // 待机
},
// 环境参数
environment: {
windSpeed: 7.5, // m/s
windDirection: "西南",
temperature: 18, // °C
waveHeight: 1.2 // m
},
// 预警统计
alertStats: {
critical: 2,
warning: 5,
normal: 8
},
// 预警列表
alerts: [
{
id: "GT018",
type: "critical",
title: "变桨系统故障",
time: "08:23",
desc: "变桨电机过载保护触发,叶片角度无法调节",
status: "未处理"
},
{
id: "A2",
type: "critical",
title: "海缆风险",
time: "09:12",
desc: "海床高度异常变化,海缆存在裸露风险",
status: "待处理"
},
{
id: "GT007",
type: "warning",
title: "齿轮箱温度",
time: "07:15",
desc: "齿轮箱温度偏高,需关注运行状态",
status: "处理中"
},
{
id: "B3",
type: "normal",
title: "海生物附着",
time: "10:45",
desc: "水下巡检发现桩基表面海生物附着较多",
status: "已记录"
}
]
};
// 全局变量存储图表实例
let powerChartInstance = null;
let unitStatusChartInstance = null;
let efficiencyChartInstance = null;
// 更新关键指标数据
function updateKeyIndicators() {
document.getElementById('totalCapacity').textContent = windFarmData.totalCapacity + ' MW';
document.getElementById('operatingUnits').textContent = windFarmData.operatingUnits + ' 台';
document.getElementById('todayPower').textContent = windFarmData.todayPower + ' MWh';
document.getElementById('currentAlerts').textContent = windFarmData.currentAlerts + ' 项';
document.getElementById('totalPower').textContent = (windFarmData.totalPower / 1000).toFixed(2) + ' GWh';
document.getElementById('utilizationRate').textContent = windFarmData.utilizationRate + ' %';
}
// 更新功率数据
function updatePowerData() {
document.getElementById('currentPower').textContent = Math.round(windFarmData.currentPower) + ' MW';
document.getElementById('peakPower').textContent = Math.round(windFarmData.peakPower) + ' MW';
document.getElementById('avgPower').textContent = Math.round(windFarmData.avgPower) + ' MW';
}
// 更新环境参数
function updateEnvironmentData() {
document.getElementById('windSpeed').textContent = windFarmData.environment.windSpeed.toFixed(1) + ' m/s';
document.getElementById('windDirection').textContent = windFarmData.environment.windDirection;
document.getElementById('temperature').textContent = windFarmData.environment.temperature + '°C';
document.getElementById('waveHeight').textContent = windFarmData.environment.waveHeight.toFixed(1) + ' m';
}
// 更新机组状态数据
function updateUnitStatus() {
const totalUnits = Object.values(windFarmData.unitStatus).reduce((a, b) => a + b, 0);
const gridPercent = Math.round((windFarmData.unitStatus.grid / totalUnits) * 100);
const maintenancePercent = Math.round((windFarmData.unitStatus.maintenance / totalUnits) * 100);
const faultPercent = Math.round((windFarmData.unitStatus.fault / totalUnits) * 100);
document.getElementById('gridConnected').textContent =
`${windFarmData.unitStatus.grid} 台 (${gridPercent}%)`;
document.getElementById('maintenance').textContent =
`${windFarmData.unitStatus.maintenance} 台 (${maintenancePercent}%)`;
document.getElementById('fault').textContent =
`${windFarmData.unitStatus.fault} 台 (${faultPercent}%)`;
}
// 更新预警统计数据
function updateAlertStats() {
document.getElementById('criticalAlerts').textContent = windFarmData.alertStats.critical;
document.getElementById('warningAlerts').textContent = windFarmData.alertStats.warning;
document.getElementById('normalAlerts').textContent = windFarmData.alertStats.normal;
}
// 更新预警列表
function updateAlertList() {
const alertList = document.getElementById('alertList');
alertList.innerHTML = '';
windFarmData.alerts.forEach(alert => {
const alertItem = document.createElement('div');
alertItem.className = `alert-item ${alert.type}`;
alertItem.innerHTML = `
<div class="alert-header">
<i class="fa fa-exclamation-${alert.type === 'critical' ? 'circle' : 'triangle'} alert-icon"></i>
<span class="alert-title">${alert.id} ${alert.title}</span>
<span class="alert-time">${alert.time}</span>
</div>
<div class="alert-content">
<p class="alert-desc">${alert.desc}</p>
<div class="alert-status">
<span class="status-tag ${alert.type}">${alert.status}</span>
</div>
</div>
`;
alertList.appendChild(alertItem);
});
}
// 模拟数据更新
function simulateDataUpdate() {
// 随机更新功率数据 (保持为整数)
windFarmData.currentPower = Math.max(150, Math.min(200,
windFarmData.currentPower + (Math.random() > 0.5 ? 1 : -1) * Math.floor(Math.random() * 5)
));
windFarmData.peakPower = Math.max(windFarmData.peakPower, windFarmData.currentPower);
windFarmData.avgPower = Math.max(140, Math.min(180,
windFarmData.avgPower + (Math.random() > 0.5 ? 1 : -1) * Math.floor(Math.random() * 3)
));
// 随机更新环境数据 (保留1位小数)
windFarmData.environment.windSpeed = Math.max(3, Math.min(15,
parseFloat((windFarmData.environment.windSpeed + (Math.random() - 0.5) * 0.5).toFixed(1))
));
windFarmData.environment.temperature = Math.max(10, Math.min(30,
windFarmData.environment.temperature + (Math.random() > 0.5 ? 1 : -1) * Math.floor(Math.random() * 2)
));
windFarmData.environment.waveHeight = Math.max(0.5, Math.min(3,
parseFloat((windFarmData.environment.waveHeight + (Math.random() - 0.5) * 0.2).toFixed(1))
));
// 随机更新今日发电量 (保持为整数)
windFarmData.todayPower = Math.max(3000, windFarmData.todayPower + Math.floor(Math.random() * 30));
// 随机更新预警数量 (保持为整数)
if (Math.random() > 0.95) {
windFarmData.alertStats.warning = Math.max(0, windFarmData.alertStats.warning + (Math.random() > 0.5 ? 1 : -1));
windFarmData.currentAlerts = windFarmData.alertStats.critical + windFarmData.alertStats.warning + windFarmData.alertStats.normal;
}
// 更新所有数据
updateKeyIndicators();
updatePowerData();
updateEnvironmentData();
updateUnitStatus();
updateAlertStats();
updateAlertList();
// 更新图表数据
updatePowerChart();
updateEfficiencyChart();
updateUnitStatusChart();
}
// 更新实时功率图表
function updatePowerChart() {
// 检查图表是否已初始化
if (powerChartInstance) {
// 移除第一个数据点,添加新数据点 (使用整数)
powerChartInstance.data.datasets[0].data.shift();
powerChartInstance.data.datasets[0].data.push(Math.round(windFarmData.currentPower));
// 更新时间标签
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
powerChartInstance.data.labels.shift();
powerChartInstance.data.labels.push(`${hours}:${minutes}`);
powerChartInstance.update();
}
}
// 更新效率图表
function updateEfficiencyChart() {
// 检查图表是否已初始化
if (efficiencyChartInstance) {
// 随机调整最后一个数据点 (使用整数)
const lastIndex = efficiencyChartInstance.data.datasets[0].data.length - 1;
const currentValue = efficiencyChartInstance.data.datasets[0].data[lastIndex];
const newValue = Math.max(75, Math.min(95, currentValue + (Math.random() > 0.5 ? 1 : -1) * Math.floor(Math.random() * 3)));
efficiencyChartInstance.data.datasets[0].data[lastIndex] = Math.round(newValue);
efficiencyChartInstance.update();
}
}
// 更新机组状态图表
function updateUnitStatusChart() {
// 检查图表是否已初始化
if (unitStatusChartInstance) {
unitStatusChartInstance.data.datasets[0].data = [
windFarmData.unitStatus.grid,
windFarmData.unitStatus.standby,
windFarmData.unitStatus.maintenance,
windFarmData.unitStatus.fault
];
unitStatusChartInstance.update();
}
}
// 初始化实时功率图表
function initRealtimePowerChart() {
const ctx = document.getElementById('realtimePowerChart').getContext('2d');
powerChartInstance = new Chart(ctx, {
type: 'line',
data: {
labels: ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
datasets: [{
label: '实时功率 (MW)',
data: [130, 145, 160, 170, 175, 180, 178],
borderColor: '#40a9ff',
backgroundColor: 'rgba(64, 169, 255, 0.1)',
borderWidth: 2,
pointRadius: 0,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
min: 120,
max: 190,
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
color: 'rgba(255, 255, 255, 0.1)'
}
},
x: {
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
display: false
}
}
}
}
});
}
// 初始化机组状态分布图表
function initUnitStatusChart() {
const ctx = document.getElementById('unitStatusChart').getContext('2d');
unitStatusChartInstance = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['并网', '待机', '维护', '故障'],
datasets: [{
data: [18, 0, 1, 1],
backgroundColor: [
'#00B42A',
'#86909C',
'#FF7D00',
'#F53F3F'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
labels: {
color: '#ffffff',
font: {
size: 10
}
}
}
},
cutout: '70%'
}
});
}
// 初始化小型效率分析图
function initEfficiencyChartMini() {
const ctx = document.getElementById('efficiencyChartMini').getContext('2d');
efficiencyChartInstance = new Chart(ctx, {
type: 'line',
data: {
labels: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'],
datasets: [{
label: '发电效率',
data: [82, 85, 88, 92, 90, 87, 85],
borderColor: '#40a9ff',
backgroundColor: 'rgba(64, 169, 255, 0.1)',
borderWidth: 2,
pointRadius: 0,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
min: 80,
max: 100,
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
color: 'rgba(255, 255, 255, 0.1)'
}
},
x: {
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
display: false
}
}
}
}
});
}
// 页面加载完成后初始化
document.addEventListener('DOMContentLoaded', function() {
// 初始化所有数据
updateKeyIndicators();
updatePowerData();
updateEnvironmentData();
updateUnitStatus();
updateAlertStats();
updateAlertList();
// 初始化所有图表
initRealtimePowerChart();
initUnitStatusChart();
initEfficiencyChartMini();
// 每5秒更新一次数据
setInterval(simulateDataUpdate, 2000);
});
</script>
<!-- <script>
// 初始化实时功率图表
function initRealtimePowerChart() {
const ctx = document.getElementById('realtimePowerChart').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels: ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
datasets: [{
label: '实时功率 (MW)',
data: [130, 145, 160, 170, 175, 180, 178],
borderColor: '#40a9ff',
backgroundColor: 'rgba(64, 169, 255, 0.1)',
borderWidth: 2,
pointRadius: 0,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
min: 120,
max: 190,
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
color: 'rgba(255, 255, 255, 0.1)'
}
},
x: {
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
display: false
}
}
}
}
});
}
// 初始化机组状态分布图表
function initUnitStatusChart() {
const ctx = document.getElementById('unitStatusChart').getContext('2d');
new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['并网', '待机', '维护', '故障'],
datasets: [{
data: [18, 0, 1, 1],
backgroundColor: [
'#00B42A',
'#86909C',
'#FF7D00',
'#F53F3F'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
labels: {
color: '#ffffff',
font: {
size: 10
}
}
}
},
cutout: '70%'
}
});
}
// 初始化小型效率分析图
function initEfficiencyChartMini() {
const ctx = document.getElementById('efficiencyChartMini').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00'],
datasets: [{
label: '发电效率',
data: [82, 85, 88, 92, 90, 87, 85],
borderColor: '#40a9ff',
backgroundColor: 'rgba(64, 169, 255, 0.1)',
borderWidth: 2,
pointRadius: 0,
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
min: 80,
max: 100,
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
color: 'rgba(255, 255, 255, 0.1)'
}
},
x: {
ticks: {
color: 'rgba(255, 255, 255, 0.7)',
font: {
size: 10
}
},
grid: {
display: false
}
}
}
}
});
}
// 页面加载后初始化所有图表
document.addEventListener('DOMContentLoaded', function () {
initRealtimePowerChart();
initUnitStatusChart();
initEfficiencyChartMini();
});
</script> -->
</body>
</html>