diff --git a/frontend/src/api/teachBusiness/syllabus.js b/frontend/src/api/teachBusiness/syllabus.js index e7d96cce..b0855c4c 100644 --- a/frontend/src/api/teachBusiness/syllabus.js +++ b/frontend/src/api/teachBusiness/syllabus.js @@ -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' }) } diff --git a/frontend/src/views/teachBusiness/syllabus/index.vue b/frontend/src/views/teachBusiness/syllabus/index.vue index a773c308..6187c69f 100644 --- a/frontend/src/views/teachBusiness/syllabus/index.vue +++ b/frontend/src/views/teachBusiness/syllabus/index.vue @@ -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 - this.localPaging = true - } else { - const pageData = data || {} - this.tableData = pageData.records || [] - this.total = pageData.total || 0 - this.localPaging = false - } + 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 }).catch(() => { this.tableData = [] this.total = 0