Browse Source

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner-admin into dev

Xiao_123 5 months ago
parent
commit
7492a723b9

+ 3 - 4
src/api/menduner/system/talentMap/index.ts

@@ -1,5 +1,4 @@
 import request from '@/config/axios'
-import pyRequest from './pythonService'
 
 // 人才地图 API
 export const TalentMap = {
@@ -88,10 +87,10 @@ export const TalentMap = {
 export const pyTalentMap = {
   // 查找人才
   searchTalent: async (params: any) => {
-    return await pyRequest.get({ url: `/menduner/system/recruit/person-map/page`, params })
+    return await request.get({ url: `/menduner/system/person-info/person-map/page`, params })
   },
   // 人才标签推荐
-  getTalentLabel: async (data: any) => {
-    return await pyRequest.post({ url: `/rocket/label/list`, data })
+  getTalentLabel: async (params: any) => {
+    return await request.get({ url: `/menduner/system/python-graph/rocket/label/list`, params })
   }
 }

+ 0 - 85
src/api/menduner/system/talentMap/pythonService.ts

@@ -1,85 +0,0 @@
-import axios, { AxiosResponse, AxiosInstance, AxiosError } from 'axios'
-import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
-type _config = {
-  base_url: string
-  result_code: number | string
-  default_headers: AxiosHeaders
-  request_timeout: number
-}
-const config: _config = {
-  /**
-   * api请求基础路径
-   */
-  base_url: import.meta.env.VITE_BASE_URL,
-  /**
-   * 接口成功返回状态码
-   */
-  result_code: 200,
-
-  /**
-   * 接口请求超时时间
-   */
-  request_timeout: 30000,
-
-  /**
-   * 默认接口请求类型
-   * 可选值:application/x-www-form-urlencoded multipart/form-data
-   */
-  default_headers: 'application/json'
-}
-
-const axiosInstance: AxiosInstance = axios.create({
-  baseURL: config.base_url,
-  timeout: config.request_timeout
-})
-
-axiosInstance.interceptors.response.use(
-  async (response: AxiosResponse<any>) => {
-    const { data } = response
-    const code = data.code
-    const msg = data.msg
-    if (code !== 200) {
-      ElNotification.error({ title: msg })
-      return Promise.reject(data)
-    }
-    return Promise.resolve(data)
-  },
-  (error: AxiosError) => {
-    let { message } = error
-    const { t } = useI18n()
-    if (message === 'Network Error') {
-      message = t('sys.api.errorMessage')
-    } else if (message.includes('timeout')) {
-      message = t('sys.api.apiTimeoutMessage')
-    } else if (message.includes('Request failed with status code')) {
-      message = t('sys.api.apiRequestFailed') + message.substr(message.length - 3)
-    }
-    ElMessage.error(message)
-    return Promise.reject(error)
-  }
-)
-const request = (option: any) => {
-  const { url, method, params, data, headersType, responseType, ...config } = option
-  return axiosInstance({
-    url: url,
-    method,
-    params,
-    data,
-    ...config,
-    responseType: responseType,
-    headers: {
-      'Content-Type': headersType || config.default_headers
-    }
-  })
-}
-
-export default {
-  get: async <T = any>(option: any) => {
-    const res = await request({ method: 'GET', ...option })
-    return res.data as unknown as T
-  },
-  post: async <T = any>(option: any) => {
-    const res = await request({ method: 'POST', ...option })
-    return res.data as unknown as T
-  },
-}

+ 1 - 0
src/utils/dict.ts

@@ -245,4 +245,5 @@ export enum DICT_TYPE {
   MENDUNER_POINT_RULE_CONFIG_TRIGGER_TYPE= 'menduner_point_rule_config_trigger_type', // 积分规则触发类型
   MENDUNER_JOB_SEEK_STATUS = 'menduner_job_seek_status', // 求职状态
   MENDUNER_INTERVIEW_INVITE_STATUS = 'menduner_interview_invite_status', // 面试邀约状态
+  MENDUNER_AREA_TYPE = 'menduner_area_type', // 门墩儿 城市
 }

+ 229 - 9
src/views/menduner/system/talentMap/talentSearch.vue

@@ -1,41 +1,261 @@
 <template>
   <ContentWrap>
-    <div class="box">
-      <div class="box-search">
+    <div class="box" :class="{ active: isSearch }">
+      <div class="box-search contentWidth">
         <el-input
           v-model="searchValue"
           size="large"
           placeholder="请输入您的描述信息定位人才"
           :suffix-icon="Search"
+          @keydown.enter="handleSearch"
         />
       </div>
+      
+      <div class="change contentWidth">
+        <el-button class="button-new-tag" size="small" @click="changeTags">
+          换一批
+        </el-button>
+      </div>
+      <div class="tags contentWidth">
+        <el-tag
+          class="tag"
+          v-for="tag in tags"
+          :key="tag"
+          :type="searchParam.labels.includes(tag) ? 'info' : ''"
+          size="large"
+          @click="handleSearchTag(tag)"
+        >{{ tag }}</el-tag>
+      </div>
+      <div v-if="searchParam.labels.length" class="search-tags">
+        <div class="search-tags-label">标签:</div>
+        <div class="search-tags-label-content">
+          <el-tag
+            v-for="(tag, i) in searchParam.labels"
+            :key="tag"
+            size="large"
+            class="search-tags-tag"
+            closable
+            :disable-transitions="false"
+            @close="handleClose(tag, i)"
+          >
+            {{ tag }}
+          </el-tag>
+
+          <el-button class="search-tags-tag" type="danger" @click="handleClear">清除</el-button>
+        </div>
+      </div>
     </div>
   </ContentWrap>
+  <ContentWrap v-if="isSearch">
+    <el-table
+      v-loading="loading"
+      :data="list"
+      :stripe="true"
+      row-key="id"
+    >
+      <el-table-column label="头像" align="left" prop="name" >
+        <template #default="scope">
+          <el-avatar :size="30" :src="scope.row.avatar" />
+        </template>
+      </el-table-column>
+      <el-table-column label="姓名" align="left" prop="name" />
+      <el-table-column label="英文名" align="left" prop="foreignName" />
+      <el-table-column label="求职状态" align="center" prop="jobStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MENDUNER_JOB_SEEK_STATUS" :value="scope.row.jobStatus" />
+        </template>
+      </el-table-column>
+      <el-table-column label="电话号码" align="center" prop="phone" />
+      <el-table-column label="出生日期" align="center" prop="birthday" />
+      <el-table-column label="婚姻状况" align="center" prop="maritalStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MENDUNER_MARITAL_STATUS" :value="scope.row.maritalStatus" />
+        </template>
+      </el-table-column>
+      <el-table-column label="所在城市" align="center" prop="areaId">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MENDUNER_AREA_TYPE" :value="scope.row.areaId" />
+        </template>
+      </el-table-column>
+      <el-table-column label="首次工作时间" align="center" prop="firstWorkTime">
+        <template #default="scope">
+          {{ formatDate(scope.row.firstWorkTime, 'YYYY-MM-DD') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="工作经验" align="center" prop="expType">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MENDUNER_EXP_TYPE" :value="scope.row.expType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="最高学历" align="center" prop="eduType">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MENDUNER_EDUCATION_TYPE" :value="scope.row.eduType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="left">
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            @click="getDetails(scope.row.id)"
+          >
+            查看
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <Pagination
+      :total="total"
+      v-model:page="pageInfo.pageNo"
+      v-model:limit="pageInfo.pageSize"
+      @pagination="getList"
+    />
+  </ContentWrap>
 </template>
 
-<script setup lang="ts">
-import { ref } from 'vue'
+<script setup>
+import { ref, computed } from 'vue'
 import { Search } from '@element-plus/icons-vue'
+import { DICT_TYPE } from '@/utils/dict'
 import { pyTalentMap } from '@/api/menduner/system/talentMap'
+import { formatDate } from '@/utils/formatTime'
 const { searchTalent, getTalentLabel } = pyTalentMap
 const searchValue = ref(null)
 
+
+const loading = ref(false)
+const list = ref([])
+const total = ref(0)
+const pageInfo = ref({
+  pageNo: 1,
+  pageSize: 10
+})
+
+const tagsPageInfo = ref({
+  current: 1,
+  size: 15
+})
+
+const tags = ref([])
+
+const searchParam = ref({
+  labels: [],
+  content: null
+})
+
+const isSearch = computed(() => {
+  return searchParam.value.content || searchParam.value.labels.length
+})
+
+const getDetails = async (id) => {
+  console.log(id)
+}
+
 const getLabelData = async () => {
-  const res = await getTalentLabel({ current: 1, size:9999, type: 'person' }) //type: job  enterprise person
-  console.log(res)
+  const res = await getTalentLabel({ ...tagsPageInfo.value, type: 'person' }) //type: job  enterprise person
+  tags.value = res.records
+  if (res.current * res.size >= res.total) {
+    tagsPageInfo.value.current = 0
+  }
+}
+
+const getList = async () => {
+  loading.value = true
+  const res = await searchTalent({ ...pageInfo.value, ...searchParam.value })
+  list.value = res.list
+  total.value = res.total
+  loading.value = false
 }
+
+const changeTags = () => {
+  tagsPageInfo.value.current++
+  getLabelData()
+}
+
+const handleClose = (tag, index) => {
+  searchParam.value.labels.splice(index, 1)
+  pageInfo.value.current = 1
+  getList()
+}
+
+const handleClear = () => {
+  searchParam.value.labels = []
+  pageInfo.value.current = 1
+  getList()
+}
+
+const handleSearch = () => {
+  searchParam.value.content = searchValue.value
+  pageInfo.value.current = 1
+  getList()
+}
+const handleSearchTag = async (tag) => {
+  if (searchParam.value.labels.includes(tag)) {
+    return
+  }
+  searchParam.value.labels.push(tag)
+  pageInfo.value.current = 1
+  getList()
+}
+
 getLabelData()
 </script>
 
 <style scoped lang="scss">
+.contentWidth {
+  width: 75%;
+  max-width: 900px;
+}
 .box {
   min-height: 500px;
   display: flex;
   align-items: center;
   justify-content: center;
-  &-search {
-    width: 75%;
-    max-width: 900px;
+  flex-direction: column;
+  transition: .5s;
+  // &-search {
+  //   width: 75%;
+  //   max-width: 900px;
+  // }
+  &.active {
+    min-height: unset;
+  }
+  .search-tags {
+    width: 100%;
+    margin-top: 10px;
+    display: flex;
+    font-size: 14px;
+    &-label {
+      padding-top: 7px;
+      margin-right: 10px;
+      &-content {
+        width: 0;
+        flex: 1;
+      }
+    }
+    &-tag {
+      margin-right: 10px;
+      margin-bottom: 10px;
+    }
+  }
+}
+.change {
+  // width: 75%;
+  // max-width: 900px;
+  margin-top: 10px;
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+}
+.tags {
+  // width: 75%;
+  // max-width: 900px;
+  padding: 10px 0;
+  
+  .tag {
+    margin: 5px;
+    cursor: pointer;
   }
 }
 </style>