提交 f6a23318 authored 作者: Yroc's avatar Yroc

'后台功能补全'

上级 6d5037d4
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
<!-- --> <!-- -->
<template> <template>
<div class="container_box"> <div class="container_box">
<el-row>
<el-col :span="24">
<el-tag v-for="(i, index) in area_data" :key="index"
>{{ index }}:{{ i }}</el-tag
>
</el-col>
</el-row>
<table class="table_box" :id="chart_id"> <table class="table_box" :id="chart_id">
<tr> <tr>
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px"> <th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
...@@ -73,7 +80,6 @@ ...@@ -73,7 +80,6 @@
<el-table <el-table
:data="table_data[index].conclusion_table" :data="table_data[index].conclusion_table"
height="250" height="250"
border
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
...@@ -134,7 +140,7 @@ ...@@ -134,7 +140,7 @@
<script> <script>
export default { export default {
props: ['table_data', 'labers', 'is_pover', 'chart_id'], props: ['table_data', 'labers', 'is_pover', 'chart_id', 'area_data'],
data() { data() {
return { return {
sort_field: null, sort_field: null,
...@@ -146,7 +152,7 @@ export default { ...@@ -146,7 +152,7 @@ export default {
computed: {}, computed: {},
created() { created() {
// console.log(this.table_data); console.log(this.area_data);
// console.log(this.labers); // console.log(this.labers);
}, },
mounted() {}, mounted() {},
...@@ -201,11 +207,11 @@ export default { ...@@ -201,11 +207,11 @@ export default {
.el-icon-caret-bottom { .el-icon-caret-bottom {
position: absolute; position: absolute;
top: 20px; top: 48px;
} }
.el-icon-caret-top { .el-icon-caret-top {
position: absolute; position: absolute;
top: 13px; top: 41px;
} }
.table_box { .table_box {
......
...@@ -60,6 +60,38 @@ ...@@ -60,6 +60,38 @@
</el-popover> </el-popover>
</div> </div>
<div v-else-if="typeof item['distribute'] == 'object'"> <div v-else-if="typeof item['distribute'] == 'object'">
<!-- <el-popover
placement="top-start"
title="答对名单:"
trigger="hover"
v-if="item.correct_student"
>
<span>{{ item.correct_student }}</span>
<div
slot="reference"
v-for="(h, key, j) in item['distribute']"
:key="j"
>
{{ key }}({{ item['distribute'][key] }}题)
</div>
</el-popover>
<el-popover
placement="top-start"
title="答错名单:"
trigger="hover"
v-else-if="item.wrong_student"
>
<span>{{ item.wrong_student }}</span>
<div
slot="reference"
v-for="(h, key, j) in item['distribute']"
:key="j"
>
{{ key }}({{ item['distribute'][key] }}题)
</div>
</el-popover> -->
<div v-for="(h, key, j) in item['distribute']" :key="j"> <div v-for="(h, key, j) in item['distribute']" :key="j">
{{ key }}({{ item['distribute'][key] }}题) {{ key }}({{ item['distribute'][key] }}题)
</div> </div>
...@@ -70,6 +102,33 @@ ...@@ -70,6 +102,33 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="e.key == 'ratio'">
<el-popover
placement="top-start"
title="答对人员名单:"
trigger="hover"
v-if="item.correct_student"
>
<span>{{ item.correct_student }}</span>
<div slot="reference">
{{ item[e.key] }}
</div>
</el-popover>
<el-popover
placement="top-start"
title="答错人员名单:"
trigger="hover"
v-else-if="item.wrong_student"
>
<span>{{ item.wrong_student }}</span>
<div slot="reference">
{{ item[e.key] }}
</div>
</el-popover>
<div v-else>{{ item[e.key] }}</div>
</div>
<div v-else-if="Array.isArray(item[e.key])"> <div v-else-if="Array.isArray(item[e.key])">
<el-popover <el-popover
placement="right" placement="right"
...@@ -106,7 +165,9 @@ export default { ...@@ -106,7 +165,9 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
mounted() {}, mounted() {
console.log(this.table_data);
},
methods: { methods: {
sort(col, type = 'desc') { sort(col, type = 'desc') {
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
:table_data="original_data.list" :table_data="original_data.list"
:labers="original_data.labers" :labers="original_data.labers"
:chart_id="original_data.chart_id" :chart_id="original_data.chart_id"
:area_data="original_data.area_data"
></eye-stability-table> ></eye-stability-table>
</div> </div>
</div> </div>
......
...@@ -588,6 +588,7 @@ export default { ...@@ -588,6 +588,7 @@ export default {
changeEyeStability(datas) { changeEyeStability(datas) {
// console.log(datas); // console.log(datas);
if (!datas) return false; if (!datas) return false;
// let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '题目', key: 'title', width: '300' }, { label: '题目', key: 'title', width: '300' },
...@@ -603,14 +604,27 @@ export default { ...@@ -603,14 +604,27 @@ export default {
area: element.area, area: element.area,
stability: element.conclusion, stability: element.conclusion,
conclusion_table: element.conclusion_table, conclusion_table: element.conclusion_table,
place_ratio: Object.keys(datas.tool_data.area),
}); });
}); });
let area_data = {};
for (let index in datas.tool_data.area) {
area_data[index || '地域信息暂无'] =
datas.tool_data.area[index].instability +
'/' +
datas.tool_data.area[index].all;
}
area_data['总稳定比值'] =
datas.tool_data.all.instability + '/' + datas.tool_data.all.all;
return { return {
type: 'eye_stability_table', type: 'eye_stability_table',
print_id: 'eye_stability', print_id: 'eye_stability',
chart_id: 'eye_stability', chart_id: 'eye_stability',
color: '#E6A23C', color: '#E6A23C',
title: '眼光稳定性', title: '眼光稳定性',
area_data,
labers, labers,
list, list,
is_show: { is_show: {
...@@ -639,6 +653,7 @@ export default { ...@@ -639,6 +653,7 @@ export default {
result: element.result, result: element.result,
errorRate: `${keepTwoDecimal(element.errorRate)}%`, errorRate: `${keepTwoDecimal(element.errorRate)}%`,
ratio: `${element.wrong_num + '/' + element.total}`, ratio: `${element.wrong_num + '/' + element.total}`,
correct_student: element.distribute_student.join(' ,'),
distribute: element.distribute, distribute: element.distribute,
}); });
}); });
...@@ -646,7 +661,6 @@ export default { ...@@ -646,7 +661,6 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_table', chart_id: 'wrong_table',
print_id: 'wrong_table', print_id: 'wrong_table',
color: '#F56C6C', color: '#F56C6C',
title: '易错题分析', title: '易错题分析',
labers, labers,
...@@ -675,14 +689,15 @@ export default { ...@@ -675,14 +689,15 @@ export default {
title: element.title, title: element.title,
result: element.result, result: element.result,
ratio: `${element.total - element.wrong_num + '/' + element.total}`, ratio: `${element.total - element.wrong_num + '/' + element.total}`,
wrong_student: element.wrong_student.join(' ,'),
errorRate: `${keepTwoDecimal(100 - element.errorRate)}%`, errorRate: `${keepTwoDecimal(100 - element.errorRate)}%`,
distribute: element.distribute,
}); });
}); });
return { return {
type: 'table', type: 'table',
chart_id: 'wrong_table', chart_id: 'wrong_table',
print_id: 'wrong_table', print_id: 'wrong_table',
color: '#529B2E', color: '#529B2E',
title: '易对题分析', title: '易对题分析',
labers, labers,
...@@ -712,7 +727,6 @@ export default { ...@@ -712,7 +727,6 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_position', chart_id: 'wrong_position',
print_id: 'wrong_position', print_id: 'wrong_position',
color: '#E6A23C', color: '#E6A23C',
title: '错误部位', title: '错误部位',
labers, labers,
...@@ -746,7 +760,6 @@ export default { ...@@ -746,7 +760,6 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_level', chart_id: 'wrong_level',
print_id: 'wrong_level', print_id: 'wrong_level',
color: '#505F79', color: '#505F79',
title: '错误上下一级', title: '错误上下一级',
labers, labers,
...@@ -780,7 +793,6 @@ export default { ...@@ -780,7 +793,6 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_color', chart_id: 'wrong_color',
print_id: 'wrong_color', print_id: 'wrong_color',
color: '#99A9BF', color: '#99A9BF',
title: '错误颜色', title: '错误颜色',
labers, labers,
...@@ -814,7 +826,6 @@ export default { ...@@ -814,7 +826,6 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_group', chart_id: 'wrong_group',
print_id: 'wrong_group', print_id: 'wrong_group',
color: '#529B2E', color: '#529B2E',
title: '错误组别', title: '错误组别',
labers, labers,
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论