|
|
@@ -457,12 +457,13 @@
|
|
|
const fields = activeFields(data);
|
|
|
if (!fields.length) return '<div class="empty-hint"><p>请至少选择一个字段</p></div>';
|
|
|
const dates = data.dates || [];
|
|
|
- const colCount = fields.length + 2;
|
|
|
+ const colCount = fields.length + 3;
|
|
|
|
|
|
const head = `<tr>
|
|
|
<th class="ops-shop-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('')}
|
|
|
+ <th class="ops-filler-col"></th>
|
|
|
</tr>`;
|
|
|
|
|
|
const body = data.groups.map((group, groupIdx) => {
|
|
|
@@ -474,11 +475,12 @@
|
|
|
const blockKey = `b${groupIdx}-${shopIdx}`;
|
|
|
const alt = shopIdx % 2 === 1 ? ' ops-block-alt' : '';
|
|
|
return useDates.map((date, i) => `<tr data-block="${blockKey}" class="ops-shop-row${i === 0 ? ' ops-block-start' : ''}${alt}">
|
|
|
- ${i === 0 ? `<td class="ops-shop-cell" rowspan="${useDates.length}" title="${esc(shop.shopName)}">${esc(shop.shopName)}${
|
|
|
+ ${i === 0 ? `<td class="ops-shop-cell" rowspan="${useDates.length}" title="${esc(shop.shopName)}"><span class="ops-shop-name">${esc(shop.shopName)}</span>${
|
|
|
shop.status && shop.status !== '已上线' ? `<span class="badge badge-muted ops-status">${esc(shop.status)}</span>` : ''
|
|
|
}</td>` : ''}
|
|
|
<td class="ops-date-cell">${shortDate(date)}</td>
|
|
|
${fields.map((f) => metricCell(shop, f, date)).join('')}
|
|
|
+ <td class="ops-filler"></td>
|
|
|
</tr>`).join('');
|
|
|
}).join('');
|
|
|
|
|
|
@@ -489,6 +491,7 @@
|
|
|
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>`;
|
|
|
}).join('')}
|
|
|
+ <td class="ops-filler ops-subtotal"></td>
|
|
|
</tr>`).join('');
|
|
|
|
|
|
return schoolRow + shopRows + subtotalRows;
|