From 9f510187c04e71f74b833621a4ffeda1d82dd291 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 7 Aug 2024 15:49:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E6=95=99=E6=9D=90?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 16 ++++--- src/renderer/src/views/prepare/index.vue | 42 ++++++++++++++++++- 2 files changed, 51 insertions(+), 7 deletions(-) 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'