Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2024-03-05 13:52:28 +08:00
commit 3e5996aee4
4 changed files with 49 additions and 6 deletions

View File

@ -13,7 +13,7 @@
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ node.label }}</span> <span>{{ node.label }}</span>
<div style="display: flex; justify-content: space-between;"> <div style="display: flex; justify-content: space-between;">
<div style="width:80px;">得分:{{ data.score }}</div> <div v-if="data.sceneid" style="width:80px;">得分:{{ data.score }}</div>
</div> </div>
</span> </span>
</el-tree> </el-tree>

View File

@ -13,7 +13,7 @@
<el-card :key="modIndex" class="tabs-module-card"> <el-card :key="modIndex" class="tabs-module-card">
<div style="margin-bottom:10px;font-size: 20px;height: 30px;text-align: center;line-height: 30px;">{{ mod.moduleName }}</div> <div style="margin-bottom:10px;font-size: 20px;height: 30px;text-align: center;line-height: 30px;">{{ mod.moduleName }}</div>
<div style="margin-bottom:10px">考试时间{{ mod.duration }}分钟</div> <div style="margin-bottom:10px">考试时间{{ mod.duration }}分钟</div>
<div style="margin-bottom:50px"> 任务目录 <div class="tabs-module-card-tree"> 任务目录
<el-tree <el-tree
:data="moduleTreeDatas[modIndex].children" :data="moduleTreeDatas[modIndex].children"
current-node-key current-node-key
@ -45,7 +45,7 @@
import paperList from './paperList'; import paperList from './paperList';
import drapLeft from '@/views/components/drapLeft/index'; import drapLeft from '@/views/components/drapLeft/index';
import ScoreRule from './scoreRule'; import ScoreRule from './scoreRule';
import { getPaperDetail, getContextScoreDetail, beginContestExercise} from '@/api/contest'; import { getTaskTreeDatas, getPaperDetail, beginContestExercise} from '@/api/contest';
let id = 1; let id = 1;
export default { export default {
@ -66,7 +66,8 @@ export default {
taskTreeDatas:[], taskTreeDatas:[],
defaultProps: { defaultProps: {
disabled: true disabled: true
} },
allTaskDatas:{}
}; };
}, },
computed: { computed: {
@ -74,6 +75,17 @@ export default {
return this.$store.state.app.width; return this.$store.state.app.width;
} }
}, },
created() {
getTaskTreeDatas().then((res) => {
this.allTaskDatas = res.data.reduce((acc, obj) => {
acc[obj.name] = obj.id;
return acc;
}, {});
}).catch(error => {
this.$message.error(error.message);
});
},
methods: { methods: {
drapWidth(width) { drapWidth(width) {
this.widthLeft = Number(width); this.widthLeft = Number(width);
@ -115,6 +127,16 @@ export default {
}, },
transformTree(data) { transformTree(data) {
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' }; 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) { if (data.group.length) {
const changeGroup = data.group.map(taskCatalog=> const changeGroup = data.group.map(taskCatalog=>
this.transformTree(taskCatalog) this.transformTree(taskCatalog)
@ -169,6 +191,20 @@ export default {
padding:10px; padding:10px;
background: transparent; background: transparent;
color: #fff; 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{ .tabs-module-card-button{
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;

View File

@ -15,7 +15,11 @@
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="描述" prop="name" /> <el-table-column label="描述" prop="name" />
<el-table-column label="评分标准" prop="criteria" /> <el-table-column label="评分标准" prop="criteria" />
<el-table-column label="分值" prop="score" width="50" /> <el-table-column label="分值" prop="score" width="50">
<template slot-scope="scope">
<span>{{ scope.row.score === 0? '': scope.row.score }}</span>
</template>
</el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>
</template> </template>

View File

@ -128,7 +128,7 @@ export default {
}, },
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
if (this.isRace) { if (this.isRace && !this.$store.state.trainingNew.trainingDetail) {
this.loadRaceScene(this.$route.query.sceneId); this.loadRaceScene(this.$route.query.sceneId);
} }
}, },
@ -147,6 +147,9 @@ export default {
} }
} }
}, },
beforeDestroy() {
this.$store.dispatch('trainingNew/setTrainingDetail', null);
},
mounted() { mounted() {
EventBus.$on('setTrainingList', (trainingList) => { EventBus.$on('setTrainingList', (trainingList) => {
this.trainingList = trainingList; this.trainingList = trainingList;