2018-08-17 22:19:25 +08:00
|
|
|
<table class="table">
|
2018-07-20 02:33:11 +08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.model.computedLabels}}
|
|
|
|
{{#each this.model.computedLabels as |label|}}
|
|
|
|
<AdminReportTableHeader
|
|
|
|
@showSortingUI={{this.showSortingUI}}
|
|
|
|
@currentSortDirection={{this.sortDirection}}
|
|
|
|
@currentSortLabel={{this.sortLabel}}
|
|
|
|
@label={{label}}
|
|
|
|
@sortByLabel={{action "sortByLabel" label}}
|
|
|
|
/>
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.model.data as |data|}}
|
2018-07-20 02:33:11 +08:00
|
|
|
<th>{{data.x}}</th>
|
|
|
|
{{/each}}
|
|
|
|
{{/if}}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.paginatedData as |data|}}
|
|
|
|
<AdminReportTableRow
|
|
|
|
@data={{data}}
|
|
|
|
@labels={{this.model.computedLabels}}
|
|
|
|
@options={{this.options}}
|
|
|
|
/>
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.showTotalForSample}}
|
2018-08-01 05:35:13 +08:00
|
|
|
<tr class="total-row">
|
2022-07-06 01:41:31 +08:00
|
|
|
<td colspan={{this.totalsForSample.length}}>
|
2018-08-01 05:35:13 +08:00
|
|
|
{{i18n "admin.dashboard.reports.totals_for_sample"}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="admin-report-table-row">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.totalsForSample as |total|}}
|
2018-08-17 22:19:25 +08:00
|
|
|
<td class="admin-report-table-cell {{total.type}} {{total.property}}">
|
2022-06-21 02:02:05 +08:00
|
|
|
{{total.formattedValue}}
|
2018-08-01 05:35:13 +08:00
|
|
|
</td>
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
</tr>
|
2018-08-01 05:35:13 +08:00
|
|
|
{{/if}}
|
2018-07-20 02:33:11 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.showTotal}}
|
2018-08-01 05:35:13 +08:00
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
|
|
|
{{i18n "admin.dashboard.reports.total"}}
|
|
|
|
</td>
|
2018-07-20 02:33:11 +08:00
|
|
|
</tr>
|
2018-08-01 05:35:13 +08:00
|
|
|
<tr class="admin-report-table-row">
|
2018-08-17 22:19:25 +08:00
|
|
|
<td class="admin-report-table-cell date x">—</td>
|
2022-07-06 01:41:31 +08:00
|
|
|
<td class="admin-report-table-cell number y">{{number
|
|
|
|
this.model.total
|
|
|
|
}}</td>
|
2018-08-01 05:35:13 +08:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2019-06-04 17:08:26 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.showAverage}}
|
2019-06-04 17:08:26 +08:00
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
2019-06-04 17:22:44 +08:00
|
|
|
{{i18n "admin.dashboard.reports.average_for_sample"}}
|
2019-06-04 17:08:26 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="admin-report-table-row">
|
|
|
|
<td class="admin-report-table-cell date x">—</td>
|
2022-07-06 01:41:31 +08:00
|
|
|
<td class="admin-report-table-cell number y">{{number
|
|
|
|
this.averageForSample
|
|
|
|
}}</td>
|
2019-06-04 17:08:26 +08:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2018-08-01 05:35:13 +08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-07-20 02:33:11 +08:00
|
|
|
|
|
|
|
<div class="pagination">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.pages as |pageState|}}
|
2022-06-30 18:30:50 +08:00
|
|
|
<DButton
|
|
|
|
@translatedLabel={{pageState.page}}
|
|
|
|
@action={{action "changePage"}}
|
|
|
|
@actionParam={{pageState.index}}
|
|
|
|
@class={{pageState.class}}
|
|
|
|
/>
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
</div>
|