diff --git a/src/App.vue b/src/App.vue
index 3d95200..a78bfaa 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -20,6 +20,10 @@ export default {
};
},
created () {
+ window.exitSystem = () => {
+ sessionStorage.removeItem('token')
+ location.reload()
+ }
//在页面加载时读取sessionStorage里的状态信息
if (sessionStorage.getItem("store")) {
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store"))))
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 7cc176b..b1d15ae 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -21,6 +21,7 @@ import Setting from '@/setting'
export default {
data () {
return {
+ timer: null,
Setting,
userName: '',
};
@@ -81,8 +82,8 @@ export default {
},
// 心跳检测
heartbeatDetection () {
- setInterval(async () => {
- await this.$get(this.api.heartbeatDetection)
+ this.timer = setInterval(async () => {
+ sessionStorage.getItem('token') ? await this.$get(this.api.heartbeatDetection) : clearInterval(this.timer)
}, 58 * 1000)
},
diff --git a/src/setting.js b/src/setting.js
index 77f0b79..ab9dacd 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -51,7 +51,7 @@ const Setting = {
isDev,
isPro,
// 是否使用动态路由
- dynamicRoute: false,
+ dynamicRoute: true,
/**
* @description 默认密码
*/
diff --git a/src/utils/api.js b/src/utils/api.js
index 24df619..dce2be0 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -17,7 +17,7 @@ export default {
logout: `users/users/user/logout`,
// 阿里云文件/视频管理
- getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证
+ getPlayAuth: `nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证
encrypt: `nakadai/data/encrypt`,
staffTemplate: `https://occupationlab.com/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
diff --git a/src/views/Login.vue b/src/views/Login.vue
index e892dd3..3392e47 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -199,6 +199,7 @@ export default {
this.$refs[ref].validate(valid => {
if (valid) {
this.$post(this.api.logins, param).then(({ status, data, message }) => {
+ localStorage.removeItem('examPath')
if (status == 200) {
const accounts = data.userAccounts
// 如果返回的是数组,则弹框给用户选择登录哪个用户,否则,直接登录
diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue
index 2c4fcf8..61e1174 100644
--- a/src/views/match/add/index.vue
+++ b/src/views/match/add/index.vue
@@ -9,8 +9,8 @@
大赛发布类型
- 仅发布信息
- 设置完整比赛
+ {{ item.name
+ }}
-
-
@@ -293,6 +348,11 @@ export default {
quill,
Upload
},
+ computed: {
+ isPractice () {
+ return this.$parent.releaseType === 2
+ },
+ },
watch: {
editing: function (val) {
this.quillShow = false
diff --git a/src/views/match/manage/matchRank.vue b/src/views/match/manage/matchRank.vue
index 57100e0..3af9570 100644
--- a/src/views/match/manage/matchRank.vue
+++ b/src/views/match/manage/matchRank.vue
@@ -178,7 +178,7 @@ export default {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
index: +this.$route.query.index,
- method: this.$route.query.method,
+ method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule,
searchTimer: null,
@@ -449,7 +449,7 @@ export default {
},
// 跳转实验报告
toReport (row) {
- this.$router.push(`/matchReport?reportId=${row.reportId}`)
+ this.$router.push(`/${this.method !== 1 ? 'trialReport' : 'theoryReport'}?reportId=${row.reportId}`)
},
handleSelectionChange (val) { // 多选
this.multipleSelection = val;
diff --git a/src/views/match/manage/theoryArchList.vue b/src/views/match/manage/theoryArchList.vue
index 48fdd38..3596bf3 100644
--- a/src/views/match/manage/theoryArchList.vue
+++ b/src/views/match/manage/theoryArchList.vue
@@ -47,8 +47,6 @@
上传成绩
- 批量删除
{{ exporting ? '正在导出' : '批量导出'
}}
@@ -182,11 +180,11 @@ export default {
tabs: [
{
id: 1,
- name: '成绩报告'
+ name: '已提交'
},
{
id: 0,
- name: '未完成竞赛'
+ name: '未提交'
}
],
active: 1,
@@ -322,7 +320,7 @@ export default {
},
handleCurrentChange (val) { // 切换分页
this.$router.push({
- path: '/matchArchList',
+ path: '/theoryArchList',
query: {
...this.$route.query,
page: val
@@ -335,10 +333,6 @@ export default {
handleSelectionChange1 (val) { // 多选
this.multipleSelection1 = val;
},
- handleCurrentChange1 (val) { // 切换分页
- this.page1 = val;
- this.getData();
- },
getChart () { // 初始化折线图
const { fractionalSegmentCounts: data } = this.statData
let myChart = echarts.init(document.getElementById("chart"));
@@ -440,7 +434,7 @@ export default {
// tab回调
tabChange (i) {
this.active = i
- this.getData()
+ this.initData()
},
// 预览附件
preview (item) {
@@ -539,7 +533,7 @@ export default {
}
.chart {
- flex: 1;
+ width: calc(100% - 660px);
height: 300px;
}
}
diff --git a/src/views/match/manage/theoryReport.vue b/src/views/match/manage/theoryReport.vue
index 6d42dac..6a36775 100644
--- a/src/views/match/manage/theoryReport.vue
+++ b/src/views/match/manage/theoryReport.vue
@@ -32,7 +32,7 @@
@click="filterStatus(item.id)">{{ item.name }}
-
+
导出报告
@@ -88,17 +88,24 @@
得分情况
-
+
-
+
+ {{ scope.row.targetScore }}分
+
待评分
- {{ scope.row.userTotalScore }}
+ {{ scope.row.userTotalScore
+ }}分(部分试题待判分,成绩待定)
+ {{ scope.row.userTotalScore }}分
-
+
+ {{ scope.row.questionType === 'essay' ? '-' : scope.row.scoreRatePercentage
+ }}
+
@@ -146,9 +153,9 @@
-
+
【知识点】
- {{ kp }}
+ {{ kp.name }}
【解析】
@@ -161,16 +168,16 @@
- 考生上传附件:
+ 考生上传附件:
{{ ques.attachmentName }}
下载
@@ -178,7 +185,7 @@
正确答案:{{ ques.quesAnswer }}
-
考生答案:
+
考生答案:
{{ ques.userAnswerStr }}
@@ -192,7 +199,7 @@
题目分值:{{ ques.questionScore }}分
考生得分:分
+ readonly />分
@@ -218,6 +225,7 @@
import QuesConst from '@/const/ques'
import TestPaperConst from '@/const/testPaper'
import Util from '@/libs/util'
+import _ from 'lodash'
export default {
data () {
return {
@@ -256,6 +264,7 @@ export default {
name: '待判分'
},
],
+ outlines: [],
paper: [],
essayExist: 0,
};
@@ -267,14 +276,14 @@ export default {
async getData () {
this.loading = true
try {
- const { userAnswers: paper, report } = await this.$get(`${this.api.getDetailedExamScores}?reportId=${this.reportId}`)
+ const { userAnswers: outline, report, paper } = await this.$get(`${this.api.getDetailedExamScores}?reportId=${this.reportId}`)
this.form = report
// 处理试题信息
const { questionTypes: types, difficults } = QuesConst
const { numToLetter } = Util
let essayExist = 0
- paper.map(e => {
+ outline.map(e => {
if (e.questionType === 'essay') essayExist = 1
e.shrink = false
const type = e.questionType
@@ -287,7 +296,6 @@ export default {
n.difficultTheme = curDiff.theme
}
}
- n.kpList = n.knowledgePointName.split(',')
const opts = n.questionAnswerVersionsList
if (type !== 'fill_blank' && type !== 'essay') { // 选择题
@@ -298,7 +306,7 @@ export default {
let { userAnswer } = n
if (userAnswer) {
userAnswer = JSON.parse(userAnswer)
- n.userAnswerStr = userAnswer.length ? userAnswer.map(m => numToLetter(+m - 1)).join('') : '未作答'
+ n.userAnswerStr = userAnswer.length ? (type === 'judgement' ? opts[+userAnswer[0] - 1].optionText : userAnswer.map(m => numToLetter(+m - 1)).join('')) : '未作答'
} else {
userAnswer = []
}
@@ -307,7 +315,7 @@ export default {
opts && opts.map((m, j) => {
const selected = userAnswer.includes(m.optionNumber)
m.optCorrect = m.answerIsCorrect ? (selected ? 1 : -1) : (selected ? 0 : -1) // 用户选择的结果跟正确答案是否匹配(1正确,0错误,-1未选择)
- m.answerIsCorrect && quesAnswer.push(numToLetter(j))
+ m.answerIsCorrect && quesAnswer.push(type === 'judgement' ? m.optionText : numToLetter(j))
})
n.quesAnswer = quesAnswer.join('')
@@ -345,7 +353,17 @@ export default {
})
this.essayExist = essayExist // 是否存在简答题
- this.paper = paper
+ this.paper = outline
+ this.outlines = [
+ ...outline,
+ {
+ outlineName: '合计',
+ questionNum: paper.questionCount,
+ targetScore: paper.score,
+ userTotalScore: paper.userTotalScore,
+ scoreRatePercentage: paper.scoreRate
+ }
+ ]
let { form } = this
this.info = {
workNumber: form.workNumber,
@@ -368,7 +386,7 @@ export default {
function scroll () {
let now = Date.now()
let progress = Math.min(1, (now - startTime) / duration)
- document.querySelector('#quesWrap').scrollTo(0, position * progress)
+ document.querySelector('#right').scrollTo(0, position * progress)
if (progress < 1) {
window.requestAnimationFrame(scroll)
@@ -380,7 +398,7 @@ export default {
// 答题卡题目点击滚动
scrollToQues (e) {
const el = document.querySelector('#ques' + e.id)
- el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop, 200)
+ el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop + 200, 200)
},
// 答题卡筛选
filterStatus (e) {
@@ -799,6 +817,24 @@ samp {
}
}
+ .html-parse {
+ table {
+ display: table;
+ margin-bottom: 10px;
+ border-collapse: collapse;
+
+ th,
+ td {
+ padding: 5px 10px;
+ border: 1px solid #DDD;
+ }
+ }
+ }
+
+ img {
+ max-width: 100%;
+ }
+
.item:not(:last-child) {
padding-bottom: 15px;
margin-bottom: 15px;
@@ -811,6 +847,7 @@ samp {
margin-bottom: 10px;
}
+
.tag {
margin-left: 10px;
cursor: pointer;
@@ -863,7 +900,7 @@ samp {
.line {
display: flex;
- align-items: center;
+ align-items: baseline;
margin-bottom: 8px;
font-size: 13px;
color: #333;
@@ -871,6 +908,14 @@ samp {
&:last-child {
margin-bottom: 0;
}
+
+ img {
+ max-width: 100%;
+ }
+ }
+
+ .line-label {
+ white-space: nowrap;
}
.fill-answers {
diff --git a/src/views/serve/Configure.vue b/src/views/serve/Configure.vue
index f302dd0..b1c588a 100644
--- a/src/views/serve/Configure.vue
+++ b/src/views/serve/Configure.vue
@@ -161,7 +161,7 @@ export default {
// 进入系统后台
toBackstage (row) {
this.setReferrer()
- if (row.systemId == 19) {
+ if (row.systemId == 19 || row.systemId == 30) {
location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&admin=1&referrer=${encodeURIComponent(location.href)}`
} else {
this.$router.push(`/backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`)
diff --git a/src/views/theoryExam/index.vue b/src/views/theoryExam/index.vue
index 3e1cdfa..8ee11c5 100644
--- a/src/views/theoryExam/index.vue
+++ b/src/views/theoryExam/index.vue
@@ -10,11 +10,25 @@ import Setting from '@/setting'
export default {
data () {
return {
- url: `http://${Setting.isDev ? '192.168.31.125:8098' : '121.37.12.51/examination'}/#/quesBankType?token=${sessionStorage.getItem('token')}`
+ url: ''
};
},
mounted () {
-
+ const path = localStorage.getItem('examPath')
+ let url = `${location.origin}/examination`
+ if (Setting.isDev) {
+ url = `http://192.168.31.125:8098/`
+ } else if (Setting.isPro) {
+ const { host } = location
+ url = `https://${host === 'dev.huorantech.cn' ? host : 'www.huorantech.cn'}/examination/`
+ }
+ if (path) {
+ url += `${path}${path.includes('?') ? `&` : '?'}token=${sessionStorage.getItem('token')}`
+ } else {
+ url += `#/quesBankType?token=${sessionStorage.getItem('token')}`
+ }
+ url += `&v=${Date.now()}`
+ this.url = url
},
methods: {