教学大纲
This commit is contained in:
@@ -48,19 +48,11 @@ export function getSyllabus(bh) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有(返回 List,无分页,前端本地分页)
|
||||
export function listSyllabus() {
|
||||
// 列表查询(支持 zydh、ty 及分页参数)
|
||||
export function listSyllabus(query) {
|
||||
return request({
|
||||
url: '/zyjxjhb/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据专业代号和停用标识查询(zydh、ty 均必填,等值匹配)
|
||||
export function listSyllabusByZydhAndTy(zydh, ty) {
|
||||
return request({
|
||||
url: '/zyjxjhb/listByZydhAndTy',
|
||||
method: 'get',
|
||||
params: { zydh, ty }
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,10 +46,13 @@
|
||||
<el-table v-loading="loading" :data="pagedData" border stripe highlight-current-row
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column prop="bh" label="编号" width="170" show-overflow-tooltip align="center" />
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="zydh" label="专业代号" width="150" align="center" />
|
||||
<el-table-column prop="kbh" label="课编号" width="110" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="jc" label="简称" width="100" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="kcdw" label="课程定位" width="120" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="mk" label="模块" width="100" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="jysdh" label="教研室" width="100" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="klx" label="课类型" width="80" align="center" />
|
||||
<el-table-column prop="xqdc" label="学期第次" width="80" align="center" />
|
||||
<el-table-column prop="xs" label="学时" width="70" align="center" />
|
||||
@@ -58,6 +61,13 @@
|
||||
<el-table-column prop="sjxs" label="实践学时" width="80" align="center" />
|
||||
<el-table-column prop="zks" label="周课时" width="70" align="center" />
|
||||
<el-table-column prop="ksks" label="考试课时" width="80" align="center" />
|
||||
<el-table-column prop="cjfz" label="成绩分制" width="90" align="center" />
|
||||
<el-table-column label="不计入平均分" width="110" align="center">
|
||||
<template slot-scope="scope">{{ fmtYesNo(scope.row.bjrxypjf) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考试课时不显示" width="130" align="center">
|
||||
<template slot-scope="scope">{{ fmtYesNo(scope.row.ksksbxs) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="大纲课程" width="90" align="center">
|
||||
<template slot-scope="scope">{{ fmtYesNo(scope.row.dgkc) }}</template>
|
||||
</el-table-column>
|
||||
@@ -278,8 +288,7 @@ import {
|
||||
deleteSyllabus,
|
||||
batchDeleteSyllabus,
|
||||
updateSyllabus,
|
||||
listSyllabus,
|
||||
listSyllabusByZydhAndTy
|
||||
listSyllabus
|
||||
} from '@/api/teachBusiness/syllabus'
|
||||
import { listMajor } from '@/api/subjectMajor/major'
|
||||
import { listKb } from '@/api/teachOffice/kb'
|
||||
@@ -302,6 +311,7 @@ export default {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
localPaging: false,
|
||||
selection: [],
|
||||
referenceDataLoading: false,
|
||||
majorOptions: [],
|
||||
@@ -326,6 +336,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
pagedData() {
|
||||
if (!this.localPaging) {
|
||||
return this.tableData
|
||||
}
|
||||
const start = (this.pageNum - 1) * this.pageSize
|
||||
return this.tableData.slice(start, start + this.pageSize)
|
||||
}
|
||||
@@ -380,21 +393,26 @@ export default {
|
||||
/* ---------- 列表加载 ---------- */
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
const { zydh, ty } = this.searchForm
|
||||
// 专业代号存在时走后端组合查询;否则查全部后按停用标识过滤
|
||||
const useApiQuery = Boolean(zydh)
|
||||
const req = useApiQuery
|
||||
? listSyllabusByZydhAndTy(zydh, ty)
|
||||
: listSyllabus()
|
||||
req.then(response => {
|
||||
let list = response.data || []
|
||||
if (!useApiQuery) {
|
||||
if (zydh) list = list.filter(i => i.zydh && i.zydh.indexOf(zydh) !== -1)
|
||||
list = list.filter(i => Number(i.ty) === Number(ty))
|
||||
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
|
||||
}
|
||||
this.tableData = list
|
||||
this.total = list.length
|
||||
this.pageNum = 1
|
||||
}).catch(() => {
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
@@ -403,10 +421,12 @@ export default {
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.pageNum = 1
|
||||
this.fetchList()
|
||||
},
|
||||
handleReset() {
|
||||
this.searchForm = { zydh: '', ty: 0 }
|
||||
this.pageNum = 1
|
||||
this.fetchList()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
@@ -487,9 +507,15 @@ export default {
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size
|
||||
this.pageNum = 1
|
||||
if (!this.localPaging) {
|
||||
this.fetchList()
|
||||
}
|
||||
},
|
||||
handlePageChange(page) {
|
||||
this.pageNum = page
|
||||
if (!this.localPaging) {
|
||||
this.fetchList()
|
||||
}
|
||||
},
|
||||
|
||||
/* ---------- 工具 ---------- */
|
||||
|
||||
Reference in New Issue
Block a user