taskBoardAddress.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="taskBoardAddress">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
  4. leftIcon="arrow-left" @leftClick="handlerToggle"> </u-navbar>
  5. <u-list :height="666" :scrollTop="topH"
  6. v-if="isShow">
  7. <u-list-item v-for="(item, index) in indexList" :key="index">
  8. <u-cell icon="share" @click="getBoradAddress(item, index)">
  9. <view slot="title" class="u-slot-title">
  10. <text class="u-cell-text">{{ `${item.deviceName} (${item.checkNum == '1' ? '第一次' :
  11. item.checkNum == '2' ? '第二次' : ''})` }}</text>
  12. <!-- <u-tag text="查看" plain size="mini" type="warning">
  13. </u-tag> -->
  14. </view>
  15. <view slot="value">
  16. <u-icon :name="item.checkState == '0' ? 'plus' : 'checkmark'" size="16"></u-icon>
  17. </view>
  18. </u-cell>
  19. </u-list-item>
  20. </u-list>
  21. <component :is="toComponent" :Ids="Ids" :checkNum="checkNum" :classType="classType" :isSensor="isSensor"
  22. :deviceID="deviceID" :deviceName="deviceName" :checkState="checkState" @getBackAddress="getBackAddress">
  23. </component>
  24. </view>
  25. </template>
  26. <script>
  27. import api from "@/api/api";
  28. import gasImgIdentify from './gasImgIdentify.vue'
  29. export default {
  30. name: 'taskBoardAddress',
  31. components: { gasImgIdentify },
  32. props: {
  33. taskId: {
  34. type: String,
  35. default: ''
  36. },
  37. },
  38. data() {
  39. return {
  40. topH:0,
  41. activeIndex:0,
  42. Ids: '',
  43. checkNum: '',//巡检次数
  44. classType: '',
  45. isSensor: '',
  46. deviceID: '',
  47. deviceName: '',
  48. checkState: '',
  49. isShow: true,
  50. toComponent: '',
  51. indexList: [],
  52. gasTitle: '任务明细',//标题
  53. backPic0: "url(/static/topnavbar0.png)",
  54. backPic: "url(../../static/topnavbar.png)",
  55. }
  56. },
  57. computed: {
  58. searchTime: function () {
  59. return uni.getStorageSync('searchTime')
  60. }
  61. },
  62. mounted() {
  63. this.taskDetailsLists()
  64. },
  65. methods: {
  66. //点击返回上一级
  67. handlerToggle() {
  68. this.$emit('getBackBoard')
  69. },
  70. getBoradAddress(item, index) {
  71. let that = this
  72. that.activeIndex=index
  73. if (item.checkState == '0') {
  74. that.isShow = false
  75. that.Ids = item.id
  76. that.checkNum = item.checkNum
  77. that.classType = item.classType_dictText
  78. that.checkState = item.checkState
  79. that.isSensor = item.isSensor
  80. that.deviceID = item.deviceId
  81. that.deviceName = item.deviceName
  82. that.toComponent = 'gasImgIdentify'
  83. } else {
  84. that.isShow = false
  85. that.checkState = item.checkState
  86. that.checkNum = item.checkNum
  87. that.deviceID = item.deviceId
  88. that.classType = item.classType_dictText
  89. that.toComponent = 'gasImgIdentify'
  90. }
  91. },
  92. getBackAddress() {
  93. this.isShow = true
  94. this.toComponent = ''
  95. this.topH = 39*this.activeIndex
  96. this.taskDetailsLists()
  97. },
  98. taskDetailsLists() {
  99. let that = this
  100. new Promise((resolve, reject) => {
  101. api
  102. .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId, taskTime: that.searchTime })
  103. .then((response) => {
  104. if (response.data.code == 200) {
  105. console.log(response, '地点列表---')
  106. that.indexList = response.data.result.records || []
  107. // that.indexList = [
  108. // { deviceName: '测试地址1' },
  109. // { deviceName: '测试地址2' },
  110. // { deviceName: '测试地址3' },
  111. // { deviceName: '测试地址4' },
  112. // { deviceName: '测试地址5' },
  113. // { deviceName: '测试地址6' },
  114. // { deviceName: '测试地址7' },
  115. // { deviceName: '测试地址8' },
  116. // { deviceName: '测试地址9' },
  117. // { deviceName: '测试地址10' },
  118. // { deviceName: '测试地址11' },
  119. // { deviceName: '测试地址12' },
  120. // { deviceName: '测试地址13' },
  121. // { deviceName: '测试地址14' },
  122. // { deviceName: '测试地址15' },
  123. // { deviceName: '测试地址16' },
  124. // { deviceName: '测试地址17' },
  125. // { deviceName: '测试地址18' },
  126. // { deviceName: '测试地址19' },
  127. // { deviceName: '测试地址20' },
  128. // { deviceName: '测试地址21' },
  129. // { deviceName: '测试地址22' },
  130. // { deviceName: '测试地址23' },
  131. // { deviceName: '测试地址24' },
  132. // { deviceName: '测试地址25' },
  133. // { deviceName: '测试地址26' },
  134. // { deviceName: '测试地址27' },
  135. // { deviceName: '测试地址28' },
  136. // { deviceName: '测试地址29' },
  137. // { deviceName: '测试地址30' },
  138. // ]
  139. } else {
  140. reject(response);
  141. }
  142. })
  143. .catch((error) => {
  144. console.log("catch===>response", response);
  145. reject(error);
  146. });
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss" scoped>
  153. .taskBoardAddress {
  154. position: relative;
  155. width: 100%;
  156. height: 100%;
  157. background-color: #fff;
  158. }
  159. ::v-deep .u-slot-title {
  160. display: flex;
  161. }
  162. </style>