p-i-s-sluice-name-detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="list_item">
  5. <view class="item" v-for="(item,index) in items" :key="index" :class="item.type" @click="click_item(item.type)">
  6. <view class="name">{{item.name}}</view>
  7. <view class="num">{{item.count}}个</view>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="inner_box">
  12. <view class="inner_title">
  13. <view class="name name_1">序号</view>
  14. <view class="name name_2">安装地点</view>
  15. <view class="name name_3">数值/状态</view>
  16. </view>
  17. <view class="list_item">
  18. <view class="item" :class="item.status" v-for="item in List" :key="item.id">
  19. <view class="text text_1">{{item.id}}</view>
  20. <view class="text text_2">{{item.position}}</view>
  21. <view class="text text_3">{{item.value}}{{item.unit}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. name:'',
  32. status:'',
  33. items:[],
  34. List:[]
  35. };
  36. },
  37. onLoad(option) {
  38. console.log(option)
  39. this.name = option.name
  40. this.changeTitle(option.name)
  41. this.get_item(option.name)
  42. this.get_list(this.name)
  43. },
  44. methods:{
  45. changeTitle(name){
  46. uni.setNavigationBarTitle({
  47. title: name
  48. });
  49. },
  50. click_item(type){
  51. console.log(type)
  52. this.status = type
  53. this.get_list(this.name,this.status)
  54. },
  55. async get_item(name){
  56. const res = await this.$myRequest({
  57. method:"POST",
  58. url:"/safety/total",
  59. header:{
  60. "Content-Type":"application/json"
  61. },
  62. data:{
  63. name:name
  64. }
  65. })
  66. console.log(res.data.data)
  67. this.items = res.data.data
  68. },
  69. async get_list(name,status){
  70. const res = await this.$myRequest({
  71. method:"POST",
  72. url:"/safety/info",
  73. header:{
  74. "Content-Type":"application/json"
  75. },
  76. data:{
  77. name:name,
  78. status:status
  79. }
  80. })
  81. console.log(res.data.data)
  82. this.List = res.data.data
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .top{
  89. height: 202rpx;
  90. background: #FFFFFF;
  91. border-bottom: 1rpx solid #f3f3f3;
  92. .list_item{
  93. height: 202rpx;
  94. display: flex;
  95. justify-content: space-around;
  96. align-items: center;
  97. .item{
  98. width: 106rpx;
  99. height: 106rpx;
  100. border-radius: 50%;
  101. text-align: center;
  102. line-height: 53rpx;
  103. .name{
  104. margin-top: 21rpx;
  105. font-size: 25rpx;
  106. font-family: PingFangSC-Regular, PingFang SC;
  107. font-weight: 400;
  108. color: #FFFFFF;
  109. line-height: 34rpx;
  110. }
  111. .num{
  112. margin-top: 4rpx;
  113. font-size: 21rpx;
  114. font-family: PingFangSC-Regular, PingFang SC;
  115. font-weight: 400;
  116. color: #FFFFFF;
  117. line-height: 29rpx;
  118. }
  119. }
  120. .item_1{
  121. background: #27AE60;
  122. }
  123. .item_2{
  124. background: #E74C3C;
  125. }
  126. .item_3{
  127. background: #2C3E50;
  128. }
  129. .item_4{
  130. background: #2873FF;
  131. }
  132. // 开关量 统计
  133. .normal{
  134. background: #27AE60;
  135. }
  136. .alarm{
  137. background: #E74C3C;
  138. }
  139. .sign{
  140. background: #2C3E50;
  141. }
  142. .fault{
  143. background: #2873FF;
  144. }
  145. .open{
  146. background: #2C3E50;
  147. }
  148. .close{
  149. background: #2873FF;
  150. }
  151. }
  152. }
  153. .inner_box{
  154. .inner_title{
  155. padding: 0 24rpx;
  156. height: 94rpx;
  157. background: #F3F6FA;
  158. display: flex;
  159. justify-content: space-between;
  160. align-items: center;
  161. .name{
  162. font-size: 27rpx;
  163. font-family: PingFangSC-Regular, PingFang SC;
  164. font-weight: 400;
  165. color: #232627;
  166. text-align: center;
  167. }
  168. .name_1{
  169. width: 125rpx;
  170. }
  171. .name_2{
  172. margin: 0 15rpx;
  173. width: 420rpx;
  174. }
  175. .name_3{
  176. width: 125rpx;
  177. }
  178. }
  179. .list_item{
  180. .item{
  181. padding: 0 24rpx;
  182. display: flex;
  183. justify-content: space-between;
  184. align-items: center;
  185. border-bottom: 1px solid #f3f3f3;
  186. .text{
  187. font-size: 25rpx;
  188. font-family: PingFangSC-Regular, PingFang SC;
  189. font-weight: 400;
  190. line-height: 94rpx;
  191. text-align: center;
  192. }
  193. .text_1{
  194. width: 125rpx;
  195. }
  196. .text_2{
  197. margin: 0 15rpx;
  198. width: 420rpx;
  199. overflow: hidden;
  200. text-overflow:ellipsis;
  201. white-space: nowrap;
  202. }
  203. .text_3{
  204. width: 125rpx;
  205. }
  206. }
  207. .normal{
  208. color: #27AE60;
  209. }
  210. .alarm{
  211. color: #E74C3C;
  212. }
  213. .sign{
  214. color: #2C3E50;
  215. }
  216. .fault{
  217. color: #2873FF;
  218. }
  219. }
  220. }
  221. </style>