machineInfo.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view>
  3. <view style="padding:0 30rpx;" class="ddflex">
  4. <view class="cell-item" v-for="item,index in groupList">
  5. <view class="cell-item-num">{{item.doorId?item.doorId:0}}</view>
  6. <block v-if="item.boxEnable==0">
  7. <view :style="(item.boxStatus==5||item.boxStatus==6)?'margin-top: 30rpx;':'margin-top: 70rpx;'"></view>
  8. <view class="error-sta" v-if="item.boxStatus==5">
  9. 异常
  10. </view>
  11. <view class="error-sta" v-else-if="item.boxStatus==6">
  12. 电池通讯故障
  13. </view>
  14. <view class="error-sta">
  15. 禁用
  16. </view>
  17. </block>
  18. <block v-else>
  19. <view class="error-sta" v-if="item.boxStatus==5" style="margin-top: 70rpx;">
  20. 异常
  21. </view>
  22. <view class="error-sta" v-else-if="item.boxStatus==6" style="margin-top: 70rpx;">
  23. 电池通讯故障
  24. </view>
  25. <block v-else>
  26. <view class="ddflex" v-if="item.boxStatus!=0&&item.batteryId">
  27. <view style="margin-right: 13rpx;">
  28. <cell :soc="item.soc"></cell>
  29. </view>
  30. <view class="cell-item-info fflex">
  31. <view class="cell-item-info-item ddflex">
  32. <view>型号</view>
  33. <view>{{item.model}}</view>
  34. </view>
  35. <view class="cell-item-info-item ddflex">
  36. <view>电量</view>
  37. <view>{{item.soc}}%</view>
  38. </view>
  39. <view class="cell-item-info-item ddflex">
  40. <view>电压</view>
  41. <view>{{item.batVol}}V</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view v-else class="kongcang">
  46. 空仓
  47. </view>
  48. </block>
  49. </block>
  50. <view class="cell-item-option" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage?id='+item.doorId+'&devId='+id)">仓位管理</view>
  51. </view>
  52. </view>
  53. <view style="height: 165rpx;" class="savepadding"></view>
  54. <view class="bottom-btns savepadding">
  55. <view class="ddflex" style="margin: 30rpx;justify-content: space-between;">
  56. <view class="btn1" @click="jumpUrl('/warning/machineAlarm/machineAlarm?id='+id)">故障告警</view>
  57. <view class="btn1" @click="jumpUrl('/machineAndCell/machineDetail/machineDetail?id='+id)">柜体信息</view>
  58. <view class="btn2" @click="getDataList()">刷新</view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. const app = getApp();
  65. const req = require("../../utils/request.js");
  66. import cell from "../../components/cell/index";
  67. export default {
  68. components: {
  69. cell
  70. },
  71. props: {},
  72. data() {
  73. return {
  74. id:null,
  75. groupList: [],
  76. page: 1,
  77. limit: 10,
  78. searchValue:'',
  79. isQuerying:false,//正在查询数据
  80. }
  81. },
  82. onLoad(options) {
  83. this.id = options.id
  84. this.getDataList()
  85. },
  86. onShow() {
  87. },
  88. onReachBottom() {
  89. this.getDataList(true)
  90. },
  91. methods: {
  92. jumpUrl(url) {
  93. if (req.isLogins(true)) {
  94. uni.navigateTo({
  95. url: url
  96. })
  97. }
  98. },
  99. getDataList(isPage) {
  100. if(this.isQuerying) return
  101. else this.isQuerying = true
  102. if (!isPage) {
  103. this.page = 1
  104. uni.showLoading({
  105. title:'加载中'
  106. })
  107. }
  108. let queryParams = {
  109. page: this.page,
  110. limit: this.limit,
  111. }
  112. queryParams.devId = this.id
  113. req.getRequest(
  114. '/admin/v2/door/page',
  115. queryParams,
  116. data => {
  117. if (data != null && data.list.length > 0) {
  118. if (!isPage) {
  119. this.groupList = data.list
  120. } else {
  121. this.groupList = this.groupList.concat(data.list)
  122. }
  123. this.page++
  124. } else {
  125. if (!isPage)
  126. this.groupList = data.list
  127. else {}
  128. }
  129. uni.hideLoading()
  130. this.isQuerying = false
  131. }
  132. )
  133. },
  134. },
  135. mounted() {
  136. },
  137. onPageScroll: function(e) {
  138. }
  139. }
  140. </script>
  141. <style>
  142. @import "./machineInfo.css";
  143. </style>