caoziwu 1 주 전
부모
커밋
8876d4db49
2개의 변경된 파일과 30개의 추가작업 그리고 18개의 파일을 삭제
  1. 9 7
      src/renderer/src/components/simulator/ParamsPanel.vue
  2. 21 11
      src/renderer/src/lib/speaker/echarts/diagramOption.ts

+ 9 - 7
src/renderer/src/components/simulator/ParamsPanel.vue

@@ -72,8 +72,13 @@ const powerModeOptions = computed(() => {
 const apply = (): void => {
   const device = devicesConfig.find((d) => d.model === selectedModel.value)
   const isCustom = !device || device.model === 'custom'
+  const flag = device.splMax.extension ? isExtension.value : false
+  const firstOption = flag ? device.splMax.extension : device.splMax.standalone
+
   formData.hCov = isCustom ? formData.hCov : device.horizontalAngle
   formData.vCov = isCustom ? formData.vCov : device.verticalAngle
+  formData.splMax =
+    firstOption.find((item) => item.label == powerMode.value)?.value || firstOption[0].value
   const deviceState = {
     model: selectedModel.value,
     isExtension: isExtension.value,
@@ -95,18 +100,15 @@ const apply = (): void => {
 const onSelectModel = (model: string | null): void => {
   const val = model || 'custom'
   selectedModel.value = val
-  isExtension.value = false
-  const firstOption = powerModeOptions.value[0]
-  powerMode.value = firstOption ? firstOption.label : ''
-  formData.splMax = firstOption ? firstOption.value : 20
+  if (val != 'custom' && powerModeOptions.value.length > 0 && !powerMode.value) {
+    powerMode.value = powerModeOptions.value[0].label
+    onSelectPowerMode(powerMode.value)
+  }
   apply()
 }
 
 const onToggleExtension = (value: boolean): void => {
   isExtension.value = value
-  const firstOption = powerModeOptions.value[0]
-  powerMode.value = firstOption ? firstOption.label : ''
-  formData.splMax = firstOption ? firstOption.value : 0
   apply()
 }
 

+ 21 - 11
src/renderer/src/lib/speaker/echarts/diagramOption.ts

@@ -114,6 +114,7 @@ export function buildDiagramOption(
   // 声学中轴(橙色实线)
   series.push({
     type: 'line',
+    name: labels.acousticAxis,
     data: [
       [0, z],
       [Math.min(maxD, d3), 0]
@@ -121,12 +122,14 @@ export function buildDiagramOption(
     showSymbol: false,
     lineStyle: { color: pal.accent, type: 'dashed', width: 2 },
     silent: true,
-    z: 3
+    z: 3,
+    tooltip: { show: false }
   } as SeriesOption)
 
   // 垂直高度 Z 虚线
   series.push({
     type: 'line',
+    name: labels.height,
     data: [
       [0, z],
       [0, 0]
@@ -134,17 +137,19 @@ export function buildDiagramOption(
     showSymbol: false,
     lineStyle: { color: pal.dim, type: 'dashed', opacity: 0.5 },
     silent: true,
-    z: 1
+    z: 1,
+    tooltip: { show: false }
   } as SeriesOption)
 
   // 扬声器(SPK 矩形标记)
   series.push({
     type: 'scatter',
+    name: 'SPK',
     data: [{ value: [0, z], name: 'SPK' }],
     symbol: 'rect',
     symbolSize: [26, 20],
     itemStyle: { color: pal.accent, borderColor: '#ffffff', borderWidth: 1 },
-    label: { show: true, formatter: 'SPK', color: '#fff', fontSize: 9, fontWeight: 'bold' },
+    label: { show: true, formatter: 'SPK', color: '#fff', fontSize: 10, fontWeight: 'bold' },
     z: 5
   } as SeriesOption)
 
@@ -204,7 +209,7 @@ export function buildDiagramOption(
         show: true,
         formatter: `${cov.toFixed(0)}°`,
         color: '#ffd54f',
-        fontSize: 11,
+        fontSize: 14,
         fontWeight: 700
       },
       silent: true,
@@ -223,25 +228,30 @@ export function buildDiagramOption(
     }
     series.push({
       type: 'line',
+      name: '安装倾斜角 A',
       data: aArcData,
       showSymbol: false,
-      lineStyle: { color: pal.dim, width: 1, opacity: 0.65 },
+      lineStyle: { color: pal.text, width: 1, opacity: 0.65 },
       silent: true,
-      z: 4
+      z: 4,
+      tooltip: { show: false }
     } as SeriesOption)
-    const aLblR = ar2 + 0.04 * maxD
+    const aLblR = ar2 + 0.02 * maxD
     series.push({
       type: 'scatter',
       data: [{ value: [Math.cos(aRad) * aLblR, z - Math.sin(aRad) * aLblR] }],
       symbolSize: 0,
       label: {
         show: true,
-        formatter: `A=${angle.toFixed(1)}°`,
-        color: pal.dim,
-        fontSize: 10
+        formatter: `A= ${angle.toFixed(1)}°`,
+        color: pal.text,
+        fontSize: 12,
+        padding: [0, 0],
+        borderRadius: 3,
+        borderWidth: 1
       },
       silent: true,
-      z: 4
+      z: 10
     } as SeriesOption)
   }