diff --git a/client/src/views/supervision/record.vue b/client/src/views/supervision/record.vue index 90e4a4d..f66aaec 100644 --- a/client/src/views/supervision/record.vue +++ b/client/src/views/supervision/record.vue @@ -4,7 +4,7 @@
@@ -112,10 +112,11 @@ highlight-current-row max-height="600" @sort-change="changeTableSort" + :span-method="objectSpanMethod" > - + - + @@ -383,8 +384,8 @@ export default { }); }, getOrgList() { - getOrgList({ pid: 1 }).then((res) => { - this.orgData = genTree(res.data); + getOrgList({ can_supervision: true }).then((res) => { + this.orgData = res.data; }); }, @@ -447,6 +448,30 @@ export default { this.$message.error("请选择清单!"); } }, + objectSpanMethod({ row, column, rowIndex, columnIndex }) { + // if (columnIndex === 1 || columnIndex === 0) { + // // 当 当前行与上一行内容相同时 返回0 0 意味消除 + // if(rowIndex > 0 && row[column.property] === this.recordList[rowIndex - 1][column.property]){ + // return { + // rowspan: 0, + // colspan: 0 + // }; + // }else{ + // let rows = 1; + // // 反之 查询相同的内容有多少行 进行合并 + // for(let i = rowIndex; i < this.recordList.length - 1; i++){ + // if (row[column.property] === this.recordList[i + 1][column.property]) { + // rows++; + // } + // } + // // 返回相同内容的行数 + // return { + // rowspan: rows, + // colspan: 1 + // }; + // } + // } + } }, };