feat: integrate 3 order tables, split agency vs self-invest channels

This commit is contained in:
王源
2026-09-07 12:41:59 +08:00
parent d1957bfa33
commit f14a200a4c
2 changed files with 23 additions and 18 deletions
+11 -6
View File
@@ -418,7 +418,8 @@
<th>日预算</th>
<th>状态</th>
<th>MMP</th>
<th>已铺投放渠道</th>
<th>代投渠道</th>
<th>平台自投渠道</th>
<th>数据来源</th>
</tr>
</thead>
@@ -482,7 +483,10 @@
const active = orderData.filter(o => o.status === 'Active').length;
const products = new Set(orderData.map(o => o.product)).size;
const allChannels = new Set();
orderData.forEach(o => (o.channels || []).forEach(c => allChannels.add(c)));
orderData.forEach(o => {
(o.agency_channels || []).forEach(c => allChannels.add(c));
(o.self_channels || []).forEach(c => allChannels.add(c));
});
document.getElementById('orderStats').innerHTML = `
<div class="summary-card">
@@ -509,11 +513,11 @@
// Table
const tbody = document.querySelector('#orderTable tbody');
const chipList = (arr) => (arr && arr.length)
? arr.map(c => `<span class="channel-chip">${c}</span>`).join('')
: '<span class="no-channel">—</span>';
tbody.innerHTML = orderData.map(o => {
const statusClass = o.status === 'Active' ? 'status-active' : 'status-pause';
const channels = (o.channels && o.channels.length)
? o.channels.map(c => `<span class="channel-chip">${c}</span>`).join('')
: '<span class="no-channel">—</span>';
return `
<tr>
<td style="font-weight:600">${o.product}</td>
@@ -525,7 +529,8 @@
<td class="num-cell">${o.budget}</td>
<td><span class="status-badge ${statusClass}">${o.status}</span></td>
<td>${o.mmp}</td>
<td style="max-width:260px;white-space:normal">${channels}</td>
<td style="max-width:220px;white-space:normal">${chipList(o.agency_channels)}</td>
<td style="max-width:180px;white-space:normal">${chipList(o.self_channels)}</td>
<td style="font-size:11px;color:#94a3b8">${o.source}</td>
</tr>
`;