|
@@ -39,7 +39,7 @@
|
|
|
<el-table-column label="创建日期" align="center" prop="created_at" :formatter="dateFormatter" />
|
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="110">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <!-- <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button> -->
|
|
|
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
|
|
<el-button link :type="scope.row.status === 'active' ? 'warning': 'success'" @click="handleDisable(scope.row)">
|
|
|
{{ scope.row.status === 'active' ? '禁用' : '启用'}}
|
|
@@ -215,10 +215,10 @@
|
|
|
</template>
|
|
|
<!-- 网页解析 -->
|
|
|
<template v-if="radioValue === 'web'">
|
|
|
+ <!-- :markDownData="markDownData" -->
|
|
|
<webAnalysis
|
|
|
v-if="showWebAnalysis"
|
|
|
- :markDownData="markDownData"
|
|
|
- @analysis="val => tagList = val"
|
|
|
+ @analysis="handleWebAnalysis"
|
|
|
@reset="handleWebClear(), showFormPage = false, formData = {}"
|
|
|
/>
|
|
|
</template>
|
|
@@ -230,11 +230,11 @@
|
|
|
round
|
|
|
size="large"
|
|
|
v-for="(val, index) in tagList"
|
|
|
- :key="index + val.name_zh"
|
|
|
+ :key="index + val"
|
|
|
class="mr-10px cursor-pointer mb-10px"
|
|
|
- @click="handleTagClick(val, index)"
|
|
|
+ @click="handleTagClick(index)"
|
|
|
>
|
|
|
- {{ val.name_zh }}
|
|
|
+ {{ val }}
|
|
|
<Icon v-if="index === tagCurrentIndex" icon="ep:check" class="ml-5px" />
|
|
|
</el-tag>
|
|
|
</div>
|
|
@@ -243,12 +243,12 @@
|
|
|
ref="FormPageRef"
|
|
|
:formType="analysisType"
|
|
|
:itemData="formData"
|
|
|
- />
|
|
|
+ />
|
|
|
<div v-if="tagList?.length && !tagCurrentIndex" class="!h-100% flex items-center justify-center">请点击上方人才姓名进行查看编辑</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
- <el-button @click="handleSave" type="success" :loading="formLoading">保 存</el-button>
|
|
|
+ <el-button @click="handleSave" type="success">保 存</el-button>
|
|
|
<el-button @click="dialog_analysisInfo = false, handleWebClear">取 消</el-button>
|
|
|
</template>
|
|
|
</Dialog>
|
|
@@ -275,6 +275,8 @@ import { Base64 } from 'js-base64'
|
|
|
import Info from '@/views/menduner/system/person/details/components/info.vue'
|
|
|
import expExtend from '@/views/menduner/system/person/details/components/expExtend.vue'
|
|
|
import Attachment from '@/views/menduner/system/person/details/components/attachment.vue'
|
|
|
+import { talentWebParsingApi } from '@/api/menduner/system/talentMap/webParsing'
|
|
|
+import { ElLoading } from 'element-plus'
|
|
|
|
|
|
const baseUrl = import.meta.env.VITE_PREVIEW_URL
|
|
|
const { uploadUrl, httpRequest } = useUpload()
|
|
@@ -332,28 +334,45 @@ const handleDelete = async (id) => {
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
-// 网页解析
|
|
|
+// 网页解析-人才标签点击
|
|
|
+// const markDownData = ref({})
|
|
|
+const handleTagClick = (index) => {
|
|
|
+ if (!webOriginList.value?.[index]) return
|
|
|
+ tagCurrentIndex.value = index
|
|
|
+ const obj = webOriginList.value[index]
|
|
|
+ formData.value = obj ?? {}
|
|
|
+ // markDownData.value = {
|
|
|
+ // name_zh: obj.name_zh,
|
|
|
+ // name_en: obj.name_en,
|
|
|
+ // hotel_zh: obj.hotel_zh,
|
|
|
+ // title_zh: obj.title_zh,
|
|
|
+ // pic_url: obj.pic_url,
|
|
|
+ // detailIntroduction: ''
|
|
|
+ // }
|
|
|
+ if (!showFormPage.value) showFormPage.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// 网页解析-信息提取
|
|
|
const tagCurrentIndex = ref(null)
|
|
|
const tagList = ref([])
|
|
|
-const markDownData = ref({})
|
|
|
-const handleTagClick = (val, index) => {
|
|
|
- tagCurrentIndex.value = index
|
|
|
- formData.value = val
|
|
|
- markDownData.value = {
|
|
|
- name_zh: val.name_zh,
|
|
|
- name_en: val.name_en,
|
|
|
- hotel_zh: val.hotel_zh,
|
|
|
- title_zh: val.title_zh,
|
|
|
- pic_url: val.pic_url,
|
|
|
- detailIntroduction: ''
|
|
|
+const originMarkdown = ref(null)
|
|
|
+const webOriginList = ref([])
|
|
|
+const handleWebAnalysis = (list, md) => {
|
|
|
+ webOriginList.value = list
|
|
|
+ tagList.value = list.map(e => e.name_zh)
|
|
|
+ originMarkdown.value = md
|
|
|
+ // 只有单个人才时默认选中
|
|
|
+ if (list?.length === 1) {
|
|
|
+ handleTagClick(0)
|
|
|
}
|
|
|
- if (!showFormPage.value) showFormPage.value = true
|
|
|
}
|
|
|
|
|
|
const handleWebClear = () => {
|
|
|
tagCurrentIndex.value = null
|
|
|
- markDownData.value = {}
|
|
|
+ originMarkdown.value = null
|
|
|
+ // markDownData.value = {}
|
|
|
tagList.value = []
|
|
|
+ webOriginList.value = []
|
|
|
}
|
|
|
|
|
|
/** 编辑 */
|
|
@@ -403,12 +422,67 @@ const handleDisable = async (item) => {
|
|
|
// 更新
|
|
|
const activeName = ref('info')
|
|
|
const dialog_analysisInfo = ref(false)
|
|
|
-const formLoading = ref(false)
|
|
|
const analysisType = ref('')
|
|
|
const showFormPage = ref(true)
|
|
|
const FormPageRef = ref(null)
|
|
|
const mergeFormRef = ref() // 合并表单 Ref
|
|
|
+
|
|
|
+const handleSaveWebData = async () => {
|
|
|
+ if (!webOriginList.value || !webOriginList.value?.length) {
|
|
|
+ message.warning('请输入微信公众号链接解析并提取信息核对后再提交保存')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!FormPageRef.value) return message.warning('请点击右侧顶部的人才标签查看核对信息后保存')
|
|
|
+
|
|
|
+ // 验证webOriginList数组中每个人才的name_zh字段,并处理mobile字段
|
|
|
+ if (webOriginList.value && Array.isArray(webOriginList.value) && webOriginList.value.length > 0) {
|
|
|
+ for (let i = 0; i < webOriginList.value.length; i++) {
|
|
|
+ const talent = webOriginList.value[i]
|
|
|
+ if (!talent.name_zh || talent.name_zh.trim() === '') {
|
|
|
+ return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理mobile字段,如果是数组则转换为字符串
|
|
|
+ if (Array.isArray(talent.mobile)) {
|
|
|
+ talent.mobile = talent.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(webOriginList.value, '网页解析-新增')
|
|
|
+
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在保存中...',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
+ })
|
|
|
+ try {
|
|
|
+ const result = await talentWebParsingApi.webParsingTalentCreate({
|
|
|
+ talent_list: webOriginList.value,
|
|
|
+ web_md: originMarkdown.value
|
|
|
+ })
|
|
|
+ console.log(result, 'create-result')
|
|
|
+ message.success('新增成功')
|
|
|
+ dialog_analysisInfo.value = false
|
|
|
+ // 刷新列表
|
|
|
+ getList()
|
|
|
+ if (result.code === 202 || result.message.includes('疑似重复')) {
|
|
|
+ if (!result.data?.main_card?.id) return
|
|
|
+
|
|
|
+ await message.confirm('发现与当前名片的疑似重复数据,去处理')
|
|
|
+ mergeFormRef.value.open(result.data?.main_card?.id)
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
+ loading.close()
|
|
|
+ handleWebClear()
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
const handleSave = async () => {
|
|
|
+ // 网页解析新增调用单独的接口保存
|
|
|
+ if (analysisType.value === 'create' && radioValue.value === 'web') return handleSaveWebData()
|
|
|
+
|
|
|
if (!FormPageRef.value) return message.warning('请将表单信息完善后再提交')
|
|
|
|
|
|
const params = { ...FormPageRef.value.formQuery, type: radioValue.value }
|
|
@@ -419,9 +493,12 @@ const handleSave = async () => {
|
|
|
params.mobile = params.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
}
|
|
|
|
|
|
- console.log(params, 'handleSubmit')
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在保存中...',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
+ })
|
|
|
try {
|
|
|
- formLoading.value = true
|
|
|
let result = {}
|
|
|
|
|
|
if (analysisType.value === 'create') {
|
|
@@ -454,7 +531,7 @@ const handleSave = async () => {
|
|
|
console.log('更新失败', error)
|
|
|
} finally {
|
|
|
cardFileQuery.value = null
|
|
|
- formLoading.value = false
|
|
|
+ loading.close()
|
|
|
openSearch.value = false
|
|
|
handleWebClear()
|
|
|
}
|
|
@@ -503,6 +580,15 @@ const handleAnalysis = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 监听表单变化,同步更新tagList中对应的数据
|
|
|
+watch(() => FormPageRef.value?.formQuery, (newVal) => {
|
|
|
+ if (tagCurrentIndex.value !== null && webOriginList.value && webOriginList.value.length > tagCurrentIndex.value) {
|
|
|
+ // 保留原始pic_url
|
|
|
+ const { pic_url } = webOriginList.value[tagCurrentIndex.value]
|
|
|
+ webOriginList.value[tagCurrentIndex.value] = { ...newVal, pic_url }
|
|
|
+ }
|
|
|
+}, { deep: true })
|
|
|
+
|
|
|
// 简历解析
|
|
|
const fileUrl = ref('') // https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf
|
|
|
const uploadRef = ref()
|