p-i-s-simulation-status-detail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view>
  3. <view class="inner_box">
  4. <view class="inner_title">
  5. <view class="name name_1">序号</view>
  6. <view class="name name_2">安装地点</view>
  7. <view class="name name_3">数值/状态</view>
  8. </view>
  9. <view class="list_item">
  10. <view class="item" :class="item.status" v-for="item in List" :key="item.id">
  11. <view class="text text_1">{{item.id}}</view>
  12. <view class="text text_2">{{item.position}}</view>
  13. <view class="text text_3">{{item.value}}{{item.unit}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. status:'',
  24. List:[]
  25. };
  26. },
  27. onLoad(option) {
  28. console.log(option)
  29. this.status = option.status
  30. this.changeTitle(option.title)
  31. this.get_List(option.status)
  32. },
  33. methods:{
  34. changeTitle(title){
  35. uni.setNavigationBarTitle({
  36. title: title
  37. });
  38. },
  39. async get_List(type){
  40. console.log(type)
  41. const res = await this.$myRequest({
  42. method:"POST",
  43. url:"/safety/info",
  44. header:{
  45. "Content-Type":"application/json"
  46. },
  47. data:{
  48. type:"simulation",
  49. status:type
  50. }
  51. })
  52. console.log(res.data.data)
  53. this.List = res.data.data
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .inner_box{
  60. .inner_title{
  61. padding: 0 24rpx;
  62. height: 94rpx;
  63. background: #F3F6FA;
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: center;
  67. .name{
  68. font-size: 27rpx;
  69. font-family: PingFangSC-Regular, PingFang SC;
  70. font-weight: 400;
  71. color: #232627;
  72. text-align: center;
  73. }
  74. .name_1{
  75. width: 125rpx;
  76. }
  77. .name_2{
  78. margin: 0 15rpx;
  79. width: 420rpx;
  80. }
  81. .name_3{
  82. width: 125rpx;
  83. }
  84. }
  85. .list_item{
  86. .item{
  87. padding: 0 24rpx;
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. border-bottom: 1px solid #f3f3f3;
  92. .text{
  93. font-size: 25rpx;
  94. font-family: PingFangSC-Regular, PingFang SC;
  95. font-weight: 400;
  96. line-height: 94rpx;
  97. text-align: center;
  98. }
  99. .text_1{
  100. width: 125rpx;
  101. }
  102. .text_2{
  103. margin: 0 15rpx;
  104. width: 420rpx;
  105. overflow: hidden;
  106. text-overflow:ellipsis;
  107. white-space: nowrap;
  108. }
  109. .text_3{
  110. width: 125rpx;
  111. }
  112. }
  113. .normal{
  114. color: #27AE60;
  115. }
  116. .alarm{
  117. color: #E74C3C;
  118. }
  119. .sign{
  120. color: #2C3E50;
  121. }
  122. .fault{
  123. color: #2873FF;
  124. }
  125. }
  126. }
  127. </style>