/*
|
* @Author: Morpheus
|
* @Date: 2021-07-31 16:31:54
|
* @Last Modified by: Morpheus
|
* @Last Modified time: 2021-07-18 17:09:52
|
* menu-name 考试管理
|
*/
|
<template>
|
<div class="exam">
|
<button class="logout"
|
onmouseover="this.style.backgroundColor='red';"
|
onmouseout="this.style.backgroundColor='';"
|
@click="handleLogout">退出系统</button>
|
<avue-data-pay :option="option" v-if="pageDisable"></avue-data-pay>
|
<div class="no" v-if="!pageDisable">
|
<span>没有找到相应的考试信息</span>
|
</div>
|
</div>
|
|
</template>
|
|
|
<script>
|
import { mapState } from 'vuex';
|
import {getExamDetail} from "@/api/examapi/examination";
|
import {updateApplyStatus} from "@/api/examapi/applyexam";
|
export default {
|
|
data(){
|
return {
|
resData:null,
|
sex:"",
|
pageDisable:false,
|
option: {
|
span: 8,
|
data: []
|
},
|
}
|
},
|
computed: {
|
...mapState({
|
userInfo: state => state.user.userInfo
|
})
|
},
|
mounted() {
|
//获取数据
|
this.getUserInfoBYExam();
|
window.startExam=this.startExam;
|
},
|
methods:{
|
//退出登录
|
handleLogout() {
|
this.$confirm("是否退出系统, 是否继续?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
}).then(() => {
|
this.$store.dispatch("LogOut").then(() => {
|
this.$router.push({ path: "/login" });
|
});
|
});
|
},
|
//开始考试跳转
|
startExam () {
|
var that = this;
|
//去修改考试状态
|
var data = {
|
id:that.resData.applyId,
|
examType:this.resData.examType
|
}
|
updateApplyStatus(data).then(() => {
|
})
|
this.$router.push({
|
path: `/startexam/${that.resData.id}`,
|
query: that.resData
|
})
|
},
|
getUserInfoBYExam(){
|
var that = this;
|
getExamDetail(this.userInfo.user_id).then((res) => {
|
that.resData = res.data.data[0];
|
var data = res.data.data[0];
|
// debugger;
|
if(res.data.data.length>0){
|
that.pageDisable = true;
|
if(data.sex==1){
|
that.sex = "男"
|
}
|
if(data.sex==2){
|
that.sex = "女"
|
}
|
that.option.data = [
|
{
|
title: that.resData.examName,
|
color: '#ffa820',
|
subtext: '开始考试',
|
click: function () {
|
window.parent.startExam();
|
},
|
list: [
|
{
|
title: '姓名: '+that.resData.realName,
|
check: true,
|
},
|
{
|
title: '准考证号: '+that.resData.candidateNo,
|
check: true,
|
},
|
{
|
title: '身份证号: '+that.resData.idCardNo,
|
check: true,
|
},
|
{
|
title: '性别: '+that.sex,
|
check: true,
|
}
|
]
|
}
|
]
|
}
|
|
},
|
|
(error) => {
|
window.console.log(error);
|
}
|
);
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.exam{
|
width: 100%;
|
height: 100%;
|
position: fixed;
|
align-items: center;
|
justify-items: center;
|
}
|
|
.avue-data-pay .item {
|
margin-left: 100% !important;
|
width: 100% !important;
|
min-height: 400px;
|
margin-top: 240px;
|
}
|
|
.list {
|
margin-left: 28% !important;
|
}
|
|
.avue-data-pay .img {
|
display: none;
|
}
|
|
.avue-data-pay .title {
|
padding: 40px 0 10px;
|
}
|
|
|
.no {
|
background-color: #fff;
|
width: 30%;
|
height: 200px;
|
border-radius: 5px;
|
margin: 0 auto;
|
margin-top: 15%;
|
text-align: center;
|
line-height: 200px;
|
|
span{
|
letter-spacing: 1px;
|
color: blueviolet;
|
font-size: 15px;
|
}
|
}
|
|
.logout{
|
border: 0px;
|
margin-left: 92%;
|
margin-top: 30px;
|
border-radius: 5px;
|
font-size: 14px;
|
width: 80px;
|
height: 30px;
|
letter-spacing: 1px;
|
}
|
</style>
|