taskBoardAddress.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 }}</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. mounted() {
  54. this.taskDetailsLists()
  55. },
  56. methods: {
  57. //点击返回上一级
  58. handlerToggle(){
  59. this.$emit('getBackBoard')
  60. },
  61. getBoradAddress(item) {
  62. let that = this
  63. if (item.checkState == '0') {
  64. that.isShow = false
  65. that.Ids = item.id
  66. that.checkNum = item.checkNum
  67. that.classType = item.classType_dictText
  68. that.checkState=item.checkState
  69. that.isSensor = item.isSensor
  70. that.deviceID = item.deviceId
  71. that.deviceName = item.deviceName
  72. that.toComponent = 'gasImgIdentify'
  73. } else {
  74. that.isShow = false
  75. that.checkState=item.checkState
  76. that.checkNum = item.checkNum
  77. that.deviceID = item.deviceId
  78. that.classType = item.classType_dictText
  79. that.toComponent = 'gasImgIdentify'
  80. }
  81. },
  82. getBackAddress() {
  83. this.isShow = true
  84. this.toComponent = ''
  85. this.taskDetailsLists()
  86. },
  87. taskDetailsLists() {
  88. let that = this
  89. new Promise((resolve, reject) => {
  90. api
  91. .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId })
  92. .then((response) => {
  93. if (response.data.code == 200) {
  94. console.log(response, '地点列表---')
  95. that.indexList = response.data.result.records || []
  96. } else {
  97. reject(response);
  98. }
  99. })
  100. .catch((error) => {
  101. console.log("catch===>response", response);
  102. reject(error);
  103. });
  104. });
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="scss" scoped>
  110. .taskBoardAddress {
  111. position: relative;
  112. width: 100%;
  113. height: 100%;
  114. background-color: #fff;
  115. }
  116. ::v-deep .u-slot-title {
  117. display: flex;
  118. }
  119. </style>