vehInfo.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <u-popup :show="isShow" @close="close" :closeOnClickOverlay="false" :overlay="false" :closeable="false" :round="10">
  3. <view class="container">
  4. <view class="info">
  5. <view class="info-head">
  6. <view>
  7. {{renderItem(workTrackInfo,'planName','--')}}
  8. </view>
  9. <view>
  10. {{renderItem(workTrackInfo,'classTime','--')}}
  11. </view>
  12. </view>
  13. <view class="info-body">
  14. <view class="item">
  15. <view class="label">当前状态:</view>
  16. <view class="value"
  17. :class="{
  18. 'orange': workTrackInfo.workStatus == '1',
  19. 'red': workTrackInfo.workStatus == '0',
  20. 'green': workTrackInfo.workStatus == '2',
  21. }"
  22. >{{workStatusObj[renderItem(workTrackInfo,'workStatus','')]}}</view>
  23. </view>
  24. <view class="item">
  25. <view class="label">完成率:</view>
  26. <view class="value green">{{renderItem(trackInfo,'percentage','--')}}%</view>
  27. </view>
  28. <view class="item">
  29. <view class="label">最近报警:</view>
  30. <view class="value red">{{renderItem(newAlarm,'alarmName','--')}}</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </u-popup>
  36. </template>
  37. <script>
  38. import {isArray,clone,isObject,isEmpty } from 'lodash'
  39. import {getImages} from '@/plugins/images'
  40. import {copyProps,clearProps} from '@/utils/gdtq.js'
  41. export default {
  42. props: {
  43. trackInfo: {
  44. type: Object,
  45. default: () => {
  46. return {}
  47. }
  48. },
  49. workTrackInfo: {
  50. type: Object,
  51. default: () => {
  52. return {}
  53. }
  54. },
  55. },
  56. computed: {
  57. newAlarm() {
  58. let list = []
  59. if(!this.isNull(this.renderItem(this.workTrackInfo,'alarmList',''))) {
  60. list = this.workTrackInfo.alarmList
  61. }
  62. if(isEmpty(list)) {
  63. return ''
  64. } else {
  65. let len = list.length
  66. return list[len-1]
  67. }
  68. }
  69. },
  70. data() {
  71. return {
  72. isShow: true,
  73. workStatusObj: {
  74. 0: '未开始',
  75. 1: '执行中',
  76. 2: '已结束',
  77. 3: '已失效',
  78. }
  79. }
  80. },
  81. mounted() {
  82. },
  83. methods: {
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .orange {
  89. color: #FF8000 !important;
  90. }
  91. .red {
  92. color: #EB4141 !important;
  93. }
  94. .green {
  95. color: #68D100 !important;
  96. }
  97. .container {
  98. // background: #fff;
  99. // padding: 52rpx 48rpx;
  100. font-size: 28rpx;
  101. // min-height: 360rpx;
  102. .info {
  103. border-radius: 20rpx;
  104. background: #fff;
  105. // padding: 0 44rpx;
  106. &-head{
  107. margin: 32rpx 48rpx;
  108. // display: flex;
  109. view:nth-child(1) {
  110. font-family: PingFangSC, PingFang SC;
  111. font-weight: 600;
  112. font-size: 32rpx;
  113. color: #333333;
  114. text-align: left;
  115. font-style: normal;
  116. padding: 0 ;
  117. width: auto;
  118. }
  119. view {
  120. font-family: PingFangSC, PingFang SC;
  121. font-weight: 400;
  122. font-size: 28rpx;
  123. color: #666666;
  124. line-height: 40rpx;
  125. text-align: left;
  126. font-style: normal;
  127. margin-top: 12rpx;
  128. }
  129. }
  130. &-body {
  131. overflow: hidden;
  132. background: #F6FAFF;
  133. border-radius: 10rpx;
  134. margin: 0rpx 24rpx 24rpx 24rpx;
  135. .item {
  136. margin: 20rpx 32rpx;
  137. display: flex;
  138. font-family: PingFangSC, PingFang SC;
  139. font-weight: 400;
  140. font-size: 28rpx;
  141. color: #333333;
  142. .label {
  143. color: #333333;
  144. }
  145. .value {
  146. color: #333333;
  147. flex: 1;
  148. text-align: right;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. </style>