rank.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="work-container">
  3. <view style="margin-top: 10px">
  4. <uni-table border stripe emptyText="暂无更多数据" >
  5. <!-- 表头行 -->
  6. <uni-tr>
  7. <uni-th align="center" width="50">排名</uni-th>
  8. <uni-th align="center" width="100">运行时长</uni-th>
  9. <uni-th align="center" width="100">设备编号</uni-th>
  10. <uni-th align="center" width="100">设备名称</uni-th>
  11. </uni-tr>
  12. <!-- 表格数据行 -->
  13. <uni-tr v-for="(item,index) in rankList">
  14. <uni-td align="center">{{index+1 }}</uni-td>
  15. <uni-td align="center">{{ item.logValue }}</uni-td>
  16. <uni-td align="center">{{ item.serialNumber }}</uni-td>
  17. <uni-td align="center">{{item.deviceName}}</uni-td>
  18. </uni-tr>
  19. </uni-table>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {getAllDeviceRunTime} from '@/api/device/device';
  25. export default {
  26. data() {
  27. return {
  28. rankList:[]
  29. }
  30. },
  31. onLoad(){
  32. this.getRank();
  33. },
  34. methods: {
  35. getRank(){
  36. let self = this;
  37. getAllDeviceRunTime().then(res=>{
  38. self.rankList = res.data;
  39. })
  40. },
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. /* #ifndef APP-NVUE */
  46. .u-collapse-content{
  47. display: flex;
  48. flex-direction: column;
  49. }
  50. page {
  51. display: flex;
  52. flex-direction: column;
  53. box-sizing: border-box;
  54. background-color: #fff;
  55. min-height: 100%;
  56. height: auto;
  57. }
  58. view {
  59. font-size: 14px;
  60. line-height: inherit;
  61. }
  62. /* #endif */
  63. .text {
  64. text-align: center;
  65. font-size: 26rpx;
  66. margin-top: 10rpx;
  67. }
  68. .grid-item-box {
  69. flex: 1;
  70. /* #ifndef APP-NVUE */
  71. display: flex;
  72. /* #endif */
  73. flex-direction: column;
  74. align-items: center;
  75. justify-content: center;
  76. padding: 15px 0;
  77. }
  78. .uni-margin-wrap {
  79. width: 690rpx;
  80. width: 100%;
  81. ;
  82. }
  83. .swiper {
  84. height: 300rpx;
  85. }
  86. .swiper-box {
  87. height: 150px;
  88. }
  89. .swiper-item {
  90. /* #ifndef APP-NVUE */
  91. display: flex;
  92. /* #endif */
  93. flex-direction: column;
  94. justify-content: center;
  95. align-items: center;
  96. color: #fff;
  97. height: 300rpx;
  98. line-height: 300rpx;
  99. }
  100. @media screen and (min-width: 500px) {
  101. .uni-swiper-dot-box {
  102. width: 400px;
  103. /* #ifndef APP-NVUE */
  104. margin: 0 auto;
  105. /* #endif */
  106. margin-top: 8px;
  107. }
  108. .image {
  109. width: 100%;
  110. }
  111. }
  112. </style>