- {{ data.this ?? "-" }}
+ {{ data.current ?? "-" }}
- {{ labels[index * 2 + 1] }}
+ {{ labels[1] }}
{
>
{{
- data.change
- ? (data.change > 0 ? "+" : "") + data.change + "%"
+ data.difference
+ ? (data.difference > 0 ? "+" : "") + data.difference
: "-"
}}
diff --git a/src/views/headquarters/components/ElecRank.vue b/src/views/headquarters/components/ElecRank.vue
index 232de2a..4d19214 100644
--- a/src/views/headquarters/components/ElecRank.vue
+++ b/src/views/headquarters/components/ElecRank.vue
@@ -37,7 +37,7 @@ const getCurrentEnergyData = () => {
-
+
@@ -58,7 +58,7 @@ const getCurrentEnergyData = () => {
-
+
{
const barWidth = 15;
@@ -98,7 +100,7 @@ const generateCylinderChartOption = (data) => {
left: "0%",
right: "0%",
bottom: "3%",
- top: "10%",
+ top: "17%",
containLabel: true,
},
tooltip: {
@@ -113,7 +115,7 @@ const generateCylinderChartOption = (data) => {
const processEnergyData = () => {
if (!props.energyCostData || !props.energyCostData.trend) {
- chartData.value = [];
+ chartData.value = [];
weekComparisonOption.value = generateCylinderChartOption(chartData.value);
return;
}
@@ -123,8 +125,8 @@ const processEnergyData = () => {
);
chartData.value = dailyData.map((item) => ({
- date: dayjs(item.time).format("MM/DD"),
- energy: item.value,
+ date: dayjs(item.time).format("MM/DD"),
+ energy: item.value,
}));
weekComparisonOption.value = generateCylinderChartOption(chartData.value);
@@ -135,15 +137,35 @@ watch(
(newEnergyCostData) => {
processEnergyData();
},
- { deep: true, immediate: true }
+ { deep: true, immediate: true }
+);
+
+watch(
+ () => storeBuild.buildings,
+ (newValue) => {
+ if (newValue) {
+ buildingList.value = [
+ {
+ title: "All",
+ key: "all",
+ },
+ ...newValue.map((building) => ({
+ title: building.full_name,
+ key: building.building_guid,
+ })),
+ ];
+ }
+ },
+ {
+ immediate: true,
+ }
);
watch(
() => storeBuild.floorList,
(newValue) => {
if (newValue) {
- console.log('newValue',newValue);
-
+
floorList.value = [
{
title: "All",
@@ -157,25 +179,6 @@ watch(
immediate: true,
}
);
-
-watch(
- () => storeBuild.floorList,
- (newValue) => {
- if (newValue) {
- floorList.value = [
- {
- title: "All",
- key: "all",
- },
- ...storeBuild.floorList,
- ];
- }
- },
- {
- immediate: true,
- }
-);
-
watch(
() => storeBuild.deptList,
(newValue) => {
@@ -199,7 +202,20 @@ watch(
-
{{ $t("dashboard.last_30_days_energy_trend") }}
+
+ {{ $t("dashboard.last_30_days_energy_trend") }}
+
+
\ No newline at end of file
+
diff --git a/src/views/headquarters/components/SysProgress.vue b/src/views/headquarters/components/SysProgress.vue
index f66fa8b..31cfdbf 100644
--- a/src/views/headquarters/components/SysProgress.vue
+++ b/src/views/headquarters/components/SysProgress.vue
@@ -114,7 +114,7 @@ onUnmounted(() => {
}
.state-box {
- @apply h-[21rem] border border-light-info shadow-md shadow-blue-300 rounded-sm py-2 px-6 mb-5 text-white relative;
+ @apply h-[21rem] border border-light-info shadow-md shadow-blue-300 rounded-sm py-2 px-6 mb-2 text-white relative;
}
.state-box:after {