|
@@ -80,6 +80,8 @@ import { cloneDeep } from 'lodash-es'
|
|
|
import { marked } from 'marked'
|
|
|
import data from './data.js'
|
|
|
import { timesTampChange, timestampToAge } from '@/utils/transform/date'
|
|
|
+import { talentGatherApi } from '@/api/menduner/system/talentMap/gather'
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
|
|
|
// 配置 marked
|
|
|
// marked.setOptions({
|
|
@@ -200,24 +202,37 @@ const resetData = () => {
|
|
|
}
|
|
|
|
|
|
// 打开弹窗
|
|
|
-const open = async (type, list) => {
|
|
|
- resetData()
|
|
|
- source.value = type
|
|
|
- const dataList = list.map(e => {
|
|
|
- if (source.value === '招聘') {
|
|
|
- return {
|
|
|
- ...e,
|
|
|
- data: e?.data?.normalized_data?.raw_data || {},
|
|
|
- checked: true
|
|
|
+const originParams = ref(null)
|
|
|
+const resultsParams = ref({})
|
|
|
+const open = async (task_name) => {
|
|
|
+ try {
|
|
|
+ const res = await talentGatherApi.getTaskDetail(task_name)
|
|
|
+ const { task_type, parse_result } = res
|
|
|
+ const { results, summary, processed_time } = parse_result
|
|
|
+ originParams.value = { summary, processed_time }
|
|
|
+
|
|
|
+ resetData()
|
|
|
+ source.value = task_type
|
|
|
+ const dataList = results.map(e => {
|
|
|
+ if (source.value === '招聘') {
|
|
|
+ return {
|
|
|
+ ...e,
|
|
|
+ data: e?.data?.normalized_data?.raw_data || {},
|
|
|
+ checked: true
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- return { ...e, checked: true }
|
|
|
- })
|
|
|
- originData.value = dataList
|
|
|
- tagList.value = cloneDeep(dataList)
|
|
|
- itemData.value = originData.value[0].data
|
|
|
- dealData(type, originData.value[0]) // 赋值左侧原始文件
|
|
|
- dialogVisible.value = true
|
|
|
+ return { ...e, checked: true }
|
|
|
+ })
|
|
|
+
|
|
|
+ originData.value = dataList
|
|
|
+ resultsParams.value = {...dataList[0], data: null}
|
|
|
+ tagList.value = cloneDeep(dataList)
|
|
|
+ itemData.value = originData.value[0].data
|
|
|
+ dealData(source.value, originData.value[0]) // 赋值左侧原始文件
|
|
|
+ dialogVisible.value = true
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
}
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
@@ -254,25 +269,37 @@ const handleStore = async () => {
|
|
|
}
|
|
|
console.log(originData.value, 'store')
|
|
|
|
|
|
- // const loading = ElLoading.service({
|
|
|
- // lock: true,
|
|
|
- // text: '正在保存中...',
|
|
|
- // background: 'rgba(0, 0, 0, 0.7)',
|
|
|
- // })
|
|
|
- // try {
|
|
|
- // message.success('新增成功')
|
|
|
- // dialogVisible.value = false
|
|
|
- // // 刷新列表
|
|
|
- // emit('refresh')
|
|
|
- // if (result.code === 202 || result.message.includes('疑似重复')) {
|
|
|
- // if (!result.data?.main_card?.id) return
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在保存中...',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
+ })
|
|
|
+ try {
|
|
|
+ const params = {
|
|
|
+ success: true,
|
|
|
+ message: '处理完成',
|
|
|
+ data: {
|
|
|
+ ...originParams.value,
|
|
|
+ results: [{
|
|
|
+ ...resultsParams.value,
|
|
|
+ data: { ...itemData.value }
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ }
|
|
|
+ await talentGatherApi.talentsAdd(JSON.stringify(params))
|
|
|
+ message.success('入库成功!')
|
|
|
+ dialogVisible.value = false
|
|
|
+ // 刷新列表
|
|
|
+ emit('refresh')
|
|
|
+ // 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()
|
|
|
- // }
|
|
|
+ // await message.confirm('发现与当前名片的疑似重复数据,去处理')
|
|
|
+ // mergeFormRef.value.open(result.data?.main_card?.id)
|
|
|
+ // }
|
|
|
+ } finally {
|
|
|
+ loading.close()
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|