commit
e885e77a54
|
|
@ -5,6 +5,7 @@
|
||||||
<script>
|
<script>
|
||||||
import echarts from 'echarts'
|
import echarts from 'echarts'
|
||||||
import tdTheme from './theme.json'
|
import tdTheme from './theme.json'
|
||||||
|
import { on, off } from '@/libs/tools'
|
||||||
echarts.registerTheme('tdTheme', tdTheme)
|
echarts.registerTheme('tdTheme', tdTheme)
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartBar',
|
name: 'ChartBar',
|
||||||
|
|
@ -13,6 +14,16 @@ export default {
|
||||||
text: String,
|
text: String,
|
||||||
subtext: String
|
subtext: String
|
||||||
},
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
dom: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
resize () {
|
||||||
|
this.dom.resize()
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let xAxisData = Object.keys(this.value)
|
let xAxisData = Object.keys(this.value)
|
||||||
|
|
@ -35,15 +46,13 @@ export default {
|
||||||
type: 'bar'
|
type: 'bar'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
let dom = echarts.init(this.$refs.dom, 'tdTheme')
|
this.dom = echarts.init(this.$refs.dom, 'tdTheme')
|
||||||
dom.setOption(option)
|
this.dom.setOption(option)
|
||||||
|
on(window, 'resize', this.resize)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
off(window, 'resize', this.resize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
.charts{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
<script>
|
<script>
|
||||||
import echarts from 'echarts'
|
import echarts from 'echarts'
|
||||||
import tdTheme from './theme.json'
|
import tdTheme from './theme.json'
|
||||||
|
import { on, off } from '@/libs/tools'
|
||||||
echarts.registerTheme('tdTheme', tdTheme)
|
echarts.registerTheme('tdTheme', tdTheme)
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartPie',
|
name: 'ChartPie',
|
||||||
|
|
@ -13,6 +14,16 @@ export default {
|
||||||
text: String,
|
text: String,
|
||||||
subtext: String
|
subtext: String
|
||||||
},
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
dom: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
resize () {
|
||||||
|
this.dom.resize()
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let legend = this.value.map(_ => _.name)
|
let legend = this.value.map(_ => _.name)
|
||||||
|
|
@ -47,15 +58,13 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
let dom = echarts.init(this.$refs.dom, 'tdTheme')
|
this.dom = echarts.init(this.$refs.dom, 'tdTheme')
|
||||||
dom.setOption(option)
|
this.dom.setOption(option)
|
||||||
|
on(window, 'resize', this.resize)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
off(window, 'resize', this.resize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
.charts{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -104,11 +104,11 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.dom = echarts.init(this.$refs.dom)
|
this.dom = echarts.init(this.$refs.dom)
|
||||||
this.dom.setOption(option)
|
this.dom.setOption(option)
|
||||||
on(window, 'resize', this.resize())
|
on(window, 'resize', this.resize)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
off(window, 'resize', this.resize())
|
off(window, 'resize', this.resize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Row :gutter="20">
|
<Row :gutter="20">
|
||||||
<i-col span="4" v-for="(infor, i) in inforCardData" :key="`infor-${i}`" style="height: 120px;">
|
<i-col :xs="12" :md="8" :lg="4" v-for="(infor, i) in inforCardData" :key="`infor-${i}`" style="height: 120px;padding-bottom: 10px;">
|
||||||
<infor-card shadow :color="infor.color" :icon="infor.icon" :icon-size="36">
|
<infor-card shadow :color="infor.color" :icon="infor.icon" :icon-size="36">
|
||||||
<count-to :end="infor.count" count-class="count-style"/>
|
<count-to :end="infor.count" count-class="count-style"/>
|
||||||
<p>{{ infor.title }}</p>
|
<p>{{ infor.title }}</p>
|
||||||
</infor-card>
|
</infor-card>
|
||||||
</i-col>
|
</i-col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row :gutter="20" style="margin-top: 20px;">
|
<Row :gutter="20" style="margin-top: 10px;">
|
||||||
<i-col span="8">
|
<i-col :md="24" :lg="8" style="margin-bottom: 20px;">
|
||||||
<Card shadow>
|
<Card shadow>
|
||||||
<chart-pie style="height: 300px;" :value="pieData" text="用户访问来源"></chart-pie>
|
<chart-pie style="height: 300px;" :value="pieData" text="用户访问来源"></chart-pie>
|
||||||
</Card>
|
</Card>
|
||||||
</i-col>
|
</i-col>
|
||||||
<i-col span="16">
|
<i-col :md="24" :lg="16" style="margin-bottom: 20px;">
|
||||||
<Card shadow>
|
<Card shadow>
|
||||||
<chart-bar style="height: 300px;" :value="barData" text="每周用户活跃量"/>
|
<chart-bar style="height: 300px;" :value="barData" text="每周用户活跃量"/>
|
||||||
</Card>
|
</Card>
|
||||||
</i-col>
|
</i-col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row style="margin-top: 20px;">
|
<Row>
|
||||||
<Card shadow>
|
<Card shadow>
|
||||||
<example style="height: 310px;"/>
|
<example style="height: 310px;"/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue