Bladeren bron

优化新增门墩招聘人才地图

lifanagju_citu 2 weken geleden
bovenliggende
commit
09182d8a0d

+ 1 - 1
src/components/DictTag/src/DictTag.vue

@@ -42,7 +42,7 @@ export default defineComponent({
       return (
         <ElTag
           style={dictData.value?.cssClass ? 'color: #fff' : ''}
-          type={dictData.value?.colorType}
+          type={dictData.value?.colorType ? dictData.value.colorType : 'primary'}
           color={
             dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
               ? dictData.value?.cssClass

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

@@ -4,17 +4,26 @@
     <el-table-column label="操作" align="center">
       <template #default="scope">
         <el-link type="primary" download :href="scope.row.url" :underline="false" target="_blank">下载</el-link>
+        <el-button v-if="showPreview" class="m-l-10px" link type="primary" @click="handlePreview(scope.row.url, row)">预览</el-button>
       </template>
     </el-table-column>
   </el-table>
+  
+  <Dialog title="附件详情" v-model="openPreview" width="1000" @close="openPreview = false">
+    <div>
+      <IFrame style="max-height: 80vh;" :src="fileUrl" />
+    </div>
+  </Dialog>
 </template>
 
 <script setup>
 defineOptions({ name: 'PersonAttachment' })
 import { PersonInfoApi } from '@/api/menduner/system/person'
+import { Base64 } from 'js-base64'
 
 const props = defineProps({
-  userId: String
+  showPreview: Boolean,
+  userId: [String, Number]
 })
 
 const loading = ref(false)
@@ -26,6 +35,18 @@ const queryParams = reactive({
   userId: props.userId
 })
 
+
+const fileUrl = ref('')
+const openPreview = ref(false)
+const fileName = ref('')
+const baseUrl = import.meta.env.VITE_PREVIEW_URL
+const handlePreview = (url) => {
+  if (!url) return message.warning('预览失败!')
+
+  openPreview.value = true
+  fileUrl.value = !url.includes('.pdf') ?  `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(url))}` : url
+}
+
 const getList = async () => {
   loading.value = true
   try {

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

@@ -27,7 +27,7 @@ import { timesTampChange } from '@/utils/transform/date'
 import { formatName } from '@/utils'
 
 const props = defineProps({
-  userId: String
+  userId: [String, Number]
 })
 
 const loading = ref(false)

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

@@ -49,7 +49,7 @@ import { PersonInfoApi } from '@/api/menduner/system/person'
 
 const props = defineProps({
   id: String,
-  userId: String
+  userId: [String, Number]
 })
 
 // 获取人才详情

+ 8 - 4
src/views/menduner/system/talentMap/maintenance/gather/components/search.vue

@@ -21,7 +21,7 @@
     </el-form>
   </ContentWrap>
 
-  <div v-if="!list?.length" class="tip">
+  <div v-if="paramsVerify && !list?.length" class="tip">
     <div>{{ tipContent }}</div>
   </div>
   <!-- 列表 -->
@@ -75,6 +75,7 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 const emit = defineEmits(['detail'])
 const props = defineProps({
   detailButTxt: String,
+  paramsVerify: Boolean,
   searchName: String
 })
 const message = useMessage() // 消息弹窗
@@ -107,7 +108,7 @@ const tipContent = '输入人才姓名、电话查询后可使用门墩儿人才
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.pageNo = 1
-  if (!queryParams.name && !queryParams.phone) {
+  if (props.paramsVerify && !queryParams.name && !queryParams.phone) {
     message.warning('请输入后查询 !')
     return
   }
@@ -121,18 +122,21 @@ const resetQuery = () => {
 }
 
 const handleDetail = (row) => {
-  emit('detail', row.user.id)
+  emit('detail', { id: row.person.id, userId: row.person.userId })
 }
 
 /** 初始化 **/
 // onMounted(async () => {
+//   if (props.paramsVerify) return
 //   setTimeout(() => {
 //     if (props.searchName) {
 //       queryParams.name = props.searchName
 //     }
-//     getList()
 //   }, 1000)
+//   getList()
 // })
+
+if (!props.paramsVerify) getList()
 </script>
 
 <style lang="scss" scoped>

+ 54 - 18
src/views/menduner/system/talentMap/maintenance/gather/index2.vue

@@ -49,7 +49,7 @@
     </el-table>
 
     <!-- 选择来源 -->
-    <Dialog title="解析方式" v-model="openSelect" width="500" @close="openSelect = false">
+    <Dialog title="新增" v-model="openSelect" width="500" @close="openSelect = false">
 			<el-radio-group v-model="radioValue" size="large" class="radioBox">
 				<el-radio
 					v-for="item in radioList"
@@ -61,10 +61,15 @@
 			</el-radio-group>
       <template #footer>
         <el-button type="primary" @click="handleSelect">确 认</el-button>
-        <el-button @click="null">取 消</el-button>
+        <el-button @click="openSelect = false">取 消</el-button>
       </template>
     </Dialog>
 
+    <!-- 人员搜索 -->
+    <Dialog :title="radioObject.menduner" v-model="openSearch" width="1200" @close="openSearch = false">
+      <Search @detail="handleDetail" :detailButTxt="detailButTxt" />
+    </Dialog>
+
     <!-- 解析文件上传 -->
     <Dialog :title="radioObject[radioValue]" v-model="dialog_upload" :width="DialogWidth" @close="handleCancel">
       <div>
@@ -120,12 +125,33 @@
     </Dialog>
 
     <!-- 解析回显 -->
-    <Dialog :title="radioObject[radioValue]" v-model="dialog_analysisInfo" width="80%">
+    <Dialog :title="radioObject[radioValue]" v-model="dialog_analysisInfo" width="90%">
       <div class="analysisInfoBox">
         <div class="analysisFile">
           <!-- 门墩儿人才库 -->
           <template v-if="radioValue === 'menduner'">
-            <Search @detail="handleDetail" :detailButTxt="detailButTxt" :searchName="formData?.name_zh || formData?.name_en || ''" />
+
+            <el-tabs v-model="activeName" type="border-card">
+              <el-tab-pane label="基本信息" name="info">
+                <el-card shadow="never" class="m-b-20px">
+                  <template #header>
+                    <CardTitle title="人才详情" />
+                  </template>
+                  <Info :id="id" :user-id="userId" />
+                </el-card>
+                
+                <el-card shadow="never" class="m-b-20px">
+                  <template #header>
+                    <CardTitle title="工作经历" />
+                  </template>
+                  <Exp :user-id="userId" />
+                </el-card>
+              </el-tab-pane>
+
+              <el-tab-pane label="附件简历" name="Attachment">
+                <Attachment showPreview :user-id="userId" />
+              </el-tab-pane>
+            </el-tabs>
           </template>
           <!-- 简历解析 -->
           <template v-if="radioValue === 'file'">
@@ -223,6 +249,9 @@ import webAnalysis from './components/webAnalysis.vue'
 import { useUpload } from '@/components/UploadFile/src/useUpload'
 import { commonApi } from '@/api/menduner/common'
 import { Base64 } from 'js-base64'
+import Info from '@/views/menduner/system/person/details/components/info.vue'
+import Exp from '@/views/menduner/system/person/details/components/exp.vue'
+import Attachment from '@/views/menduner/system/person/details/components/attachment.vue'
 
 const baseUrl = import.meta.env.VITE_PREVIEW_URL
 const { uploadUrl, httpRequest } = useUpload()
@@ -325,6 +354,7 @@ const handleDisable = async (item) => {
 }
 
 // 更新
+const activeName = ref('info')
 const dialog_analysisInfo = ref(false)
 const formLoading = ref(false)
 const analysisType = ref('')
@@ -375,6 +405,7 @@ const handleSave = async () => {
   } finally {
     cardFileQuery.value = null
     formLoading.value = false
+    openSearch.value = false
   }
 }
 
@@ -468,18 +499,6 @@ const handleResetUpload = async () => {
   resumeAnalysisToForm('reset') // 简历解析
 }
 
-const detailButTxt = '应用'
-// 搜索-查看详情
-const handleDetail = async (userId) => {
-  if (!userId) return message.warning('请先选择人才!')
-  try {
-    const data = await TalentMap.getTalentMapDetail(userId)
-    // 去除id
-    resumeAnalysisToForm(data) // 简历解析
-    message.success(`${detailButTxt}成功`)
-  } catch {}
-}
-
 // 简历解析数据解构赋值
 const resumeAnalysisToForm = (data) => {
   if (data === 'reset') {
@@ -516,6 +535,23 @@ const cardUploadChange = (raw) => {
   cardUploadRow.value = raw
 }
 
+// 人员搜索
+const detailButTxt = '加入人才地图'
+const openSearch = ref(false)
+const id = ref(null)
+const userId = ref(null)
+const handleDetail = async ({id: use_id, userId: use_userId}) => {
+  if (!use_userId || !use_userId)  return message.warning('请先选择人才!')
+  id.value = use_id; userId.value = use_userId
+  try {
+    const data = await TalentMap.getTalentMapDetail(use_userId)
+    // 去除id
+    resumeAnalysisToForm(data) // 简历解析
+    dialog_analysisInfo.value = true
+    // message.success(`操作成功`)
+  } catch {}
+}
+
 const DialogWidth = ref('500')
 const showWebAnalysis = ref(false)
 // 选择解析方式
@@ -528,7 +564,7 @@ const handleSelect = () => {
     createAnalysisNum.value++
   }
   if (type === 'menduner') {
-    dialog_analysisInfo.value = true
+    openSearch.value = true
     return
   }
   if (type === 'web') {
@@ -546,7 +582,7 @@ const handleCancel = () => {
 }
 
 const openSelect = ref(false)
-const radioObject = { card: '名片解析', file: '简历解析', web: '网页解析', menduner: '门墩儿人才库(普通新增)' }
+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)