This commit is contained in:
‘937886381’
2024-07-08 13:25:28 +08:00
parent 689de3173f
commit f2d57a8ebb
14 changed files with 246 additions and 124 deletions

View File

@@ -1,11 +1,13 @@
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
<span v-if="item.redirect === 'noRedirect' || index === levelList.length - 1" class="no-redirect">{{
item.meta.title
}}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
<el-breadcrumb-item v-for=" (item, index) in levelList" :key="item.path">
<span :style="{ color: (changeColor == true ? 'rgba(255, 255, 255, 0.45)' :' rgba(0, 0, 0, .65)')}"
v-if="item.redirect === 'noRedirect' || index === levelList.length - 1" class="no-redirect">{{
item.meta.title
}}</span>
<a :style="{ color: (changeColor == true ? 'rgba(255, 255, 255, 0.45)' :' rgba(0, 0, 0, .45)')}" v-else
@click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
@@ -20,33 +22,33 @@ export default {
},
computed: {
changeColor() {
if (this.$route.path == '/copilot/efficiency-container' || this.$route.path == '/copilot/main') {
console.log(this.$route);
if (this.$route.path == '/copilot/efficiency-container' || this.$route.path == '/copilot/main' || this.$route.path == '/factoryData/hdIndex' || this.$route.path === '/factoryData/factory-data') {
return true
} else {
return false
}
},
}
},
watch: {
// changeColor(val) {
// if (val == true) {
// var tag = document.getElementsByClassName("breadcrumb-container")
// console.log('tag', tag)
// // for (let i in tag) {
// tag[i].style.color = 'rgba(255, 255, 255, 0.45)'
// // tag[i].classList.remove("default")
// // }
// // console.log('this.$refs.scrollContainer', this.$refs.tag);
// } else {
// var tag = document.getElementsByClassName("breadcrumb-container")
// console.log('tag', tag)
// for (let i in tag) {
// tag[i].style.color = ''
// // tag[i].classList.remove("default")
// }
// // this.$refs.mainContainer.style.backgroundColor = ''
// }
// },
changeColor(val) {
if (val == true) {
let item = document.getElementsByClassName('el-breadcrumb__separator')
for (let i in item) {
console.log(item[i])
if (item[i]) {
item[i].style.color = 'rgba(255, 255, 255, 0.45)'
}
}
} else {
let item = document.getElementsByClassName('el-breadcrumb__separator')
for (let i in item) {
if (item[i]) {
// item[i].style.color = '#c0c4cc'
}
}
}
},
$route(route) {
// if you go to the redirect page, do not update the breadcrumbs
if (route.path.startsWith('/redirect/')) {
@@ -98,13 +100,13 @@ export default {
margin-left: 8px;
.no-redirect {
color: rgba(0, 0, 0, 0.65);
color: rgba(0, 0, 0, .45);
cursor: text;
}
}
.app-breadcrumb .el-breadcrumb__inner a,
.el-breadcrumb__inner.is-link {
color: rgba(0, 0, 0, 0.45);
color:rgba(0, 0, 0, 0.65)
}
</style>