update 综合驾驶舱

This commit is contained in:
DESKTOP-FUDKNA8\znjsz
2024-04-29 17:00:53 +08:00
parent bc3a68a9a7
commit 646eb9c270
10 changed files with 190 additions and 268 deletions

View File

@@ -0,0 +1,30 @@
<!--
filename: ElecCost.vue
author: liubin
date: 2024-04-29 16:37:01
description: 电能耗
-->
<template>
<div class="elec-cost">elec cost</div>
</template>
<script>
export default {
name: "ElecCost",
components: {},
props: {},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.elec-cost {
background: #cc03;
flex: 1;
}
</style>

View File

@@ -0,0 +1,30 @@
<!--
filename: NatGas.vue
author: liubin
date: 2024-04-29 16:36:27
description: 天然气能耗
-->
<template>
<div class="nat-gas">nat-gas</div>
</template>
<script>
export default {
name: "NatGas",
components: {},
props: {},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.nat-gas {
background: #31f2;
flex: 1;
}
</style>

View File

@@ -0,0 +1,30 @@
<!--
filename: StockMonitor.vue
author: liubin
date: 2024-04-29 16:35:40
description: 仓库监控·当前
-->
<template>
<div class="stock-monitor">仓库监控</div>
</template>
<script>
export default {
name: "StockMonitor",
components: {},
props: {},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.stock-monitor {
background: #fff2;
flex: 1;
}
</style>

View File

@@ -0,0 +1,30 @@
<!--
filename: WaterCost.vue
author: liubin
date: 2024-04-29 16:37:34
description: 水能耗
-->
<template>
<div class="water-cost">water cost</div>
</template>
<script>
export default {
name: "WaterCost",
components: {},
props: {},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.water-cost {
background: #f002;
flex: 1;
}
</style>

View File

@@ -2,24 +2,81 @@
filename: index.vue
author: liubin
date: 2024-04-16 14:40:15
description: 能源驾驶舱
description: 综合驾驶舱
-->
<template>
<div class="energy-copilot">能源驾驶舱</div>
<div class="energy-copilot">
<Container title="仓库监控·当前" icon="chip2">
<StockMonitorVue />
</Container>
<Container title="天然气能耗" icon="std">
<NatGasVue />
</Container>
<Container title="电能耗" icon="chip">
<ElecCostVue :period="period" />
</Container>
<Container title="水能耗" icon="cube">
<WaterCostVue :period="period" />
</Container>
</div>
</template>
<script>
import Container from "@/views/copilot/components/Container.vue";
import StockMonitorVue from "./components/StockMonitor.vue";
import ElecCostVue from "./components/ElecCost.vue";
import NatGasVue from "./components/NatGas.vue";
import WaterCostVue from "./components/WaterCost.vue";
export default {
name: "EnergyCopilot",
components: {},
props: {},
components: {
Container,
StockMonitorVue,
ElecCostVue,
NatGasVue,
WaterCostVue,
},
props: {
period: {
type: String,
default: "日",
},
},
data() {
return {};
},
computed: {},
methods: {},
watch: {
period: {
handler(val) {
val && this.fetchData(val);
},
immediate: true,
},
},
methods: {
fetchData(period = "日") {
console.log(`效率驾驶舱,获取${period}数据`);
this.$store.dispatch("copilot/initCopilot", {
period,
source: "comprehensive",
});
},
},
};
</script>
<style scoped></style>
<style scoped>
.energy-copilot {
flex: 1;
display: grid;
gap: 16px;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
}
.energy-copilot > div {
height: 100%;
}
</style>