rank.vue 2.1 KB

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