Jelajahi Sumber

门墩招聘参数对齐

lifanagju_citu 2 bulan lalu
induk
melakukan
8bf6738925

+ 1 - 1
src/views/menduner/system/person/details/components/expExtend.vue

@@ -78,7 +78,7 @@ const getExpList = async () => {
   try {
     const data = await PersonInfoApi.getPersonExpPage(queryParams)
     list.value = data.list?.length ? deal(data.list) : []
-    emit('echo', JSON.stringify(list.value))
+    emit('echo', list.value)
     
     total.value = data.total
   } finally {

+ 0 - 351
src/views/menduner/system/talentMap/maintenance/gather/components/index_split.vue

@@ -1,351 +0,0 @@
-<!-- 备份文件 -->
-<template>
-  <ContentWrap>
-    <!-- 搜索工作栏 -->
-    <el-form
-      class="-mb-15px"
-      :model="queryParams"
-      ref="queryFormRef"
-      :inline="true"
-      label-width="68px"
-    >
-      <el-form-item label="名称" prop="name">
-        <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" class="!w-180px" />
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="handleQuery('search')"><Icon icon="ep:search" /> 搜索</el-button>
-        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
-        <el-button type="primary" plain @click="handleAdd">
-          <Icon icon="ep:plus" class="mr-5px" /> 新增人才
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
-
-  <!-- 列表 -->
-  <ContentWrap>
-    <el-table v-loading="loading" :data="list" :stripe="true">
-      <el-table-column label="中文名称" align="center" prop="name_zh" fixed="left" />
-      <el-table-column label="英文名称" align="center" prop="name_en" />
-      <el-table-column label="职位" align="center" prop="title_zh" />
-      <el-table-column label="酒店/公司" align="center" prop="hotel_zh" />
-      <el-table-column label="手机号码" align="center" prop="mobile" />
-      <el-table-column label="固定电话" align="center" prop="phone" />
-      <el-table-column label="状态" align="center" prop="status" width="80">
-        <template #default="scope">
-          <el-tag type="success" v-if="scope.row.status === 'active'">已启用</el-tag>
-          <el-tag type="danger" v-else>已禁用</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="created_at" :formatter="dateFormatter" />
-      <el-table-column label="操作" align="center" fixed="right" min-width="110">
-        <template #default="scope">
-          <el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-          <el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
-          <el-button link :type="scope.row.status === 'active' ? 'warning': 'success'" @click="handleDisable(scope.row)">
-            {{ scope.row.status === 'active' ? '禁用' : '启用'}}
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <!-- 选择来源 -->
-    <Dialog title="解析方式" v-model="selectDialog" width="500" @close="selectDialog = false">
-			<el-radio-group v-model="radioValue" size="large" class="radioBox">
-				<el-radio
-					v-for="item in radioList"
-					:key="item.value"
-					:value="item.value"
-				>
-					{{ item.label }}
-				</el-radio>
-			</el-radio-group>
-      <template #footer>
-        <el-button type="primary" @click="handleSelect">确 认</el-button>
-        <el-button @click="null">取 消</el-button>
-      </template>
-    </Dialog>
-
-    <!-- 解析文件上传 -->
-    <Dialog :title="radioObject[radioValue]" v-model="dialog_upload" :width="DialogWidth" @close="handleCancel">
-      <div>
-        <!-- 门墩儿人才库 -->
-        <!-- <template v-if="radioValue === 'menduner'"></template> -->
-        <!-- 简历解析 -->
-        <template v-if="radioValue === 'file'">
-          <el-upload
-            ref="uploadRef"
-            v-model:file-list="fileList"
-            :action="uploadUrl"
-            :auto-upload="false"
-            :data="data"
-            :limit="1"
-            :on-change="handleChange"
-            :on-error="submitFormError"
-            :on-exceed="handleExceed"
-            :on-success="submitFormSuccess"
-            :http-request="httpRequest"
-            accept=".pdf, doc, .docx"
-            drag
-            class="flex-1"
-          >
-            <i class="el-icon-upload"></i>
-            <div class="el-upload__text">上传附件, 将文件拖到此处,或 <em>点击上传</em></div>
-            <template #tip>
-              <div class="el-upload__tip color-red">
-                提示:仅允许导入 pdf、doc、docx 格式文件!
-              </div>
-            </template>
-          </el-upload>
-        </template>
-        <!-- 名片解析 -->
-        <template v-if="radioValue === 'card'">
-          <UploadImg
-            v-model="cardImgUrl"
-            :limit="1"
-            :uploadSuccessTip="false"
-            @handle-change="cardUploadChange"
-            height="150px" width="150px" style="margin: 20px auto; width: 150px;"
-          >
-            <template #tip>{{ cardImgUrl ? '' : '请上传名片' }}</template>
-          </UploadImg>
-        </template>
-        <!-- 网页解析 -->
-        <!-- <template v-if="radioValue === 'web'"></template> -->
-      </div>
-      <template #footer>
-        <el-button @click="handleAnalysis" type="success" :disabled="analysisLoading" :loading="analysisLoading">解 析</el-button>
-        <el-button @click="handleCancel">取 消</el-button>
-      </template>
-    </Dialog>
-  </ContentWrap>
-</template>
-
-<script setup>
-defineOptions({ name: 'TalentMapStoreIndex' })
-import { dateFormatter } from '@/utils/formatTime'
-import { talentLabelingApi } from '@/api/menduner/system/talentMap/labeling'
-import { TalentMap } from '@/api/menduner/system/talentMap'
-import MergeForm from '@/views/menduner/system/talentMap/components/merge.vue'
-import FormPage from '@/views/menduner/system/talentMap/components/FormPage.vue'
-import { timesTampChange, timestampToAge } from '@/utils/transform/date'
-import Search from './search.vue'
-import { useUpload } from '@/components/UploadFile/src/useUpload'
-import { commonApi } from '@/api/menduner/common'
-import { Base64 } from 'js-base64'
-
-const baseUrl = import.meta.env.VITE_PREVIEW_URL
-const { uploadUrl, httpRequest } = useUpload()
-const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
-const { push } = useRouter()
-
-const loading = ref(false) // 列表的加载中
-const list = ref([]) // 列表的数据
-const total = ref(0) // 列表的总页数
-const queryParams = reactive({
-  name: undefined
-})
-const queryFormRef = ref() // 搜索的表单
-const dialog_upload = ref(false)
-
-/** 查询列表 */
-const getList = async () => {
-  loading.value = true
-  try {
-    list.value = []
-    const data = await talentLabelingApi.getCardList()
-    list.value = data ? data.reverse() : []
-  } finally {
-    loading.value = false
-  }
-}
-
-/** 搜索按钮操作 */
-const handleQuery = (type) => {
-  if (type !== 'reset') {
-    message.warning('搜索正在建设中...')
-    return
-  }
-  getList()
-}
-
-/** 重置按钮操作 */
-const resetQuery = () => {
-  queryFormRef.value.resetFields()
-  handleQuery('reset')
-}
-
-/** 删除按钮操作 */
-const handleDelete = async (id) => {
-  try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await talentLabelingApi.deleteBusinessCard(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    setTimeout(async () => {
-      await getList()
-    }, 0)
-  } catch {}
-}
-
-/** 禁用按钮操作 */
-const handleDisable = async (item) => {
-  if (!item?.id) return message.warning('操作失败,请稍后再试')
-  try {
-    // 禁用的二次确认
-    const status = item.status === 'active' ? 'inactive' : 'active'
-    const text = status === 'inactive' ? '禁用' : '启用'
-    
-    await message.delConfirm(`是否${text}该名片?`)
-    // 发起禁用
-    await talentLabelingApi.updateBusinessCardStatus({
-      status,
-    }, item.id)
-    message.success(`${text}成功`)
-    // 刷新列表
-    await getList()
-  } catch {}
-}
-
-/** 编辑 */
-const handleEdit = async (item) => {
-  if (!item?.id) return message.warning('查询数据失败!')
-  push({ name: 'TalentMapGatherDetails', params: { id: item.id }, query: { item: JSON.stringify(item) }  })
-}
-
-// 解析中
-const analysisLoading = ref(false)
-const handleAnalysis = async () => {
-  // 开始解析
-  analysisLoading.value = true
-  cardFileQuery.value = null
-	const type = radioValue.value
-  const query = { type }
-  try {
-    if (type === 'file') { // 简历解析
-      if (!fileUrl.value) {
-        message.warning('获取文件失败,请重新上传!')
-        return 
-      }
-      const data = await commonApi.resumeParser({ fileUrl: fileUrl.value })
-      query.fileUrl = encodeURIComponent(fileUrl.value)
-      query.data = JSON.stringify({ person: data })
-    }
-    if (type === 'card') { // 名片解析
-      if (!cardImgUrl.value) {
-        message.warning('请先上传名片!')
-        return
-      }
-      query.cardImgUrl = encodeURIComponent(cardImgUrl.value)
-      cardFileQuery.value = new FormData()
-      cardFileQuery.value.append('image', cardUploadRow.value)
-      message.warning('正在解析...')
-  
-      const index = createAnalysisNum.value
-      const res = await talentLabelingApi.businessCardParse(cardFileQuery.value)
-      if (index !== createAnalysisNum.value || !dialog_upload.value) return // 不是最新的名片解析数据(用户在解析完成前已重新上传)或用户已取消解析
-      query.data = JSON.stringify(res?.data || res)
-      message.success('名片解析成功')
-    }
-    dialog_upload.value = false
-    push({ name: 'TalentMapGatherDetails', params: { id: 'add' }, query })
-  } catch (error) {
-    console.log('解析失败', error)
-    cardFileQuery.value = null
-  } finally {
-    analysisLoading.value = false
-  }
-}
-
-// 简历解析
-const fileUrl = ref('') // https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf
-const uploadRef = ref()
-const fileList = ref([])
-const data = ref({ path: '' })
-// 文件上传
-const handleChange = async (file) => {
-  data.value.path = file.name
-  unref(uploadRef)?.submit()
-  if (!fileList.value.length) return
-
-  const url = fileList.value[0].response.data
-  fileUrl.value = !url.includes('.pdf') ?  `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(url))}` : url
-}
-const submitFormError = () => {
-  message.error('上传失败,请您重新上传!')
-}
-const handleExceed = () => {
-  message.error('最多只能上传一个文件!')
-}
-const submitFormSuccess = (e) => {
-  // 清理
-  // unref(uploadRef)?.clearFiles()
-}
-
-// 名片解析 
-const createAnalysisNum = ref(0)
-const cardFileQuery = ref(null)
-const cardUploadRow = ref(null)
-const cardImgUrl = ref(null)
-const cardUploadChange = (raw) => {
-  cardUploadRow.value = raw
-}
-
-const DialogWidth = ref('500')
-// 选择解析方式
-const handleSelect = () => {
-  selectDialog.value = false
-	const type = radioValue.value
-  if (type === 'card') {
-    createAnalysisNum.value++
-  }
-  if (type === 'menduner' || type === 'web') {
-    push({ name: 'TalentMapGatherDetails', params: { id: 'add' }, query: { type }  })
-    return
-  }
-  dialog_upload.value = true
-}
-
-// 关闭上传弹窗
-const handleCancel = () => {
-  dialog_upload.value = false
-  analysisLoading.value = false
-}
-
-const selectDialog = ref(false)
-const radioObject = { card: '名片解析', file: '简历解析', web: '网页解析', menduner: '门墩儿人才库(普通新增)' }
-const radioList = ref(Object.keys(radioObject).map(key => ({ value: key, label: radioObject[key]}) ))
-const defaultValue = radioList.value[0].value // 默认选中
-const radioValue = ref(defaultValue)
-// 新增解析
-const handleAdd = () => {
-  cardUploadRow.value = null
-  cardImgUrl.value = null
-  analysisLoading.value = false
-  radioValue.value = defaultValue // 重置解析类型
-	// 
-  selectDialog.value = true
-}
-
-/** 初始化 **/
-onMounted(() => {
-  getList()
-})
-
-</script>
-
-<style lang="scss" scoped>
-.radioBox {
-	margin: 40px 0;
-}
-
-:deep(.drawer) {
-  position: absolute;
-  .el-drawer {
-    background-color: aliceblue;
-  }
-}
-</style>

+ 7 - 2
src/views/menduner/system/talentMap/maintenance/gather/components/personCard.vue

@@ -30,7 +30,7 @@
     </div>
     <!-- 工作经验 -->
     <!-- <expExtend :data="info?.workExpList" /> -->
-    <expExtend :user-id="info?.userId" />
+    <expExtend :user-id="info?.userId" @echo="expEcho" />
     <div class="button">
       <el-button type="success" plain @click="personClick">{{ props.detailButTxt || '加入人才地图' }}</el-button>
     </div>
@@ -51,8 +51,13 @@ const props = defineProps({
 
 const info = ref(props?.data)
 
+let expData = []
+const expEcho = (data) => {
+  expData = data
+}
+
 const personClick = () => {
- emit('detail', info.value)
+ emit('detail', info.value, expData)
 }
 
 </script>

+ 29 - 5
src/views/menduner/system/talentMap/maintenance/gather/components/search.vue

@@ -96,7 +96,7 @@
   <ContentWrap v-if="addList?.length">
     <span style="color: #666;">已选择: </span>
     <el-tag v-for="(i, index) in addList" :key="i.id" closable type="success" style="margin: 5px 10px 5px 0;" @close="delAddTag(index)">
-      {{ i.name }}
+      {{ i.name_zh }}
     </el-tag>
   </ContentWrap>
 
@@ -136,8 +136,8 @@ import { PersonInfoApi } from '@/api/menduner/system/person'
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 import personCard from './personCard.vue'
 import { getDict } from '@/hooks/web/useDictionaries'
+import { timesTampChange, timestampToAge } from '@/utils/transform/date'
 
-const emit = defineEmits(['detail'])
 const props = defineProps({
   paramsVerify: Boolean, // 查询条件必传
   searchName: String
@@ -223,8 +223,32 @@ const resetQuery = () => {
   handleQuery()
 }
 
+const getTypicalData = (row, expData) => {
+  return {
+    id: row.id,
+    userId: row.userId,
+    name_zh: row.name,
+    data: {
+      name_zh: row?.name || '',
+      email: row?.email || '',
+      mobile: row?.phone || '',
+      birthday: row?.birthday ? timesTampChange(row.birthday, 'Y-M-D') : '',
+      age: row?.birthday ? timestampToAge(row.birthday) : null,
+      created_at: row?.createTime ? timesTampChange(row.createTime, 'Y-M-D') : null,
+      updated_at: row?.updateTime ? timesTampChange(row.updateTime, 'Y-M-D') : null,
+      career_path: expData ? expData.map(e => {
+        return {
+          hotel_zh: e?.enterpriseName || null,
+          title_zh: e?.positionName || null,
+          date: e?.startTime ? timesTampChange(e.startTime, 'Y-M-D') : null
+        }
+      }) : null
+    }
+  }
+}
+
 const addList = ref([])
-const detail = (row) => {
+const detail = (row, expData) => {
   if (!row?.id || !row?.userId) {
     message.warning('添加失败 !')
     return
@@ -233,9 +257,9 @@ const detail = (row) => {
     message.warning('已经被添加,请勿重复添加 !')
     return
   }
-  addList.value.push({ id: row.id, userId: row.userId, name: row.name, name_zh: row.name })
+
+  addList.value.push(getTypicalData(row, expData))
   message.success('已添加到选择列表!')
-  // emit('detail', { id: row.id, userId: row.userId, name: row.name })
 }
 const delAddTag = (index) => {
   addList.value.splice(index, 1)

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

@@ -48,7 +48,7 @@
                 @click="handleTagClick(index)"
               >
                 <div class="flex items-center">
-                  <el-checkbox v-if="!readOnly" v-model="val.checked" />
+                  <el-checkbox v-if="!readOnly" v-model="val.checked" @click.stop />
                   <span class="ml-5px">{{ val.name || `人才${index + 1}` }}</span>
                   <Icon icon="ep:view" class="ml-5px" /> 
                 </div>
@@ -149,8 +149,8 @@ const dealData = async (type, data) => {
   if (type === '简历') fileUrl.value = data.minio_path
   
   if (type === '招聘') { // 门墩儿招聘-人员信息在组件中通过id和userId获取
-    personId.value = data?.data?.id || ''
-    userId.value = data?.data?.userId || ''
+    personId.value = data?.id || ''
+    userId.value = data?.userId || ''
     activeName.value = 'info'
     // return
   }
@@ -189,7 +189,6 @@ const infoEcho = (data) => {
 
 // 门墩儿招聘人才工作经历回显赋值
 const expEcho = (workList) => {
-  workList = workList ? JSON.parse(workList) : null
   itemData.value = {
     ...itemData.value,
     career_path: workList ? workList.map(e => {
@@ -221,8 +220,17 @@ const open = async (task_type, parse_result, task_id, isDetail) => {
   const { results } = parse_result
   resetData()
   source.value = task_type
-  const dataList = results.map(e => {
-    if (source.value === '招聘') e.data = { ...e }
+  const dataList = results.map((e, index) => {
+    if (source.value === '招聘') {
+      Object.assign(e, {
+        error: null,
+        filename: '',
+        index,
+        minio_path: '',
+        object_key: '',
+        success: true,
+      })
+    }
     // 切换标签
     tagList.value.push({ name: e.data.name_zh, checked: true })
     return e

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

@@ -155,7 +155,7 @@
           @reset="webOriginList = []"
         />
       </template>
-      <!-- 网页解析 -->
+      <!-- 门墩儿招聘 -->
       <template v-if="radioValue === 'menduner'">
         <Search ref="SearchRef" />
       </template>