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