Browse Source

显示数量

master
han\hanst 3 months ago
parent
commit
68152177ff
  1. 39
      src/views/modules/dashboard/warehouse-3d-board.vue

39
src/views/modules/dashboard/warehouse-3d-board.vue

@ -600,6 +600,18 @@ export default {
this.charts.storage = echarts.init(chartDom) this.charts.storage = echarts.init(chartDom)
// legend formatter
const storageData = {
steelPallet: this.storageData.steelPallet || 0,
guardPallet: this.storageData.guardPallet || 0,
flatPallet: this.storageData.flatPallet || 0,
otherPallet: this.storageData.otherPallet || 0
}
//
console.log('初始化饼图 - 库位数据:', storageData)
console.log('原始storageData:', this.storageData)
const option = { const option = {
color: ['#00d4ff', '#7b68ee', '#00ff88','#c5d9ed'], color: ['#00d4ff', '#7b68ee', '#00ff88','#c5d9ed'],
tooltip: { tooltip: {
@ -627,7 +639,7 @@ export default {
name: '库位类型', name: '库位类型',
type: 'pie', type: 'pie',
radius: ['30%', '70%'], radius: ['30%', '70%'],
center: ['40%', '50%'],
center: ['50%', '50%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
itemStyle: { itemStyle: {
borderRadius: 8, borderRadius: 8,
@ -637,7 +649,10 @@ export default {
label: { label: {
show: true, show: true,
position: 'inside', position: 'inside',
formatter: '{d}%',
formatter: function(params) {
const percent = params.percent ? params.percent.toFixed(1) : '0.0'
return percent + '%'
},
color: '#fff', color: '#fff',
fontSize: 12, fontSize: 12,
fontWeight: 'bold' fontWeight: 'bold'
@ -645,6 +660,10 @@ export default {
emphasis: { emphasis: {
label: { label: {
show: true, show: true,
formatter: function(params) {
const percent = params.percent ? params.percent.toFixed(1) : '0.0'
return percent + '%'
},
fontSize: 14, fontSize: 14,
fontWeight: 'bold' fontWeight: 'bold'
}, },
@ -656,8 +675,8 @@ export default {
}, },
data: [ data: [
{ {
value: this.storageData.steelPallet,
name: '钢托盘',
value: storageData.steelPallet,
name: '钢托盘(' + storageData.steelPallet + ')',
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',
@ -670,8 +689,8 @@ export default {
} }
}, },
{ {
value: this.storageData.guardPallet,
name: '围挡托盘',
value: storageData.guardPallet,
name: '围挡托盘(' + storageData.guardPallet + ')',
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',
@ -684,8 +703,8 @@ export default {
} }
}, },
{ {
value: this.storageData.flatPallet,
name: '平托盘',
value: storageData.flatPallet,
name: '平托盘(' + storageData.flatPallet + ')',
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',
@ -698,8 +717,8 @@ export default {
} }
}, },
{ {
value: this.storageData.otherPallet,
name: '可用库位数',
value: storageData.otherPallet,
name: '可用库位数(' + storageData.otherPallet + ')',
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',

Loading…
Cancel
Save