humiture.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <!-- 温湿度 -->
  3. <view>
  4. <u-navbar title="温湿度记录" autoBack placeholder></u-navbar>
  5. <view v-if="humitureList.length > 0">
  6. <view class="card_particulars" v-for="(item,index) in humitureList" :key="index">
  7. <view class="card_describe">
  8. <view class="describe_title">{{item.title}}</view>
  9. <view class="describe_time">{{item.startTime}}</view>
  10. <view class="describe_time">{{item.endTime}}</view>
  11. </view>
  12. <view class="humiture_details" @click="foldingPanel(item)">
  13. <view class="title_details">温湿度</view>
  14. <view style="display: flex;">
  15. <view class="title_blue title_details">查看详情</view>
  16. <u-icon :class="item.collapseil ? '' : 'overturn'" name="arrow-down"></u-icon>
  17. </view>
  18. </view>
  19. <view v-show="item.collapseil">
  20. <x-humiture ref="humiture" :taskId="item.id" :waybillNo="orderList.waybillNo"
  21. :current="item.presentNum" :probeList="item.deviceSensorList"></x-humiture>
  22. </view>
  23. </view>
  24. </view>
  25. <view style="margin-top: 30%;" v-else>
  26. <u-empty mode="data" text="当前没有温湿度记录"></u-empty>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. orderList: {},
  35. humitureList: [],
  36. userType: '',
  37. myChart: null,
  38. chartData: {},
  39. chartData1: {},
  40. }
  41. },
  42. mounted() {
  43. var userInfo = this.$cache.getCache('userInfo')
  44. this.userType = userInfo.userType
  45. var orderList = this.$cache.getCache('orderDetails')
  46. this.orderList = orderList
  47. this.getList()
  48. },
  49. methods: {
  50. getList() {
  51. this.$api.get('/api/waybill-task', {
  52. waybillNo: this.orderList.waybillNo,
  53. }).then(res => {
  54. if (res.code == 200) {
  55. this.humitureList = res.data.list
  56. this.humitureList.forEach((item, index) => {
  57. item.title = ''
  58. item.collapseil = true
  59. if (item.coolerBox.id) {
  60. item.title = item.coolerBox.name
  61. }
  62. if (item.deviceSensorList) {
  63. this.$nextTick(() => {
  64. this.$refs.humiture[index].getlist(item.deviceSensorList[0]
  65. .T_id)
  66. })
  67. }
  68. })
  69. }
  70. })
  71. },
  72. // 折叠面板
  73. foldingPanel(value) {
  74. this.humitureList.forEach((item, index) => {
  75. if (item.id == value.id) {
  76. if (item.collapseil) {
  77. item.collapseil = false
  78. } else {
  79. if (item.deviceSensorList) {
  80. this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
  81. }
  82. item.collapseil = true
  83. }
  84. }
  85. })
  86. this.$forceUpdate()
  87. },
  88. open(e) {
  89. // console.log('open', e)
  90. },
  91. close(e) {
  92. // console.log('close', e)
  93. },
  94. change(e) {
  95. if (e[0].status == 'open') {
  96. this.humitureList.forEach((item, index) => {
  97. this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
  98. })
  99. }
  100. },
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. .card_particulars {
  106. display: flex;
  107. flex-direction: column;
  108. padding-top: 20rpx;
  109. margin: 30rpx 20rpx 20rpx 20rpx;
  110. border-radius: 20rpx;
  111. background-color: #fff;
  112. }
  113. .card_describe {
  114. padding-left: 20rpx;
  115. padding-bottom: 20rpx;
  116. border-bottom: 1rpx solid #EBEEF5;
  117. }
  118. .describe_title {
  119. font-size: 30rpx;
  120. font-weight: 600;
  121. }
  122. .describe_time {
  123. font-size: 28rpx;
  124. }
  125. .humiture_details {
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. padding: 20rpx;
  130. }
  131. .title_blue {
  132. color: #2979ff;
  133. margin-right: 10rpx;
  134. }
  135. .title_details {
  136. font-size: 28rpx;
  137. }
  138. ::v-deep .u-collapse-item__content__text {
  139. padding: 0rpx 0rpx 30rpx 0rpx;
  140. }
  141. ::v-deep .u-line {
  142. display: none;
  143. }
  144. .card_qiucharts {
  145. display: flex;
  146. align-items: center;
  147. flex-direction: column;
  148. }
  149. .card_echart {
  150. width: 80%;
  151. height: 500rpx;
  152. }
  153. .card_echart {
  154. width: 80%;
  155. height: 500rpx;
  156. }
  157. .overturn {
  158. transform: rotate(180deg);
  159. }
  160. </style>