clay fix : 进入三级后,点击二级是无法显示,(路径问题)

This commit is contained in:
clay
2022-10-03 22:34:24 +08:00
parent e63086460f
commit ddd515381c
2 changed files with 45 additions and 17 deletions

View File

@@ -17,7 +17,6 @@
<div style="background-color:#F8F8F8 ; padding-bottom: 19rem">
<!--有三级菜单-->
<el-row v-show="showSecond">
<el-col v-if="$i18n.locale === 'cn'" :xs="2" :sm="2" :md="1.5" :lg="2" :xl="4">
<div class="grid-content"></div>
</el-col>
@@ -202,6 +201,7 @@ export default {
},
watch: {
$route(to, from) {
console.log("我被触发了")
let arcId = this.$route.params && this.$route.query.id
this.navId = this.$route.params && this.$route.params.navId;
let id = this.$route.params && this.$route.params.secondId
@@ -220,6 +220,12 @@ export default {
this.getContent(info.second)
}
return
}else {
console.log(this.navId,"this.navId")
if (undefined == this.navId ){
this.showIndex = 0
this.getNodes()
}
}
this.showSecond = true
if (arcId != undefined) {
@@ -324,6 +330,7 @@ export default {
if (arcId != undefined) {
this.getContext(arcId)
} else {
console.log("测试,我被触发了!")
if (this.navId == undefined) {
this.getContent(this.navList[0])
} else {
@@ -359,6 +366,12 @@ export default {
getNode(data).then(res => {
console.log(res, "res值")
console.log(this.type);
if (null == res.data){
this.contextData = null
console.log("将值设为null",this.contextData)
this.type = 0
return
}
if (this.type === 2 || this.type === 4) {
this.contextData = {
data: res.rows,
@@ -374,6 +387,7 @@ export default {
if (res.additional == ""){
this.organizationType = "1"
}else {
console.log(this.organizationType,"this.organizationType")
this.organizationType = res.additional
}
this.contextData = handleTree(res.data, "id", "pid", null, null)