fix:对接新风系统 修改计划获取的枚举

This commit is contained in:
zhaohy
2024-08-22 13:26:00 +08:00
parent 069698930e
commit a57c3d5b6c
9 changed files with 158 additions and 47 deletions

View File

@@ -65,22 +65,22 @@
const props = defineProps({
dataSource: {
type: Object,
default: () => ({ title: '', converterTemp: 0 }), // 假设默认值还包括number属性
default: () => ({ title: '', number: 0 }), // 假设默认值还包括number属性
},
});
const getSunUrl = () => {
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
if (props.dataSource.number >= 0 && props.dataSource.number < 20) {
return sunGreen;
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
return sunYellow;
} else {
return sunRed;
}
};
const getColor = () => {
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
if (props.dataSource.number >= 0 && props.dataSource.number < 20) {
return '#0dffa4';
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
return '#f59a23';
} else {
return '#f36163';