<template>
	<a-form :model="createForm" :label-col="{span: 4}" labelAlign="left">
		<a-row gutter="20">
			<a-col span="24">
				<a-form-item required label="是否至今" name="是否至今" :label-col="{span: 0}">
					<a-radio-group v-model:value="createForm.end_today" button-style="solid">
						<a-radio-button :value="1">非至今</a-radio-button>
						<a-radio-button :value="2">至今</a-radio-button>
					</a-radio-group>
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item label="学校/培训机构" name="school_or_institution" :label-col="{span: 5}">
					<a-input v-model:value="createForm.school_or_institution" placeholder="请输入学校/培训机构" />
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item required label="专业" name="major">
					<a-input v-model:value="createForm.major" placeholder="请输入专业" />
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item label="获得证书" name="certificate">
					<a-input v-model:value="createForm.certificate" placeholder="请输入获得证书" />
				</a-form-item>
			</a-col>
			<a-col span="16">
				<a-form-item label="曾获学校奖项或技能比赛奖项" name="certificate" :label-col="{span: 4}">
					<a-input v-model:value="createForm.awards" placeholder="请输入曾获学校奖项或技能比赛奖项" />
				</a-form-item>
			</a-col>
			<a-col span="8">
				<a-form-item label="曾任职务" name="awards">
					<a-input v-model:value="createForm.awards" placeholder="请输入曾任职务" />
				</a-form-item>
			</a-col>
		</a-row>
		<a-row gutter="20">
			<a-col>
				<a-button type="primary" @click="onSubmit">保存</a-button>
			</a-col>
			<a-col>
				<a-button style="margin-left: 10px">重置</a-button>
			</a-col>
		</a-row>
	</a-form>

</template>

<script lang="ts" setup>
	import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue';
	import { message } from 'ant-design-vue';
	import { PostJobapplicantAdd, PostJobapplicantUpdate } from '@/apis/models';
	const emit = defineEmits();
	const onSubmit = () => {
		// PostJobapplicantAdd(createForm.value).then(res => {
		// 	message.success('基本资料保存成功')
		// 	emit('toNext', {activeKey: "2"})
		// })
		emit('toNext', { activeKey: "6" })
	}
	let createForm = ref({
		start_year: 0,
		start_month: 0,
		end_year: 0,
		end_month: 0,
		end_today: 0,
		school_or_institution: '',
		major: '',
		certificate: '',
		awards: '',
		positions_held: '',
	})

	const resetForm = () => {
		createForm.value = {
			start_year: 0,
			start_month: 0,
			end_year: 0,
			end_month: 0,
			end_today: 0,
			school_or_institution: '',
			major: '',
			certificate: '',
			awards: '',
			positions_held: '',
		}
	}
</script>

<style>
</style>