taskBoardAddress.vue 4.3 KB

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