Commit 2ac1643d authored by 沈翠玲's avatar 沈翠玲

修改bug

parent c1e3b8ac
......@@ -81,31 +81,54 @@ const formatOptions = (data: any) => {
},
],
grid: {
left: 82,
left: 10,
bottom: 30,
right: 40,
},
legend: {
show: false
},
yAxis: {
yAxis: [{
type: 'category',
triggerEvent: true,
data: [],
axisLabel: {
color: '#fff',
fontSize: 14,
formatter: function (value: string) {
return (value.length > 4 ? (value.slice(0,4)+"...") : value )
}
},
axisTick: {
show: false,
},
show: false,
axisLine: {
show: false,
},
},
{
type: "category",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
inside: false,
textStyle: {
color: "#fff",
fontSize: "14",
fontFamily: "PingFangSC-Regular",
},
formatter: function (val) {
return `${val}`;
},
},
splitArea: {
show: false,
},
splitLine: {
show: false,
},
data: [],
}
],
series: [],
};
if (data && data.length) {
......@@ -114,13 +137,22 @@ const formatOptions = (data: any) => {
type: 'bar',
barGap: 0,
label: {
show: true,
position: 'right',
color: '#fff',
normal: {
color: "#fff",
show: true,
position: [0, "-14px"],
textStyle: {
fontSize: 17,
},
formatter: function (a) {
return a.name;
},
},
},
data: data.map((item: any) => item.ct),
}];
option.yAxis.data = xAxisData;
option.yAxis[0].data = xAxisData;
option.yAxis[1].data = data.map((item: any) => item.ct);
option.series = series;
}
console.log('option', option)
......@@ -168,25 +200,11 @@ const Main: React.FC<ProcessOutProps> = ({ data, setting }) => {
const chart = getInstanceByDom(chartRef.current);
const option = formatOptions(data);
chart?.setOption(option);
chart?.off('click');
chart?.on('click', (p) => {
if (p.seriesName === '完成量') {
console.log(setting.productionComprehensKanbanSettingId, '----');
setProcessParams({
dataRange: setting.dataRange,
processName: p.name,
current: 1,
pageSize: 10,
kanbanSettingId: setting.productionComprehensKanbanSettingId,
});
setIsModalOpen(true);
}
});
// 如果数据工序大于5那么需要自动轮训播放
if (option.yAxis.data.length > 4 && setting.rowMovingTime > 0) {
if (option.yAxis[0].data.length > 4 && setting.rowMovingTime > 0) {
timer = setInterval(() => {
option.dataZoom[0].startValue++;
if (option.dataZoom[0].endValue++ >= option.yAxis.data.length - 1) {
if (option.dataZoom[0].endValue++ >= option.yAxis[0].data.length - 1) {
option.dataZoom[0].startValue = 0;
option.dataZoom[0].endValue = 3;
}
......
......@@ -73,9 +73,9 @@ const formatOptions = (data: any) => {
},
],
grid: {
left: 70,
left: 10,
bottom: 30,
right: 40,
right: 50,
},
legend: {
orient: 'vertical',
......@@ -88,17 +88,11 @@ const formatOptions = (data: any) => {
fontSize: 14,
},
},
yAxis: {
yAxis: [{
type: 'category',
triggerEvent: true,
data: [],
axisLabel: {
color: '#fff',
fontSize: 14,
formatter: function (value: string) {
return (value.length > 4 ? (value.slice(0,4)+"...") : value )
}
},
show: false,
axisTick: {
show: false,
},
......@@ -106,6 +100,35 @@ const formatOptions = (data: any) => {
show: false,
},
},
{
type: "category",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
inside: false,
textStyle: {
color: "#fff",
fontSize: "14",
fontFamily: "PingFangSC-Regular",
},
formatter: function (val) {
return `${val}%`;
},
},
splitArea: {
show: false,
},
splitLine: {
show: false,
},
data: [],
}
],
series: [],
};
if (data && data.length) {
......@@ -119,15 +142,23 @@ const formatOptions = (data: any) => {
name: item.label,
barGap: 0,
label: {
show: true,
position: 'right',
color: '#fff',
formatter: '{c}%',
normal: {
color: "#fff",
show: true,
position: [0, "-14px"],
textStyle: {
fontSize: 17,
},
formatter: function (a) {
return a.name;
},
},
},
data: data.map((v) => v[item.field]),
};
});
option.yAxis.data = xAxisData;
option.yAxis[0].data = xAxisData;
option.yAxis[1].data = data.map((v) => v['qualifiedRate']);
option.series = series;
}
return option;
......@@ -199,10 +230,10 @@ const Main: React.FC<ProcessFailProps> = ({ data, setting }) => {
}
});
// 如果数据工序大于5那么需要自动轮训播放
if (option.yAxis.data.length > 4 && setting.rowMovingTime > 0) {
if (option.yAxis[0].data.length > 4 && setting.rowMovingTime > 0) {
timer = setInterval(() => {
option.dataZoom[0].startValue++;
if (option.dataZoom[0].endValue++ >= option.yAxis.data.length - 1) {
if (option.dataZoom[0].endValue++ >= option.yAxis[0].data.length - 1) {
option.dataZoom[0].startValue = 0;
option.dataZoom[0].endValue = 3;
}
......
......@@ -80,6 +80,8 @@ const formatOptions = (data: any) => {
interval: 0,
color: '#fff',
fontSize: 14,
width: 120,
overflow: 'breakAll'
},
axisTick: {
show: false,
......@@ -99,7 +101,7 @@ const formatOptions = (data: any) => {
grid: {
left: 5,
// right: 60,
bottom: 30,
bottom: 40,
},
legend: {
orient: 'vertical',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment