mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-18 23:36:44 +08:00
2022年5月29日从svn移到git
This commit is contained in:
186
src/views/exam/MyExamTask.vue
Normal file
186
src/views/exam/MyExamTask.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<!--我的独立考试-->
|
||||
<div>
|
||||
<div style="display: flex; justify-content: flex-start;padding:12px 20px 10px 22px" >
|
||||
<!--查询-->
|
||||
<div style="padding: 0px 0px">
|
||||
<el-select clearable v-model="status" placeholder="状态" style="width: 110px">
|
||||
<el-option label="未开始" :value="0"></el-option>
|
||||
<el-option label="进行中" :value="1"></el-option>
|
||||
<el-option label="中断" :value="8"></el-option>
|
||||
<el-option label="完成" :value="9"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="padding-left: 10px">
|
||||
<el-input v-model="testName" clearable placeholder="搜索名称"></el-input>
|
||||
</div>
|
||||
<div class="button-class" style="padding-left: 10px"><el-button type="primary" icon="el-icon-search" @click="search()">搜索</el-button></div>
|
||||
<div class="button-class" style="padding-left: 10px"><el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button></div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div v-for="(item,idx) in taskList" :key="idx" class="titem">
|
||||
<!-- <div><a :href="webBaseUrl+'/exam/test?id='+item.objId" target="_blank"> {{item.objId}}</a></div> -->
|
||||
<div class="task-info">
|
||||
<div @click="jumpRouter(item)" v-html="$keywordActiveShow(item.testName,testName)" class="task-tit one-line-ellipsis">
|
||||
</div>
|
||||
<div class="task-text">
|
||||
考试状态:
|
||||
<span v-if="item.status == 0">未开始</span>
|
||||
<span v-if="item.status == 1">进行中</span>
|
||||
<span v-if="item.status == 8">中断</span>
|
||||
<span v-if="item.status == 9">完成</span>
|
||||
<span style="margin-left: 20px;" v-if="item.status == 9">
|
||||
分数:{{toScoreTow(item.score)}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="task-time">
|
||||
入场时间:<span>{{ item.startTime}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-btns" >
|
||||
<a v-if="item.status == 0" :href="webBaseUrl+'/exam/test?id='+item.testId" target="_blank" >
|
||||
<el-button type="primary" size="small">开始考试</el-button>
|
||||
</a>
|
||||
<a v-if="item.status == 1 && 8" :href="webBaseUrl+'/exam/test?id='+item.testId" target="_blank" >
|
||||
<el-button type="primary" size="small">继续考试</el-button>
|
||||
</a>
|
||||
<!-- <a v-if="item.status == 9" :href="webBaseUrl+'/exam/test?id='+item.testId" target="_blank" >
|
||||
<el-button type="primary" size="small">回顾考试</el-button>
|
||||
</a> -->
|
||||
|
||||
<el-button type="primary" v-if="item.status == 9" size="small" @click="jumpRouter(item)">查看</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="taskList.length > 0 " style="text-align: center;margin-top:70px">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="taskList.length == 0">
|
||||
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
|
||||
<div v-else class="zan-wu">暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import apiExamTask from "@/api/modules/examTask";
|
||||
import {toScoreTow} from '@/utils/tools.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isSearh:false,
|
||||
toScoreTow,
|
||||
taskList:[],
|
||||
total:0,
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
testName:'',
|
||||
status:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.query();
|
||||
},
|
||||
methods:{
|
||||
query(){
|
||||
let params={
|
||||
pageIndex:this.pageIndex,
|
||||
pageSize:this.pageSize,
|
||||
testName:this.testName,
|
||||
status:this.status
|
||||
}
|
||||
|
||||
apiExamTask.myList(params).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.taskList=rs.result.list;
|
||||
this.total=rs.result.count;
|
||||
}
|
||||
})
|
||||
},
|
||||
search(){
|
||||
this.isSearh = true;
|
||||
this.query()
|
||||
},
|
||||
reset() {
|
||||
this.testName = '';
|
||||
this.status='';
|
||||
this.query();
|
||||
this.isSearh = false;
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.query()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageIndex = val
|
||||
this.query()
|
||||
},
|
||||
jumpRouter(item){
|
||||
window.open(`${this.webBaseUrl}/exam/test?id=${item.testId}` )
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.one-line-ellipsis {
|
||||
display: -webkit-box;
|
||||
white-space: pre-wrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.titem{
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
// padding: 10px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 15px 0px;
|
||||
margin: 0 10px;
|
||||
.task-info{
|
||||
flex: 1;
|
||||
// padding: 0px 10px;
|
||||
margin-left:10px;
|
||||
.task-tit{
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
margin-top: -3px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.task-text{
|
||||
color: #444;
|
||||
font-size: 16px;
|
||||
line-height: 45px;
|
||||
}
|
||||
.task-time{
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.task-btns {
|
||||
text-align: right;
|
||||
margin-top: 40px;
|
||||
width: 100px;
|
||||
// height: 44px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user