|
@@ -13,21 +13,27 @@
|
|
|
<div class="more-t">
|
|
|
<template v-for="(item,index) in headerTitle" :key="item.name">
|
|
|
<div v-if="!item.children" class="el-dropdown"><p
|
|
|
- @click="() => item.linkHref == '/power-home' ? router.push(item.linkHref):''"
|
|
|
+ @click="clickHome"
|
|
|
class="more-t-item el-tooltip__trigger el-tooltip__trigger"
|
|
|
- aria-haspopup="menu">{{ item.name }}</p>
|
|
|
+ :style="selectedHead == item.name ? {color: '#2e4eda'}:{}"
|
|
|
+ aria-haspopup="menu"
|
|
|
+ >{{ item.name }}</p>
|
|
|
</div>
|
|
|
- <el-dropdown v-else>
|
|
|
- <span class="more-t-item">{{
|
|
|
+ <el-dropdown v-else @command="handleCommand">
|
|
|
+ <span class="more-t-item" :style="selectedHead == item.name ? {color: '#2e4eda'}:{}">{{
|
|
|
item.name
|
|
|
}}</span>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="linkToOther(item2,getDisabled(item2))"
|
|
|
- :key="item2.name" v-for="item2 in item.children"
|
|
|
- :class="{'disabled':item2.disabled ||
|
|
|
+ <el-dropdown-item
|
|
|
+ :style="selectedItem == item2.name ? {color: '#2e4eda'}:{}"
|
|
|
+ :command="item2.name"
|
|
|
+ @click="linkToOther(item2,getDisabled(item2),item.name)"
|
|
|
+ :key="item2.name" v-for="item2 in item.children"
|
|
|
+ :class="{'disabled':item2.disabled ||
|
|
|
(!item2.isZi && !loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +item2.moduleId)),
|
|
|
- 'not-login':getDisabled(item2)}">{{ item2.name }}
|
|
|
+ 'not-login':getDisabled(item2),
|
|
|
+ 'highlight': item2.name === selectedItem }">{{ item2.name }}
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
@@ -70,6 +76,12 @@ import {handleMes, showMessage} from "@/unit/element-ui/tip";
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
+const selectedItem = ref('')
|
|
|
+const selectedHead = ref('')
|
|
|
+
|
|
|
+function handleCommand(command) {
|
|
|
+ selectedItem.value = command;
|
|
|
+}
|
|
|
|
|
|
function loginZHFXFN(type, url) {
|
|
|
|
|
@@ -122,7 +134,7 @@ function loginZHFXFN(type, url) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function toPage(item, isDisabled) {
|
|
|
+function toPage(item, isDisabled, headName) {
|
|
|
// console.log('点击', item, isDisabled)
|
|
|
debugger
|
|
|
let path = isDisabled ? item.loginPage : item.linkHref
|
|
@@ -130,6 +142,8 @@ function toPage(item, isDisabled) {
|
|
|
if (path.indexOf("http://") > -1 || path.indexOf("https://") > -1) {
|
|
|
window.open(path, path)
|
|
|
} else {
|
|
|
+ // 记录父名称
|
|
|
+ selectedHead.value = headName
|
|
|
router.push({name: 'interface', params: {type: item.type}})
|
|
|
}
|
|
|
return
|
|
@@ -409,6 +423,11 @@ function loginZW(type, url) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function clickHome() {
|
|
|
+ selectedHead.value = '首页'
|
|
|
+ router.push('/power-home')
|
|
|
+}
|
|
|
+
|
|
|
function selectUserModule(user_id, url) {
|
|
|
var json_data = {
|
|
|
"user_id": user_id
|
|
@@ -780,7 +799,7 @@ function getDisabled(child) {
|
|
|
return !loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +child.moduleId) && child.isZi
|
|
|
}
|
|
|
|
|
|
-function linkToOther(item, isDisabled) {
|
|
|
+function linkToOther(item, isDisabled, headName) {
|
|
|
debugger
|
|
|
if (!item.disabled) {
|
|
|
if (item.linkHref) {
|
|
@@ -789,12 +808,9 @@ function linkToOther(item, isDisabled) {
|
|
|
return
|
|
|
|
|
|
}
|
|
|
- toPage(item, isDisabled)
|
|
|
- // window.open(item.linkHref,item.linkHref)
|
|
|
+ toPage(item, isDisabled, headName)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -875,6 +891,7 @@ function linkToOther(item, isDisabled) {
|
|
|
color: #272727;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</style>
|
|
|
|
|
|
|