|
@@ -2,38 +2,186 @@
|
|
<template>
|
|
<template>
|
|
<CtDialog
|
|
<CtDialog
|
|
:visible="show"
|
|
:visible="show"
|
|
- :widthType="0"
|
|
|
|
- :footer="false"
|
|
|
|
|
|
+ :widthType="6"
|
|
|
|
+ :footer="true"
|
|
titleClass="text-h6"
|
|
titleClass="text-h6"
|
|
title="附件简历解析内容"
|
|
title="附件简历解析内容"
|
|
@close="emit('close')"
|
|
@close="emit('close')"
|
|
|
|
+ @submit="submit"
|
|
>
|
|
>
|
|
- <Evaluation v-if="data.contMyDesc" :data="data" />
|
|
|
|
- <WorkExp v-if="data.jobExpObjs && data.jobExpObjs.length" :data="data" />
|
|
|
|
- <EduExp v-if="data.educationObjs && data.educationObjs.length" :data="data" />
|
|
|
|
|
|
+ <div class="d-flex" style="height: calc(90vh - 160px); overflow: hidden; position: relative;">
|
|
|
|
+ <!-- 简历附件回显 -->
|
|
|
|
+ <div class="mr-5" style="width: 60%; height: 100%">
|
|
|
|
+ <IFrame :src="decodeURIComponent(props.fileUrl)" initHeight="100%"></IFrame>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 解析内容 -->
|
|
|
|
+ <v-card class="elevation-2 pa-3" style="flex: 1; height: 100%; overflow: auto;" >
|
|
|
|
+ <div v-for="item, index of paths" :key="item.id" :id="item.id" class="pa-3 mb-3" style="background-color: var(--color-f8);">
|
|
|
|
+ <div class="resume-header mb-3">
|
|
|
|
+ <div class="resume-title">{{ item.text }}</div>
|
|
|
|
+ <v-btn variant="text" color="error" density="compact" prepend-icon="mdi-delete-outline" @click="del(index, item)">删除</v-btn>
|
|
|
|
+ </div>
|
|
|
|
+ <component ref="componentRef" :id="item.id" :is="item.path" :data="item.data" />
|
|
|
|
+ </div>
|
|
|
|
+ </v-card>
|
|
|
|
+ <v-overlay
|
|
|
|
+ v-model="loading"
|
|
|
|
+ :close-on-content-click="false"
|
|
|
|
+ :no-click-animation="true"
|
|
|
|
+ contained
|
|
|
|
+ class="align-center justify-center"
|
|
|
|
+ >
|
|
|
|
+ <v-progress-circular color="primary" size="64" indeterminate></v-progress-circular>
|
|
|
|
+ </v-overlay>
|
|
|
|
+ </div>
|
|
</CtDialog>
|
|
</CtDialog>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({name: 'position-details-selectResumeDialog'})
|
|
defineOptions({name: 'position-details-selectResumeDialog'})
|
|
-import { watch, computed } from 'vue'
|
|
|
|
-import WorkExp from './analysis/workExp.vue'
|
|
|
|
-import EduExp from './analysis/eduExp.vue'
|
|
|
|
-import Evaluation from './analysis/evaluation.vue'
|
|
|
|
-
|
|
|
|
|
|
+import { watch, computed, shallowRef, ref } from 'vue'
|
|
|
|
+import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
+import IFrame from '@/components/IFrame'
|
|
|
|
+import basicInfo from './analysis/basicInfo.vue'
|
|
|
|
+import selfEvaluation from './analysis/selfEvaluation.vue'
|
|
|
|
+import educationExp from './analysis/educationExp.vue'
|
|
|
|
+import workExperience from './analysis/workExperience.vue'
|
|
|
|
+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()
|
|
const emit = defineEmits(['update:modelValue', 'close'])
|
|
const emit = defineEmits(['update:modelValue', 'close'])
|
|
|
|
+const { t } = useI18n()
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
modelValue: [Boolean, Number],
|
|
modelValue: [Boolean, Number],
|
|
|
|
+ fileUrl: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
|
|
+ },
|
|
data: {
|
|
data: {
|
|
type: Object,
|
|
type: Object,
|
|
- default: () => ({})
|
|
|
|
|
|
+ default: () => {}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+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 },
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const componentRef = ref()
|
|
|
|
+const getValue = async () => {
|
|
|
|
+ let id = ''
|
|
|
|
+ let data = {}
|
|
|
|
+ for (let index = 0; index < componentRef.value.length; index++) {
|
|
|
|
+ const e = componentRef.value[index]
|
|
|
|
+ const query = await e.submit()
|
|
|
|
+ if (query && query.data) {
|
|
|
|
+ data[query.id] = query.data
|
|
|
|
+ } else {
|
|
|
|
+ id = id ? id : query.id
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log('id:', id)
|
|
|
|
+ if (id) {
|
|
|
|
+ Snackbar.warning('请填写完整后提交!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 处理data
|
|
|
|
+ const obj = Object.keys(data).length ? {} : null
|
|
|
|
+ const keyTransform = { // 转换给后端的key
|
|
|
|
+ eduList: 'eduExp',
|
|
|
|
+ workList: 'workExp',
|
|
|
|
+ trainList: 'trainExp',
|
|
|
|
+ }
|
|
|
|
+ if (obj) {
|
|
|
|
+ Object.keys(data).forEach(key => {
|
|
|
|
+ if (key.includes('_')) { // 数组
|
|
|
|
+ const oldKey = key.split('_')[0]
|
|
|
|
+ const newKey = keyTransform[oldKey] ? keyTransform[oldKey] : oldKey
|
|
|
|
+ if (!obj[newKey]) obj[newKey] = [data[key]]
|
|
|
|
+ else obj[newKey].push(data[key])
|
|
|
|
+ } else {
|
|
|
|
+ const newKey = keyTransform[key] ? keyTransform[key] : key
|
|
|
|
+ obj[newKey] = data[key]
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ obj.avatar = ""
|
|
|
|
+ obj.tag = { tagList: [] }
|
|
|
|
+ obj.jobInterested = []
|
|
|
|
+ }
|
|
|
|
+ // console.log('123456:', obj)
|
|
|
|
+ return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
|
|
|
|
+}
|
|
|
|
+const loading = ref(false)
|
|
|
|
+const submit = async () => {
|
|
|
|
+ const obj = await getValue()
|
|
|
|
+ if (!obj) return
|
|
|
|
+ try {
|
|
|
|
+ loading.value = true
|
|
|
|
+ await saveResumeInfo(obj)
|
|
|
|
+ Snackbar.success(t('common.saveMsg'))
|
|
|
|
+ emit('close')
|
|
|
|
+ await useUserStore().getUserBaseInfos() // 更新用户信息
|
|
|
|
+ setTimeout(() => { window.location.reload() }, 1000)
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ } finally {
|
|
|
|
+ loading.value = false
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const del = (index, item) => {
|
|
|
|
+ Confirm('系统提示', `是否确认删除${item.text}?`).then(async () => {
|
|
|
|
+ paths.value = paths.value.filter(e => e.id !== item.id)
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
const show = computed(() => {
|
|
const show = computed(() => {
|
|
return props.modelValue
|
|
return props.modelValue
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const paths = shallowRef([])
|
|
|
|
+watch(
|
|
|
|
+ () => props.data,
|
|
|
|
+ (newVal) => {
|
|
|
|
+ paths.value = []
|
|
|
|
+ if (newVal && Object.keys(newVal)) {
|
|
|
|
+ if (newVal.person?.advantage) newVal.advantage = newVal.person.advantage
|
|
|
|
+ // obj
|
|
|
|
+ const dealObjKeys = ['person', 'advantage']
|
|
|
|
+ dealObjKeys.forEach(key => {
|
|
|
|
+ if (newVal[key]) {
|
|
|
|
+ const obj = {...exampleList[key]}
|
|
|
|
+ obj.data = newVal[key]
|
|
|
|
+ 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 => {
|
|
|
|
+ if (newVal[key]?.length) {
|
|
|
|
+ for (let index = 0; index < newVal[key].length; index++) {
|
|
|
|
+ const obj = {...exampleList[key]}
|
|
|
|
+ obj.id = obj.id + '_' + index
|
|
|
|
+ obj.text = newVal[key].length > 1 ? obj.text + (index+1) : obj.text
|
|
|
|
+ obj.data = newVal[key][index]
|
|
|
|
+ paths.value.push(obj)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ { immediate: true },
|
|
|
|
+)
|
|
|
|
+
|
|
watch(() => show.value, (newVal) => {
|
|
watch(() => show.value, (newVal) => {
|
|
emit('update:modelValue', newVal)
|
|
emit('update:modelValue', newVal)
|
|
})
|
|
})
|