Browse Source

消缺恢复

SunZehao 4 months ago
parent
commit
214e4be11e

+ 23 - 11
src/components/generatingCapacityComponent/table.vue

@@ -15,7 +15,7 @@
         viewBox="0 -120 1024 1024"
         version="1.1"
         style="cursor: pointer"
-        @click="handlefilesExport"
+        @click="handlefilesExport(tableId)"
         xmlns="http://www.w3.org/2000/svg"
         p-id="2706"
         width="35"
@@ -170,20 +170,32 @@ export default {
         if (typeof console !== "undefined") console.error(e);
       }
     },
-    handlefilesExport() {
+    handlefilesExport(id) {
         ElMessageBox.confirm("确认导出当前节点的所有数据?", "导出", {
             confirmButtonText: "确认",
             cancelButtonText: "取消",
             type: "warning",
           }).then(() => {
-            const a = document.createElement("a");
-            let childs = [];
-            const url = "/export/files?filename="
-            a.href =
-              process.env.VUE_APP_GENERAT_URL + url + this.tableFilePath;
-            a.download = "";
-            a.target = "_blank";
-            a.click();
+            if (id === "1") {
+                this.handleExport()
+            } else {
+                // const a = document.createElement("a");
+                // let childs = [];
+                // const url = "/export/files?filename="
+                // a.href =
+                //   process.env.VUE_APP_GENERAT_URL + url + this.tableFilePath;
+                // a.download = "";
+                // a.target = "_blank";
+                // a.click();
+                const a = document.createElement("a");
+                const url = "/data/option/download?ids="
+                a.href =
+                  // config.baseURL + url + childs.join(",");
+                  process.env.VUE_APP_GENERAT_URL + url + id;
+                a.download = "";
+                a.target = "_blank";
+                a.click();
+            }
           });
     },
   },
@@ -202,7 +214,7 @@ export default {
     display: flex;
 
     p {
-      width: 5%;
+      width: 7%;
       text-overflow: ellipsis;
       white-space: nowrap;
       overflow: hidden;

+ 2 - 2
src/views/generatingCapacity/dataAnalysis/agcAnalysis/index.vue

@@ -246,7 +246,7 @@ const createMark = (markInfo) => {
 const funSubmit = async (params) => {
   activeTab.value = "2";
   tableShowId.value = "";
-  tableName.value = "AGC曲线分析";
+  tableName.value = "AGC";
   tableLoading.value = true;
   const res = await httpRequest.get("/agc/deviate", {
     params: params,
@@ -473,7 +473,7 @@ const abnormalPoint = ref([]);
 const initPageData = () => {
   activeTab.value = "2";
   tableShowId.value = "";
-  tableName.value = "AGC曲线分析";
+  tableName.value = "AGC";
   tableLoading.value = true;
   const res = JSON.parse(JSON.stringify(jsonData.deviateData));
   // const res = agcJson

+ 12 - 5
src/views/generatingCapacity/dataAnalysis/angleAnalysis/index.vue

@@ -45,13 +45,14 @@
                 :column="tableColumn"
                 :theme="theme"
                 :height="tableHeight"
-                tableId="1"
+                :tableId="tableShowId"
                 :tableName="tableName"
                 :rowstyle="true"
               ></table-cop>
             </div>
             <div v-show="activeTab === '1'" :style="{ height: tableHeight }">
               <!-- :height="`calc( ${tableHeight})`" -->
+              <p :style="!theme ? 'color: #fff' : 'color: #000'" style="width: 100%;text-align: center">变桨角度偏差率:{{angleData*100}}%</p>
               <CurrentScatterChart
                 ref="chartRef"
                 width="100%"
@@ -156,7 +157,8 @@ const funExcelChange = async (obj) => {
   funSubmit({
     ids: obj.id,
   });
-  tableName.value = obj.name;
+  tableShowId.value = obj.id
+  tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
   getSpeedLine({
     ids: obj.id,
   });
@@ -194,8 +196,9 @@ const funRepeatMap = (arr, type) => {
 };
 
 const funGetTree = async () => {
-  const res = await httpRequest.get("/power/prepare/treepitch");
-  treeData.value = funRepeatMap(res.data, "prepare");
+//   const res = await httpRequest.get("/power/prepare/treepitch");
+  const res = await httpRequest.get("/power/process/tree");
+  treeData.value = funRepeatMap(res.data, "process");
   excelList.value = [];
   if (actTreeNode.value) {
     funCurrentChange({
@@ -275,6 +278,7 @@ const chartRef = ref(); //chart 的ref
 const seriesData = ref([]);
 const seriesAllData = ref([]);
 const dataSet = ref("");
+const angleData = ref("");
 const funChartSelect = async (batch) => {
   return false;
 };
@@ -287,6 +291,8 @@ const funSubmit = async (params) => {
     return false;
   }
 
+  angleData.value = res.data.angle
+
   let exTime = [];
   let yp1 = [],
     yp2 = [],
@@ -536,7 +542,8 @@ const initPageData = () => {
       },
     ];
 
-    tableName.value = obj.name;
+    tableShowId.value = obj.id
+    tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
 
     let xAsis = [];
     let series = [];

+ 36 - 37
src/views/generatingCapacity/dataAnalysis/combine/index.vue

@@ -16,7 +16,7 @@
             @refresh="funGetTree"
           >
           </tree-cop>
-          <div style="padding: 5px 0;border-radius: 5px;" :style="theme === false ? 'background: #181A1E' : 'background: #cdcdde'" >
+          <div style="padding: 5px 0;border-radius: 5px;" :style="!theme ? 'background: #181A1E' : 'background: #cdcdde'" >
             <tree-cop
                 :dropdownMenu="['export', 'delete', 'save']"
                 :data="processTreeData"
@@ -153,32 +153,28 @@
         </el-tab-pane>
         <el-tab-pane label="故障" name="problem">
           <el-table :data="faultData" row-key="id" :max-height="550">
-            <el-table-column property="deviceId" align="center" label="风机" />
+            <el-table-column property="wtid" align="center" label="风机" />
             <el-table-column
-              property="ts"
+              property="time"
               sortable
               :width="160"
               align="center"
               label="时间"
-            >
-              <template v-slot="scope">
-                {{ new Date(scope.row.ts).formatDate("yyyy-MM-dd hh:mm:ss") }}
-              </template>
-            </el-table-column>
+            />
             <el-table-column
-              property="characteristic"
+              property="tx"
               sortable
               align="center"
               label="特性"
             />
             <el-table-column
-              property="components"
+              property="bj"
               sortable
               align="center"
               label="部件"
             />
             <el-table-column
-              property="description"
+              property="alarmname"
               sortable
               align="center"
               label="描述"
@@ -187,32 +183,28 @@
         </el-tab-pane>
         <el-tab-pane label="预警" name="warning">
           <el-table :data="warnData" row-key="id" :max-height="550">
-            <el-table-column property="deviceId" align="center" label="风机" />
+            <el-table-column property="wtid" align="center" label="风机" />
             <el-table-column
-              property="ts"
+              property="time"
               sortable
               :width="160"
               align="center"
               label="时间"
-            >
-              <template v-slot="scope">
-                {{ new Date(scope.row.ts).formatDate("yyyy-MM-dd hh:mm:ss") }}
-              </template>
-            </el-table-column>
+            />
             <el-table-column
-              property="characteristic"
+              property="tx"
               sortable
               align="center"
               label="特性"
             />
             <el-table-column
-              property="components"
+              property="bj"
               sortable
               align="center"
               label="部件"
             />
             <el-table-column
-              property="description"
+              property="alarmname"
               sortable
               align="center"
               label="描述"
@@ -625,6 +617,7 @@ const chartRef = ref(); //chart 的ref
 const seriesData = ref([]);
 const isChartArea = ref(false); // 用来控制图表是否区域划分
 const dataSet = ref("");
+const allpowerFittingData = ref([])
 const funChartSelect = async (batch) => {
   const wDataArr = [];
   const yDataArr = [];
@@ -654,6 +647,14 @@ const funChartSelect = async (batch) => {
           only: dataRadom.value,
         },
       });
+      allpowerFittingData.value = []
+      wtRes.data.forEach(it =>{
+        let obj = {
+            wtId: it.wtId,
+            time: it.time
+        }
+        allpowerFittingData.value.push(obj)
+    })
       if (wtRes.code === 200) {
         let id = 1;
         const tempArr = []; //用于以风机id 聚合dataArr
@@ -835,25 +836,23 @@ const handleClick = (val) => {
 
 //故障数据
 const faultDataFn = async () => {
-  let params = {
-    only: dataRadom.value,
-    table: "alarmWt",
-  };
-  const faultRes = await httpRequest.get("/power/fitting/alarms", {
-    params: params,
-  });
-  faultData.value = faultRes.data;
+    let params = {
+        // only: dataRadom.value,
+        alarmList: allpowerFittingData.value,
+        table: "alarmWt",
+    };
+    const faultRes = await httpRequest.post("/power/fitting/alarms", params);
+    faultData.value = faultRes.data;
 };
 //预警数据
 const warnDataFn = async () => {
-  let params = {
-    only: dataRadom.value,
-    table: "alarmCt",
-  };
-  const warnRes = await httpRequest.get("/power/fitting/alarms", {
-    params: params,
-  });
-  warnData.value = warnRes.data;
+    let params = {
+        // only: dataRadom.value,
+        alarmList: allpowerFittingData.value,
+        table: "alarmCt",
+    };
+    const warnRes = await httpRequest.post("/power/fitting/alarms", params);
+    warnData.value = warnRes.data;
 };
 
 /**dialog 数据 */

+ 4 - 1
src/views/generatingCapacity/dataAnalysis/hotAnalysis/index.vue

@@ -138,7 +138,7 @@
                     :column="tableColumn"
                     :theme="theme"
                     :height="tableHeight"
-                    tableId="1"
+                    :tableId="tableShowId"
                     :tableName="tableName"
                     :tableFilePath="tableFilePath"
                   ></table-cop>
@@ -317,12 +317,14 @@ const tableDataGet = async () => {
 const excelCheckboxShow = ref(false);
 const excelCheckIds = ref([]);
 const excelList = ref([]);
+const tableShowId = ref("");
 const tableName = ref("");
 const tableFilePath = ref("");
 const funExcelChange = async (obj) => {
   //点击excel项时
   /**次代码供温度功率曲线分析使用 */
   excelCheckIds.value = [obj.id]; //当为单选展示风机图表时
+  tableShowId.value = obj.id
   let tableX = ["未满发样板机", "满发样板机", "未满发", "满发" ]
   tableX.forEach(it =>{
     if (obj.name.indexOf(it) !== -1) {
@@ -1183,6 +1185,7 @@ const initPageData = () => {
     currentNodeKey.value = actTreeNode.value?.id || "";
 
     excelCheckIds.value = [obj.id]; //当为单选展示风机图表时
+    tableShowId.value = obj.id
     let tableX = ["未满发样板机", "满发样板机", "未满发", "满发" ]
     tableX.forEach(it =>{
         if (obj.name.indexOf(it) !== -1) {

+ 2 - 1
src/views/generatingCapacity/dataAnalysis/lineAnalysis/index.vue

@@ -95,6 +95,7 @@
             :xAxis="barxAxis"
             :yAxis="baryAxis"
             :series="barSeries"
+            :colors="['#22a6b3', '#05bc4c', '#C531C7', '#4b55ae', '#fa8c16', '#1DA0D7','#DD5044']"
           >
           </bar-chart-cop>
         </div>
@@ -107,7 +108,7 @@
             ]" -->
           <bar-chart-cop
             height="600px"
-            :colors="['#05bb4c', '#C531C7', '#4b55ae', '#fa8c16', '#1DA0D7', '#DD5044', '#323E6F']"
+            :colors="['#22a6b3', '#05bc4c', '#C531C7', '#4b55ae', '#fa8c16', '#1DA0D7','#DD5044', '#be2edd', '#323E6F']"
             width="100%"
             :xAxis="barxAxis"
             :yAxis="baryAxis"

+ 158 - 43
src/views/generatingCapacity/dataAnalysis/rateAnalysis/index.vue

@@ -39,8 +39,9 @@
                 :column="tableColumn"
                 :theme="theme"
                 :height="tableHeight"
-                tableId="1"
-                tableName="对风偏差分析"
+                :tableId="tableShowId"
+                :tableName="tableName"
+                :tableFilePath="tableFilePath"
               ></table-cop>
             </div>
             <el-row v-if="activeTab === '1'" :style="{ height: tableHeight }">
@@ -223,7 +224,7 @@
       <div v-loading="exportLoading">
         <el-row
           ref="diaPanelRef"
-          style="height: 650px; overflow-y: auto; overflow-x: hidden"
+          style="height: 650px; overflow-y: auto; over-x: hidden"
         >
           <el-col
             :span="actCopList.length > 1 ? 12 : 24"
@@ -247,7 +248,6 @@
               :yAxis="item.yAxis"
               :dataset="item.dataset"
               :brush="item.isBrush"
-              :count="item.count || []"
               @getSelected="funChartSelect"
             ></component>
           </el-col>
@@ -288,10 +288,16 @@ const tableHeight = ref(window.innerHeight - 170 + "px");
 const activeTab = ref("1");
 const excelCheckIds = ref([]);
 const excelList = ref([]);
+const tableShowId = ref("");
+const tableName = ref("");
+const tableFilePath = ref("");
 const currentNodeKey = ref("");
 //点击excel项时
 const funExcelChange = async (obj) => {
   excelCheckIds.value = [obj.id]; //当为单选展示风机图表时
+  tableShowId.value = obj.id
+  tableName.value = obj.code ? obj.code : obj.name.substring(0, obj.name.indexOf('_'));
+  tableFilePath.value = obj.path;
   chartExcelList.value = excelList.value.map((o) => {
     return {
       ...o,
@@ -357,6 +363,8 @@ const funGetTree = async () => {
     });
     funExcelChange({
       id: actTreeNode.value.childs[0].id,
+      code: actTreeNode.value.childs[0].code,
+      path: actTreeNode.value.childs[0].path
     });
     currentNodeKey.value = actTreeNode.value?.id || "";
   }
@@ -456,7 +464,6 @@ const funSubmit = async () => {
     if (rosesRes.data.length) {
       chartData.value = [];
       for (const chart of rosesRes.data) {
-        // 风速风向玫瑰图左侧
         chartData.value.push({
           id: chartId,
           title: "",
@@ -464,24 +471,7 @@ const funSubmit = async () => {
           xAxis: {
             type: "category",
             boundaryGap: false,
-            data: [
-              "北",
-              "",
-              "东北",
-              "",
-              "东",
-              "",
-              "东南",
-              "",
-              "南",
-              "",
-              "西南",
-              "",
-              "西",
-              "",
-              "西北",
-              "",
-            ],
+            data: ["北", "东北", "东", "东南", "南", "西南", "西", "西北"],
             splitLine: {
               show: true,
             },
@@ -506,7 +496,6 @@ const funSubmit = async () => {
                 coordinateSystem: "polar",
                 name: "方位风速",
               },
-          count: chart.ys || [],
         });
         chartId++;
         chartData.value.push({
@@ -539,9 +528,9 @@ const funSubmit = async () => {
               show: true,
             },
           },
-          series: chart.roses.length
+          series: chart.count.length
             ? [
-                ...chart.roses.map((o, index) => {
+                ...chart.count.map((o, index) => {
                   return {
                     type: "bar",
                     data: o,
@@ -551,7 +540,6 @@ const funSubmit = async () => {
                     emphasis: {
                       focus: "series",
                     },
-                    coordinateSystem: "polar",
                   };
                 }),
                 {
@@ -568,7 +556,6 @@ const funSubmit = async () => {
                 },
               ]
             : [],
-          count: chart.count || [],
         });
         chartId++;
         scatterSeries.value[0].data = chart.frequency.data.length
@@ -900,7 +887,6 @@ const funDiaSubmit = async () => {
       if (res.data.length) {
         for (const chart of res.data) {
           if (actChartName.value === "chartCop1") {
-            // 弹窗展示内容
             actCopList.value.push({
               id: chartId,
               isBrush: false,
@@ -933,13 +919,25 @@ const funDiaSubmit = async () => {
                 },
               },
               isRadar: false,
-              series: {
-                type: "bar",
-                data: chart.roses,
-                coordinateSystem: "polar",
-                name: "方位风速",
-              },
-              count: chart.ys || [],
+              series:
+                // chart.roses.length ? chart.roses.map((o, index) => {
+                //     return {
+                //         type: 'bar',
+                //         data: o,
+                //         coordinateSystem: 'polar',
+                //         name: funText(index),
+                //         stack: 'a',
+                //         emphasis: {
+                //             focus: 'series'
+                //         }
+                //     }
+                // }) : []
+                {
+                  type: "bar",
+                  data: chart.roses,
+                  coordinateSystem: "polar",
+                  name: "方位风速",
+                },
             });
             chartId++;
           }
@@ -976,9 +974,9 @@ const funDiaSubmit = async () => {
                 },
               },
               isRadar: true,
-              series: chart.roses.length
+              series: chart.count.length
                 ? [
-                    ...chart.roses.map((o, index) => {
+                    ...chart.count.map((o, index) => {
                       return {
                         type: "bar",
                         data: o,
@@ -988,14 +986,16 @@ const funDiaSubmit = async () => {
                         emphasis: {
                           focus: "series",
                         },
-                        coordinateSystem: "polar",
                       };
                     }),
                     {
                       type: "radar",
+                      // coordinateSystem: 'polar',
                       tooltip: {
                         trigger: "item",
                       },
+                      // smooth: true,
+                      // areaStyle: {},
                       name: "对风",
                       data: [
                         {
@@ -1005,7 +1005,6 @@ const funDiaSubmit = async () => {
                     },
                   ]
                 : [],
-              count: chart.count || [],
             });
             chartId++;
           }
@@ -1030,9 +1029,9 @@ const funDiaSubmit = async () => {
                 {
                   name: "对风频次",
                   type: "line",
-                  symbol: "line", // 设定为实心点
-                  symbolSize: 0, // 设定实心点的大小
-                  smooth: true, // 这个是把线变成曲线
+                  symbol: "line", //设定为实心点
+                  symbolSize: 0, //设定实心点的大小
+                  smooth: true, //这个是把线变成曲线
                   data: chart.count,
                   yAxisIndex: 1,
                   large: true,
@@ -1176,9 +1175,14 @@ const initPageData = () => {
 
     const obj = {
       id: actTreeNode.value.childs[0].id,
+      code: actTreeNode.value.childs[0].code,
+      path: actTreeNode.value.childs[0].path
     };
 
     excelCheckIds.value = [obj.id]; //当为单选展示风机图表时
+    tableShowId.value = obj.id
+    tableName.value = obj.code;
+    tableFilePath.value = obj.path;
     chartExcelList.value = excelList.value.map((o) => {
       return {
         ...o,
@@ -1240,6 +1244,56 @@ const initPageData = () => {
               name: "方位风速",
             },
       });
+      false &&
+        console.log(1111111111, {
+          id: chartId,
+          title: "",
+          subtext: "风速风向玫瑰图",
+          xAxis: {
+            type: "category",
+            boundaryGap: false,
+            data: [
+              "北",
+              "",
+              "东北",
+              "",
+              "东",
+              "",
+              "东南",
+              "",
+              "南",
+              "",
+              "西南",
+              "",
+              "西",
+              "",
+              "西北",
+            ],
+            splitLine: {
+              show: true,
+            },
+          },
+          isRadar: false,
+          series: chart.roses.length
+            ? chart.roses.map((o, index) => {
+                return {
+                  type: "bar",
+                  data: o,
+                  coordinateSystem: "polar",
+                  name: funText(index),
+                  stack: "a",
+                  emphasis: {
+                    focus: "series",
+                  },
+                };
+              })
+            : {
+                type: "bar",
+                data: chart.roses,
+                coordinateSystem: "polar",
+                name: "方位风速",
+              },
+        });
       chartId++;
       chartData.value.push({
         id: chartId,
@@ -1302,6 +1356,67 @@ const initPageData = () => {
           : [],
         count: chart.count || [],
       });
+      false &&
+        console.log(2222222222, {
+          id: chartId,
+          title: "",
+          subtext: "风速风向频次玫瑰图",
+          isRadar: true,
+          xAxis: {
+            type: "category",
+            boundaryGap: false,
+            data: [
+              "北",
+              "",
+              "东北",
+              "",
+              "东",
+              "",
+              "东南",
+              "",
+              "南",
+              "",
+              "西南",
+              "",
+              "西",
+              "",
+              "西北",
+              "",
+            ],
+            splitLine: {
+              show: true,
+            },
+          },
+          series: chart.count.length
+            ? [
+                ...chart.count.map((o, index) => {
+                  return {
+                    type: "bar",
+                    data: o,
+                    coordinateSystem: "polar",
+                    name: funText(index),
+                    stack: "a",
+                    emphasis: {
+                      focus: "series",
+                    },
+                    coordinateSystem: "polar",
+                  };
+                }),
+                {
+                  type: "radar",
+                  tooltip: {
+                    trigger: "item",
+                  },
+                  name: "对风",
+                  data: [
+                    {
+                      value: chart.radar,
+                    },
+                  ],
+                },
+              ]
+            : [],
+        });
       chartId++;
       scatterSeries.value[0].data = chart.frequency.data.length
         ? chart.frequency.data.map((item) => {

+ 3 - 2
src/views/generatingCapacity/dataAnalysis/spaceAnalysis/index.vue

@@ -98,6 +98,7 @@
         <el-form-item label="" class="!mb-0">
           <el-select
             v-model="queryForm.checkIds"
+            style="width: 120px"
             clearable
             @clear="checkAll = false"
             collapse-tags
@@ -345,7 +346,7 @@ const funSubmit = async () => {
 /**lineChart */
 const linexAxis = reactive({
   type: "category",
-  name: "",
+  name: "",
   data: [],
   splitLine: {
     show: false,
@@ -475,7 +476,7 @@ const funChartSelect = async (batch) => {
 /**barChart */
 const barxAxis = reactive({
   type: "category",
-  name: "",
+  name: "",
   data: [],
   splitLine: {
     show: false,

+ 8 - 0
src/views/powerPrediction/component/power.json

@@ -1306,6 +1306,14 @@
                 ]
             },
             {
+                "name": "风向",
+                "xAxisData": null,
+                "data": [
+                    [null, 15, null, null, null, null, null, null],
+                    [null, null, null, 20, null, null, null, null]
+                ]
+            },
+            {
                 "name": "压强",
                 "xAxisData": null,
                 "data": [

+ 2 - 2
src/views/powerPrediction/homePageNoMap.vue

@@ -721,8 +721,8 @@
             },
         },
         mounted() {
-            this.initPageData();
-            // this.initPageFn()
+            // this.initPageData();
+            this.initPageFn()
         },
         beforeRouteLeave(to, from, next) {
             next();

+ 185 - 116
src/views/powerPrediction/powerPredictionPage.vue

@@ -581,66 +581,73 @@
                 }
 
                 {
-                    let radar = [];
-                    let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
-                    let serise = [{
-                            value: [],
-                            name: "实际风向",
-                        },
-                        {
-                            value: [],
-                            name: "预测风向",
-                        },
-                    ];
-                    jsonData.windRosetteChartData.dataFormatList[0].data.forEach(
-                        (item, index) => {
-                            if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                let obj = {
-                                    name: (index + 1) * 5,
-                                };
-                                radar.unshift(obj);
-                            }
+                    // let radar = [];
+                    // let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
+                    // let serise = [{
+                    //         value: [],
+                    //         name: "实际风向",
+                    //     },
+                    //     {
+                    //         value: [],
+                    //         name: "预测风向",
+                    //     },
+                    // ];
+                    // jsonData.windRosetteChartData.dataFormatList[0].data.forEach(
+                    //     (item, index) => {
+                    //         if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                    //             let obj = {
+                    //                 name: (index + 1) * 5,
+                    //             };
+                    //             radar.unshift(obj);
+                    //         }
+                    //     }
+                    // );
+                    // jsonData.windRosetteChartData.dataFormatList.forEach((itn) => {
+                    //     let ser1 = [];
+                    //     let ser2 = [];
+                    //     if (itn.name === "预测风速") {
+                    //         itn.data.forEach((it, index) => {
+                    //             if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                    //                 ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
+                    //             }
+                    //         });
+                    //         serise[1].value = ser1;
+                    //     } else {
+                    //         itn.data.forEach((it, index) => {
+                    //             if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                    //                 ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
+                    //             }
+                    //         });
+                    //         serise[0].value = ser2;
+                    //     }
+                    // });
+                    // radar.forEach((itb) => {
+                    //     if (itb.name === 360) {
+                    //         itb.name = "北";
+                    //     } else if (itb.name === 45) {
+                    //         itb.name = "东北";
+                    //     } else if (itb.name === 90) {
+                    //         itb.name = "东";
+                    //     } else if (itb.name === 135) {
+                    //         itb.name = "东南";
+                    //     } else if (itb.name === 180) {
+                    //         itb.name = "南";
+                    //     } else if (itb.name === 225) {
+                    //         itb.name = "西南";
+                    //     } else if (itb.name === 270) {
+                    //         itb.name = "西";
+                    //     } else if (itb.name === 315) {
+                    //         itb.name = "西北";
+                    //     }
+                    // });
+                    let serise = []
+                    jsonData.meteorologicalElementsData.dataFormatList.forEach(it => {
+                        if (it.name === '风向') {
+                            serise = it.data
                         }
-                    );
-                    jsonData.windRosetteChartData.dataFormatList.forEach((itn) => {
-                        let ser1 = [];
-                        let ser2 = [];
-                        if (itn.name === "预测风速") {
-                            itn.data.forEach((it, index) => {
-                                if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                    ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
-                                }
-                            });
-                            serise[1].value = ser1;
-                        } else {
-                            itn.data.forEach((it, index) => {
-                                if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                    ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
-                                }
-                            });
-                            serise[0].value = ser2;
-                        }
-                    });
-                    radar.forEach((itb) => {
-                        if (itb.name === 360) {
-                            itb.name = "北";
-                        } else if (itb.name === 45) {
-                            itb.name = "东北";
-                        } else if (itb.name === 90) {
-                            itb.name = "东";
-                        } else if (itb.name === 135) {
-                            itb.name = "东南";
-                        } else if (itb.name === 180) {
-                            itb.name = "南";
-                        } else if (itb.name === 225) {
-                            itb.name = "西南";
-                        } else if (itb.name === 270) {
-                            itb.name = "西";
-                        } else if (itb.name === 315) {
-                            itb.name = "西北";
-                        }
-                    });
-                    that.getRadar(radar, serise);
+
+                    })
+                    that.getRose(serise);
                 }
 
                 const gaugeData = [{
@@ -1335,64 +1342,71 @@
                 };
                 apiGetwindRosetteChart(params).then((datas) => {
                     if (datas && datas.data) {
-                        let radar = [];
-                        let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
-                        let serise = [{
-                                value: [],
-                                name: "实际风向",
-                            },
-                            {
-                                value: [],
-                                name: "预测风向",
-                            },
-                        ];
-                        datas.data.dataFormatList[0].data.forEach((item, index) => {
-                            if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                let obj = {
-                                    name: (index + 1) * 5,
-                                };
-                                radar.unshift(obj);
-                            }
-                        });
-                        datas.data.dataFormatList.forEach((itn) => {
-                            let ser1 = [];
-                            let ser2 = [];
-                            if (itn.name === "预测风速") {
-                                itn.data.forEach((it, index) => {
-                                    if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                        ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
-                                    }
-                                });
-                                serise[1].value = ser1;
-                            } else {
-                                itn.data.forEach((it, index) => {
-                                    if (radaxr.indexOf((index + 1) * 5) !== -1) {
-                                        ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
-                                    }
-                                });
-                                serise[0].value = ser2;
-                            }
-                        });
-                        radar.forEach((itb) => {
-                            if (itb.name === 360) {
-                                itb.name = "北";
-                            } else if (itb.name === 45) {
-                                itb.name = "东北";
-                            } else if (itb.name === 90) {
-                                itb.name = "东";
-                            } else if (itb.name === 135) {
-                                itb.name = "东南";
-                            } else if (itb.name === 180) {
-                                itb.name = "南";
-                            } else if (itb.name === 225) {
-                                itb.name = "西南";
-                            } else if (itb.name === 270) {
-                                itb.name = "西";
-                            } else if (itb.name === 315) {
-                                itb.name = "西北";
+                        // let radar = [];
+                        // let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
+                        // let serise = [{
+                        //         value: [],
+                        //         name: "实际风向",
+                        //     },
+                        //     {
+                        //         value: [],
+                        //         name: "预测风向",
+                        //     },
+                        // ];
+                        // datas.data.dataFormatList[0].data.forEach((item, index) => {
+                        //     if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                        //         let obj = {
+                        //             name: (index + 1) * 5,
+                        //         };
+                        //         radar.unshift(obj);
+                        //     }
+                        // });
+                        // datas.data.dataFormatList.forEach((itn) => {
+                        //     let ser1 = [];
+                        //     let ser2 = [];
+                        //     if (itn.name === "预测风速") {
+                        //         itn.data.forEach((it, index) => {
+                        //             if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                        //                 ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
+                        //             }
+                        //         });
+                        //         serise[1].value = ser1;
+                        //     } else {
+                        //         itn.data.forEach((it, index) => {
+                        //             if (radaxr.indexOf((index + 1) * 5) !== -1) {
+                        //                 ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
+                        //             }
+                        //         });
+                        //         serise[0].value = ser2;
+                        //     }
+                        // });
+                        // radar.forEach((itb) => {
+                        //     if (itb.name === 360) {
+                        //         itb.name = "北";
+                        //     } else if (itb.name === 45) {
+                        //         itb.name = "东北";
+                        //     } else if (itb.name === 90) {
+                        //         itb.name = "东";
+                        //     } else if (itb.name === 135) {
+                        //         itb.name = "东南";
+                        //     } else if (itb.name === 180) {
+                        //         itb.name = "南";
+                        //     } else if (itb.name === 225) {
+                        //         itb.name = "西南";
+                        //     } else if (itb.name === 270) {
+                        //         itb.name = "西";
+                        //     } else if (itb.name === 315) {
+                        //         itb.name = "西北";
+                        //     }
+                        // });
+                        let serise = []
+                        datas.data.dataFormatList.forEach(it => {
+                            if (it.name === '风向') {
+                                serise = it.data
                             }
-                        });
-                        this.getRadar(radar, serise);
+
+                        })
+                        this.getRose(serise);
                     }
                 });
             },
@@ -1439,6 +1453,61 @@
                     myChart.resize();
                 });
             },
+            getRose(serise) {
+                let option = {
+                    backgroundColor: '',
+                    polar: {
+                        radius: [10, '80%']
+                    },
+                    radiusAxis: {
+                        max: 25,
+                        startAngle: 75
+                    },
+                    angleAxis: {
+                        type: 'category',
+                        data: ["北", "东北", "东", "东南", "南", "西南", "西", "西北"],
+                        boundaryGap: false,
+                        axisLabel: {
+                            show: true,
+                            interval: 0,
+                            formatter: '{value}',
+                            align: 'center',
+                            margin: 10
+                        },
+                        axisTick: {
+                            show: true,
+                            alignWithLabel: true
+                        }
+                    },
+                    tooltip: {},
+                    series: [{
+                            name: '实际',
+                            type: 'bar',
+                            data: serise[1],
+                            coordinateSystem: 'polar',
+                            barWidth: 15
+                        },
+                        {
+                            name: '预测',
+                            type: 'bar',
+                            data: serise[0],
+                            coordinateSystem: 'polar',
+                            barWidth: 15
+                        }
+                    ],
+                    animation: false
+                };
+                // 基于准备好的dom,初始化echarts实例
+                let dom = document.getElementById("radarChart");
+                dom.removeAttribute("_echarts_instance_") ?
+                    dom.removeAttribute("_echarts_instance_") :
+                    "";
+                let myChart = this.$echarts.init(dom, this.echartsTheme);
+                myChart.setOption(option);
+                window.addEventListener("resize", function () {
+                    myChart.resize();
+                });
+            },
         },
     };
 </script>

+ 2 - 2
src/views/powerPrediction/statisticalSummaryPage.vue

@@ -99,8 +99,8 @@
             },
         },
         created() {
-            this.initPageData();
-            // this.getStationData();
+            // this.initPageData();
+            this.getStationData();
             (this.pieColor = [{
                     value: "",
                     name: "一月",