Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
c7a622eadf
@ -51,6 +51,19 @@ export function deletePaper(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取竞赛试卷菜单
|
||||||
|
* @param {Object} params
|
||||||
|
* @param {String} params.group 分组ZZ=中职;GZ=高职
|
||||||
|
*/
|
||||||
|
export function getPaperMenu(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/exercise/race/paper/menu',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** 模块修改任务设置
|
/** 模块修改任务设置
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
* @param {Array} data.modules 所有模块
|
* @param {Array} data.modules 所有模块
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
<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">
|
<el-tabs v-model="activeModuleName" class="tabs-box" type="border-card">
|
||||||
<el-tab-pane label="详情" name="detail">
|
<el-tab-pane label="详情" name="detail">
|
||||||
<div class="tabs-module">
|
<div v-if="showSeasonInfo" class="tabs-season" v-html="detailHtmlContent" />
|
||||||
|
<div v-else class="tabs-module">
|
||||||
<template v-for="(mod, modIndex) in moduleList">
|
<template v-for="(mod, modIndex) in moduleList">
|
||||||
<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>
|
||||||
@ -58,7 +59,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
widthLeft: 380,
|
widthLeft: 380,
|
||||||
paperName:'试卷',
|
paperName:'赛季',
|
||||||
paperId:'',
|
paperId:'',
|
||||||
activeModuleName:'detail',
|
activeModuleName:'detail',
|
||||||
moduleList:[],
|
moduleList:[],
|
||||||
@ -67,7 +68,9 @@ export default {
|
|||||||
defaultProps: {
|
defaultProps: {
|
||||||
disabled: true
|
disabled: true
|
||||||
},
|
},
|
||||||
allTaskDatas:{}
|
allTaskDatas:{},
|
||||||
|
showSeasonInfo:false,
|
||||||
|
detailHtmlContent:'赛季信息'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -90,9 +93,11 @@ export default {
|
|||||||
drapWidth(width) {
|
drapWidth(width) {
|
||||||
this.widthLeft = Number(width);
|
this.widthLeft = Number(width);
|
||||||
},
|
},
|
||||||
changeModuleData(paper) {
|
changeModuleData(paper, season) {
|
||||||
|
if (paper) {
|
||||||
this.paperName = paper.name;
|
this.paperName = paper.name;
|
||||||
this.paperId = paper.id;
|
this.paperId = paper.id;
|
||||||
|
this.showSeasonInfo = false;
|
||||||
getPaperDetail(paper.id).then((res) => {
|
getPaperDetail(paper.id).then((res) => {
|
||||||
this.moduleList = res.data.moduleVo.modules;
|
this.moduleList = res.data.moduleVo.modules;
|
||||||
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
|
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
|
||||||
@ -114,6 +119,12 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(error.message);
|
this.$message.error(error.message);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.showSeasonInfo = true;
|
||||||
|
this.paperName = season.seasonCode + '—' + season.seasonName;
|
||||||
|
this.detailHtmlContent = season.detailHtmlContent;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
showScoreRule(moduleScoreRuleId) {
|
showScoreRule(moduleScoreRuleId) {
|
||||||
this.$refs.scoreRule.doShow(moduleScoreRuleId);
|
this.$refs.scoreRule.doShow(moduleScoreRuleId);
|
||||||
@ -180,6 +191,10 @@ export default {
|
|||||||
&::-webkit-scrollbar-track{
|
&::-webkit-scrollbar-track{
|
||||||
background: #06284a;
|
background: #06284a;
|
||||||
}
|
}
|
||||||
|
.tabs-season{
|
||||||
|
padding:10px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
.tabs-module{
|
.tabs-module{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -9,19 +9,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="defaultIndex"
|
|
||||||
class="el-menu-vertical"
|
class="el-menu-vertical"
|
||||||
background-color="#ffffff00"
|
background-color="#ffffff00"
|
||||||
text-color="#fff"
|
text-color="#fff"
|
||||||
active-text-color="#ffd04b"
|
active-text-color="#ffd04b"
|
||||||
|
:default-openeds="defaultOpenIndex"
|
||||||
|
:default-active="defaultIndex"
|
||||||
|
@open="handleOpen"
|
||||||
>
|
>
|
||||||
<el-submenu v-for="(paper,paperIndex) in paperList" :key="paperIndex" :index="paper.id+''" @click="showPaperDetail(paper)">
|
<el-submenu v-for="season in seasonMenu" :key="season.seasonId" :index="season.seasonId+''" @click="showPaperDetail(season)">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span> {{ paper.name }}</span>
|
<span> {{ season.seasonCode + '—'+season.seasonName }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-for="(paper2,paperIndex2) in paperList">
|
<template v-for="paper in season.papers">
|
||||||
<el-menu-item v-show="!formModel.seasonId||paper.seasonId==formModel.seasonId" :key="paperIndex2" :index="paper2.id+''" @click="showPaperDetail(paper)">
|
<el-menu-item :key="paper.id" :index="paper.id+''" @click="showPaperDetail(paper)">
|
||||||
{{ paper2.name }}
|
{{ paper.name }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</template>
|
</template>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
@ -30,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { queryContestSeasonPaged, getPaperList} from '@/api/contest';
|
import { getPaperMenu } from '@/api/contest';
|
||||||
export default {
|
export default {
|
||||||
name: 'PaperList',
|
name: 'PaperList',
|
||||||
components: {
|
components: {
|
||||||
@ -42,41 +44,30 @@ export default {
|
|||||||
group:'GZ' // 高职和中职
|
group:'GZ' // 高职和中职
|
||||||
},
|
},
|
||||||
seasonOptions:[],
|
seasonOptions:[],
|
||||||
paperList:[],
|
seasonMenu:[],
|
||||||
defaultIndex: ''
|
defaultIndex: '',
|
||||||
|
defaultOpenIndex:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loading = false;
|
this.queryPaper();
|
||||||
getPaperList({ group:'GZ', pageSize:999}).then((res) => {
|
|
||||||
this.paperList = res.data.list;
|
|
||||||
this.defaultIndex = this.paperList[0].id + '';
|
|
||||||
this.$emit('changeModuleData', this.paperList[0]);
|
|
||||||
});
|
|
||||||
this.querySeason();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
queryPaper() {
|
queryPaper() {
|
||||||
getPaperList({ group:this.formModel.group, pageSize:999}).then((res) => {
|
getPaperMenu({ group:this.formModel.group}).then((res) => {
|
||||||
this.paperList = res.data.list;
|
this.seasonMenu = res.data.menu;
|
||||||
});
|
this.$emit('changeModuleData', null, this.seasonMenu[0]);
|
||||||
this.querySeason();
|
this.defaultOpenIndex = [this.seasonMenu[0].seasonId + ''];
|
||||||
},
|
this.defaultIndex = '';
|
||||||
querySeason() {
|
this.loading = false;
|
||||||
queryContestSeasonPaged({pageSize:999, group:this.formModel.group }).then((res) => {
|
}).catch(error => {
|
||||||
this.seasonOptions = res.data.list;
|
this.$message.error(error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
filterPaper() {
|
handleOpen(key) {
|
||||||
if (this.formModel.seasonId) {
|
this.defaultIndex = '';
|
||||||
const paper = this.paperList.find(paper=>paper.seasonId == this.formModel.seasonId);
|
const seasonData = this.seasonMenu.find(season=>season.seasonId == key);
|
||||||
this.defaultIndex = paper.id + '';
|
this.$emit('changeModuleData', null, seasonData);
|
||||||
this.$emit('changeModuleData', paper);
|
|
||||||
} else {
|
|
||||||
this.defaultIndex = this.paperList[0].id + '';
|
|
||||||
this.$emit('changeModuleData', this.paperList[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
showPaperDetail(paper) {
|
showPaperDetail(paper) {
|
||||||
this.$emit('changeModuleData', paper);
|
this.$emit('changeModuleData', paper);
|
||||||
|
Loading…
Reference in New Issue
Block a user