diff --git a/src/views/contest/contestList.vue b/src/views/contest/contestList.vue index f9e616eb3..6e466634b 100644 --- a/src/views/contest/contestList.vue +++ b/src/views/contest/contestList.vue @@ -13,7 +13,7 @@
{{ mod.moduleName }}
考试时间:{{ mod.duration }}分钟
-
任务目录: +
任务目录: { + this.allTaskDatas = res.data.reduce((acc, obj) => { + acc[obj.name] = obj.id; + return acc; + }, {}); + }).catch(error => { + this.$message.error(error.message); + }); + + }, methods: { drapWidth(width) { this.widthLeft = Number(width); @@ -115,6 +127,16 @@ export default { }, transformTree(data) { const result = {label:data.name, children:[], id:id++, type:'taskCatalog' }; + data.taskIds.forEach(taskId => { + let label = ''; + for (const key in this.allTaskDatas) { + if (this.allTaskDatas[key] === taskId) { + label = key; + break; + } + } + result.children.push({label, id:id++, type:'tasks', parentId:result.id }); + }); if (data.group.length) { const changeGroup = data.group.map(taskCatalog=> this.transformTree(taskCatalog) @@ -169,6 +191,20 @@ export default { padding:10px; background: transparent; color: #fff; + .tabs-module-card-tree{ + max-height:calc(100vh - 370px); + overflow: auto; + margin-bottom:50px; + &::-webkit-scrollbar{ + background: #06284a; + } + &::-webkit-scrollbar-thumb{ + background: #0c0909; + } + &::-webkit-scrollbar-track{ + background: #06284a; + } + } .tabs-module-card-button{ position: absolute; bottom: 10px;