machineInfo.vue 3.5 KB

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