Bläddra i källkod

任务解析接口

Xiao_123 3 dagar sedan
förälder
incheckning
85f85fa741

+ 9 - 0
src/api/menduner/system/talentMap/gather.ts

@@ -26,5 +26,14 @@ export const talentGatherApi = {
 			url: `/api/parse/get-parse-task-detail?task_name=${task_name}`,
 			baseURL: import.meta.env.VITE_BASE_URL
 		})
+	},
+
+	// 任务解析
+	taskAnalysis: async (data: any) => {
+		return await request.post({
+			url: '/api/parse/execute_parse_task',
+			data,
+			baseURL: import.meta.env.VITE_BASE_URL
+		})
 	}
 }

+ 23 - 3
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -52,9 +52,9 @@
             v-if="scope.row.task_status === '待解析'"
             link
             type="success"
+            @click="handleAnalysis(scope.row)"
           >解析</el-button>
           <el-button
-            v-if="scope.row.parse_result"
             link
             type="primary"
             @click="handleStore(scope.row)"
@@ -242,8 +242,28 @@ const handleWebAnalysis = (list) => {
 
 // 入库
 const StorePageRef = ref(null)
-const handleStore = (row) => {
-  StorePageRef.value.open(row)
+const handleStore = async (row) => {
+  // StorePageRef.value.open(row)
+  const data = await talentGatherApi.getTaskDetail(row.task_name)
+  console.log(data, '任务详情')
+}
+
+// 任务解析
+const handleAnalysis = async ({ task_type, id, task_source }) => {
+  if (!id) return
+  const params = {
+    task_type,
+    id,
+    data: task_source.minio_paths_json
+  }
+  if (task_type === '杂项') params.process_type = 'table'
+  if (task_type === '新任命') params.publish_time = '2025-07-17'
+  try {
+    await message.confirm('是否解析当前任务?')
+    await talentGatherApi.taskAnalysis(params)
+    message.success('操作成功,任务解析中')
+    getList()
+  } finally {}
 }
 
 // 关闭上传弹窗