1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009 |
- <template>
- <div class="navbar">
- <div class="pageTitle">{{ this.$route.meta.title }}</div>
- <!--收缩左侧菜单按钮-->
- <!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
- <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" /> -->
- <div class="right-menu">
- <!--搜索,全屏,大小写转换和翻译-->
- <!-- <template v-if="device!=='mobile'">
- <search id="header-search" class="right-menu-item" />
- <error-log class="errLog-container right-menu-item hover-effect" />
- <screenfull id="screenfull" class="right-menu-item hover-effect" />
- <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
- <size-select id="size-select" class="right-menu-item hover-effect" />
- </el-tooltip>
- <lang-select class="right-menu-item hover-effect" />
- </template> -->
- <div class="noticeIconBox">
- <img src="@/assets/public/nav/notice1.png" class="noticeIconImg" @click="showTabs = !showTabs" />
- <span class="unreadCount">{{ msg.count }}</span>
- <!-- <img src="@/assets/public/nav/arrowDown.png" class="arrowDown" /> -->
- <div class="noticeTabsBox" v-if="showTabs" ref="noticeTabsBox">
- <div class="noticeTabsTitleBox">
- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 1 }" @click="changeTabs(1)">
- <div class="noticeTabsItem">
- 资讯
- <span class="noticeMessageNew" v-if="msg.apply_articale.length > 0"></span>
- </div>
- </div>
- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 2 }" @click="changeTabs(2)">
- <div class="noticeTabsItem">
- 商品
- <span class="noticeMessageNew" v-if="msg.good.length > 0"></span>
- </div>
- </div>
- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 4 }" @click="changeTabs(4)">
- <div class="noticeTabsItem">
- 书刊
- <span class="noticeMessageNew" v-if="msg.book.length > 0"></span>
- </div>
- </div>
- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 3 }" @click="changeTabs(3)">
- <div class="noticeTabsItem">
- 求职招聘
- <span class="noticeMessageNew"
- v-if="msg.job_hunting.length > 0 || msg.job_recruiting.length > 0 || msg.job_apply.length > 0 || msg.job_resume.length > 0">
- </span>
- </div>
- </div>
- </div>
- <div class="noticeTabsLine" v-if="tabsIndex == 3" style="height: 20px; margin: 0px; margin-top: -20px;">
- <ul class="noticeTabsLink">
- <li v-if="userType == 1">
- 求职
- </li>
- <li v-if="userType == 3">
- 招聘
- </li>
- </ul>
- <ul class="noticeTabsLink" v-if="userType == 10000">
- <li v-if="qiu" @click="changeJob(1)">
- 求职
- <img src="@/assets/public/nav/arrowDown.png" class="arrowDown" />
- </li>
- <li v-if="zhao" @click="changeJob(2)">
- 招聘
- <img src="@/assets/public/nav/arrowDown.png" class="arrowDown" />
- </li>
- </ul>
- </div>
- <div class="noticeTabsLinkLine">
- <div v-if="userType == 10000 || userType == 1 || userType == 3">
- <div v-if="tabsIndex == 1" @click="goToPath(1, 0)">待审核列表</div>
- <div v-if="tabsIndex == 2" @click="goToPath(2, 0)">待审核列表</div>
- <div class="qiuFlex" v-if="tabsIndex == 3 && qiu == true && (userType == 10000 || userType == 1)"
- @click="goToPath(3, 0)">
- <span :class="{ 'qiuPillow': true, 'qiuPillowHover': qiu1 == true }" @mouseover="handleQiu(1)"
- @click="goToPath(3.1, 0)">待审核列表</span>
- <span :class="{ 'qiuPillow': true, 'qiuPillowHover': qiu2 == true }" @mouseover="handleQiu(2)"
- @click="goToPath(3.2, 0)">职场机会</span>
- </div>
- <div class="qiuFlex" v-if="tabsIndex == 3 && zhao == true && (userType == 10000 || userType == 3)"
- @click="goToPath(3, 0)">
- <span :class="{ 'qiuPillow': true, 'qiuPillowHover': zhao1 == true }" @mouseover="handleQiu(3)"
- @click="goToPath(3.3, 0)">待审核列表</span>
- <span :class="{ 'qiuPillow': true, 'qiuPillowHover': zhao2 == true }" @mouseover="handleQiu(4)"
- @click="goToPath(3.4, 0)">人才库</span>
- </div>
- <div v-if="tabsIndex == 4" @click="goToPath(4, 0)">待审核列表</div>
- </div>
- <div v-else>
- <div v-if="tabsIndex == 1" @click="goToPath(1, -1)">资讯列表</div>
- <div v-if="tabsIndex == 2" @click="goToPath(2, -1)">商品列表</div>
- <div v-if="tabsIndex == 3" @click="goToPath(3, -1)">求职招聘列表</div>
- <div v-if="tabsIndex == 4" @click="goToPath(4, -1)">书刊列表</div>
- </div>
- </div>
- <div class="noticeTabsDataBox" v-if="tabsIndex == 1">
- <div v-if="msg.apply_articale && msg.apply_articale.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.apply_articale" :key="item.id"
- @click="goToPath(1, item.id)">
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.title }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <div class="noticeTabsDataBox" v-if="tabsIndex == 2">
- <div v-if="msg.good && msg.good.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.good" :key="item.id" @click="goToPath(2, item.id)">
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.name }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 求职信息 待审核 -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && qiu == true && qiu1 == true && userType == 10000">
- <div v-if="msg.job_hunting && msg.job_hunting.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_hunting" :key="item.id"
- @click="goToPath(3.1, item.id)">
- <!-- 待审核求职 -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ':' + item.website_name + '-' + '发布求职信息了' }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 求职信息 职场机会 -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && qiu == true && qiu2 == true && userType == 10000">
- <div v-if="msg.job_apply && msg.job_apply.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_apply" :key="item.id"
- @click="goToPath(3.2, item.recruit_id)">
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.business_name + ':' + item.website_name + ' ' + '关注了' +
- item.user_name
- + '的简历' }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 招聘信息 招聘信息 job_recruiting -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && zhao == true && zhao1 == true && userType == 10000">
- <div v-if="msg.job_recruiting && msg.job_recruiting.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_recruiting" :key="item.id"
- @click="goToPath(3.3, item.id)">
- <!-- 招聘信息 job_recruiting -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ':' + item.website_name + ' ' + '-' + item.title
- + '岗位' }}
- </div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 招聘信息 人才库 job_apply -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && zhao == true && zhao2 == true && userType == 10000">
- <div v-if="msg.job_apply && msg.job_apply.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_apply" :key="item.id"
- @click="goToPath(3.4, item.hunt_id)">
- <!-- 人才库 job_apply -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ': 求职了' + '-' + item.business_name +
- '-' +
- item.job_name }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 求职信息 待审核 -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && qiu == true && qiu1 == true && userType == 1">
- <div v-if="msg.job_hunting && msg.job_hunting.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_hunting" :key="item.id"
- @click="goToPath(3.1, item.id)">
- <!-- 待审核求职 -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ':' + item.website_name + '-' + '发布求职信息了' }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 求职信息 职场机会 -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && qiu == true && qiu2 == true && userType == 1">
- <div v-if="msg.job_apply && msg.job_apply.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_apply" :key="item.id"
- @click="goToPath(3.2, item.recruit_id)">
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.business_name + ':' + item.website_name + ' ' + '关注了' +
- item.user_name
- + '的简历' }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 招聘信息 招聘信息 job_recruiting -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && zhao == true && zhao1 == true && userType == 3">
- <div v-if="msg.job_recruiting && msg.job_recruiting.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_recruiting" :key="item.id"
- @click="goToPath(3.3, item.id)">
- <!-- 招聘信息 job_recruiting -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ':' + item.website_name + ' ' + '-' + item.title
- + '岗位' }}
- </div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <!-- 招聘信息 人才库 job_apply -->
- <div class="noticeTabsDataBox" v-if="tabsIndex == 3 && zhao == true && zhao2 == true && userType == 3">
- <div v-if="msg.job_apply && msg.job_apply.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.job_apply" :key="item.id"
- @click="goToPath(3.4, item.hunt_id)">
- <!-- 人才库 job_apply -->
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.user_name + ': 求职了' + '-' + item.business_name +
- '-' +
- item.job_name }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- <div class="noticeTabsDataBox" v-if="tabsIndex == 4">
- <div v-if="msg.book && msg.book.length > 0">
- <div class="noticeTabsDataItem" v-for="item in msg.book" :key="item.id" @click="goToPath(4, item.id)">
- <div class="noticeTabsDataItemImg newsIcon">
- <img src="@/assets/public/nav/message-news.png">
- </div>
- <div class="noticeTabsDataItemContent">
- <div class="noticeNewsTitle">{{ item.title }}</div>
- <div class="noticeNewsTime">{{ item.updated_at }}</div>
- </div>
- </div>
- </div>
- <div v-else class="noticeTabsDataItemEmpty">
- <div class="noticeEmpty">
- <img src="@/assets/public/nav/message-empty.png">
- </div>
- <div class="noticeEmptyText">
- 暂无消息
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 用户头像和菜单 -->
- <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
- <div class="avatar-wrapper">
- <!-- <img src="@/assets/public/nav/notice.png" class="user-notice"> -->
- <img :src="avatar + '?imageView2/1/w/80/h/80'" class="user-avatar" v-if="avatar != ''">
- <img src="@/assets/login/userDefault.png" class="user-avatar" v-else>
- <span class="userName">{{ this.$store.state.user.name }}</span>
- <img src="@/assets/public/nav/arrowDown.png" class="arrowDown">
- <!--向下按钮-->
- <!-- <i class="el-icon-caret-bottom" /> -->
- </div>
- <el-dropdown-menu slot="dropdown">
- <router-link to="/profile/index">
- <div class="userMenuDownItem">
- <el-dropdown-item>
- <span style="display:block;">{{ $t('navbar.profile') }}</span>
- </el-dropdown-item>
- </div>
- </router-link>
- <!-- <router-link to="/">
- <el-dropdown-item>
- {{ $t('navbar.dashboard') }}
- </el-dropdown-item>
- </router-link>
- <a target="_blank" href="https://github.com/PanJiaChen/vue-element-admin/">
- <el-dropdown-item>
- {{ $t('navbar.github') }}
- </el-dropdown-item>
- </a>
- <a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
- <el-dropdown-item>Docs</el-dropdown-item>
- </a> -->
- <el-dropdown-item divided @click.native="logout">
- <div class="userMenuDownItem">
- <span style="display:block;">{{ $t('navbar.logOut') }}</span>
- <img src="@/assets/public/nav/Logout.png">
- </div>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import Breadcrumb from '@/components/Breadcrumb'
- import Hamburger from '@/components/Hamburger'
- import ErrorLog from '@/components/ErrorLog'
- import Screenfull from '@/components/Screenfull'
- import SizeSelect from '@/components/SizeSelect'
- import LangSelect from '@/components/LangSelect'
- import Search from '@/components/HeaderSearch'
- import axios from 'axios';
- import router, { resetRouter } from '@/router'
- import BASEURL from '@/utils/baseUrl'
- import { getUseType, removeLoginStatus } from '@/utils/auth'
- export default {
- components: {
- Breadcrumb,
- Hamburger,
- ErrorLog,
- Screenfull,
- SizeSelect,
- LangSelect,
- Search
- },
- data() {
- return {
- msg: {},
- userType: '', //用户类型
- tabsIndex: 1, //显示哪个选项卡
- showTabs: false, //是否显示悬浮菜单
- //求职招聘
- qiu: false,
- zhao: true,
- qiu1: true,
- qiu2: false,
- zhao1: true,
- zhao2: false,
- }
- },
- computed: {
- ...mapGetters([
- 'sidebar',
- 'avatar',
- 'device'
- ]),
- },
- mounted() {
- this.getMsg();
- //获得用户类型
- this.userType = getUseType();
- if (this.userType == 1) {
- this.qiu = true;
- }
- // 添加点击事件监听器
- document.addEventListener('click', this.handleClickOutside);
- },
- beforeDestroy() {
- // 组件销毁前移除事件监听器
- document.removeEventListener('click', this.handleClickOutside);
- },
- methods: {
- //0.收缩菜单 start---------------------------------------->
- toggleSideBar() {
- this.$store.dispatch('app/toggleSideBar')
- },
- //0.收缩菜单 end---------------------------------------->
- //1.退出登录 start---------------------------------------->
- logout() {
- //获取 token
- const token = this.getTokenFromCookie();
- // 新做的,待替换
- // this.$store.dispatch('user/logoutapi', {token: token}).then(response => {
- // //重置访问过的路由
- // resetRouter()
- // dispatch('tagsView/delAllViews', null, { root: true })
- // console.log(response);
- // this.$store.commit("user/LOGOUT");
- // this.$router.push(`/login`);
- // }).catch(error => {
- // this.$store.commit("user/LOGOUT");
- // this.$router.push(`/login`);
- // });
- axios.get(BASEURL.WebCLogoutUrl, { params: { token: token } }).then(response => {
- console.log(response);
- this.$store.commit("user/LOGOUT");
- //this.$router.push(`/login`);
- //刷新页面
- window.location.reload();
- }).catch(error => {
- console.log(error);
- this.$store.commit("user/LOGOUT");
- //this.$router.push(`/login`);
- //this.$message.error(response.message);
- window.location.reload();
- });
- removeLoginStatus();
- },
- // async logout() {
- // await this.$store.dispatch('user/logout')
- // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
- // },
- getTokenFromCookie() {
- const name = "Admin-Token=";
- const decodedCookie = decodeURIComponent(document.cookie);
- const cookieArray = decodedCookie.split(';');
- for (let i = 0; i < cookieArray.length; i++) {
- let cookie = cookieArray[i].trim();
- if (cookie.indexOf(name) === 0) {
- return cookie.substring(name.length, cookie.length); // 返回 token
- }
- }
- return ""; // 如果没有找到 token,返回空字符串
- },
- //1.退出登录 end---------------------------------------->
- //2.通知消息 start---------------------------------------->
- //2.1 获取通知消息列表
- getMsg() {
- this.$store.dispatch('news/getMSG').then(response => {
- //console.log('response1111111111', response);
- this.msg = response.data;
- // console.log(this.msg);
- }).catch(error => {
- console.log(error);
- });
- },
- //2.2 切换
- changeTabs(index) {
- this.tabsIndex = index;
- },
- //2.3跳转方法
- goToPath(type, id) {
- //如果id是0 跳转到列表
- if (id == 0) {
- if (type == 1) {
- this.$router.push(`/examine`);
- } else if (type == 2) {
- this.$router.push(`/goodListApply`);
- } else if (type == 3.1) { //求职 待审核
- this.$router.push(`/jobHuntingListApply`);
- }
- else if (type == 3.2) { // 职场机会
- this.$router.push(`/jobOpportunities`);
- }
- else if (type == 3.3) { // 招聘 待审核
- this.$router.push(`/checkjobRecruitingList`);
- }
- else if (type == 3.4) { // 人才库
- this.$router.push(`/jobHuntingApplyList`);
- }
- else if (type == 4) {
- this.$router.push(`/bookListApply`);
- }
- } else if (id == -1) {
- if (type == 1) {
- this.$router.push(`/articleList`);
- } else if (type == 2) {
- this.$router.push(`/goodList`);
- } else if (type == 3) {
- this.$router.push(`/jobHuntingList`);
- }
- else if (type == 3.1) { //求职 待审核
- this.$router.push(`/jobHuntingList`);
- }
- else if (type == 3.2) { // 职场机会
- this.$router.push(`/jobOpportunities`);
- }
- else if (type == 3.3) { // 招聘 待审核
- this.$router.push(`/jobRecruitingList`);
- }
- else if (type == 3.4) { // 人才库
- this.$router.push(`/jobHuntingApplyList`);
- }
- else if (type == 4) {
- this.$router.push(`/bookList`);
- }
- } else {
- if (type == 1) {
- this.$router.push(`/creatNews?id=${id}`);
- } else if (type == 2) {
- this.$router.push(`/addGood?id=${id}`);
- } else if (type == 3) {
- this.$router.push(`/addJobHunting?id=${id}`);
- }
- else if (type == 3.1) { //求职 待审核
- this.$router.push(`/addJobHunting?id=${id}`);
- }
- else if (type == 3.2) { // 职场机会
- this.$router.push(`/jobOpportunitiesDetails?id=${id}`);
- }
- else if (type == 3.3) { // 招聘 待审核
- this.$router.push(`/creatJob?id=${id}`);
- }
- else if (type == 3.4) { // 人才库
- this.$router.push(`/jobHuntingApplyDetil?id=${id}`);
- }
- else if (type == 4) {
- this.$router.push(`/addBook?id=${id}`);
- }
- }
- this.showTabs = false;
- },
- // 添加处理点击外部的方法
- handleClickOutside(event) {
- const noticeTabsBox = this.$refs.noticeTabsBox;
- const noticeIconImg = event.target.closest('.noticeIconImg');
- // 如果点击的不是通知图标,并且点击的区域不在通知框内,则关闭通知框
- if (!noticeIconImg && noticeTabsBox && !noticeTabsBox.contains(event.target)) {
- this.showTabs = false;
- }
- },
- //2.通知消息 end---------------------------------------->
- changeJob(index) {
- if (index == 1) {
- this.qiu = false;
- this.zhao = true;
- } else if (index == 2) {
- this.qiu = true;
- this.zhao = false;
- }
- },
- handleQiu(index) {
- if (index == 1) {
- this.qiu1 = true;
- this.qiu2 = false;
- } else if (index == 2) {
- this.qiu1 = false;
- this.qiu2 = true;
- } else if (index == 3) {
- this.zhao1 = true;
- this.zhao2 = false;
- } else if (index == 4) {
- this.zhao1 = false;
- this.zhao2 = true;
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .navbar {
- height: 60px;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- background: #fff;
- // box-shadow: 0 1px 4px rgba(0,21,41,.08);
- border-bottom: 1px solid #E9EDF7;
- .pageTitle {
- font-size: 20px;
- font-weight: bold;
- padding-left: 30px;
- color: #45464E;
- }
- .userName {
- font-size: 14px;
- color: #1C1D22;
- margin-left: 10px;
- font-weight: bold;
- }
- .hamburger-container {
- line-height: 46px;
- height: 100%;
- float: left;
- cursor: pointer;
- transition: background .3s;
- -webkit-tap-highlight-color: transparent;
- &:hover {
- background: rgba(0, 0, 0, .025)
- }
- }
- .breadcrumb-container {
- float: left;
- }
- .errLog-container {
- display: inline-block;
- vertical-align: top;
- }
- .right-menu {
- float: right;
- height: 100%;
- line-height: 50px;
- display: flex;
- align-items: center;
- position: relative;
- &:focus {
- outline: none;
- }
- .right-menu-item {
- display: inline-block;
- padding: 0 8px;
- height: 100%;
- font-size: 18px;
- color: #5a5e66;
- vertical-align: text-bottom;
- &.hover-effect {
- cursor: pointer;
- transition: background .3s;
- &:hover {
- background: rgba(0, 0, 0, .025)
- }
- }
- }
- .avatar-container {
- margin-right: 30px;
- .avatar-wrapper {
- margin-top: 5px;
- display: flex;
- align-items: center;
- .user-avatar {
- cursor: pointer;
- width: 32px;
- height: 32px;
- }
- .arrowDown {
- width: 12px;
- height: 8px;
- margin-left: 10px;
- }
- .user-notice {
- width: 20px;
- height: 20px;
- margin-right: 20px;
- }
- .el-icon-caret-bottom {
- cursor: pointer;
- position: absolute;
- right: -20px;
- top: 25px;
- font-size: 12px;
- }
- }
- }
- //通知消息 图标
- .noticeIconBox {
- width: 45px;
- height: 50px;
- box-sizing: border-box;
- padding-top: 8px;
- position: relative;
- .noticeIconImg {
- width: 34px;
- height: 34px;
- cursor: pointer;
- }
- .unreadCount {
- position: absolute;
- top: 5px;
- right: 10px;
- width: 16px;
- height: 16px;
- background: #FF4E4E;
- font-size: 12px;
- line-height: 16px;
- text-align: center;
- color: #fff;
- border-radius: 50%;
- }
- //通知消息 悬浮菜单
- .noticeTabsBox {
- position: absolute;
- width: 380px;
- height: 640px;
- border-radius: 8px;
- background: #fff;
- z-index: 999;
- right: 20px;
- top: 50px;
- box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.15);
- padding: 25px 20px;
- box-sizing: border-box;
- .noticeTabsTitleBox {
- display: flex;
- align-items: center;
- border-bottom: 1px solid #E9EDF7;
- .noticeTabs {
- height: 41px;
- border-bottom: 2px solid #fff;
- margin-right: 40px;
- display: flex;
- cursor: pointer;
- .noticeTabsItem {
- height: 20px;
- line-height: 20px;
- font-size: 16px;
- position: relative;
- .noticeMessageNew {
- width: 5px;
- height: 5px;
- border-radius: 50%;
- background: #FF4E4E;
- position: absolute;
- right: -5px;
- top: 0;
- }
- }
- }
- .active {
- border-bottom: 2px solid #5570F1;
- }
- }
- .noticeTabsLinkLine {
- height: 38px;
- box-sizing: border-box;
- font-size: 14px;
- cursor: pointer;
- background: #F5F7FB;
- border: 1px solid #E3E8FA;
- text-align: center;
- line-height: 38px;
- border-radius: 8px;
- margin: 20px 0;
- }
- .noticeTabsDataBox {
- .noticeTabsDataItem {
- display: flex;
- align-items: flex-start;
- cursor: pointer;
- border-radius: 8px;
- box-sizing: border-box;
- padding: 5px 10px;
- &:hover {
- background: #F5F7FB;
- }
- height: 95px;
- .noticeTabsDataItemImg {
- border-radius: 50%;
- width: 26px;
- height: 26px;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 15px;
- margin-top: 6px;
- }
- .newsIcon {
- background: #BAC5F8;
- }
- .noticeTabsDataItemContent {
- flex: 1;
- .noticeNewsTitle {
- font-size: 14px;
- line-height: 28px;
- height: 56px;
- color: #333;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .noticeNewsTime {
- height: 30px;
- line-height: 30px;
- font-size: 14px;
- color: #999;
- }
- }
- }
- .noticeTabsDataItemEmpty {
- .noticeEmpty {
- text-align: center;
- padding-top: 150px;
- box-sizing: border-box;
- }
- .noticeEmptyText {
- text-align: center;
- color: #999;
- font-size: 14px;
- }
- }
- }
- }
- }
- }
- }
- .userMenuDownItem {
- width: 100px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .el-dropdown-menu__item:not(.is-disabled):hover {
- background: none;
- color: #606266;
- }
- .unread-count {
- position: relative;
- display: inline-block;
- width: 20px;
- height: 20px;
- border-radius: 50%;
- background-color: red;
- color: white;
- font-size: 12px;
- text-align: center;
- line-height: 20px;
- margin-left: -40px;
- margin-top: -20px;
- /* 调整位置,使其贴合通知图标 */
- }
- /* 如果未读数量为 0,则隐藏角标 */
- .unread-count:empty {
- display: none;
- }
- .noticeTabsLink {
- padding-left: 10px;
- // 去掉圆点
- list-style: none;
- }
- .qiuPillow {
- border-radius: 4px;
- padding: -1px;
- width: 48%;
- height: 36px;
- display: block;
- }
- .qiuPillowHover {
- border-radius: 4px;
- padding: -1px;
- width: 48%;
- height: 36px;
- background: #dfe9ee;
- border: #dfe1e7 1px solid;
- }
- .qiuFlex {
- display: flex;
- justify-content: space-between;
- text-align: center;
- }
- </style>
|