소스 검색

招聘会职位列表

Xiao_123 3 달 전
부모
커밋
df6b95227a

+ 8 - 0
src/api/recruit/personal/jobFair.js

@@ -14,3 +14,11 @@ export const getJobFairList = async () => {
 		url: '/app-api/menduner/system/job-fair/list'
 	})
 }
+
+// 根据企业id查询招聘会职位列表
+export const getJobFairEntJobPage = async (params) => {
+	return await request.get({
+		url: '/app-api/menduner/system/job-fair/detail/page',
+		params
+	})
+}

+ 13 - 7
src/views/recruit/personal/jobFair/position/components/entCard.vue

@@ -4,14 +4,15 @@
 			<div class="d-flex pa-4 pb-2">
 				<img :src="val.logoUrl" style="width: 80px; height: 80px; border-radius: 4px;" />
 				<div style="max-width: 390px;">
-					<h3 v-ellipse-tooltip class="enterprise-name ml-3">{{ formatName(val.name) }}</h3>
-					<p class="font-size-14 color-666 mt-1 mb-2 ml-3">{{ val.industryName }}</p>
+					<h3 v-ellipse-tooltip class="enterprise-name ml-3">{{ formatName(val.anotherName || val.name) }}</h3>
+					<p class="font-size-14 color-666 mt-1 mb-2 ml-3">
+						<span>{{ val.industryName }}</span>
+						<span class="septal-line" v-if="val.industryName && val.scaleName"></span>
+						<span>{{ val.scaleName }}</span>
+					</p>
 					<div class="flex-nowrap overflow-hidden pl-3" style="height: 35px;">
-						<!-- <v-hover v-slot="{ isHovering, props }" v-for="(job, index) in val.lastJobTop5" :key="index">
-							<v-chip v-bind="props" :class="isHovering ? 'elevation-5' : 'elevation-1'" class="mr-2 mb-4 display-inline-block" variant="flat" color="primary" size="small">{{ formatName(job.name) }}</v-chip>
-						</v-hover> -->
-						<v-chip v-for="(job, index) in val.lastJobTop5" :key="index" class="mr-2 mb-4 display-inline-block" variant="flat" color="primary" size="small">
-							{{ formatName(job.name) }}
+						<v-chip v-for="(welfare, index) in val.welfareList" :key="index" class="mr-2 mb-4 display-inline-block" variant="flat" color="primary" size="small">
+							{{ welfare }}
 						</v-chip>
 					</div>
 				</div>
@@ -52,4 +53,9 @@ const handleClickEnterprise = (val, index) => {
 .active {
 	border: 1px solid var(--v-primary-base);
 }
+.v-card:hover {
+	h3 {
+		color: var(--v-primary-base);
+	}
+}
 </style>

+ 17 - 19
src/views/recruit/personal/jobFair/position/components/jobCard.vue

@@ -3,25 +3,25 @@
     <div class="resume-title">{{ enterpriseName }}</div>
   </div>
 	<div v-if="items.length > 0" v-loading="loading">
-		<v-hover v-slot="{ isHovering, props }" v-for="val in items" :key="val.job.id">
-			<v-card  class="cursor-pointer mb-3 pa-3" v-bind="props" :elevation="isHovering ? 7 : 3" @click="handleClick(val.job.id)">
+		<v-hover v-slot="{ isHovering, props }" v-for="val in items" :key="val.id">
+			<v-card  class="cursor-pointer mb-3 pa-3" v-bind="props" :elevation="isHovering ? 7 : 3" @click="handleClick(val.id)">
 				<div class="d-flex justify-space-between">
-					<p class="job-name" v-ellipse-tooltip>{{ formatName(val.job.name) }}</p>
-					<p v-if="!val.job.payFrom && !val.job.payTo" class="salary">面议</p>
-					<p v-else class="salary ml-3">{{ val.job.payFrom ? val.job.payFrom + '-' : '' }}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</p>
+					<p class="job-name" v-ellipse-tooltip>{{ formatName(val.name) }}</p>
+					<p v-if="!val.payFrom && !val.payTo" class="salary">面议</p>
+					<p v-else class="salary ml-3">{{ val.payFrom ? val.payFrom + '-' : '' }}{{ val.payTo }}{{ val.payName ? '/' + val.payName : '' }}</p>
 				</div>
 				<div class="d-flex justify-space-between mt-3">
 					<div class="color-666 font-size-14">
 						<span v-for="k in desc" :key="k.mdi">
-							<span v-if="val.job[k.value] || k.value === 'areaName'" class="mr-5">
+							<span v-if="val[k.value] || k.value === 'areaName'" class="mr-5">
 								<v-icon color="var(--color-666)" size="15">{{ k.mdi }}</v-icon>
 								<span class="ml-1 tag-text">
-									{{ k.value === 'areaName' ? !val.job.areaId ? '全国' : val.job.area?.str : val.job[k.value] }}
+									{{ k.value === 'areaName' ? !val.areaId ? '全国' : val.area?.str : val[k.value] }}
 								</span>
 							</span>
 						</span>
 					</div>
-					<div class="font-size-14 color-999">{{ timesTampChange(val.job.updateTime) }} 刷新</div>
+					<div class="font-size-14 color-999">{{ timesTampChange(val.updateTime) }} 刷新</div>
 				</div>
 			</v-card>
 		</v-hover>
@@ -39,21 +39,22 @@
 defineOptions({ name: 'jobFairDetails' })
 import { ref, watch, reactive } from 'vue'
 import { formatName } from '@/utils/getText'
-import { useRouter, useRoute } from 'vue-router'; const router = useRouter(); const route = useRoute()
-import { getJobAdvertisedSearch } from '@/api/position'
-import { dealDictObjData } from '@/utils/position'
+import { getJobFairEntJobPage } from '@/api/recruit/personal/jobFair'
+import { dealDictArrayData } from '@/utils/position'
 import { timesTampChange } from '@/utils/date'
 
 const props = defineProps({
 	enterpriseId: [String, Number],
-	enterpriseName: String
+	enterpriseName: String,
+	jobFairId: [String, Number]
 })
 
 const loading = ref(false)
 const items = ref([])
 const query = reactive({
 	pageNo: 1,
-	pageSize: 10
+	pageSize: 10,
+	jobFairId: props.jobFairId
 })
 const total = ref(0)
 // 城市、学历、工作经验
@@ -66,17 +67,14 @@ const desc = [
 const getPositionList = async () => {
 	loading.value = true
 	try {
-		const { list, total: number } = await getJobAdvertisedSearch(query)
+		const { list, total: number } = await getJobFairEntJobPage(query)
 		if (!list || !list.length) {
 			items.value = []
 			total.value = 0
 			return
 		}
 		total.value = number
-		items.value = list.map(e => {
-			e.job = dealDictObjData({}, e.job)
-			return e
-		})
+		items.value = dealDictArrayData([], list)
 		loading.value = false
 	} catch {}
 }
@@ -89,7 +87,7 @@ const handleChangePage = (index) => {
 watch(
 	() => props.enterpriseId,
 	(val) => {
-		query.enterpriseId = '158258417071427584'
+		query.enterpriseId = val
 		getPositionList()
 	},
 	{ immediate: true }

+ 16 - 20
src/views/recruit/personal/jobFair/position/index.vue

@@ -7,19 +7,18 @@
 					<span class="breadcrumbsText" :class="{ active: !item.disabled && index !== breadcrumbs.length-1 }" @click="breadcrumbsClickDeal({ e: item, breadcrumbs, index })">{{ item.text }}</span>
 				</template>
 			</v-breadcrumbs>
-			<headSearch v-model="content" placeholder="搜索公司关键字" @handleSearch="handleSearch"></headSearch>
+			<headSearch v-model="query.keyword" placeholder="搜索公司关键字" @handleSearch="handleSearch"></headSearch>
     </div>
     <Empty v-if="!items.length" :message="loadingType === 1 ? loadingText[loadingType] : '该招聘会暂无企业参与,前往其他招聘会看看吧~'" class="mt-3 py-15"></Empty>
     <template v-else>
       <div class="d-flex">
         <div class="mt-3">
           <EntCard :list="items" @selectChange="selectChange" />
-          <div class="loading defaultLink-i" @click="handleLoadMore">查看更多</div>
-          <div v-if="showLoadingMore" :class="['loading', {'defaultLink-i': !loadingType}]" @click="handleChangePage">{{ loadingText[loadingType] }}</div>
+          <div :class="['loading', {'defaultLink-i': !loadingType}]" @click="handleChangePage">{{ loadingText[loadingType] }}</div>
         </div>
         <div class="position-details ml-3" style="flex: 1; overflow: hidden;">
           <div class="position-content pa-3">
-						<JobCard :enterpriseId="enterpriseId" :enterpriseName="enterpriseName" />
+						<JobCard :enterpriseId="enterpriseId" :enterpriseName="enterpriseName" :jobFairId="route.params.id" />
           </div>
         </div>
       </div>
@@ -33,14 +32,13 @@ defineOptions({ name: 'personalPositionRecommend'})
 import buttons from '@/views/recruit/personal/components/buttons.vue'
 import { ref, reactive } from 'vue'
 import { getJobFairEnterprisePage } from '@/api/recruit/personal/jobFair'
-
 import EntCard from './components/entCard.vue'
 import JobCard from './components/jobCard.vue'
 import { useRoute } from 'vue-router'; const route = useRoute()
 import { breadcrumbsClickDeal, getJobFairBreadcrumbs } from '@/utils/index'
 import { formatName } from '@/utils/getText'
+import { dealDictArrayData } from '@/utils/position'
 
-const showLoadingMore = ref(false)
 const breadcrumbs = ref(getJobFairBreadcrumbs(route?.query) || [])
 
 // 切换企业选中
@@ -51,12 +49,11 @@ const selectChange = (val) => {
 	enterpriseName.value = formatName(val.anotherName || val.name)
 }
 
-const total = ref(0)
-const content = ref('')
 const query = reactive({
   pageNo: 1,
   pageSize: 10,
-	jobFairId: route.params.id
+	jobFairId: route.params.id,
+	keyword: ''
 })
 
 const items = ref([])
@@ -67,14 +64,13 @@ const loadingType = ref(0)
 const getList = async () => {
 	loadingType.value = 1
 	try {
-		const { list, total } = await getJobFairEnterprisePage(query)
-		console.log(list, '企业列表')
+		const result = await getJobFairEnterprisePage(query)
+		const list = result?.list || []
 		if (list.length) {
-			items.value = items.value.concat(list)
-			loadingType.value = list.length  === query.pageSize ? 0 : 2
+			items.value = items.value.concat(dealDictArrayData([], list))
+			loadingType.value = list.length  === result.total ? 2 : 0
 			enterpriseId.value = items.value[0].id
 			enterpriseName.value = formatName(items.value[0].anotherName || items.value[0].name)
-			getPositionList()
 		} else {
 			loadingType.value = 2
 		}
@@ -82,7 +78,12 @@ const getList = async () => {
 }
 getList()
 
-const handleSearch = (val) => {}
+const handleSearch = (val) => {
+	query.keyword = val
+	query.pageNo = 1
+	items.value = []
+	getList()
+}
 
 const handleChangePage = () => {
   if (loadingType.value) return // 没有更多数据了
@@ -90,11 +91,6 @@ const handleChangePage = () => {
   query.pageNo++
   getList()
 }
-
-const handleLoadMore = () => {
-
-}
-
 </script>
 
 <style scoped lang="scss">