From 8df53373ce9b78e970ebb92c153c1db8143dad17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666>
Date: Tue, 14 Jan 2025 14:57:46 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E7=8F=AD=E7=BA=A7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B9=B4=E7=BA=A7=E5=AD=A6=E6=AE=B5=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/classManage/basicGroup.vue | 14 ++-
.../src/views/classManage/classInfo.vue | 114 +++++++++++++++++-
2 files changed, 117 insertions(+), 11 deletions(-)
diff --git a/src/renderer/src/views/classManage/basicGroup.vue b/src/renderer/src/views/classManage/basicGroup.vue
index a96285b..ee8170b 100644
--- a/src/renderer/src/views/classManage/basicGroup.vue
+++ b/src/renderer/src/views/classManage/basicGroup.vue
@@ -9,11 +9,8 @@
可用分组
- props.classId,()=> {
.groupList{
display: flex;
flex-wrap: wrap;
+ gap:10px;
}
.card-row {
font-size: 12px;
@@ -415,4 +413,10 @@ watch(()=> props.classId,()=> {
display: flex;
flex-direction: column;
}
+.card_div{
+ width: calc(20% - 10px);
+ margin-bottom: 10px;
+ cursor: pointer;
+ position: relative;
+}
diff --git a/src/renderer/src/views/classManage/classInfo.vue b/src/renderer/src/views/classManage/classInfo.vue
index b451e5a..818ac53 100644
--- a/src/renderer/src/views/classManage/classInfo.vue
+++ b/src/renderer/src/views/classManage/classInfo.vue
@@ -1,14 +1,69 @@
-
- {{ classInfo.caption }}
-
+
+
+
+
+
+
+
+ 班级名称
+
+
+ {{ classInfo.caption }}
+
+
+
+
+
+
+
+ 学段
+
+
+ {{ currentGrade }}
+
+
+
+
+
+
+
+ 年级
+
+
+ {{ currentGradeName }}
+
+
+
+
+
+
+
+ 学生人数
+
+
+ {{ classInfo.classstudentcount || 0 }}人
+
+
+
+
+
+
+
+ 教师
+
+
{{item.name}}
{{ classInfo.teachername }}
- {{ classInfo.classstudentcount || 0 }}人
@@ -17,7 +72,7 @@
import {ElMessage, ElMessageBox} from "element-plus";
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
import useUserStore from '@/store/modules/user'
- import {reactive,onMounted,nextTick,watch} from 'vue'
+ import {reactive,onMounted,nextTick,watch,ref} from 'vue'
import delClassDemo from '@/store/modules/delClass'
const props = defineProps({
classId: {
@@ -31,6 +86,36 @@
})
const isDelClass = delClassDemo()
const userStore = useUserStore().user
+ // 当前年级
+ const currentGradeName = ref('')
+ // 当前学段
+ const currentGrade = ref('')
+ // 获取年级
+ const gradeDataList = reactive([
+ [
+ { label: '一年级', agekey: 1, checked: false, current: 1 },
+ { label: '二年级', agekey: 2, checked: false, current: 1 },
+ { label: '三年级', agekey: 3, checked: false, current: 1 },
+ { label: '四年级', agekey: 4, checked: false, current: 1 },
+ { label: '五年级', agekey: 5, checked: false, current: 1 },
+ { label: '六年级', agekey: 6, checked: false, current: 1 },
+ ],
+ [
+ { label: '初一', agekey: 7, checked: false, current: 2 },
+ { label: '初二', agekey: 8, checked: false, current: 2 },
+ { label: '初三', agekey: 9, checked: false, current: 2 },
+ ],
+ [
+ { label: '高一', agekey: 10, checked: false, current: 3 },
+ { label: '高二', agekey: 11, checked: false, current: 3 },
+ { label: '高三', agekey: 12, checked: false, current: 3 },
+ ],
+ ])
+ const gradeData = reactive([
+ {current:1, label:'小学',},
+ {current:2, label:'初中',},
+ {current:3, label:'高中',},
+ ])
//删除教室
const deleteClassRoom = () => {
ElMessageBox.alert('确认删除该班级?', {
@@ -53,6 +138,14 @@
if(props.classId){
getClassmain(props.classId).then(response => {
Object.assign(classInfo,response.data)
+ //先把二级数组转化为一级数组,用于筛选
+ const flatGradeDataList = gradeDataList.flat();
+ //学段和年级的回显处理
+ const currentIndex = flatGradeDataList.findIndex(item => item.agekey === Number(response.data.agekey));
+ currentGradeName.value = flatGradeDataList[currentIndex].label
+ const current = flatGradeDataList[currentIndex].current
+ currentGrade.value = gradeData.find(item => item.current === current).label
+ console.log(classInfo,'classInfo');
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')
@@ -71,5 +164,14 @@