Commit 4eeb712e authored by leon's avatar leon

feat:remove local storage

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