|
@@ -1,20 +1,19 @@
|
|
|
<template>
|
|
|
<div class="mt-4">
|
|
|
<div class="d-flex justify-center">
|
|
|
- <TextInput v-model="query.content" :item="textItem" @enter="handleConfirm" @appendInnerClick="handleConfirm"></TextInput>
|
|
|
+ <TextInput v-model="queryParams.content" :item="textItem" @enter="handleConfirm" @appendInnerClick="handleConfirm"></TextInput>
|
|
|
</div>
|
|
|
- <!-- <div style="margin: auto; text-align: center; width: 70%"> -->
|
|
|
<div>
|
|
|
- <Position :selectData="position" @select="val => position = val"></Position>
|
|
|
- <Area @select="val => handleSearch('areaIds', val)"></Area>
|
|
|
- <CommonPage class="my-3" dictType="menduner_education_type" title="最高学历" @select="val => handleSearch('eduType', val)"></CommonPage>
|
|
|
- <CommonPage dictType="menduner_exp_type" title="工作经验" @select="val => handleSearch('expType', val)"></CommonPage>
|
|
|
+ <Position :isClear="clear" @clear="clear = false" :selectData="position" @select="val => position = val"></Position>
|
|
|
+ <Area :isClear="clear" @clear="clear = false" @select="val => handleSearch('areaIds', val)"></Area>
|
|
|
+ <CommonPage :isClear="clear" @clear="clear = false" class="my-3" dictType="menduner_education_type" title="最高学历" @select="val => handleSearch('eduType', val)"></CommonPage>
|
|
|
+ <CommonPage :isClear="clear" @clear="clear = false" dictType="menduner_exp_type" title="工作经验" @select="val => handleSearch('expType', val)"></CommonPage>
|
|
|
<v-divider class="mt-1 mb-3"></v-divider>
|
|
|
<div>
|
|
|
<div>
|
|
|
<v-chip v-for="k in position" :key="k.id" label class="mr-3" closable @click:close="handleClose(k)">{{ k.nameCn }}</v-chip>
|
|
|
</div>
|
|
|
- <div v-if="position.length" class="text-end font-size-15 color-999 cursor-pointer color-primary" @click="handleClear">清除选择</div>
|
|
|
+ <div class="text-end font-size-15 color-999 cursor-pointer color-999 clear" @click="handleClear">清空筛选条件</div>
|
|
|
</div>
|
|
|
<div class="text-center mt-3">
|
|
|
<v-btn class="half-button" color="primary" @click="handleConfirm">搜 索</v-btn>
|
|
@@ -50,9 +49,6 @@
|
|
|
<span class="defaultLink ml-3 mt-2">{{ item?.name }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- <template #actions="{ item }">
|
|
|
- <v-btn color="primary" variant="text" @click="handleCommunicate(item)">立即沟通</v-btn>
|
|
|
- </template> -->
|
|
|
</CtTable>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -67,10 +63,8 @@ import { getPersonSearchPage } from '@/api/enterprise.js'
|
|
|
import { dealDictArrayData } from '@/utils/position'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
-// import { talkToUser, defaultTextEnt } from '@/hooks/web/useIM'
|
|
|
-// import { useRouter } from 'vue-router'
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
-// const router = useRouter()
|
|
|
const textItem = ref({
|
|
|
type: 'text',
|
|
|
width: 600,
|
|
@@ -81,7 +75,9 @@ const textItem = ref({
|
|
|
})
|
|
|
const query = ref({
|
|
|
pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 10
|
|
|
+})
|
|
|
+const queryParams = ref({
|
|
|
content: null,
|
|
|
positionIds: [],
|
|
|
areaIds: [],
|
|
@@ -100,16 +96,13 @@ const headers = ref([
|
|
|
{ title: '所在城市', key: 'areaName', sortable: false },
|
|
|
{ title: '户籍地', key: 'regName', sortable: false },
|
|
|
{ title: '婚姻状况', key: 'maritalStatusName', sortable: false },
|
|
|
- { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item => timesTampChange(item.firstWorkTime, 'Y-M-D') },
|
|
|
- // { title: '联系电话', key: 'phone', sortable: false },
|
|
|
- // { title: '常用邮箱', key: 'email', sortable: false },
|
|
|
- // { title: '操作', key: 'actions', sortable: false }
|
|
|
+ { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item => timesTampChange(item.firstWorkTime, 'Y-M-D') }
|
|
|
])
|
|
|
|
|
|
const getData = async () => {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
- const res = await getPersonSearchPage(query.value)
|
|
|
+ const res = await getPersonSearchPage(Object.assign(queryParams.value, query.value))
|
|
|
if (!res.list.length) {
|
|
|
items.value = []
|
|
|
total.value = 0
|
|
@@ -131,32 +124,40 @@ const handleChangePage = (e) =>{
|
|
|
const position = ref([])
|
|
|
const handleSearch = (key, value) => {
|
|
|
query.value.pageNo = 1
|
|
|
- if (value === -1) query.value[key] = null
|
|
|
- else query.value[key] = value
|
|
|
+ queryParams.value[key] = value
|
|
|
+}
|
|
|
+
|
|
|
+const checkValue = (obj) => {
|
|
|
+ return Object.values(obj).some(value => {
|
|
|
+ return value !== null && value !== undefined && value !== '' && (Array.isArray(value) ? value.length > 0 : true)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const handleConfirm = () => {
|
|
|
const positionIds = position.value.map(k => k.id)
|
|
|
- query.value.positionIds = positionIds || []
|
|
|
+ queryParams.value.positionIds = positionIds || []
|
|
|
query.value.pageNo = 1
|
|
|
+ if (!checkValue(queryParams.value)) return Snackbar.warning('至少选择一个条件进行搜索')
|
|
|
getData()
|
|
|
}
|
|
|
|
|
|
-const handleClose = (item) => {
|
|
|
- position.value = position.value.filter(k => k.id !== item.id)
|
|
|
-}
|
|
|
-
|
|
|
+// 清空筛选条件
|
|
|
+const clear = ref(false)
|
|
|
const handleClear = () => {
|
|
|
position.value = []
|
|
|
+ queryParams.value = {
|
|
|
+ content: null,
|
|
|
+ positionIds: [],
|
|
|
+ areaIds: [],
|
|
|
+ expType: '',
|
|
|
+ eduType: ''
|
|
|
+ }
|
|
|
+ clear.value = true
|
|
|
}
|
|
|
|
|
|
-// 立即沟通
|
|
|
-// const handleCommunicate = async (item) => {
|
|
|
-// const userId = item.userId
|
|
|
-// await talkToUser({userId, text: defaultTextEnt})
|
|
|
-// let url = `/recruit/enterprise/chatTools?id=${userId}`
|
|
|
-// router.push(url)
|
|
|
-// }
|
|
|
+const handleClose = (item) => {
|
|
|
+ position.value = position.value.filter(k => k.id !== item.id)
|
|
|
+}
|
|
|
|
|
|
// 人才详情
|
|
|
const handleToPersonDetail = ({ userId, id }) => {
|
|
@@ -173,4 +174,7 @@ const badgeIcon = computed(() => (item) => {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+.clear:hover {
|
|
|
+ color: var(--v-primary-base);
|
|
|
+}
|
|
|
</style>
|