Commit 9e7f2148 authored by leon's avatar leon

fix: index page localstorage

parent c01bde6b
...@@ -132,6 +132,9 @@ ...@@ -132,6 +132,9 @@
}, },
methods: { methods: {
initChart() { initChart() {
if(!this.elementData.dataList) {
return
}
this.tabsValue = this.elementInfo.option.tabs.defaultValue this.tabsValue = this.elementInfo.option.tabs.defaultValue
if (this.elementData.dataList.defaultValue) { if (this.elementData.dataList.defaultValue) {
this.tabsValue = this.elementData.dataList.defaultValue this.tabsValue = this.elementData.dataList.defaultValue
...@@ -267,6 +270,8 @@ ...@@ -267,6 +270,8 @@
align-items: flex-start; align-items: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
width: 100%; width: 100%;
justify-content: center;
align-items: center;
} }
.tab-vertical { .tab-vertical {
display: flex !important; display: flex !important;
...@@ -277,7 +282,7 @@ ...@@ -277,7 +282,7 @@
.tab-item { .tab-item {
width: var(--width); width: var(--width);
margin: 1%; margin: 3px;
font-size: var(--font-size); font-size: var(--font-size);
color: var(--color); color: var(--color);
border: var(--border-style); border: var(--border-style);
......
...@@ -213,8 +213,8 @@ export default { ...@@ -213,8 +213,8 @@ export default {
} }
}, },
'elementData.dataList': { 'elementData.dataList': {
handler(newVal) { handler(newVal,oldVal) {
if (newVal) { if (JSON.stringify(newVal) !== JSON.stringify(oldVal) ) {
this.setStorageData() this.setStorageData()
this.initChart() this.initChart()
} }
......
...@@ -72,6 +72,11 @@ ...@@ -72,6 +72,11 @@
const toolbox = {show: false} const toolbox = {show: false}
this.element.option.toolbox = toolbox this.element.option.toolbox = toolbox
}, },
onUnload() {
// 移除监听事件
uni.$off('handleLinkParams')
uni.$off('handleLinkComp')
},
onShow() { onShow() {
/** /**
* 组件交互 - 组件 * 组件交互 - 组件
......
...@@ -124,9 +124,9 @@ ...@@ -124,9 +124,9 @@
// detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听 // detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听
onShow() { onShow() {
const that = this const that = this
// if(uni.getStorageSync('reportInfo')) { if(Object.keys(that.reportInfo).length) {
// this.reportInfo = JSON.parse(uni.getStorageSync('reportInfo')) uni.setStorageSync('reportInfo', JSON.stringify(that.reportInfo))
// } }
/** /**
* 组件交互 - 参数 * 组件交互 - 参数
*/ */
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
} }
that.reportInfo = this.handleTabsLink(res.data.Result) that.reportInfo = this.handleTabsLink(res.data.Result)
uni.setStorageSync('reportInfo', JSON.stringify(res.data.Result)) uni.setStorageSync('reportInfo', JSON.stringify(that.reportInfo))
that.getStickyTables() that.getStickyTables()
} }
}, },
......
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