西海岸:点击图标进入首页增加权限判断

This commit is contained in:
guoyue 2022-10-18 10:45:40 +08:00
parent 2ebec87514
commit 5f3aad2539
1 changed files with 460 additions and 490 deletions

View File

@ -1,11 +1,8 @@
<template> <template>
<div <div class="home-header" :class="[
class="home-header"
:class="[
select !== 'home' || scrollTop > 500 ? 'white' : '', select !== 'home' || scrollTop > 500 ? 'white' : '',
props.showView === 'algorithm-details' ? '' : '', props.showView === 'algorithm-details' ? '' : '',
]" ]">
>
<div class="name" @click="goToHome"> <div class="name" @click="goToHome">
<div class="name-bg" v-if="!itShowXiHaiAn"></div> <div class="name-bg" v-if="!itShowXiHaiAn"></div>
<div class="name-bg-xihaian" v-else></div> <div class="name-bg-xihaian" v-else></div>
@ -14,52 +11,26 @@
<p>(United Capacity System)</p> <p>(United Capacity System)</p>
</div> </div>
</div> </div>
<div <div v-for="item in navList" :key="item.key" @click="jumpPage(item)" class="nav"
v-for="item in navList" :class="item.key == select ? 'select' : ''">
:key="item.key"
@click="jumpPage(item)"
class="nav"
:class="item.key == select ? 'select' : ''"
>
{{ item.name }} {{ item.name }}
</div> </div>
<!-- 购物车 --> <!-- 购物车 -->
<a-badge :count="sgcNum"> <a-badge :count="sgcNum">
<svg <svg t="1650455446850" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
t="1650455446850" p-id="2069" width="0.4rem" height="0.4rem" @click="goToSgc">
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2069"
width="0.4rem"
height="0.4rem"
@click="goToSgc"
>
<path <path
d="M384 832v85.333333h-85.333333v-85.333333h85.333333z m405.333333 0v85.333333h-85.333333v-85.333333h85.333333zM240.32 185.002667l24.149333 140.928h633.173334L835.285333 746.666667h-563.626666l-85.333334-497.685334H94.485333v-64h145.834667z m583.104 204.928H275.434667L325.632 682.666667h454.464l43.328-292.736z" d="M384 832v85.333333h-85.333333v-85.333333h85.333333z m405.333333 0v85.333333h-85.333333v-85.333333h85.333333zM240.32 185.002667l24.149333 140.928h633.173334L835.285333 746.666667h-563.626666l-85.333334-497.685334H94.485333v-64h145.834667z m583.104 204.928H275.434667L325.632 682.666667h454.464l43.328-292.736z"
:fill="props.showView === 'algorithm-details' ? '#1296db' : '#1296db'" :fill="props.showView === 'algorithm-details' ? '#1296db' : '#1296db'" p-id="2070"></path>
p-id="2070"
></path>
</svg> </svg>
</a-badge> </a-badge>
<a-badge :count="mynoticeNum" style="margin-left: 0.2rem"> <a-badge :count="mynoticeNum" style="margin-left: 0.2rem">
<!-- 消息提醒 --> <!-- 消息提醒 -->
<svg <svg t="1654051054113" class="icon2" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
t="1654051054113" p-id="2187" width="0.35rem" height="0.35rem">
class="icon2"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2187"
width="0.35rem"
height="0.35rem"
>
<path <path
d="M544 161.536a330.666667 330.666667 0 0 1 298.666667 329.130667h-0.341334c0.213333 1.493333 0.341333 2.986667 0.341334 4.565333v219.434667h39.68a32 32 0 0 1 0 64h-212.053334a160 160 0 0 1-316.586666 0H141.909333a32 32 0 1 1 0-64h39.424v-219.434667c0-1.578667 0.128-3.072 0.341334-4.565333H181.333333a330.666667 330.666667 0 0 1 298.666667-329.130667V128a32 32 0 1 1 64 0v33.536z m-298.666667 553.130667h533.333334v-219.434667c0-1.578667 0.128-3.072 0.341333-4.565333h-0.341333a266.666667 266.666667 0 1 0-533.333334 0h-0.341333c0.213333 1.493333 0.341333 2.986667 0.341333 4.565333v219.434667z m359.765334 64H418.901333a96 96 0 0 0 186.197334 0z" d="M544 161.536a330.666667 330.666667 0 0 1 298.666667 329.130667h-0.341334c0.213333 1.493333 0.341333 2.986667 0.341334 4.565333v219.434667h39.68a32 32 0 0 1 0 64h-212.053334a160 160 0 0 1-316.586666 0H141.909333a32 32 0 1 1 0-64h39.424v-219.434667c0-1.578667 0.128-3.072 0.341334-4.565333H181.333333a330.666667 330.666667 0 0 1 298.666667-329.130667V128a32 32 0 1 1 64 0v33.536z m-298.666667 553.130667h533.333334v-219.434667c0-1.578667 0.128-3.072 0.341333-4.565333h-0.341333a266.666667 266.666667 0 1 0-533.333334 0h-0.341333c0.213333 1.493333 0.341333 2.986667 0.341333 4.565333v219.434667z m359.765334 64H418.901333a96 96 0 0 0 186.197334 0z"
:fill="props.showView === 'algorithm-details' ? '#1296db' : '#1296db'" :fill="props.showView === 'algorithm-details' ? '#1296db' : '#1296db'" p-id="2188"></path>
p-id="2188"
></path>
</svg> </svg>
<!-- <a-avatar shape="square" size="large" /> --> <!-- <a-avatar shape="square" size="large" /> -->
</a-badge> </a-badge>
@ -88,10 +59,7 @@
<template #title> <template #title>
<span>{{ user.realName }}</span> <span>{{ user.realName }}</span>
</template> </template>
<span <span class="name" @click="jumpPage({ name: '个人中心', key: 'personalCenter' })">
class="name"
@click="jumpPage({ name: '个人中心', key: 'personalCenter' })"
>
{{ user.realName }} {{ user.realName }}
</span> </span>
</a-tooltip> </a-tooltip>
@ -114,11 +82,7 @@
fill="#bfbfbf" fill="#bfbfbf"
></path> ></path>
</svg> --> </svg> -->
<i <i @click="jumpPage({ name: '后台管理', key: 'houtaiguanli' })" class="iconTo" v-show="backFlag"></i>
@click="jumpPage({ name: '后台管理', key: 'houtaiguanli' })"
class="iconTo"
v-show="backFlag"
></i>
</div> </div>
</div> </div>
</template> </template>
@ -180,6 +144,14 @@
} }
// //
const goToHome = () => { const goToHome = () => {
// 西
if (itShowXiHaiAn.value) {
if (
!xhaHasPermissionUser.list.includes(user.value.username)
) {
return message.warn('暂无权限')
}
}
router.push({ router.push({
path: '/home', path: '/home',
}) })
@ -397,8 +369,7 @@
.name-bg-xihaian { .name-bg-xihaian {
height: 0.6rem; height: 0.6rem;
width: 0.6rem; width: 0.6rem;
background: url('~@/assets/newHome/newHome-title-bg-xihaian.png') background: url('~@/assets/newHome/newHome-title-bg-xihaian.png') no-repeat;
no-repeat;
background-size: 100%; background-size: 100%;
margin-right: 0.15rem; margin-right: 0.15rem;
} }
@ -517,11 +488,9 @@
.blue { .blue {
position: absolute; position: absolute;
background: linear-gradient( background: linear-gradient(to right,
to right,
rgba(15, 90, 253, 0.8), rgba(15, 90, 253, 0.8),
rgba(36, 25, 248, 0.8) rgba(36, 25, 248, 0.8));
);
.name { .name {
color: #fff; color: #fff;
@ -572,6 +541,7 @@
} }
:deep(.ant-list-item-meta-title) { :deep(.ant-list-item-meta-title) {
// display: flex; // display: flex;
// justify-content: space-around; // justify-content: space-around;
// align-items: center; // align-items: center;