Forráskód Böngészése

人才采集:已解析的任务可查看详情

Xiao_123 2 hónapja
szülő
commit
a3ecafe656

+ 3 - 1
src/views/menduner/system/talentMap/components/FormPage.vue

@@ -5,6 +5,7 @@
       :model="formQuery"
       label-width="128px"
       v-loading="loading"
+      :disabled="readOnly"
     >
       <el-row>
         <div class="m-title">基础信息</div>
@@ -230,7 +231,8 @@ import { validatePhoneNumber } from '@/utils/formatter'
 const message = useMessage() // 消息弹窗
 const props = defineProps({
   itemData: Object,
-  formType: String
+  formType: String,
+  readOnly: { type: Boolean, default: false }
 })
 
 const loading = ref(false)

+ 11 - 6
src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

@@ -44,23 +44,23 @@
                 effect="plain"
                 v-for="(val, index) in tagList"
                 :key="val.name + index"
-                class="mr-10px cursor-pointer"
+                class="mr-10px cursor-pointer mb-10px"
                 @click="handleTagClick(index)"
               >
                 <div class="flex items-center">
-                  <el-checkbox v-model="val.checked" />
+                  <el-checkbox v-if="!readOnly" v-model="val.checked" />
                   <span class="ml-5px">{{ val.name || `人才${index + 1}` }}</span>
                   <Icon icon="ep:view" class="ml-5px" /> 
                 </div>
               </el-tag>
             </div>
-            <FormPage	ref="FormPageRef"	formType="create"	:itemData="itemData" />
+            <FormPage	ref="FormPageRef"	formType="create" :readOnly="readOnly"	:itemData="itemData" />
 					</el-tab-pane>
 				</el-tabs>
       </div>
     </div>
     <template #footer>
-      <el-button @click="handleStore" type="success">入 库</el-button>
+      <el-button v-if="!readOnly" @click="handleStore" type="success">入 库</el-button>
       <el-button @click="dialogVisible = false">取 消</el-button>
     </template>
   </Dialog>
@@ -200,7 +200,11 @@ const resetData = () => {
 }
 
 // 打开弹窗
-const open = async (task_type, parse_result) => {
+const id = ref(null)
+const readOnly = ref(false)
+const open = async (task_type, parse_result, task_id, isDetail) => {
+  readOnly.value = isDetail // 是否为查看详情
+  id.value = task_id
   const { results } = parse_result
   resetData()
   source.value = task_type
@@ -263,9 +267,10 @@ const handleStore = async () => {
   })
   try {
     const params = {
+      task_id: id.value,
       data: {
         results
-      },
+      }
     }
     await talentGatherApi.talentsAdd(JSON.stringify(params))
     message.success('入库成功!')

+ 7 - 11
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -43,6 +43,7 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true">
+      <el-table-column label="任务ID" align="center" prop="id" />
       <el-table-column label="任务名称" align="center" prop="task_name" />
       <el-table-column label="任务类型" align="center" prop="task_type" />
       <el-table-column label="任务状态" align="center" prop="task_status" />
@@ -56,6 +57,7 @@
             type="success"
             @click="handleAnalysis(scope.row)"
           >解析</el-button>
+          <el-button v-else type="warning" link @click="handleStore(scope.row, true)">详情</el-button>
           <el-button
             v-if="scope.row.task_status === '成功' && scope.row.parse_result"
             link
@@ -207,7 +209,7 @@ const taskType = [
   { label: '门墩儿招聘', value: '招聘' },
   { label: '杂项', value: '杂项' }
 ]
-const taskStatus = ['待解析', '成功']
+const taskStatus = ['待解析', '成功', '已入库']
 const itemData = ref({})
 
 const SearchRef = ref(null)
@@ -245,15 +247,9 @@ const handleWebAnalysis = (list) => {
 
 // 入库
 const StorePageRef = ref(null)
-const handleStore = async (row) => {
-  const { task_type, task_name, parse_result } = row
-  // const { results } = parse_result
-  // if (!results || !results.length) return message.warning('该任务无解析数据,无法入库')
-
-  // StorePageRef.value.open(task_type, results, { summary, processed_time })
-
-  // if (!row?.task_name) return message.warning('该任务无解析数据,无法入库')
-  StorePageRef.value.open(task_type, parse_result)
+const handleStore = ({ task_type, parse_result, id }, isDetail = false) => {
+  if (!parse_result) return message.warning(isDetail ? '暂无详情查看' : '暂无解析数据可入库')
+  StorePageRef.value.open(task_type, parse_result, id, isDetail)
 }
 
 // 任务解析
@@ -281,7 +277,7 @@ const handleAnalysis = async ({ task_type, id, task_source, task_name }) => {
     message.success('解析成功')
     getList()
 
-    StorePageRef.value.open(task_type, { results })
+    StorePageRef.value.open(task_type, { results }, id)
 
   } finally {
     loading.close()