|
@@ -19,6 +19,9 @@ import ResultPanel from './ResultPanel.vue'
|
|
|
import SPLChartPanel from './SPLChartPanel.vue'
|
|
import SPLChartPanel from './SPLChartPanel.vue'
|
|
|
import logo from '../../assets/logo.png'
|
|
import logo from '../../assets/logo.png'
|
|
|
import BaseModel from '../BaseModel.vue'
|
|
import BaseModel from '../BaseModel.vue'
|
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
|
+
|
|
|
|
|
+const { t } = useI18n()
|
|
|
|
|
|
|
|
const defaultParams: SpeakerParams = {
|
|
const defaultParams: SpeakerParams = {
|
|
|
splMax: 121,
|
|
splMax: 121,
|
|
@@ -46,7 +49,50 @@ const deviceState = reactive<DevicePanelState>({
|
|
|
hCov: params.hCov,
|
|
hCov: params.hCov,
|
|
|
vCov: params.vCov
|
|
vCov: params.vCov
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+const deviceFields: any[] = [
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'model',
|
|
|
|
|
+ symbol: '⌘',
|
|
|
|
|
+ labelKey: 'params.model',
|
|
|
|
|
+ show: '',
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'isExtension',
|
|
|
|
|
+ symbol: '🔊',
|
|
|
|
|
+ labelKey: 'params.hasSubwoofer',
|
|
|
|
|
+ show: '',
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'powerMode',
|
|
|
|
|
+ symbol: '⚡',
|
|
|
|
|
+ labelKey: 'params.powerMode',
|
|
|
|
|
+ show: '',
|
|
|
|
|
+ unit: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'splMax',
|
|
|
|
|
+ symbol: 'SPLₘₐₓ',
|
|
|
|
|
+ labelKey: 'params.splMax',
|
|
|
|
|
+ show: 'custom',
|
|
|
|
|
+ unit: 'dB SPL'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'hCov',
|
|
|
|
|
+ symbol: 'H',
|
|
|
|
|
+ labelKey: 'params.hCov',
|
|
|
|
|
+ show: 'custom',
|
|
|
|
|
+ unit: '°'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'vCov',
|
|
|
|
|
+ symbol: 'V',
|
|
|
|
|
+ labelKey: 'params.vCov',
|
|
|
|
|
+ show: 'custom',
|
|
|
|
|
+ unit: '°'
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
const patchDeviceState = (patch: Partial<DevicePanelState>): void => {
|
|
const patchDeviceState = (patch: Partial<DevicePanelState>): void => {
|
|
|
Object.assign(deviceState, patch)
|
|
Object.assign(deviceState, patch)
|
|
|
}
|
|
}
|
|
@@ -93,7 +139,15 @@ const reset = (): void => {
|
|
|
params.d3 = a > 0.05 && z > 0 ? Number((z / Math.tan(a * DEG)).toFixed(2)) : 0
|
|
params.d3 = a > 0.05 && z > 0 ? Number((z / Math.tan(a * DEG)).toFixed(2)) : 0
|
|
|
runCalc()
|
|
runCalc()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+const computeLabel = (item) => {
|
|
|
|
|
+ if (item.key == 'isExtension')
|
|
|
|
|
+ return deviceState[item.key] ? t('params.withSubwoofer') : t('params.withoutSubwoofer')
|
|
|
|
|
+ return `${t(item.labelKey)}: ${deviceState[item.key]} ${item.unit}`
|
|
|
|
|
+}
|
|
|
|
|
+const showLabel = (item) => {
|
|
|
|
|
+ if (deviceState.model == 'custom') return item.show == 'custom'
|
|
|
|
|
+ else return item.show != 'custom'
|
|
|
|
|
+}
|
|
|
runCalc()
|
|
runCalc()
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -119,6 +173,14 @@ runCalc()
|
|
|
</header>
|
|
</header>
|
|
|
|
|
|
|
|
<NCard :title="$t('params.tuner')" size="small" class="panel-card">
|
|
<NCard :title="$t('params.tuner')" size="small" class="panel-card">
|
|
|
|
|
+ <div class="device-info">
|
|
|
|
|
+ <template v-for="item in deviceFields" :key="item.key">
|
|
|
|
|
+ <div class="field-label" v-if="showLabel(item)">
|
|
|
|
|
+ <span class="sym">{{ item.symbol }}</span>
|
|
|
|
|
+ {{ computeLabel(item) }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
<ParamTuner
|
|
<ParamTuner
|
|
|
:params="params"
|
|
:params="params"
|
|
|
:linked="linked"
|
|
:linked="linked"
|
|
@@ -130,17 +192,21 @@ runCalc()
|
|
|
<!-- <ResultPanel :result="result" :assessment="assessment" /> -->
|
|
<!-- <ResultPanel :result="result" :assessment="assessment" /> -->
|
|
|
|
|
|
|
|
<NCard size="small" class="panel-card chart-card">
|
|
<NCard size="small" class="panel-card chart-card">
|
|
|
- <NTabs type="line" animated>
|
|
|
|
|
- <NTabPane name="diagram" :tab="$t('diagram.panel')">
|
|
|
|
|
- <DiagramPanel :params="params" :result="result" />
|
|
|
|
|
- </NTabPane>
|
|
|
|
|
- <NTabPane name="chart" :tab="$t('chart.panel')">
|
|
|
|
|
- <SPLChartPanel :params="params" :result="result" />
|
|
|
|
|
- </NTabPane>
|
|
|
|
|
- <NTabPane name="result" :tab="$t('result.panel')">
|
|
|
|
|
|
|
+ <div class="chart-result-wrap">
|
|
|
|
|
+ <div class="tabs-wrap">
|
|
|
|
|
+ <NTabs type="line" animated>
|
|
|
|
|
+ <NTabPane name="diagram" :tab="$t('diagram.panel')">
|
|
|
|
|
+ <DiagramPanel :params="params" :result="result" />
|
|
|
|
|
+ </NTabPane>
|
|
|
|
|
+ <NTabPane name="chart" :tab="$t('chart.panel')">
|
|
|
|
|
+ <SPLChartPanel :params="params" :result="result" />
|
|
|
|
|
+ </NTabPane>
|
|
|
|
|
+ </NTabs>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="result-wrap">
|
|
|
<ResultPanel :result="result" :assessment="assessment" />
|
|
<ResultPanel :result="result" :assessment="assessment" />
|
|
|
- </NTabPane>
|
|
|
|
|
- </NTabs>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</NCard>
|
|
</NCard>
|
|
|
|
|
|
|
|
<!-- 设备选型弹框 -->
|
|
<!-- 设备选型弹框 -->
|