跳转增加bookid #248

Merged
lyc merged 1 commits from lyc-dev into main 2024-09-22 16:41:47 +08:00
4 changed files with 11 additions and 6 deletions
Showing only changes of commit cafea2d719 - Show all commits

View File

@ -114,6 +114,7 @@ const emitChangeBook = async () => {
*/
let levelFirstId = null
let levelSecondId = null
let bookeId = curBook.data.id
if (curData.parentNode) {
levelFirstId = curData.parentNode.id
levelSecondId = curData.id
@ -121,7 +122,7 @@ const emitChangeBook = async () => {
levelFirstId = curData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('changeBook', data)
}
@ -206,6 +207,7 @@ const handleNodeClick = (data, node) => {
*/
let levelFirstId = null
let levelSecondId = null
let bookeId = curBook.data.id
if (nodeData.parentNode) {
levelFirstId = nodeData.parentNode.id
levelSecondId = nodeData.id
@ -213,7 +215,7 @@ const handleNodeClick = (data, node) => {
levelFirstId = nodeData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('nodeClick', curData)

View File

@ -102,8 +102,9 @@ const getTreeData = () => {
levelFirstId = curNode.id
levelSecondId = ''
}
let bookeId = curBookId
// 头部 教材分析、作业设计打开外部链接需要当前章节ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
// const data = {
// textBook: {

View File

@ -168,10 +168,11 @@ const clickMenu = ({isOuter, path, disabled}) =>{
let fullPath = configObj.fullPath + path
if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' || path == '/teaching/classtaskassign?titleName=作业布置'){
// ID
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
let unitId = levelSecondId ? levelSecondId : levelFirstId
fullPath = fullPath + `&unitId=${unitId}`
fullPath = fullPath + `&unitId=${unitId}&bookeId=${bookeId}`
console.log(fullPath)
}

View File

@ -208,7 +208,8 @@ export default {
openFileWin(items) {
if (items.fileFlag === 'apt') {
console.log(this.curNode);
const path="/teaching/aptindex?id="+items.fileId + "&cataId=" + this.curNode.id;
let curBook = JSON.parse(localStorage.getItem('curBook'))
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path
fullPath = fullPath.replaceAll('//', '/')