第一个页面调整

This commit is contained in:
joylink_zhaoerwei 2024-03-01 16:20:10 +08:00
parent 7810cfc993
commit ccaefdeb5e
2 changed files with 67 additions and 70 deletions

View File

@ -7,43 +7,36 @@
<div class="module-box"> <div class="module-box">
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;color: #fff;">{{ paperName }}</div> <div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;color: #fff;">{{ paperName }}</div>
<el-tabs v-model="activeModuleName" class="tabs-box" type="border-card" @tab-click="handleTabClick"> <el-tabs v-model="activeModuleName" class="tabs-box" type="border-card" @tab-click="handleTabClick">
<template v-for="(mod, modIndex) in moduleList"> <el-tab-pane label="详情" name="detail">
<el-tab-pane :key="modIndex" :label="mod.moduleName" :name="mod.customModuleId+''"> <div class="tabs-module">
<el-card style="padding:10px"> <template v-for="(mod, modIndex) in moduleList">
<div>考试时间{{ mod.duration }}分钟</div> <el-card :key="modIndex" class="tabs-module-card">
</el-card> <div style="margin-bottom:10px">模块{{ mod.moduleName }}</div>
<el-card style="margin-top: 10px;"> <div style="margin-bottom:10px">考试时间{{ mod.duration }}分钟</div>
<div style="padding:10px"> 任务目录</div> <div style="margin-bottom:50px"> 任务目录
<el-tree <el-tree
:data="taskTreeDatas" :data="moduleTreeDatas[modIndex].children"
node-key="id" current-node-key
default-expand-all node-key="id"
:expand-on-click-node="false" :props="defaultProps"
/> default-expand-all
</el-card> :expand-on-click-node="false"
<el-card style="margin-top: 10px;"> :highlight-current="false"
<div style="padding:10px"> 评分规则</div> style="background: transparent;color: #fff;"
<el-table />
:data="ruleData" </div>
border <div class="tabs-module-card-button">
show-summary <div style="display: flex; justify-content: center;margin-top: 10px;">
:summary-method="getSummaries" <el-button type="primary" size="medium" @click="showScoreRule(mod.moduleScoreRuleId)">评分表</el-button>
style="width: 100%;margin-top: 10px;" <el-button type="primary" size="medium" @click="beginExercise(mod.customModuleId)">开始训练</el-button>
> </div>
<el-table-column type="index" width="50" /> </div>
<el-table-column label="描述" prop="text" /> </el-card>
<el-table-column label="作业程序" prop="worker" /> </template>
<el-table-column label="分值" prop="score" width="50" /> </div>
<el-table-column label="评分标准" prop="criteria" /> </el-tab-pane>
</el-table>
</el-card>
<div style="display: flex; justify-content: center;margin-top: 10px;">
<el-button type="primary" size="medium" @click="beginExercise(mod.customModuleId)">开始训练</el-button>
</div>
</el-tab-pane>
</template>
</el-tabs> </el-tabs>
<score-rule ref="scoreRule" />
</div> </div>
</div> </div>
</template> </template>
@ -51,6 +44,7 @@
<script> <script>
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 { getPaperDetail, getContextScoreDetail} from '@/api/contest'; import { getPaperDetail, getContextScoreDetail} from '@/api/contest';
let id = 1; let id = 1;
@ -58,18 +52,22 @@ export default {
name: 'ContestList', name: 'ContestList',
components: { components: {
paperList, paperList,
drapLeft drapLeft,
ScoreRule
}, },
data() { data() {
return { return {
widthLeft: 380, widthLeft: 380,
paperName:'试卷', paperName:'试卷',
paperId:'', paperId:'',
activeModuleName:'', activeModuleName:'detail',
moduleList:[], moduleList:[],
moduleTreeDatas:[], moduleTreeDatas:[],
taskTreeDatas:[], taskTreeDatas:[],
ruleData:[] ruleData:[],
defaultProps: {
disabled: true
}
}; };
}, },
computed: { computed: {
@ -86,7 +84,6 @@ export default {
this.paperId = paper.id; this.paperId = paper.id;
getPaperDetail(paper.id).then((res) => { getPaperDetail(paper.id).then((res) => {
this.moduleList = res.data.moduleVo.modules; this.moduleList = res.data.moduleVo.modules;
this.activeModuleName = this.moduleList[0].customModuleId + '';
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{ this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
let children = []; let children = [];
if (moduleItem.group.length) { if (moduleItem.group.length) {
@ -117,34 +114,12 @@ export default {
this.ruleData = res.data.rule ? res.data.rule.units : []; this.ruleData = res.data.rule ? res.data.rule.units : [];
}).catch(() => { this.ruleData = []; }); }).catch(() => { this.ruleData = []; });
}, },
showScoreRule(moduleScoreRuleId) {
this.$refs.scoreRule.doShow(moduleScoreRuleId);
},
beginExercise(moduleId) { beginExercise(moduleId) {
this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }}); this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }});
}, },
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总分';
return;
}
if (index === 3) {
const values = data.map(item => Number(item[column.property]));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += '';
} else {
sums[index] = '/';
}
});
return sums;
},
transformTree(data) { transformTree(data) {
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' }; const result = {label:data.name, children:[], id:id++, type:'taskCatalog' };
if (data.group.length) { if (data.group.length) {
@ -189,11 +164,36 @@ export default {
} }
&::-webkit-scrollbar-track{ &::-webkit-scrollbar-track{
background: #06284a; background: #06284a;
} }
} .tabs-module{
display: flex;
justify-content: space-between;
color: #fff;
.tabs-module-card{
position: relative;
width:49%;
margin-top: 10px;
padding:10px;
background: transparent;
color: #fff;
.tabs-module-card-button{
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
}
}
}
}
} }
} }
.el-card{
border: solid 1px #01468B;
}
/deep/{ /deep/{
.el-tree-node__content:hover, .el-upload-list__item:hover {
background-color: #00172E !important;
}
.el-tabs__nav-scroll{ .el-tabs__nav-scroll{
background: #00172E; background: #00172E;
} }

View File

@ -91,9 +91,6 @@ export default {
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
queryChildrenTask() {
console.log(111);
},
creatTask() { creatTask() {
this.$refs.addEditTask.doShow(); this.$refs.addEditTask.doShow();
}, },