From f213e8153ce15c2cb06442d7caf0d0b725654f42 Mon Sep 17 00:00:00 2001 From: jiameng Date: Fri, 11 Sep 2026 17:26:27 +0800 Subject: [PATCH] =?UTF-8?q?3.1=E5=AE=A2=E6=88=B7=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=97=A5=E6=8A=A5:T-4~T-1=E8=A1=A8=E5=A4=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E6=97=A5=E6=9C=9F(=E5=8A=A8=E6=80=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 473b6af..d7bdd8d 100644 --- a/index.html +++ b/index.html @@ -104,18 +104,7 @@

3.1 客户分类日报

DoD=T-1−T-2,DoD%=T-1/T-2−1。波动原因可编辑(暂存本浏览器)。
-
- - - - - - - - - - -
客户分类iDSP个数base daily revenueT-4收入T-3收入T-2收入T-1收入DoDDoD%波动原因
+

3.2 客户明细 保留14天

@@ -358,6 +347,20 @@ function renderCustDaily(){ return (vavb?1:0)*dir; }); } + // 动态表头:用实际日期替代 T-4~T-1 + function dLbl(dt){ return dt? dt : '—'; } + var thead=document.querySelector('#tCustDaily thead'); + thead.innerHTML='' + +'客户分类' + +'iDSP个数' + +'base daily revenue' + +''+dLbl(t4)+'' + +''+dLbl(t3)+'' + +''+dLbl(t2)+'' + +''+dLbl(t1)+'' + +'DoD('+dLbl(t1)+'−'+dLbl(t2)+')' + +'DoD%' + +'波动原因'; var body=rows.map(function(r){ var dc=r.dod==null?'':(r.dod>=0?'pos':'neg'); return ''+r.cat+''+(r.idsp||'')+''+n2(r.base)+'' @@ -368,7 +371,14 @@ function renderCustDaily(){ +reasonCell('cust_daily', r.cat)+''; }).join(''); document.querySelector('#tCustDaily tbody').innerHTML=body; + // 表头动态生成后重新绑定排序点击 + 箭头 document.querySelectorAll('#tCustDaily th.cd-sort').forEach(function(th){ + th.style.cursor='pointer'; + th.onclick=function(){ + var k=th.getAttribute('data-k'), ty=th.getAttribute('data-ty'); + if(CD_SORT.k===k){ CD_SORT.dir=(CD_SORT.dir==='asc'?'desc':'asc'); } else { CD_SORT.k=k; CD_SORT.ty=ty; CD_SORT.dir='desc'; } + renderCustDaily(); + }; th.classList.remove('asc','desc'); if(th.getAttribute('data-k')===CD_SORT.k) th.classList.add(CD_SORT.dir); }); @@ -416,14 +426,7 @@ function renderCustDetail(){ // 3.1/3.2 表头排序绑定 function bindCustSort(){ - document.querySelectorAll('#tCustDaily th.cd-sort').forEach(function(th){ - th.style.cursor='pointer'; - th.onclick=function(){ - var k=th.getAttribute('data-k'), ty=th.getAttribute('data-ty'); - if(CD_SORT.k===k){ CD_SORT.dir=(CD_SORT.dir==='asc'?'desc':'asc'); } else { CD_SORT.k=k; CD_SORT.ty=ty; CD_SORT.dir='desc'; } - renderCustDaily(); - }; - }); + // 3.1 的表头排序绑定在 renderCustDaily 内部动态处理(表头是动态生成的) document.querySelectorAll('#tCustDetail th.de-sort').forEach(function(th){ th.style.cursor='pointer'; th.onclick=function(){