|
@@ -42,6 +42,7 @@ defineOptions({name: 'position-details-selectResumeDialog'})
|
|
|
import { watch, computed, shallowRef, ref } from 'vue'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import IFrame from '@/components/IFrame'
|
|
|
+import avatar from './analysis/avatar.vue'
|
|
|
import basicInfo from './analysis/basicInfo.vue'
|
|
|
import selfEvaluation from './analysis/selfEvaluation.vue'
|
|
|
import educationExp from './analysis/educationExp.vue'
|
|
@@ -50,7 +51,7 @@ import trainingExperience from './analysis/trainingExperience.vue'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
import Confirm from '@/plugins/confirm'
|
|
|
import { saveResumeInfo } from '@/api/recruit/personal/resume'
|
|
|
-import { useUserStore } from '@/store/user'; const userStore = useUserStore()
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
const emit = defineEmits(['update:modelValue', 'close'])
|
|
|
const { t } = useI18n()
|
|
|
const props = defineProps({
|
|
@@ -66,11 +67,12 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const exampleList = {
|
|
|
- person: { text: t('resume.basicInfo'), id: 'person', path: basicInfo, hide: false },
|
|
|
- advantage: { text: t('resume.personalAdvantages'), id: 'advantage', path: selfEvaluation, hide: false },
|
|
|
- eduList: { text: t('resume.educationExp'), id: 'eduList', path: educationExp, hide: false },
|
|
|
- workList: { text: t('resume.workExperience'), id: 'workList', path: workExperience, hide: false },
|
|
|
- trainList: { text: t('resume.trainingExperience'), id: 'trainList', path: trainingExperience, hide: false },
|
|
|
+ avatar: { text: t('resume.avatar'), id: 'avatar', path: avatar },
|
|
|
+ person: { text: t('resume.basicInfo'), id: 'person', path: basicInfo },
|
|
|
+ advantage: { text: t('resume.personalAdvantages'), id: 'advantage', path: selfEvaluation },
|
|
|
+ eduList: { text: t('resume.educationExp'), id: 'eduList', path: educationExp },
|
|
|
+ workList: { text: t('resume.workExperience'), id: 'workList', path: workExperience },
|
|
|
+ trainList: { text: t('resume.trainingExperience'), id: 'trainList', path: trainingExperience },
|
|
|
}
|
|
|
|
|
|
const componentRef = ref()
|
|
@@ -92,7 +94,7 @@ const getValue = async () => {
|
|
|
return
|
|
|
}
|
|
|
// 处理data
|
|
|
- const obj = Object.keys(data).length ? {} : null
|
|
|
+ let obj = Object.keys(data).length ? {} : null
|
|
|
const keyTransform = { // 转换给后端的key
|
|
|
eduList: 'eduExp',
|
|
|
workList: 'workExp',
|
|
@@ -110,9 +112,8 @@ const getValue = async () => {
|
|
|
obj[newKey] = data[key]
|
|
|
}
|
|
|
})
|
|
|
- obj.avatar = ""
|
|
|
- obj.tag = { tagList: [] }
|
|
|
- obj.jobInterested = []
|
|
|
+ const defaultObj = { avatar: "", person: {}, tag: { tagList: [] }, jobInterested: [], eduExp: [], workExp: [], trainExp: [] } // 必传字段
|
|
|
+ obj = { ...defaultObj, ...obj }
|
|
|
}
|
|
|
// console.log('123456:', obj)
|
|
|
return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
|
|
@@ -152,8 +153,9 @@ watch(
|
|
|
paths.value = []
|
|
|
if (newVal && Object.keys(newVal)) {
|
|
|
if (newVal.person?.advantage) newVal.advantage = newVal.person.advantage
|
|
|
+ if (newVal.person?.avatar) newVal.avatar = newVal.person.avatar
|
|
|
// obj
|
|
|
- const dealObjKeys = ['person', 'advantage']
|
|
|
+ const dealObjKeys = ['avatar', 'person', 'advantage']
|
|
|
dealObjKeys.forEach(key => {
|
|
|
if (newVal[key]) {
|
|
|
const obj = {...exampleList[key]}
|
|
@@ -161,9 +163,6 @@ watch(
|
|
|
paths.value.push(obj)
|
|
|
}
|
|
|
})
|
|
|
- // const baseInfoItem = { ...exampleList.person }
|
|
|
- // if (newVal.person) baseInfoItem = newVal.person; paths.value.push(baseInfoItem)
|
|
|
- // if (newVal.person?.advantage) exampleList.advantage.data = newVal.person.advantage; paths.value.push(exampleList.advantage)
|
|
|
// arr
|
|
|
const dealArrKeys = ['eduList', 'workList', 'trainList']
|
|
|
dealArrKeys.forEach(key => {
|