<template>
	<div class="home-container layout-padding">
		<div style="overflow: hidden auto">
			<el-row :gutter="10">
				<el-col class="mb10">
					<home-date />
				</el-col>
				<el-col :xs="24" :sm="24" :md="24" :lg="17" :xl="17">
					<TodoCenter v-if="userInfos.isCenter" />
					<TodoDepartment v-else />
				</el-col>
				<el-col :xs="24" :sm="24" :md="24" :lg="7" :xl="7">
					<!-- 常用入口 -->
					<entrance />
					<!-- 通知公告 -->
					<notice />
				</el-col>
			</el-row>
		</div>
	</div>
</template>

<script lang="ts" setup name="home">
import { defineAsyncComponent } from 'vue';
import { useUserInfo } from '@/stores/userInfo';
import { storeToRefs } from 'pinia';
// 引入组件
const Entrance = defineAsyncComponent(() => import('@/views/home/components/Entrance.vue'));
const TodoCenter = defineAsyncComponent(() => import('@/views/home/components/Todo-center.vue'));
const TodoDepartment = defineAsyncComponent(() => import('@/views/home/components/Todo-department.vue'));
const Notice = defineAsyncComponent(() => import('@/views/home/components/Notice.vue'));
const HomeDate = defineAsyncComponent(() => import('@/views/home/components/Home-date.vue'));

const stores = useUserInfo(); // 用户信息
const { userInfos } = storeToRefs(stores); // 用户信息
</script>
