This commit is contained in:
2026-08-25 19:25:55 +08:00
parent 0240f410b6
commit 13d72c54f2
16 changed files with 185 additions and 163 deletions
@@ -10,11 +10,11 @@
</el-form-item>
</el-col>
<el-col :xs="24" :md="8">
<el-form-item label="停用标识">
<el-select v-model="searchForm.ty" placeholder="全部" clearable class="w-full">
<el-option :value="0" label="正常" />
<el-option :value="1" label="停用" />
</el-select>
<el-form-item label="停用">
<el-radio-group v-model="searchForm.ty">
<el-radio :label="0">否</el-radio>
<el-radio :label="1">是</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :md="8">
@@ -296,7 +296,7 @@ export default {
loading: false,
searchForm: {
zydh: '',
ty: ''
ty: 0
},
tableData: [],
total: 0,
@@ -381,8 +381,8 @@ export default {
fetchList() {
this.loading = true
const { zydh, ty } = this.searchForm
// 专业代号与停用标识同时给出时走后端 /listByZydhAndTy;否则查全部后本地过滤
const useApiQuery = zydh && ty !== '' && ty !== null && ty !== undefined
// 专业代号存在时走后端组合查询;否则查全部后按停用标识过滤
const useApiQuery = Boolean(zydh)
const req = useApiQuery
? listSyllabusByZydhAndTy(zydh, ty)
: listSyllabus()
@@ -390,9 +390,7 @@ export default {
let list = response.data || []
if (!useApiQuery) {
if (zydh) list = list.filter(i => i.zydh && i.zydh.indexOf(zydh) !== -1)
if (ty !== '' && ty !== null && ty !== undefined) {
list = list.filter(i => Number(i.ty) === Number(ty))
}
list = list.filter(i => Number(i.ty) === Number(ty))
}
this.tableData = list
this.total = list.length
@@ -408,7 +406,7 @@ export default {
this.fetchList()
},
handleReset() {
this.searchForm = { zydh: '', ty: '' }
this.searchForm = { zydh: '', ty: 0 }
this.fetchList()
},
handleSelectionChange(val) {