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

排序表格合并

上级 e20e3820
......@@ -11,7 +11,7 @@
<tr>
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
}}<span v-if="!merge_fields"
}}<span
><i
class="el-icon-caret-bottom"
:style="
......@@ -164,9 +164,7 @@ export default {
components: {},
computed: {},
created() {
},
created() {},
mounted() {
this.data_f();
// console.log(this.table_data);
......@@ -175,21 +173,38 @@ export default {
methods: {
data_f() {
this.row_data_name = {};
this.show_row_key = {};
this.is_show_table = false;
let index_list = [];
for (let d in this.merge_fields) {
for (let i in this.table_data) {
let s = 0;
if (this.show_row_key[this.merge_fields[d]]) {
s = this.merge_fields_fun(i, this.merge_fields[d]);
this.show_row_key[this.merge_fields[d]][i] = s ? true : false;
if (!index_list[i] && s) {
index_list[i] = true;
}
} else {
let a = {};
let s = this.merge_fields_fun(i, this.merge_fields[d]);
a[i] = s ? true : false;
this.show_row_key[this.merge_fields[d]] = a;
if (!index_list[i] && s) {
index_list[i] = true;
}
}
}
}
for (let i in index_list) {
for (let d in this.merge_fields) {
if (this.merge_fields[d] == 'wrong_position') {
this.show_row_key[this.merge_fields[d]][i] = true;
}
}
}
// console.log(this.show_row_key);
this.row_data_name = {};
this.is_show_table = true;
},
......@@ -198,12 +213,19 @@ export default {
if (
!this.row_data_name[key] ||
(this.row_data_name[key] &&
this.row_data_name[key] != this.table_data[index][key])
this.row_data_name[key] != this.table_data[index][key]) ||
this.show_row_key[key][index]
) {
this.row_data_name[key] = this.table_data[index][key];
for (let mf_i in this.table_data) {
if (parseInt(mf_i) >= parseInt(index)) {
if (this.table_data[index][key] == this.table_data[mf_i][key]) {
if (a && this.show_row_key[key][parseInt(mf_i) + 1]) {
num += 1;
return num;
} else if (
this.table_data[parseInt(index)][key] ==
this.table_data[parseInt(mf_i)][key]
) {
num += 1;
} else {
return num;
......
......@@ -506,12 +506,12 @@ export default {
if (res.top_data)
this.exactness_question_data = this.changeRight(res.top_data.dataasc); //对题分析
this.wrong_position_data = this.changeWrongPosition(res.WrongPosition); //错误部位
this.error_level_data = this.changeErrorLevel(res.WrongLevel); //错误等级
this.wrong_color_data = this.changeWrongColor(res.WrongColor); //错误颜色
this.wrongG_group_data = this.changeWrongGroup(res.WrongGroup); //错误组别
this.holdTobacco_data = this.changeHoldTobacco(res.holdTobacco); //把烟
this.flakeTobacco_data = this.changeFlakeTobacco(res.flakeTobacco); //片烟
this.swingHandle_data = this.changeSwingHandle(res.swingHandle); //甩把
// this.error_level_data = this.changeErrorLevel(res.WrongLevel); //错误等级
// this.wrong_color_data = this.changeWrongColor(res.WrongColor); //错误颜色
// this.wrongG_group_data = this.changeWrongGroup(res.WrongGroup); //错误组别
// this.holdTobacco_data = this.changeHoldTobacco(res.holdTobacco); //把烟
// this.flakeTobacco_data = this.changeFlakeTobacco(res.flakeTobacco); //片烟
// this.swingHandle_data = this.changeSwingHandle(res.swingHandle); //甩把
});
},
//百分比
......@@ -1017,7 +1017,7 @@ export default {
print_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
merge_fields: ['answer_position','wrong_position'], //, 'wrong_position'
merge_fields: ['answer_position', 'wrong_position'], //, 'wrong_position'
labers,
list,
is_show: {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论