From 1657283209dc9fd3d89ecf73a3dac2b87b9fa497 Mon Sep 17 00:00:00 2001
From: letsgocoding <sdxt_0802@163.com>
Date: 星期六, 15 二月 2025 10:02:52 +0800
Subject: [PATCH] !81 !80 同比环比集成完毕接口 Merge pull request !81 from letsgocoding/develop1.0

---
 zhitan-vue/src/views/poweranalysis/pariPassu/index.vue |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/zhitan-vue/src/views/poweranalysis/pariPassu/index.vue b/zhitan-vue/src/views/poweranalysis/pariPassu/index.vue
index f132534..d6bcfd1 100644
--- a/zhitan-vue/src/views/poweranalysis/pariPassu/index.vue
+++ b/zhitan-vue/src/views/poweranalysis/pariPassu/index.vue
@@ -46,11 +46,11 @@
                 鐜瘮
               </el-button>
             </el-form-item> -->
-            <el-form-item>
+            <!-- <el-form-item>
               <el-button type="primary" icon="Download" @click="handleExport">
                 瀵煎嚭
               </el-button>
-            </el-form-item>
+            </el-form-item> -->
           </el-form>
         </div>
         <div style="
@@ -86,7 +86,7 @@
                   '(' +
                   queryParams.muid +
                   ')'
-                  " align="center" key="compareValue" prop="compareValue" :show-overflow-tooltip="true" />
+                  " align="center" key="contrastValues" prop="contrastValues" :show-overflow-tooltip="true" />
                 <el-table-column :label="(queryParams.analysisType == 'YOY' ? '鍚�' : '鐜�') + '姣�(%)'
                   " align="center" key="ratio" prop="ratio" :show-overflow-tooltip="true" width="200" />
               </el-table>
@@ -104,6 +104,7 @@
 import {
   listRegion,
   listDepartment,
+  querySameCompareList,
 } from "@/api/energyAnalysis/energyAnalysis";
 import { listEnergyTypeList } from "@/api/modelConfiguration/energyType";
 import * as echarts from "echarts";
@@ -126,6 +127,7 @@
     nodeId: null,
     timeType: null,
     dataTime: null,
+    timeCode: null,
     analysisType: "YOY",
     energyType: null,
   },
@@ -149,7 +151,14 @@
 }
 function handleTimeType(e) {
   queryParams.value.timeType = e;
-  queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD");
+  if(e=='MONTH'){
+    queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM");
+  }else if(e=='YEAR'){
+    queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY");
+  }else{
+    queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM-DD");
+  }
+  
 }
 function handleEnergyType(item) {
   queryParams.value.enername = item.enername;
@@ -160,7 +169,7 @@
   queryParams.value.analysisType = analysisType;
   getList();
 }
-// 鑳借�楀姣斿垎鏋�-绉戝鑳借�楀垎鏋�-鍒楄〃
+// 鑳借�楀姣斿垎鏋�-鍒楄〃
 function getList() {
   loading.value = true;
   // 鍦ㄥ垵濮嬪寲涔嬪墠锛屽厛dispose鏃х殑瀹炰緥
@@ -172,7 +181,7 @@
   // }
   const myChart1 = echarts.init(document.getElementById("Chart1"));
   // const myChart2 = echarts.init(document.getElementById("Chart2"));
-  listRegion(
+  querySameCompareList(
     proxy.addDateRange({
       ...queryParams.value,
       ...query.value,
@@ -184,23 +193,20 @@
       let yvalue = [];
       let ycompareValue = [];
       let yqoq = [];
-      if (!!res.data.chartDataList) {
-        res.data.chartDataList.map((item) => {
+      if (!!res.data) {
+        res.data.map((item) => {
           xdata.push(
             proxy
-              .dayjs(item.xdata)
+              .dayjs(item.currentTime)
               .format(
-                queryParams.value.timeType == "YEAR"
-                  ? "MM鏈�"
-                  : queryParams.value.timeType == "MONTH"
-                    ? "DD鏃�"
-                    : "HH鏃�"
+                queryParams.value.timeType == "YEAR"? "MM鏈�": queryParams.value.timeType =="MONTH"? "DD鏃�": "HH鏃�"
               )
           );
-          yvalue.push(!!item.yvalue ? item.yvalue : 0);
-          ycompareValue.push(!!item.ycompareValue ? item.ycompareValue : 0);
-          yqoq.push(!!item.yqoq ? item.yqoq : 0);
+          yvalue.push(!!item.currentValue ? item.currentValue : 0);
+          ycompareValue.push(!!item.contrastValues? item.contrastValues : 0);
+          yqoq.push(!!item.ratio ? item.ratio : 0);
         });
+       console.log(xdata)
       }
       setTimeout(() => {
         myChart1.setOption({
@@ -399,7 +405,7 @@
           ],
         });
       }, 100);
-      departmentList.value = !!res.data.dataList ? res.data.dataList : [];
+      departmentList.value = !!res.data ? res.data : [];
       window.addEventListener(
         "resize",
         () => {

--
Gitblit v1.9.3