Report multi-selection

This commit is contained in:
Jiang Yio 2023-05-25 06:18:49 -04:00
parent baa8103167
commit f6408e0188

View File

@ -12,9 +12,8 @@
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<div class="btn-group">
<button v-for="report in reports" class="btn" :class="{ 'btn-primary': report.enabled, 'btn-outline-primary': !report.enabled }" @click="toggle(report)">{{report.name}}</button>
<button v-for="report in reports" class="btn" :class="{ 'btn-primary': report.enabled, 'btn-outline-primary': !report.enabled }" @click="enable(report)">{{report.name}}<input type="checkbox" class="form-check-input" :checked="report.enabled" @click.stop="report.enabled = !report.enabled" /></button>
</div>
<button class="btn" :class="{ 'btn-success': unify, 'btn-outline-success': !unify }" @click="unify = !unify">Unify</button>
<DateRangePicker range="Range" direction="-1" v-model:date="date_end" v-model:date_end="date_begin" />
</li>
</ul>
@ -56,6 +55,12 @@
top: 3.65rem;
z-index: 2;
}
div.filter input.form-check-input {
position: absolute;
top: 0;
right: 0;
margin-top: 0;
}
div.selector {
position: sticky;
top: 1.15rem;
@ -423,7 +428,6 @@
date_next: null,
query: '',
x_query: '',
unify: false,
reports: create_reports(),
loaders: {},
resultsets: {},
@ -476,10 +480,8 @@
timestring(date) {
return date.toLocaleTimeString('en-GB').substring(0, 5);
},
toggle(report) {
if(report.enabled) report.enabled = false;
else if(this.unify) report.enabled = true;
else {
enable(report) {
if(!report.enabled) {
var reports = this.reports;
for(var i = reports.length - 1; i >= 0; --i) reports[i].enabled = false;
report.enabled = true;