修复先进入备课报错
This commit is contained in:
parent
0d41a5a62f
commit
57aa718711
|
@ -55,6 +55,8 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive, toRaw, onMounted, nextTick, watch } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
|
@ -66,6 +68,8 @@ const props = defineProps({
|
|||
default: '移动至'
|
||||
}
|
||||
})
|
||||
const userStore = useUserStore()
|
||||
const { edustage, edusubject, userId } = userStore.user
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const bookVisible = ref(false)
|
||||
|
@ -106,10 +110,26 @@ watch(() => props.modelValue, (newVal) => {
|
|||
})
|
||||
|
||||
|
||||
const getSubjectContent = () => {
|
||||
const getSubjectContent = async () => {
|
||||
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
let data = evaluationList.value
|
||||
const params = {
|
||||
edusubject,
|
||||
edustage,
|
||||
entpcourseedituserid: userId,
|
||||
pageSize: 500
|
||||
}
|
||||
|
||||
let data;
|
||||
if (localStorage.getItem('evaluationList')) {
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
data = evaluationList.value
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
}
|
||||
|
||||
//获取教材版本
|
||||
getSubject()
|
||||
|
@ -121,8 +141,18 @@ const getSubjectContent = () => {
|
|||
getTreeData()
|
||||
}
|
||||
|
||||
const getSubject = () => {
|
||||
const getSubject = async () => {
|
||||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
|
||||
if (localStorage.getItem('subjectList')) {
|
||||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id))
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||
}
|
||||
|
||||
// 默认第一个
|
||||
curBookName.value = subjectList.value[0].itemtitle
|
||||
curBookId.value = subjectList.value[0].id
|
||||
|
@ -297,7 +327,8 @@ onMounted(() => {
|
|||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
.icon-close{
|
||||
|
||||
.icon-close {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue