Forráskód Böngészése

职位列表跳转简历页面

Xiao_123 1 hónapja
szülő
commit
a631d2bb02

+ 22 - 41
components/FilterList/index.vue

@@ -2,13 +2,14 @@
   <view class="labelColor itemBox" style="height: 45px;">
     <view class="item" v-for="(item) in filterList" :key="item[props.idValue]">
       <m-filter
-        class="itemFilter"
         :items="item.array"
         :label="item.label"
+        :value="item.value"
         :multiple="item.multiple"
         :item-label="item.itemLabel"
         :item-value="item.itemValue"
-        :popupStyle="{ 'padding-bottom': '80px' }"
+		    :style="{ 'width': labelWidth }"
+        :popupStyle="{ 'padding-bottom': paddingBottom + 'px' }"
         @change="($event, $name) => handleClick($event, $name, item)"
       >
         <view
@@ -42,60 +43,43 @@
 import { ref, watch } from 'vue'
 import { getDict } from '@/hooks/useDictionaries'
 import MFilter from './mFilter.vue'
+import { formatName } from '@/utils/getText'
 
 const emit = defineEmits(['change'])
 const props = defineProps({
   list: { type: Array, default: () => [] },
   idValue: { type: String, default: 'id' },
   labelValue: { type: String, default: 'label' },
-  // selectIdValue: { type: String, default: 'id' },
-  // selectLabelValue: { type: String, default: 'label' },
-  // useApiData: { type: Boolean, default: true },
   lazy: { type: Boolean, default: false },
+  paddingBottom: { type: [Number, String], default: 80 },
+  labelWidth: { type: String, default: '100%' }
 })
 
-// const popup = ref()
-
-// const handleOpen = (index) => {
-//   popup.value[index].open('bottom')
-// }
-// const handleChangeItem = (i, item) => {
-//   if (i === item.active) {
-//     return
-//   }
-//   item.active = i
-// }
-
 
 const handleClick = (e, name, item) => {
   item.value = e
   item.name = name ?? item.label
-  // const obj = e.detail.value?.length ? e.detail.value[e.detail.value.length-1] : {}
-  // const obj0 = e.detail.value?.length ? e.detail.value[0] : {}
-  // //
-  // let val = obj.value
-  // item.value = obj.value
-  // item.text = obj.text || ''
-  // if (typeof val === 'string' && val.includes('unlimited') && obj0) {
-  //   val = Number.isInteger(obj0.id) ? Number(val.split('unlimited')[0]) : val.split('unlimited')[0]
-  // }
   emit('change', item.key, e)
 }
 
-// const handleClear = (item, index) => {
-//   item.value = e.multiple ? [] : null
-//   item.text = null
-//   emit('change', item.key, item.value)
-// }
-
 // 获取字典数据
 const getData = (e) => {
-  getDict(e.dictType, e.map ? {} : null, e.map ? e.dictType : 'dict').then(({ data }) => {
-    e.array = data.data
-    e.itemLabel = e.map?.text
-    e.itemValue = e.map?.value
-    e.value = e.multiple ? [] : null
-  })
+  if (e?.dictType) {
+    getDict(e.dictType, e.map ? {} : null, e.map ? e.dictType : 'dict').then(({ data }) => {
+      e.array = data.data
+      e.itemLabel = e.map?.text
+      e.itemValue = e.map?.value
+      e.value = e.multiple ? [] : null
+    })
+  }
+  if (e?.api) {
+    e.api().then(({ data }) => {
+      e.array = data.map(k => {
+        const label = e.isRichText ? k[e.dataLabel].replace(/<\/?p[^>]*>/gi, '') : e.isFormatText ? formatName(k[e.dataLabel]) : k[e.dataLabel]
+        return { label, value: k[e.dataValue] }
+      })
+    })
+  }
 }
 
 const setItemSelectData = () => {
@@ -135,9 +119,6 @@ watch(() => props.list,
     flex: 1;
     width: 0;
     font-size: 14px;
-    .itemFilter {
-      width: 100%;
-    }
     .name {
       width: 100%;
       display: flex;

+ 5 - 10
components/FilterList/mFilter.vue

@@ -43,6 +43,7 @@
 
 <script setup>
 import { ref, watch } from 'vue'
+
 const emit = defineEmits(['change', 'init'])
 const props = defineProps({
   popupStyle: {
@@ -97,10 +98,8 @@ watch(
   }
 )
 
-watch(
-  () => props.value,
-  (val) => {
-    if (!val) {
+const handleData = (val) => {
+  if (!val) {
       showList.value = [{
         choose: -1,
         data: props.items
@@ -162,12 +161,7 @@ watch(
     }
     showList.value = arr
     emit('init', label)
-  },
-  {
-    immediate: true,
-    deep: true
-  }
-)
+}
 
 const findItem = (value, lists) => {
   let level = -1
@@ -197,6 +191,7 @@ const findItem = (value, lists) => {
 }
 
 const handleOpen = () => {
+  handleData(props.value)
   popup.value.open('bottom')
 }
 

+ 3 - 3
components/PositionList/index.vue

@@ -192,9 +192,9 @@ const handleDetail = (item) => {
 
 // 查看职位投递简历
 const handleToResume = (val) => {
-  let path = `/recruit/enterprise/invite/resume?id=${val.id}`
-  if (val.bizId) path += `&jobFairId=${val.bizId}`
-  router.push(path)
+  let url = `/pagesA/resume/index?jobId=${val.id}&jobName=${formatName(val.name)}`
+  if (val.bizId) url += `&jobFairId=${val.bizId}`
+  uni.navigateTo({ url })
 }
 
 const paySuccess = () => {

+ 53 - 1
pagesA/resume/index.vue

@@ -8,6 +8,20 @@
         styleType="text"
         activeColor="#00B760"
       ></uni-segmented-control>
+
+      <!-- 条件搜索 -->
+      <uni-search-bar
+        v-model="query.name"
+        radius="5"
+        placeholder="投递人姓名"
+        cancelButton="none"
+        :focus="false"
+				@clear="handleSearch('name', null)"
+        @confirm="handleSearch('name', query.name)"
+      ></uni-search-bar>
+      <view style="padding: 0 10px;">
+		<FilterList :list="filterList" idValue="label" labelWidth="93%" :paddingBottom="10" @change="handleSearch"></FilterList>
+	  </view>
     </view>
 
     <scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
@@ -22,7 +36,19 @@ import { ref } from 'vue'
 import { timesTampChange } from '@/utils/date'
 import { dealDictObjData } from '@/utils/position'
 import CardItem from './item.vue'
+import FilterList from '@/components/FilterList'
 import { getPersonCvPage, getInterviewInvitePage, personCvUnfitPage } from '@/api/resume'
+import { getJobFairList } from '@/api/jobFair'
+import { getJobAdvertised } from '@/api/search'
+import { onLoad } from '@dcloudio/uni-app'
+
+const filterList = ref([
+  { label: '投递职位',key: 'jobId', dataLabel: 'name', dataValue: 'id', api: getJobAdvertised, isFormatText: true },
+  { label: '招聘会', key: 'jobFairId', dataLabel: 'title', dataValue: 'id', isRichText: true, api: getJobFairList },
+  { label: '最高学历', dictType: 'menduner_education_type', key: 'eduType' },
+  { label: '工作经验', dictType: 'menduner_exp_type', key: 'expType' },
+  { label: '求职状态', dictType: 'menduner_job_seek_status', key: 'jobStatus' }
+])
 
 const current = ref(0)
 const tabList = ref([
@@ -40,6 +66,7 @@ const query = ref({
   pageSize: 10,
   type: null,
   status: null,
+  name: null
 })
 
 // 获取牛人列表
@@ -81,7 +108,32 @@ const getList = async () => {
     more.value = 'more'
   }
 }
-getList()
+
+onLoad((options) => {
+  if (options?.jobId) {
+    query.value.jobId = options.jobId
+    const item = filterList.value.find(e => e.key === 'jobId')
+    item.value = options.jobId
+    item.name = decodeURIComponent(options.jobName)
+  }
+  if (options?.jobFairId) {
+    query.value.jobFairId = options.jobFairId
+    const item = filterList.value.find(e => e.key === 'jobFairId')
+    item.value = options.jobFairId
+    item.name = decodeURIComponent(options.jobFairName)
+  }
+  query.value.pageNo = 1
+  getList()
+})
+
+const handleSearch = (key, value) => {
+	query.value.pageNo = 1
+	query.value[key] = value
+
+	items.value = []
+	total.value = 0
+	getList()
+}
 
 const handleRefresh = () => {
   items.value = []

+ 5 - 1
pagesA/resume/item.vue

@@ -31,7 +31,11 @@
 			</view>
 
 			<view class="ss-m-t-15 color-999">
-				<view>投递职位:{{ formatName(val.job?.name) }}</view>
+				<view>
+					投递职位:
+					<image v-if="val.jobFairId" src="/static/svg/jobFair.svg" style="width: 15px; height: 15px;"></image>
+					{{ formatName(val.job?.name) }}
+				</view>
 				<view>操作时间:{{ timesTampChange(val.createTime) }}</view>
 			</view>
 

+ 7 - 1
pagesB/jobFair/details.vue

@@ -6,7 +6,13 @@
 		</view>
 
 		<scroll-view class="scrollBox" :scroll-y="true" style="position:relative;">
-			<JobItem v-if="jobFairPosition?.length" :list="jobFairPosition" :jobFairId="id" @refresh="getJobFairPositionList" />
+			<JobItem 
+				v-if="jobFairPosition?.length"
+				:list="jobFairPosition"
+				:jobFairId="id"
+				:jobFairName="jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '')"
+				@refresh="getJobFairPositionList"
+			/>
 			<uni-load-more v-else status="noMore" />
 		</scroll-view>
 

+ 5 - 2
pagesB/jobFair/jobItem.vue

@@ -55,7 +55,8 @@ import { quitJobFairPosition } from '@/api/jobFair'
 const emit = defineEmits(['refresh'])
 const props = defineProps({
 	list: Array,
-	jobFairId: [String, Number]
+	jobFairId: [String, Number],
+	jobFairName: String
 })
 
 // 查看职位详情
@@ -68,7 +69,9 @@ const handleToDetail = (val) => {
 
 // 查看职位投递简历
 const handleToResume = (val) => {
-	console.log(val, '投递简历数')
+	uni.navigateTo({
+		url: `/pagesA/resume/index?jobId=${val.id}&jobName=${formatName(val.name)}&jobFairId=${props.jobFairId}&jobFairName=${props.jobFairName}`
+	})
 }
 
 // 移出招聘会