<!-- * @Description: 城管事件数量统计 * @Author: 王晓颖 * @Date: 2020-09-07 16:39:10 --> <template> <single-layout title="案件趋势"> <div style="width: 100%;height:100%;"> <gradient-line-chart :id="options.id" :unit="options.unit" :height="options.height" :legend="options.xAxisData" :xAxisData="options.xAxisData" :seriesData="options.seriesData" /> </div> </single-layout> </template> <script> import ChartLayout from '@/components/layout/chartLayout' import ColorfulBarChart from '@/components/barChart/colorfulBarChart' import GradientLineChart from '@/components/lineChart/gradientLineChart' import {fetchCaseByDay} from '@/api/cityManage' import SingleLayout from '../../../../../components/layout/singleLayout' export default { name: 'socialSecurityLine', components: {SingleLayout, GradientLineChart, ColorfulBarChart, ChartLayout}, data () { return { options: { id: 'case_line1', height: '100%', width: '100%', unit: '次', xAxisData: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], seriesData: [ {name: '案件总数', data: [0, 0, 0, 0, 0, 0, 0], color: '255,45,85'}, {name: '处理数', data: [0, 0, 0, 0, 0, 0, 0], color: '0,144,255'} ] } } }, created () { this.getData() }, methods: { getData () { // fetchCaseByDay().then(response => { // if (response.code === 200) { // const data = response.data // this.options.xAxisData = data.map(item => { return item.name }) // const total = data.map(item => { return item.total }) // const complete = data.map(item => { return item.complete }) // this.options.seriesData = [ // {name: '案件总数', data: total, color: '255,45,85'}, // {name: '处理数', data: complete, color: '0,144,255'} // ] // } // }) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> </style>