| | |
| | | @row-click="rowClick" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0" |
| | | :summary-method="getSummaries" :row-class-name="tableRowClassName" |
| | | :row-key="record=>record.id" :current-row-key="data.currentId" |
| | | highlight-current-row |
| | | :highlight-current-row="data.highlight===undefined||data.highlight" |
| | | :span-method="spanMethod"> |
| | | <el-table-column type="selection" width="65" v-if="data.showSelect" :key="Math.random()"> |
| | | </el-table-column> |
| | |
| | | // position:0 |
| | | // } |
| | | ], |
| | | testArr: [], |
| | | testPosition: 0, |
| | | specialSpanList:[ |
| | | // { |
| | | // arr:[], |
| | | // position:0 |
| | | // } |
| | | ], |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }); |
| | | }, |
| | | spanMethod({ row, column, rowIndex, columnIndex }){ |
| | | // 一般的合并行 |
| | | if(this.data.spanConfig!=undefined&&this.data.spanConfig.rows&&this.data.spanConfig.rows.length>0){ |
| | | let i = null; |
| | | let obj = this.data.spanConfig.rows.find((item,index)=>{ |
| | |
| | | }) |
| | | if(obj){ |
| | | const _row = this.spanList[i].arr[rowIndex]; |
| | | const _col = _row > 0 ? 1 : 0; |
| | | return { |
| | | rowspan: _row, |
| | | colspan: _col, |
| | | }; |
| | | } |
| | | } |
| | | // 特殊的合并行 |
| | | if(this.data.spanConfig!=undefined&&this.data.spanConfig.special&&this.data.spanConfig.special.main&&this.data.spanConfig.special.rows&&this.data.spanConfig.special.rows.length>0){ |
| | | let i = null; |
| | | let obj = this.data.spanConfig.special.rows.find((item,index)=>{ |
| | | i = index; |
| | | return item.index==columnIndex |
| | | }) |
| | | if(obj){ |
| | | const _row = this.specialSpanList[i].arr[rowIndex]; |
| | | const _col = _row > 0 ? 1 : 0; |
| | | return { |
| | | rowspan: _row, |
| | |
| | | }) |
| | | } |
| | | } |
| | | // 一般的合并行 |
| | | if(this.data.spanConfig!=undefined&&this.data.spanConfig.rows&&this.data.spanConfig.rows.length>0){ |
| | | this.spanList = []; |
| | | this.data.spanConfig.rows.forEach((item,index)=>{ |
| | |
| | | }) |
| | | this.rowspan(this.spanList[index].arr, this.spanList[index].position, item.name); |
| | | }) |
| | | // this.testArr = [] |
| | | // this.testPosition = 0 |
| | | // this.rowspan(this.testArr, this.testPosition, this.data.spanConfig.rows.name); |
| | | } |
| | | // 特殊的合并行 |
| | | if(this.data.spanConfig!=undefined&&this.data.spanConfig.special&&this.data.spanConfig.special.main&&this.data.spanConfig.special.rows&&this.data.spanConfig.special.rows.length>0){ |
| | | this.specialSpanList = [] |
| | | this.data.spanConfig.special.rows.forEach((item,index)=>{ |
| | | this.specialSpanList.push({ |
| | | arr:[], |
| | | position:0 |
| | | }) |
| | | this.rowspan(this.specialSpanList[index].arr, this.specialSpanList[index].position, this.data.spanConfig.special.main); |
| | | }) |
| | | } |
| | | this.loading = false |
| | | }).catch(e => { |