From 817ea8790e1ccad2407bdb877c34853ef4917c05 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Tue, 30 Jul 2024 10:16:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/classManage/basicGroup.vue | 6 ++-- .../src/views/classManage/classInfo.vue | 34 ++++++++----------- src/renderer/src/views/classManage/index.vue | 16 +++++---- .../src/views/classManage/studentList.vue | 6 ++-- 4 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/renderer/src/views/classManage/basicGroup.vue b/src/renderer/src/views/classManage/basicGroup.vue index 42a70cd..9668b2a 100644 --- a/src/renderer/src/views/classManage/basicGroup.vue +++ b/src/renderer/src/views/classManage/basicGroup.vue @@ -92,7 +92,7 @@ 未选学生:
- {{stuItem.name || stuItem.studentname}} + {{stuItem.studentname || stuItem.name}}
@@ -121,7 +121,7 @@ const groupForm = reactive({ groupname: '', orderidx: 0, classid: Number(props.classId), - edituserid: userStore.id, + edituserid: userStore.userId, edusubject: userStore.edusubject, userid : 0, studentid : 0, @@ -188,7 +188,7 @@ const getClassInfo = () => { const chooseItem = (item,stuIndex) => { let formdata = {} formdata.classid = props.classId; - formdata.edituserid = userStore.id; + formdata.edituserid = userStore.userId; formdata.userid = item.userid; formdata.parentid = parentId.value; formdata.studentid = item.studentid; diff --git a/src/renderer/src/views/classManage/classInfo.vue b/src/renderer/src/views/classManage/classInfo.vue index feacec5..0ea3c47 100644 --- a/src/renderer/src/views/classManage/classInfo.vue +++ b/src/renderer/src/views/classManage/classInfo.vue @@ -2,25 +2,19 @@ - - - + + {{ classInfo.caption }} + + + + + {{ classInfo.classstudentcount || 0 }}人 + @@ -42,13 +36,14 @@ }) const isDelClass = delClassDemo() const userStore = useUserStore().user + console.log(userStore,'userStore') //删除教室 const deleteClassRoom = () => { ElMessageBox.alert('确认删除该班级?', { confirmButtonText: '确认', type: 'warning' }).then(() => { - leaveClass({ classid: props.classId, userid: userStore.id, inrole: 'teacher' }).then(() => { + leaveClass({ classid: props.classId, userid: userStore.userId, inrole: 'teacher' }).then(() => { ElMessage({ message: '删除成功', type: 'success', @@ -63,12 +58,13 @@ const getClassInfo = () => { if(props.classId){ getClassmain(props.classId).then(response => { - classInfo.className = response.data.caption + Object.assign(classInfo,response.data) listClassuser({classid:props.classId,pageSize:100}).then(res => { classInfo.teacher = res.rows.filter(item => item.inrole === 'teacher') classInfo.student = res.rows.filter(item => item.inrole === 'student') }) }) + console.log(classInfo,'classInfo') } } onMounted(() => { diff --git a/src/renderer/src/views/classManage/index.vue b/src/renderer/src/views/classManage/index.vue index 1a4b1c8..c0c0b57 100644 --- a/src/renderer/src/views/classManage/index.vue +++ b/src/renderer/src/views/classManage/index.vue @@ -145,12 +145,14 @@ // 获取班级信息 const getClassInfo = () => { classList.value = [] - listClassmain({ entpid: userStore.deptId, pageSize: 500, status: 'open' }).then(response => { - response.rows.forEach(item => { - if(item.classteacherids && Number(item.classteacherids) === userStore.userId){ - classList.value.push(item) - } - }) + listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(response => { + // response.rows.forEach(item => { + // if(item.teacherid && Number(item.teacherid) === userStore.userId){ + // classList.value.push(item) + // } + // }) + classList.value = [...response.rows] + console.log(classList.value,'classList') if(classList.value.length > 0){ classId.value = classList.value[0].id currentIndex.value = 0 @@ -190,7 +192,7 @@ classForm.entpid = userStore.deptId; classForm.status = 'open'; classForm.teachername = userStore.nickName; - classForm.teacherid = userStore.id; + classForm.teacherid = userStore.userId; classForm.teacherSubject = classForm.edusubject; addClassmain(classForm).then(response => { if (response.code === 200) { diff --git a/src/renderer/src/views/classManage/studentList.vue b/src/renderer/src/views/classManage/studentList.vue index dc08770..2f42b29 100644 --- a/src/renderer/src/views/classManage/studentList.vue +++ b/src/renderer/src/views/classManage/studentList.vue @@ -71,7 +71,7 @@ @@ -201,7 +201,7 @@ studentForm.classname = classInfo.value.caption; studentForm.schoolname = classInfo.value.entpname; studentForm.status = ''; - studentForm.editoruserid = userStore.id; + studentForm.editoruserid = userStore.userId; addStudentmain(studentForm).then((response) => { if (response.code === 200) { ElMessage({ @@ -422,7 +422,7 @@ formdata.classname = classInfo.value.caption; formdata.schoolname = classInfo.value.entpname; formdata.status = ''; - formdata.editoruserid = userStore.id; + formdata.editoruserid = userStore.userId; addStudentmainByNameArray(formdata).then(res => { if(res.code == 200){