Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-learning-report
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-learning-report
提交
f040e37b
提交
f040e37b
编写于
12月 12, 2019
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
课程平均学习时长的长度问题
上级
480262c5
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
12 行删除
+13
-12
course-times-stat.vue
components/bussiness/course-times-stat.vue
+10
-4
pica-process.vue
components/common/pica-process.vue
+3
-8
未找到文件。
components/bussiness/course-times-stat.vue
浏览文件 @
f040e37b
...
...
@@ -7,11 +7,11 @@
课程总时长
<span>
(所有课程数
{{
totalSize
}}
门)
</span>
</p>
<ProcessBar
:processDataObj=
"processDataObj"
:maxValue=
"maxDuration
"
:value=
"maxDuration
"
></ProcessBar>
<ProcessBar
:processDataObj=
"processDataObj"
:maxValue=
"maxDuration
| convert"
:value=
"maxDuration | convert
"
></ProcessBar>
</li>
<li>
<p>
平均学习时长
</p>
<ProcessBar
barColor=
"#FFB01A"
:processDataObj=
"processDataObj"
:maxValue=
"maxDuration
"
:value=
"avgDuration
"
></ProcessBar>
<ProcessBar
barColor=
"#FFB01A"
:processDataObj=
"processDataObj"
:maxValue=
"maxDuration
| convert"
:value=
"avgDuration | convert
"
></ProcessBar>
</li>
</ul>
<ul
class=
"lr-course-times"
v-show=
"avgDuration > maxDuration"
>
...
...
@@ -20,11 +20,11 @@
课程总时长
<span>
(所有课程数
{{
totalSize
}}
门)
</span>
</p>
<ProcessBar
:processDataObj=
"processDataObj"
:maxValue=
"avgDuration
"
:value=
"maxDuration
"
></ProcessBar>
<ProcessBar
:processDataObj=
"processDataObj"
:maxValue=
"avgDuration
| convert"
:value=
"maxDuration | convert
"
></ProcessBar>
</li>
<li>
<p>
平均学习时长
</p>
<ProcessBar
barColor=
"#FFB01A"
:processDataObj=
"processDataObj"
:maxValue=
"avgDuration
"
:value=
"avgDuration
"
></ProcessBar>
<ProcessBar
barColor=
"#FFB01A"
:processDataObj=
"processDataObj"
:maxValue=
"avgDuration
| convert"
:value=
"avgDuration | convert
"
></ProcessBar>
</li>
</ul>
</div>
...
...
@@ -55,6 +55,12 @@ export default {
}
},
},
filters
:
{
convert
:
function
(
value
,
unitName
=
'分钟'
)
{
if
(
!
value
)
return
0
+
unitName
;
return
Math
.
ceil
(
value
/
60
)
},
},
components
:
{
ProcessBar
,
},
...
...
components/common/pica-process.vue
浏览文件 @
f040e37b
<!-- Tabs组件 -->
<
template
>
<div
class=
"common-process"
>
<span
class=
"bar"
:style=
"
{'width': maxPocessWidth, 'background': barColor}">
</span><span
class=
"desc"
>
{{
value
|
convert
}}
</span>
<span
class=
"bar"
:style=
"
{'width': maxPocessWidth, 'background': barColor}">
</span><span
class=
"desc"
>
{{
value
}}
</span>
</div>
</
template
>
<
script
>
...
...
@@ -46,12 +46,6 @@ export default {
maxPocessWidth
:
'0px'
}
},
filters
:
{
convert
:
function
(
value
,
unitName
=
'分钟'
)
{
if
(
!
value
)
return
0
+
unitName
;
return
Math
.
ceil
(
value
/
60
)
+
unitName
},
},
watch
:
{
processDataObj
:
{
handler
(
newVal
)
{
...
...
@@ -59,13 +53,14 @@ export default {
let
clientWidth
=
window
.
outerWidth
||
document
.
body
.
clientWidth
||
document
.
documentElement
.
clientWidth
;
let
maxWidth
=
clientWidth
-
this
.
valueDescWidth
;
let
ratio
=
1
;
// debugger
if
(
this
.
maxValue
&&
this
.
maxValue
<
this
.
value
)
{
ratio
=
this
.
maxValue
/
this
.
value
;
}
if
(
this
.
value
&&
this
.
maxValue
>
this
.
value
)
{
ratio
=
this
.
value
/
this
.
maxValue
;
}
if
(
this
.
value
<
=
1
||
this
.
maxValue
<=
1
||
ratio
<=
0.01
)
{
if
(
this
.
value
<
1
||
this
.
maxValue
<
1
||
ratio
<=
0.01
)
{
this
.
maxPocessWidth
=
'1px'
}
else
{
this
.
maxPocessWidth
=
Math
.
round
(
ratio
*
maxWidth
)
+
'px'
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录