feat: 新增3h预报
This commit is contained in:
parent
701292c54b
commit
3799b9fac8
@ -123,9 +123,9 @@ const WeatherChart = {
|
||||
if (forecastData.length > 0) {
|
||||
// 雨量 仅显示 -1h/-2h/-3h
|
||||
datasets.push(
|
||||
{ label: '雨量 (mm) - 预报 (-1h)', data: forecastRainfallsH1, type: 'bar', backgroundColor: 'rgba(255, 99, 71, 0.55)', borderColor: 'rgb(255, 99, 71)', yAxisID: 'y-rainfall' },
|
||||
{ label: '雨量 (mm) - 预报 (-2h)', data: forecastRainfallsH2, type: 'bar', backgroundColor: 'rgba(255, 205, 86, 0.55)', borderColor: 'rgb(255, 205, 86)', yAxisID: 'y-rainfall' },
|
||||
{ label: '雨量 (mm) - 预报 (-3h)', data: forecastRainfallsH3, type: 'bar', backgroundColor: 'rgba(76, 175, 80, 0.55)', borderColor: 'rgb(76, 175, 80)', yAxisID: 'y-rainfall' }
|
||||
{ label: '雨量 (mm) - 预报 (+1h)', data: forecastRainfallsH1, type: 'bar', backgroundColor: 'rgba(255, 99, 71, 0.55)', borderColor: 'rgb(255, 99, 71)', yAxisID: 'y-rainfall' },
|
||||
{ label: '雨量 (mm) - 预报 (+2h)', data: forecastRainfallsH2, type: 'bar', backgroundColor: 'rgba(255, 205, 86, 0.55)', borderColor: 'rgb(255, 205, 86)', yAxisID: 'y-rainfall' },
|
||||
{ label: '雨量 (mm) - 预报 (+3h)', data: forecastRainfallsH3, type: 'bar', backgroundColor: 'rgba(76, 175, 80, 0.55)', borderColor: 'rgb(76, 175, 80)', yAxisID: 'y-rainfall' }
|
||||
);
|
||||
|
||||
// 温度 取最接近的预报(0h>1h>2h>3h)
|
||||
|
||||
@ -77,7 +77,7 @@ const WeatherTable = {
|
||||
|
||||
const issuedBadge = (() => {
|
||||
if (item.source !== '预报') return '';
|
||||
const lead = (typeof item.lead_hours === 'number' && item.lead_hours >= 0) ? ` -${item.lead_hours}h` : '';
|
||||
const lead = (typeof item.lead_hours === 'number' && item.lead_hours >= 0) ? ` +${item.lead_hours}h` : '';
|
||||
const issued = item.issued_at ? new Date(item.issued_at.replace(' ', 'T')) : null;
|
||||
const issuedStr = issued ? `${String(issued.getHours()).padStart(2,'0')}:${String(issued.getMinutes()).padStart(2,'0')}` : '-';
|
||||
return `<span style="font-size: 12px; color: #6b7280;">(发布: ${issuedStr}${lead})</span>`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user