Compare commits

..

No commits in common. "d669b6ee426f625002a129a45860131e4d3ff47d" and "4fd47d2f2f32ee3aa3d5caadc657dadab277a426" have entirely different histories.

3 changed files with 32 additions and 24 deletions

View File

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

View File

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

View File

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