lifanagju_citu vor 1 Woche
Ursprung
Commit
9504049400
1 geänderte Dateien mit 51 neuen und 52 gelöschten Zeilen
  1. 51 52
      src/views/menduner/system/talentMap/maintenance/gather/index3.vue

+ 51 - 52
src/views/menduner/system/talentMap/maintenance/gather/index3.vue

@@ -71,7 +71,7 @@
     </Dialog>
 
     <!-- 解析文件上传 -->
-    <Dialog :title="radioObject[radioValue]" v-model="dialog_upload" :width="DialogWidth" @close="handleCancel">
+    <Dialog :title="radioObject[radioValue]" v-model="dialog_upload" :modalClose="false" :width="DialogWidth" @close="handleCancel">
       <div>
         <!-- 简历解析 -->
         <template v-if="radioValue === 'file'">
@@ -81,7 +81,6 @@
             :action="uploadUrl"
             :auto-upload="false"
             :data="fileData"
-            :limit="1"
             :on-change="handleChange"
             :on-error="submitFormError"
             :on-exceed="handleExceed"
@@ -89,6 +88,7 @@
             :http-request="httpRequest"
             accept=".pdf, doc, .docx"
             drag
+            multiple
             class="flex-1"
           >
             <i class="el-icon-upload"></i>
@@ -102,26 +102,26 @@
         </template>
         <!-- 名片解析 -->
         <template v-if="radioValue === 'card'">
-          <UploadImg
+          <UploadImgs
             v-model="cardImgUrl"
-            :limit="1"
             :uploadSuccessTip="false"
+            :limit="100"
             @handle-change="cardUploadChange"
-            height="150px" width="150px" style="margin: 20px auto; width: 150px;"
+            height="150px" width="150px" style="margin: 20px auto; text-align: center;"
           >
             <template #tip>{{ cardImgUrl ? '' : '请上传名片' }}</template>
-          </UploadImg>
+          </UploadImgs>
         </template>
         <template v-if="radioValue === 'picture'">
-          <UploadImg
+          <UploadImgs
             v-model="cardImgUrl"
-            :limit="1"
             :uploadSuccessTip="false"
+            :limit="100"
             @handle-change="cardUploadChange"
-            height="150px" width="150px" style="margin: 20px auto; width: 150px;"
+            height="150px" width="150px" style="margin: 20px auto; text-align: center;"
           >
             <template #tip>{{ cardImgUrl ? '' : '请上传图片' }}</template>
-          </UploadImg>
+          </UploadImgs>
         </template>
       </div>
       <template #footer>
@@ -173,8 +173,7 @@
               v-model:file-list="fileList"
               :action="uploadUrl"
               :auto-upload="false"
-              :data="data"
-              :limit="1"
+              :data="fileData"
               :on-change="handleChange"
               :on-error="submitFormError"
               :on-exceed="handleExceed"
@@ -182,6 +181,7 @@
               :http-request="httpRequest"
               accept=".pdf, doc, .docx"
               drag
+              multiple
               class="flex-1"
             >
               <i class="el-icon-upload"></i>
@@ -198,18 +198,17 @@
             <div class="image">
               <el-image v-if="cardImgUrl" class="!w-100%" :src="cardImgUrl" />
               <div v-else>
-                <UploadImg
+                <UploadImgs
                   v-model="cardImgUrl"
-                  :limit="1"
                   :uploadSuccessTip="false"
-                  drag
-                  buttonUpload
+                  :limit="100"
+                  drag buttonUpload
                   @handle-change="cardUploadChange"
                   height="32px" width="104px"
                   style="margin: 0 auto; width: 104px;margin-top: 40%;"
                 >
                   <template #tip>{{ cardImgUrl ? '' : '请上传名片' }}</template>
-                </UploadImg>
+                </UploadImgs>
               </div>
             </div>
           </template>
@@ -536,31 +535,29 @@ const handleAnalysis = async () => {
   formData.value = null
 	const type = radioValue.value
   try {
-    // if (type === 'menduner') { // 门墩儿人才库
-    // } else 
-    if (type === 'file') { // 简历解析
-      if (!fileUrl.value) return message.warning('获取文件失败,请重新上传!')
-      const data = await commonApi.resumeParser({ fileUrl: fileUrl.value })
-      resumeAnalysisToForm(data) // 简历解析
-    } else if (type === 'card') { // 名片解析
-      if (!cardImgUrl.value) {
-        message.warning('请先上传名片!')
-        return
-      }
-      cardFileQuery.value = new FormData()
-      cardFileQuery.value.append('image', cardUploadRow.value)
-      message.warning('正在解析...')
+    // if (type === 'file') { // 简历解析
+    //   if (!fileUrl.value) return message.warning('获取文件失败,请重新上传!')
+    //   const data = await commonApi.resumeParser({ fileUrl: fileUrl.value })
+    //   resumeAnalysisToForm(data) // 简历解析
+    // } else if (type === 'card') { // 名片解析
+    //   if (!cardImgUrl.value) {
+    //     message.warning('请先上传名片!')
+    //     return
+    //   }
+    //   cardFileQuery.value = new FormData()
+    //   cardFileQuery.value.append('image', cardUploadRow.value)
+    //   message.warning('正在解析...')
   
-      const index = createAnalysisNum.value
-      const res = await talentLabelingApi.businessCardParse(cardFileQuery.value)
-      if (index !== createAnalysisNum.value || !dialog_upload.value) return // 不是最新的名片解析数据(用户在解析完成前已重新上传)或用户已取消解析
-      formData.value = res?.data || res
-      message.success('名片解析成功')
-    }
-    // else if (type === 'web') {}
+    //   const index = createAnalysisNum.value
+    //   const res = await talentLabelingApi.businessCardParse(cardFileQuery.value)
+    //   if (index !== createAnalysisNum.value || !dialog_upload.value) return // 不是最新的名片解析数据(用户在解析完成前已重新上传)或用户已取消解析
+    //   formData.value = res?.data || res
+    //   message.success('名片解析成功')
+    // }
 
     dialog_upload.value = false
-    dialog_analysisInfo.value = true
+    message.success('上传成功,请等待解析任务完成,解析完成后点击入库即可完成人才入库!')
+    // dialog_analysisInfo.value = true
   } catch (error) {
     console.log('解析失败', error)
     cardFileQuery.value = null
@@ -585,19 +582,19 @@ const fileList = ref([])
 const fileData = ref({ path: '' })
 // 文件上传
 const handleChange = async (file) => {
-  fileData.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
-  if (dialog_analysisInfo.value) {
-    if (FormPageRef.value?.changeLoading) FormPageRef.value.changeLoading(true)
-    message.warning('正在解析...')
-    const data = await commonApi.resumeParser({ fileUrl: fileUrl.value })
-    resumeAnalysisToForm(data) // 简历解析
-    if (FormPageRef.value?.changeLoading) FormPageRef.value.changeLoading(false)
-  }
+  // fileData.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
+  // if (dialog_analysisInfo.value) {
+  //   if (FormPageRef.value?.changeLoading) FormPageRef.value.changeLoading(true)
+  //   message.warning('正在解析...')
+  //   const data = await commonApi.resumeParser({ fileUrl: fileUrl.value })
+  //   resumeAnalysisToForm(data) // 简历解析
+  //   if (FormPageRef.value?.changeLoading) FormPageRef.value.changeLoading(false)
+  // }
 }
 const submitFormError = () => {
   message.error('上传失败,请您重新上传!')
@@ -684,9 +681,11 @@ const handleSelect = () => {
   openSelect.value = false
   formData.value = null
   showWebAnalysis.value = false
+  DialogWidth.value = '500'
 	const type = radioValue.value
   if (type === 'card') {
     createAnalysisNum.value++
+  DialogWidth.value = '800'
   }
   if (type === 'menduner') {
     openSearch.value = true