gasreport.vue 5.2 KB

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