|
|
@@ -9,100 +9,111 @@ import charts from '../../../components/echarts/index.vue'
|
|
|
|
|
|
export default {
|
|
|
components: { charts },
|
|
|
+ props: {
|
|
|
+ deptId: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ quarter: {
|
|
|
+ type: Object,
|
|
|
+ default: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ deptId: {
|
|
|
+ handler (val) {
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ quarter: {
|
|
|
+ handler (val) {
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
option: {
|
|
|
title: {
|
|
|
- text: '单位(个)',
|
|
|
- x: 'right',
|
|
|
- y: 'top',
|
|
|
+ text: '单位:(万元)',
|
|
|
textStyle: {
|
|
|
color: 'white',
|
|
|
fontSize: '12'
|
|
|
- }
|
|
|
- },
|
|
|
- color: ['#ED7B30', '#64D4F4'],
|
|
|
- legend: {
|
|
|
- textStyle: {
|
|
|
- color: 'white'
|
|
|
},
|
|
|
- data: ['项目入库', '项目开工']
|
|
|
- },
|
|
|
- toolbox: {
|
|
|
- show: true
|
|
|
+ x: 'right',
|
|
|
+ y: 'top'
|
|
|
},
|
|
|
- xAxis: {
|
|
|
- type: 'category',
|
|
|
- axisTick: { show: false },
|
|
|
- splitLine: { show: false },
|
|
|
- boundaryGap: true,
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- color: '#B0F0EE',
|
|
|
- width: '2'
|
|
|
+ xAxis: [
|
|
|
+ {
|
|
|
+ type: 'category',
|
|
|
+ axisTick: { show: false },
|
|
|
+ splitLine: { show: false },
|
|
|
+ data: ['2', '3'],
|
|
|
+ axisPointer: {
|
|
|
+ type: 'shadow'
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: true,
|
|
|
+ lineStyle: {
|
|
|
+ color: '#B2BFCB',
|
|
|
+ width: '2'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ yAxis: [
|
|
|
+ {
|
|
|
+ type: 'value',
|
|
|
+ axisTick: { show: true },
|
|
|
+ splitLine: { show: false },
|
|
|
+ axisLine: {
|
|
|
+ show: true,
|
|
|
+ lineStyle: {
|
|
|
+ color: '#B2BFCB',
|
|
|
+ width: '2'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- data: []
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- type: 'value',
|
|
|
- axisTick: { show: false },
|
|
|
- splitLine: { show: false },
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- color: '#B0F0EE',
|
|
|
- width: '2'
|
|
|
+ {
|
|
|
+ type: 'value',
|
|
|
+ name: '',
|
|
|
+ axisTick: { show: false },
|
|
|
+ splitLine: { show: false },
|
|
|
+ min: 0,
|
|
|
+ max: 25,
|
|
|
+ interval: 5,
|
|
|
+ axisLabel: {
|
|
|
+ formatter: ''
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
+ ],
|
|
|
series: [
|
|
|
{
|
|
|
- name: '项目入库',
|
|
|
+ name: '计划完成总投资',
|
|
|
type: 'line',
|
|
|
- data: [9, 15, 14, 12, 11, 12],
|
|
|
- smooth: true,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: '#ED7B30',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- color: '#ED7B30',
|
|
|
- fontSize: 14
|
|
|
- }
|
|
|
+ barWidth: '45',
|
|
|
+ tooltip: {
|
|
|
+ valueFormatter: function (value) {
|
|
|
+ return value + ' ml'
|
|
|
}
|
|
|
},
|
|
|
- markPoint: {
|
|
|
- data: [
|
|
|
- { type: 'max', name: 'Max' },
|
|
|
- { type: 'min', name: 'Min' }
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- name: '项目开工',
|
|
|
- type: 'line',
|
|
|
- data: [6, 12, 12, 15, 13, 12],
|
|
|
itemStyle: {
|
|
|
- color: '#5EC7D5',
|
|
|
- borderColor: '#5EC7D5',
|
|
|
normal: {
|
|
|
- color: '#5EC7D5',
|
|
|
label: {
|
|
|
show: true,
|
|
|
- color: '#5EC7D5',
|
|
|
- fontSize: 14
|
|
|
+ color: 'red',
|
|
|
+ fontSize: 12
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- smooth: true,
|
|
|
- markPoint: {
|
|
|
- data: [
|
|
|
- { type: 'max', name: 'Max' },
|
|
|
- { type: 'min', name: 'Min' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: 'top'
|
|
|
+ },
|
|
|
+ lineStyle: { color: '#528BEC', type: 'solid', borderColor: 'red' },
|
|
|
+ data: []
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -112,7 +123,17 @@ export default {
|
|
|
created () {
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ init () {
|
|
|
+ this.$api.invest.count({
|
|
|
+ deptId: this.deptId === null ? '' : this.deptId,
|
|
|
+ quarter: this.quarter.value === undefined ? '' : this.quarter.value
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.option.xAxis[0].data = res.data.list.map(res => res.month)
|
|
|
+ this.option.series[0].data = res.data.list.map(res => res.sum_complete_amount)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|