|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="search d-flex align-center">
|
|
|
- <v-menu :close-delay="1" :open-delay="0" v-bind="$attrs">
|
|
|
+ <v-menu v-if="defineProps.text" :close-delay="1" :open-delay="0" v-bind="$attrs">
|
|
|
<template v-slot:activator="{ isActive, props }">
|
|
|
<v-btn
|
|
|
style="height: 100%; font-size: 16px;"
|
|
@@ -24,7 +24,7 @@
|
|
|
</div> -->
|
|
|
<v-text-field
|
|
|
v-model="value"
|
|
|
- placeholder="搜索职位/公司"
|
|
|
+ :placeholder="defineProps.placeholder"
|
|
|
color="primary"
|
|
|
variant="plain"
|
|
|
density="compact"
|
|
@@ -47,9 +47,13 @@ const route = useRoute(); const router = useRouter()
|
|
|
const emits = defineEmits(['update:modelValue', 'handleSearch', 'handleJobClick'])// 定义一个或多个自定义事件
|
|
|
const defineProps = defineProps({
|
|
|
modelValue: [String, Number],
|
|
|
+ placeholder: {
|
|
|
+ type: String,
|
|
|
+ default: '搜索职位/公司'
|
|
|
+ },
|
|
|
text: {
|
|
|
type: String,
|
|
|
- default: '职位类型'
|
|
|
+ default: ''
|
|
|
},
|
|
|
})
|
|
|
|
|
@@ -67,16 +71,17 @@ watch(() => sharedState.layoutClickCount, () => {
|
|
|
});
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
- // 职位搜索页传参,其它的跳转到职位搜索页
|
|
|
- if (route.path !== '/recruit/position') {
|
|
|
- if (value.value) router.push(`/recruit/position?content=${value.value}`)
|
|
|
- else router.push('/recruit/position')
|
|
|
- } else emits('handleSearch', value.value)
|
|
|
+ // // 职位搜索页传参,其它的跳转到职位搜索页
|
|
|
+ // if (route.path !== '/recruit/position') {
|
|
|
+ // if (value.value) router.push(`/recruit/position?content=${value.value}`)
|
|
|
+ // else router.push('/recruit/position')
|
|
|
+ // } else emits('handleSearch', value.value)
|
|
|
+ emits('handleSearch', value.value)
|
|
|
}
|
|
|
|
|
|
const handleClickJob = (val) => {
|
|
|
// 职位搜索页点击传参, 其它的跳转到职位搜索页
|
|
|
- if (route.path !== '/recruit/position') router.push(`/recruit/position?positionId=${val.id}`)
|
|
|
+ if (route.path !== '/recruit/position') router.push(`/recruit/position?positionId=${val[0]}`)
|
|
|
else emits('handleJobClick', val)
|
|
|
}
|
|
|
|