|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <charts id="chart" height="255px" :option="option"/>
|
|
|
|
|
|
|
+ <charts id="chart" height="255px" :option="option" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -8,7 +8,7 @@
|
|
|
import charts from '../../../components/echarts/index.vue'
|
|
import charts from '../../../components/echarts/index.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: {charts},
|
|
|
|
|
|
|
+ components: { charts },
|
|
|
props: {
|
|
props: {
|
|
|
deptId: {
|
|
deptId: {
|
|
|
type: String,
|
|
type: String,
|
|
@@ -58,8 +58,8 @@ export default {
|
|
|
xAxis: [
|
|
xAxis: [
|
|
|
{
|
|
{
|
|
|
type: 'category',
|
|
type: 'category',
|
|
|
- axisTick: {show: false},
|
|
|
|
|
- splitLine: {show: false},
|
|
|
|
|
|
|
+ axisTick: { show: false },
|
|
|
|
|
+ splitLine: { show: false },
|
|
|
data: [],
|
|
data: [],
|
|
|
axisPointer: {
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
type: 'shadow'
|
|
@@ -76,8 +76,8 @@ export default {
|
|
|
yAxis: [
|
|
yAxis: [
|
|
|
{
|
|
{
|
|
|
type: 'value',
|
|
type: 'value',
|
|
|
- axisTick: {show: false},
|
|
|
|
|
- splitLine: {show: false},
|
|
|
|
|
|
|
+ axisTick: { show: false },
|
|
|
|
|
+ splitLine: { show: false },
|
|
|
axisLine: {
|
|
axisLine: {
|
|
|
show: true,
|
|
show: true,
|
|
|
lineStyle: {
|
|
lineStyle: {
|
|
@@ -89,8 +89,8 @@ export default {
|
|
|
{
|
|
{
|
|
|
type: 'value',
|
|
type: 'value',
|
|
|
name: '',
|
|
name: '',
|
|
|
- axisTick: {show: true},
|
|
|
|
|
- splitLine: {show: true},
|
|
|
|
|
|
|
+ axisTick: { show: true },
|
|
|
|
|
+ splitLine: { show: true },
|
|
|
interval: 5,
|
|
interval: 5,
|
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
formatter: '',
|
|
formatter: '',
|
|
@@ -124,7 +124,7 @@ export default {
|
|
|
show: true,
|
|
show: true,
|
|
|
position: 'top'
|
|
position: 'top'
|
|
|
},
|
|
},
|
|
|
- lineStyle: {color: '#528BEC', type: 'solid', borderColor: 'red'},
|
|
|
|
|
|
|
+ lineStyle: { color: '#528BEC', type: 'solid', borderColor: 'red' },
|
|
|
data: []
|
|
data: []
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
show: true,
|
|
show: true,
|
|
|
position: 'top'
|
|
position: 'top'
|
|
|
},
|
|
},
|
|
|
- lineStyle: {color: 'red', type: 'solid', borderColor: 'red'},
|
|
|
|
|
|
|
+ lineStyle: { color: 'red', type: 'solid', borderColor: 'red' },
|
|
|
data: []
|
|
data: []
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -157,33 +157,25 @@ export default {
|
|
|
type: 1
|
|
type: 1
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
init() {
|
|
init() {
|
|
|
this.$api.invest
|
|
this.$api.invest
|
|
|
- .count({
|
|
|
|
|
- deptId: this.deptId === null ? '' : this.deptId,
|
|
|
|
|
- year: this.year === null ? '' : this.year,
|
|
|
|
|
- quarter: this.quarter.value === undefined ? '' : this.quarter.value
|
|
|
|
|
- })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- this.option.xAxis[0].data = res.data.map(res => res.month)
|
|
|
|
|
- this.option.series[0].data = res.data.map(
|
|
|
|
|
- res => res.sum_complete_amount
|
|
|
|
|
- )
|
|
|
|
|
- this.option.series[1].data = res.data.map(res => res.average)
|
|
|
|
|
- const size = this.option.series[0].data.length
|
|
|
|
|
- this.avg(
|
|
|
|
|
- this.option.series[0].data[size - 2],
|
|
|
|
|
- this.option.series[1].data[size - 2]
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- avg(lastComplete, lastAvg) {
|
|
|
|
|
- this.$emit('avg', lastAvg === 0 ? true : lastComplete > lastAvg)
|
|
|
|
|
|
|
+ .count({
|
|
|
|
|
+ deptId: this.deptId === null ? '' : this.deptId,
|
|
|
|
|
+ year: this.year === null ? '' : this.year,
|
|
|
|
|
+ quarter: this.quarter.value === undefined ? '' : this.quarter.value
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.option.xAxis[0].data = res.data.map(res => res.month)
|
|
|
|
|
+ this.option.series[0].data = res.data.map(
|
|
|
|
|
+ res => res.sum_complete_amount
|
|
|
|
|
+ )
|
|
|
|
|
+ this.option.series[1].data = res.data.map(res => res.average)
|
|
|
|
|
+ const size = this.option.series[0].data.length
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|