From 64780fbfdf28248151dcc788115b6fffc6a228f2 Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Wed, 11 Jun 2025 21:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=87=BA=E9=A2=98=E5=8A=A0=E4=B8=8A=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E6=96=87=E4=BB=B6=E5=A4=B9=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/paper/audit/index.vue | 2 +- src/views/paper/question/FileForm.vue | 31 ++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/views/paper/audit/index.vue b/src/views/paper/audit/index.vue index bff82f2..317d0e1 100644 --- a/src/views/paper/audit/index.vue +++ b/src/views/paper/audit/index.vue @@ -149,7 +149,7 @@ - + +
答案目录
+
原始目录
+ + @@ -456,6 +466,7 @@ import * as SpecialtyApi from '@/api/points' defineOptions({ name: 'ChoiceForm' }) // 定义一个缓存对象 const nodeListCache: Record = {}; +const stuListCache: Record = {}; const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -466,6 +477,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改 const fileTreeDialogVisible = ref(false); const fileTreeData = ref([]); +const fileTreeStu = ref([]); const currentEditingRow = ref(null); // 当前点击的行 @@ -516,12 +528,15 @@ const openFileTree = (row: any) => { console.log("111") const quId = kaodianData.value.quId; const cached = nodeListCache[quId]; + const cachedstu = stuListCache[quId] if (!cached) { ElMessage.warning('暂无缓存的文件结构'); return; } - fileTreeData.value.push(...handleTree(cached)) + fileTreeData.value.push(...handleTree(cached)) + fileTreeStu.value.push(...handleTree(cachedstu)) + currentEditingRow.value = row; fileTreeDialogVisible.value = true; }; @@ -537,6 +552,19 @@ const handleFileNodeClick = (data) => { } fileTreeDialogVisible.value = false } + + +const handleFileNodeStuClick = (data) => { + const pathArray = findFilePathById(fileTreeStu.value, data.id) + if (!pathArray) return + + const fullPath = pathArray.join('\\') + if (currentEditingRow.value) { + currentEditingRow.value.content = fullPath + currentEditingRow.value.attribute = data.attribute || '' + } + fileTreeDialogVisible.value = false +} const findFilePathById = ( tree: any[], targetId: number, @@ -660,6 +688,7 @@ const setKaodianRow =async () => { const quId = kaodianData.value.quId; if (quId) { nodeListCache[quId] = res.nodeList; + stuListCache[quId]=res.stuList; } };