Commit 4dad49db authored by leon's avatar leon

feat: hide normal tabs child

parent 175c3d4e
...@@ -106,7 +106,10 @@ ...@@ -106,7 +106,10 @@
uni.$on('handleLinkComp', ({ showData, hideData }) => { uni.$on('handleLinkComp', ({ showData, hideData }) => {
that.reportInfo.list = that.reportInfo.list.map(item => { that.reportInfo.list = that.reportInfo.list.map(item => {
if(showData.includes(item.id)) item.hide = false 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 return item
}) })
}) })
...@@ -137,6 +140,25 @@ ...@@ -137,6 +140,25 @@
clearInterval(this.timename) clearInterval(this.timename)
}, },
methods: { 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 @@ ...@@ -108,10 +108,14 @@
uni.$on('handleLinkComp', ({ showData, hideData }) => { uni.$on('handleLinkComp', ({ showData, hideData }) => {
that.reportInfo.list = that.reportInfo.list.map(item => { that.reportInfo.list = that.reportInfo.list.map(item => {
if(showData.includes(item.id)) item.hide = false 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 return item
}) })
}) })
/** /**
* datazoom交互 * datazoom交互
*/ */
...@@ -136,6 +140,25 @@ ...@@ -136,6 +140,25 @@
clearInterval(this.timename) clearInterval(this.timename)
}, },
methods: { 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() { userAuthCheck() {
var userId = uni.getStorageSync('userId') var userId = uni.getStorageSync('userId')
...@@ -173,7 +196,7 @@ ...@@ -173,7 +196,7 @@
async getReportCharts() { async getReportCharts() {
clearInterval(this.timename) clearInterval(this.timename)
const that = this const that = this
let res = await that.$u.api.getReportCharts({id: '61cd2ba1c06bffbdae442c4f'}) let res = await that.$u.api.getReportCharts({id: '6274f095460633568801a709'})
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
const { Status, Result: { info, list } } = res.data const { Status, Result: { info, list } } = res.data
if (Status === 'true') { 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