提交 ad6d48e1 编写于 作者: guangjun.yang's avatar guangjun.yang

单位转换等

上级 6addd07e
......@@ -31,7 +31,7 @@ export default {
},
data() {
return {
chartWidth: "300px",
chartWidth: "100%",
chartHeight: "350px"
};
},
......@@ -45,10 +45,10 @@ export default {
return item.classifyName;
});
series0Data = this.dataList.map(item => {
return item.beforeRate;
return (item.beforeRate || 0) * 100;
});
series1Data = this.dataList.map(item => {
return item.afterRate;
return (item.afterRate || 0) * 100;
});
if (process.client) {
let clientWidth =
......@@ -56,8 +56,8 @@ export default {
document.body.clientWidth ||
document.documentElement.clientWidth;
this.chartWidth = clientWidth + "px";
this.chartHeight = 54 * 3 + "px";
this.chartHeight = 54 * this.dataList.length + "px";
// this.chartHeight = 54 * 3 + "px";
this.chartHeight = 43 * this.dataList.length + "px";
this.drawColumn(yAxisData, series0Data, series1Data);
}
// this.drawColumn(yAxisData, series0Data, series1Data);
......@@ -67,20 +67,11 @@ export default {
},
created() {
if (process.client) {
let clientWidth =
window.outerWidth ||
document.body.clientWidth ||
document.documentElement.clientWidth;
this.chartWidth = clientWidth + "px";
this.chartHeight = 54 * 3 + "px";
// this.chartHeight = 54 * this.dataList.length + "px";
}
},
mounted() {
vm = this;
// chartColumn = this.$echarts.init(document.getElementById(this.id));
// this.drawColumn([], [], []);
},
methods: {
// 画
......@@ -108,10 +99,10 @@ export default {
}
},
grid: {
top: "2%",
left: "3%",
top: "6%",
left: "6%",
right: "6%",
bottom: "0%",
bottom: "6%",
containLabel: true,
borderWidth: 0
},
......
......@@ -10,8 +10,8 @@
<ul class="list">
<li v-for="(item, index) in dataList" :key="index">
<span>{{item.courseName | shortName}}</span>
<span>{{item.courseTime}}分钟</span>
<span>{{item.averageTime}}分钟</span>
<span>{{item.courseTime | convert}}</span>
<span>{{item.averageTime | convert}}</span>
</li>
</ul>
</div>
......@@ -36,6 +36,10 @@ export default {
return value
}
},
convert: function (value, unitName = '分钟') {
if(!value) return 0 + unitName;
return Math.ceil(value / 60) + unitName
},
},
methods: {
......
<!-- Tabs组件 -->
<template>
<div class="common-process">
<span class="bar" :style="{'width': maxPocessWidth, 'background': barColor}"></span><span class="desc">{{value}}{{unitName}}</span>
<span class="bar" :style="{'width': maxPocessWidth, 'background': barColor}"></span><span class="desc">{{value | convert}}</span>
</div>
</template>
<script>
......@@ -46,6 +46,12 @@ export default {
maxPocessWidth: '0px'
}
},
filters: {
convert: function (value, unitName = '分钟') {
if(!value) return 0 + unitName;
return Math.ceil(value / 60) + unitName
},
},
watch: {
processDataObj: {
handler(newVal) {
......
......@@ -217,6 +217,7 @@ export default {
allData: {},
projectId: "",
token:
"A220943B006347799F277CC524EBB662" ||
"B10441890E2940499621C76667675B2D" ||
// "17B31C94D44947829097A953BC7C2732" ||
"A0E52265D31B4D2380C7CFC9E1ACCDCE" ||
......
<template>
<section>
<CommonHeader title="培训前后知识点掌握情况"></CommonHeader>
<TitleKLGPoint :title="listTitle"></TitleKLGPoint>
<TitleKLGPoint :title="title"></TitleKLGPoint>
<ChartColumnHorizontalTCLong :dataList="knowledgeEffectList" class="mt-10"></ChartColumnHorizontalTCLong>
<CommonNoMore></CommonNoMore>
</section>
......@@ -18,7 +18,7 @@ import ChartColumnHorizontalTCLong from "@/components/bussiness/charts/chart-col
export default {
data() {
return {
listTitle: "共10知识点",
title: "共0知识点",
token: '',
queryGDParams: {
appSelectType: 2, //考试分析(1考试次数全部2考试分数全部) 学习效果分析(1正确率对比全部2知识点对比全部)
......@@ -64,7 +64,8 @@ export default {
async getStudyEffect(params) {
await getStudyEffect(params).then(res => {
if (res.code === "000000") {
this.knowledgeEffectList = res.data.knowledgeEffectList;
this.knowledgeEffectList = res.data.knowledgeEffectList || [];
this.title = `共${this.knowledgeEffectList.length}知识点`;
}
});
}
......@@ -73,6 +74,6 @@ export default {
</script>
<style lang="less" scoped>
.mt-10 {
margin-top: 2px !important;
margin-top: 20px !important;
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册