|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
|
|
+ <div v-loading="saveLoading">
|
|
<el-row :gutter="10">
|
|
<el-row :gutter="10">
|
|
- <el-col :span="14">
|
|
|
|
|
|
+ <el-col :span="12">
|
|
<el-tabs type="border-card">
|
|
<el-tabs type="border-card">
|
|
<el-tab-pane label="简历解析" v-loading="loading">
|
|
<el-tab-pane label="简历解析" v-loading="loading">
|
|
<div v-if="fileUrl">
|
|
<div v-if="fileUrl">
|
|
@@ -42,15 +42,19 @@
|
|
</el-tabs>
|
|
</el-tabs>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="10">
|
|
|
|
|
|
+ <el-col :span="12">
|
|
<div :style="{'height': height, 'overflow-y': 'auto'}">
|
|
<div :style="{'height': height, 'overflow-y': 'auto'}">
|
|
<el-tabs type="border-card">
|
|
<el-tabs type="border-card">
|
|
<el-tab-pane label="简历解析内容">
|
|
<el-tab-pane label="简历解析内容">
|
|
- <Info :data="result?.person"/>
|
|
|
|
- <JobIntention :data="result?.person?.jobInterestedList" />
|
|
|
|
- <Edu :data="result?.eduList" />
|
|
|
|
- <Exp :data="result?.workList" />
|
|
|
|
- <Training :data="result?.trainList" />
|
|
|
|
|
|
+ <Info v-model="result.person" :isEdit="isEdit" />
|
|
|
|
+ <JobIntention v-model="result.person.jobInterestedList" />
|
|
|
|
+ <Edu v-model="result.eduList" :isEdit="isEdit" />
|
|
|
|
+ <Exp v-model="result.workList" :isEdit="isEdit" />
|
|
|
|
+ <Training v-model="result.trainList" :isEdit="isEdit" />
|
|
|
|
+ <div class="text-center m-t-30px">
|
|
|
|
+ <el-button @click="push('/menduner/talentMap')">取 消</el-button>
|
|
|
|
+ <el-button v-if="id === 'add'" type="primary" @click="handleSave">保 存</el-button>
|
|
|
|
+ </div>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="标签">
|
|
<el-tab-pane label="标签">
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
@@ -107,6 +111,9 @@ import Tags from './components/tags.vue'
|
|
import TagsRecommend from './components/tagsRecommend.vue'
|
|
import TagsRecommend from './components/tagsRecommend.vue'
|
|
import Search from './components/search.vue'
|
|
import Search from './components/search.vue'
|
|
|
|
|
|
|
|
+import DefaultData from './defaultData'
|
|
|
|
+
|
|
|
|
+const { push } = useRouter()
|
|
const addNewTag = ref(false)
|
|
const addNewTag = ref(false)
|
|
const newTagText = ref('')
|
|
const newTagText = ref('')
|
|
const saveTags = () => {
|
|
const saveTags = () => {
|
|
@@ -114,8 +121,9 @@ const saveTags = () => {
|
|
}
|
|
}
|
|
|
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
-const result = ref({})
|
|
|
|
-const fileUrl = ref('https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf')
|
|
|
|
|
|
+const saveLoading = ref(false)
|
|
|
|
+const result = ref(DefaultData)
|
|
|
|
+const fileUrl = ref('') // https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf
|
|
const uploadRef = ref()
|
|
const uploadRef = ref()
|
|
const fileList = ref([])
|
|
const fileList = ref([])
|
|
const data = ref({ path: '' })
|
|
const data = ref({ path: '' })
|
|
@@ -127,33 +135,58 @@ const height = ref(0)
|
|
const { currentRoute } = useRouter() // 路由
|
|
const { currentRoute } = useRouter() // 路由
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const { id } = route.params
|
|
const { id } = route.params
|
|
|
|
+const baseUrl = import.meta.env.VITE_PREVIEW_URL
|
|
|
|
+const isEdit = ref(false)
|
|
|
|
+
|
|
|
|
+// 获取人才详情
|
|
|
|
+const getTalentMap = async () => {
|
|
|
|
+ result.value = DefaultData
|
|
|
|
+ loading.value = true
|
|
|
|
+ try {
|
|
|
|
+ const data = await TalentMap.getTalentMapDetails(id)
|
|
|
|
+ if (!data || !Object.keys(data).length) return
|
|
|
|
+ if (data.person?.resumeUrl) {
|
|
|
|
+ fileUrl.value = !data.person?.resumeUrl.includes('.pdf') ? `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(data.person?.resumeUrl))}` : data.person?.resumeUrl
|
|
|
|
+ }
|
|
|
|
+ result.value = data
|
|
|
|
+ result.value.person.interestedAreaIdList = result.value.person.interestedAreaIdList && result.value.person.interestedAreaIdList.length ? result.value.person.interestedAreaIdList.map(e => Number(e)) : []
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ } finally {
|
|
|
|
+ loading.value = false
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
height.value = document.documentElement.clientHeight + 'px'
|
|
height.value = document.documentElement.clientHeight + 'px'
|
|
|
|
+ if (id && id !== 'add') {
|
|
|
|
+ isEdit.value = true
|
|
|
|
+ await getTalentMap()
|
|
|
|
+ } else result.value = DefaultData
|
|
})
|
|
})
|
|
|
|
|
|
// 简历解析
|
|
// 简历解析
|
|
const getResumeParser = async (url) => {
|
|
const getResumeParser = async (url) => {
|
|
|
|
+ result.value = DefaultData
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
const data = await commonApi.resumeParser({ fileUrl: url })
|
|
const data = await commonApi.resumeParser({ fileUrl: url })
|
|
- console.log(data, 'resumeParserData')
|
|
|
|
result.value = data
|
|
result.value = data
|
|
|
|
+ result.value.person.interestedAreaIdList = result.value.person.interestedAreaIdList && result.value.person.interestedAreaIdList.length ? result.value.person.interestedAreaIdList.map(e => Number(e)) : []
|
|
} finally {
|
|
} finally {
|
|
loading.value = false
|
|
loading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-getResumeParser(fileUrl.value)
|
|
|
|
|
|
|
|
// 文件上传
|
|
// 文件上传
|
|
-const baseUrl = import.meta.env.VITE_PREVIEW_URL
|
|
|
|
const handleChange = async (file) => {
|
|
const handleChange = async (file) => {
|
|
- // data.value.path = file.name
|
|
|
|
- // unref(uploadRef)?.submit()
|
|
|
|
- // if (!fileList.value.length) return
|
|
|
|
|
|
+ data.value.path = file.name
|
|
|
|
+ unref(uploadRef)?.submit()
|
|
|
|
+ if (!fileList.value.length) return
|
|
|
|
|
|
- // const url = fileList.value[0].response.data
|
|
|
|
- // fileUrl.value = !url.includes('.pdf') ? `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(url))}` : url
|
|
|
|
- // await getResumeParser(url)
|
|
|
|
|
|
+ const url = fileList.value[0].response.data
|
|
|
|
+ fileUrl.value = !url.includes('.pdf') ? `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(url))}` : url
|
|
|
|
+ await getResumeParser(url)
|
|
}
|
|
}
|
|
|
|
|
|
/** 上传错误提示 */
|
|
/** 上传错误提示 */
|
|
@@ -172,14 +205,15 @@ const submitFormSuccess = () => {
|
|
}
|
|
}
|
|
|
|
|
|
// 重新上传简历
|
|
// 重新上传简历
|
|
-const handleResetUpload = () => {
|
|
|
|
|
|
+const handleResetUpload = async () => {
|
|
|
|
+ await message.confirm('是否确定重新上传简历?确定后将清空当前信息')
|
|
fileUrl.value = ''
|
|
fileUrl.value = ''
|
|
data.value.path = ''
|
|
data.value.path = ''
|
|
fileList.value = []
|
|
fileList.value = []
|
|
- result.value = {}
|
|
|
|
|
|
+ result.value = DefaultData
|
|
}
|
|
}
|
|
|
|
|
|
-// 查看详情
|
|
|
|
|
|
+// 搜索-查看详情
|
|
const apiArr = [
|
|
const apiArr = [
|
|
{ api: PersonInfoApi.getPersonDetails, key: 'person' },
|
|
{ api: PersonInfoApi.getPersonDetails, key: 'person' },
|
|
{ api: PersonInfoApi.getPersonEduPage, key: 'eduList', type: 'array' },
|
|
{ api: PersonInfoApi.getPersonEduPage, key: 'eduList', type: 'array' },
|
|
@@ -190,7 +224,25 @@ const handleDetail = async (id, userId) => {
|
|
if (!id) return message.warning('请先选择人才!')
|
|
if (!id) return message.warning('请先选择人才!')
|
|
apiArr.forEach(async (val) => {
|
|
apiArr.forEach(async (val) => {
|
|
const data = await val.api(val.type === 'array' ? { pageSize: 100, pageNo: 1, userId } : id)
|
|
const data = await val.api(val.type === 'array' ? { pageSize: 100, pageNo: 1, userId } : id)
|
|
|
|
+ if (!val.type) delete data.id
|
|
result.value[val.key] = val.type === 'array' ? data.list : data || {}
|
|
result.value[val.key] = val.type === 'array' ? data.list : data || {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 新增人才
|
|
|
|
+const handleSave = async () => {
|
|
|
|
+ if (result.value?.resume) delete result.value.resume
|
|
|
|
+ console.log(result.value, 'result-add')
|
|
|
|
+ saveLoading.value = true
|
|
|
|
+ try {
|
|
|
|
+ await TalentMap.createTalentMapInfo(result.value)
|
|
|
|
+ message.success('新增成功!')
|
|
|
|
+ result.value = DefaultData
|
|
|
|
+ push('/menduner/talentMap')
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ } finally {
|
|
|
|
+ saveLoading.value = false
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|