master
lion 2 years ago
parent 1679662592
commit 7c0cf93ddd

@ -0,0 +1,100 @@
<template>
<div style="width:100%;height:100%" ref="chartsDOM">
</div>
</template>
<script>
import * as echarts from 'echarts';
export default {
props:{
lineDataX:{
type:Array,
default:{}
},
lineDataY:{
type:Array,
default:{}
},
rotate:{
type:Number,
default:0
},
color:{
type:Array,
default:()=>{
return ['#0077CC','#333']
}
}
},
data() {
return {
myChart: null
}
},
mounted() {
this.initEchartsMap()
},
methods: {
initEchartsMap() {
this.myChart = echarts.init(this.$refs["chartsDOM"]);
var option = {
color: [this.color[0]],
tooltip: {
trigger: 'axis',
axisPointer: { //
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '8%',
right: '8%',
bottom: '8%',
top: "8%",
containLabel: true
},
xAxis: [{
type: 'category',
data: this.lineDataX,
axisTick: {
alignWithLabel: true
},
axisLabel: {
show:true,
interval: 0,
rotate: this.rotate,
textStyle: {
show: true,
color: this.color[1]
},
}
}],
yAxis: [{
type: 'value',
axisLabel: {
textStyle: {
show: true,
color: this.color[1]
},
}
}],
series: [{
name: '数量',
type: 'bar',
barWidth: '60%',
data: this.lineDataY
}]
};
this.myChart.setOption(option);
},
resetCharts() {
this.myChart.resize()
}
}
}
</script>
<style>
</style>

@ -0,0 +1,46 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="出库统计" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
</div>
<div class="wrap" :style="{'height':mapHeight+'px'}">
<echartsLine ref="echartsLine1" :rotate="60" :lineDataX='monthX' :lineDataY='monthY'></echartsLine>
</div>
</div>
</template>
<script>
import echartsLine from "@/views/reports/components/echartsLine.vue";
export default {
components: {
echartsLine
},
data(){
return{
mapHeight:0,
monthX: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
monthY: [5, 6, 7, 8, 9, 10, 12, 5, 6, 7, 8, 9],
}
},
created(){
this.initHeight()
},
methods: {
initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
console.log(winHeight)
},
},
}
</script>
<style>
.wrap{
width:100%;
}
</style>

@ -0,0 +1,46 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="入库统计" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
</div>
<div class="wrap" :style="{'height':mapHeight+'px'}">
<echartsLine ref="echartsLine1" :rotate="60" :lineDataX='monthX' :lineDataY='monthY'></echartsLine>
</div>
</div>
</template>
<script>
import echartsLine from "@/views/reports/components/echartsLine.vue";
export default {
components: {
echartsLine
},
data(){
return{
mapHeight:0,
monthX: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
monthY: [5, 6, 7, 8, 9, 10, 12, 5, 6, 7, 8, 9],
}
},
created(){
this.initHeight()
},
methods: {
initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
console.log(winHeight)
},
},
}
</script>
<style>
.wrap{
width:100%;
}
</style>
Loading…
Cancel
Save