fix:解决个人中心班级限制问题;
This commit is contained in:
parent
471d73a224
commit
6c60cd4442
|
@ -198,9 +198,14 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
listClassmain({entpid: userStore.deptId, status: 'open', pageSize: 100}).then(response => {
|
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);
|
gradeTree.value = groupByCondition(arr, item => item.agekey);
|
||||||
console.log(gradeTree.value,'gradeTree.value')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//将所有班级筛选成二级的数组
|
//将所有班级筛选成二级的数组
|
||||||
|
@ -293,13 +298,15 @@
|
||||||
// }
|
// }
|
||||||
//新增班级
|
//新增班级
|
||||||
const btnSave = () => {
|
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) {
|
if (res.code === 200) {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
|
//清空所选中的值
|
||||||
|
classids.value = []
|
||||||
}else{
|
}else{
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, getCurrentInstance } from 'vue'
|
import { ref, getCurrentInstance,onMounted } from 'vue'
|
||||||
import {updateUserInfo } from '@/api/system/user'
|
import {updateUserInfo } from '@/api/system/user'
|
||||||
import { listEvaluation } from '@/api/subject/index'
|
import { listEvaluation } from '@/api/subject/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
@ -90,9 +90,12 @@ const rules = ref({
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
|
|
||||||
// 获取基础的学科
|
// 获取基础的学科
|
||||||
listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => {
|
const getSubject = () => {
|
||||||
subjectList.value = res.rows
|
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(() => {
|
setTimeout(() => {
|
||||||
if (props.user.edudegree != '') {
|
if (props.user.edudegree != '') {
|
||||||
|
@ -150,4 +153,7 @@ const semeterChange = (item) => {
|
||||||
props.user.edusubject = ''
|
props.user.edusubject = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getSubject()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="sourceStore.loading" class="resource-list">
|
<div class="resource-list">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-empty v-if="!sourceStore.thirdResult.list.length" description="暂无数据" />
|
<el-empty v-if="!sourceStore.thirdResult.list.length" description="暂无数据" />
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Reference in New Issue