parent
eed9678abe
commit
8cbd56a4cb
@ -34,14 +34,7 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="quick-ranges" role="group" aria-label="快捷时间范围">
|
||||
<button
|
||||
v-for="range in quickRanges"
|
||||
:key="range.key"
|
||||
type="button"
|
||||
:class="{ 'is-active': isQuickRangeActive(range) }"
|
||||
@click="setQuickRange(range)"
|
||||
>{{ range.label }}</button>
|
||||
<div class="filter-status">
|
||||
<div class="filter-state">
|
||||
<span v-if="dateError" class="filter-error" role="alert">{{ dateError }}</span>
|
||||
<span v-else-if="filtersDirty" class="filter-dirty" role="status">条件已修改,点击查询后生效</span>
|
||||
@ -357,27 +350,6 @@ export default {
|
||||
endDateConfig() {
|
||||
return { ...dateConfig, minDate: this.dateRange.start || null };
|
||||
},
|
||||
quickRanges() {
|
||||
const end = this.report.available_dates.end || this.queryRange.end;
|
||||
const anchor = this.parseDate(end);
|
||||
const previousMonth = new Date(anchor.getFullYear(), anchor.getMonth() - 1, 1);
|
||||
const previousEnd = new Date(anchor.getFullYear(), anchor.getMonth(), 0);
|
||||
const sevenStart = new Date(anchor);
|
||||
sevenStart.setDate(anchor.getDate() - 6);
|
||||
|
||||
return [
|
||||
{ key: '7d', label: '近 7 天', start: this.formatDate(sevenStart), end: this.formatDate(anchor) },
|
||||
{ key: '30d', label: '近 30 天', start: this.formatDate(new Date(anchor.getFullYear(), anchor.getMonth(), 1)), end: this.formatDate(anchor) },
|
||||
{ key: 'current', label: '本月', start: this.formatDate(new Date(anchor.getFullYear(), anchor.getMonth(), 1)), end: this.formatDate(anchor) },
|
||||
{ key: 'last', label: '上月', start: this.formatDate(previousMonth), end: this.formatDate(previousEnd) },
|
||||
{
|
||||
key: 'all',
|
||||
label: '全部',
|
||||
start: this.report.available_dates.start || this.formatDate(new Date(anchor.getFullYear(), anchor.getMonth() - 1, 1)),
|
||||
end: this.formatDate(anchor),
|
||||
},
|
||||
];
|
||||
},
|
||||
financialSummary() {
|
||||
return this.report.financial.summary || emptyReport().financial.summary;
|
||||
},
|
||||
@ -642,12 +614,6 @@ export default {
|
||||
pending: { label: '待核查', className: 'is-pending' },
|
||||
}[status] || { label: '待核查', className: 'is-pending' };
|
||||
},
|
||||
setQuickRange(range) {
|
||||
this.dateRange = { start: range.start, end: range.end };
|
||||
},
|
||||
isQuickRangeActive(range) {
|
||||
return range.start === this.dateRange.start && range.end === this.dateRange.end;
|
||||
},
|
||||
applyTimeRange() {
|
||||
if (!this.canQuery) return;
|
||||
this.queryRange = { ...this.dateRange };
|
||||
@ -1064,27 +1030,11 @@ export default {
|
||||
background: #fff;
|
||||
color: var(--ink);
|
||||
}
|
||||
.quick-ranges {
|
||||
.filter-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.quick-ranges button {
|
||||
min-height: 28px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
color: var(--muted);
|
||||
font: 600 11px/1 inherit;
|
||||
}
|
||||
.quick-ranges button.is-active {
|
||||
border-color: var(--gold-light);
|
||||
background: var(--gold-soft);
|
||||
color: var(--gold);
|
||||
}
|
||||
.filter-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -50,6 +50,8 @@ class PeriodBalanceReconciliationTest extends TestCase
|
||||
$this->assertStringContainsString('200', $component);
|
||||
$this->assertStringContainsString('条件已修改,点击查询后生效', $component);
|
||||
$this->assertStringContainsString('当前数据:{{ dataPeriodLabel }}', $component);
|
||||
$this->assertStringNotContainsString('快捷时间范围', $component);
|
||||
$this->assertStringNotContainsString("label: '近 7 天'", $component);
|
||||
$this->assertStringContainsString('金额异常', $component);
|
||||
$this->assertStringContainsString('取数日期待核查', $component);
|
||||
$this->assertStringContainsString('聚水潭未匹配', $component);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user