diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index ae8d243..9693126 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -71,6 +71,8 @@ const curBookId = ref(-1) const curBookName = ref('') //当前教材封面图 const curBookImg = ref('') +//当前教材文件路径 +const curBookPath = ref('') // 上册 const volumeOne = ref([]) // 下册 @@ -126,10 +128,11 @@ const getSubjectContent = async () => { } //选择教材 -const changeBook = ({ id, itemtitle, avartar }) => { +const changeBook = ({ id, itemtitle, avartar, fileurl }) => { curBookId.value = id curBookName.value = itemtitle curBookImg.value = BaseUrl + avartar + curBookPath.value = fileurl getTreeData() setTimeout(() => { dialogVisible.value = false @@ -176,7 +179,8 @@ const emitChangeBook = () => { textBook: { curBookId: curBookId.value, curBookName: curBookName.value, - curBookImg: curBookImg.value + curBookImg: curBookImg.value, + curBookPath: curBookPath.value }, node: curNode } @@ -276,6 +280,7 @@ const getSubject = async () => { curBookName.value = subjectList.value[0].itemtitle curBookId.value = subjectList.value[0].id curBookImg.value = BaseUrl + subjectList.value[0].avartar + curBookPath.value = subjectList.value[0].fileurl } @@ -291,7 +296,7 @@ const handleNodeClick = (data, node) => { * data : 当前节点数据 * node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象 */ - + const nodeData = data; const parentNode = node.parent.data; @@ -306,7 +311,8 @@ const handleNodeClick = (data, node) => { textBook: { curBookId: curBookId.value, curBookName: curBookName.value, - curBookImg: curBookImg.value + curBookImg: curBookImg.value, + curBookPath: curBookPath.value }, node: toRaw(nodeData) } @@ -428,4 +434,4 @@ onMounted(() => { background-color: #eaf3ff !important; color: #409EFF } - \ No newline at end of file + diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 307cab9..4f66edc 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -66,6 +66,7 @@ import { Check } from '@element-plus/icons-vue' import Reserv from '@/views/prepare/container/reserv.vue'