|
|
@@ -1,4 +1,5 @@ |
|
|
|
const radius = ["55%", "70%"]; |
|
|
|
const radius = ["58%", "72%"]; |
|
|
|
const radius2 = ["45%", "58%"]; |
|
|
|
const grid = { |
|
|
|
top: 0, |
|
|
|
left: 24, |
|
|
@@ -83,12 +84,65 @@ const dataSerie = { |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
const targetSerie = { |
|
|
|
type: "pie", |
|
|
|
radius: radius2, |
|
|
|
center: ["50%", "40%"], |
|
|
|
avoidLabelOvervlap: false, |
|
|
|
label: { |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
labelLine: { |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
data: [ |
|
|
|
{ |
|
|
|
value: 90, |
|
|
|
name: "目标成产量", |
|
|
|
selected: false, |
|
|
|
itemStyle: { |
|
|
|
borderJoin: "round", |
|
|
|
borderCap: "round", |
|
|
|
borderWidth: 12, |
|
|
|
borderRadius: "50%", |
|
|
|
color: { |
|
|
|
type: "linear", |
|
|
|
x: 1, |
|
|
|
y: 0, |
|
|
|
x2: 0, |
|
|
|
y2: 1, |
|
|
|
colorStops: [ |
|
|
|
{ offset: 0, color: "#1065ff66" }, |
|
|
|
{ offset: 1, color: "#1065ff" }, |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: 20, |
|
|
|
name: "-", |
|
|
|
itemStyle: { color: "transparent" }, |
|
|
|
label: { show: false }, |
|
|
|
}, |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
export default (data) => { |
|
|
|
// title.text = |
|
|
|
// (100 * (+data.nowProduction / +data.targetProduction)).toFixed(0) + "%"; |
|
|
|
title.text = (data.nowProduction || 0) + '片'; |
|
|
|
// 外圈 |
|
|
|
title.text = data.nowProduction || 0; |
|
|
|
dataSerie.data[0].value = data.nowProduction; |
|
|
|
dataSerie.data[1].value = data.targetProduction - data.nowProduction; |
|
|
|
dataSerie.data[1].value = !data.targetProduction |
|
|
|
? data.nowProduction == 0 |
|
|
|
? 1 |
|
|
|
: 0 |
|
|
|
: data.targetProduction - data.nowProduction; |
|
|
|
|
|
|
|
// 内圈 |
|
|
|
targetSerie.data[0].value = data?.targetProduction ?? 0; |
|
|
|
targetSerie.data[1].value = data?.targetProduction ? 0 : 1; |
|
|
|
|
|
|
|
return { |
|
|
|
tooltip, |
|
|
|
title, |
|
|
@@ -96,8 +150,8 @@ export default (data) => { |
|
|
|
series: [ |
|
|
|
// background |
|
|
|
bgSerie, |
|
|
|
// actual data |
|
|
|
dataSerie, |
|
|
|
targetSerie, |
|
|
|
], |
|
|
|
}; |
|
|
|
}; |