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 @@ ...@@ -90,7 +90,7 @@
}, },
onLoad(option) { onLoad(option) {
this.detailId = option.id this.detailId = option.id
this.userAuthCheck() this.getReportCharts()
}, },
onShow() { onShow() {
const that = this const that = this
...@@ -109,46 +109,34 @@ ...@@ -109,46 +109,34 @@
if(hideData.includes(item.id)) item.hide = true if(hideData.includes(item.id)) item.hide = true
return item 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() { onUnload() {
// 移除监听事件 // 移除监听事件
uni.$off('handleLinkParams') uni.$off('handleLinkParams')
uni.$off('handleLinkComp') uni.$off('handleLinkComp')
uni.$off('handleDataZoomParams')
clearInterval(this.timename) clearInterval(this.timename)
}, },
methods: { 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