Commit 4eeb712e authored by leon's avatar leon

feat:remove local storage

parent 37973c96
......@@ -158,7 +158,6 @@
if(!formatter || !formatter.length) {
return
}
console.log(this.elementInfo.dataZoom)
var arr = [] // 当前显示的label,formatter需要阻塞线程
var all = [] // 除当前显示label之外的值,formatter可以在异步线程请求处理
const count = this.elementData.dataList.categories.length
......
......@@ -171,7 +171,6 @@
}
})
})
console.log(all)
// all的线程可以异步处理
all.forEach(item => {
if(!this.formatter.hasOwnProperty(item.value)) {
......@@ -187,7 +186,6 @@
})
}
})
console.log(this.formatter)
},
/**
......@@ -202,7 +200,6 @@
return {
...tooltip,
formatter: (val, ticket, callback) => {
console.log(val)
const params = {
script: tooltip.formatter,
data: JSON.stringify(val)
......
......@@ -162,7 +162,6 @@
})
})
console.log(all)
// all的线程可以异步处理
all.forEach(item => {
if(!this.formatter.hasOwnProperty(item.value)) {
......
......@@ -137,8 +137,6 @@
// that.cacheImages(item.dataIndex)
}
})
console.log(that.chartTables)
console.log(that.elementInfo.table.column)
})
},
cellClick(e) {
......
......@@ -106,7 +106,6 @@
this.pageSize = option.pageSize
//如果是最后一个元素,需要提前加载后面列表数据
if (this.indexs == this.idList.length-1) {
console.log("xiayiye")
this.getReportIdList()
}
this.getReportCharts()
......@@ -276,7 +275,6 @@
handlePage() {
var idstr = this.idList[this.indexs]
const url = "/pages/details/details?id=" + idstr + "&idList=" + this.idList
console.log(url)
uni.redirectTo({
url: url
})
......
......@@ -104,9 +104,9 @@
// detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听
onShow() {
const that = this
if(uni.getStorageSync('reportInfo')) {
this.reportInfo = JSON.parse(uni.getStorageSync('reportInfo'))
}
// if(uni.getStorageSync('reportInfo')) {
// this.reportInfo = JSON.parse(uni.getStorageSync('reportInfo'))
// }
/**
* 组件交互 - 参数
*/
......@@ -225,6 +225,17 @@
}
}
that.reportInfo = res.data.Result
// 清除数据
if(uni.getStorageSync('reportInfo')) {
let info = JSON.parse(uni.getStorageSync('reportInfo'))
info.list.forEach(item => {
// 如果本地缓存的数组在接口请求的数组中不存在,则删除
if(!that.reportInfo.list.some(idx => idx.id == item.id)) {
uni.removeStorageSync(item.id)
}
})
}
uni.setStorageSync('reportInfo', JSON.stringify(res.data.Result))
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