浏览代码

完成简历解析

lifanagju_citu 1 月之前
父节点
当前提交
1cbd8f537b

+ 1 - 1
pagesA/info/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
 		<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="105px" label-align="right">
 			<uni-forms-item label="头像" name="avatar" class="f-straight">
         <view style="display: flex;flex-wrap: wrap;">

+ 0 - 1
pagesA/resume/index.vue

@@ -144,7 +144,6 @@ const handleResumeAnalysis = () => {
 	// })
 }
 
-
 </script>
 
 <style scoped lang="scss">

+ 2 - 7
pagesA/resumeAnalysis/components/advantage.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="f-straight wrapper">
-		<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="105px" label-align="right">
+	<view class="f-straight">
+		<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="80px" label-align="right">
       <uni-forms-item label="个人优势" name="advantage" required>
         <textarea
           placeholder-style="color:#F76260"
@@ -68,11 +68,6 @@ defineExpose({
 </script>
 
 <style lang="less" scoped>
-
-.wrapper{
-	padding: 15px;
-  padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 1 - 5
pagesA/resumeAnalysis/components/avatarEdit.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
 		<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="105px" label-align="right">
 			<uni-forms-item label="头像" name="avatar" class="f-straight" required>
         <view style="display: flex;flex-wrap: wrap;">
@@ -95,10 +95,6 @@ defineExpose({
 
 <style lang="less" scoped>
 
-.wrapper{
-	padding: 15px;
-  padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 1 - 6
pagesA/resumeAnalysis/components/baseInfoEdit.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
 		<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="105px" label-align="right">
 			<uni-forms-item required label="中文名" name="name">
         <uni-easyinput v-model="formData.name" placeholder="请输入中文名" />
@@ -155,11 +155,6 @@ defineExpose({
 </script>
 
 <style lang="less" scoped>
-
-.wrapper{
-	padding: 15px;
-  // padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 2 - 7
pagesA/resumeAnalysis/components/educationExp.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
     <uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="90px">
       <uni-forms-item label="学校名称" name="schoolName" required>
 				<uni-combox :candidates="schoolData" placeholder="学校名称" v-model="formData.schoolName" @input="handleSearchSchool"></uni-combox>
@@ -134,7 +134,7 @@ const submit = async () => {
     const startTime = convertYearMonthToTimestamp(formData.value.startTime)
     const endTime = convertYearMonthToTimestamp(formData.value.endTime)
     if (startTime > endTime) {
-      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间' })
+      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间', duration: 2000 })
       return
     }
     return { id: props.id, data: { ...formData.value, startTime, endTime }}
@@ -152,11 +152,6 @@ defineExpose({
 </script>
 
 <style lang="less" scoped>
-
-.wrapper{
-	padding: 15px;
-  // padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 2 - 7
pagesA/resumeAnalysis/components/trainingExperience.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
     <uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="90px">
       <uni-forms-item label="培训中心" name="orgName" required>
 				<uni-easyinput type="text" v-model="formData.orgName" placeholder="请输入内容"></uni-easyinput>
@@ -94,7 +94,7 @@ const submit = async () => {
     const startTime = convertYearMonthToTimestamp(formData.value.startTime)
     const endTime = convertYearMonthToTimestamp(formData.value.endTime)
     if (startTime > endTime) {
-      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间' })
+      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间', duration: 2000 })
       return
     }
     return { id: props.id, data: { ...formData.value, startTime, endTime }}
@@ -112,11 +112,6 @@ defineExpose({
 </script>
 
 <style lang="less" scoped>
-
-.wrapper{
-	padding: 15px;
-  // padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 3 - 8
pagesA/resumeAnalysis/components/workExperience.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="f-straight wrapper">
+	<view class="f-straight">
     <uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="90px">
       <uni-forms-item label="企业名称" name="enterpriseName" required>
 				<uni-combox :candidates="enterpriseData" placeholder="企业名称" v-model="formData.enterpriseName" @input="handleSearchEnterprise"></uni-combox>
@@ -134,12 +134,12 @@ const submit = async () => {
   try {
     const valid = await unref(form).validate()
     // if (!valid) return { id: props.id, data: null}
-    if (!formData.value.endTime && !sofar.value.length) return uni.showToast({ icon: 'none', title: '请选择工作经历的结束时间' })
+    if (!formData.value.endTime && !sofar.value.length) return uni.showToast({ icon: 'none', title: '请选择工作经历的结束时间', duration: 2000 })
     //
     const startTime = convertYearMonthToTimestamp(formData.value.startTime)
     const endTime = sofar.value.length ? null : convertYearMonthToTimestamp(formData.value.endTime)
     if (endTime && startTime > endTime) {
-      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间' })
+      uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间', duration: 2000 })
       return
     }
     return { id: props.id, data: { ...formData.value, startTime, endTime }}
@@ -157,11 +157,6 @@ defineExpose({
 </script>
 
 <style lang="less" scoped>
-
-.wrapper{
-	padding: 15px;
-  // padding-top: 30px;
-}
 .upload-img{
   position: relative;
   width: 200rpx;

+ 27 - 18
pagesA/resumeAnalysis/index.vue

@@ -47,7 +47,6 @@
 
 <script setup>
 import { saveResumeInfo, resumeParser2 } from '@/api/user'
-// import { envObj, baseUrl } from '@/utils/config'
 import resume from '../resume/index.vue'
 import { ref, shallowRef } from 'vue'
 import avatarEdit from './components/avatarEdit.vue'
@@ -56,7 +55,8 @@ import advantageEdit from './components/advantage.vue'
 import educationEdit from './components/educationExp.vue'
 import workExperienceEdit from './components/workExperience.vue'
 import trainingExperienceEdit from './components/trainingExperience.vue'
-import { resumeParser2Data } from './testData.js'
+// import { resumeParser2Data } from './testData.js'
+import { userStore } from '@/store/user'; const useUserStore = userStore()
 
 const step = ref(1)
 
@@ -137,9 +137,9 @@ const handleAnalysis = async (url) => {
   loading.value = true
   step.value = 3
   try {
-    // const res = await resumeParser2({ fileUrl: url })
-    // result.value = res?.data || {}
-    result.value = resumeParser2Data
+    const res = await resumeParser2({ fileUrl: url })
+    result.value = res?.data || {}
+    // result.value = resumeParser2Data // 测试数据
     await transformToLIst(result.value)
     step.value = 2
   } catch (error) {
@@ -152,7 +152,7 @@ const handleAnalysis = async (url) => {
 
 const handleResumeAnalysis = (url) => {
   if (!url) {
-    return uni.showToast({ icon: 'none', title: '请选择要解析的简历' })
+    return uni.showToast({ icon: 'none', title: '请选择要解析的简历', duration: 2000 })
   }
   handleAnalysis(url)
 }
@@ -171,7 +171,7 @@ const getValue = async () => {
     }
   }
   if (text) {
-    uni.showToast({ icon: 'none', title: `请完整填写 ${text} 后提交!` })
+    uni.showToast({ icon: 'none', title: `请完整填写 ${text} 后提交!`, duration: 2000 })
     return
   }
   // 处理data
@@ -194,21 +194,30 @@ const getValue = async () => {
       }
     })
   }
-  console.log('123456:', obj)
-  return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
+  console.log('getValue:', obj)
+  return (obj && Object.keys(obj).length) ? JSON.stringify(obj) : null
 }
 
 const submitLoading = ref(false)
 const submit = async () => {
-  const obj = await getValue()
-  if (!obj) return
-  submitLoading.value = true
-  await saveResumeInfo(obj)
-  dialogType = 'submitSuccess'
-  dialogContent.value = '提交成功,立即前往在线简历查看'
-  showClose.value = false
-  confirmRef.value.open()
-  // await useUserStore().getUserBaseInfos() // 更新用户信息
+  try {
+    const obj = await getValue()
+    if (!obj) return
+    submitLoading.value = true
+    uni.showLoading({ title: '提交中' })
+    await saveResumeInfo(obj)
+    await useUserStore.getInfo()
+		uni.hideLoading()
+    setTimeout(() => {
+      uni.showToast({ title: '提交成功', icon: 'success', duration: 2000 })
+    }, 500)
+    uni.navigateTo({ url: '/pagesA/resumeOnline/index' })
+  } catch (error) {
+    console.log('saveResumeInfoError:', error)
+  } finally {
+    submitLoading.value = false
+		uni.hideLoading()
+  }
 }
 
 </script>

文件差异内容过多而无法显示
+ 1 - 1
pagesA/resumeAnalysis/testData.js


+ 2 - 4
pagesA/resumeOnline/index.vue

@@ -260,13 +260,11 @@ import {
 } from '@/api/resume'
 import { getText } from '@/utils/getText'
 import { getDict } from '@/hooks/useDictionaries'
-import { userStore } from '@/store/user'
 import { dealJobData } from './dict'
 import layoutPage from '@/layout'
 import { onShow } from '@dcloudio/uni-app'
 import { getUserAvatar } from '@/utils/avatar'
-
-const useUserStore = userStore()
+import { userStore } from '@/store/user'; const useUserStore = userStore()
 
 const baseInfo = ref({})
 const intention = ref([])
@@ -286,7 +284,7 @@ function handleToResumeAnalysis () {
 }
 
 // 获取基础信息
-function getBaseInfo () {
+async function getBaseInfo () {
   const { name, phone, ...obj } = useUserStore.baseInfo
   baseInfo.value = {
     ...obj,

部分文件因为文件数量过多而无法显示