diff --git a/index.html b/index.html
index fdc2472..554217e 100644
--- a/index.html
+++ b/index.html
@@ -156,6 +156,10 @@
+
+
+
+
@@ -359,7 +363,8 @@
fillSelect('perfChannel', [...new Set(perfData.map(d => d.channel))].sort());
fillSelect('perfProduct', [...new Set(perfData.map(d => d.product))].sort());
fillSelect('perfCountry', [...new Set(perfData.map(d => d.location))].filter(x=>x&&x!=='0').sort());
- ['perfChannel','perfProduct','perfCountry','perfRange'].forEach(id =>
+ fillSelect('perfDay', [...new Set(perfData.map(d => d.date))].sort().reverse());
+ ['perfChannel','perfProduct','perfCountry','perfRange','perfDay'].forEach(id =>
document.getElementById(id).addEventListener('change', drawPerf));
drawPerf();
}
@@ -370,10 +375,14 @@
const pr = document.getElementById('perfProduct').value;
const co = document.getElementById('perfCountry').value;
const rg = document.getElementById('perfRange').value;
+ const day = document.getElementById('perfDay').value;
if (ch !== 'all') d = d.filter(x => x.channel === ch);
if (pr !== 'all') d = d.filter(x => x.product === pr);
if (co !== 'all') d = d.filter(x => x.location === co);
- if (rg !== 'all') {
+ // 选了具体某天则优先按天过滤(覆盖时间范围);否则用时间范围
+ if (day !== 'all') {
+ d = d.filter(x => x.date === day);
+ } else if (rg !== 'all') {
const allDates = [...new Set(perfData.map(x => x.date))].sort();
const cut = allDates[Math.max(0, allDates.length - parseInt(rg))];
d = d.filter(x => x.date >= cut);