教研室管理
This commit is contained in:
@@ -48,11 +48,10 @@ export function getSyllabus(bh) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 列表查询(支持 zydh、ty 及分页参数)
|
// 列表查询(返回全部,前端本地过滤+分页)
|
||||||
export function listSyllabus(query) {
|
export function listSyllabus() {
|
||||||
return request({
|
return request({
|
||||||
url: '/zyjxjhb/listByZydhAndTy',
|
url: '/zyjxjhb/list',
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params: query
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,26 +393,16 @@ export default {
|
|||||||
/* ---------- 列表加载 ---------- */
|
/* ---------- 列表加载 ---------- */
|
||||||
fetchList() {
|
fetchList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const query = {
|
listSyllabus().then(response => {
|
||||||
pageNum: this.pageNum,
|
const data = response.data || []
|
||||||
pageSize: this.pageSize,
|
const list = Array.isArray(data) ? data : (data.records || [])
|
||||||
ty: this.searchForm.ty
|
this.tableData = list.filter(row => {
|
||||||
}
|
const matchZydh = !this.searchForm.zydh || row.zydh === this.searchForm.zydh
|
||||||
if (this.searchForm.zydh) {
|
const matchTy = String(row.ty) === String(this.searchForm.ty)
|
||||||
query.zydh = this.searchForm.zydh
|
return matchZydh && matchTy
|
||||||
}
|
})
|
||||||
listSyllabus(query).then(response => {
|
this.total = this.tableData.length
|
||||||
const data = response.data
|
this.localPaging = true
|
||||||
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
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.total = 0
|
this.total = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user