Commit 4dad49db authored by leon's avatar leon

feat: hide normal tabs child

parent 175c3d4e
......@@ -106,7 +106,10 @@
uni.$on('handleLinkComp', ({ showData, hideData }) => {
that.reportInfo.list = that.reportInfo.list.map(item => {
if(showData.includes(item.id)) item.hide = false
if(hideData.includes(item.id)) item.hide = true
if(hideData.includes(item.id)) {
item.hide = true
that.childrenDataHide(item)
}
return item
})
})
......@@ -137,6 +140,25 @@
clearInterval(this.timename)
},
methods: {
/**
* 递归 - 隐藏子项为NormalTabs的所有关联组件
*/
childrenDataHide(item) {
if(item.type === 'NormalTabs') {
if(!item.child.data.length) {
return
}
item.child.data.forEach(data => {
this.reportInfo.list.map(item => {
if(data.comp === item.id) {
item.hide = true
this.childrenDataHide(item)
}
return item
})
})
}
},
/**
* 获取页面报表配置
*/
......
......@@ -108,10 +108,14 @@
uni.$on('handleLinkComp', ({ showData, hideData }) => {
that.reportInfo.list = that.reportInfo.list.map(item => {
if(showData.includes(item.id)) item.hide = false
if(hideData.includes(item.id)) item.hide = true
if(hideData.includes(item.id)) {
item.hide = true
that.childrenDataHide(item)
}
return item
})
})
/**
* datazoom交互
*/
......@@ -136,6 +140,25 @@
clearInterval(this.timename)
},
methods: {
/**
* 递归 - 隐藏子项为NormalTabs的所有关联组件
*/
childrenDataHide(item) {
if(item.type === 'NormalTabs') {
if(!item.child.data.length) {
return
}
item.child.data.forEach(data => {
this.reportInfo.list.map(item => {
if(data.comp === item.id) {
item.hide = true
this.childrenDataHide(item)
}
return item
})
})
}
},
//检查是否登录
userAuthCheck() {
var userId = uni.getStorageSync('userId')
......@@ -173,7 +196,7 @@
async getReportCharts() {
clearInterval(this.timename)
const that = this
let res = await that.$u.api.getReportCharts({id: '61cd2ba1c06bffbdae442c4f'})
let res = await that.$u.api.getReportCharts({id: '6274f095460633568801a709'})
uni.stopPullDownRefresh()
const { Status, Result: { info, list } } = res.data
if (Status === 'true') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment