From 035c01e90be961cb96d22f269ec36645b1cba20b Mon Sep 17 00:00:00 2001 From: liweijie Date: Sun, 20 Sep 2026 19:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=AD=A6=E4=BB=BB=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2=E5=AE=8C=E5=96=84=EF=BC=8C=E6=95=99?= =?UTF-8?q?=E5=91=98=E3=80=81=E6=95=99=E5=AD=A6=E5=9C=BA=E5=9C=B0=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shiftSemester/ClassCalendarDialog.vue | 114 +++++++++++++++++- 1 file changed, 111 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue b/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue index 2a663980..766c93ef 100644 --- a/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue +++ b/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue @@ -121,7 +121,7 @@ :remote-method="searchKbOptions" :loading="kbLoading" @change="handleKbhChange" - @focus="!kbOptions.length && searchKbOptions('')" + @focus="searchKbOptions('')" > - + + + - + + + @@ -412,6 +448,8 @@ import { pasteTasks } from '@/api/studentRecords/classCalendar' import { listKb } from '@/api/teachOffice/kb' +import { listTeacher } from '@/api/teachOffice/teacher' +import { listClassroom } from '@/api/teachBusiness/classroom' const TASK_CLIPBOARD_KEY = 'education.classTaskClipboard' @@ -446,6 +484,10 @@ export default { }, kbOptions: [], kbLoading: false, + teacherOptions: [], + teacherLoading: false, + roomOptions: [], + roomLoading: false, // ==================== 复制到其它班次 ==================== teamSelectVisible: false, @@ -672,6 +714,8 @@ export default { form.xydxqbh = s.bh || row.xydxqbh this.editForm = form this.ensureKbOption(form.kbh, row) + this.ensureTeacherOption(form.jybh, row) + this.ensureRoomOption(form.jsbh, row) this.editVisible = true this.$nextTick(() => { if (this.$refs.editFormRef) this.$refs.editFormRef.clearValidate() @@ -709,11 +753,75 @@ export default { }) }) this.kbOptions = merged + this.ensureKbOption(this.editForm && this.editForm.kbh) this.kbLoading = false }).catch(() => { this.kbLoading = false }) }, + /* ---------- 教员下拉(责任教员远程检索) ---------- */ + teacherOptionLabel(item) { + const name = item.jyxm || '' + return name ? `${name}(${item.jybh})` : item.jybh + }, + ensureTeacherOption(jybh, row) { + if (!jybh) return + if (this.teacherOptions.some(item => item.jybh === jybh)) return + this.teacherOptions = [{ jybh, jyxm: (row && row.jyxm) || '' }].concat(this.teacherOptions) + }, + searchTeacherOptions(keyword) { + this.teacherLoading = true + const kw = (keyword || '').trim() + const params = { pageNum: 1, pageSize: 30 } + if (kw) params.jyxm = kw + listTeacher(params).then(res => { + const data = (res && res.data) || {} + this.teacherOptions = data.records || (Array.isArray(data) ? data : []) + this.ensureTeacherOption(this.editForm && this.editForm.jybh) + this.teacherLoading = false + }).catch(() => { + this.teacherLoading = false + }) + }, + + /* ---------- 教室下拉(教学场地远程检索) ---------- */ + roomOptionLabel(item) { + const name = item.jsmc || '' + return name ? `${name}(${item.jsbh})` : item.jsbh + }, + ensureRoomOption(jsbh, row) { + if (!jsbh) return + if (this.roomOptions.some(item => item.jsbh === jsbh)) return + this.roomOptions = [{ jsbh, jsmc: (row && row.jsmc) || '' }].concat(this.roomOptions) + }, + searchRoomOptions(keyword) { + this.roomLoading = true + const kw = (keyword || '').trim() + const unwrap = res => { + const data = (res && res.data) || {} + return data.records || (Array.isArray(data) ? data : []) + } + const requests = kw + ? [listClassroom({ pageNum: 1, pageSize: 30, jsmc: kw }), listClassroom({ pageNum: 1, pageSize: 30, jsbh: kw })] + : [listClassroom({ pageNum: 1, pageSize: 30 })] + Promise.all(requests).then(results => { + const merged = [] + const seen = {} + results.forEach(res => { + unwrap(res).forEach(item => { + if (!item.jsbh || seen[item.jsbh]) return + seen[item.jsbh] = true + merged.push(item) + }) + }) + this.roomOptions = merged + this.ensureRoomOption(this.editForm && this.editForm.jsbh) + this.roomLoading = false + }).catch(() => { + this.roomLoading = false + }) + }, + /** 选中课程后带出课程档案信息(仅覆盖课程有值的字段) */ handleKbhChange(kbh) { const course = this.kbOptions.find(item => item.kbh === kbh)