Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
971227a6
提交
971227a6
authored
11月 09, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
考前摸底,真题实战
上级
b1a87ba8
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
280 行增加
和
27 行删除
+280
-27
exam.js
src/api/exam.js
+9
-2
pieChart.vue
src/components/exam/pieChart.vue
+1
-2
resultCard.vue
src/components/exam/resultCard.vue
+7
-6
aside.vue
src/components/layout/aside.vue
+1
-1
index.vue
src/pages/mockExam/exam/index.vue
+0
-0
result.vue
src/pages/mockExam/exam/result.vue
+181
-0
index.vue
src/pages/mockExam/index.vue
+57
-4
index.vue
src/pages/testExam/exam/index.vue
+1
-1
result.vue
src/pages/testExam/exam/result.vue
+7
-2
index.vue
src/pages/testExam/index.vue
+4
-7
routes.js
src/router/routes.js
+12
-2
没有找到文件。
src/api/exam.js
浏览文件 @
971227a6
...
...
@@ -9,8 +9,8 @@ export function getExamQuestion(params) {
/**
* 缓存考前摸底试题
*/
export
function
setCache
(
data
)
{
return
httpRequest
.
post
(
'/api/zy/v2/examination/examination-papers'
,
data
)
export
function
setCache
(
params
)
{
return
httpRequest
.
post
(
'/api/zy/v2/examination/examination-papers'
,
params
)
}
/**
...
...
@@ -20,6 +20,13 @@ export function getExamStatus(params) {
return
httpRequest
.
get
(
'/api/zy/v2/examination/examination-papers-status'
,
{
params
})
}
/**
* 模拟考试设置角色
*/
export
function
setRoles
(
params
)
{
return
httpRequest
.
post
(
'/api/zy/v2/examination/role'
,
params
)
}
/**
* 获取课程列表
*/
...
...
src/components/exam/pieChart.vue
浏览文件 @
971227a6
...
...
@@ -5,8 +5,7 @@
<circle
cx=
"74"
cy=
"74"
r=
"70"
stroke-width=
"7"
stroke=
"#4cce8c"
fill=
"none"
:stroke-dasharray=
"data"
stroke-linecap=
"round"
></circle>
</svg>
<div
class=
"chart-txt"
>
<div
class=
"num"
>
{{
accuracy
}}
%
</div>
<div
class=
"t"
>
正确率
</div>
<slot
name=
"tips"
></slot>
</div>
</div>
</
template
>
...
...
src/components/exam/resultCard.vue
浏览文件 @
971227a6
...
...
@@ -88,12 +88,13 @@ export default {
})
},
goQuestion
(
id
)
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
id
:
id
}
})
this
.
$emit
(
'goQuestion'
,
id
)
// this.$router.push({
// path: '/testExam/exam',
// query: {
// id: id
// }
// })
}
}
}
...
...
src/components/layout/aside.vue
浏览文件 @
971227a6
...
...
@@ -28,7 +28,7 @@ export default {
return
{
defaultMenus
:
[
{
title
:
'考前摸底'
,
icon
:
''
,
path
:
'/testExam'
},
{
title
:
'真题实战'
,
icon
:
''
,
path
:
'/mock
Exam
'
},
{
title
:
'真题实战'
,
icon
:
''
,
path
:
'/mock'
},
{
title
:
'错题集合'
,
icon
:
''
,
path
:
'/my/questions/wrong'
},
{
title
:
'收藏试题'
,
icon
:
''
,
path
:
'/my/questions/collection'
},
{
title
:
'必考考点'
,
icon
:
''
,
path
:
'/course/test'
},
...
...
src/pages/mockExam/exam/index.vue
0 → 100644
浏览文件 @
971227a6
差异被折叠。
点击展开。
src/pages/mockExam/exam/result.vue
0 → 100644
浏览文件 @
971227a6
<
template
>
<div
class=
"result-box"
>
<div
class=
"card-left"
>
<div
class=
"title"
>
成绩报告
</div>
<div
class=
"chart-box"
>
<chart
:accuracy=
"accuracy"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
accuracy
}}
</div>
<div
class=
"t"
>
分
</div>
</
template
>
</chart>
</div>
<!-- <div class="assess">测试评估</div>
<div class="assess-box">
<div class="prog">
<div class="line-box">
<div class="line" :style="setStyle"></div>
</div>
<div class="icon"></div>
</div>
<div class="text">{{ accuracy !== 100 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}</div>
<div class="btn">全部考试服务</div>
</div> -->
</div>
<div
class=
"card-right"
>
<card
v-if=
"data.sheet"
:data=
"data.sheet"
@
goQuestion=
"goPage"
>
<
template
v-slot:btnBox
>
<div
class=
"btn-box"
>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
<div
class=
"btn"
@
click=
"goPage('err')"
>
错误解析
</div>
</div>
</
template
>
</card>
</div>
</div>
</template>
<
script
>
import
chart
from
'@/components/exam/pieChart.vue'
import
card
from
'@/components/exam/resultCard.vue'
import
*
as
api
from
'@/api/exam.js'
export
default
{
components
:
{
chart
,
card
},
data
()
{
return
{
data
:
{},
accuracy
:
0
}
},
created
()
{
this
.
getExamPapers
()
},
computed
:
{
},
mounted
()
{
},
methods
:
{
goPage
(
param
)
{
this
.
$router
.
push
({
path
:
'/mock/exam'
,
query
:
{
id
:
param
}
})
},
getExamPapers
()
{
const
param
=
{
type
:
1
,
is_create
:
0
}
api
.
getExamQuestion
(
param
)
.
then
(
response
=>
{
const
data
=
JSON
.
parse
(
response
.
data
)
this
.
data
=
data
this
.
accuracy
=
parseInt
(
data
.
sheet
.
score
)
// console.log(this.accuracy)
})
.
finally
(()
=>
{
// this.loaded = true
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.result-box
{
width
:
100%
;
display
:
flex
;
.card-left
{
position
:
relative
;
box-sizing
:
border-box
;
padding
:
10px
30px
20px
;
flex
:
1
;
background
:
#fff
;
margin-right
:
10px
;
height
:
560px
;
border-radius
:
8px
;
.title
{
font-size
:
18px
;
color
:
#222222
;
line-height
:
45px
;
border-bottom
:
1px
solid
#ccc
;
}
.chart-box
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
-webkit-transform
:
translate
(
-50%
,
-50%
);
width
:
148px
;
// margin: 26px auto 0;
}
.assess
{
font-size
:
18px
;
color
:
#222222
;
line-height
:
45px
;
border-bottom
:
1px
solid
#ccc
;
}
.assess-box
{
padding-top
:
27px
;
.prog
{
width
:
350px
;
margin
:
0
auto
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.line-box
{
width
:
300px
;
width
:
300px
;
height
:
10px
;
background
:
#F9F9F9
;
border-radius
:
5px
;
.line
{
width
:
80%
;
height
:
10px
;
background
:
linear-gradient
(
90deg
,
#F47C46
0%
,
#F22F48
100%
);
border-radius
:
5px
;
}
}
.icon
{
width
:
41px
;
height
:
38px
;
background
:
url(@/assets/images/res-icon.png)
;
background-size
:
100%
100%
;
}
}
.text
{
font-size
:
14px
;
color
:
#222222
;
line-height
:
20px
;
text-align
:
center
;
margin
:
50px
0
68px
0
;
}
.btn
{
cursor
:
pointer
;
text-align
:
center
;
line-height
:
40px
;
width
:
144px
;
height
:
40px
;
background
:
#C01540
;
border-radius
:
4px
;
font-size
:
14px
;
font-weight
:
bold
;
color
:
#FFFFFF
;
margin
:
0
auto
;
}
}
}
.card-right
{
box-sizing
:
border-box
;
flex
:
1
;
background
:
#fff
;
height
:
560px
;
border-radius
:
8px
;
margin-left
:
10px
;
padding
:
10px
30px
0
;
}
}
</
style
>
src/pages/mockExam/index.vue
浏览文件 @
971227a6
...
...
@@ -20,8 +20,8 @@
<div
class=
"item"
>
<p><b>
选择角色
</b></p>
<el-radio-group
v-model=
"role"
>
<el-radio
:label=
"
0
"
>
管理人员
</el-radio>
<el-radio
:label=
"
1
"
>
安全人员
</el-radio>
<el-radio
:label=
"
1
"
>
管理人员
</el-radio>
<el-radio
:label=
"
2
"
>
安全人员
</el-radio>
</el-radio-group>
</div>
<div
class=
"item"
>
...
...
@@ -30,18 +30,71 @@
</div>
</div>
<template
#
footer
>
<div
class=
"app-container-ft"
><el-button
type=
"primary"
>
开始考试
</el-button></div>
<div
class=
"app-container-ft"
><el-button
type=
"primary"
@
click=
"startExam"
>
开始考试
</el-button></div>
</
template
>
</app-container>
</template>
<
script
>
import
AppContainer
from
'@/components/AppContainer'
import
*
as
api
from
'@/api/exam.js'
export
default
{
components
:
{
AppContainer
},
data
()
{
return
{
role
:
0
role
:
window
.
localStorage
.
role
?
parseInt
(
window
.
localStorage
.
role
)
:
1
}
},
mounted
()
{},
methods
:
{
startExam
()
{
api
.
setRoles
({
role
:
this
.
role
})
.
then
(
response
=>
{
if
(
response
.
code
===
0
)
{
window
.
localStorage
.
role
=
this
.
role
api
.
getExamStatus
({
type
:
2
})
.
then
(
response
=>
{
if
(
parseInt
(
response
.
status
)
===
0
||
parseInt
(
response
.
status
)
===
3
)
{
this
.
toolTipBox
()
}
else
{
this
.
$router
.
push
({
path
:
'/mock/exam'
,
query
:
{
is_create
:
true
}
})
}
})
.
finally
(()
=>
{
})
}
})
.
finally
(()
=>
{
})
},
toolTipBox
()
{
this
.
$confirm
(
'您上次未做完试题'
,
''
,
{
confirmButtonText
:
'重新答题'
,
cancelButtonText
:
'继续答题'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$router
.
push
({
path
:
'/mock/exam'
,
query
:
{
is_create
:
1
}
})
}).
catch
((
e
)
=>
{
console
.
log
(
e
)
this
.
$router
.
push
({
path
:
'/mock/exam'
,
query
:
{
is_create
:
0
}
})
})
}
}
}
...
...
src/pages/testExam/exam/index.vue
浏览文件 @
971227a6
...
...
@@ -165,7 +165,7 @@ export default {
getTopic
()
{
const
param
=
{
type
:
1
,
is_create
:
this
.
$route
.
query
.
id
||
!
this
.
$route
.
query
.
is_create
?
0
:
1
is_create
:
this
.
$route
.
query
.
id
||
this
.
$route
.
query
.
is_create
===
undefined
?
0
:
this
.
$route
.
query
.
is_create
}
api
.
getExamQuestion
(
param
)
...
...
src/pages/testExam/exam/result.vue
浏览文件 @
971227a6
...
...
@@ -3,7 +3,12 @@
<div
class=
"card-left"
>
<div
class=
"title"
>
成绩报告
</div>
<div
class=
"chart-box"
>
<chart
:accuracy=
"accuracy"
/>
<chart
:accuracy=
"accuracy"
>
<template
v-slot:tips
>
<div
class=
"num"
>
{{
accuracy
}}
%
</div>
<div
class=
"t"
>
正确率
</div>
</
template
>
</chart>
</div>
<div
class=
"assess"
>
测试评估
</div>
<div
class=
"assess-box"
>
...
...
@@ -18,7 +23,7 @@
</div>
</div>
<div
class=
"card-right"
>
<card
v-if=
"data.sheet"
:data=
"data.sheet"
>
<card
v-if=
"data.sheet"
:data=
"data.sheet"
@
goQuestion=
"goPage"
>
<
template
v-slot:btnBox
>
<div
class=
"btn-box"
>
<div
class=
"btn"
@
click=
"goPage('all')"
>
全部解析
</div>
...
...
src/pages/testExam/index.vue
浏览文件 @
971227a6
...
...
@@ -23,11 +23,8 @@ export default {
},
methods
:
{
getExamStatus
()
{
const
param
=
{
type
:
1
}
api
.
getExamStatus
(
param
)
.
getExamStatus
(
{
type
:
1
}
)
.
then
(
response
=>
{
if
(
response
.
status
===
0
||
response
.
status
===
3
)
{
this
.
open
()
...
...
@@ -35,7 +32,7 @@ export default {
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
is_create
:
true
is_create
:
1
}
})
}
...
...
@@ -60,14 +57,14 @@ export default {
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
is_create
:
false
is_create
:
0
}
})
}
else
{
this
.
$router
.
push
({
path
:
'/testExam/exam'
,
query
:
{
is_create
:
true
is_create
:
1
}
})
}
...
...
src/router/routes.js
浏览文件 @
971227a6
...
...
@@ -43,10 +43,15 @@ const examAnswer = [
path
:
'/testExam/result'
,
component
:
()
=>
import
(
/* webpackChunkName: "exam" */
'@/pages/testExam/exam/result'
)
},
/
/ 真题实战
/
* 真题实战 */
{
path
:
'/mock
Exam
'
,
path
:
'/mock'
,
component
:
()
=>
import
(
/* webpackChunkName: "exam" */
'@/pages/mockExam'
)
},
/* 真题实战结果页 */
{
path
:
'/mock/result'
,
component
:
()
=>
import
(
/* webpackChunkName: "exam" */
'@/pages/mockExam/exam/result'
)
}
]
...
...
@@ -259,5 +264,10 @@ export default [
path
:
'/testExam/exam'
,
component
:
()
=>
import
(
/* webpackChunkName: "course-learn" */
'@/pages/testExam/exam/index'
)
},
/* 模拟考试 */
{
path
:
'/mock/exam'
,
component
:
()
=>
import
(
/* webpackChunkName: "course-learn" */
'@/pages/mockExam/exam/index'
)
},
...
viewerRoutes
]
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论