|
|
@ -8,7 +8,7 @@ |
|
|
|
:key="item.code" |
|
|
|
class="left-nav left-child d-flex align-center justify-center" |
|
|
|
:class="code === item.code ? 'active' : ''" |
|
|
|
@click="changeQuery(item.code, item.url)" |
|
|
|
@click="changeQuery(item.code, item.url, item)" |
|
|
|
> |
|
|
|
{{ item.title }} |
|
|
|
</div> |
|
|
@ -46,12 +46,26 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
'$route.query.code'(val) { |
|
|
|
this.childCode = val; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.childCode = this.$route.query.code; |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
changeQuery(code, status, url) { |
|
|
|
changeQuery(code, url, item) { |
|
|
|
let childCode = code; |
|
|
|
if (item && item.children && item.children.length) { |
|
|
|
childCode = item.children[0].code; |
|
|
|
} |
|
|
|
if (!url) { |
|
|
|
if (this.code && code !== this.code) { |
|
|
|
this.$router.push({ |
|
|
|
query: { code }, |
|
|
|
query: { code: childCode }, |
|
|
|
}); |
|
|
|
this.$emit('chanegCode', code); |
|
|
|
this.childCode = code; |
|
|
@ -60,7 +74,7 @@ export default { |
|
|
|
if (url === '/') { |
|
|
|
window.open(`${window.location.href}`); |
|
|
|
} else { |
|
|
|
window.open(`${process.env.VUE_APP_BASE_URL + process.env.VUE_APP_PUBLIC_PATH}${url}?code=${code}`); |
|
|
|
window.open(`${process.env.VUE_APP_BASE_URL + process.env.VUE_APP_PUBLIC_PATH}${url}?code=${childCode}`); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -68,7 +82,6 @@ export default { |
|
|
|
if (code === this.code) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
console.log('code: ', code); |
|
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
|
|
const item = this.list.children[i]; |
|
|
|
if (item.children && item.children.length) { |
|
|
@ -99,15 +112,16 @@ export default { |
|
|
|
.left-nav { |
|
|
|
width: 240px; |
|
|
|
height: 56px; |
|
|
|
border-bottom: 1px solid rgba(112, 112, 112, 0.1); |
|
|
|
margin-bottom: 1px; |
|
|
|
/* border-bottom: 1px solid rgba(112, 112, 112, 0.1); */ |
|
|
|
/* margin-bottom: 1px; */ |
|
|
|
} |
|
|
|
.left-nav-child { |
|
|
|
width: 240px; |
|
|
|
height: 28px; |
|
|
|
border-bottom: 1px solid rgba(112, 112, 112, 0.1); |
|
|
|
margin-bottom: 1px; |
|
|
|
background-color: #f5f5f5; |
|
|
|
padding-left: 20px; |
|
|
|
/* border-bottom: 1px solid rgba(112, 112, 112, 0.1); */ |
|
|
|
/* margin-bottom: 1px; */ |
|
|
|
background-color: #fff; |
|
|
|
font-size: 16px; |
|
|
|
cursor: pointer; |
|
|
|
transition: all 0.2s; |
|
|
|