提交 fb5bd4e4 authored 作者: 王鹏飞's avatar 王鹏飞

update

上级 e215b284
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
// ], // ],
data: seriesData, data: seriesData,
coordinateSystem: 'polar', coordinateSystem: 'polar',
roundCap: true, // roundCap: true,
itemStyle: { color: '#34A6D2' } itemStyle: { color: '#34A6D2' }
} }
] ]
......
...@@ -41,14 +41,20 @@ export default { ...@@ -41,14 +41,20 @@ export default {
tooltip: { trigger: 'axis', axisPointer: {} }, tooltip: { trigger: 'axis', axisPointer: {} },
dataset: { source: this.dataset.source }, dataset: { source: this.dataset.source },
legend: { legend: {
top: 'bottom', // top: 'bottom',
bottom: '10px',
itemWidth: 13, itemWidth: 13,
itemHeight: 13, itemHeight: 13,
icon: 'rect', icon: 'rect',
textStyle: { color: '#fff', fontSize: 16 } textStyle: { color: '#fff', fontSize: 16 }
}, },
yAxis: { type: 'value', splitLine: { show: false } }, yAxis: { type: 'value', splitLine: { show: false }, axisLabel: { color: '#0A7199' } },
xAxis: { type: 'category', axisTick: { show: false }, axisLine: { show: false } }, xAxis: {
type: 'category',
axisTick: { show: false },
axisLine: { show: false },
axisLabel: { color: '#0A7199' }
},
series: this.dataset.series series: this.dataset.series
} }
} }
......
...@@ -19,12 +19,20 @@ export default { ...@@ -19,12 +19,20 @@ export default {
option() { option() {
return { return {
tooltip: { trigger: 'item' }, tooltip: { trigger: 'item' },
legend: { orient: 'vertical', left: 'left', top: 'middle', textStyle: { color: '#fff' } }, legend: {
orient: 'vertical',
right: 0,
top: 'middle',
itemWidth: 14,
itemHeight: 14,
icon: 'rect',
textStyle: { color: '#fff', fontSize: 16 }
},
series: [ series: [
{ {
type: 'pie', type: 'pie',
data: this.dataset, label: { alignTo: 'labelLine', color: '#fff' },
emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } data: this.dataset
} }
] ]
} }
......
...@@ -5,69 +5,70 @@ ...@@ -5,69 +5,70 @@
<script> <script>
import * as api from '@/api/index' import * as api from '@/api/index'
export default { export default {
name: 'MonthlyIncome', name: 'MonthIncomeTrend',
data() { data() {
return { return {
loading: false, loading: false,
response: { sell_data: [] } response: []
} }
}, },
computed: { computed: {
option() { dataset() {
const axisData = [] const dimensions = []
const seriesData = [] const source = {}
this.response.sell_data.forEach(item => { const series = []
axisData.push(item.project_name) this.response.forEach(item => {
seriesData.push({ value: item.pay_money, name: item.project_name }) if (!dimensions.includes(item.week)) {
dimensions.push(item.week)
}
console.log(item.week)
if (!source[item.project_name]) {
source[item.project_name] = []
const temp = { type: 'bar', name: item.project_name, stack: 'total', barWidth: 20 }
if (['当前周预测', 'T+1', 'T+2'].includes(item.week)) {
console.log(temp)
temp.itemStyle = { color: 'transparent', borderWidth: 1, borderColor: '#000' }
}
series.push(temp)
}
source[item.project_name].push(item.pay_money)
}) })
const option = { source.product = dimensions
tooltip: { return { dimensions, source, series }
trigger: 'axis'
},
grid: { left: 0, top: 0, right: 0, bottom: 0 },
angleAxis: {
show: false
}, },
radiusAxis: { option() {
type: 'category', return {
// data: ['sofia', 'kelley'], tooltip: { trigger: 'axis', axisPointer: {} },
data: axisData, dataset: { source: this.dataset.source },
z: 10, legend: {
axisLine: { show: false,
show: false bottom: '10px',
itemWidth: 13,
itemHeight: 13,
icon: 'rect',
textStyle: { color: '#fff', fontSize: 16 }
}, },
axisTick: { yAxis: {
show: false type: 'value',
} splitLine: { show: false },
axisLabel: { color: '#0A7199', formatter: value => value / 10000 }
}, },
textStyle: { xAxis: {
color: '#fff' type: 'category',
axisTick: { show: false },
axisLine: { show: false },
axisLabel: { color: '#0A7199' }
}, },
polar: {}, series: this.dataset.series
series: [
{
type: 'bar',
barWidth: 10,
barCategoryGap: '0%',
// data: [
// { value: 100, itemStyle: { color: '#34A6D2' } },
// { value: 200, itemStyle: { color: '#34A6D2' } }
// ],
data: seriesData,
coordinateSystem: 'polar',
roundCap: true,
itemStyle: { color: '#34A6D2' }
}
]
} }
return option
} }
}, },
methods: { methods: {
getData() { getData() {
this.loading = true this.loading = true
api api
.getMonthIncome() .getPayMoneyByWeek()
.then(response => { .then(response => {
this.response = response this.response = response
}) })
...@@ -84,6 +85,6 @@ export default { ...@@ -84,6 +85,6 @@ export default {
<style scoped> <style scoped>
.chart { .chart {
height: 200px; height: 300px;
} }
</style> </style>
...@@ -33,14 +33,13 @@ export default { ...@@ -33,14 +33,13 @@ export default {
orient: 'vertical', orient: 'vertical',
left: '200px', left: '200px',
top: 'middle', top: 'middle',
itemWidth: 13, itemWidth: 14,
itemHeight: 13, itemHeight: 14,
icon: 'rect', icon: 'rect',
textStyle: { color: '#fff', fontSize: 16, padding: [0, 0, 0, 12] } textStyle: { color: '#fff', fontSize: 16, padding: [0, 0, 0, 12] }
}, },
series: [ series: [
{ {
name: '年度总营收',
type: 'pie', type: 'pie',
radius: ['60%', '90%'], radius: ['60%', '90%'],
width: 160, width: 160,
......
<template> <template>
<div> <div>
<month-dashboard style="margin-bottom: 24px"></month-dashboard> <month-dashboard style="margin-bottom: 24px"></month-dashboard>
<card>
<week-income></week-income>
</card>
<card title="各项目月度营收"> <card title="各项目月度营收">
<month-income></month-income> <month-income></month-income>
</card> </card>
...@@ -45,9 +48,9 @@ import YearIncome from '@/components/yearIncome' ...@@ -45,9 +48,9 @@ import YearIncome from '@/components/yearIncome'
import ProjectRanking from '@/components/projectRanking' import ProjectRanking from '@/components/projectRanking'
// 各月营收走势 // 各月营收走势
import MonthIncomeTrend from '@/components/monthIncomeTrend' import MonthIncomeTrend from '@/components/monthIncomeTrend'
// 缴费结构 // 缴费结构
import PaymentStructure from '@/components/PaymentStructure' import PaymentStructure from '@/components/PaymentStructure'
import WeekIncome from '@/components/weekIncome'
export default { export default {
name: 'Index', name: 'Index',
...@@ -61,7 +64,8 @@ export default { ...@@ -61,7 +64,8 @@ export default {
YearIncome, YearIncome,
ProjectRanking, ProjectRanking,
MonthIncomeTrend, MonthIncomeTrend,
PaymentStructure PaymentStructure,
WeekIncome
}, },
data() { data() {
return {} return {}
......
...@@ -6,6 +6,7 @@ Vue.use(Vuex) ...@@ -6,6 +6,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
colors: { sofia: '#FC654B', kelley: '#34A6D2', ciis: '#EFB1AE', cu: '#F9BD73', shms: '#9892F0' },
user: {}, user: {},
isLogin: false, isLogin: false,
isIos: /iphone|ipad|ipod/i.test(navigator.userAgent), isIos: /iphone|ipad|ipod/i.test(navigator.userAgent),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论