gasreport.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="gas-report" name="gasreport">
  3. <u-navbar :title="gasTitle" :safeAreaInsetTop="true" leftIcon="list" @leftClick="handlerToggle"> </u-navbar>
  4. <view class="gas-content">
  5. <component :is="loadComponent" :firstAddress="firstAddress" :secondAddress="secondAddress"
  6. :firstTj="firstTj" :secondTj="secondTj"></component>
  7. </view>
  8. <!-- 导航弹出层 -->
  9. <view class="popup-modal">
  10. <popupModal :showModel="showModel" @handlerClick="handlerClick"></popupModal>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import api from "@/api/api";
  16. import popupModal from './components/popupModal.vue'
  17. import gasFill from './components/gasFill.vue'
  18. import gasTask from './components/gasTask.vue'
  19. import gasRecordCard from './components/gasRecordCard.vue'
  20. import gasImgIdentify from './components/gasImgIdentify.vue'
  21. export default {
  22. name: 'gasreport',
  23. components: {
  24. popupModal,
  25. gasFill,
  26. gasTask,
  27. gasRecordCard,
  28. gasImgIdentify
  29. },
  30. data() {
  31. return {
  32. gasTitle: '',//标题
  33. showModel: false,//是否打开弹出层
  34. // loadComponent: 'gasFill',//默认加载组件
  35. loadComponent: 'gasImgIdentify',//默认加载组件
  36. taskTj: {},
  37. firstAddress: '',//一次线路
  38. secondAddress: '',//二次线路
  39. firstTj: [],//一次统计
  40. secondTj: [],//二次统计
  41. };
  42. },
  43. computed: {
  44. },
  45. mounted() {
  46. this.queryNowGasInfoByUser()
  47. },
  48. methods: {
  49. //切换导航
  50. handlerToggle() {
  51. this.showModel = !this.showModel
  52. },
  53. //导航栏点击
  54. handlerClick(data) {
  55. let that = this
  56. switch (data) {
  57. case '瓦斯巡检记录卡管理':
  58. that.loadComponent = 'gasRecordCard'
  59. that.gasTitle = '瓦斯巡检记录卡管理'
  60. that.showModel = false
  61. break;
  62. case '图片识别':
  63. that.loadComponent = 'gasImgIdentify'
  64. that.gasTitle = '图片识别'
  65. that.showModel = false
  66. break;
  67. case '早班':
  68. that.loadComponent = 'gasTask'
  69. that.gasTitle = '早班巡检任务'
  70. that.firstAddress = that.taskTj.addressEarly1
  71. that.secondAddress = that.taskTj.addressEarly2
  72. that.firstTj = that.taskTj.arrayEarly1
  73. that.secondTj = that.taskTj.arrayEarly2
  74. that.showModel = false
  75. break;
  76. case '中班':
  77. that.loadComponent = 'gasTask'
  78. that.gasTitle = '中班巡检任务'
  79. that.firstAddress = that.taskTj.addressNoon1
  80. that.secondAddress = that.taskTj.addressNoon2
  81. that.firstTj = that.taskTj.arrayNoon1
  82. that.secondTj = that.taskTj.arrayNoon2
  83. that.showModel = false
  84. break;
  85. case '夜班':
  86. that.loadComponent = 'gasTask'
  87. that.gasTitle = '夜班巡检任务'
  88. that.firstAddress = that.taskTj.addressNight1
  89. that.secondAddress = that.taskTj.addressNight2
  90. that.firstTj = that.taskTj.arrayNight1
  91. that.secondTj = that.taskTj.arrayNight2
  92. that.showModel = false
  93. break;
  94. case '瓦斯巡检填报':
  95. that.loadComponent = 'gasFill'
  96. that.gasTitle = '瓦斯巡检填报'
  97. that.showModel = false
  98. break;
  99. }
  100. },
  101. //获取card列表
  102. queryNowGasInfoByUser() {
  103. let that = this
  104. new Promise((resolve, reject) => {
  105. api
  106. .queryNowGasInfoByUser({})
  107. .then((response) => {
  108. if (response.data.code == 200) {
  109. that.taskTj=response.data.result
  110. } else {
  111. reject(response);
  112. }
  113. })
  114. .catch((error) => {
  115. console.log("catch===>response", response);
  116. reject(error);
  117. });
  118. });
  119. },
  120. },
  121. };
  122. </script>
  123. <style lang="scss" scoped>
  124. .gas-report {
  125. position: relative;
  126. box-sizing: border-box;
  127. .gas-content {
  128. height: 708px;
  129. margin-top: 85px;
  130. overflow-y: auto;
  131. .popup-modal {
  132. position: absolute;
  133. top: 45px;
  134. left: 0;
  135. height: 748px;
  136. width: 240px;
  137. }
  138. }
  139. }
  140. </style>