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; } };