fix(reports): 筛选条常驻避免自定义时间范围死锁
This commit is contained in:
@@ -109,6 +109,20 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
筛选条必须在数据闸门之外常驻:它既是唯一能改筛选条件的入口,也是「自定义时间范围」
|
||||
填日期的入口。放进 `v-else`(有数据才渲染)会死锁 —— 选「自定义…」时起止为空 ⇒
|
||||
无统计窗口 ⇒ 不发请求 ⇒ dataset 为空 ⇒ 筛选条被卸载 ⇒ 永远填不上日期,只能刷新页面。
|
||||
常驻后顺带解决两个问题:重查期间筛选条不再闪隐;后端返回空或报错时仍能改条件重试。
|
||||
-->
|
||||
<ReportFilterBar
|
||||
:campuses="campusOptions"
|
||||
:departments="departmentOptions"
|
||||
:categories="categoryOptions"
|
||||
:can-export="canExport"
|
||||
@export="exportVisible = true"
|
||||
/>
|
||||
|
||||
<template v-if="loading && !available">
|
||||
<div class="report-state">正在读取报表数据…</div>
|
||||
</template>
|
||||
@@ -126,30 +140,19 @@ watch(
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<ReportFilterBar
|
||||
:campuses="campusOptions"
|
||||
:departments="departmentOptions"
|
||||
:categories="categoryOptions"
|
||||
:can-export="canExport"
|
||||
@export="exportVisible = true"
|
||||
/>
|
||||
|
||||
<p v-if="customRangeIncomplete" class="report-warn">
|
||||
自定义时间范围只填了一头,当前<b>未按时间过滤</b>;补齐起止日期后统计窗口才会生效。
|
||||
</p>
|
||||
|
||||
<slot />
|
||||
|
||||
<ReportExportDialog
|
||||
v-if="canExport"
|
||||
:visible="exportVisible"
|
||||
:filter="reportFilter"
|
||||
:campuses="campusOptions"
|
||||
:departments="allDepartmentOptions"
|
||||
:categories="categoryOptions"
|
||||
@close="exportVisible = false"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<!-- 导出弹窗独立于数据加载状态:筛选条常驻,它上面的「导出」按钮就必须一直可用 -->
|
||||
<ReportExportDialog
|
||||
v-if="canExport"
|
||||
:visible="exportVisible"
|
||||
:filter="reportFilter"
|
||||
:campuses="campusOptions"
|
||||
:departments="allDepartmentOptions"
|
||||
:categories="categoryOptions"
|
||||
@close="exportVisible = false"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -233,20 +236,6 @@ watch(
|
||||
color: var(--err);
|
||||
}
|
||||
|
||||
.report-warn {
|
||||
padding: 9px 14px;
|
||||
margin: 0 0 14px;
|
||||
color: var(--warn);
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
background: var(--warn-l);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.report-warn b {
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
@media (max-width: 680px) {
|
||||
.page-intro {
|
||||
align-items: flex-start;
|
||||
|
||||
Reference in New Issue
Block a user