提交 7421b204 authored 作者: wangjialong209's avatar wangjialong209

数据统计优化修改

上级 0b211777
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
<div class="container_box"> <div class="container_box">
<table class="table_box"> <table class="table_box">
<!-- <tr> <!-- <tr>
<th v-for="(e, i) in labers" :key="i">{{ e.label }}</th> <th v-for="(e, i) in labers" :key="i">{{ e.label }}</th>
</tr> --> </tr> -->
<tr v-for="(item, index) in table_data.labers" :key="index"> <tr v-for="(item, index) in table_data.labers" :key="index">
<th>{{ item.label }}</th> <th>{{ item.label }}</th>
<th>{{ table_data.data[item.key] }}</th> <th>{{ keepTwoDecimal(table_data.data[item.key]) }}</th>
<th></th> <th></th>
</tr> </tr>
</table> </table>
...@@ -35,9 +35,19 @@ export default { ...@@ -35,9 +35,19 @@ export default {
}, },
mounted() { }, mounted() { },
methods: {} methods: {
//保留两位,四舍五入
keepTwoDecimal(num) {
var result = parseFloat(num);
if (isNaN(result)) {
return false;
} else {
result = Math.round(num * 100) / 100;
return result;
}
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container_box { .container_box {
......
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
console.log('获取试题详情'); console.log('获取试题详情');
console.log(res); console.log(res);
this.found_remark = res.found_remark || ''; this.found_remark = res.found_remark || '';
this.head_data.title = res.review_content.EyeStability.title;//标题 this.head_data.title = res.review_content.title_list;//标题
this.is_loading = false; this.is_loading = false;
this.review_conditions = res.review_conditions;//审阅条件 this.review_conditions = res.review_conditions;//审阅条件
if (res.review_content) { if (res.review_content) {
......
...@@ -278,7 +278,7 @@ export default { ...@@ -278,7 +278,7 @@ export default {
console.log('统计数据'); console.log('统计数据');
console.log(res); console.log(res);
this.is_loading = false; this.is_loading = false;
this.head_data.title = res.EyeStability.title;//标题 this.head_data.title = res.title_list;//标题
this.result_section = this.changeScore(res.ScoreScore);//成绩分段 this.result_section = this.changeScore(res.ScoreScore);//成绩分段
this.area_score = this.changeAreaScore(res.AreaScore);//南北方得分 this.area_score = this.changeAreaScore(res.AreaScore);//南北方得分
this.province_score = this.changeProvinceScore(res.ProvinceScore);//省区得分 this.province_score = this.changeProvinceScore(res.ProvinceScore);//省区得分
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论