Commit 9ad9e682 authored by Jenny's avatar Jenny

Merge branch 'develop' of http://106.15.103.105/lihuizhen/ec-report-refactor into develop

parents 9bf886b7 db1a2a7a
......@@ -90,7 +90,7 @@
},
onLoad(option) {
this.detailId = option.id
this.userAuthCheck()
this.getReportCharts()
},
onShow() {
const that = this
......@@ -110,45 +110,33 @@
return item
})
})
/**
* datazoom交互
*/
uni.$on('handleDataZoomParams', ({index, paramName, value}) => {
if(index.length && paramName && value) {
that.reportInfo.list = that.reportInfo.list.map(item => {
console.log('begin item', item)
const flag = index.includes(item.id)
if(flag && item.dataZoom) {
console.log('set item', item)
that.$set(item.dataZoom, 'start', value.start)
that.$set(item.dataZoom, 'end', value.end)
}
console.log('after item', item)
return item
})
}
})
},
onUnload() {
// 移除监听事件
uni.$off('handleLinkParams')
uni.$off('handleLinkComp')
uni.$off('handleDataZoomParams')
clearInterval(this.timename)
},
methods: {
//检查是否登录
userAuthCheck() {
var userId = uni.getStorageSync('userId')
this.getNewestAuthFromServer()
var authorized = uni.getStorageSync('authorized')
if (userId) {
if (authorized) {
this.getReportCharts()
} else {
uni.reLaunch({
url:'../login/authorized'
})
}
} else {
uni.reLaunch({
url: '../login/login'
})
}
},
//获取最新的授权信息
getNewestAuthFromServer() {
var param = {
id: uni.getStorageSync('userId')
}
this.$u.api.getAuthorized(param).then(res=>{
const { Status, Result } = res.data
if (Status === 'true') {
uni.setStorageSync('authorized', Result.authorized)
}
})
},
/**
* 获取页面报表配置
*/
......
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