123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <!--
- * @Author: WangQiBiao
- * @Date: 2019-09-26 08:46:04
- * @LastEditors: MoZhuangRu
- * @LastEditTime: 2019-11-21 10:22:25
- * @Description: 近1年应实收统计
- -->
- <template>
- <div class="paid-in">
- <TitleCom>近12个月实收统计</TitleCom>
- <div class="map">
- <div class="map-item" id="paid"></div>
- <div class="map-item">
- <IncomeCom/>
- </div>
- </div>
- </div>
- </template>
- <script>
- import TitleCom from '@/components/title'
- import IncomeCom from './../income'
- import echarts from 'echarts'
- import { api } from '@/api'
- import config from '@/config'
- export default {
- data () {
- return {
- yearTotal: []
- }
- },
- components: {
- TitleCom,
- IncomeCom
- },
- mounted () {
- api.getBillSumMonth({
- version: config.version
- }).then(res => {
- this.yearTotal = res.data.data
- this.createMapPaid()
- })
- },
- methods: {
- createMapPaid () {
- var myChart = echarts.init(document.getElementById('paid'))
- var dataAxis = []
- var data = []
- if (this.yearTotal && this.yearTotal.length !== 0) {
- this.yearTotal.forEach(item => {
- dataAxis.push(item.type)
- data.push(item.total)
- })
- }
- var option = {
- name: '近12个月实收统计',
- legendHoverLink: true,
- grid: {
- top: 26,
- right: 0,
- bottom: 36
- },
- xAxis: {
- data: dataAxis,
- position: 'bottom',
- inverse: false,
- minInterval: 7,
- axisLine: { // 坐标轴
- show: true,
- lineStyle: {
- color: '#1036A9',
- width: 1
- }
- },
- axisTick: { // 坐标轴刻度
- show: false
- },
- axisLabel: { // 坐标轴label
- show: true,
- inside: false,
- rotate: 30,
- color: '#39D6FE',
- fontWeight: 400
- },
- splitLine: { // x轴线
- show: true,
- interval: 1000,
- lineStyle: {
- type: 'solid',
- color: '#1036A9'
- }
- },
- splitArea: { // 分隔区域
- show: false,
- interval: 0,
- areaStyle: {
- opacity: 0.36
- }
- }
- },
- yAxis: {
- show: true,
- position: 'left',
- name: '单位(万元)',
- nameTextStyle: {
- color: '#fff',
- fontSize: 10,
- fontWeight: 400
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#1036A9',
- width: 1
- }
- },
- axisTick: { // 坐标轴刻度
- show: false
- },
- axisLabel: { // 坐标轴label
- show: true,
- inside: false,
- // rotate: 30,
- color: '#fff',
- fontWeight: 400
- },
- splitLine: { // x轴线
- show: true,
- interval: 0,
- lineStyle: {
- type: 'solid',
- color: '#1036A9'
- }
- },
- splitArea: { // 分隔区域
- show: false,
- interval: 0,
- areaStyle: {
- opacity: 0.36
- }
- }
- },
- series: [
- {
- type: 'bar',
- barWidth: 20,
- label: {
- show: true,
- position: 'top',
- color: '#FFF600'
- },
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(
- 0, 0, 0, 1,
- [
- { offset: 0, color: '#01B4FF' },
- { offset: 1, color: '#0E2AF6' }
- ]
- )
- }
- },
- data: data
- }
- ]
- }
- myChart.setOption(option)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import './index.scss';
- </style>
|