index.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div style="height: 100%;">
  3. <van-pull-refresh class="inspect-object-question-wrapper" v-model="loading" @refresh="getData()">
  4. <card01 v-for="item in list" :key="item" :title="item.ojbNm + ''" icon="notes"
  5. :description="renderData(item, objectConfig.description)"
  6. @click="jumpPage(`/inspect/${item.plnaId}/object/${item.id}/question/`)" />
  7. </van-pull-refresh>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { onMounted, ref } from "vue";
  12. import { useRoute } from "vue-router";
  13. import card01 from '@/components/card01.vue';
  14. import { getTacQuestionList } from "@/api/inspect";
  15. import { getBaseByInspectType } from "@/assets/js/base";
  16. import { renderData } from "@/utils/template";
  17. import { jumpPage } from "@/utils/page";
  18. const route = useRoute();
  19. const list = ref([]);
  20. const loading = ref(false);
  21. const inspectType = route.query.inspectType;
  22. const objectConfig = ref(getBaseByInspectType(inspectType));
  23. function getData() {
  24. getTacQuestionList(route.params.objId).then(res => {
  25. list.value = res.data;
  26. loading.value = false;
  27. })
  28. }
  29. onMounted(() => {
  30. getData();
  31. })
  32. </script>
  33. <style lang="scss" scoped>
  34. .inspect-object-wrapper {
  35. width: 100%;
  36. height: 100%;
  37. overflow: auto;
  38. }
  39. </style>