添加点击

This commit is contained in:
a0049873 2022-11-28 11:25:09 +08:00
parent ea3f9b693a
commit 04aacd14a6
1 changed files with 188 additions and 162 deletions

View File

@ -17,9 +17,17 @@
<div <div
v-for="item in navList" v-for="item in navList"
:key="item.key" :key="item.key"
@click="jumpPage(item,'headerClick')" @click="jumpPage(item, 'headerClick')"
class="nav" class="nav"
:class="[{'select':item.key == select},{'select-inner':(item.key == 'DetailsPageconetent' && item.innerKey && props.targetFlag)}]" :class="[
{ select: item.key == select },
{
'select-inner':
item.key == 'DetailsPageconetent' &&
item.innerKey &&
props.targetFlag,
},
]"
> >
{{ item.name }} {{ item.name }}
</div> </div>
@ -54,6 +62,7 @@
p-id="2187" p-id="2187"
width="0.35rem" width="0.35rem"
height="0.35rem" height="0.35rem"
@click="goToView()"
> >
<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"
@ -90,14 +99,18 @@
</template> </template>
<span <span
class="name" class="name"
@click="jumpPage({ name: '个人中心', key: 'personalCenter' },'headerClick')" @click="
jumpPage({ name: '个人中心', key: 'personalCenter' }, 'headerClick')
"
> >
{{ user.realName }} {{ user.realName }}
</span> </span>
</a-tooltip> </a-tooltip>
<span @click="logout" class="out">退出</span> <span @click="logout" class="out">退出</span>
<i <i
@click="jumpPage({ name: '后台管理', key: 'houtaiguanli' },'headerClick')" @click="
jumpPage({ name: '后台管理', key: 'houtaiguanli' }, 'headerClick')
"
class="iconTo" class="iconTo"
v-show="backFlag" v-show="backFlag"
></i> ></i>
@ -135,10 +148,10 @@
const mynoticeFlag = ref(false) const mynoticeFlag = ref(false)
const mynoticeData = ref([]) const mynoticeData = ref([])
const navList = ref(navListManagement.navList) const navList = ref(navListManagement.navList)
const targetRouter= ref('') const targetRouter = ref('')
const backFlag = ref(false) const backFlag = ref(false)
getUserInfo().then((res) => { getUserInfo().then((res) => {
if(res.data.data.superAdmin =='1'){ if (res.data.data.superAdmin == '1') {
backFlag.value = true backFlag.value = true
} else { } else {
res.data.data.roleIdList.map((val) => { res.data.data.roleIdList.map((val) => {
@ -188,8 +201,8 @@
window.open('http://15.72.177.175:18460/analystrunner/tonglan', '_blank') window.open('http://15.72.177.175:18460/analystrunner/tonglan', '_blank')
} }
// //
const jumpPage = (item,type) => { const jumpPage = (item, type) => {
if(type == 'headerClick'){ if (type == 'headerClick') {
// 西 // 西
if (itShowXiHaiAn.value) { if (itShowXiHaiAn.value) {
let _arr = ['共享门户', '能力云图', '能力统计', '需求中心', '赋能案例'] let _arr = ['共享门户', '能力云图', '能力统计', '需求中心', '赋能案例']
@ -203,7 +216,10 @@
select.value = item.key select.value = item.key
switch (item.name) { switch (item.name) {
case '个人中心': case '个人中心':
window.sessionStorage.setItem('type', JSON.stringify('PurchaseVehicle')) window.sessionStorage.setItem(
'type',
JSON.stringify('PurchaseVehicle')
)
router.push({ router.push({
path: '/personalCenter', path: '/personalCenter',
}) })
@ -275,11 +291,14 @@
router.push('/home') router.push('/home')
break break
} }
}else if(type == 'innerClick'){ } else if (type == 'innerClick') {
//select.value = item.key //select.value = item.key
switch (item.name) { switch (item.name) {
case '个人中心': case '个人中心':
window.sessionStorage.setItem('type', JSON.stringify('PurchaseVehicle')) window.sessionStorage.setItem(
'type',
JSON.stringify('PurchaseVehicle')
)
router.push({ router.push({
path: '/personalCenter', path: '/personalCenter',
}) })
@ -295,7 +314,7 @@
query: { query: {
id: targetRouter.value.id, id: targetRouter.value.id,
}, },
}); })
break break
case '能力云图': case '能力云图':
router.push({ router.push({
@ -321,7 +340,6 @@
router.push('/home') router.push('/home')
break break
} }
} }
} }
const scrollTop = ref(0) const scrollTop = ref(0)
@ -403,24 +421,32 @@
mybus.on('changeMenuStyle', (data) => { mybus.on('changeMenuStyle', (data) => {
debugger debugger
targetRouter.value = data; targetRouter.value = data
if(data.path=='/algorithmCompare'){ if (data.path == '/algorithmCompare') {
jumpPage({ jumpPage(
"name": "能力集市", {
"key": "DetailsPageconetent", name: '能力集市',
"innerKey":"algorithmCompare" key: 'DetailsPageconetent',
},'innerClick'); innerKey: 'algorithmCompare',
} else if(data.path =='/DetailsPageconetent'){ },
jumpPage({ name: '能力集市', key: 'DetailsPageconetent' },'headerClick') 'innerClick'
} else if(data.path =='/details'){ )
jumpPage({ } else if (data.path == '/DetailsPageconetent') {
"name": "能力集市", jumpPage(
"key": "DetailsPageconetent", { name: '能力集市', key: 'DetailsPageconetent' },
"innerKey":"details" 'headerClick'
},'innerClick'); )
} else if (data.path == '/details') {
jumpPage(
{
name: '能力集市',
key: 'DetailsPageconetent',
innerKey: 'details',
},
'innerClick'
)
} }
}) })
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
mybus.off('getSgcNum') mybus.off('getSgcNum')