irrigatedArea.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="irrigated-area">
  3. <view class="irrigated-area-list">
  4. <view
  5. class="irrigated-area-item"
  6. v-for="(item, index) in irrigatedAreaList"
  7. :key="index"
  8. >
  9. <view class="irrigated-area-item-title">
  10. <view class="irrigated-area-item-title-text">{{
  11. item.sfDisplayname || item.sfName
  12. }}</view>
  13. <view class="irrigated-area-item-title-time"></view>
  14. </view>
  15. <view class="irrigated-area-item-content">
  16. <view
  17. class="irrigated-area-item-content-item"
  18. v-for="(i, n) in item.childrenList"
  19. :key="n"
  20. >
  21. <view class="irrigated-area-item-content-item-title">{{
  22. i.sfDisplayname || i.sfName || '暂无数据'
  23. }}</view>
  24. <view class="irrigated-area-item-content-item-icon" v-if="i.sfType != '10'">
  25. <image
  26. :src="i.value != '0' ? bucketOpen1 : bucketClose1"
  27. class="bucket-icon"
  28. />
  29. </view>
  30. <view class="irrigated-area-item-content-item-icon" v-else>
  31. <image
  32. :src="i.value == '0' ? bucketStop1 : i.value == '1'? bucketOpen1 : bucketClose1"
  33. class="bucket-icon"
  34. />
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import bucketOpen1 from '../assets/bucketOpen1.png';
  44. import bucketClose1 from '../assets/bucketClose1.png';
  45. import bucketStop1 from '../assets/bucketStop1.png';
  46. export default {
  47. props: {
  48. irrigatedAreaList: {
  49. type: Array,
  50. default: () => [],
  51. },
  52. },
  53. data() {
  54. return {
  55. bucketOpen1,
  56. bucketClose1,
  57. bucketStop1
  58. };
  59. },
  60. methods: {
  61. formartDate(date) {
  62. return date.slice(0, 10);
  63. },
  64. },
  65. components: {},
  66. mounted() {},
  67. };
  68. </script>
  69. <style scoped lang="scss">
  70. .irrigated-area {
  71. .irrigated-area-list {
  72. .irrigated-area-item {
  73. display: flex;
  74. justify-content: space-between;
  75. align-items: center;
  76. padding: 10px;
  77. background: #F5F6FA;
  78. margin-bottom: 8rpx;
  79. .irrigated-area-item-title {
  80. width: 120rpx;
  81. .irrigated-area-item-title-text {
  82. color: #042118;
  83. text-align: left;
  84. font-family: 'Source Han Sans CN VF';
  85. font-size: 24rpx;
  86. font-weight: 500;
  87. // 超出隐藏
  88. overflow: hidden;
  89. text-overflow: ellipsis;
  90. white-space: nowrap;
  91. }
  92. .irrigated-area-item-title-time {
  93. color: #14a478;
  94. font-family: 'Source Han Sans CN VF';
  95. font-size: 24rpx;
  96. font-weight: 500;
  97. text-align: left;
  98. margin-top: 8rpx;
  99. height: 30rpx;
  100. }
  101. }
  102. .irrigated-area-item-content {
  103. display: flex;
  104. width: calc(100% - 120rpx);
  105. justify-content: flex-start;
  106. flex-wrap:wrap;
  107. gap:10rpx;
  108. .irrigated-area-item-content-item {
  109. width: 20%;
  110. .irrigated-area-item-content-item-title {
  111. width: 100%;
  112. color: #333333;
  113. font-family: 'Source Han Sans CN VF';
  114. font-size: 24rpx;
  115. font-weight: 400;
  116. margin-bottom: 20rpx;
  117. // 超出隐藏
  118. overflow: hidden;
  119. text-overflow: ellipsis;
  120. white-space: nowrap;
  121. text-align: center;
  122. }
  123. .irrigated-area-item-content-item-icon {
  124. display: flex;
  125. justify-content: center;
  126. .bucket-icon {
  127. width: 24rpx;
  128. height: 24rpx;
  129. margin-right: 10rpx;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. }
  136. }
  137. </style>