From d3e4aaf77888c46f1909eaaaa8256b1f756ce475 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 1 Apr 2021 10:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/supervision/record.vue | 35 +++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) 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 + // }; + // } + // } + } }, };