diff --git a/index.html b/index.html index 201425c..62ae561 100644 --- a/index.html +++ b/index.html @@ -550,7 +550,7 @@ function renderMatrix() { // 列 = 产品(按 pkg 区分,同名产品用地区区分显示);行 = 渠道 - // 每个订单条目是一列 + // 每个订单条目是一列,代投+自投渠道合并 const cols = orderData.map(o => ({ key: o.pkg, label: o.product, @@ -559,15 +559,13 @@ channels: new Set([...(o.agency_channels||[]), ...(o.self_channels||[])]) })); - // 收集所有渠道,分代投 / 自投两组 - const agencySet = new Set(); - const selfSet = new Set(); + // 收集所有渠道(代投+自投合并去重,保持出现顺序) + const channels = []; orderData.forEach(o => { - (o.agency_channels||[]).forEach(c => agencySet.add(c)); - (o.self_channels||[]).forEach(c => selfSet.add(c)); + [...(o.agency_channels||[]), ...(o.self_channels||[])].forEach(c => { + if (!channels.includes(c)) channels.push(c); + }); }); - const agencyChannels = [...agencySet]; - const selfChannels = [...selfSet]; // 表头 const thead = document.querySelector('#matrixTable thead'); @@ -588,22 +586,13 @@ return `