<template>
	<a-form :model="createForm" :label-col="{span: 4}" labelAlign="right">
		<a-row gutter="20">
			<a-col span="12">
				<a-row>
					<a-col span="24">
						<a-form-item label="关键字" name="keyword">
							<a-input v-model:value="createForm.keyword" placeholder="Basic usage" />
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="应聘职位">
							<a-shujilian :dict="2004" placeholder="职位类别(最多三个,多选只取前三)" @saveTreeNode="jobTypeChange"
								:select_content="job_type"></a-shujilian>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="期望地区">
							<a-shujilian :dict="2009" placeholder="工作区域(最多四个,多选只取前四)" @saveTreeNode="jobAddressChange"
								:select_content="job_location"></a-shujilian>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="户口所在地">
							<a-jilian :dict="2009" @saveCascader="regLevelSave" placeholder="请选择籍贯"
								:cascader_content="addOtherForm.company_jiguan_cascader"></a-jilian>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="学历">
							<a-xuanze :dict="2006" placeholder="请选择学历" @saveSelect="saveSchoolDegree"
								:select_content="createForm.school_degree"></a-xuanze>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="含最高学历" name="degree_better">
							<a-radio-group v-model:value="createForm.degree_better" 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="24">
						<a-form-item required label="英语">
							<a-xuanze :dict="2007" placeholder="请选择掌握程度" @saveSelect="saveEnglish"
								:select_content="createForm.language_degree"></a-xuanze>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item required label="国语">
							<a-xuanze :dict="2007" placeholder="请选择掌握程度" @saveSelect="saveMandarin"
								:select_content="createForm.language_degree"></a-xuanze>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item required label="粤语">
							<a-xuanze :dict="2007" placeholder="请选择掌握程度" @saveSelect="saveCantonese"
								:select_content="createForm.language_degree"></a-xuanze>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item required label="第二外语">
							<a-xuanze :dict="2007" placeholder="请选择第二外语" @saveSelect="saveOtherLanguage"
								:select_content="createForm.language"></a-xuanze>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item required label="计算机能力">
							<a-input v-model:value="value" placeholder="请输入计算机能力" />
						</a-form-item>
					</a-col>

					<a-col span="24">
						<a-form-item required label="工作经验">
							<a-xuanze :dict="2021" placeholder="请选择工作经验" @saveSelect="saveExperience"
								:select_content="createForm.experience"></a-xuanze>
						</a-form-item>
					</a-col>

					<a-col span="24">
						<a-form-item label="性别" name="sex">
							<a-radio-group v-model:value="createForm.gender" button-style="solid">
								<a-radio-button value="男">男</a-radio-button>
								<a-radio-button value="女">女</a-radio-button>
								<a-radio-button value="不限">不限</a-radio-button>
							</a-radio-group>
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="最小年龄" name="age_min">
							<a-input-number :min="0" type="number" v-model:value="createForm.age_min"
								placeholder="请输入最小年龄" style="width: 100%;" />
						</a-form-item>
					</a-col>

					<a-col span="24">
						<a-form-item label="最大年龄" name="age_max">
							<a-input-number :min="0" type="number" v-model:value="createForm.age_max"
								placeholder="请输入最大年龄" style="width: 100%;" />
						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item required label="简历更新" name="marital_status">

						</a-form-item>
					</a-col>
					<a-col span="24">
						<a-form-item label="搜索">
							<a-button type="primary" block @click="saveForm">搜索</a-button>
						</a-form-item>
					</a-col>
				</a-row>
			</a-col>
		</a-row>
	</a-form>
</template>

<script setup lang="ts">
	import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue';

	let createForm : companyListType.addrFormType = ref({
		keyword: "",
		gender: "女",
		title: 0,
		education: 0,
		marital_status: 0,
		ethnicity: 0,
		reg_level1: 0,
		reg_level2: 0,
		reg_level3: 0,
		reg_level4: 0,
		now_level1: 0,
		now_level2: 0,
		now_level3: 0,
		now_level4: 0,
		maxdob: "9999-12-31 23:59:59",
		mindob: "1000-01-01 00:00:00",
		maxheight: 230,
		minheight: 60,
		maxweight: 200,
		minweight: 30,
		political_status: 0,
		native_place: 0,
		desire_area: [],
		desire_position: [],
		desire_industry: [],
		job_type_desire: 0,
		talent_type_desire: 0,
		max_work_experience: 0,
		min_work_experience: 0,
		salary_range_desire: 0,
		available_date_desire: 0,
		title_requirement_desire: 0,
		skill_certification_desire: 0,
		english: 0,
		mandarin: 0,
		cantonese: 0,
		other_language: 0,
		sort: "id",
		sortby: "asc",
		page: 1,
		pagesize: 20
	})
	
	let addOtherForm : companyListType.addrFormType = ref({
		company_jiguan_cascader: []
	})
	
	// 户口所在地
	const regLevelSave = (data) => {
		for (let i = 0; i < 4; i++) {
			createForm.value[`reg_level${i + 1}`] = data.arr1[i] || 0;
		}
	}
	
	// 学历要求
	const saveSchoolDegree = (data) => {
		createForm.value.education = data.val.key;
	}
	
	// 英语掌握程度
	const saveEnglish = (data) => {
		createForm.value.english = data.val.key;;
	}
	
	// 国语掌握程度
	const saveMandarin = (data) => {
		createForm.value.mandarin = data.val.key;;
	}
	
	// 粤语掌握程度
	const saveCantonese = (data) => {
		createForm.value.cantonese = data.val.key;;
	}
	
	// 第二外语
	const saveOtherLanguage = (data) => {
		createForm.value.other_language = data.val.key;;
	}
	
	
	// 工作经验
	const saveExperience = (data) => {
		createForm.value.experience = data.val.key;
	}
	
</script>

<style>
</style>

<style>
</style>