|
@@ -24,7 +24,7 @@
|
|
</template>
|
|
</template>
|
|
<template #analysis>
|
|
<template #analysis>
|
|
<div style="text-align: right; width: 100%;">
|
|
<div style="text-align: right; width: 100%;">
|
|
- <v-btn variant="text" color="primary" :loading="analyzeLoading" @click="handleImportAttachment">导入简历快速填写</v-btn>
|
|
|
|
|
|
+ <v-btn variant="text" color="primary" :loading="analyzeLoading" @click="handleImportAttachment">导入简历快速填写 ({{ attachmentCount }}/5)</v-btn>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</CtForm>
|
|
</CtForm>
|
|
@@ -62,7 +62,8 @@ import { uploadFile } from '@/api/common'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
import uploadForm from './upload.vue'
|
|
import uploadForm from './upload.vue'
|
|
-// import { analyzeTestData } from './analyzeTestData.js'
|
|
|
|
|
|
+import { analyzeTestData } from './analyzeTestData.js'
|
|
|
|
+
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
option: {
|
|
option: {
|
|
@@ -384,9 +385,17 @@ const getQuery = async () => {
|
|
|
|
|
|
// 填充
|
|
// 填充
|
|
const handleAnalyzeFill = (data) => {
|
|
const handleAnalyzeFill = (data) => {
|
|
|
|
+ // debugger
|
|
const person = data?.person || null
|
|
const person = data?.person || null
|
|
if (!person && !Object.keys(person).length) return Snackbar.warning('无可用内容!')
|
|
if (!person && !Object.keys(person).length) return Snackbar.warning('无可用内容!')
|
|
- if (person.enterpriseName) getEnterpriseData(person.enterpriseName)
|
|
|
|
|
|
+ if (data.lastEmployed) {
|
|
|
|
+ // debugger
|
|
|
|
+ if (data.lastEmployed.enterpriseName) person.enterpriseId = person.enterpriseName = data.lastEmployed.enterpriseName
|
|
|
|
+ if (data.lastEmployed.positionName) person.positionId = person.positionName = data.lastEmployed.positionName
|
|
|
|
+ if (person.enterpriseName) getEnterpriseData(person.enterpriseName)
|
|
|
|
+ }
|
|
|
|
+ if (data.lastPositionId) person.interestedPositionList = [data.lastPositionId]
|
|
|
|
+ // debugger
|
|
items.value.options.forEach((e) => {
|
|
items.value.options.forEach((e) => {
|
|
if (person[e.key]) e.value = person[e.key]
|
|
if (person[e.key]) e.value = person[e.key]
|
|
})
|
|
})
|
|
@@ -404,15 +413,23 @@ const uploadFileSubmit = async () => {
|
|
await savePersonResumeCv(query)
|
|
await savePersonResumeCv(query)
|
|
openUploadDialog.value = false
|
|
openUploadDialog.value = false
|
|
const data = await resumeParser2({ fileUrl: obj.url })
|
|
const data = await resumeParser2({ fileUrl: obj.url })
|
|
- // const data = JSON.parse(JSON.stringify(analyzeTestData))
|
|
|
|
- console.log('resumeParser2:', data)
|
|
|
|
handleAnalyzeFill(data)
|
|
handleAnalyzeFill(data)
|
|
|
|
+ getAttachmentList()
|
|
analyzeLoading.value = false
|
|
analyzeLoading.value = false
|
|
}
|
|
}
|
|
|
|
|
|
-const handleImportAttachment = async () => {
|
|
|
|
|
|
+handleAnalyzeFill(JSON.parse(JSON.stringify(analyzeTestData)))
|
|
|
|
+
|
|
|
|
+const attachmentCount = ref(0)
|
|
|
|
+const getAttachmentList = async () => {
|
|
const data = await getPersonResumeCv() // 获取附件
|
|
const data = await getPersonResumeCv() // 获取附件
|
|
- if (data?.length >= 5) return Snackbar.warning('导入解析简历尝试不得超过5次!')
|
|
|
|
|
|
+ attachmentCount.value = data?.length || 0
|
|
|
|
+}
|
|
|
|
+getAttachmentList()
|
|
|
|
+
|
|
|
|
+const handleImportAttachment = async () => {
|
|
|
|
+ await getAttachmentList()
|
|
|
|
+ if (attachmentCount.value >= 5) return Snackbar.warning('导入解析简历尝试不得超过5次!')
|
|
openUploadDialog.value = true
|
|
openUploadDialog.value = true
|
|
}
|
|
}
|
|
|
|
|