diff --git a/front/src/views/home/details.vue b/front/src/views/home/details.vue index 06423409..d07ddcfb 100644 --- a/front/src/views/home/details.vue +++ b/front/src/views/home/details.vue @@ -28,7 +28,8 @@ import AbilityToRecommendBottom from '@/views/home/components/AbilityToRecommendBottom' import AlgorithmDetails from '@/views/detailsAll/AlgorithmDetails' import ApplicationDetails from '@/views/detailsAll/ApplicationDetails' - + import { selectOne } from '@/api/home' + import { useRouter } from 'vue-router' export default defineComponent({ name: '', props: {}, @@ -74,11 +75,26 @@ label: '交通运输局', }, ]) - const showView = ref('application-details') + const router = useRouter() + const id = router.currentRoute.value.query.id + let showView = ref('algorithm-details') + const init = () => { + selectOne(id).then((res) => { + if (res.data.data.type == '组件服务') { + showView.value = 'algorithm-details' + } else { + showView.value = 'application-details' + } + }) + } + init() return { formState, options, showView, + init, + router, + id, } }, })