fix(工作台): 修复工作台测试计划概览缺陷

This commit is contained in:
xinxin.wu 2024-12-11 18:53:51 +08:00 committed by 刘瑞斌
parent 67cdb0ddc3
commit 95503291b6
2 changed files with 32 additions and 28 deletions

View File

@ -147,6 +147,8 @@
radius: ['75%', '90%'], radius: ['75%', '90%'],
center: ['50%', '50%'], center: ['50%', '50%'],
color: [], color: [],
minAngle: 5,
minShowLabelAngle: 10,
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
@ -175,22 +177,24 @@
const pieBorderWidth = hasDataLength === 1 ? 0 : 1; const pieBorderWidth = hasDataLength === 1 ? 0 : 1;
options.value.series.data = const seriesData = temData
hasDataLength > 0 .map((e, i) => {
? temData.map((e) => { return {
return { ...e,
...e, tooltip: {
tooltip: { ...toolTipConfig,
...toolTipConfig, show: !!props.hasPermission,
show: !!props.hasPermission, },
}, itemStyle: {
itemStyle: { color: color[i],
borderWidth: pieBorderWidth, borderWidth: pieBorderWidth,
borderColor: '#ffffff', borderColor: '#ffffff',
}, },
}; };
}) })
: []; .filter((e) => e.value !== 0);
options.value.series.data = hasDataLength > 0 ? seriesData : [];
legend.value = [...props.data.slice(1)].map((e, i) => { legend.value = [...props.data.slice(1)].map((e, i) => {
return { return {
...e, ...e,
@ -213,8 +217,6 @@
options.value.tooltip.show = !!props.hasPermission; options.value.tooltip.show = !!props.hasPermission;
options.value.title.text = name; options.value.title.text = name;
options.value.series.color = color;
} }
const chartRef = ref<InstanceType<typeof MsChart>>(); const chartRef = ref<InstanceType<typeof MsChart>>();

View File

@ -257,16 +257,18 @@
const pieBorderWidth = executeData.filter((e) => Number(e.value) > 0).length === 1 ? 0 : 1; const pieBorderWidth = executeData.filter((e) => Number(e.value) > 0).length === 1 ? 0 : 1;
execOptions.value.series.data = executeData.map((e) => { execOptions.value.series.data = executeData
return { .map((e) => {
...e, return {
itemStyle: { ...e,
borderWidth: pieBorderWidth, itemStyle: {
borderColor: '#ffffff', borderWidth: pieBorderWidth,
color: e.color, borderColor: '#ffffff',
}, color: e.color,
}; },
}); };
})
.filter((e) => e.value !== 0);
} }
const showSkeleton = ref(false); const showSkeleton = ref(false);