处理点击展开的问题

ui1
e 3 years ago
parent ada5fa3bca
commit 54ef0d033d
  1. 38
      src/pages/data/list/index.vue
  2. 5
      src/setting.js

@ -294,7 +294,7 @@ export default {
if(e.children.length>0){// if(e.children.length>0){//
if(e.children[0].children.length===0){// if(e.children[0].children.length===0){//
action = e.children[0].id action = e.children[0].id
}else{// }else{//
action = e.children[0].children[0].id action = e.children[0].children[0].id
} }
} }
@ -342,7 +342,7 @@ export default {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.getData() this.getData()
}, },
selectType(index,indexPath){ selectType(index,indexPath){//
let introduce = '' let introduce = ''
this.keyword = '' this.keyword = ''
let list = this.typeList let list = this.typeList
@ -362,7 +362,37 @@ export default {
} }
}) })
if(!introduce) introduce = list.find(n => n.id == indexPath[0]).introduce if(!introduce) introduce = list.find(n => n.id == indexPath[0]).introduce
this.defaultType = index
if(indexPath.length>=2){
let clikckId = indexPath[indexPath.length-1]
let select
function getSelect(arr){
if(arr.length>0){
arr.map(e=>{
if(e.id==clikckId){
if(e.children.length===0){
select = e.id
}else{
if(e.children[0].children.length>0){
select = e.children[0].children[0].id
}else{
select = e.children[0].id
}
}
}else{
getSelect(e.children)
}
})
}else{
return
}
}
getSelect(this.typeList)
console.log(select,'dig');
this.defaultType = select
}else{
this.defaultType = index
}
this.introduce = introduce this.introduce = introduce
this.previewHead = [] this.previewHead = []
this.previewData = [] this.previewData = []
@ -384,7 +414,7 @@ export default {
return result return result
}, },
openType(index,indexPath){ openType(index,indexPath){
// console.log(11,this.typeList) console.log(11,this.typeList)
let id = this.findId(this.typeList,index) let id = this.findId(this.typeList,index)
this.selectType(id,indexPath) this.selectType(id,indexPath)
}, },

@ -15,8 +15,9 @@ const Setting = {
// 页面切换时,是否显示模拟的进度条 // 页面切换时,是否显示模拟的进度条
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.216:9000' : 'http://39.108.250.202:9000', // apiBaseURL: env === 'development' ? 'http://192.168.31.125:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000', apiBaseURL:'http://39.108.250.202:9000' ,
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://192.168.31.151:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

Loading…
Cancel
Save