Commit 3238334f by ningjihai

echart 单位

parent 9a596b05
......@@ -28,6 +28,10 @@ export default {
chartList: {
type: Array,
default: () => []
},
unit: {
type: String,
default: ''
}
},
data() {
......@@ -78,7 +82,7 @@ export default {
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: "{b}: {c}"
formatter: "{b}: {c}" + this.unit
},
legend: {
orient: 'horizontal',
......@@ -166,7 +170,7 @@ export default {
],
label: {
normal: {
formatter: '{b}:{c}'
formatter: '{b}:{c}' + this.unit
},
},
......
......@@ -32,6 +32,10 @@ export default {
chartList: {
type: Array,
default: () => []
},
unit: {
type: String,
default: ''
}
},
data() {
......@@ -108,9 +112,13 @@ export default {
},
type: 'value',
show: true,
minInterval: 1,
axisTick: {
show: true
},
axisLabel: {
formatter: '{value} '+ this.unit
}
}],
yAxis: [{
splitLine: {
......
......@@ -54,7 +54,7 @@
</el-radio-group>
</div>
<div class="flex1">
<kucunchart :chartList="kucunList"/>
<kucunchart :chartList="kucunList" :unit="kucunUnit"/>
</div>
</div>
</div>
......@@ -70,7 +70,7 @@
</el-radio-group>
</div>
<div class="flex1">
<rukuRankChart :chartList="rukuList"/>
<rukuRankChart :chartList="rukuList" :unit="rukuUnit"/>
</div>
</div>
<div class="card-container-flex chart-container shadow flex1 two">
......@@ -82,7 +82,7 @@
</el-radio-group>
</div>
<div class="flex1">
<rukuRankChart barColor="rgba(255, 125, 0, 1)" :chartList="cukuList"/>
<rukuRankChart barColor="rgba(255, 125, 0, 1)" :chartList="cukuList" :unit="cukuUnit"/>
</div>
</div>
</div>
......@@ -142,7 +142,10 @@ export default {
cukuRankType: 'count',
kucunList:[],
cukuList:[],
rukuList:[]
rukuList:[],
rukuUnit:'件',
cukuUnit:'件',
kucunUnit:'件'
}
},
mounted() {
......@@ -187,6 +190,7 @@ export default {
value:item.totalQuantity,
name:item.materialName
})).reverse().splice(0,5).reverse()
this.rukuUnit = '件'
})
}
if(this.rukuRankType === 'money'){
......@@ -197,7 +201,9 @@ export default {
value:item.totalMoney,
name:item.materialName
})).reverse().splice(0,5).reverse()
this.rukuUnit = '元'
})
}
},
queryKucun(){
......@@ -205,9 +211,8 @@ export default {
inventoryTopTenByQuantity().then(res=>{
let data = res.rows
if(!data) return
console.log('123123',data)
this.kucunList = data.splice(0,5)
this.kucunUnit = '件'
})
}
if(this.kucunQueryType === 'money'){
......@@ -215,6 +220,7 @@ export default {
let data = res.rows
if(!data) return
this.kucunList = data.splice(0,5)
this.kucunUnit = '元'
})
}
},
......@@ -235,6 +241,7 @@ export default {
let data = res.rows
if(!data) return
this.cukuList = data.splice(0,5).reverse()
this.cukuUnit = '件'
})
}
if(this.cukuRankType === 'money'){
......@@ -242,6 +249,7 @@ export default {
let data = res.rows
if(!data) return
this.cukuList = data.splice(0,5).reverse()
this.cukuUnit = '元'
})
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论