fix:解决个人中心班级限制问题; #193

Merged
yangws merged 1 commits from yangws into main 2024-09-11 14:43:26 +08:00
3 changed files with 21 additions and 8 deletions
Showing only changes of commit 6c60cd4442 - Show all commits

View File

@ -198,9 +198,14 @@
}
});
listClassmain({entpid: userStore.deptId, status: 'open', pageSize: 100}).then(response => {
//
let arr = [...response.rows]
classList.value.forEach(item => {
const currentIndex = arr.findIndex(items => items.id === item.id)
if(currentIndex) arr.splice(currentIndex, 1)
})
//
gradeTree.value = groupByCondition(response.rows, item => item.agekey);
console.log(gradeTree.value,'gradeTree.value')
gradeTree.value = groupByCondition(arr, item => item.agekey);
})
}
//
@ -293,13 +298,15 @@
// }
//
const btnSave = () => {
addClasses({classIds:classids.value.join(','),regId:userStore.userId}).then(res => {
addClasses({classIds:classids.value.join(','),userId:userStore.userId}).then(res => {
if (res.code === 200) {
dialogVisible.value = false
ElMessage({
message: res.msg,
type: 'success',
})
//
classids.value = []
}else{
ElMessage({
message: res.msg,

View File

@ -40,7 +40,7 @@
</template>
<script setup>
import { ref, getCurrentInstance } from 'vue'
import { ref, getCurrentInstance,onMounted } from 'vue'
import {updateUserInfo } from '@/api/system/user'
import { listEvaluation } from '@/api/subject/index'
import useUserStore from '@/store/modules/user'
@ -90,9 +90,12 @@ const rules = ref({
const subjectList = ref([])
//
listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => {
subjectList.value = res.rows
})
const getSubject = () => {
listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => {
const arr = userStore.user.subject.split(',')
subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items)
})
}
setTimeout(() => {
if (props.user.edudegree != '') {
@ -150,4 +153,7 @@ const semeterChange = (item) => {
props.user.edusubject = ''
}
}
onMounted(() => {
getSubject()
})
</script>

View File

@ -1,5 +1,5 @@
<template>
<div v-loading="sourceStore.loading" class="resource-list">
<div class="resource-list">
<el-scrollbar>
<el-empty v-if="!sourceStore.thirdResult.list.length" description="暂无数据" />
<ul>