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

单位转换等

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