delAbnormalResult.vue 827 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div>
  3. <el-table :data="resultList" style="width: 100%">
  4. <el-table-column v-for="(item,index) in keyList" :key="index" align="center" :label="item" :prop="item">
  5. </el-table-column>
  6. </el-table>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'delAbnormalResult',
  12. props: ['resultList'],
  13. data() {
  14. return {
  15. keyList: [],
  16. }
  17. },
  18. created() {
  19. this.init()
  20. },
  21. methods: {
  22. init() {
  23. this.keyList = Object.keys(this.resultList[0])
  24. },
  25. cellClassName(data) {
  26. const { columnIndex, rowIndex } = data
  27. // console.log(rowIndex,columnIndex);
  28. if (!this.resultList[rowIndex][columnIndex]) {
  29. return 'red-background'
  30. }
  31. },
  32. },
  33. }
  34. </script>
  35. <style scoped>
  36. ::v-deep .el-table__row .red-background {
  37. background-color: red;
  38. }
  39. </style>