筛选优化

This commit is contained in:
biss committed 2026-08-14 19:35:08 +08:00
1 parent ccdfe977ba
commit 0ce758191e
7 files changed
+119 -6

No files matched your search

+14 -2
View File
@@ -136,6 +136,15 @@ async function loadClasses(reset = false) {
}
}
function resetFilters() {
termId.value = defaultAcademicTermId(terms.value)
collegeId.value = undefined
keyword.value = ''
teacherKeyword.value = ''
riskOnly.value = false
loadClasses(true)
}
async function loadReport(item = selected.value) {
if (!item) return
selected.value = item
@@ -428,6 +437,7 @@ onBeforeUnmount(() => {
<el-input v-model="teacherKeyword" clearable placeholder="任课教师姓名或工号" :prefix-icon="Search" @keyup.enter="loadClasses(true)" @clear="loadClasses(true)" />
<el-checkbox v-model="riskOnly" @change="loadClasses(true)">仅看预警班</el-checkbox>
<el-button type="primary" @click="loadClasses(true)">查询</el-button>
<el-button :icon="Refresh" @click="resetFilters">重置</el-button>
</section>
<section class="analytics-shell">
@@ -521,7 +531,9 @@ onBeforeUnmount(() => {
<style scoped>
.grade-analytics { --ink: #18324f; --blue: #204f87; --line: #dce3ec; }
.analytics-intro { align-items: flex-end; }
.filter-bar { display: grid; grid-template-columns: 240px minmax(260px, 560px) auto; gap: 12px; align-items: center; padding: 16px 18px; background: #f7f9fc; border: 1px solid var(--line); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 18px; background: #f7f9fc; border: 1px solid var(--line); }
.filter-bar > :deep(.el-input) { width: min(100%, 280px); }
.filter-bar > :deep(.el-checkbox) { margin-right: 4px; }
.analytics-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 18px; align-items: start; }
.class-rail { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; background: #f6f8fb; border: 1px solid var(--line); }
.class-rail > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 8px; padding: 15px 16px; background: #eef2f7; border-bottom: 1px solid var(--line); }
@@ -575,7 +587,7 @@ onBeforeUnmount(() => {
.chart-card-wide { grid-column: auto; }
}
@media (max-width: 820px) {
.filter-bar { grid-template-columns: 1fr; }
.filter-bar { display: grid; grid-template-columns: 1fr; }
.filter-bar :deep(.el-select) { width: 100% !important; }
.analytics-shell { grid-template-columns: 1fr; }
.class-rail { position: static; max-height: 390px; }
+18 -1
View File
@@ -36,6 +36,8 @@ const returnDialog = ref(false)
const termId = ref<string | undefined>()
const status = ref<string | undefined>()
const taskKeyword = ref('')
const teacherKeyword = ref('')
const classKeyword = ref('')
const taskPage = ref(1)
const taskPageSize = 12
const taskTotal = ref(0)
@@ -149,6 +151,8 @@ async function load(resetPage = false) {
academicTermId: termId.value,
status: status.value,
keyword: taskKeyword.value.trim() || undefined,
teacherKeyword: teacherKeyword.value.trim() || undefined,
classKeyword: classKeyword.value.trim() || undefined,
page: taskPage.value,
pageSize: taskPageSize,
},
@@ -212,6 +216,15 @@ async function changeTaskPage(page: number) {
await load()
}
function resetTaskFilters() {
taskKeyword.value = ''
teacherKeyword.value = ''
classKeyword.value = ''
status.value = undefined
termId.value = defaultAcademicTermId(terms.value)
load(true)
}
async function searchRecords() {
recordPage.value = 1
await loadDetail()
@@ -522,7 +535,10 @@ onMounted(async () => {
<el-select v-model="status" clearable placeholder="全部状态" @change="load(true)">
<el-option v-for="(label, value) in statusLabels" :key="value" :label="label" :value="value" />
</el-select>
<el-input v-model="teacherKeyword" clearable :prefix-icon="Search" placeholder="任课教师姓名或工号" @keyup.enter="load(true)" @clear="load(true)" />
<el-input v-model="classKeyword" clearable :prefix-icon="Search" placeholder="行政班、专业或班级代码" @keyup.enter="load(true)" @clear="load(true)" />
<el-button :icon="Search" @click="load(true)">查询</el-button>
<el-button :icon="Refresh" @click="resetTaskFilters">重置</el-button>
<span>共 {{ taskTotal }} 个可管理教学班</span>
</section>
@@ -880,7 +896,8 @@ onMounted(async () => {
.experiment-import .el-select { width: 165px; }
.item-score-readonly { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.item-score-readonly small { margin-top: 3px; color: #2d8975; font-size: 10px; font-weight: 650; }
.grade-toolbar > .el-input { width: min(320px, 100%); }
.grade-toolbar { flex-wrap: wrap; }
.grade-toolbar > .el-input { width: min(260px, 100%); }
.grade-task-pagination { justify-content: center; padding: 14px 8px; border-top: 1px solid var(--line); }
.grade-record-toolbar {
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
+25
View File
@@ -54,6 +54,7 @@ const now = ref(Date.now())
const fileInput = ref<HTMLInputElement>()
const termId = ref<string>()
const taskKeyword = ref('')
const taskClassKeyword = ref('')
const taskPage = ref(1)
const taskPageSize = 12
const taskTotal = ref(0)
@@ -126,6 +127,7 @@ async function loadTasks(resetPage = false) {
params: {
academicTermId: termId.value || undefined,
keyword: taskKeyword.value.trim() || undefined,
classKeyword: taskClassKeyword.value.trim() || undefined,
page: taskPage.value,
pageSize: taskPageSize,
},
@@ -164,6 +166,20 @@ async function selectTask(task: any) {
if (activeMode.value === 'statistics') await loadStatistics()
}
function resetTaskFilters() {
taskKeyword.value = ''
taskClassKeyword.value = ''
termId.value = defaultAcademicTermId(terms.value)
loadTasks(true)
}
function resetSheetFilters() {
sheetKeyword.value = ''
sheetStatus.value = undefined
sheetMethod.value = undefined
loadSheets(true)
}
async function loadSheets(resetPage = false) {
if (!selectedTask.value) return
try {
@@ -737,7 +753,15 @@ onUnmounted(() => {
<el-select v-model="termId" clearable placeholder="全部学期" @change="loadTasks(true)">
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
</el-select>
<el-input
v-model="taskClassKeyword"
clearable
placeholder="行政班、专业或班级代码"
@keyup.enter="loadTasks(true)"
@clear="loadTasks(true)"
/>
<el-button :icon="Search" @click="loadTasks(true)">查询</el-button>
<el-button :icon="Refresh" @click="resetTaskFilters">重置</el-button>
<span>共 {{ taskTotal }} 个教学班</span>
<el-radio-group v-model="activeMode" class="mode-switch" size="small">
<el-radio-button value="rollcall">点名记录</el-radio-button>
@@ -806,6 +830,7 @@ onUnmounted(() => {
<el-option label="定位签到" value="Location" />
</el-select>
<el-button :icon="Search" @click="loadSheets(true)">筛选</el-button>
<el-button :icon="Refresh" @click="resetSheetFilters">重置</el-button>
</div>
<div class="attendance-sheet-list">
<button
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff. Show more