lifanagju_citu 8 miesięcy temu
rodzic
commit
b3acb99c59

+ 13 - 1
src/components/FormUI/areaSelect/index.vue

@@ -18,6 +18,7 @@
 </template>
 
 <script setup>
+import { getDict } from '@/hooks/web/useDictionaries'
 import TextInput from '@/components/FormUI/TextInput'
 import { ref, watch } from 'vue'
 defineOptions({ name:'FormUI-areaSelect'})
@@ -31,7 +32,13 @@ watch(
   () => defineProp.modelValue,
   (newVal) => {
     value.value = newVal ? (typeof newVal === 'string') ? [newVal] : newVal : [] // 转数组
-    if (value.value?.length === 0) areaSelect.value = []
+    // console.log('areaSelect.value ', value.value )
+    if (value.value?.length) {
+      areaSelect.value = value.value.map(id => {
+        const obj = areaList.find(k => Number(k.id) === Number(id))
+        return obj
+      }).filter(Boolean)
+    } else areaSelect.value = []
   },
   { immediate: true },
   { deep: true }
@@ -56,6 +63,11 @@ const handleAreaClear = (k) => {
   if (index !== -1) areaSelect.value.splice(index, 1)
 }
 
+let areaList = []
+getDict('menduner_area_type', {}, 'areaList').then(({ data }) => {
+  areaList = data?.length && data || []
+})
+
 </script>
 <style lang="scss" scoped>
 </style>

+ 0 - 215
src/views/recruit/enterprise/resumeManagement/talentMap/components/data.js

@@ -1,215 +0,0 @@
-export const dataTest = {
-  list: [
-    {
-      id: "1793583467288223745", 
-      userId: "1", 
-      name: "无牙仔", 
-      sex: "1", 
-      avatar: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/241e594d4473872eabb312673f42241a2e9598298cb7d9d791cc9c8cb65fb058.jpg", 
-      phone: "13229740092", 
-      email: "citupro.com", 
-      wxCode: null, 
-      birthday: 863625600000, 
-      maritalStatus: "3", 
-      areaId: "340400", 
-      regId: "460100", 
-      jobType: "0", 
-      jobStatus: "0", 
-      firstWorkTime: 1020182400000, 
-      advantage: "advantage", 
-      expType: "0", 
-      eduType: "0", 
-      createTime: 1716487396000
-    }, 
-    {
-      id: "1793583467288223746", 
-      userId: "2", 
-      name: "垃圾数据", 
-      sex: "1", 
-      avatar: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/241e594d4473872eabb312673f42241a2e9598298cb7d9d791cc9c8cb65fb058.jpg", 
-      phone: "13229740091", 
-      email: "citupro.com", 
-      wxCode: null, 
-      birthday: 946656000000, 
-      maritalStatus: "3", 
-      areaId: "110101", 
-      regId: null, 
-      jobType: "1", 
-      jobStatus: "1", 
-      firstWorkTime: 1020182400000, 
-      advantage: "advantage", 
-      expType: "5", 
-      eduType: "2", 
-      createTime: 1716487396000
-    }, 
-    {
-      id: "1802554979923980290", 
-      userId: "3", 
-      name: "蔡", 
-      sex: "1", 
-      avatar: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/b74a994d9368418cfad012a089fe8e7352f2fe3c2974bf7a9df126b9d6c2b8be.jpeg", 
-      phone: "15774563630", 
-      email: "11@qq.com", 
-      wxCode: null, 
-      birthday: 1718553600000, 
-      maritalStatus: "3", 
-      areaId: "110101", 
-      regId: null, 
-      jobType: "0", 
-      jobStatus: "2", 
-      firstWorkTime: 1732982400000, 
-      advantage: null, 
-      expType: "7", 
-      eduType: "6", 
-      createTime: 1718597572000
-    }, 
-    {
-      id: "1810882841609445377", 
-      userId: "1802537861731995650", 
-      name: "雪糕", 
-      sex: "0", 
-      avatar: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/3ddfc91539fa8edf0337be724f112d8b1ba3fbf5b5267f83208842909e08bc62.jpg", 
-      phone: "1840000003", 
-      email: "15246666@qq.com", 
-      wxCode: null, 
-      birthday: 1720627200000, 
-      maritalStatus: "0", 
-      areaId: "110105", 
-      regId: null, 
-      jobType: "0", 
-      jobStatus: "0", 
-      firstWorkTime: 1704038400000, 
-      advantage: null, 
-      expType: "0", 
-      eduType: "0", 
-      createTime: 1720583088674
-    }, 
-    {
-      id: "1810894386980671490", 
-      userId: "1802587750646571010", 
-      name: "姓名", 
-      sex: "0", 
-      avatar: "", 
-      phone: "1840000003", 
-      email: "", 
-      wxCode: null, 
-      birthday: null, 
-      maritalStatus: null, 
-      areaId: null, 
-      regId: null, 
-      jobType: null, 
-      jobStatus: "0", 
-      firstWorkTime: null, 
-      advantage: "测试账号", 
-      expType: "0", 
-      eduType: "0", 
-      createTime: 1720585841311
-    }, 
-    {
-      id: "1810895855691714562", 
-      userId: "1810895787827875842", 
-      name: "123", 
-      sex: "0", 
-      avatar: "", 
-      phone: "18400000004", 
-      email: "", 
-      wxCode: null, 
-      birthday: null, 
-      maritalStatus: null, 
-      areaId: null, 
-      regId: null, 
-      jobType: null, 
-      jobStatus: "0", 
-      firstWorkTime: null, 
-      advantage: null, 
-      expType: "0", 
-      eduType: "5", 
-      createTime: 1720586191484
-    }, 
-    {
-      id: "1810897010463297537", 
-      userId: "1810857066626179074", 
-      name: "安琪", 
-      sex: "2", 
-      avatar: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/933de4dc9eb28e2bdf79a1da518a8e1a0e14bf4b78358ea9452fb8e8fdd2f7f6.jpeg", 
-      phone: "13229740092", 
-      email: "0092@qq.com", 
-      wxCode: null, 
-      birthday: 647622000000, 
-      maritalStatus: "0", 
-      areaId: "440100", 
-      regId: null, 
-      jobType: "0", 
-      jobStatus: "0", 
-      firstWorkTime: 1462032000000, 
-      advantage: "advantage", 
-      expType: "4", 
-      eduType: "4", 
-      createTime: 1720586466794
-    }, 
-    {
-      id: "1810946471751229441", 
-      userId: "1810946290024620033", 
-      name: "林女士", 
-      sex: "0", 
-      avatar: "", 
-      phone: "13229740099", 
-      email: "", 
-      wxCode: null, 
-      birthday: null, 
-      maritalStatus: null, 
-      areaId: null, 
-      regId: null, 
-      jobType: null, 
-      jobStatus: "0", 
-      firstWorkTime: null, 
-      advantage: null, 
-      expType: "5", 
-      eduType: "3", 
-      createTime: 1720598259290
-    }, 
-    {
-      id: "1810966328299397121", 
-      userId: "1810966001873494017", 
-      name: "小七", 
-      sex: "0", 
-      avatar: "", 
-      phone: "13229742258", 
-      email: "", 
-      wxCode: null, 
-      birthday: null, 
-      maritalStatus: null, 
-      areaId: null, 
-      regId: null, 
-      jobType: null, 
-      jobStatus: "0", 
-      firstWorkTime: null, 
-      advantage: null, 
-      expType: "0", 
-      eduType: "4", 
-      createTime: 1720602993456
-    }, 
-    {
-      id: "1811241432220610562", 
-      userId: "1811241235713273857", 
-      name: "18400000006", 
-      sex: "0", 
-      avatar: "", 
-      phone: "18400000006", 
-      email: "", 
-      wxCode: null, 
-      birthday: null, 
-      maritalStatus: null, 
-      areaId: null, 
-      regId: null, 
-      jobType: null, 
-      jobStatus: "0", 
-      firstWorkTime: null, 
-      advantage: null, 
-      expType: "1", 
-      eduType: "4", 
-      createTime: 1720668583351
-    }
-  ], 
-  total: "56"
-}

+ 19 - 15
src/views/recruit/enterprise/resumeManagement/talentMap/components/filter.vue

@@ -9,14 +9,14 @@
         <v-menu :close-delay="1" :open-delay="0" v-bind="$attrs">
           <template v-slot:activator="{  props }">
             <textUI
-              :modelValue="item.value"
+              v-model="item.value"
               :item="item"
               v-bind="props"
               style="position: relative;"
-              @handleClear="handleJobClickItem"
+              @handleClear="handleJobClickItem()"
             ></textUI>
           </template>
-          <jobTypeCard class="jobTypeCardBox" :select="[positionId].filter(Boolean)" :isSingle="true" @handleJobClick="handleJobClickItem"></jobTypeCard>
+          <jobTypeCard class="jobTypeCardBox" :select="[item[item.valueKey]].filter(Boolean)" :isSingle="true" @handleJobClick="handleJobClickItem"></jobTypeCard>
         </v-menu>
       </template>
     </CtForm>
@@ -38,6 +38,7 @@ defineOptions({ name: 'talent-map-filter'})
 import jobTypeCard from '@/components/jobTypeCard'
 import textUI from '@/components/FormUI/TextInput'
 import { getDict } from '@/hooks/web/useDictionaries'
+import Snackbar from '@/plugins/snackbar'
 import { ref } from 'vue'
 const emit = defineEmits(['cancel', 'confirm'])
 
@@ -184,7 +185,6 @@ const formItems = ref({
   ]
 })
 
-
 // 获取字典内容
 const getDictData = async (item) => {
   if (item) {
@@ -206,14 +206,14 @@ formItems.value.options.forEach((e, index) => {
 // }
 
 // 期望职位
-let positionId = ''
-let positionName = ''
+const positionId = ref('')
+const positionName = ref('')
 const handleJobClickItem = (list, name) => {
   const positionItem = formItems.value.options.find(f => f.key === 'positionName')
   if (positionItem) {
     if (list?.length) {
-      positionItem.value = positionName = name || ''
-      positionItem[positionItem.valueKey] = positionId = list?.length ? list[0] : ''
+      positionItem.value = positionName.value = name || ''
+      positionItem[positionItem.valueKey] = positionId.value = list?.length ? list[0] : ''
     } else {
       positionItem.value = name || ''
       positionItem[positionItem.valueKey] = list?.length ? list[0] : ''
@@ -226,13 +226,17 @@ const confirm = () => {
   formItems.value.options.forEach(e => {
     if (e.key === 'positionName') {
       if (e.value) {
-        obj[e.valueKey] = positionId ? positionId : ''
-        obj[e.key] = positionName ? positionName : ''
+        obj[e.valueKey] = positionId.value || ''
+        obj[e.key] = positionName.value || ''
       }
     } else if (e.value !== null && e.value !== '' && e.value !== undefined) obj[e.key] = e.value
   })
-  if (obj.age1 || obj.age2) obj.age = [obj.age1 || null, obj.age2 || null]
-  if (obj.pay1 || obj.pay2) obj.pay = [obj.pay1 || null, obj.pay2 || null]
+  if (obj.age1 > obj.age2) return Snackbar.warning('年龄区间异常,前者不能大于后者!')
+  if (obj.pay2 > obj.pay1) return Snackbar.warning('期望薪资异常,前者不能大于后者!')
+  //
+  if (obj.age1 || obj.age2) obj.age = [obj.age1 || null, obj.age2 || null].filter(Boolean)
+  if (obj.pay1 || obj.pay2) obj.pay = [obj.pay1 || null, obj.pay2 || null].filter(Boolean)
+  //
   if (!obj.labels?.length) delete obj.labels
   emit('confirm', obj)
 }
@@ -241,7 +245,7 @@ const resetValue = () => {
   formItems.value.options.forEach(e => {
     if (e.key === 'positionName') {
       e[e.valueKey] = ''
-      e.value = e[e.valueKey] = positionId = positionName = ''
+      e.value = e[e.valueKey] = positionId.value = positionName.value = ''
     } else {
       e.value = null
     }
@@ -250,8 +254,8 @@ const resetValue = () => {
 const setValue = (query) => {
   formItems.value.options.forEach(e => {
     if (e.key === 'positionName') {
-      e.value = query[e.key]
-      e[e.valueKey] = query[e.valueKey]
+      e.value = positionName.value = query[e.key]
+      e[e.valueKey] = positionId.value = query[e.valueKey]
     } else {
       if (query[e.key] !== undefined) e.value = query[e.key]
     }

+ 27 - 10
src/views/recruit/enterprise/resumeManagement/talentMap/index.vue

@@ -15,7 +15,7 @@
     >
       <template #bottom></template>
       <template v-slot:[`item.name`]="{ item }">
-        <div class="d-flex align-center cursor-pointer" @click="handleToPersonDetail(item)">
+        <div class="d-flex align-center cursor-pointer" @click="null">
           <v-badge
             bordered
             offset-y="6"
@@ -26,6 +26,12 @@
           <span class="defaultLink ml-3">{{ item?.name }}</span>
         </div>
       </template>
+      <template v-slot:[`item.advantage`]="{ item }">
+        <div v-if="item.advantage" id="menu-activator" class="requirementBox requirement ellipsis" v-html="item.advantage?.replace(/\n/g, '</br>')"></div>
+        <v-menu activator="#menu-activator">
+          <div v-if="item.advantage" class="requirement" v-html="item.advantage?.replace(/\n/g, '</br>')"></div>
+        </v-menu>
+      </template>
     </v-data-table>
     <CtPagination
       v-if="total > 0"
@@ -52,11 +58,9 @@ import { dealDictArrayData } from '@/utils/position'
 import { getUserAvatar } from '@/utils/avatar'
 import { timesTampChange } from '@/utils/date'
 import FilterPage from './components/filter.vue'
-import { dataTest } from './components/data.js'
 import { computed, reactive, ref } from 'vue'
 
 const screen = ref(false)
-const tipsText = ref('暂无数据')
 
 let query = {}
 const pageInfo = reactive({ pageNo: 1, pageSize: 10 })
@@ -82,15 +86,12 @@ const headers = [
 // 获取数据
 const getData = async () => {
   const obj = { ...pageInfo, ...query }
-  console.log('getData-obj',obj)
+  console.log('obj', obj)
+  const { list, total: number } = await getRecruitPersonMapPage(obj)
   // const { list, total: number } = dataTest
   //
-  // const { list, total: number } = await getRecruitPersonMapPage(obj)
-  // if (!list.length) {
-  //   if (query.value.name) tipsText.value = '暂无数据,请更换关键词后再试'
-  // }
-  // total.value = number
-  // dataList.value = list.length ? dealDictArrayData([], list) : []
+  total.value = number
+  dataList.value = list?.length ? dealDictArrayData([], list) : []
 }
 getData()
 
@@ -130,6 +131,22 @@ const badgeIcon = computed(() => (item) => {
 :deep(.v-selection-control__input) {
   color: var(--v-primary-base) !important;
 }
+.requirementBox {
+  width: 150px;
+  height: 28px;
+  line-height: 28px;
+  // overflow: hidden;
+}
+.requirement {
+  white-space: pre-wrap;
+  word-break: break-all;
+  line-height: 28px;
+  color: var(--color-333);
+  font-size: 15px;
+  text-align: justify;
+  letter-spacing: 0;
+  // width: 60%;
+}
 .list-item {
   border: 1px solid #e5e6eb;
 }