|
@@ -1,6 +1,7 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
import VChart from 'vue-echarts';
|
|
import VChart from 'vue-echarts';
|
|
|
|
+import dayjs from 'dayjs';
|
|
import { BarChart, LineChart, PieChart } from 'echarts/charts';
|
|
import { BarChart, LineChart, PieChart } from 'echarts/charts';
|
|
import { DatasetComponent, GridComponent, LegendComponent, TitleComponent, TooltipComponent } from 'echarts/components';
|
|
import { DatasetComponent, GridComponent, LegendComponent, TitleComponent, TooltipComponent } from 'echarts/components';
|
|
import { use } from 'echarts/core';
|
|
import { use } from 'echarts/core';
|
|
@@ -10,7 +11,8 @@ import SvgIcon from '@/components/SvgIcon.vue';
|
|
import { useRequest } from '@/hooks/request';
|
|
import { useRequest } from '@/hooks/request';
|
|
import { useViewVisible } from '@/hooks/view-visible';
|
|
import { useViewVisible } from '@/hooks/view-visible';
|
|
import { t } from '@/i18n';
|
|
import { t } from '@/i18n';
|
|
-import { getElectricityDataStatistics } from '@/api';
|
|
|
|
|
|
+import { downloadElectricityHisData, getElectricityDataStatistics } from '@/api';
|
|
|
|
+import { downloadBlob } from '@/utils';
|
|
import type { IconfontIcon } from '@/icons/fonts/iconfont';
|
|
import type { IconfontIcon } from '@/icons/fonts/iconfont';
|
|
|
|
|
|
import cumulativeElectricityBill from '@/assets/img/cumulative-electricity-bill.png';
|
|
import cumulativeElectricityBill from '@/assets/img/cumulative-electricity-bill.png';
|
|
@@ -402,8 +404,16 @@ const deviceAndGroups = computed<EquipmentData[]>(() => {
|
|
}));
|
|
}));
|
|
});
|
|
});
|
|
|
|
|
|
-const exportData = () => {
|
|
|
|
- return;
|
|
|
|
|
|
+const exportData = async () => {
|
|
|
|
+ const fileName = t('energyAnalysis.energyConsumptionAnalysis') + ' - ' + dayjs().format('YYYYMMDDHHmmss');
|
|
|
|
+ const file = await downloadElectricityHisData({
|
|
|
|
+ deviceGroupId: 7,
|
|
|
|
+ deviceTypes: [DeviceType.冷水主机, DeviceType.冷却塔, DeviceType.冷却泵, DeviceType.冷冻泵],
|
|
|
|
+ startTime: '2025-04-01 00:00:00',
|
|
|
|
+ endTime: '2025-05-01 23:00:00',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ downloadBlob(file, fileName);
|
|
};
|
|
};
|
|
|
|
|
|
const { handleRequest: handleDevElectricRequest } = useRequest();
|
|
const { handleRequest: handleDevElectricRequest } = useRequest();
|