Commit c38f6c6c authored by Jenny's avatar Jenny

feat: 修改tab组件下拉刷新状态不变问题

parent fee85e7f
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
tabsValue: '' tabsValue: ''
}; };
}, },
mounted() {
uni.$on('handlePullDownRefresh', () => {
this.initChart()
})
},
destroy() {
uni.$off('handlePullDownRefresh')
},
computed: { computed: {
tabsGroup() { tabsGroup() {
const { type, count} = this.elementInfo.option.tabs const { type, count} = this.elementInfo.option.tabs
...@@ -83,12 +91,12 @@ ...@@ -83,12 +91,12 @@
} }
}, },
methods: { methods: {
initChart() { initChart(index = 0) {
this.currentTabs = index
this.tabsValue = this.elementData.dataList.series[this.currentTabs].value this.tabsValue = this.elementData.dataList.series[this.currentTabs].value
}, },
handleTabsChange(index) { handleTabsChange(index) {
this.currentTabs = index this.initChart(index)
this.initChart()
this.tabsValueChange() this.tabsValueChange()
}, },
handleSelectChange(e) { handleSelectChange(e) {
......
...@@ -212,6 +212,7 @@ ...@@ -212,6 +212,7 @@
const that = this const that = this
let res = await that.$u.api.getReportCharts({id: '6274f095460633568801a709'}) let res = await that.$u.api.getReportCharts({id: '6274f095460633568801a709'})
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
uni.$emit('handlePullDownRefresh')
const { Status, Result: { info, list } } = res.data const { Status, Result: { info, list } } = res.data
if (Status === 'true') { if (Status === 'true') {
if(info.dataUrl) { if(info.dataUrl) {
......
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