<template>
	<a-modal v-model:visible="show_add" title="新增求职简历" ok-text="提交" cancel-text="取消" 
		@cancel="hideModal"   width="100%" >
		<a-collapse v-model:activeKey="activeKey" accordion>
			<a-collapse-panel key="1" header="基本资料">
				<resume-basic @toNext="toNext" :customer_record="customer_record"></resume-basic>
			</a-collapse-panel>
			<a-collapse-panel key="2" header="联系信息">
				<resume-contact @toNext="toNext" :customer_record="customer_record"></resume-contact>
			</a-collapse-panel>
			<a-collapse-panel key="3" header="个人简介">
				<resume-introduction @toNext="toNext" :customer_record="customer_record"></resume-introduction>
			</a-collapse-panel>
			<a-collapse-panel key="4" header="专业技能掌握程度">
				<resume-skill @toNext="toNext" :customer_record="customer_record"></resume-skill>
			</a-collapse-panel>
			<a-collapse-panel key="5" header="培训经历">
				<resume-train @toNext="toNext" :customer_record="customer_record"></resume-train>
			</a-collapse-panel>
			<a-collapse-panel key="6" header="求职意向">
				<resume-intention @toNext="toNext" :customer_record="customer_record"></resume-intention>
			</a-collapse-panel>
			<a-collapse-panel key="7" header="工作经历">
				<resume-experience @toNext="toNext" :customer_record="customer_record"></resume-experience>
			</a-collapse-panel>
			<a-collapse-panel key="8" header="证书">
				<resume-credential @toNext="toNext" :customer_record="customer_record"></resume-credential>
			</a-collapse-panel>
		</a-collapse>
	</a-modal>
</template>

<script setup lang="ts">
	import ResumeBasic from '@/views/jobSeeker/resume/add/basic/basic.vue';
	import ResumeContact from '@/views/jobSeeker/resume/add/contact/contact.vue';
	import ResumeCredential from '@/views/jobSeeker/resume/add/credential/credential.vue';
	import ResumeExperience from '@/views/jobSeeker/resume/add/experience/experience.vue';
	import ResumeIntention from '@/views/jobSeeker/resume/add/intention/intention.vue';
	import ResumeIntroduction from '@/views/jobSeeker/resume/add/introduction/introduction.vue';
	import ResumeSkill from '@/views/jobSeeker/resume/add/skill/skill.vue';
	import ResumeTrain from '@/views/jobSeeker/resume/add/train/train.vue';
	import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue';
	import { PostRoleAdd, updateRole } from '@/apis/models';
	import { message } from 'ant-design-vue';
	const emit = defineEmits();
	let props = defineProps(['edit_record']);
	let show_add = ref<Boolean>(true)
	let activeKey = ref<String>("1")
	let customer_record = ref<Object>(props.edit_record)
	
	onMounted(() => {
		if (props.edit_record) {
			customer_record.value = props.edit_record
		}
	})
	
	const toNext = (data) => {
		console.log(data)
		activeKey.value = data.activeKey
	}
	
	const hideModal = () => {
		show_add.value = false;
		emit('closeAdd', { show: false });
	}

</script>

<style>
</style>