|
@@ -22,9 +22,28 @@
|
|
</div>
|
|
</div>
|
|
<div style="font-size: 14px; color: var(--color-999);">只支持JPG、JPEG、PNG类型的图片,大小不超过20M</div>
|
|
<div style="font-size: 14px; color: var(--color-999);">只支持JPG、JPEG、PNG类型的图片,大小不超过20M</div>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #analysis>
|
|
|
|
+ <div style="text-align: right; width: 100%;">
|
|
|
|
+ <v-btn variant="text" color="primary" :loading="analyzeLoading" @click="handleImportAttachment">导入简历解析</v-btn>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</CtForm>
|
|
</CtForm>
|
|
</div>
|
|
</div>
|
|
<ImgCropper :visible="isShowCopper" :image="selectPic" :cropBoxResizable="true" @submit="handleHideCopper" :aspectRatio="1 / 1" @close="isShowCopper = false"></ImgCropper>
|
|
<ImgCropper :visible="isShowCopper" :image="selectPic" :cropBoxResizable="true" @submit="handleHideCopper" :aspectRatio="1 / 1" @close="isShowCopper = false"></ImgCropper>
|
|
|
|
+
|
|
|
|
+ <!-- 选择本地简历 -->
|
|
|
|
+ <CtDialog
|
|
|
|
+ :visible="openUploadDialog"
|
|
|
|
+ :widthType="2"
|
|
|
|
+ titleClass="text-h6"
|
|
|
|
+ @close="openUploadDialog = false"
|
|
|
|
+ title="附件简历上传"
|
|
|
|
+ @submit="uploadFileSubmit"
|
|
|
|
+ >
|
|
|
|
+ <uploadForm ref="uploadFormRef"></uploadForm>
|
|
|
|
+ <div class="color-warning" style="font-size: 14px;">提示:上传成功后将自动解析,导入解析简历尝试不得超过5次,请确认好简历后上传!</div>
|
|
|
|
+ </CtDialog>
|
|
|
|
+ <Loading :visible="analyzeLoading"></Loading>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -32,11 +51,18 @@ import { getDict } from '@/hooks/web/useDictionaries'
|
|
defineOptions({name: 'dialogExtend-InfoForm'})
|
|
defineOptions({name: 'dialogExtend-InfoForm'})
|
|
import { reactive, ref } from 'vue'
|
|
import { reactive, ref } from 'vue'
|
|
import { checkEmail } from '@/utils/validate'
|
|
import { checkEmail } from '@/utils/validate'
|
|
-import { enterpriseSearchByName } from '@/api/recruit/personal/resume'
|
|
|
|
|
|
+import {
|
|
|
|
+ resumeParser2,
|
|
|
|
+ getPersonResumeCv,
|
|
|
|
+ enterpriseSearchByName,
|
|
|
|
+ savePersonResumeCv
|
|
|
|
+} from '@/api/recruit/personal/resume'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
import { uploadFile } from '@/api/common'
|
|
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 { analyzeTestData } from './analyzeTestData.js'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
option: {
|
|
option: {
|
|
@@ -79,6 +105,9 @@ const items = ref({
|
|
value: '',
|
|
value: '',
|
|
flexStyle: 'align-center'
|
|
flexStyle: 'align-center'
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ slotName: 'analysis',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
key: 'name',
|
|
key: 'name',
|
|
@@ -254,6 +283,7 @@ const openFileInput = () => {
|
|
// 上传头像
|
|
// 上传头像
|
|
const accept = ['jpg', 'png', 'jpeg']
|
|
const accept = ['jpg', 'png', 'jpeg']
|
|
const handleUploadFile = async (e) => {
|
|
const handleUploadFile = async (e) => {
|
|
|
|
+ console.log('handleUploadFile:', e)
|
|
const file = e.target.files[0]
|
|
const file = e.target.files[0]
|
|
if (!file) return
|
|
if (!file) return
|
|
|
|
|
|
@@ -352,6 +382,40 @@ const getQuery = async () => {
|
|
return query
|
|
return query
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 填充
|
|
|
|
+const handleAnalyzeFill = (data) => {
|
|
|
|
+ const person = data?.person || null
|
|
|
|
+ if (!person && !Object.keys(person).length) return Snackbar.warning('无可用内容!')
|
|
|
|
+ if (person.enterpriseName) getEnterpriseData(person.enterpriseName)
|
|
|
|
+ items.value.options.forEach((e) => {
|
|
|
|
+ if (person[e.key]) e.value = person[e.key]
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const analyzeLoading = ref(false)
|
|
|
|
+const uploadFormRef = ref()
|
|
|
|
+const openUploadDialog = ref(false)
|
|
|
|
+// 上传附件-提交
|
|
|
|
+const uploadFileSubmit = async () => {
|
|
|
|
+ const obj = await uploadFormRef.value.getQuery()
|
|
|
|
+ if (!obj?.url || !obj?.title) return Snackbar.warning(t('resume.selectResumeToSubmit'))
|
|
|
|
+ const query = { title: obj.title, url: obj.url }
|
|
|
|
+ analyzeLoading.value = true
|
|
|
|
+ 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)
|
|
|
|
+ analyzeLoading.value = false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const handleImportAttachment = async () => {
|
|
|
|
+ const data = await getPersonResumeCv() // 获取附件
|
|
|
|
+ if (data?.length >= 5) return Snackbar.warning('导入解析简历尝试不得超过5次!')
|
|
|
|
+ openUploadDialog.value = true
|
|
|
|
+}
|
|
|
|
+
|
|
defineExpose({
|
|
defineExpose({
|
|
getQuery
|
|
getQuery
|
|
})
|
|
})
|
|
@@ -362,8 +426,9 @@ defineExpose({
|
|
width: 80px;
|
|
width: 80px;
|
|
position: relative;
|
|
position: relative;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
- margin: 32px;
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
|
+ // margin: 32px;
|
|
|
|
+ // margin-right: 40px;
|
|
|
|
+ margin: 0 40px 0 32px;
|
|
.img {
|
|
.img {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|