From df7f13d411e9ccbece623e45950b483f2650b114 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 25 Dec 2019 10:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E7=BB=AD=E4=BF=9D=E6=8A=A4=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E9=A2=84=E8=A7=88=E8=AF=A6=E6=83=85=E5=90=88=E5=B9=B6?= =?UTF-8?q?rowspan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routeoperate/protectDetail.vue | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protectDetail.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protectDetail.vue index 11db11161..5da9960b1 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protectDetail.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protectDetail.vue @@ -9,7 +9,7 @@ append-to-body > - + @@ -49,7 +49,8 @@ export default { return { show: false, title: '', - data: [] + data: [], + sectionListNumList: [] }; }, computed: { @@ -61,10 +62,13 @@ export default { methods: { doShow(data) { this.data = []; + this.sectionListNumList = []; data.relSectionSwitchList.forEach(item => { const unlockSectionName = this.handleRouteOverlapSectionList(item, data.unlockSectionCode); if (item.routeOverlapSwitchList.length) { + this.sectionListNumList.push(item.routeOverlapSwitchList.length); item.routeOverlapSwitchList.forEach( ele => { + this.sectionListNumList.push(0); const column = { unlockSectionCode: unlockSectionName, unlockTime: data.unlockTime, @@ -75,7 +79,9 @@ export default { this.$convertSpecifiedField(column, this.switchList, 'code', 'name', ['switchCode']); this.data.push(column); } ); + this.sectionListNumList.pop(); } else { + this.sectionListNumList.push(1); const column = { unlockSectionCode: unlockSectionName, unlockTime: data.unlockTime, @@ -102,6 +108,26 @@ export default { }, doClose(done) { this.show = false; + }, + objectSpanMethod({ row, column, rowIndex, columnIndex }) { + if (column.property === 'unlockSectionCode' || column.property === 'unlockTime') { + if (rowIndex === 0) { + return { + rowspan: this.data.length, + colspan: 1 + }; + } else { + return { + rowspan: 0, + colspan: 0 + }; + } + } else if (column.property === 'routeOverlapSectionList') { + return { + rowspan: this.sectionListNumList[rowIndex], + colspan: 1 + }; + } } } };