|
@@ -457,13 +457,12 @@
|
|
|
const fields = activeFields(data);
|
|
const fields = activeFields(data);
|
|
|
if (!fields.length) return '<div class="empty-hint"><p>请至少选择一个字段</p></div>';
|
|
if (!fields.length) return '<div class="empty-hint"><p>请至少选择一个字段</p></div>';
|
|
|
const dates = data.dates || [];
|
|
const dates = data.dates || [];
|
|
|
- const colCount = fields.length + 3;
|
|
|
|
|
|
|
+ const colCount = fields.length + 2;
|
|
|
|
|
|
|
|
const head = `<tr>
|
|
const head = `<tr>
|
|
|
<th class="ops-shop-col">店铺</th>
|
|
<th class="ops-shop-col">店铺</th>
|
|
|
<th class="ops-date-col">日期</th>
|
|
<th class="ops-date-col">日期</th>
|
|
|
${fields.map((f) => `<th class="ops-metric-col ${f.type === 'text' ? 'ops-col-text' : 'ops-col-num'}" title="${esc(f.label)}">${esc(f.label)}</th>`).join('')}
|
|
${fields.map((f) => `<th class="ops-metric-col ${f.type === 'text' ? 'ops-col-text' : 'ops-col-num'}" title="${esc(f.label)}">${esc(f.label)}</th>`).join('')}
|
|
|
- <th class="ops-filler-col"></th>
|
|
|
|
|
</tr>`;
|
|
</tr>`;
|
|
|
|
|
|
|
|
const body = data.groups.map((group, groupIdx) => {
|
|
const body = data.groups.map((group, groupIdx) => {
|
|
@@ -480,7 +479,6 @@
|
|
|
}</td>` : ''}
|
|
}</td>` : ''}
|
|
|
<td class="ops-date-cell">${shortDate(date)}</td>
|
|
<td class="ops-date-cell">${shortDate(date)}</td>
|
|
|
${fields.map((f) => metricCell(shop, f, date)).join('')}
|
|
${fields.map((f) => metricCell(shop, f, date)).join('')}
|
|
|
- <td class="ops-filler"></td>
|
|
|
|
|
</tr>`).join('');
|
|
</tr>`).join('');
|
|
|
}).join('');
|
|
}).join('');
|
|
|
|
|
|
|
@@ -491,7 +489,6 @@
|
|
|
const v = subtotalValue(group, f, date);
|
|
const v = subtotalValue(group, f, date);
|
|
|
return `<td class="${f.type === 'text' ? 'ops-text-cell' : 'ops-num'} ops-subtotal">${v == null ? '–' : fmtValue(v, f.type)}</td>`;
|
|
return `<td class="${f.type === 'text' ? 'ops-text-cell' : 'ops-num'} ops-subtotal">${v == null ? '–' : fmtValue(v, f.type)}</td>`;
|
|
|
}).join('')}
|
|
}).join('')}
|
|
|
- <td class="ops-filler ops-subtotal"></td>
|
|
|
|
|
</tr>`).join('');
|
|
</tr>`).join('');
|
|
|
|
|
|
|
|
return schoolRow + shopRows + subtotalRows;
|
|
return schoolRow + shopRows + subtotalRows;
|
|
@@ -501,7 +498,7 @@
|
|
|
return `<section class="ops-block">
|
|
return `<section class="ops-block">
|
|
|
<div class="ops-block-head"><h2>运营明细</h2><span>${shopCount} 家门店 · ${dates.length} 天 · ${fields.length} 个字段</span></div>
|
|
<div class="ops-block-head"><h2>运营明细</h2><span>${shopCount} 家门店 · ${dates.length} 天 · ${fields.length} 个字段</span></div>
|
|
|
<div class="ops-table-wrap">
|
|
<div class="ops-table-wrap">
|
|
|
- <table class="ops-table ops-table-wide">
|
|
|
|
|
|
|
+ <table class="ops-table ops-table-wide" style="min-width: ${240 + 72 + fields.length * 104}px">
|
|
|
<thead>${head}</thead>
|
|
<thead>${head}</thead>
|
|
|
<tbody>${body}</tbody>
|
|
<tbody>${body}</tbody>
|
|
|
</table>
|
|
</table>
|