gasTask.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="gas-task">
  3. <u-collapse>
  4. <u-collapse-item title="一次巡检点巡检路线">
  5. <u-icon name="map" size="16" slot="icon"></u-icon>
  6. <u-cell icon="pushpin" v-for="(item, index) in firstAddressList" :key="item" :title="item"
  7. :border="false"></u-cell>
  8. </u-collapse-item>
  9. <u-collapse-item title="一次巡检情况统计">
  10. <u-icon name="minus-circle" size="16" slot="icon"></u-icon>
  11. <u-cell icon="map" v-for="(ite, ind) in firstTj" :key="ind" :title="ite.address" :border="false">
  12. <text slot="value" class="u-slot-value">
  13. <text :class="ite.isFinish ? 'comlete-xj' : 'complete-xj-n'">{{ ite.isFinish ? '已巡检' : '未巡检'
  14. }}</text>
  15. </text>
  16. </u-cell>
  17. </u-collapse-item>
  18. <u-collapse-item title="两次巡检点巡检路线">
  19. <u-icon name="map" size="16" slot="icon"></u-icon>
  20. <u-cell icon="pushpin" v-for="(item, index) in secondAddressList" :key="item" :title="item"
  21. :border="false"></u-cell>
  22. </u-collapse-item>
  23. <u-collapse-item title="两次巡检情况统计">
  24. <u-icon name="minus-circle" size="16" slot="icon"></u-icon>
  25. <u-cell icon="map" v-for="(ite, ind) in secondTj" :key="ind" :title="ite.address" :border="false">
  26. <view slot="value" class="u-slot-value">
  27. <view class="xj-second-tj">
  28. <text class="task-text">第一次</text>
  29. <text :class="ite.isFinish1 ? 'complete-xj-s' : 'complete-xj-s-n'">{{ ite.isFinish1 ? '已巡检' :
  30. '未巡检' }}</text>
  31. </view>
  32. <view class="xj-second-tj">{{ ite.time1 || '' }}</view>
  33. <view class="xj-second-tj">
  34. <text class="task-text">第二次</text>
  35. <text :class="ite.isFinish2 ? 'complete-xj-s' : 'complete-xj-s-n'">{{ ite.isFinish2 ? '已巡检'
  36. : '未巡检' }}</text>
  37. </view>
  38. <view class="xj-second-tj">{{ ite.time2 || '' }}</view>
  39. </view>
  40. </u-cell>
  41. </u-collapse-item>
  42. </u-collapse>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'gasTask',
  48. props: {
  49. firstAddress: {
  50. type: String,
  51. default: ''
  52. },
  53. secondAddress: {
  54. type: String,
  55. default: '',
  56. },
  57. firstTj: {
  58. type: Array,
  59. default: () => {
  60. return []
  61. }
  62. },
  63. secondTj: {
  64. type: Array,
  65. default: () => {
  66. return []
  67. }
  68. }
  69. },
  70. data() {
  71. return {
  72. firstAddressList: [],
  73. secondAddressList: []
  74. }
  75. },
  76. computed: {},
  77. watch: {
  78. firstAddress: {
  79. handler(newF, oldF) {
  80. if (newF) {
  81. this.firstAddressList = newF.split(',')
  82. }
  83. },
  84. immediate: true
  85. },
  86. secondAddress: {
  87. handler(newF, oldF) {
  88. if (newF) {
  89. this.secondAddressList = newF.split(',')
  90. }
  91. },
  92. immediate: true
  93. }
  94. },
  95. mounted() { },
  96. methods: {},
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .gas-task {
  101. position: relative;
  102. width: 100%;
  103. height: 100%;
  104. padding: 10px;
  105. box-sizing: border-box;
  106. background-color: #FFF;
  107. .task-text {
  108. font-size: 12px;
  109. margin: 0px 10px;
  110. }
  111. .comlete-xj {
  112. color: rgb(59, 221, 10);
  113. font-size: 12px;
  114. }
  115. .complete-xj-n {
  116. color: rgb(241, 22, 6);
  117. font-size: 12px;
  118. }
  119. .xj-second-tj {
  120. margin-bottom: 3px;
  121. font-size: 12px;
  122. }
  123. .complete-xj-s {
  124. color: rgb(59, 221, 10);
  125. font-size: 12px;
  126. margin: 0px 10px;
  127. }
  128. .complete-xj-s-n {
  129. color: rgb(241, 22, 6);
  130. font-size: 12px;
  131. margin: 0px 10px;
  132. }
  133. }
  134. ::v-deep .u-collapse-item__content__text {
  135. padding: 0px 15px !important;
  136. }
  137. ::v-deep .u-collapse-item__content {
  138. overflow-y: auto !important;
  139. }
  140. ::v-deep .u-cell__title-text {
  141. font-size: 14px;
  142. }
  143. </style>