ByPassChart.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div>
  3. <el-table
  4. :data="tableData2"
  5. style="width:11.25rem"
  6. :row-class-name="tableRowClassName"
  7. :header-cell-style="headerCellStyle">
  8. <el-table-column
  9. prop="tagNo"
  10. :label="$t('位号')"
  11. width="180">
  12. </el-table-column>
  13. <el-table-column
  14. prop="type"
  15. :label="$t('类型')"
  16. width="180">
  17. </el-table-column>
  18. <el-table-column
  19. prop="byPassTime"
  20. :label="$t('旁路时间')">
  21. </el-table-column>
  22. <el-table-column
  23. prop="isTimeOut"
  24. :label="$t('是否超时')"
  25. width="80">
  26. </el-table-column>
  27. </el-table>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. name: "ByPassChart",
  33. methods: {
  34. tableRowClassName({row, rowIndex}) {
  35. if(rowIndex % 2 === 0){
  36. return 'warning-row';
  37. } else {
  38. return 'success-row';
  39. }
  40. return '';
  41. },
  42. headerCellStyle({ row, rowIndex }) {
  43. return 'background-color: #0f1325;color: #FFFFFF;border: none'
  44. }
  45. },
  46. data() {
  47. return {
  48. tableData2: [{
  49. tagNo: '320FC2222',
  50. type: '类型',
  51. byPassTime: '2016-05-03',
  52. isTimeOut: '是'
  53. }, {
  54. tagNo: '320FC2222',
  55. type: '类型',
  56. byPassTime: '2016-05-03',
  57. isTimeOut: '是'
  58. }, {
  59. tagNo: '320FC2222',
  60. type: '类型',
  61. byPassTime: '2016-05-03',
  62. isTimeOut: '是'
  63. }, {
  64. tagNo: '320FC2222',
  65. type: '类型',
  66. byPassTime: '2016-05-03',
  67. isTimeOut: '是'
  68. }]
  69. }
  70. }
  71. }
  72. </script>
  73. <style scoped>
  74. /deep/.el-table .warning-row {
  75. background: #171c33;
  76. }
  77. /deep/.el-table .success-row {
  78. background: #0f1325;
  79. }
  80. .el-table {
  81. background-color: #0f1325;
  82. text-align: center;
  83. color: #FFFFFF;
  84. }
  85. /deep/.el-table__row>td{
  86. border: none;
  87. }
  88. .el-table::before {
  89. height: 0px;
  90. }
  91. </style>