云链智安app
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="container">
  3. <view class="custom-tabs">
  4. <view class="custom_box" v-for="item in baseInfo" key="index">
  5. <view class="custom_title">
  6. <view class="custom_title_name">设备编号</view>
  7. <view class="custom_title_gl">{{item.ecId }}</view>
  8. </view>
  9. <view class="custom_div">
  10. <view class="batteryccc">实时功率</view>
  11. <!-- <view class="custom_title_gl">converter.formattoFixed(item.power*1,2)<text class="batteryccc"> kW</text> </view> -->
  12. </view>
  13. <view class="custom_div">
  14. <view class="batteryccc">在线状态</view>
  15. <view v-if="item.comState==0" class="tag_type2red">离线</view>
  16. <view v-else class="tag_type2">在线</view>
  17. </view>
  18. <view class="custom_div">
  19. <view class="batteryccc">故障状态</view>
  20. <view v-if="item.faultState == 0" class="tag_type2">正常</view>
  21. <view v-else class="tag_type2red">故障</view>
  22. </view>
  23. <view class="custom_div">
  24. <view class="batteryccc">运行状态</view>
  25. <view v-if="item.runState== 1" class="tag_type2">运行</view>
  26. <view v-else class="tag_type3">停机</view>
  27. </view>
  28. <view class="custom_div">
  29. <view class="batteryccc">所属电站</view>
  30. <view class="custom_div1">{{item.powerName}}</view>
  31. </view>
  32. <view class="custom_div">
  33. <view class="batteryccc">投运时间</view>
  34. <view class="custom_div1">{{item.createTime}}</view>
  35. </view>
  36. </view>
  37. <view class="tag_typetext">没有更多数据...</view>
  38. </view>
  39. <!--
  40. createAt 投运时间
  41. comState 在线状态
  42. power 实时功率
  43. 故障状态 faultState
  44. 运行状态 runState
  45. name 名称
  46. -->
  47. </view>
  48. </template>
  49. <!-- -->
  50. <script>
  51. import request from '@/utils/request';
  52. import { onLoad,onHide,onShow,onUnload } from '@dcloudio/uni-app';
  53. export default {
  54. data() {
  55. return {
  56. baseInfo:"",
  57. interval:""
  58. }
  59. },
  60. onLoad() {
  61. this.getmuitiStationinfo()
  62. },
  63. onHide() {
  64. // 页面隐藏时也可以选择清理定时器
  65. if (this.interval) {
  66. clearInterval(this.interval);
  67. this.interval = null
  68. }
  69. },
  70. onUnload(){
  71. // 页面隐藏时也可以选择清理定时器
  72. if (this.interval) {
  73. clearInterval(this.interval);
  74. this.interval = null
  75. }
  76. },
  77. onShow(){
  78. // 页面再次显示时重新启动定时器
  79. if (!this.interval) {
  80. setIntervalDemo();
  81. }
  82. },
  83. setIntervalDemo() {
  84. this.interval = setInterval(() => {
  85. this.getmuitiStationinfo()
  86. }, 10000)
  87. },
  88. methods: {
  89. // /api/va/superStationsAPP/${wx.getStorageSync('station').id}
  90. async getmuitiStationinfo (){
  91. // www.economicalplus.site
  92. try {
  93. const response = await request({
  94. url: `/connectionapp/selectems`,
  95. method: 'POST',
  96. header: {
  97. 'Content-Type': 'application/x-www-form-urlencoded'
  98. }
  99. });
  100. this.baseInfo = response.data;
  101. } catch (error) {
  102. console.error('登录失败:', error);
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style scoped>
  109. #app{
  110. width: 100%;
  111. height: 100%;
  112. }
  113. uni-page{
  114. width: 100%;
  115. height: 100%;
  116. }
  117. uni-page-wrapper{
  118. width: 100%;
  119. height: 100%;
  120. }
  121. uni-page-body{
  122. width: 100%;
  123. height: 100%;
  124. }
  125. .container {
  126. height: 100%;
  127. background: linear-gradient(to bottom, #007545 -40%, #f0f5f5 40%, #f0f5f5 100%);
  128. box-sizing: border-box;
  129. display: flex;
  130. flex-direction: column;
  131. }
  132. /* pages/station/index.wxss */
  133. .custom-tabs{
  134. width: 100%;
  135. height: 100vh;
  136. padding: 0rpx 20rpx 20rpx 20rpx;
  137. overflow: auto;
  138. box-sizing: border-box;
  139. }
  140. .custom_box{
  141. width:100%;
  142. padding: 1rpx 20rpx 20rpx 20rpx;
  143. border-radius: 20rpx;
  144. background-color: #ffffff;
  145. box-sizing: border-box;
  146. /* overflow: auto; */
  147. }
  148. .custom_title{
  149. width: 100%;
  150. display: flex;
  151. justify-content: space-between;
  152. padding: 20rpx 0rpx;
  153. border-bottom:1rpx solid #E1E0F4;
  154. box-sizing: border-box;
  155. }
  156. .custom_title_gl{
  157. font-size: 26rpx;
  158. color: #222222;
  159. }
  160. .custom_div{
  161. width: 100%;
  162. display: flex;
  163. justify-content: space-between;
  164. margin-top: 20rpx;
  165. }
  166. .custom_div1{
  167. font-size: 26rpx;
  168. color: #222222;
  169. }
  170. .battery{
  171. font-size: 24rpx;
  172. color: #222222;
  173. }
  174. .batteryccc{
  175. font-size: 26rpx;
  176. color: #999999;
  177. }
  178. .tag_type1 {
  179. font-size: 28rpx;
  180. color: #F0A26C;
  181. font-weight: 500;
  182. }
  183. .tag_type2 {
  184. font-size: 28rpx;
  185. color: #15DB9B;
  186. font-weight: 500;
  187. }
  188. .tag_type3 {
  189. font-size: 28rpx;
  190. color: #b0c4de;
  191. font-weight: 500;
  192. /* 蓝 */
  193. }
  194. .tag_type2red {
  195. font-size: 28rpx;
  196. color: red;
  197. font-weight: 500;
  198. /* 蓝 */
  199. }
  200. .custom_box{
  201. margin-top: 20rpx;
  202. }
  203. .tag_typetext{
  204. width: 100%;
  205. display: flex;
  206. font-size: 26rpx;
  207. justify-content: center;
  208. color: #b0c4de;
  209. margin-top: 20rpx;
  210. }
  211. </style>