教研室管理

This commit is contained in:
2026-08-27 10:42:49 +08:00
parent 90e03e1faf
commit ffdcfaa350
2 changed files with 14 additions and 25 deletions
+4 -5
View File
@@ -48,11 +48,10 @@ export function getSyllabus(bh) {
})
}
// 列表查询(支持 zydh、ty 及分页参数
export function listSyllabus(query) {
// 列表查询(返回全部,前端本地过滤+分页
export function listSyllabus() {
return request({
url: '/zyjxjhb/listByZydhAndTy',
method: 'get',
params: query
url: '/zyjxjhb/list',
method: 'get'
})
}
@@ -393,26 +393,16 @@ export default {
/* ---------- 列表加载 ---------- */
fetchList() {
this.loading = true
const query = {
pageNum: this.pageNum,
pageSize: this.pageSize,
ty: this.searchForm.ty
}
if (this.searchForm.zydh) {
query.zydh = this.searchForm.zydh
}
listSyllabus(query).then(response => {
const data = response.data
if (Array.isArray(data)) {
this.tableData = data
this.total = data.length
listSyllabus().then(response => {
const data = response.data || []
const list = Array.isArray(data) ? data : (data.records || [])
this.tableData = list.filter(row => {
const matchZydh = !this.searchForm.zydh || row.zydh === this.searchForm.zydh
const matchTy = String(row.ty) === String(this.searchForm.ty)
return matchZydh && matchTy
})
this.total = this.tableData.length
this.localPaging = true
} else {
const pageData = data || {}
this.tableData = pageData.records || []
this.total = pageData.total || 0
this.localPaging = false
}
}).catch(() => {
this.tableData = []
this.total = 0