Sfoglia il codice sorgente

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 4 mesi fa
parent
commit
84bf039150

File diff suppressed because it is too large
+ 11 - 0
src/plugins/dialogExtend/components/analyzeTestData.js


+ 24 - 7
src/plugins/dialogExtend/components/infoForm.vue

@@ -24,7 +24,7 @@
       </template>
       <template #analysis>
         <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>
       </template>
     </CtForm>
@@ -62,7 +62,8 @@ import { uploadFile } from '@/api/common'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
 import uploadForm from './upload.vue'
-// import { analyzeTestData } from './analyzeTestData.js'
+import { analyzeTestData } from './analyzeTestData.js'
+
 
 const props = defineProps({
   option: {
@@ -384,9 +385,17 @@ const getQuery = async () => {
 
 // 填充
 const handleAnalyzeFill = (data) => {
+  // debugger
   const person = data?.person || null
   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) => {
     if (person[e.key]) e.value = person[e.key]
   })
@@ -404,15 +413,23 @@ const uploadFileSubmit = async () => {
   await savePersonResumeCv(query)
   openUploadDialog.value = false
   const data = await resumeParser2({ fileUrl: obj.url })
-  // const data = JSON.parse(JSON.stringify(analyzeTestData))
-  console.log('resumeParser2:', data)
   handleAnalyzeFill(data)
+  getAttachmentList()
   analyzeLoading.value = false
 }
 
-const handleImportAttachment = async () => {
+handleAnalyzeFill(JSON.parse(JSON.stringify(analyzeTestData)))
+
+const attachmentCount = ref(0)
+const getAttachmentList = async () => {
   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
 }
 

Some files were not shown because too many files changed in this diff