topScrollBar.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div class="top-scroll-bar">
  3. <div class="column-row-title">
  4. <span class="title-text"><img src="@/assets/images/title-icon.png" alt=""/>最近巡检</span>
  5. <span class="t-span">
  6. <span class="t-time">{{ result.time }}</span> |
  7. <span class="text-a" @click="nowCheck(false)">查看详情 </span></span>
  8. <span class="right-btn" @click="nowCheck(true)">立即巡检</span>
  9. </div>
  10. <div class="column-content scroll-text">
  11. 巡检结果:本次自动巡检共{{result.model}}个模块,共发现{{result.problem}}问题
  12. </div>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import {hlCheck} from "@/api/index/hl"
  17. import {onMounted, ref} from "vue";
  18. import {useRouter} from "vue-router"
  19. const router = useRouter()
  20. const nowCheck = (query) => {
  21. if(query){
  22. router.push({path: '/hl/check',query:{check:'true'}})
  23. }else{
  24. router.push({path: '/hl/check'})
  25. }
  26. }
  27. const result = ref({})
  28. onMounted(async () => {
  29. const res = await hlCheck()
  30. result.value = res.data
  31. })
  32. </script>