Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-exam-show
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-exam-show
Commits
af99a9de
提交
af99a9de
authored
11月 03, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
页面功能开发,提测版本
上级
b98afc5c
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
674 行增加
和
345 行删除
+674
-345
examAction.js
src/action/examAction.js
+34
-0
index.js
src/action/index.js
+4
-1
exam_api.js
src/api/exam_api.js
+29
-0
index.js
src/api/index.js
+4
-1
end-bg.png
src/assets/images/end-bg.png
+0
-0
answerCard.vue
src/components/exam/answerCard.vue
+80
-65
question.vue
src/components/exam/question.vue
+194
-90
examAnswer.vue
src/pages/exam/examAnswer.vue
+105
-167
examEnd.vue
src/pages/exam/examEnd.vue
+112
-0
examTime.vue
src/pages/exam/examTime.vue
+16
-2
confirmInfo.vue
src/pages/login/confirmInfo.vue
+1
-1
index.vue
src/pages/login/index.vue
+92
-17
routes.js
src/router/routes.js
+3
-1
没有找到文件。
src/action/examAction.js
0 → 100644
浏览文件 @
af99a9de
import
BaseACTION
from
'./base_action'
import
{
Exam
}
from
'@api'
export
default
class
LoginAction
extends
BaseACTION
{
/* 获取考试信息 */
getTopic
(
examId
)
{
return
Exam
.
getTopic
(
examId
).
then
(
res
=>
res
)
}
/* 缓存考试 */
setCache
(
examId
,
obj
)
{
return
Exam
.
setCache
(
examId
,
obj
).
then
(
res
=>
res
)
}
/* 获取缓存 */
getCache
(
examId
)
{
return
Exam
.
getCache
(
examId
).
then
(
res
=>
res
)
}
/* 结束考试 */
endExam
(
examId
,
obj
)
{
return
Exam
.
endExam
(
examId
,
obj
).
then
(
res
=>
res
)
}
/* 进入考试 */
// userLogin (obj) { return Exam.userLogin(obj).then(res => res) }
/* 确认信息 */
// confirmInfo (obj) { return Exam.confirmInfo(obj).then(res => res) }
// /* post传输方式 */
// postTest (obj = {}) {
// return Login.postTest(obj).then(res => {
// return res || { test: 'OK' }
// }).catch(res => {
// return res || { test: 'OK' }
// })
// }
// /* 当前登录用户,检测是否该系统有权限 */
// getInfo () {
// return Login.getInfo().then(res => {
// return res || { test: 'OK' }
// }).catch(res => {
// return res || { test: 'OK' }
// })
// }
}
src/action/index.js
浏览文件 @
af99a9de
import
TestAction
from
'./TestAction'
import
LoginAction
from
'./LoginAction'
import
ExamAction
from
'./ExamAction'
const
Test
=
new
TestAction
()
const
Login
=
new
LoginAction
()
const
Exam
=
new
ExamAction
()
const
cAction
=
{
Test
,
Login
Login
,
Exam
}
export
default
cAction
src/api/exam_api.js
0 → 100644
浏览文件 @
af99a9de
import
BaseAPI
from
'./base_api'
export
default
class
ExamAPI
extends
BaseAPI
{
/**
* 获取考试信息
* @param {[string]} examId resource_id
*/
getTopic
=
(
examId
)
=>
this
.
get
(
`/ehall/v1/exam/sheet/
${
examId
}
`
,
{})
/* 缓存考试 */
setCache
=
(
examId
=
{},
obj
=
{})
=>
this
.
post
(
`/ehall/v1/exam/cache/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
/* 获取缓存 */
getCache
=
(
examId
)
=>
this
.
get
(
`/ehall/v1/exam/cache/
${
examId
}
`
,
{})
/* 缓存考试 */
endExam
=
(
examId
=
{},
obj
=
{})
=>
this
.
post
(
`/ehall/v1/exam/sheet/
${
examId
}
`
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
/**
* 进入考试
*/
// userLogin = (obj = {}) => this.post('/ehall/v1/user/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
// confirmInfo = (obj = {}) => this.post('/ehall/v1/user/confirm', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
// /**
// * post传输方式
// * @param {[object]} obj
// */
// postTest = (obj = {}) => this.post('/passport/rest/login', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
// /**
// * 当前登录用户,检测是否该系统有权限
// */
// getInfo = () => this.post('/user_center/get_user_info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
}
src/api/index.js
浏览文件 @
af99a9de
import
TestAPI
from
'./test_api'
import
LoginAPI
from
'./login_api'
import
ExamAPI
from
'./exam_api'
const
Test
=
new
TestAPI
(
webConf
)
const
Login
=
new
LoginAPI
(
webConf
)
const
Exam
=
new
ExamAPI
(
webConf
)
export
{
Test
,
Login
Login
,
Exam
}
src/assets/images/end-bg.png
0 → 100644
浏览文件 @
af99a9de
40.8 KB
src/components/exam/answerCard.vue
浏览文件 @
af99a9de
...
...
@@ -2,75 +2,90 @@
<div>
<div
class=
"info"
>
<div
class=
"shape"
>
<img
src=
"https://zws-imgs-pub.ezijing.com/static/public/f2f02f49c3a107e7bf3201c91e29894e.jpg
"
alt=
""
>
<img
:src=
"info.id_photo
"
alt=
""
>
</div>
<div
class=
"right"
>
<div
class=
"name"
>
陈泽亚
</div>
<div
class=
"code"
>
CzY1689367
</div>
<div
class=
"name"
>
{{
info
.
name
}}
</div>
<div
class=
"code"
>
{{
info
.
examinee_number
}}
</div>
</div>
</div>
<div
class=
"order-num"
>
<div
class=
"tit"
>
单选题
</div>
<ul>
<li
@
click=
"go(1)"
:class=
"questionParams.questionIndex === 0
? questionParams.answerRecord['1'] ? 'stu1 stu2' : 'stu2'
: questionParams.answerRecord['1'] ? 'stu1' : ''"
>
1
</li>
<!-- stu1已答 stu2当前 stu3标记 -->
<!-- questionParams.answerRecord['1'] ? 'stu1' : '' questionParams.questionIndex === 0 ? 'stu2' : ''-->
<!--
<li
class=
"stu1"
>
1
</li>
<li
class=
"stu1"
>
2
</li>
<li
class=
"stu1 stu2 stu3"
>
3
</li>
<li>
4
</li>
-->
<!--
<li
class=
"stu1"
>
1
</li>
<li
class=
"stu1"
>
2
</li>
<li
class=
"stu1 stu2 stu3"
>
3
</li>
<li>
4
</li>
-->
</ul>
<div
class=
"tit"
>
多选题
</div>
<ul>
<li
@
click=
"go(2)"
:class=
"questionParams.questionIndex === 1
? questionParams.answerRecord['2'] ? questionParams.answerRecord['2'].answer.length ? 'stu1 stu2' : 'stu2' : 'stu2'
: questionParams.answerRecord['2'] ? questionParams.answerRecord['2'].answer.length ? 'stu1' : '' : ''"
>
2
</li>
</ul>
<div
class=
"tit"
>
判断题
</div>
<ul>
<li
@
click=
"go(3)"
:class=
"questionParams.questionIndex === 2
? questionParams.answerRecord['3'] ? 'stu1 stu2' : 'stu2'
: questionParams.answerRecord['3'] ? 'stu1' : ''"
>
3
</li>
</ul>
<div
class=
"tit"
>
复合题
</div>
<ul>
<li
@
click=
"go(4)"
:class=
"questionParams.questionIndex === 3
? questionParams.answerRecord['4'] ? 'stu1 stu2' : 'stu2'
: questionParams.answerRecord['4'] ? 'stu1' : ''"
>
4
</li>
</ul>
<template
v-for=
"(item, index) in questionParams.question.question_items"
>
<div
:key=
"index"
v-if=
"item.question_item_type != 5"
>
<div
class=
"tit"
>
{{
item
.
question_item_title
}}
</div>
<ul>
<template
v-for=
"(cItem, cIndex) in item.question_list"
>
<!-- stu1已答 stu2当前 stu3标记 -->
<li
:key=
"cItem.q_order + '-' + cIndex"
@
click=
"goQuestion(cItem.q_order)"
:class=
"questionParams.questionIndex + 1 === cItem.q_order
? questionParams.answerRecord[item.question_item_id]
? questionParams.answerRecord[item.question_item_id][cItem.id]
? questionParams.answerRecord[item.question_item_id][cItem.id].answer.length !== 0
? questionParams.answerRecord[item.question_item_id][cItem.id].sign
? 'stu1 stu2 stu3'
: 'stu1 stu2'
: questionParams.answerRecord[item.question_item_id][cItem.id].sign
? 'stu2 stu3'
: 'stu2'
: 'stu2'
: 'stu2'
: questionParams.answerRecord[item.question_item_id]
? questionParams.answerRecord[item.question_item_id][cItem.id]
? questionParams.answerRecord[item.question_item_id][cItem.id].answer.length !== 0
? questionParams.answerRecord[item.question_item_id][cItem.id].sign
? 'stu1 stu3'
: 'stu1'
: questionParams.answerRecord[item.question_item_id][cItem.id].sign
? 'stu3'
: ''
: ''
: ''
"
>
{{
cItem
.
q_order
}}
</li>
</
template
>
</ul>
</div>
<div
:key=
"index"
v-else
>
<div
class=
"tit"
>
{{ item.question_item_title }}
</div>
<ul>
<
template
v-for=
"cItem in item.question_list"
>
<template
v-for=
"(lItem, lIndex) in cItem.list"
>
<li
:key=
"lItem.q_order +'-'+ lIndex"
@
click=
"goQuestion(lItem.q_order)"
:class=
"questionParams.questionIndex + 1 === lItem.q_order
? questionParams.answerRecord[item.question_item_id]
? questionParams.answerRecord[item.question_item_id][lItem.id]
? questionParams.answerRecord[item.question_item_id][lItem.id].answer.length !== 0
? questionParams.answerRecord[item.question_item_id][lItem.id].sign
? 'stu1 stu2 stu3'
: 'stu1 stu2'
: questionParams.answerRecord[item.question_item_id][lItem.id].sign
? 'stu2 stu3'
: 'stu2'
: 'stu2'
: 'stu2'
: questionParams.answerRecord[item.question_item_id]
? questionParams.answerRecord[item.question_item_id][lItem.id]
? questionParams.answerRecord[item.question_item_id][lItem.id].answer.length !== 0
? questionParams.answerRecord[item.question_item_id][lItem.id].sign
? 'stu1 stu3'
: 'stu1'
: questionParams.answerRecord[item.question_item_id][lItem.id].sign
? 'stu3'
: ''
: ''
: ''
"
>
{{
lItem
.
q_order
}}
</li>
</
template
>
</template>
</ul>
</div>
</template>
</div>
<ul
class=
"flag-tips"
>
<li>
<div
class=
"circle1"
></div>
<div
class=
"txt"
>
已答
</div>
</li>
<li>
<div
class=
"circle2"
></div>
<div
class=
"txt"
>
未答
</div>
</li>
<li>
<div
class=
"circle3"
></div>
<div
class=
"txt"
>
当前
</div>
</li>
<!--
<li>
<div
class=
"circle4"
></div>
<div
class=
"txt"
>
标记
</div>
</li>
-->
</ul>
</div>
</template>
<
script
>
...
...
@@ -78,7 +93,7 @@ import Bus from '../../components/common/bus.js'
export
default
{
props
:
{
questionParams
:
{
type
:
Object
,
default
:
()
=>
{}
},
changeTime
:
{
type
:
Number
,
default
:
()
=>
{}
}
info
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
mounted
()
{
Bus
.
$on
(
'monitoringChanges'
,
target
=>
{
...
...
@@ -86,7 +101,7 @@ export default {
})
},
methods
:
{
go
(
n
)
{
go
Question
(
n
)
{
this
.
questionParams
.
questionIndex
=
n
-
1
}
}
...
...
src/components/exam/question.vue
浏览文件 @
af99a9de
<
template
>
<div>
<!-- 单选多选判断题(题目描述dom结构一样,只那选项区分) -->
<template
v-if=
"questionData.type === 1 || questionData.type === 2 || questionData.type === 3"
>
<template
v-if=
"questionData.question_item_type == 1 || questionData.question_item_type == 2 || questionData.question_item_type == 6"
>
<div
class=
"title-type"
>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionParams
.
question
.
total_question_count
}}
</div>
</div>
<div
class=
"title"
>
<
span>
{{
questionData
.
orderNum
}}
.
</span>
{{
questionData
.
title
}}
<
div
class=
"num"
>
{{
questionData
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"questionData.content"
></div>
</div>
<
div
class=
"describe"
v-html=
"questionData.des"
></div
>
<ul
:class=
"questionData.
type =
== 2 ? 'check-option' : 'radio-option'"
>
<template
v-for=
"(item, index) in questionData.opt"
>
<
!--
<div
class=
"describe"
></div>
--
>
<ul
:class=
"questionData.
question_item_type
== 2 ? 'check-option' : 'radio-option'"
>
<template
v-for=
"(item, index) in questionData.opt
ions
"
>
<li
:key=
"index"
@
click=
"changeOptions(questionData.type, questionData.id, item.id)"
:class=
"questionParams.answerRecord[questionData.id]
? questionParams.answerRecord[questionData.id].answer.find(id =>
{ return id === item.id })
? 'active'
@
click=
"changeOptions(questionData.question_item_type, questionData.question_item_id, questionData.id, item.id)"
:class=
"questionParams.answerRecord[questionData.question_item_id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id =>
{ return id === item.id })
? 'active'
: ''
: ''
: ''"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
{{
item
.
text
}}
</div>
<div
class=
"txt"
>
{{
item
.
option
}}
</div>
</li>
</
template
>
</ul>
</template>
<!-- 复合题 -->
<
template
v-if=
"questionData.type === 4"
>
<
template
v-if=
"questionData.question_item_type == 5"
>
<div
class=
"title-type"
>
<div
class=
"type"
>
{{
questionData
.
question_item_title
}}
</div>
<div
class=
"num"
>
{{
questionData
.
q_order
}}
/
{{
questionParams
.
question
.
total_question_count
}}
</div>
</div>
<div
class=
"case-que"
>
<div
class=
"stem"
>
{{
questionData
.
stem
}}
</div>
<div
class=
"stem"
v-html=
"questionData.common_content"
>
</div>
<ul
class=
"topics"
:style=
"
{height: contentHeight - 60 + 'px'}">
<template
v-for=
"(item, index) in questionData.list"
>
<li
:key=
"'type
4
' + index"
>
<li
:key=
"'type
5
' + index"
>
<div
class=
"title"
>
<
span>
{{
item
.
orderNum
}}
.
</span>
{{
item
.
title
}}
<
div
class=
"num"
>
{{
item
.
q_order
}}
.
</div><div
class=
"des"
v-html=
"item.content"
></div>
</div>
<ul
:class=
"item.type === 2 ? 'check-option' : 'radio-option'"
>
<!-- radio-option check-option -->
<template
v-for=
"(items, cIndex) in item.opt"
>
<li
:key=
"'c' + cIndex"
@
click=
"changeOptions(item.type, item.id, items.id)"
:class=
"questionParams.answerRecord[item.id]
? questionParams.answerRecord[item.id].answer.find(id =>
{ return id === items.id })
? 'active'
: ''
: ''"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
{{
items
.
text
}}
</div>
</li>
<ul
:class=
"item.type == 2 ? 'check-option' : 'radio-option'"
>
<!-- radio-option check-option -->
<template
v-if=
"item.options"
>
<template
v-for=
"(items, cIndex) in item.options"
>
<li
:id=
"items.id"
:key=
"'c' + cIndex"
@
click=
"changeOptions(item.type, questionData.question_item_id, questionData.id, items.id)"
:class=
"questionParams.answerRecord[questionData.question_item_id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id]
? questionParams.answerRecord[questionData.question_item_id][questionData.id].answer.find(id =>
{ return id === items.id })
? 'active'
: ''
: ''
: ''"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
{{
items
.
option
}}
</div>
</li>
</
template
>
</template>
<!-- <li class="active">
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li> -->
</ul>
</li>
</template>
<!-- <li>
<div class="title">
<span>11.</span>将以下5个句子重新排列组合,排列组合最连贯的是。
</div>
<ul class="check-option"> radio-option check-option
<li class="active">
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
<li>
<div class="icon"></div>
<div class="txt">A.⑤④②③①</div>
</li>
</ul>
</li> -->
</ul>
</div>
</template>
</div>
</template>
<
script
>
import
action
from
'@action'
import
Bus
from
'../../components/common/bus.js'
export
default
{
props
:
{
...
...
@@ -108,34 +85,134 @@ export default {
}
},
mounted
()
{
this
.
questionData
=
this
.
questionParams
.
list
[
this
.
questionParams
.
questionIndex
]
this
.
dataCombined
()
},
methods
:
{
changeOptions
(
type
,
id
,
cId
)
{
if
(
type
!==
2
)
{
this
.
questionParams
.
answerRecord
[
id
]
?
this
.
questionParams
.
answerRecord
[
id
].
answer
=
[
cId
]
:
(()
=>
{
this
.
questionParams
.
answeredCount
++
this
.
questionParams
.
answerRecord
[
id
]
=
{
answer
:
[
cId
]
}
})()
// 重组数据
dataCombined
()
{
this
.
questionParams
.
question
.
question_items
.
map
((
item
,
index
)
=>
{
if
(
parseInt
(
item
.
question_item_type
)
===
5
)
{
item
.
question_list
.
map
(
cItem
=>
{
const
currentItem
=
cItem
.
list
.
find
(
items
=>
{
return
items
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
})
if
(
currentItem
)
{
this
.
questionData
=
{}
this
.
questionData
.
common_content
=
cItem
.
common_content
this
.
questionData
.
list
=
cItem
.
list
.
map
(
k
=>
{
if
(
k
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
)
{
this
.
questionData
.
id
=
k
.
id
this
.
questionData
.
q_order
=
k
.
q_order
typeof
k
.
options
===
'string'
&&
(
k
.
options
=
JSON
.
parse
(
k
.
options
))
return
k
}
else
{
return
{
content
:
k
.
content
,
q_order
:
k
.
q_order
}
}
})
const
key
=
[
'question_item_id'
,
'question_item_title'
,
'question_item_type'
]
key
.
map
(
k
=>
{
this
.
questionData
[
k
]
=
item
[
k
]
})
}
})
}
else
{
const
currentItem
=
item
.
question_list
.
find
(
items
=>
{
return
items
.
q_order
===
this
.
questionParams
.
questionIndex
+
1
})
if
(
currentItem
)
{
this
.
questionData
=
currentItem
const
key
=
[
'question_item_id'
,
'question_item_title'
,
'question_item_type'
]
key
.
map
(
k
=>
{
this
.
questionData
[
k
]
=
item
[
k
]
})
typeof
this
.
questionData
.
options
===
'string'
&&
(
this
.
questionData
.
options
=
JSON
.
parse
(
currentItem
.
options
))
}
}
})
},
// 选项选择
changeOptions
(
type
,
pId
,
cId
,
optId
)
{
if
(
parseInt
(
type
)
!==
2
)
{
this
.
questionParams
.
answerRecord
[
pId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
answer
=
[
optId
]
:
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
=
{
answer
:
[
optId
],
sign
:
false
}
:
this
.
questionParams
.
answerRecord
[
pId
]
=
{
[
cId
]:
{
answer
:
[
optId
],
sign
:
false
}
}
}
else
{
if
(
this
.
questionParams
.
answerRecord
[
id
])
{
const
optChack
=
this
.
questionParams
.
answerRecord
[
id
].
answer
.
findIndex
(
item
=>
{
return
item
===
cId
})
optChack
===
-
1
this
.
questionParams
.
answerRecord
[
pId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
?
(()
=>
{
this
.
questionParams
.
answerRecord
[
id
].
answer
.
length
===
0
&&
(
this
.
questionParams
.
answeredCount
++
)
this
.
questionParams
.
answerRecord
[
id
].
answer
.
push
(
cId
)
const
optChack
=
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
answer
.
findIndex
(
item
=>
{
return
item
===
optId
})
if
(
optChack
===
-
1
)
{
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
answer
.
push
(
optId
)
}
else
{
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
answer
.
splice
(
optChack
,
1
)
}
})()
:
this
.
questionParams
.
answerRecord
[
id
].
answer
.
splice
(
optChack
,
1
)
this
.
questionParams
.
answerRecord
[
id
].
answer
.
length
===
0
&&
(
this
.
questionParams
.
answeredCount
--
)
}
else
{
this
.
questionParams
.
answeredCount
++
this
.
questionParams
.
answerRecord
[
id
]
=
{
answer
:
[
cId
]
}
}
:
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
=
{
answer
:
[
optId
],
sign
:
false
}
:
this
.
questionParams
.
answerRecord
[
pId
]
=
{
[
cId
]:
{
answer
:
[
optId
],
sign
:
false
}
}
}
Bus
.
$emit
(
'monitoringChanges'
)
this
.
$forceUpdate
()
},
setCache
()
{
const
param
=
{
answer
:
JSON
.
stringify
(
this
.
questionParams
.
answerRecord
)
}
action
.
Exam
.
setCache
(
this
.
$route
.
params
.
examId
,
param
).
then
(
res
=>
{
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
},
// 标记
onSignHandle
()
{
const
pId
=
this
.
questionData
.
question_item_id
const
cId
=
this
.
questionData
.
id
this
.
questionParams
.
answerRecord
[
pId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
sign
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
sign
=
false
:
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
sign
=
true
:
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
=
{
sign
:
true
,
answer
:
[]
}
:
this
.
questionParams
.
answerRecord
[
pId
]
=
{
[
cId
]:
{
sign
:
true
,
answer
:
[]
}
}
this
.
signCallback
()
},
signCallback
()
{
const
pId
=
this
.
questionData
.
question_item_id
const
cId
=
this
.
questionData
.
id
let
isSign
=
false
this
.
questionParams
.
answerRecord
[
pId
]
?
this
.
questionParams
.
answerRecord
[
pId
][
cId
]
?
isSign
=
this
.
questionParams
.
answerRecord
[
pId
][
cId
].
sign
:
isSign
=
false
:
isSign
=
false
this
.
$emit
(
'isSign'
,
isSign
)
Bus
.
$emit
(
'monitoringChanges'
)
}
},
computed
:
{
...
...
@@ -145,23 +222,50 @@ export default {
},
watch
:
{
changeQuestionIndex
(
newV
,
oldV
)
{
this
.
questionData
=
this
.
questionParams
.
list
[
this
.
questionParams
.
questionIndex
]
console
.
log
(
this
.
questionData
)
this
.
dataCombined
()
this
.
setCache
()
this
.
signCallback
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.title-type
{
width
:
100%
;
height
:
45px
;
border-bottom
:
1px
solid
#ccc
;
display
:
flex
;
align-items
:
center
;
.type
{
font-size
:
18px
;
color
:
#222222
;
}
.num
{
margin-left
:
auto
;
font-size
:
18px
;
color
:
#222222
;
}
}
.title
{
font-size
:
18px
;
font-weight
:
bold
;
color
:
#222222
;
line-height
:
25px
;
span
{
display
:
flex
;
.num
{
font-size
:
32px
;
font-weight
:
bold
;
color
:
#222222
;
line-height
:
45px
;
margin-top
:
5px
;
}
.des
{
margin-left
:
5px
;
padding-top
:
18px
;
&
:
:
v-deep
p
{
margin
:
0
;
}
}
}
.describe
{
...
...
src/pages/exam/examAnswer.vue
浏览文件 @
af99a9de
...
...
@@ -2,9 +2,9 @@
<div>
<div
class=
"answer-box"
>
<div
class=
"head"
id=
"head-h"
>
<div
class=
"title"
>
全国统一高考试卷A
</div>
<div
class=
"title"
>
{{
examInfo
.
name
}}
</div>
<div
class=
"right"
>
<div
class=
"count"
>
已答
{{
questionParams
.
answeredCount
}}
/6
</div>
<div
class=
"count"
>
{{
examTime
}}
</div>
<!--
<div
class=
"time"
>
<div
class=
"icon"
></div>
<div
class=
"mun"
>
60:00
</div>
...
...
@@ -14,12 +14,15 @@
<div
class=
"exam-main"
:style=
"
{height: this.contentHeight + 'px'}">
<div
class=
"left"
>
<question
v-if=
"Object.keys(questionParams.question).length"
:contentHeight=
"contentHeight"
:questionParams=
"questionParams"
ref=
"signHandle"
@
isSign=
"isSign"
></question>
</div>
<div
class=
"right"
>
<answer-card
:questionParams=
"questionParams"
:changeTime=
"changeTime"
></answer-card>
<answer-card
:questionParams=
"questionParams"
:changeTime=
"changeTime"
:info=
"sInfo.info"
></answer-card>
</div>
</div>
<div
class=
"foot"
id=
"foot-h"
>
...
...
@@ -29,30 +32,31 @@
:class=
"this.questionParams.questionIndex !== 0 ? 'active' : ''"
>
上一题
</div>
<div
:class=
"questionParams.questionIndex
!== questionParams.list.length - 1
? 'active' : ''"
:class=
"questionParams.questionIndex
+ 1 !== questionParams.question.total_question_count
? 'active' : ''"
@
click=
"changeIndex('next')"
>
下一题
</div>
</div>
<div
class=
"rigth-btn"
>
<
!--
<
div
class=
"sign"
>
<div
class=
"rigth-btn"
@
click=
"signHandle"
>
<div
class=
"sign"
>
<div
class=
"icon"
></div>
<div
class=
"txt"
>
标记
</div>
</div>
-->
<div
class=
"txt"
>
{{
itemSign
?
'取消标记'
:
'标记'
}}
</div>
</div>
<div
class=
"end-exam-btn"
>
<div
class=
"btn"
@
click=
"
isPopup = true
"
>
结束考试
</div>
<div
class=
"btn"
@
click=
"
endExam
"
>
结束考试
</div>
</div>
</div>
</div>
</div>
<my-dia
:title=
"title"
:prompt=
"prompt"
v-if=
"isPopup"
@
close=
"close"
>
<template
v-slot:button
>
<
!--
<button>
我知道了
</button>
--
>
<button
@
click=
"
close"
>
好的
</button>
<
button
@
click=
"close"
>
关闭
</button
>
<button
@
click=
"
endExamRequest"
>
确定
</button>
</
template
>
</my-dia>
</div>
</template>
<
script
>
import
action
from
'@action'
import
answerCard
from
'../../components/exam/answerCard.vue'
import
question
from
'../../components/exam/question.vue'
import
dialogComponent
from
'../../components/exam/dialogComponent.vue'
...
...
@@ -64,176 +68,88 @@ export default {
},
data
()
{
return
{
isExamTimeDate
:
true
,
itemSign
:
false
,
examTime
:
'00:00:00 倒计时'
,
clearTime
:
null
,
sInfo
:
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'studentInfo'
)),
examInfo
:
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'examInfo'
)),
title
:
'提示'
,
prompt
:
'
考试完成
'
,
prompt
:
'
确定后要结束本次考试?还有作答时间,结束考试后,将不能返回本次考试!
'
,
isPopup
:
false
,
contentHeight
:
0
,
// 题的数据所需的参数
changeTime
:
0
,
questionParams
:
{
answeredCount
:
0
,
// 用户选择的选项 --- 提交后台的数据
answerRecord
:
{},
// 当前题的下标
questionIndex
:
0
,
// 所有题
list
:
[
{
id
:
1
,
type
:
1
,
orderNum
:
'1'
,
title
:
'将以下5个句子重新排列组合:'
,
des
:
'<p>①宋代《新唐书音训》云:“京口在润州城东北甘露寺侧。</p><p>②这也就是李白《丁督护歌》中所描绘的“万人凿磐石,无由达江浒”的施工场面。</p><p>③而要开辟一条通京口的新漕路却是十分艰辛的。</p><p>④甘露寺正位于北固山,所以移徙这段漕路,势必要紧贴着北固山下与山根的顽石打交手战,这样的工程自非一日之功。</p><p>⑤瓜洲浦成为便利的津渡是由于它正对南岸江边的京口,而京口的漕路是在开元二十五年齐浣迁润州后才兴修的,换句话说,旧漕路原来并不通京口。</p>'
,
opt
:
[
{
id
:
1
,
text
:
'A、⑤④①③②'
},
{
id
:
2
,
text
:
'B、④①②③⑤'
},
{
id
:
3
,
text
:
'C、⑤③①④②'
},
{
id
:
4
,
text
:
'D、④①③②⑤'
}
]
},
{
id
:
2
,
type
:
2
,
orderNum
:
'2'
,
title
:
'下列关于国际税法内容的陈述,正确的有( )。'
,
des
:
'甘露寺正位于北固山,所以移徒这段漕路。'
,
opt
:
[
{
id
:
1
,
text
:
'A、国际避税的基本方式就是跨国纳税人通过错用或滥用有关国家税法、国际税收协定,利用它们的差别、漏洞、特例和缺陷,规避纳税主体和纳税客体的纳税义务,不纳税或少纳税。'
},
{
id
:
2
,
text
:
'B、税收情报交换是国际反避税的合作的主要内容'
},
{
id
:
3
,
text
:
'C、加强国际税收合作,防止国际避税和逃税,这是国际税收协定的基本内容'
},
{
id
:
4
,
text
:
'D、税收协定不能限制有关国家对跨国投资者提供更为优惠的税收待遇'
},
{
id
:
5
,
text
:
'E、税收协定可以干预协约国对税法的修订和调整'
}
]
},
{
id
:
3
,
type
:
3
,
orderNum
:
'3'
,
title
:
'八月十五是中秋节?'
,
des
:
'甘露寺正位于北固山,所以移徒这段漕路。'
,
opt
:
[
{
id
:
1
,
text
:
'A、正确'
},
{
id
:
2
,
text
:
'B、错误'
}
]
},
{
type
:
4
,
stem
:
'将以下5个句子重新排列组合:'
,
list
:
[
{
id
:
4
,
type
:
1
,
orderNum
:
'4'
,
title
:
'将以下5个句子重新排列组合:'
,
des
:
'①宋代《新唐书音训》云:“京口在润州城东北甘露寺侧。<br/>②这也就是李白《丁督护歌》中所描绘的“万人凿磐石,无由达江浒”的施工场面。<br/>③而要开辟一条通京口的新漕路却是十分艰辛的。<br/>④甘露寺正位于北固山,所以移徙这段漕路,势必要紧贴着北固山下与山根的顽石打交手战,这样的工程自非一日之功。<br/>⑤瓜洲浦成为便利的津渡是由于它正对南岸江边的京口,而京口的漕路是在开元二十五年齐浣迁润州后才兴修的,换句话说,旧漕路原来并不通京口。'
,
opt
:
[
{
id
:
1
,
text
:
'A、⑤④①③②'
},
{
id
:
2
,
text
:
'B、④①②③⑤'
},
{
id
:
3
,
text
:
'C、⑤③①④②'
},
{
id
:
4
,
text
:
'D、④①③②⑤'
}
]
},
{
id
:
5
,
type
:
2
,
orderNum
:
'5'
,
title
:
'下列关于国际税法内容的陈述,正确的有( )。'
,
des
:
'甘露寺正位于北固山,所以移徒这段漕路。'
,
opt
:
[
{
id
:
1
,
text
:
'A、国际避税的基本方式就是跨国纳税人通过错用或滥用有关国家税法、国际税收协定,利用它们的差别、漏洞、特例和缺陷,规避纳税主体和纳税客体的纳税义务,不纳税或少纳税。'
},
{
id
:
2
,
text
:
'B、税收情报交换是国际反避税的合作的主要内容'
},
{
id
:
3
,
text
:
'C、加强国际税收合作,防止国际避税和逃税,这是国际税收协定的基本内容'
},
{
id
:
4
,
text
:
'D、税收协定不能限制有关国家对跨国投资者提供更为优惠的税收待遇'
},
{
id
:
5
,
text
:
'E、税收协定可以干预协约国对税法的修订和调整'
}
]
},
{
id
:
6
,
type
:
3
,
orderNum
:
'6'
,
title
:
'八月十五是中秋节?'
,
des
:
'甘露寺正位于北固山,所以移徒这段漕路。'
,
opt
:
[
{
id
:
1
,
text
:
'A、正确'
},
{
id
:
2
,
text
:
'B、错误'
}
]
}
]
}
]
// 所有题 和题的信息
question
:
{}
}
}
},
mounted
()
{
this
.
setTick
()
this
.
getTopic
()
this
.
contentHeight
=
parseInt
(
document
.
body
.
clientHeight
-
(
this
.
getDom
(
'head-h'
).
offsetHeight
+
this
.
getDom
(
'foot-h'
).
offsetHeight
))
},
methods
:
{
// 标记
signHandle
()
{
this
.
$refs
.
signHandle
.
onSignHandle
()
},
isSign
(
value
)
{
this
.
itemSign
=
value
console
.
log
(
value
)
},
// 提交考试
endExam
()
{
this
.
isExamTimeDate
?
this
.
isPopup
=
true
:
this
.
endExamRequest
()
},
endExamRequest
()
{
const
param
=
{
answer
:
JSON
.
stringify
(
this
.
questionParams
.
answerRecord
)
}
action
.
Exam
.
endExam
(
this
.
$route
.
params
.
examId
,
param
).
then
(
res
=>
{
clearInterval
(
this
.
clearTime
)
this
.
$router
.
push
({
path
:
'/examEnd'
})
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
},
countDown
(
time
)
{
const
lefttime
=
parseInt
((
time
)
/
1000
)
const
h
=
this
.
addZero
(
parseInt
(
lefttime
/
(
60
*
60
)
%
24
))
const
m
=
this
.
addZero
(
parseInt
(
lefttime
/
60
%
60
))
const
s
=
this
.
addZero
(
parseInt
(
lefttime
%
60
))
this
.
examTime
=
`
${
h
}
:
${
m
}
:
${
s
}
倒计时`
},
setTick
()
{
this
.
clearTime
=
setInterval
(()
=>
{
const
nowtime
=
new
Date
()
const
endtime
=
new
Date
(
this
.
examInfo
.
end_time
)
const
countTime
=
endtime
.
getTime
()
-
nowtime
.
getTime
()
if
(
countTime
<=
0
)
{
this
.
isExamTimeDate
=
false
clearInterval
(
this
.
clearTime
)
this
.
examTime
=
'00:00:00 倒计时'
this
.
endExam
()
}
else
{
this
.
countDown
(
countTime
)
}
},
1000
)
},
addZero
(
i
)
{
return
i
<
10
?
'0'
+
i
:
i
+
''
},
close
()
{
this
.
isPopup
=
false
},
...
...
@@ -244,9 +160,30 @@ export default {
if
(
type
===
'prev'
)
{
this
.
questionParams
.
questionIndex
>
0
&&
(
this
.
questionParams
.
questionIndex
--
)
}
else
{
this
.
questionParams
.
questionIndex
!==
this
.
questionParams
.
list
.
length
-
1
&&
(
this
.
questionParams
.
questionIndex
++
)
console
.
log
(
this
.
questionParams
.
questionIndex
)
this
.
questionParams
.
questionIndex
+
1
!==
this
.
questionParams
.
question
.
total_question_count
&&
(
this
.
questionParams
.
questionIndex
++
)
}
},
getTopic
()
{
action
.
Exam
.
getTopic
(
this
.
$route
.
params
.
examId
).
then
(
res
=>
{
this
.
questionParams
.
question
=
res
this
.
getCache
()
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
},
getCache
()
{
action
.
Exam
.
getCache
(
this
.
$route
.
params
.
examId
).
then
(
res
=>
{
const
data
=
JSON
.
parse
(
res
.
answer
)
if
(
data
!==
null
&&
data
!==
'null'
)
{
this
.
questionParams
.
answerRecord
=
data
}
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
}
}
}
...
...
@@ -301,7 +238,7 @@ export default {
display
:
flex
;
.left
{
flex
:
1
;
padding
:
4
0px
20px
0
53px
;
padding
:
1
0px
20px
0
53px
;
overflow-y
:
scroll
;
scrollbar-width
:
none
;
&
:
:-
webkit-scrollbar
{
...
...
@@ -375,6 +312,7 @@ export default {
.sign
{
margin-right
:
20px
;
.icon
{
margin
:
0
auto
;
width
:
24px
;
height
:
24px
;
background
:
url(../../assets/images/sign.png)
;
...
...
src/pages/exam/examEnd.vue
0 → 100644
浏览文件 @
af99a9de
<
template
>
<div
class=
"end-box"
>
<div
class=
"title"
>
{{
examInfo
.
name
}}
</div>
<div
class=
"text"
>
感谢您完成测试
</div>
<img
src=
"../../assets/images/end-bg.png"
alt=
""
>
<div
class=
"pop-progress"
v-if=
"ispop"
>
<div
class=
"pop-con"
>
<div
class=
"tit"
>
提示
</div>
<div
class=
"count-box"
>
<div
class=
"anmi"
:style=
"
{width:width}">
</div>
</div>
<div
class=
"txt"
>
系统交卷中,请不要关闭页面…
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
width
:
''
,
ispop
:
true
,
examInfo
:
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'examInfo'
))
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
width
=
'100%'
},
1000
)
setTimeout
(()
=>
{
this
.
ispop
=
false
},
4000
)
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.end-box
{
.pop-progress
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background
:rgba
(
0
,
0
,
0
,
0
.3
)
;
.pop-con
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
-webkit-transform
:
translate
(
-50%
,
-50%
);
width
:
342px
;
height
:
220px
;
background
:
#FFFFFF
;
border-radius
:
5px
;
.count-box
{
width
:
250px
;
height
:
10px
;
background
:
#EEEEEE
;
border-radius
:
5px
;
margin
:
50px
auto
;
overflow
:
hidden
;
.anmi
{
transition
:
all
3s
;
width
:
0
;
height
:
10px
;
background
:
#428AFF
;
border-radius
:
5px
;
}
}
.txt
{
font-size
:
14px
;
color
:
#262626
;
line-height
:
20px
;
text-align
:
center
;
}
.tit
{
text-align
:
center
;
padding-top
:
20px
;
font-size
:
18px
;
font-weight
:
bold
;
color
:
#222222
;
line-height
:
18px
;
}
}
}
width
:
100%
;
height
:
100%
;
background
:
linear-gradient
(
360deg
,
#FCFFFF
0%
,
#E2F6FF
100%
);
.title
{
padding-top
:
80px
;
text-align
:
center
;
font-size
:
46px
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
65px
;
letter-spacing
:
2px
;
}
.text
{
text-align
:
center
;
margin-top
:
10px
;
font-size
:
24px
;
color
:
#666666
;
line-height
:
33px
;
letter-spacing
:
2px
;
margin-bottom
:
40px
;
}
img
{
display
:
block
;
margin
:
0
auto
;
height
:
60%
;
}
}
</
style
>
src/pages/exam/examTime.vue
浏览文件 @
af99a9de
...
...
@@ -18,6 +18,7 @@
export
default
{
data
()
{
return
{
clearTime
:
null
,
date
:
{
num1
:
'0'
,
num2
:
'0'
,
...
...
@@ -27,17 +28,30 @@ export default {
}
},
mounted
()
{
setInterval
(()
=>
{
clearInterval
(
this
.
clearTime
)
this
.
clearTime
=
setInterval
(()
=>
{
this
.
countDown
()
},
1000
)
},
methods
:
{
countDown
()
{
// const date = JSON.parse(window.sessionStorage.getItem('examInfo')).start_time
const
date
=
'2020-10-29 19:00:00'
const
date
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'examInfo'
)).
start_time
const
nowtime
=
new
Date
()
const
endtime
=
new
Date
(
date
)
const
lefttime
=
parseInt
((
endtime
.
getTime
()
-
nowtime
.
getTime
())
/
1000
)
if
(
lefttime
<=
0
)
{
clearInterval
(
this
.
clearTime
)
this
.
date
=
{
num1
:
'0'
,
num2
:
'0'
,
num3
:
'0'
,
num4
:
'0'
}
this
.
$router
.
push
({
path
:
`/examAnswer/
${
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'examInfo'
)).
exam_id
}
`
})
}
const
td
=
`
${
this
.
addZero
(
parseInt
(
lefttime
/
60
%
60
))}${
this
.
addZero
(
parseInt
(
lefttime
%
60
))}
`
const
arr
=
td
.
split
(
''
)
Object
.
keys
(
this
.
date
).
map
((
item
,
index
)
=>
{
...
...
src/pages/login/confirmInfo.vue
浏览文件 @
af99a9de
...
...
@@ -70,7 +70,7 @@ export default {
})()
:
(()
=>
{
this
.
$router
.
push
({
name
:
'examAnswer'
path
:
`/examAnswer/
${
this
.
examInfo
.
exam_id
}
`
})
})()
},
...
...
src/pages/login/index.vue
浏览文件 @
af99a9de
...
...
@@ -12,17 +12,19 @@
</div>
<div
class=
"mian-form"
>
<!--
<div
class=
"form prohibit"
>
-->
<div
class=
"form"
>
<div
class=
"tips"
v-show=
"false"
>
您登录的次数已超过最大限制
</div>
<input
type=
"text"
@
click=
"fullScreen"
v-model=
"examineeNumber"
placeholder=
"请输入准考证号"
>
<!--
<input
type=
"text"
placeholder=
"请输入准考证号"
readonly=
"readonly"
class=
"prohibit"
>
-->
<div
:class=
"loginParam.is ? 'form prohibit' : 'form'"
>
<div
class=
"tips"
>
{{
tips
}}
</div>
<!-- 您登录的次数已超过最大限制 -->
<input
type=
"text"
@
click=
"fullScreen"
v-model=
"examineeNumber"
placeholder=
"请输入准考证号"
v-show=
"!loginParam.is"
>
<input
type=
"text"
placeholder=
"请输入准考证号"
readonly=
"readonly"
class=
"prohibit"
v-show=
"loginParam.is"
>
<div
class=
"btn"
@
click=
"login"
>
登录
</div>
<!--
<div
class=
"btn prohibit"
>
登录
</div>
-->
<div
class=
"time-tips"
v-show=
"
false"
>
距离开考还有:3:23:04
</div>
<div
class=
"time-tips"
v-show=
"
loginParam.is"
>
{{
loginParam
.
countTimeText
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"welcome-msg mian-cont900"
v-if=
"data"
v-html=
"data.config.welcome_message"
></div>
<!--
<my-dia
:title=
"title"
:prompt=
"prompt"
:isPopup=
"isPopup"
v-if=
"isPopup"
>
<template
v-slot:button
>
<button>
我知道了
</button>
...
...
@@ -40,11 +42,18 @@ export default {
},
data
()
{
return
{
tips
:
''
,
claerExamTime
:
null
,
title
:
'提示'
,
prompt
:
'从哪女快递费也琴女是儿是而发大V是阿女大是安抚大V vavgrrad'
,
data
:
''
,
examineeNumber
:
''
,
isPopup
:
true
isPopup
:
true
,
loginParam
:
{
clearTime
:
null
,
is
:
true
,
countTimeText
:
''
}
}
},
mounted
()
{
...
...
@@ -52,11 +61,65 @@ export default {
// this.$store.commit('setExamInfo', res)
window
.
sessionStorage
.
setItem
(
'examInfo'
,
JSON
.
stringify
(
res
))
this
.
data
=
res
console
.
log
(
this
.
$store
.
state
)
if
(
this
.
getEnabledTime
()
<
0
)
{
this
.
examTimeInit
()
}
else
{
let
claearTimes
=
null
claearTimes
=
setInterval
(()
=>
{
if
(
this
.
getAfterTime
()
<=
0
)
{
this
.
tips
=
'超过登录时间'
this
.
loginParam
.
is
=
true
clearInterval
(
claearTimes
)
}
},
1000
)
this
.
loginParam
.
is
=
false
}
}).
finally
(
res
=>
{
})
},
methods
:
{
getAfterTime
()
{
const
curTime
=
new
Date
()
const
startTime
=
new
Date
(
this
.
data
.
start_time
)
const
setStartTime
=
this
.
data
.
config
.
enabled_after
?
new
Date
(
startTime
.
setMinutes
(
startTime
.
getMinutes
()
+
this
.
data
.
config
.
after_login
))
:
curTime
const
countTime
=
setStartTime
.
getTime
()
-
curTime
.
getTime
()
return
countTime
},
getEnabledTime
()
{
const
curTime
=
new
Date
()
const
setCurTime
=
this
.
data
.
config
.
enabled_before
?
new
Date
(
curTime
.
setMinutes
(
curTime
.
getMinutes
()
+
this
.
data
.
config
.
before_login
))
:
curTime
const
startTime
=
new
Date
(
this
.
data
.
start_time
)
const
countTime
=
setCurTime
.
getTime
()
-
startTime
.
getTime
()
return
countTime
},
examTimeInit
()
{
this
.
loginParam
.
is
=
true
this
.
claerExamTime
=
setInterval
(()
=>
{
const
date
=
this
.
getEnabledTime
()
if
(
date
>=
0
)
{
clearInterval
(
this
.
claerExamTime
)
this
.
loginParam
.
is
=
false
}
else
{
this
.
countDown
(
Math
.
abs
(
date
))
}
},
1000
)
},
addZero
(
i
)
{
return
i
<
10
?
'0'
+
i
:
i
+
''
},
// 倒计时
countDown
(
time
)
{
const
lefttime
=
parseInt
((
time
)
/
1000
)
const
h
=
this
.
addZero
(
parseInt
(
lefttime
/
(
60
*
60
)
%
24
))
const
m
=
this
.
addZero
(
parseInt
(
lefttime
/
60
%
60
))
const
s
=
this
.
addZero
(
parseInt
(
lefttime
%
60
))
this
.
loginParam
.
countTimeText
=
`距离开考还有:
${
h
}
:
${
m
}
:
${
s
}
`
},
// 开启全屏
fullScreen
()
{
const
el
=
document
.
documentElement
const
rfs
=
el
.
requestFullScreen
||
el
.
webkitRequestFullScreen
||
el
.
mozRequestFullScreen
||
el
.
msRequestFullscreen
...
...
@@ -65,23 +128,35 @@ export default {
}
return
false
},
// 点击登录
login
()
{
action
.
Login
.
userLogin
({
examinee_number
:
this
.
examineeNumber
}).
then
(
res
=>
{
// this.$store.commit('setStudentInfo', res)
window
.
sessionStorage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
))
this
.
$router
.
push
({
name
:
'confirmInfo'
})
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
if
(
!
this
.
loginParam
.
is
)
{
action
.
Login
.
userLogin
({
examinee_number
:
this
.
examineeNumber
}).
then
(
res
=>
{
// this.$store.commit('setStudentInfo', res)
window
.
sessionStorage
.
setItem
(
'studentInfo'
,
JSON
.
stringify
(
res
))
const
status
=
parseInt
(
res
.
sheet_status
)
if
(
status
===
0
)
{
this
.
$router
.
push
({
name
:
'confirmInfo'
})
}
status
===
1
&&
(
this
.
$alert
(
'已提交考卷'
,
{
callback
:
action
=>
{}
}))
}).
catch
(
err
=>
{
this
.
$alert
(
err
.
message
,
{
callback
:
action
=>
{}
})
})
}
)
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.welcome-msg
{
padding-top
:
130px
;
}
.mian-cont900
{
margin
:
0
auto
;
width
:
900px
;
...
...
src/router/routes.js
浏览文件 @
af99a9de
...
...
@@ -10,7 +10,9 @@ export default [
/* 考试倒计时 */
{
path
:
'/examTime'
,
name
:
'examTime'
,
component
:
()
=>
import
(
'../pages/exam/examTime.vue'
)
},
/* 答题 */
{
path
:
'/examAnswer'
,
name
:
'examAnswer'
,
component
:
()
=>
import
(
'../pages/exam/examAnswer.vue'
)
},
{
path
:
'/examAnswer/:examId'
,
name
:
'examAnswer'
,
component
:
()
=>
import
(
'../pages/exam/examAnswer.vue'
)
},
/* 结束考试 */
{
path
:
'/examEnd'
,
name
:
'examEnd'
,
component
:
()
=>
import
(
'../pages/exam/examEnd.vue'
)
},
/* 如果所有页面都没找到 - 指向 */
{
path
:
'*'
,
component
:
()
=>
import
(
'@/components/errorPages/404.vue'
)
}
]
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论