You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1279 lines
37 KiB

<template>
<div>
3 years ago
<!-- <transition name="slide-fade" enter-active-class="animate__animated animate__bounceInLeft" leave-active-class=" animate__animated animate__bounceOutLeft"> -->
2 years ago
3 years ago
<el-container v-show="showIt">
<el-header>
<div class="flex a-center j-between">
10 months ago
<div class="flex a-center" style="width: 28%">
<p>实训项目</p>
10 months ago
<el-select v-model.trim="projectId" placeholder="请选择" class="select" disabled @change="selectProject">
<el-option v-for="item in topicList" :key="item.projectId" :label="item.projectName"
:value="item.projectId"></el-option>
</el-select>
</div>
<div class="countDownBox">
<div style="margin-left: -40px;">
10 months ago
<div :sendSync="sendSync" :autoStart="autoStart" :defaultVal="defaultVal">
实训{{ text }}时间
<span class="timeSpan">{{ day }}</span>
<span class="timeSpan">{{ hour }}</span>小时
<span class="timeSpan">{{ minutes }}</span>
<span class="timeSpan">{{ seconds }}</span>
</div>
</div>
</div>
<div class="countDownBox">
<div>
总得分
10 months ago
<span class="gradeSpan">{{ grade }}</span>
</div>
</div>
<div>
10 months ago
<el-button @click="toReport" v-if="popContainer">查看实验报告</el-button>
<el-button style="background: #202020;color: #d0d0d0;font-size:16px;" v-show="projectPermissions == 0"
@click="reload"
:disabled="popContainer && (assessmentId != '' && assessmentId != 'null' && assessmentId != null)">
2 years ago
重新开始
3 years ago
</el-button>
10 months ago
<el-button class="submit-btn" style="margin-right:7px" @click="Submit()"
:disabled="popContainer || requires.length == 0">提交</el-button>
</div>
</div>
</el-header>
3 years ago
<el-container>
10 months ago
<el-aside width="30%" class="flex flex-col">
<div class="aside-header">
<div class="header_h flex a-center">
<i class="el-icon-s-order"></i>
<p>实验目标</p>
</div>
<div class="font_css">
<div class="experimentalGoal">
10 months ago
<div class="break-all" v-html="projectManage.experimentTarget" style="font-size: 0.875rem;">
</div>
</div>
</div>
</div>
3 years ago
<div class="aside-footer flex-grow">
<div class="header_h flex a-center">
<i class="el-icon-s-management"></i>
<p>实验任务</p>
</div>
<div>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
10 months ago
<el-table :data="requires" height="43.5vh" v-loading="loading" ref='testTable'>
<el-table-column type="index"></el-table-column>
10 months ago
<el-table-column prop="name" label="判分点" align="left">
</el-table-column>
10 months ago
<el-table-column prop="score" label="分值" width="60" align="center">
3 years ago
</el-table-column>
10 months ago
<el-table-column prop="right" label="完成结果" width="80" align="center">
<template slot-scope="scope">
10 months ago
<i v-if="scope.row.right == true" class="el-icon-check" style="color:green;"></i>
<i v-else-if="scope.row.right == false" class="el-icon-close" style="color:red;"></i>
</template>
</el-table-column>
10 months ago
<el-table-column prop="scores" label="得分" width="60" align="center"></el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</div>
</div>
</el-aside>
<el-main>
10 months ago
<el-tabs v-model.trim="activeName" type="card">
<el-tab-pane label="案例" name="first">
<div class="break-all" v-html="projectManage.experimentDescription"></div>
</el-tab-pane>
10 months ago
<el-tab-pane label="实验要求" name="second">
<el-collapse :value="activeNames" accordion>
<el-collapse-item v-for="(item, index) in requires" :key="index" :name="item.id">
<template slot="title" style='line-height: 0px;'>
2 years ago
<i class='el-icon-s-ticket'></i>
<span style="margin: 0px 10px;font-size: 1rem;">{{ item.name }}</span>
</template>
10 months ago
<div class="break-all" v-html="item.experimentalRequirements"></div>
</el-collapse-item>
3 years ago
<!-- <p ref="scrollTag" style="font-size:16px;"></p> -->
</el-collapse>
</el-tab-pane>
10 months ago
<el-tab-pane label="实验提示" name="fifth" v-if="hintOpen == 0">
<div class="break-all" v-html="projectManage.experimentHint"></div>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</el-container>
3 years ago
<!-- </transition> -->
<!-- </div> -->
10 months ago
<div class="panel" :class="{ active: showIt }">
<div @click="toggleCase">
10 months ago
<img src="../../assets/img/case/left.png" alt v-if="showIt" />
<img src="../../assets/img/case/right.png" alt v-else />
</div>
</div>
3 years ago
10 months ago
<div class='popContainer' v-if='popContainer'></div>
3 years ago
3 years ago
<!-- 遮罩层 -->
10 months ago
<div class="absolute z-50 h-screen bg-transparent inset-0" v-show="showIt"></div>
3 years ago
10 months ago
<el-dialog title="提示" :visible.sync="closePaneJudge" width="30%" center>
3 years ago
<h4 class="antialiased text-center text-2xl">请选择你将进行的操作</h4>
10 months ago
<span slot="footer" class="dialog-footer">
3 years ago
<el-button @click="closePane()">再试一次</el-button>
3 years ago
<!-- <el-button type="primary" @click="closePane(true)">其他业务</el-button> -->
3 years ago
</span>
</el-dialog>
2 years ago
</div>
2 years ago
</template>
<script>
import Cookie from 'js-cookie'
import util from '@/libs/util'
import Setting from '@/setting'
// 引入封装好的接口
2 years ago
import { getProjectBySystemId, getProjectDetail, submit, getQueryCache, deleteCache, checkTest, checkTest2 } from "@/api/http.js";
import { mapMutations } from 'vuex'
2 years ago
import { async } from 'q';
2 years ago
import Bus from '@/libs/bus'
export default {
3 years ago
props: {
sendSync: {
type: Boolean,
default: false
},
autoStart: {
type: Boolean,
default: false
},
defaultVal: {
type: Number,
default: null
},
showIt: {
type: Boolean,
required: true
}
},
2 years ago
data () {
return {
3 years ago
closePaneJudge: false,
lockIt: false,
3 years ago
intervalJudge: {},
systemId: Setting.systemId,
workbench: [],
test: [],
caseVisible: true,
grade: "00",
exampleData: "",
codeid: "",
judgmentPointsIds: [],
text: "",
isStart: false,
globalTimer: null, //获取setInterval对象值
millisecond: 0,
countVal: this.defaultVal, //获取初始值
pauseTime: 0,
day: '00',
seconds: '00',
minutes: '00',
hour: '00',
createTime: "", //开始时间
actEndTime: "", //倒计时结束时间
projectId: "" || sessionStorage.getItem('projectId'), //选中后绑定的对象
value: [
2 years ago
{ projectName: '项目1', projectId: 1 }
],
experimentalGoal: "", //实验目标
caseDescription: "", //案例描述
experimentSuggests: "", //实验提示
judgmentPointsName: "", // 判分点名称
points: [],
3 years ago
// activeNames: [],
tableData: [],
activeName: "first",
schoolId: '',
studentId: "",
courseId: "",
assessmentId: "",
2 years ago
classId: '',
projectPermissions: 0, //项目权限(0、练习 1、考核 2、竞赛)
2 years ago
competitionId: '',
stageId: '',
teamId: '',
isSubmit: false,
entryTime: util.formatDate('yyyy-MM-dd hh:mm:ss'),
startTime: '',
stopTime: '',
isSelected: false,
userId: '',
2 years ago
hintOpen: 0,
topicList: [],
projectManage: {},
requires: [],
projectName: '',
loading: false,
sss: 1,
popContainer: false,
timestamp: '',
2 years ago
curSystemId: '',
2 years ago
reportId: '',
submitType: false
}
},
2 years ago
created () {
3 years ago
let assessmentId = this.getQueryVariable('assessmentId')
2 years ago
sessionStorage.setItem('assessmentId', assessmentId)
3 years ago
this.assessmentId = assessmentId
2 years ago
if (assessmentId == '' || assessmentId == null || assessmentId == 'null') {
3 years ago
2 years ago
} else {
this.intervalJudge = setInterval(() => {
const data = {
id: parseInt(sessionStorage.getItem('assessmentId')),
}
checkTest(data).then(data => {
const { data: { data: { status } } } = data
if (status !== 1) {
this.popContainer = true
clearInterval(this.intervalJudge)
this.$alert('考试已结束,已自动为您提交。', '提示', {
confirmButtonText: '确定',
type: 'warning',
center: true
});
// 提交
this.sureSubmit(true)
} else {
}
})
}, 4000)
3 years ago
}
2 years ago
Bus.$on('setSubmited', data => {
this.popContainer = data
})
3 years ago
},
watch: {
countVal: {
deep: true,
2 years ago
handler: function (val, oldVal) {
let vm = this;
if (vm.needSendSunc) {
vm.passToParent(val);
}
}
},
needSendSunc: {
deep: true,
2 years ago
handler: function (val) {
let vm = this;
if (val) {
vm.passToParent(vm.countString);
}
}
3 years ago
},
3 years ago
// caseVisible(newVal) {
// if(!newVal) {
// console.log(this.$refs.scrollTag)
// }
// }
},
2 years ago
computed: {
2 years ago
needSendSunc: function () {
return this.sendSync;
},
// 倒计时
2 years ago
second: function () {
return this.num(this.seconds);
},
2 years ago
minute: function () {
return this.num(this.minutes);
3 years ago
},
2 years ago
activeNames () {
3 years ago
// 默认展开所有
return this.requires.map(item => item.id)
},
},
2 years ago
mounted () {
let token = sessionStorage.getItem('token') || this.getQueryVariable('token')
let cid = sessionStorage.getItem('cid') || this.getQueryVariable('cid')
let systemId = sessionStorage.getItem('systemId') || this.getQueryVariable('systemId')
2 years ago
let projectId = this.getQueryVariable('projectId')
2 years ago
if (sessionStorage.getItem('projectId')) {
projectId = sessionStorage.getItem('projectId')
}
let assessmentId = sessionStorage.getItem('assessmentId') || this.getQueryVariable('assessmentId')
let competitionId = sessionStorage.getItem('competitionId') || this.getQueryVariable('competitionId')
let stageId = sessionStorage.getItem('stageId') || this.getQueryVariable('stageId')
let teamId = sessionStorage.getItem('teamId') || this.getQueryVariable('teamId')
let classId = sessionStorage.getItem('classId') || this.getQueryVariable('classId')
let stopTime = sessionStorage.getItem('stopTime') || this.getQueryVariable('stopTime')
2 years ago
let mallId = sessionStorage.getItem('mallId') || this.getQueryVariable('mallId')
2 years ago
let timestamp = +stopTime;
if (timestamp != null) {
} else {
sessionStorage.setItem('timestamp', null)
}
if (token != null) {
sessionStorage.setItem('token', token)
sessionStorage.setItem('cid', cid)
sessionStorage.setItem('systemId', systemId)
sessionStorage.setItem('timestamp', timestamp)
sessionStorage.setItem('projectId', projectId)
sessionStorage.setItem('assessmentId', assessmentId)
sessionStorage.setItem('competitionId', competitionId)
sessionStorage.setItem('stageId', stageId)
sessionStorage.setItem('teamId', teamId)
sessionStorage.setItem('classId', classId)
this.assessmentId = assessmentId
this.competitionId = JSON.parse(competitionId)
this.stageId = stageId
this.teamId = teamId
this.classId = classId
2 years ago
this.mallId = mallId
2 years ago
}
let tokens = sessionStorage.getItem('token')
if (tokens || token) {
this.projectPermissions = this.assessmentId ?
1 :
this.competitionId ?
2 :
0
this.assessmentId && this.projectId && this.checkVer()
if (JSON.parse(assessmentId != null && assessmentId != '' && assessmentId != 'null' || this.competitionId)) {
this.selectProjects({
projectId
})
} else {
this.getData()
}
2 years ago
}
},
methods: {
...mapMutations({
1 year ago
setPopId: 'system/setPopId',
2 years ago
setBusinessKey: 'system/setBusinessKey',
2 years ago
initState: 'system/initState',
setShowBusiness: 'system/setShowBusiness',
}),
2 years ago
clearStore () {
3 years ago
// // 清空缓存
3 years ago
let token = sessionStorage.getItem('token')
let cid = sessionStorage.getItem('cid')
let systemId = sessionStorage.getItem('systemId')
let projectId = sessionStorage.getItem('projectId')
3 years ago
let assessmentId = sessionStorage.getItem('assessmentId')
let classId = sessionStorage.getItem('classId')
let timestamp = sessionStorage.getItem('timestamp')
let startTime = sessionStorage.getItem('startTime')
2 years ago
3 years ago
const storeProjectId = sessionStorage.getItem('storeProjectId')
3 years ago
sessionStorage.clear()
sessionStorage.setItem('token', token)
sessionStorage.setItem('cid', cid)
sessionStorage.setItem('systemId', systemId)
sessionStorage.setItem('projectId', projectId)
2 years ago
sessionStorage.setItem('firstLoad2', true)
2 years ago
if (assessmentId) {
3 years ago
sessionStorage.setItem('assessmentId', assessmentId)
}
2 years ago
if (classId) {
3 years ago
sessionStorage.setItem('classId', classId)
}
2 years ago
if (timestamp) {
3 years ago
sessionStorage.setItem('timestamp', timestamp)
}
2 years ago
if (startTime) {
3 years ago
sessionStorage.setItem('startTime', startTime)
}
2 years ago
if (storeProjectId) {
3 years ago
sessionStorage.setItem('storeProjectId', storeProjectId)
}
2 years ago
3 years ago
// 初始化vuex中的state
this.initState();
},
2 years ago
closePane (judge = false) {
3 years ago
this.closePaneJudge = false
3 years ago
// this.lockIt = false
3 years ago
this.reload()
2 years ago
if (judge) {
3 years ago
this.toggleCase()
}
3 years ago
},
2 years ago
getQueryVariable (name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
if (window.location.href.split('?')[1]) {
var r = window.location.href.split('?')[1].match(reg)
if (r != null) {
return (r[2])
} else {
return null
3 years ago
}
2 years ago
}
// if(sessionStorage.getItem(name)) {
// return sessionStorage.getItem(name)
// }else {
// var reg = new RegExp('(^|&)'+name+'=([^&]*)(&|$)')
// if(window.location.href.split('?')[1]){
// var r = window.location.href.split('?')[1].match(reg)
// if (r != null){
// return (r[2])
// }else{
// return null
// }
// }
// }
3 years ago
},
//获取项目列表
2 years ago
getData () {
let params = {
2 years ago
"systemId": sessionStorage.getItem('systemId'),
"cId": sessionStorage.getItem('cid'),
"permissions": 0,
2 years ago
mallId: this.mallId
}
2 years ago
getProjectBySystemId(params).then((data) => {
if (data.status == 200) {
// this.getQueryCaches()
//获取当前时间
this.getBeginTime()
this.topicList = []
for (var i = 0; i < data.data.projects.length; i++) {
if (data.data.projects[i].projectId) {
this.topicList.push(data.data.projects[i])
3 years ago
}
2 years ago
}
if (this.topicList.length > 0) {
const storeProjectId = sessionStorage.getItem('storeProjectId') || this.$route.query.projectId
if (storeProjectId) {
this.selectProjects({
projectId: storeProjectId
})
} else {
this.selectProjects({
projectId: this.topicList[0].projectId
})
3 years ago
}
2 years ago
this.gotuQueryVariable()
// 加的
}
this.getQueryCaches()
}
2 years ago
}).catch((error) => {
})
},
2 years ago
getBeginTime () {
let dates = new Date().getTime();
let date = new Date(dates)
let y = date.getFullYear();
let MM = date.getMonth() + 1;
MM = MM < 10 ? ('0' + MM) : MM;
let d = date.getDate();
d = d < 10 ? ('0' + d) : d;
let h = date.getHours();
h = h < 10 ? ('0' + h) : h;
let m = date.getMinutes();
m = m < 10 ? ('0' + m) : m;
let s = date.getSeconds();
s = s < 10 ? ('0' + s) : s;
this.startTime = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
sessionStorage.setItem('startTime', this.startTime)
},
getQueryCaches () {
getQueryCache(params).then((data) => {
if (data.data.status == 200) {
this.$confirm('有项目未做完,是否回到未做完的项目?', '提示', {
center: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '切换成功!'
});
this.projectId = data.data.projectId
let params = {
"projectId": data.data.projectId,
}
sessionStorage.setItem('projectId', data.data.projectId)
this.selectProjects(params)
}).catch(() => {
deleteCache().then((data) => {
this.$message({
type: 'info',
message: '已取消'
});
}).catch(() => {
})
this.gotuQueryVariable()
});
} else {
this.gotuQueryVariable()
}
}).catch((error) => {
this.gotuQueryVariable()
})
},
gotuQueryVariable () {
let projectId = sessionStorage.getItem('projectId') || this.getQueryVariable('projectId')
if (projectId) {
this.projectId = projectId
} else {
const storeProjectId = sessionStorage.getItem('storeProjectId')
if (storeProjectId) {
this.projectId = storeProjectId;
} else {
this.projectId = this.topicList[0].projectId;
}
}
sessionStorage.setItem('projectId', this.projectId)
let params = {
"projectId": this.projectId,
}
this.selectProjects(params)
},
selectProjects (params) {
getProjectDetail(params).then((data) => {
if (data.status == 200) {
this.globalTimer = "";
let stopTime = sessionStorage.getItem('timestamp')
let timestamp = +stopTime;
this.countVal = timestamp;
this.sss = 1;
this.hintOpen = data.data.projectManage.hintOpen;
this.countDown(timestamp);
this.curSystemId = data.data.projectManage.systemId
let assessmentId = this.getQueryVariable('assessmentId')
if (assessmentId != null && assessmentId != '' && assessmentId != 'null') {
//获取当前时间
this.getBeginTime()
this.topicList = [data.data.projectManage];
this.projectId = +params.projectId
this.projectName = data.data.projectManage.projectName
this.projectId = data.data.projectManage.projectId;
this.projectManage = data.data.projectManage;
this.requires = data.data.projectJudgmentVos;
} else {
this.projectName = data.data.projectManage.projectName
this.projectId = data.data.projectManage.projectId;
this.projectManage = data.data.projectManage;
this.requires = data.data.projectJudgmentVos;
3 years ago
}
2 years ago
}
}).catch((error) => {
})
},
//选择好题目
2 years ago
selectProject () {
3 years ago
this.lockIt = false
2 years ago
this.submitType = false
3 years ago
this.$router.push('/index/list')
3 years ago
3 years ago
this.$nextTick(() => {
this.clearStore()
})
3 years ago
let params = {
2 years ago
"projectId": this.projectId,
}
3 years ago
sessionStorage.setItem('storeProjectId', this.projectId)
3 years ago
let formList = []
sessionStorage.setItem('ruleReqs', JSON.stringify(formList))
sessionStorage.setItem('accountVoucher', JSON.stringify(formList))
sessionStorage.setItem('accountPasswordAll', '')
sessionStorage.setItem('projectId', this.projectId)
1 year ago
sessionStorage.removeItem('submited', 0)
sessionStorage.removeItem('firstLoad2')
this.setBusinessKey('')
2 years ago
getProjectDetail(params).then((data) => {
if (data.status == 200) {
const { systemId, projectId } = data.data.projectManage
// systemId=11 为银行项目,为其他值则是python项目,直接跳python
if (systemId === 11) {
3 years ago
this.popContainer = false;
this.hintOpen = data.data.projectManage.hintOpen;
this.projectName = data.data.projectManage.projectName;
3 years ago
this.projectId = data.data.projectManage.projectId;
this.projectManage = data.data.projectManage;
this.requires = data.data.projectJudgmentVos;
this.$router.push('/index/list')
} else {
const { cid, curriculumName, token, systemId } = this.$route.query
Cookie.set('admin-assessmentId', '', -1)
Cookie.set('admin-startTime', '', -1)
Cookie.set('admin-stopTime', '', -1)
Cookie.set('admin-projectId', projectId)
Cookie.set('admin-token', token)
Cookie.set('admin-courseId', cid)
Cookie.set('admin-curriculumName', escape(curriculumName))
Cookie.set('admin-systemId', systemId)
// 8个python子系统都跳这个地址,子系统会通过cookie里的systemId识别展示哪套系统
location.href = process.env.NODE_ENV === 'development' ?
3 years ago
`http://${location.hostname}:8085/#/` :
location.href.includes('occupationlab.com') ?
'https://www.occupationlab.com/pyTrials' :
`${location.origin}/pyTrials`
}
}
2 years ago
}).catch((error) => {
})
//获取当前时间
2 years ago
this.getBeginTime()
this.globalTimer = "";
this.countVal = "";
this.day = "00";
this.seconds = "00";
this.minutes = "00";
this.hour = "00";
this.sss = 1
this.startCountFn();
},
2 years ago
// 查看实验报告
2 years ago
toReport () {
this.popContainer = false
// this.setShowBusiness(false)
2 years ago
this.$emit('update:showIt', !this.showIt)
this.$router.push(`/index/report?reportId=${this.reportId}`)
},
//提交
2 years ago
Submit () {
this.$confirm('此操作将视为结束考试, 是否继续?', '提示', {
center: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.sureSubmit(true)
}).catch(() => {
this.$message({
type: "info",
message: "已取消提交"
3 years ago
});
2 years ago
});
3 years ago
},
2 years ago
async sureSubmit (judge) {
// 初始化vuex中的state
// this.initState();
this.actEndTime = new Date().getTime();
let ruleReqs = sessionStorage.getItem('ruleReqs')
7 months ago
let startTime = sessionStorage.getItem('startTime') || this.entryTime
console.log("🚀 ~ sureSubmit ~ this.entryTime:", this.entryTime)
2 years ago
let ruleReqsList = JSON.parse(ruleReqs);
let lcld = []
for (var i = 0; i < this.requires.length; i++) {
lcld.push(this.requires[i].judgmentId)
}
let cid = sessionStorage.getItem('cid')
let params = {
"assessmentId": this.assessmentId,
"classId": this.classId,
"curriculumId": +cid,
"endTime": this.actEndTime,
"lcId": lcld,
"projectId": this.projectId,
"projectName": this.projectName,
"purpose": this.projectManage.experimentTarget,
"ruleReqs": ruleReqsList,
"startTime": startTime,
"submitTime": this.actEndTime,
"systemId": this.curSystemId,
competitionId: this.competitionId,
stageId: this.stageId,
teamId: this.teamId,
2 years ago
mallId: this.mallId
2 years ago
}
this.loading = true;
submit(params).then((data) => {
if (data.status == 200) {
2 years ago
sessionStorage.setItem('firstLoad2', true)
// this.clearStore()
2 years ago
const { retMap } = data.data
this.reportId = retMap.reportId
let firstLoad = null
let firstLoad2 = null
if (sessionStorage.getItem('firstLoad')) {
firstLoad = sessionStorage.getItem('firstLoad')
}
if (sessionStorage.getItem('firstLoad2')) {
firstLoad2 = sessionStorage.getItem('firstLoad2')
}
this.lockIt = true
if (this.assessmentId) {
this.submitType = true
}
if (firstLoad) {
sessionStorage.setItem('firstLoad', firstLoad)
}
if (firstLoad2) {
sessionStorage.setItem('firstLoad2', firstLoad2)
}
let datas = retMap.scoreInfo;
let formList = []
sessionStorage.setItem('ruleReqs', JSON.stringify(formList))
sessionStorage.setItem('accountVoucher', JSON.stringify(formList))
sessionStorage.setItem('accountPasswordAll', '')
sessionStorage.setItem('submited', 1)
let list = this.requires
this.grade = retMap.totalScore
for (var j = 0; j < list.length; j++) {
for (var i = 0; i < datas.length; i++) {
if (datas[i].lcId == list[j].judgmentId) {
list[j].flag = datas[i].flag
list[j].scores = datas[i].questionScore
list[j].right = datas[i].calculate
}
}
2 years ago
}
this.sss = 0;
this.popContainer = true;
if (judge) {
this.$message({
type: 'success',
message: '提交成功'
});
}
this.requires.splice(0, this.requires.length, ...list)
1 year ago
} else {
this.$message({
type: "error",
message: data.message
});
2 years ago
}
this.loading = false
}).catch((error) => {
this.loading = false
})
},
2 years ago
//开始计时
startCountFn () {
if (!this.isStart) {
3 years ago
// this.countVal = this.countVal ? this.countVal : 0;
3 years ago
this.globalTimer = setInterval(() => {
2 years ago
if (this.sss == 0) {
this.globalTimer = null;
clearInterval(this.globalTimer);
} else if (this.timestamp) {
this.counterFn(this.countVal--);
} else {
this.counterFn(this.countVal++);
}
}, 1000);
this.isStart = true;
}
},
2 years ago
//倒计时
countDown (timestamp) {
this.timestamp = timestamp
this.sss = 1;
this.globalTimer = null;
clearInterval(this.globalTimer);
this.startCountFn()
3 years ago
},
2 years ago
counterFn (counterTime) {
if (this.timestamp) {
let countDown = (new Date(counterTime).getTime() - new Date().getTime()) / 1000
if (countDown > 0) {
let d = Math.floor(countDown / (60 * 60 * 24));
let h = Math.floor(countDown / (60 * 60));
let m = Math.floor(countDown % (60 * 60) / 60);
let s = Math.floor(countDown % (60 * 60) % 60);
this.day = `${d > 9 ? d : `0${d}`}`;
this.hour = `${h > 9 ? h : `0${h}`}`;
this.minutes = `${m > 9 ? m : `0${m}`}`;
this.seconds = `${s > 9 ? s : `0${s}`}`;
} else {
this.$confirm('此操作将视为结束考试, 是否继续?', '提示', {
center: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.sureSubmit(true)
}).catch(() => {
// this.$message({
// type: "info",
// message: "已取消提交"
// });
});
// this.$alert('考试已结束,已自动为您提交。', '提示', {
// confirmButtonText: '确定',
// type: 'warning',
// center: true
// });
this.sss = 0
this.sureSubmit(true)
this.day = '00';
this.hour = '00';
this.minutes = '00';
this.seconds = '00';
3 years ago
}
2 years ago
} else {
let leave1 = counterTime % (24 * 3600 * 1); //计算天数后剩余的毫秒数
let leave2 = leave1 % (3600 * 1); //计算小时数后剩余的毫秒数
let leave3 = leave2 % (60 * 1); //计算分钟数后剩余的毫秒数
let day = Math.floor(counterTime / (24 * 3600 * 1)); //计算相差天数
let hour = Math.floor(leave1 / (3600 * 1)); //计算相差小时
let minutes = Math.floor(leave2 / (60 * 1)); //计算相差分钟
let seconds = Math.round(leave3 / 1); //计算相差秒
day = day >= 10 ? day : "0" + day;
hour = hour >= 10 ? hour : "0" + hour;
minutes = minutes >= 10 ? minutes : "0" + minutes;
seconds = seconds >= 10 ? seconds : "0" + seconds;
this.day = day;
this.hour = hour;
this.minutes = minutes;
this.seconds = seconds;
}
},
2 years ago
reload () {
this.submitType = false
this.lockIt = false
this.clearStore()
let token = sessionStorage.getItem('token')
let cid = sessionStorage.getItem('cid')
let systemId = sessionStorage.getItem('systemId')
let projectId = sessionStorage.getItem('projectId')
let formList = []
sessionStorage.setItem('ruleReqs', JSON.stringify(formList))
sessionStorage.setItem('accountVoucher', JSON.stringify(formList))
sessionStorage.setItem('accountPasswordAll', '')
1 year ago
this.setPopId('')
2 years ago
this.setBusinessKey('')
2 years ago
let params = {
"projectId": projectId,
}
this.selectProjects(params)
this.popContainer = false
this.sss = 1
this.startCountFn();
deleteCache().then((data) => {
3 years ago
2 years ago
}).catch(() => {
3 years ago
2 years ago
})
this.globalTimer = "";
this.countVal = "";
this.day = "00";
this.seconds = "00";
this.minutes = "00";
this.hour = "00";
this.grade = '00'
this.$router.push('/index/list')
this.getBeginTime()
},
2 years ago
checkVer () {
let data = {
userId: this.userId,
id: this.assessmentId
}
2 years ago
this.$get(this.api.qualifications, data).then(res => {
if (res.message == 'false') {
this.isSubmit = true;
}
});
},
// 倒计时
2 years ago
timeFormat (param) {
return param < 10 ? "0" + param : param;
},
2 years ago
toggleCase () {
if (this.submitType) return
2 years ago
// if (!this.lockIt) {
this.$emit('update:showIt', !this.showIt)
// } else {
// this.closePaneJudge = true
// }
2 years ago
3 years ago
// this.caseVisible = !this.caseVisible
},
2 years ago
collapse () {
},
2 years ago
passToParent (data) {
this.$emit("getDataFromChild", data);
},
2 years ago
getCookie (cookie_name) {
//获取cookie中指定key的value
var allcookies = document.cookie; //索引长度,开始索引的位置
3 years ago
var cookie_pos = allcookies.indexOf(cookie_name); //如果找到了索引,就代表cookie存在,否则不存在
if (cookie_pos != -1) {
3 years ago
//把cookie_pos放在值的开始,只要给值加1即可
//计算取cookie值得开始索引,加的1为“=”
cookie_pos = cookie_pos + cookie_name.length + 1; //计算取cookie值得结束索引
var cookie_end = allcookies.indexOf(";", cookie_pos);
if (cookie_end == -1) {
cookie_end = allcookies.length;
} //得到想要的cookie的值
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}
return value;
}
}
};
</script>
<style lang="scss" scoped>
3 years ago
$togetherFontSize: 16px;
3 years ago
/deep/ .el-tab-pane {
10 months ago
font-size: 1rem !important;
3 years ago
}
3 years ago
.scrollbar {
10 months ago
z-index: 100000000;
3 years ago
}
3 years ago
.popContainer {
10 months ago
position: absolute;
width: 100%;
/*宽度设置为100%,这样才能使隐藏背景层覆盖原页面*/
height: 100%;
z-index: 1000;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
3 years ago
}
10 months ago
2 years ago
/deep/.el-container {
10 months ago
height: 80%;
10 months ago
&.is-vertical {
position: fixed;
top: 200px;
bottom: 20px;
left: 0;
width: 85%;
height: 70%;
background-color: #f5f5f5;
z-index: 1001;
}
10 months ago
.el-header {
color: #333;
padding: 0 12px 0 20px;
2 years ago
10 months ago
.el-button {
background-color: $main-color;
color: #fff;
border: none;
margin: 5px 0px 5px 5px;
font-size: 16px;
2 years ago
}
10 months ago
.submit-btn {
padding-left: 30px;
padding-right: 30px;
background: $main-color url(../../assets/img/case/btn.png) 0 0/100% 100% no-repeat;
}
10 months ago
}
3 years ago
10 months ago
.el-aside {
font-size: $togetherFontSize;
color: #333;
[class*=' el-icon-'],
[class^='el-icon-'] {
line-height: 40px;
font-size: 16px;
font-size: $togetherFontSize;
2 years ago
}
10 months ago
}
.el-main {
width: 60%;
background-color: #fff;
color: #333;
padding: 0;
font-size: $togetherFontSize;
margin: 0px 20px 10px 10px;
white-space: pre-wrap;
background: #fff url(../../assets/img/case/bg.png) top right no-repeat;
// overflow: visible;
}
.aside-header {
margin: 0px 10px 10px 10px;
background-color: #fff;
font-size: 0.875rem;
}
.aside-footer {
margin: 0px 10px 10px 10px;
background-color: #fff;
}
.header_h {
height: 40px;
background: url(../../assets/img/case/header.png) 0 0/100% 100% no-repeat;
justify-content: center;
i {
color: #fff;
}
10 months ago
p {
line-height: 40px;
font-size: 16px;
color: #fff;
padding-left: 10px;
}
10 months ago
}
2 years ago
10 months ago
.el-card {
border: 0;
border-radius: 0;
.el-card__body {
padding: 0;
}
10 months ago
}
.select {
flex: 1;
input::-webkit-input-placeholder {
color: #333;
}
10 months ago
.el-input__icon {
line-height: 60px;
}
10 months ago
.el-select__caret:before {
content: '\e78f';
font-size: 16px;
padding: 3px;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}
10 months ago
.el-input--suffix .el-input__inner {
color: #333;
font-size: $togetherFontSize;
border-radius: 30px;
border: none;
background-color: #fff;
margin-left: 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
10 months ago
.el-input {
padding: 10px 0;
}
10 months ago
}
.font_css {
margin: 0 10px;
text-indent: 2em;
font-size: $togetherFontSize;
padding: 10px 0;
}
.countDownBox {
font-size: $togetherFontSize;
margin: 0 10px;
padding: 20px 0;
}
.timeSpan {
color: #333333;
padding: 5px 15px;
font-size: $togetherFontSize;
background: #ffffff;
border-radius: 18px;
margin: 0 5px;
text-align: center;
}
.gradeSpan {
color: #878787;
padding: 10px;
font-size: $togetherFontSize;
background: #e0e0e0;
border-radius: 6px;
text-align: center;
}
.el-header /deep/.el-button:hover,
.el-button:focus,
.el-button:active {
background-color: $main-color;
color: #fff;
}
/deep/.el-table {
font-size: 12px;
thead {
color: #fff;
}
10 months ago
.el-table__cell {
padding: 12px 0;
}
10 months ago
.cell {
font-weight: 100;
font-size: 12px;
}
10 months ago
td,
th.is-leaf {
border-bottom: 0 !important;
3 years ago
}
10 months ago
}
.el-table__header-wrapper {
thead {
color: #ffffff;
font-size: 12px;
th {
font-weight: 100;
}
}
10 months ago
th,
tr {
background-color: #badfff;
}
10 months ago
}
.el-table__row--striped {
td {
background-color: #badfff !important;
}
10 months ago
}
/deep/ .el-collapse {
font-size: 0.875rem;
}
.el-collapse-item__content {
padding-left: 10px;
padding-right: 10px;
font-size: $togetherFontSize;
}
.el-collapse-item__wrap {
border-bottom: none;
}
/deep/.el-collapse-item__header {
font-size: 1rem;
border-bottom: none;
}
.el-tabs__content {
margin: 0 20px;
}
.el-icon-s-ticket:before {
font-size: togetherFontSize;
//padding: 5px;
color: $main-color;
}
.el-collapse-item__arrow {
margin: 0 5px 0 0;
}
.el-icon-arrow-right:before {
font-size: 12px;
font-size: $togetherFontSize;
//padding: 1px;
//margin-left: 10px;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}
.el-tabs__item {
font-size: 16px;
}
.el-tabs--card>.el-tabs__header .el-tabs__nav {
border: none;
}
.el-tabs--card>.el-tabs__header .el-tabs__item {
border-left: none;
}
.el-tabs--card>.el-tabs__header {
border-bottom: none;
}
.el-collapse {
border-bottom: none;
border-top: none;
height: calc(100vh - 422px);
overflow: hidden;
overflow-y: auto;
}
/deep/.el-collapse-item {
font-size: $togetherFontSize;
background-color: red;
color: red;
}
.el-tabs__item.is-active {
color: #fff;
background-color: $main-color;
}
.el-tabs__header {
padding: 5px 20px;
}
2 years ago
}
10 months ago
2 years ago
.break-all {
10 months ago
font-size: 16px;
word-break: break-all;
2 years ago
}
10 months ago
2 years ago
.panel {
10 months ago
position: fixed;
z-index: 10010000;
top: 50%;
&.active {
//z-index: 10;
left: 85%;
z-index: 1001;
}
img {
height: 175px;
cursor: pointer;
}
2 years ago
}
</style>