Explorar o código

解析后弹窗入库

Xiao_123 hai 2 meses
pai
achega
659ea2e4a6

+ 5 - 3
src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

@@ -49,7 +49,7 @@
               >
                 <div class="flex items-center">
                   <el-checkbox v-model="val.checked" />
-                  <span class="ml-5px">{{ val.name }}</span>
+                  <span class="ml-5px">{{ val.name || `人才${index + 1}` }}</span>
                   <Icon icon="ep:view" class="ml-5px" /> 
                 </div>
               </el-tag>
@@ -201,9 +201,9 @@ const resetData = () => {
 
 // 打开弹窗
 const originParams = ref(null)
-const open = async (task_name) => {
+const open = async (task_name, data) => {
   try {
-    const res = await talentGatherApi.getTaskDetail(task_name)
+    const res = task_name ? await talentGatherApi.getTaskDetail(task_name) : data
     const { task_type, parse_result } = res
     const { results, summary, processed_time } = parse_result
     originParams.value = { summary, processed_time }
@@ -263,6 +263,8 @@ const handleStore = async () => {
   }
   // console.log(originData.value, 'store')
 
+  await message.confirm('是否对当前选中的人才进行入库?')
+
   const loading = ElLoading.service({
     lock: true,
     text: '正在保存中...',

+ 13 - 2
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -258,7 +258,7 @@ const handleStore = async (row) => {
 }
 
 // 任务解析
-const handleAnalysis = async ({ task_type, id, task_source }) => {
+const handleAnalysis = async ({ task_type, id, task_source, task_name }) => {
   if (!id) return
   await message.confirm('是否解析当前任务?')
 
@@ -278,9 +278,20 @@ const handleAnalysis = async ({ task_type, id, task_source }) => {
   // 招聘数据未返回,params.data设置为测试数据
   if (task_type === '招聘' && !params.data?.length) params.data = [{"id":"1843906600113389570","userId":"598525227328212992","name":"尹世丹","name_zh":"尹世丹"},{"id":"1942125259693166593","userId":"1942124499676893185","name":"陈梅","name_zh":"陈梅"}]
   try {
-    await talentGatherApi.taskAnalysis(params)
+    const { summary, results, processed_time } = await talentGatherApi.taskAnalysis(params)
     message.success('解析成功')
     getList()
+
+    const openData = {
+      task_type,
+      parse_result: {
+        summary,
+        results,
+        processed_time
+      }
+    }
+    StorePageRef.value.open('', openData)
+
   } finally {
     loading.close()
   }