<template>
    <WeekReport :account-list="accountList" :prj-list="prjList"/>
</template>
<script lang="ts" setup>
import WeekReport from '@/pages/project/components/detail/week-report/report-layout.vue'
import { getStaffList } from '@/api/biz/staff';
import { getProjectList } from '@/api/project-center/info';

const prjList = ref<{ id: string, name: string }[]>([])
const accountList = ref<{ id: string, name: string }[]>([])
// 获取主责人账号信息
const getAccounts = async () => {
    const { list } = await getStaffList({ page_no: 1, page_size: 9999 })
    accountList.value = list
}

// 获取项目列表
const getProjects = async () => {
    try {
        const { list } = await getProjectList({ page_no: 1, page_size: 9999 })
        prjList.value = list
    } catch (e) {
        console.error(e)
    }
}

onMounted(async () => {
    getAccounts()
    getProjects()
})
</script>