table.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="health-day-info">
  3. <!-- <div class="header">
  4. <span class="herder-info">
  5. 风机编号:麻黄山24号风机
  6. </span>
  7. <span class="herder-info">
  8. 风机编号:麻黄山24号风机
  9. </span>
  10. <span class="herder-info">
  11. 基础指标
  12. </span>
  13. </div> -->
  14. <div class="body">
  15. <div class="left">
  16. <table class="table-form">
  17. <tr>
  18. <td class="white"></td>
  19. <td class="white" v-for="(item, index) in tableData.datels" :key="index">{{item}}</td>
  20. </tr>
  21. <tr v-for="(item, index) in tableData.result" :key="index">
  22. <td class="white">{{item.value1}}</td>
  23. <td class="white">{{item.value2}}</td>
  24. <td class="white">{{item.value3}}</td>
  25. <td class="white">{{item.value4}}</td>
  26. <td class="white">{{item.value5}}</td>
  27. <td class="white">{{item.value6}}</td>
  28. <td class="white">{{item.value7}}</td>
  29. <td class="white">{{item.value8}}</td>
  30. </tr>
  31. </table>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. value: "",
  41. tableData:{}
  42. };
  43. },
  44. props:{
  45. data:{
  46. type:Object,
  47. default:() => {}
  48. }
  49. },
  50. mounted(){
  51. this.tableData = this.data;
  52. },
  53. watch:{
  54. data(res){
  55. this.tableData = res;
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="less">
  61. .health-day-info {
  62. .header {
  63. display: flex;
  64. width: 100%;
  65. height: 40px;
  66. line-height: 40px;
  67. background: fade(@gray, 60);
  68. color: @white;
  69. .herder-info {
  70. flex: 1 0 25%;
  71. text-align: center;
  72. font-size: @fontsize-s;
  73. &:last-child {
  74. flex: 1 0 50%;
  75. }
  76. }
  77. }
  78. .body {
  79. display: flex;
  80. .left {
  81. flex: 0 0 100%;
  82. display: flex;
  83. flex-direction: column;
  84. .chart-body {
  85. flex-grow: 1;
  86. display: flex;
  87. align-items: center;
  88. }
  89. }
  90. .right {
  91. flex: 0 0 50%;
  92. }
  93. }
  94. }
  95. </style>