|
@@ -99,7 +99,6 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
import { TalentMap } from '@/api/menduner/system/talentMap'
|
|
import { TalentMap } from '@/api/menduner/system/talentMap'
|
|
import { useUpload } from '@/components/UploadFile/src/useUpload'
|
|
import { useUpload } from '@/components/UploadFile/src/useUpload'
|
|
import { commonApi } from '@/api/menduner/common'
|
|
import { commonApi } from '@/api/menduner/common'
|
|
-import { PersonInfoApi } from '@/api/menduner/system/person'
|
|
|
|
import { Base64 } from 'js-base64'
|
|
import { Base64 } from 'js-base64'
|
|
|
|
|
|
import Info from './components/info.vue'
|
|
import Info from './components/info.vue'
|
|
@@ -112,6 +111,7 @@ import TagsRecommend from './components/tagsRecommend.vue'
|
|
import Search from './components/search.vue'
|
|
import Search from './components/search.vue'
|
|
|
|
|
|
import DefaultData from './defaultData'
|
|
import DefaultData from './defaultData'
|
|
|
|
+import { cloneDeep } from 'lodash-es';
|
|
|
|
|
|
const { push } = useRouter()
|
|
const { push } = useRouter()
|
|
const addNewTag = ref(false)
|
|
const addNewTag = ref(false)
|
|
@@ -122,7 +122,7 @@ const saveTags = () => {
|
|
|
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
const saveLoading = ref(false)
|
|
const saveLoading = ref(false)
|
|
-const result = ref(DefaultData)
|
|
|
|
|
|
+const result = ref(cloneDeep(DefaultData))
|
|
const fileUrl = ref('') // https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf
|
|
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([])
|
|
@@ -140,7 +140,6 @@ const isEdit = ref(false)
|
|
|
|
|
|
// 获取人才详情
|
|
// 获取人才详情
|
|
const getTalentMap = async () => {
|
|
const getTalentMap = async () => {
|
|
- result.value = DefaultData
|
|
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
const data = await TalentMap.getTalentMapDetails(id)
|
|
const data = await TalentMap.getTalentMapDetails(id)
|
|
@@ -162,12 +161,11 @@ onMounted(async () => {
|
|
if (id && id !== 'add') {
|
|
if (id && id !== 'add') {
|
|
isEdit.value = true
|
|
isEdit.value = true
|
|
await getTalentMap()
|
|
await getTalentMap()
|
|
- } else result.value = DefaultData
|
|
|
|
|
|
+ } else result.value = cloneDeep(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 })
|
|
@@ -210,23 +208,18 @@ const handleResetUpload = async () => {
|
|
fileUrl.value = ''
|
|
fileUrl.value = ''
|
|
data.value.path = ''
|
|
data.value.path = ''
|
|
fileList.value = []
|
|
fileList.value = []
|
|
- result.value = DefaultData
|
|
|
|
|
|
+ result.value = cloneDeep(DefaultData)
|
|
}
|
|
}
|
|
|
|
|
|
// 搜索-查看详情
|
|
// 搜索-查看详情
|
|
-const apiArr = [
|
|
|
|
- { api: PersonInfoApi.getPersonDetails, key: 'person' },
|
|
|
|
- { api: PersonInfoApi.getPersonEduPage, key: 'eduList', type: 'array' },
|
|
|
|
- { api: PersonInfoApi.getPersonExpPage, key: 'workList', type: 'array' },
|
|
|
|
- { api: PersonInfoApi.getPersonTrainingPage, key: 'trainList', type: 'array' }
|
|
|
|
-]
|
|
|
|
-const handleDetail = async (id, userId) => {
|
|
|
|
- if (!id) return message.warning('请先选择人才!')
|
|
|
|
- apiArr.forEach(async (val) => {
|
|
|
|
- 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 || {}
|
|
|
|
- })
|
|
|
|
|
|
+const keyList = ['person', 'eduList', 'workList', 'trainList']
|
|
|
|
+const handleDetail = async (userId) => {
|
|
|
|
+ if (!userId) return message.warning('请先选择人才!')
|
|
|
|
+ try {
|
|
|
|
+ const data = await TalentMap.getTalentMapDetail(userId)
|
|
|
|
+ if (data && data.person && data.person.id) delete data.person.id
|
|
|
|
+ keyList.forEach(key => result.value[key] = data[key])
|
|
|
|
+ } catch {}
|
|
}
|
|
}
|
|
|
|
|
|
// 新增人才
|
|
// 新增人才
|
|
@@ -237,7 +230,7 @@ const handleSave = async () => {
|
|
try {
|
|
try {
|
|
await TalentMap.createTalentMapInfo(result.value)
|
|
await TalentMap.createTalentMapInfo(result.value)
|
|
message.success('新增成功!')
|
|
message.success('新增成功!')
|
|
- result.value = DefaultData
|
|
|
|
|
|
+ result.value = cloneDeep(DefaultData)
|
|
push('/menduner/talentMap')
|
|
push('/menduner/talentMap')
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error)
|
|
console.log(error)
|