Commit 0238fda3 by maxiaohan

比中列表树形回显

parent 4d1554af
......@@ -668,28 +668,46 @@ export default {
hadnlExpandChange(row, expanded) {
// 获取下标
var i = this.list.findIndex(table => table.queryId === row.queryId);
// var i = this.tableData.findIndex(table => table.id === row.id);
console.log(i);
if (expanded) {
console.info("展开时row数据", this.list[i]);
this.list[i] = {
qid: row.qid,
children: row.children,
queryId: row.queryId
};
this.$forceUpdate();
// this.$set(this.tableData[i], "barcode", "");
// 保证临时变量中存在下标属性,方便后续折叠时取值
row.index = i;
//row.index = i;
// // push到临时数组中
// this.arr.push(row);
// 清空表格数据
var obj = {
// var obj = {
// qid: row.qid,
// children: row.children,
// queryId: row.queryId
// };
// this.list[i] = obj;
} else {
console.info("折叠时row数据", this.list[i]);
this.list[i] = {
qid: row.qid,
children: row.children,
queryId: row.queryId
queryId: row.queryId,
barcode: row.children[0].barcode,
maxcandidatecnt: row.children[0].maxcandidatecnt,
querytype: row.children[0].querytype,
queryStateName: row.children[0].queryStateName,
hitpossibility: row.children[0].hitpossibility,
queryclass: row.children[0].queryclass,
affirmtime: row.children[0].affirmtime,
requestdatetime: row.children[0].requestdatetime,
userdesc: row.children[0].userdesc
};
this.list[i] = obj;
} else {
console.info("折叠时row数据", row);
var rowObj = row.children[0];
rowObj.children = row.children;
// this.$set(rowObj, "children", row.children);
// // 根据下标取临时变量
// var rowObj = this.arr.find(row => row.index === i);
// 赋值
console.info("折叠时rowObj数据", rowObj);
this.list[i] = rowObj;
this.$forceUpdate();
console.info("塞完数据的row", this.list[i]);
}
},
// table表格选中获取数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment