Files
energy_storage/web/src/components/Home/Modal/OperationalInfo.vue

148 lines
2.9 KiB
Vue
Raw Normal View History

2025-09-01 16:58:54 +08:00
<template>
<div class="onLine">
<div class="content">
<div v-for="item in list" :key="item.key" :class="`item ${item.class}`">
<a-image :preview="false" :src="item.iconPath" :width="50" class="left"> </a-image>
<div class="right">
2025-09-03 15:41:12 +08:00
<span>{{ item.label }}</span>
<span>{{ item.value }} {{ item.d }}</span>
</div>
2025-09-01 16:58:54 +08:00
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
2025-09-03 15:41:12 +08:00
propsTotal: {
2025-09-01 16:58:54 +08:00
type: Object,
2025-09-03 15:41:12 +08:00
default: () => {}
},
propsInfo: {
type: Array,
default: () => []
},
2025-09-01 16:58:54 +08:00
},
data() {
return {
list: [
// {
// key: 'tianshu',
// value: 26,
// d: '℃',
// label: '舱内温度',
// class: 'item-1',
// iconPath: require('@/assets/home/wendu.png')
// },
// {
// key: 'shouyi',
// value: 25,
// d: '%',
// label: '舱内湿度',
// class: 'item-2',
// iconPath: require('@/assets/home/shidu.png')
// },
2025-09-01 16:58:54 +08:00
{
key: 'voltage',
2025-09-01 16:58:54 +08:00
value: 24,
d: 'V',
label: '电压',
class: 'item-3',
iconPath: require('@/assets/home/dianya.png')
},
{
key: 'current',
2025-09-01 16:58:54 +08:00
value: 26,
d: 'A',
label: '电流',
class: 'item-4',
iconPath: require('@/assets/home/dianliu.png')
},
{
key: 'power',
2025-09-01 16:58:54 +08:00
value: 20,
d: 'w',
label: '功率',
class: 'item-5',
iconPath: require('@/assets/home/gonglv.png')
},
{
key: 'powerFactor',
2025-09-01 16:58:54 +08:00
value: 100,
d: '',
label: '功率因数',
class: 'item-6',
iconPath: require('@/assets/home/gonglv.png')
}
]
}
},
computed: {
2025-09-01 16:58:54 +08:00
},
2025-09-03 15:41:12 +08:00
watch: {
propsTotal: {
2025-09-04 11:12:20 +08:00
handler(newVal, oldVal) {
if (newVal !== oldVal) {
2025-09-03 15:41:12 +08:00
this.list.forEach((item) => {
item.value = this.propsTotal[item.key]
})
}
},
2025-09-04 11:12:20 +08:00
2025-09-03 15:41:12 +08:00
}
},
2025-09-01 16:58:54 +08:00
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
2025-09-03 15:41:12 +08:00
width: 95%;
2025-09-01 16:58:54 +08:00
margin: auto;
}
2025-09-03 15:41:12 +08:00
.content {
2025-09-01 16:58:54 +08:00
flex-wrap: wrap;
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
height: 100%;
2025-09-03 15:41:12 +08:00
.item {
height: 50%;
width: 30%;
// height: 47px;
box-sizing: border-box;
display: flex;
align-items: center;
// justify-content: center;
// text-align: center;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d {
margin-left: 1px;
font-size: 12px;
}
2025-09-01 16:58:54 +08:00
}
.right {
2025-09-03 15:41:12 +08:00
display: flex;
flex-direction: column;
margin-left: 20px;
}
2025-09-01 16:58:54 +08:00
}
</style>