瀏覽代碼

风资源分析模块完成

yangxiao 3 年之前
父節點
當前提交
0abdf9c1b1

+ 1 - 1
src/views/Home/components/map/MHS_FDC.vue

@@ -64,7 +64,7 @@
             </defs>
 
             <!-- 一期hover -->
-			<image
+			        <image
                 style="overflow: visible"
                 width="912"
                 height="399"

+ 0 - 1
src/views/windAnalysis/tab1.vue

@@ -27,7 +27,6 @@
 </template>
 
 <script>
-import Mlc from "@com/chart/line/multiple-line-chart.vue";
 import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
 export default {
   // 名称

+ 15 - 28
src/views/windAnalysis/tab2.vue

@@ -31,19 +31,19 @@
         <button class="btn green" @click="search">搜索</button>
       </div>
     </div>
-    <Mlc height="650px" :list="chartData" :units="chartUnit" :showLegend="true" />
+    <NormalScatterChart height="650px" :data="chartData" :showLegend="true" />
   </div>
 </template>
 
 <script>
-import Mlc from "@com/chart/line/multiple-line-chart.vue";
+import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
 export default {
   // 名称
   name: "cutAnalyse",
 
   // 使用组件
   components: {
-    Mlc
+    NormalScatterChart
   },
 
   // 数据
@@ -57,11 +57,9 @@ export default {
       wtId: "MG01_01",
       recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
       chartData: [{
-        title: "",
-        yAxisIndex: 0,
+        title: "风资源分析",
         value: []
-      }],
-      chartUnit: ["功率(万kw)"]
+      }]
     };
   },
 
@@ -103,33 +101,22 @@ export default {
       let that = this;
       that.API.requestData({
         method: "POST",
-        subUrl: "powersaturation/powersaturationamonutchart",
+        subUrl: "scatter/scatterAjax",
         data: {
-          wtId: that.wtId
+          wpId: that.wpId,
+          pjId: that.projectId,
+          lnId: "",
+          year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
+          month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
         },
         success (res) {
-
-          const keyArray = [{
-            key: "value1",
-            title: "功率"
-          }];
-
           let chartData = [{
-            title: "功率",
-            yAxisIndex: 0,
-            value: []
+            title: "风资源分析",
+            value: (res.data || [])
           }];
-
-          keyArray.forEach((keyEle, keyIndex) => {
-            res.data.forEach(ele => {
-              chartData[keyIndex].value.push({
-                text: "",
-                value: ele[keyEle.key]
-              });
-            });
+          that.$nextTick(()=>{
+            that.chartData = chartData;
           });
-
-          that.chartData = chartData;
         }
       });
     },

+ 15 - 28
src/views/windAnalysis/tab3.vue

@@ -31,19 +31,19 @@
         <button class="btn green" @click="search">搜索</button>
       </div>
     </div>
-    <Mlc height="650px" :list="chartData" :units="chartUnit" :showLegend="true" />
+    <NormalScatterChart height="650px" :data="chartData" :showLegend="true" />
   </div>
 </template>
 
 <script>
-import Mlc from "@com/chart/line/multiple-line-chart.vue";
+import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
 export default {
   // 名称
   name: "cutAnalyse",
 
   // 使用组件
   components: {
-    Mlc
+    NormalScatterChart
   },
 
   // 数据
@@ -57,11 +57,9 @@ export default {
       wtId: "MG01_01",
       recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
       chartData: [{
-        title: "",
-        yAxisIndex: 0,
+        title: "风资源分析",
         value: []
-      }],
-      chartUnit: ["功率(万kw)"]
+      }]
     };
   },
 
@@ -103,33 +101,22 @@ export default {
       let that = this;
       that.API.requestData({
         method: "POST",
-        subUrl: "powersaturation/powersaturationamonutchart",
+        subUrl: "scatter/scatterAjax",
         data: {
-          wtId: that.wtId
+          wpId: that.wpId,
+          pjId: "",
+          lnId: that.lineId,
+          year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
+          month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
         },
         success (res) {
-
-          const keyArray = [{
-            key: "value1",
-            title: "功率"
-          }];
-
           let chartData = [{
-            title: "功率",
-            yAxisIndex: 0,
-            value: []
+            title: "风资源分析",
+            value: (res.data || [])
           }];
-
-          keyArray.forEach((keyEle, keyIndex) => {
-            res.data.forEach(ele => {
-              chartData[keyIndex].value.push({
-                text: "",
-                value: ele[keyEle.key]
-              });
-            });
+          that.$nextTick(()=>{
+            that.chartData = chartData;
           });
-
-          that.chartData = chartData;
         }
       });
     },