123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <template>
- <div>
- <div class="position-item mb-3 job-closed" style="position: relative;" :class="val.active ? 'elevation-8' : 'elevation-3'"
- v-for="(val, i) in props.items" :key="i" @mouseenter="val.active = true" @mouseleave="val.active = false"
- >
- <div class="info-header">
- <div v-if="val.active && val.job.status === '0'" class="header-btn">
- <v-btn v-if="showCancelDeliveryResumeBtn && val.cvRel?.status === '0'" class="MiSans-Medium" color="primary" size="small" @click.stop="emits('cancelDeliveryResume', val.cvRel.id)">撤销投递简历</v-btn>
- <v-btn v-if="props.showCancelBtn" class="half-button ml-3 MiSans-Medium" color="primary" size="small" @click.stop="handleCancel(val)">取消收藏</v-btn>
- <v-btn class="half-button ml-3 MiSans-Medium" color="primary" size="small" @click.stop="toDetails(val)">立即沟通</v-btn>
- </div>
- <div v-if="val.job.status === '1'" class="font-size-14 header-btn color-error">职位已关闭</div>
- <div class="img-box">
- <v-avatar :image="getUserAvatar(val.contact.avatar, val.contact.sex)" size="x-small"></v-avatar>
- <span class="name">
- <span class="mx-3">{{ val.contact.name }}</span>
- <span class="gray">{{ val.contact.postNameCn }}</span>
- </span>
- </div>
- </div>
- <div class="info-content" >
- <div class="job-info">
- <div class="job-name ellipsis" :class="{'cursor-pointer': val.job.status === '0'}" v-ellipse-tooltip>
- <!-- <svg-icon v-if="val.job.bizId" name="jobFair" size="18" class="mr-1"></svg-icon> -->
- <span class="mr-3" :class="{'info-name': val.job.status === '0'}" @click.stop="handleToPositionDetails(val)">{{ formatName(val.job.name) }}</span>
- <span>
- [{{ !val.job.areaId ? '全国' : val.job.area?.str }}]
- </span>
- </div>
- <div class="job-other">
- <span v-if="!val.job.payFrom && !val.job.payTo" class="salary color-primary">面议</span>
- <span v-else class="salary color-primary">{{ val.job.payFrom ? val.job.payFrom + '-' : ''}}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
- <v-chip v-if="val.job?.expName" class="mx-3" color="primary" label size="small">{{ val.job.expName }}</v-chip>
- <v-chip v-if="val.job?.eduName" color="primary" label size="small">{{ val.job.eduName }}</v-chip>
- </div>
- </div>
- <div class="company-info ml-3" style="flex: 1;">
- <div style="height: 50px; width: 50px;">
- <v-img width="50" height="50" :src="val.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/7.png'" rounded contain></v-img>
- </div>
- <div class="ml-3">
- <div class="cursor-pointer info-name" v-ellipse-tooltip @click.stop="jumpToEnterpriseDetail(val.enterprise.id)">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</div>
- <div class="mt-3 ellipsis color-666 font-size-13" style="max-width: 260px;">
- <span v-for="(k, i) in desc" :key="k">
- {{ val.enterprise[k] }}
- <span v-if="i !== desc.length - 1 && val.enterprise[k] && val.enterprise[desc[i + 1]]" class="septal-line"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 快速登录 -->
- <loginPage v-if="showLogin" @loginSuccess="loginSuccess" @close="loginClose"></loginPage>
- </div>
- </template>
- <script setup>
- defineOptions({ name: 'longStrip'})
- import { getPersonJobUnfavorite } from '@/api/position'
- import { useI18n } from '@/hooks/web/useI18n'
- import Snackbar from '@/plugins/snackbar'
- import { getUserAvatar } from '@/utils/avatar'
- import { useRouter } from 'vue-router'
- import { ref } from 'vue'
- import { prologue, defaultText } from '@/hooks/web/useIM'
- import loginPage from '@/views/common/loginDialog.vue'
- import { getToken } from '@/utils/auth'
- import { checkPersonBaseInfo } from '@/utils/check'
- import dialogExtend from '@/plugins/dialogExtend'
- import { formatName } from '@/utils/getText'
- import { jumpToEnterpriseDetail } from '@/utils/position'
- const emits = defineEmits(['refresh', 'cancelDeliveryResume'])
- const { t } = useI18n()
- const props = defineProps({
- items: {
- type: Array,
- default: () => []
- },
- // 是否展示取消收藏按钮
- showCancelBtn: {
- type: Boolean,
- default: false
- },
- // 是否显示取消投递简历按钮
- showCancelDeliveryResumeBtn: {
- type: Boolean,
- default: false
- }
- })
- const router = useRouter()
- const desc = ['industryName', 'scaleName']
- const handleCancel = async (item) => {
- if (!item.job.id) return Snackbar.warning(t('sys.api.operationFailed'))
- await getPersonJobUnfavorite(item.job.id)
- emits('refresh')
- Snackbar.success(t('common.operationSuccessful'))
- }
- // 职位详情
- const handleToPositionDetails = (item) => {
- if (item.job.status === '1') return
- let path = `/recruit/personal/position/details/${item.job.id}`
- if (item.cvRel?.jobFairId) path += `?jobFairId=${item.cvRel.jobFairId}`
- router.push(path)
- }
- let toDetailsInfo = {}
- // 立即沟通
- const toDetails = async (info) => {
- if (info) toDetailsInfo = info // 快速登录弹窗回调使用
- else info = toDetailsInfo
- if (!getToken()) {
- showLogin.value = true // 打开快速登录弹窗
- Snackbar.warning('您还未登录,请先登录后再试')
- //
- loginCloseWarningWord = '您已取消登录,无法对职位进行沟通' // 取消登录提示语
- nextFunc.value = toDetails // 登录成功后要执行的操作 (toDetails执行不成功,原因未找到)
- return
- }
- if (!checkPersonBaseInfo()) { // 强制填写个人信息
- dialogExtend('necessaryInfoDialog').then(() => {
- toDetails(toDetailsInfo)
- })
- return
- }
- const userId = info.contact.userId
- const enterpriseId = info.contact.enterpriseId
- const textObj = {
- text: defaultText,
- positionInfo: { ...info.job, enterprise: info.enterprise, contact: info.contact },
- }
- await prologue({userId, enterpriseId, text: JSON.stringify(textObj)})
- let url = `/recruit/personal/message?id=${info.job.id}`
- if (info.contact.enterpriseId) {
- url += `&enterprise=${info.contact.enterpriseId}`
- }
- window.open(url)
- }
- const showLogin = ref(false)
- const nextFunc = ref(null)
- let loginCloseWarningWord = ''
- // 快速登录
- const loginSuccess = () => {
- showLogin.value = false
- Snackbar.success('登录成功')
- if (nextFunc.value) nextFunc.value()
- }
- const loginClose = () => {
- showLogin.value = false
- Snackbar.warning(loginCloseWarningWord)
- }
- </script>
- <style scoped lang="scss">
- .position-item {
- height: 144px;
- background-color: #fff;
- border-radius: 12px;
- .info-header {
- height: 48px;
- background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
- border-radius: 12px;
- .img-box {
- padding: 12px 24px;
- .name {
- color: var(--color-222);
- font-weight: 400;
- font-size: 13px;
- .gray {
- color: var(--color-666);
- }
- }
- }
- .header-btn {
- padding: 10px 10px 0 0;
- float: right;
- .v-btn {
- z-index: 1;
- }
- }
- }
- .info-content {
- display: flex;
- padding: 16px 24px;
- justify-content: space-between;
- .job-info {
- width: 430px;
- min-width: 430px;
- max-width: 430px;
- font-weight: 500;
- font-size: 16px;
- .job-name {
- width: 100%;
- height: 22px;
- line-height: 22px;
- color: #0E100F;
- margin-bottom: 12px;
- }
- .job-other {
- color: var(--v-error-base);
- height: 22px;
- line-height: 22px;
- }
- }
- .company-info {
- display: flex;
- align-items: center
- }
- .interview-info {
- color: var(--color-333);
- font-size: 15px;
- }
- }
- }
- .info-name:hover {
- color: var(--v-primary-base);
- }
- </style>
|