yanghao 1 неделя назад
Родитель
Сommit
da476ddc0a
1 измененных файлов с 56 добавлено и 36 удалено
  1. 56 36
      src/views/pms/stat/rdkb/rd-Inventory-safety.vue

+ 56 - 36
src/views/pms/stat/rdkb/rd-Inventory-safety.vue

@@ -242,37 +242,8 @@ function getDistributionOption(
         fontFamily: FONT_FAMILY
       }
     }),
-    graphic: [
-      {
-        type: 'text',
-        left: '19.5%',
-        top: '45%',
-        style: {
-          text: `总库存\n${formatAmount(inventoryTotal)}万元`,
-          textAlign: 'center',
-          fill: THEME.text.strong,
-          fontSize: layout.compact ? 8 : 10,
-          fontWeight: 700,
-          lineHeight: layout.distributionTitleLineHeight + 6,
-          fontFamily: FONT_FAMILY
-        }
-      },
-      {
-        type: 'text',
-        left: '67%',
-        top: '45%',
-        style: {
-          text: `总积压\n${formatAmount(backlogTotal)}万元`,
-          textAlign: 'center',
-          fill: THEME.text.strong,
-          fontSize: layout.compact ? 8 : 10,
-          fontWeight: 700,
-          lineHeight: layout.distributionTitleLineHeight + 6,
-          fontFamily: FONT_FAMILY
-        }
-      }
-    ],
     series: [
+      // ===== 第一个饼图:库存数据(带外标签) =====
       {
         name: '库存',
         type: 'pie',
@@ -293,11 +264,8 @@ function getDistributionOption(
         },
         labelLine: {
           show: true,
-          // length: layout.compact ? 6 : 10,
-          // length2: layout.compact ? 8 : 14,
           minTurnAngle: 90,
           lineStyle: {
-            color: distributionColors[0],
             width: 1.5,
             opacity: 1
           }
@@ -324,6 +292,34 @@ function getDistributionOption(
           }
         }))
       },
+      // ===== 第二个饼图:库存中心文字(不显示饼图) =====
+      {
+        name: '库存中心文字',
+        type: 'pie',
+        radius: ['0%', '0%'],
+        center: ['25%', layout.distributionPieCenterY],
+        label: {
+          show: true,
+          position: 'center',
+          formatter: `总库存\n${formatAmount(inventoryTotal)}万元`,
+          color: THEME.text.strong,
+          fontSize: layout.compact ? 8 : 10,
+          fontWeight: 700,
+          lineHeight: layout.distributionTitleLineHeight + 6,
+          fontFamily: FONT_FAMILY
+        },
+        data: [{ name: '中心文字', value: 1 }],
+        animation: false,
+        tooltip: { show: false },
+        legend: { show: false },
+        // ✅ 关键:禁用所有交互
+        silent: true,
+        emphasis: {
+          scale: false,
+          label: { show: false }
+        }
+      },
+      // ===== 第三个饼图:积压数据(带外标签) =====
       {
         name: '积压库存',
         type: 'pie',
@@ -344,11 +340,8 @@ function getDistributionOption(
         },
         labelLine: {
           show: true,
-          // length: layout.compact ? 6 : 10,
-          // length2: layout.compact ? 8 : 14,
           minTurnAngle: 90,
           lineStyle: {
-            color: distributionColors[0],
             width: 1.5,
             opacity: 1
           }
@@ -376,6 +369,33 @@ function getDistributionOption(
               }
             }
           }))
+      },
+      // ===== 第四个饼图:积压中心文字(不显示饼图) =====
+      {
+        name: '积压中心文字',
+        type: 'pie',
+        radius: ['0%', '0%'],
+        center: ['73%', layout.distributionPieCenterY],
+        label: {
+          show: true,
+          position: 'center',
+          formatter: `总积压\n${formatAmount(backlogTotal)}万元`,
+          color: THEME.text.strong,
+          fontSize: layout.compact ? 8 : 10,
+          fontWeight: 700,
+          lineHeight: layout.distributionTitleLineHeight + 6,
+          fontFamily: FONT_FAMILY
+        },
+        data: [{ name: '中心文字', value: 1 }],
+        animation: false,
+        tooltip: { show: false },
+        legend: { show: false },
+        // ✅ 关键:禁用所有交互
+        silent: true,
+        emphasis: {
+          scale: false,
+          label: { show: false }
+        }
       }
     ]
   }