教材选择不区分上下册 #148

Merged
lyc merged 1 commits from lyc-dev into main 2024-08-20 17:11:01 +08:00
3 changed files with 24 additions and 32 deletions
Showing only changes of commit 13598615c7 - Show all commits

View File

@ -75,8 +75,7 @@ const curBookImg = ref('')
const curBookPath = ref('')
//
const volumeOne = ref([])
//
const volumeTwo = ref([])
//
const currentNode = reactive({
data:{}
@ -111,9 +110,11 @@ const getSubjectContent = async () => {
//
await getSubject()
//
volumeOne.value = data.filter(item => item.level == 1 && item.semester == '上册')
//
volumeTwo.value = data.filter(item => item.level == 1 && item.semester == '下册')
/**
* 不区分上下册
* 2024/08/20调整
*/
volumeOne.value = data.filter(item => item.level == 1)
getTreeData()
}
@ -132,12 +133,8 @@ const changeBook = ({ id, itemtitle, avartar, fileurl }) => {
const getTreeData = () => {
//
let upData = transData(volumeOne.value)
let downData = transData(volumeTwo.value)
if(upData.length && downData.length){
treeData.value = [...upData,...downData]
}
else if(upData.length || downData.length){
treeData.value = upData.length ? upData : downData
if(upData.length){
treeData.value = [...upData]
}
else{
treeData.value = []

View File

@ -88,8 +88,6 @@ const curBookId = ref(-1)
const curBookName = ref('')
//
const volumeOne = ref([])
//
const volumeTwo = ref([])
//
const currentNode = reactive({
data: {}
@ -127,9 +125,12 @@ const getSubjectContent = async () => {
//
getSubject()
//
volumeOne.value = data.filter(item => item.level == 1 && item.semester == '上册')
//
volumeTwo.value = data.filter(item => item.level == 1 && item.semester == '下册')
/**
* 不区分上下册
* 2024/08/20调整
*/
volumeOne.value = data.filter(item => item.level == 1)
getTreeData()
}
@ -160,13 +161,8 @@ const isHaveUnit = (id) => {
const getTreeData = () => {
//
let upData = transData(volumeOne.value)
let downData = transData(volumeTwo.value)
if(upData.length && downData.length){
treeData.value = [...upData,...downData]
}
else if(upData.length || downData.length){
treeData.value = upData.length ? upData : downData
if(upData.length){
treeData.value = [...upData]
}
else{
treeData.value = []

View File

@ -42,18 +42,17 @@ const getTreeData = () => {
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
//
let volumeOne = evaluationList.value.filter(item => item.level == 1 && item.semester == '上册')
//
let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册')
/**
* 不区分上下册
* 2024/08/20调整
*/
let volumeOne = evaluationList.value.filter(item => item.level == 1)
//
let upData = transData(volumeOne)
let downData = transData(volumeTwo)
if(upData.length && downData.length){
treeData.value = [...upData,...downData]
}
else if(upData.length || downData.length){
treeData.value = upData.length ? upData : downData
if(upData.length){
treeData.value = [...upData]
}
else{
treeData.value = []