fix:修改枚举 新风系统

This commit is contained in:
zhaohy
2024-08-22 09:15:50 +08:00
parent 13bda76928
commit 12990f86d2
6 changed files with 148 additions and 159 deletions

View File

@@ -26,10 +26,10 @@
<div style="margin-top: 4px"> {{ dataSource.type === '地暖' ? '设置' : '风量' }} </div>
<div style="margin-top: -5px">
<span style="font-size: 18px; color: #0dffff; font-style: italic">
{{ dataSource.type === '地暖' ? dataSource.setUpNumber : '18' }}
{{ dataSource.type === '地暖' ? dataSource.setUpNumber : dataSource.airVol }}
</span>
<span style="font-size: 10px; margin-left: 5px">{{
dataSource.type === '地暖' ? '℃' : 'm3/h'
dataSource.type === '地暖' ? '℃' : dataSource.airVolUnit
}}</span>
</div>
</div>
@@ -48,7 +48,7 @@
<span :style="{ fontSize: '18px', color: getColor(), fontStyle: 'italic' }">
{{ dataSource.number }}
</span>
<span style="font-size: 10px; margin-left: 5px"></span>
<span style="font-size: 10px; margin-left: 5px">{{ dataSource.numberUnit }}</span>
</div>
</div>
</div>
@@ -65,22 +65,22 @@
const props = defineProps({
dataSource: {
type: Object,
default: () => ({ title: '', number: 0 }), // 假设默认值还包括number属性
default: () => ({ title: '', converterTemp: 0 }), // 假设默认值还包括number属性
},
});
const getSunUrl = () => {
if (props.dataSource.number > 0 && props.dataSource.number < 20) {
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
return sunGreen;
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
return sunYellow;
} else {
return sunRed;
}
};
const getColor = () => {
if (props.dataSource.number > 0 && props.dataSource.number < 20) {
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
return '#0dffa4';
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
return '#f59a23';
} else {
return '#f36163';