| | |
| | | border |
| | | size="mini" |
| | | height="100%" |
| | | :cell-class-name="cellClassName" |
| | | header-cell-class-name="blue-header"> |
| | | <el-table-column |
| | | v-for="index of len * 2" :key="'prop_' + index" |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | tableData() { |
| | | tableData () { |
| | | let result = []; |
| | | this.data.forEach((item, index)=>{ |
| | | let num = index % this.len; |
| | |
| | | let last = result[result.length-1]; |
| | | last['prop_' + (num + 1)] = item.text; |
| | | last['value_' + (num + 1)] = item.val; |
| | | last['maxList'] = last['maxList'] || []; |
| | | last['minList'] = last['minList'] || []; |
| | | if (item.isMin) { |
| | | last['minList'].push(num + 1); |
| | | } |
| | | if (item.isMax) { |
| | | last['maxList'].push(num + 1); |
| | | } |
| | | }); |
| | | // console.log('co') |
| | | return result; |
| | | }, |
| | | labelArr () { |
| | | return this.labels.split(','); |
| | | } |
| | | } |
| | | ,methods: { |
| | | cellClassName (obj) { |
| | | let res = ''; |
| | | let rowData = obj.row; |
| | | rowData.maxList.forEach((v) => { |
| | | if (obj.column.property.indexOf(v) > -1) { |
| | | res += 'max-value'; |
| | | } |
| | | }); |
| | | rowData.minList.forEach((v) => { |
| | | if (obj.column.property.indexOf(v) > -1) { |
| | | res += (res ? ' min-value' : 'min-value'); |
| | | } |
| | | }); |
| | | return res; |
| | | } |
| | | } |
| | | } |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | >>> .max-value { |
| | | background: #900 !important; |
| | | } |
| | | >>> .min-value { |
| | | background: #090 !important; |
| | | } |
| | | </style> |
| | | |