|
@@ -37,12 +37,12 @@
|
|
<div class="flex-1">
|
|
<div class="flex-1">
|
|
<el-tabs type="border-card">
|
|
<el-tabs type="border-card">
|
|
<el-tab-pane label="已解析人才列表">
|
|
<el-tab-pane label="已解析人才列表">
|
|
- <div class="tagBox mb-10px" v-if="tagList?.length">
|
|
|
|
|
|
+ <div class="tagBox mb-10px" v-if="originData?.length">
|
|
<el-tag
|
|
<el-tag
|
|
:type="index === tagCurrentIndex ? 'primary' : 'info'"
|
|
:type="index === tagCurrentIndex ? 'primary' : 'info'"
|
|
size="large"
|
|
size="large"
|
|
effect="plain"
|
|
effect="plain"
|
|
- v-for="(val, index) in tagList"
|
|
|
|
|
|
+ v-for="(val, index) in originData"
|
|
:key="val.data.name_zh + index"
|
|
:key="val.data.name_zh + index"
|
|
class="mr-10px cursor-pointer"
|
|
class="mr-10px cursor-pointer"
|
|
@click="handleTagClick(val, index)"
|
|
@click="handleTagClick(val, index)"
|
|
@@ -92,7 +92,6 @@ const emit = defineEmits(['refresh'])
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
const FormPageRef = ref(null)
|
|
const FormPageRef = ref(null)
|
|
const itemData = ref({})
|
|
const itemData = ref({})
|
|
-const tagList = ref([])
|
|
|
|
const tagCurrentIndex = ref(0)
|
|
const tagCurrentIndex = ref(0)
|
|
const source = ref('')
|
|
const source = ref('')
|
|
const originData = ref([])
|
|
const originData = ref([])
|
|
@@ -172,7 +171,6 @@ const infoEcho = (data) => {
|
|
created_at: data?.createTime ? timesTampChange(data.createTime, 'Y-M-D') : null,
|
|
created_at: data?.createTime ? timesTampChange(data.createTime, 'Y-M-D') : null,
|
|
updated_at: data?.updateTime ? timesTampChange(data.updateTime, 'Y-M-D') : null,
|
|
updated_at: data?.updateTime ? timesTampChange(data.updateTime, 'Y-M-D') : null,
|
|
}
|
|
}
|
|
- // if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(itemData.value)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 门墩儿招聘人才工作经历回显赋值
|
|
// 门墩儿招聘人才工作经历回显赋值
|
|
@@ -188,20 +186,19 @@ const expEcho = (workList) => {
|
|
}
|
|
}
|
|
}) : null
|
|
}) : null
|
|
}
|
|
}
|
|
- // if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(itemData.value)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 重置
|
|
// 重置
|
|
const resetData = () => {
|
|
const resetData = () => {
|
|
|
|
+ tagCurrentIndex.value = 0
|
|
imgUrl.value = null
|
|
imgUrl.value = null
|
|
fileUrl.value = null
|
|
fileUrl.value = null
|
|
itemData.value = {}
|
|
itemData.value = {}
|
|
- tagList.value = []
|
|
|
|
|
|
+ originData.value = []
|
|
}
|
|
}
|
|
|
|
|
|
// 打开弹窗
|
|
// 打开弹窗
|
|
const originParams = ref(null)
|
|
const originParams = ref(null)
|
|
-const resultsParams = ref({})
|
|
|
|
const open = async (task_name) => {
|
|
const open = async (task_name) => {
|
|
try {
|
|
try {
|
|
const res = await talentGatherApi.getTaskDetail(task_name)
|
|
const res = await talentGatherApi.getTaskDetail(task_name)
|
|
@@ -221,12 +218,9 @@ const open = async (task_name) => {
|
|
}
|
|
}
|
|
return { ...e, checked: true }
|
|
return { ...e, checked: true }
|
|
})
|
|
})
|
|
-
|
|
|
|
- originData.value = dataList
|
|
|
|
- resultsParams.value = {...dataList[0], data: null}
|
|
|
|
- tagList.value = cloneDeep(dataList)
|
|
|
|
|
|
+ originData.value = cloneDeep(dataList)
|
|
itemData.value = originData.value[0].data
|
|
itemData.value = originData.value[0].data
|
|
- dealData(source.value, originData.value[0]) // 赋值左侧原始文件
|
|
|
|
|
|
+ dealData(source.value, dataList[0]) // 赋值左侧原始文件
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error)
|
|
console.log(error)
|
|
@@ -244,25 +238,27 @@ const handleTagClick = (val, index) => {
|
|
watch(() => FormPageRef.value?.formQuery, (newVal) => {
|
|
watch(() => FormPageRef.value?.formQuery, (newVal) => {
|
|
if (tagCurrentIndex.value !== null && originData.value && originData.value.length > tagCurrentIndex.value) {
|
|
if (tagCurrentIndex.value !== null && originData.value && originData.value.length > tagCurrentIndex.value) {
|
|
// 保留原始pic_url
|
|
// 保留原始pic_url
|
|
- const { pic_url } = originData.value[tagCurrentIndex.value]
|
|
|
|
- originData.value[tagCurrentIndex.value] = { ...newVal }
|
|
|
|
|
|
+ // const { pic_url } = originData.value[tagCurrentIndex.value]
|
|
|
|
+ originData.value[tagCurrentIndex.value].data = { ...newVal }
|
|
}
|
|
}
|
|
}, { deep: true })
|
|
}, { deep: true })
|
|
|
|
|
|
// 入库
|
|
// 入库
|
|
const handleStore = async () => {
|
|
const handleStore = async () => {
|
|
// 验证originData数组中每个人才的name_zh字段,并处理mobile字段
|
|
// 验证originData数组中每个人才的name_zh字段,并处理mobile字段
|
|
|
|
+ // const list = []
|
|
if (originData.value && Array.isArray(originData.value) && originData.value.length > 0) {
|
|
if (originData.value && Array.isArray(originData.value) && originData.value.length > 0) {
|
|
for (let i = 0; i < originData.value.length; i++) {
|
|
for (let i = 0; i < originData.value.length; i++) {
|
|
const talent = originData.value[i]
|
|
const talent = originData.value[i]
|
|
- if (!talent.name_zh || talent.name_zh.trim() === '') {
|
|
|
|
|
|
+ if (!talent.data.name_zh || talent.data.name_zh.trim() === '') {
|
|
return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
|
|
return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
|
|
}
|
|
}
|
|
|
|
|
|
// 处理mobile字段,如果是数组则转换为字符串
|
|
// 处理mobile字段,如果是数组则转换为字符串
|
|
- if (Array.isArray(talent.mobile)) {
|
|
|
|
- talent.mobile = talent.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
|
|
|
+ if (Array.isArray(talent.data.mobile)) {
|
|
|
|
+ talent.data.mobile = talent.data.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
}
|
|
}
|
|
|
|
+ // list.push()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
console.log(originData.value, 'store')
|
|
console.log(originData.value, 'store')
|
|
@@ -278,10 +274,7 @@ const handleStore = async () => {
|
|
message: '处理完成',
|
|
message: '处理完成',
|
|
data: {
|
|
data: {
|
|
...originParams.value,
|
|
...originParams.value,
|
|
- results: [{
|
|
|
|
- ...resultsParams.value,
|
|
|
|
- data: { ...itemData.value }
|
|
|
|
- }]
|
|
|
|
|
|
+ results: originData.value
|
|
},
|
|
},
|
|
}
|
|
}
|
|
await talentGatherApi.talentsAdd(JSON.stringify(params))
|
|
await talentGatherApi.talentsAdd(JSON.stringify(params))
|