style(工作台): 修复工作台饼图多余tooltip

This commit is contained in:
xinxin.wu 2024-11-21 18:40:48 +08:00 committed by 刘瑞斌
parent 454ccccea8
commit ff68f2090e
2 changed files with 19 additions and 9 deletions

View File

@ -63,8 +63,7 @@
bottom: 40,
},
tooltip: {
...toolTipConfig,
show: !!props.hasPermission,
show: true,
},
legend: {
orient: 'vertical',
@ -80,6 +79,9 @@
formatter: (name: any) => {
return `{a|${name}} {b|${addCommasToNumber(1022220)}}`;
},
tooltip: {
show: false,
},
},
textStyle: {
rich: {
@ -138,7 +140,15 @@
function initOptions() {
const { name, color } = props.rateConfig;
options.value.series.data = [...props.data.slice(1)];
options.value.series.data = [...props.data.slice(1)].map((e) => {
return {
...e,
tooltip: {
...toolTipConfig,
show: !!props.hasPermission,
},
};
});
options.value.legend.formatter = (seriousName: string) => {
const item = props.data.find((e) => e.name === seriousName);

View File

@ -293,12 +293,7 @@ export function getPieCharOptions(key: WorkCardEnum, hasPermission: boolean) {
textAlign: 'center', // 确保副标题居中
},
color: colorMapConfig[key],
tooltip: {
...toolTipConfig,
trigger: 'item',
position: 'right',
show: !!hasPermission,
},
tooltip: { show: true },
legend: {
width: '100%',
height: 128,
@ -470,6 +465,11 @@ export function handlePieData(
options.series.data = lastStatusPercentList.map((item) => ({
name: item.status,
value: item.count,
tooltip: {
...toolTipConfig,
position: 'right',
show: !!hasPermission,
},
}));
// 计算总数和图例格式