|
@@ -411,6 +411,9 @@
|
|
|
const warn = quality && quality.length
|
|
const warn = quality && quality.length
|
|
|
? `<span class="ops-warn" title="${esc('解析标记:' + quality.join('、'))}">⚠</span>`
|
|
? `<span class="ops-warn" title="${esc('解析标记:' + quality.join('、'))}">⚠</span>`
|
|
|
: '';
|
|
: '';
|
|
|
|
|
+ if (field.type === 'text') {
|
|
|
|
|
+ return `<td class="ops-text-cell${value == null ? ' ops-null' : ''}">${fmtValue(value, field.type)}${warn}</td>`;
|
|
|
|
|
+ }
|
|
|
return `<td class="ops-num${value == null ? ' ops-null' : ''}">${fmtValue(value, field.type)}${warn}</td>`;
|
|
return `<td class="ops-num${value == null ? ' ops-null' : ''}">${fmtValue(value, field.type)}${warn}</td>`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -459,7 +462,7 @@
|
|
|
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" 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('')}
|
|
|
</tr>`;
|
|
</tr>`;
|
|
|
|
|
|
|
|
const body = data.groups.map((group, groupIdx) => {
|
|
const body = data.groups.map((group, groupIdx) => {
|
|
@@ -484,7 +487,7 @@
|
|
|
<td class="ops-subtotal-label" colspan="2">${esc(group.school)} · 小计 · ${shortDate(date)}</td>
|
|
<td class="ops-subtotal-label" colspan="2">${esc(group.school)} · 小计 · ${shortDate(date)}</td>
|
|
|
${fields.map((f) => {
|
|
${fields.map((f) => {
|
|
|
const v = subtotalValue(group, f, date);
|
|
const v = subtotalValue(group, f, date);
|
|
|
- return `<td class="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('')}
|
|
|
</tr>`).join('');
|
|
</tr>`).join('');
|
|
|
|
|
|