<template>
	<div style="overflow-y: auto">
		<a-layout>
			<Header @onChangeCurrent="onChangeCurrent" />
			<div style="width: 71%; margin-left: 10%">
				<div style="height: 20px"></div>
				<ResourceList />
			</div>
		</a-layout>
		<Footer />
	</div>
</template>

<script setup>
	import Header from '@/views/portal/components/Header.vue'
	import Footer from '@/views/portal/components/Footer.vue'
	import ResourceList from './components/ResourceList.vue'
	import { useRouter, useRoute } from 'vue-router'

	import EventBus from '@/utils/EventBus'

	const router = useRouter()
	const indexType = ref('resourceCenter')
	const onChangeCurrent = (current) => {
		indexType.value = current

		router.push({
			path: '/' + current
		})
	}

	const handlerItemCorrelation = (item) => {
		// emit('handlerItemSidebar', item)
	}
	const handleOpenCourseDetails = (item) => {
		console.log('看看呢', item)
		router.push({
			path: '/portal/courseDetails',
			query: {
				id: item.id
			}
		})
	}
	onMounted(() => {
		// setTimeout(() => {
		// 	images.value = 'http://192.168.1.245:10005/education/2025/7/2/1940361083973906434.jpg'
		// }, 10000)
	})
	EventBus.off('openCourseDetails', handleOpenCourseDetails)
	EventBus.on('openCourseDetails', handleOpenCourseDetails)
</script>

<style scoped>
	.content {
		padding-left: 10%;
		padding-right: 30%;
	}
</style>
