Commit 81339469 authored by Jenny's avatar Jenny

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

parents 706b6b15 50a0315d
<template>
<view>
<uni-ec-canvas
class="uni-ec-canvas"
id="normalra-dar"
ref="normalRadarCanvas"
canvas-id="normalra-dar-chart"
:ec="ec"></uni-ec-canvas>
</view>
</template>
<script>
import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas'
import * as echarts from '@/components/uni-ec-canvas/echarts'
import echartElementData from '@/mixins/echartElementData.js'
let chart = null
export default {
name: "NormalRadar",
mixins: [echartElementData],
data() {
return {
ec: {
lazyLoad: true
}
}
},
onReady() {
},
components: {
uniEcCanvas
},
methods: {
initChart() {
this.$nextTick(() => {
this.$refs['normalRadarCanvas'].init((canvas, width, height, canvasDpr) => {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: canvasDpr
})
canvas.setChart(chart)
const {
dataList: {
indicator,
series
}
} = this.elementData
const config = {
tooltip: {},
radar: {
indicator
},
series: [{
type: 'radar',
label: {
...this.elementInfo.option.dataset
},
data: this.dealSeriesData(series)
}]
}
chart.setOption(config)
return chart
})
})
},
/**
* 处理数据
*/
dealSeriesData(data) {
if (!data) return
const newData = data.map(item => {
const {
name,
data: value
} = item
return {
name,
value
}
})
return newData
}
}
}
</script>
<style scoped>
</style>
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
<NormalPie v-if="element.type == 'NormalPie'" :elementInfo="element"></NormalPie> <NormalPie v-if="element.type == 'NormalPie'" :elementInfo="element"></NormalPie>
<!-- 中国地图 --> <!-- 中国地图 -->
<ChinaMap v-if="element.type == 'ChinaMap'" :elementInfo="element"></ChinaMap> <ChinaMap v-if="element.type == 'ChinaMap'" :elementInfo="element"></ChinaMap>
<!-- 雷达图 -->
<NormalRadar v-if="element.type == 'NormalRadar'" :elementInfo="element"></NormalRadar>
</view> </view>
</view> </view>
</template> </template>
......
...@@ -85,21 +85,24 @@ export default { ...@@ -85,21 +85,24 @@ export default {
} }
} }
let res = await info.url let res = await info.url
this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`) const { Status, Result } = res.data
this.$u.toast(info.msg) if (Status === 'true') {
this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`)
this.removeUserStorage() this.$u.toast(info.msg)
this.saveUserStorage(res.data.Result) this.removeUserStorage()
this.saveUserStorage(res.data.Result)
// 登录成功后返回来源页面 // 登录成功后返回来源页面
let timer = setTimeout(() => { let timer = setTimeout(() => {
const backUrl = uni.getStorageSync('back_url') || '/pages/index/index' const backUrl = uni.getStorageSync('back_url') || '/pages/index/index'
this.$u.route({ this.$u.route({
type: 'reLaunch', type: 'reLaunch',
url: backUrl url: backUrl
}) })
clearTimeout(timer) clearTimeout(timer)
}, 500) }, 500)
} else {
this.$u.toast(res.data.Msg)
}
} else { } else {
console.log('验证失败'); console.log('验证失败');
} }
......
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