p-i-power.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="time">
  5. <text>2019-10-22 星期二 11:01:32</text>
  6. </view>
  7. </view>
  8. <view class="content">
  9. <view class="content_title">
  10. 实时参数
  11. </view>
  12. <view class="content_inner">
  13. <view class="inner_box" v-for="item in powerList" :key="item.dsspara_id" :class="open == item.dsspara_id? '':'item_box_close'" @click="change(item.dsspara_id)">
  14. <view class="item">
  15. <view class="left">
  16. <view class="line"></view>
  17. <view class="name">{{item.dsspara_name}}</view>
  18. </view>
  19. <view class="icon">
  20. <uni-icons color="#999" :type="open == item.dsspara_id? 'arrowdown':'arrowright'"></uni-icons>
  21. </view>
  22. </view>
  23. <view class="item_content">
  24. <view class="item_content_list">
  25. <view v-for="item in mdparaList" :key="item.mdpara_id" class="item_content_list_item" :class="item.mdpara_state == 0?'item_content_list_item_close':''" >
  26. <view class="item_content_list_item_title">
  27. <view class="item_content_list_item_title_left">
  28. <view class="item_content_list_item_title_left_icon"></view>
  29. <view class="item_content_list_item_title_left_name">{{item.mdpara_name}}</view>
  30. </view>
  31. <view class="item_content_list_item_title_left_flag">
  32. <text>{{item.mdpara_state==0?'关':'开'}}</text>
  33. </view>
  34. </view>
  35. <view class="item_content_list_item_content">
  36. <view class="inner_list">
  37. <view class="inner_list_item" v-for="list in item.ycpara">{{list.name}}:{{list.val}} {{list.unit}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. open:0,
  53. // 列表
  54. powerList:[],
  55. // 详情
  56. mdparaList:[]
  57. };
  58. },
  59. onLoad() {
  60. this.get_powerList()
  61. },
  62. methods:{
  63. change(dsspara_id){
  64. this.open = dsspara_id
  65. // this.mdparaList = []
  66. this.get_mdparaList(dsspara_id)
  67. },
  68. // 获取列表
  69. async get_powerList(){
  70. const res = await this.$myRequest({
  71. url:"/electric/dsspara"
  72. })
  73. console.log(res.data.data)
  74. this.powerList = res.data.data
  75. },
  76. // 获取详情
  77. async get_mdparaList(dsspara_id){
  78. const res = await this.$myRequest({
  79. url:"/electric/mdpara",
  80. data:{
  81. dsspara_id:dsspara_id
  82. }
  83. })
  84. console.log(res.data.data)
  85. this.mdparaList = res.data.data
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. page{
  92. background: #009FE8;
  93. box-sizing: border-box;
  94. padding: 0 15rpx;
  95. }
  96. .top{
  97. position: relative;
  98. top: 0;
  99. left: 0;
  100. height: 314rpx;
  101. background-image: url(./icon/top.png);
  102. background-size: cover;
  103. background-repeat: no-repeat;
  104. .time{
  105. position: absolute;
  106. right: 30rpx;
  107. bottom: 10rpx;
  108. text{
  109. height: 44rpx;
  110. font-size: 31rpx;
  111. font-family: PingFangSC-Medium, PingFang SC;
  112. font-weight: 500;
  113. color: #2C3E50;
  114. line-height: 44rpx;
  115. }
  116. }
  117. }
  118. .content{
  119. margin-top: 8rpx;
  120. margin-bottom: 20rpx;
  121. background: #FFFFFF;
  122. box-shadow: 0px 3rpx 29rpx 0px rgba(59, 74, 116, 0.14);
  123. border-radius: 20rpx;
  124. padding-bottom: 20rpx;
  125. .content_title{
  126. line-height: 96rpx;
  127. text-align: center;
  128. font-size: 31rpx;
  129. font-family: PingFangSC-Medium, PingFang SC;
  130. font-weight: 500;
  131. color: #232627;
  132. border-bottom: 1rpx solid #f3f3f3;
  133. }
  134. .content_inner{
  135. .inner_box{
  136. .item{
  137. height: 88rpx;
  138. box-sizing: border-box;
  139. padding-left: 25rpx;
  140. padding-right: 25rpx;
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. border-bottom: 1px solid #f3f3f3;
  145. .left{
  146. display: flex;
  147. align-items: center;
  148. .line{
  149. width: 7rpx;
  150. height: 63rpx;
  151. background: #009FE8;
  152. border-radius: 3rpx;
  153. }
  154. .name{
  155. margin-left: 20rpx;
  156. font-size: 33rpx;
  157. font-family: PingFangSC-Medium, PingFang SC;
  158. font-weight: 500;
  159. color: #000000;
  160. }
  161. }
  162. .icon{
  163. }
  164. }
  165. .item_content{
  166. box-sizing: border-box;
  167. padding: 22rpx;
  168. .item_content_list{
  169. .item_content_list_item{
  170. margin-bottom: 15rpx;
  171. width: 670rpx;
  172. border-radius: 10rpx;
  173. border: 4rpx solid #009FE8;
  174. box-sizing: border-box;
  175. padding: 28rpx 18rpx 0;
  176. .item_content_list_item_title{
  177. height: 76rpx;
  178. background: #E74C3C;
  179. border-radius: 37rpx;
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. box-sizing: border-box;
  184. padding-left: 30rpx;
  185. padding-right: 30rpx;
  186. .item_content_list_item_title_left{
  187. display: flex;
  188. .item_content_list_item_title_left_icon{
  189. width: 40rpx;
  190. height: 40rpx;
  191. background-image: url(./icon/flag.png);
  192. background-size: cover;
  193. background-repeat: no-repeat;
  194. }
  195. .item_content_list_item_title_left_name{
  196. margin-left: 20rpx;
  197. font-size: 27rpx;
  198. font-family: PingFangSC-Medium, PingFang SC;
  199. font-weight: 500;
  200. color: #FFFFFF;
  201. }
  202. }
  203. .item_content_list_item_title_left_flag{
  204. width: 46rpx;
  205. height: 46rpx;
  206. background: #FFFFFF;
  207. border-radius: 5rpx;
  208. text-align: center;
  209. text{
  210. font-size: 25rpx;
  211. font-family: PingFangSC-Medium, PingFang SC;
  212. font-weight: 500;
  213. color: #E74C3C;
  214. }
  215. }
  216. }
  217. .item_content_list_item_content{
  218. box-sizing: border-box;
  219. padding: 20rpx 10rpx;
  220. .inner_list{
  221. display: flex;
  222. flex-wrap: wrap;
  223. .inner_list_item{
  224. margin-bottom: 15rpx;
  225. width: 50%;
  226. height: 39rpx;
  227. font-size: 27rpx;
  228. font-family: PingFangSC-Medium, PingFang SC;
  229. font-weight: 500;
  230. color: #2C3E50;
  231. line-height: 39rpx;
  232. }
  233. }
  234. }
  235. }
  236. .item_content_list_item_close{
  237. .item_content_list_item_title{
  238. background: #27AE60;
  239. }
  240. }
  241. }
  242. }
  243. }
  244. .item_box_close{
  245. .item_content{
  246. display: none;
  247. }
  248. }
  249. }
  250. }
  251. </style>