2 次代码提交 aaca94a419 ... 17e5b09c23

作者 SHA1 备注 提交日期
  lifanagju_citu 17e5b09c23 Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner-admin into dev 2 月之前
  lifanagju_citu de853e37a7 tag联动 2 月之前
共有 1 个文件被更改,包括 14 次插入21 次删除
  1. 14 21
      src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

+ 14 - 21
src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

@@ -37,12 +37,12 @@
       <div class="flex-1">
 				<el-tabs type="border-card">
 					<el-tab-pane label="已解析人才列表">
-						<div class="tagBox mb-10px" v-if="tagList?.length">
+						<div class="tagBox mb-10px" v-if="originData?.length">
               <el-tag 
                 :type="index === tagCurrentIndex ? 'primary' : 'info'" 
                 size="large"
                 effect="plain"
-                v-for="(val, index) in tagList"
+                v-for="(val, index) in originData"
                 :key="val.data.name_zh + index"
                 class="mr-10px cursor-pointer"
                 @click="handleTagClick(val, index)"
@@ -92,7 +92,6 @@ const emit = defineEmits(['refresh'])
 const dialogVisible = ref(false)
 const FormPageRef = ref(null)
 const itemData = ref({})
-const tagList = ref([])
 const tagCurrentIndex = ref(0)
 const source = ref('')
 const originData = ref([])
@@ -172,7 +171,6 @@ const infoEcho = (data) => {
     created_at: data?.createTime ? timesTampChange(data.createTime, '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
   }
-  // if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(itemData.value)
 }
 
 // 重置
 const resetData = () => {
+  tagCurrentIndex.value = 0
   imgUrl.value = null
   fileUrl.value = null
   itemData.value = {}
-  tagList.value = []
+  originData.value = []
 }
 
 // 打开弹窗
 const originParams = ref(null)
-const resultsParams = ref({})
 const open = async (task_name) => {
   try {
     const res = await talentGatherApi.getTaskDetail(task_name)
@@ -221,12 +218,9 @@ const open = async (task_name) => {
       }
       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
-    dealData(source.value, originData.value[0]) // 赋值左侧原始文件
+    dealData(source.value, dataList[0]) // 赋值左侧原始文件
     dialogVisible.value = true
   } catch (error) {
     console.log(error)
@@ -244,25 +238,27 @@ const handleTagClick = (val, index) => {
 watch(() => FormPageRef.value?.formQuery, (newVal) => {
   if (tagCurrentIndex.value !== null && originData.value && originData.value.length > tagCurrentIndex.value) {
     // 保留原始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 })
 
 // 入库
 const handleStore = async () => {
   // 验证originData数组中每个人才的name_zh字段,并处理mobile字段
+  // const list = []
   if (originData.value && Array.isArray(originData.value) && originData.value.length > 0) {
     for (let i = 0; i < originData.value.length; 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}个人才中的中文姓名未填写,请完善后再进行保存`)
       }
       
       // 处理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')
@@ -278,10 +274,7 @@ const handleStore = async () => {
       message: '处理完成',
       data: {
         ...originParams.value,
-        results: [{
-          ...resultsParams.value,
-          data: { ...itemData.value }
-        }]
+        results: originData.value
       },
     }
     await talentGatherApi.talentsAdd(JSON.stringify(params))