Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
5939ac45
提交
5939ac45
authored
12月 02, 2021
作者:
matian
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/vite' into vite
上级
23abb27b
bafd584f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
12 行删除
+24
-12
ScoreRange.vue
src/modules/teacher/data/exam/components/ScoreRange.vue
+10
-3
SetScoreRange.vue
src/modules/teacher/data/exam/components/SetScoreRange.vue
+14
-9
没有找到文件。
src/modules/teacher/data/exam/components/ScoreRange.vue
浏览文件 @
5939ac45
...
...
@@ -14,6 +14,7 @@
v-if=
"isSetScoreRange"
@
close=
"isSetScoreRange = false"
@
scoreRangeChange=
"scoreRangeChange"
:recordScoreRange=
"recordScoreRange"
></set-score-range>
</div>
</
template
>
...
...
@@ -26,6 +27,7 @@ export default {
data
()
{
return
{
data
:
[],
recordScoreRange
:
[],
isSetScoreRange
:
false
,
option
:
{
tooltip
:
{
...
...
@@ -71,13 +73,16 @@ export default {
}
},
mounted
()
{
this
.
scoreRangeChange
(
[{
a
:
0
,
b
:
100
}]
)
this
.
scoreRangeChange
()
},
methods
:
{
scoreRangeChange
(
data
)
{
scoreRangeChange
(
data
=
{})
{
const
{
datas
=
[{
a
:
0
,
b
:
100
}],
tags
=
[
0
,
100
]
}
=
data
const
arr
=
[
0
,
10
,
11
,
12
,
13
,
20
,
22
,
24
,
50
,
50
,
50
,
21
,
54
,
100
]
const
colors
=
[
'#6F85CC'
,
'#96C080'
,
'#EAC370'
,
'#D96685'
,
'#B170CE'
]
this
.
option
.
series
[
0
].
data
=
data
.
reduce
((
prev
,
cur
,
index
)
=>
{
this
.
recordScoreRange
=
tags
// 组装echart数据
this
.
option
.
series
[
0
].
data
=
datas
.
reduce
((
prev
,
cur
,
index
)
=>
{
let
count
=
0
arr
.
forEach
(
i
=>
{
if
(
i
>=
(
i
===
0
?
cur
.
a
:
cur
.
a
+
1
)
&&
i
<=
cur
.
b
)
count
++
...
...
@@ -85,8 +90,10 @@ export default {
prev
.
push
({
value
:
count
,
name
:
`
${
cur
.
a
}
-
${
cur
.
b
}
`
,
itemStyle
:
colors
[
index
]
})
return
prev
},
[])
// 渲染echart
const
myChart
=
echarts
.
init
(
document
.
getElementById
(
'score'
))
myChart
.
setOption
(
this
.
option
)
// 关闭弹窗
this
.
isSetScoreRange
=
false
}
}
...
...
src/modules/teacher/data/exam/components/SetScoreRange.vue
浏览文件 @
5939ac45
...
...
@@ -10,7 +10,7 @@
<div
class=
"btn"
@
click=
"addTag"
>
添加
</div>
</div>
<div
class=
"range-box"
>
<template
v-for=
"(item, index) in tag
Count
"
>
<template
v-for=
"(item, index) in tag
s
"
>
<div
class=
"li-item"
:key=
"index"
v-if=
"item != 0 && item != 100"
...
...
@@ -35,15 +35,19 @@
<
script
>
export
default
{
props
:
{
recordScoreRange
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
return
{
tagInput
:
''
,
tag
Count
:
[
0
,
100
]
tag
s
:
[
0
,
100
]
}
},
mounted
()
{
},
created
()
{
this
.
tags
=
[...
this
.
recordScoreRange
]
},
methods
:
{
// 添加标签
addTag
()
{
...
...
@@ -53,28 +57,29 @@ export default {
this
.
$message
(
'请填写正确分数段'
)
return
false
}
if
(
this
.
tag
Count
.
length
===
9
)
{
if
(
this
.
tag
s
.
length
===
9
)
{
this
.
$message
(
'最多可添加8个'
)
return
false
}
if
(
!
this
.
tag
Count
.
includes
(
value
))
{
this
.
tag
Count
.
push
(
value
)
this
.
tag
Count
.
sort
((
a
,
b
)
=>
a
-
b
)
if
(
!
this
.
tag
s
.
includes
(
value
))
{
this
.
tag
s
.
push
(
value
)
this
.
tag
s
.
sort
((
a
,
b
)
=>
a
-
b
)
this
.
tagInput
=
''
}
console
.
log
(
this
.
recordScoreRange
,
'===123'
)
},
// 删除标签
removeTag
(
index
)
{
this
.
tag
Count
.
splice
(
index
,
1
)
this
.
tag
s
.
splice
(
index
,
1
)
},
// 确认选择
confirmTag
()
{
const
data
=
this
.
tag
Count
.
reduce
((
prev
,
cur
)
=>
{
const
data
=
this
.
tag
s
.
reduce
((
prev
,
cur
)
=>
{
const
findPrev
=
prev
[
prev
.
length
-
1
]
if
(
cur
!==
0
)
prev
.
push
({
a
:
findPrev
?
findPrev
.
b
:
0
,
b
:
cur
})
return
prev
},
[])
this
.
$emit
(
'scoreRangeChange'
,
data
)
this
.
$emit
(
'scoreRangeChange'
,
{
datas
:
data
,
tags
:
this
.
tags
}
)
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论