Ver código fonte

更新分支

shilin 3 anos atrás
pai
commit
056bbccad4

+ 1 - 1
public/static/config/modeConfig.js

@@ -8,7 +8,7 @@ let baseURL = null;
 let websocketUrl = null;
 
 if (localTest) {
-    baseURL = "http://192.168.10.12:8082/" // 联机调试 - 石林
+    baseURL = "http://10.155.32.4:8082/" // 联机调试 - 石林
         // baseURL = "http://10.155.32.33:9001/" // 联机调试 - 谢生杰
 } else {
     baseURL = "http://10.155.32.4:8082/" // 正式环境

+ 99 - 51
src/views/NewPages/dj2.vue

@@ -8,41 +8,25 @@
               <div class="query-items">
                 <div class="query-item selections">
                   <button class="btn" type="button">风向走势图</button>
-                  <button class="btn" type="button">
+                 <!-- <button class="btn" type="button">
                     风资源玫瑰图
-                  </button>
+                  </button> -->
                 </div>
                 <div class="query-item">
-                  <div class="lable">场:</div>
+                  <div class="lable">场:</div>
                   <div class="search-input">
-                    <el-select
-                      v-model="value1"
-                      clearable
-                      placeholder="请选择风场"
-                      popper-class="select"
-                    >
-                      <el-option
-                        v-for="item in options"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                      >
-                      </el-option>
+                    <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select">
+                      <el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
                     </el-select>
                   </div>
                 </div>
-                <div class="query-item">
-                  <div class="lable">日期:</div>
-                  <div class="search-input">
-                    <el-date-picker
-                      v-model="value4"
-                      type="date"
-                      placeholder="选择日期"
-                      popper-class="date-select"
-                    >
-                    </el-date-picker>
-                  </div>
-                </div>
+              <div class="query-item">
+                        <div class="lable">日期:</div>
+                        <div class="search-input">
+                          <el-date-picker v-model="recorddate" type="date" value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
+                          </el-date-picker>
+                        </div>
+                      </div>
                 <div class="query-item selections">
                   <button class="btn active" type="button">搜索</button>
                 </div>
@@ -72,31 +56,95 @@ export default {
   },
   data() {
     return {
-      options: [
-        {
-          value: "选项1",
-          label: "黄金糕",
-        },
-        {
-          value: "选项2",
-          label: "双皮奶",
-        },
-        {
-          value: "选项3",
-          label: "蚵仔煎",
-        },
-        {
-          value: "选项4",
-          label: "龙须面",
-        },
-        {
-          value: "选项5",
-          label: "北京烤鸭",
-        },
-      ],
+      wpArray: [],
+      wtArray: [],
+      recorddate: new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
+      wpId: "",
+      wtId: "",
+      chartData: [{
+        title: "",
+        yAxisIndex: 0,
+        value: []
+      }],
+      chartUnit: ["(m/s)"]
     };
   },
-  created() {},
+
+    // 函数
+  methods: {
+    // 请求服务
+    requestData () {
+      let that = this;
+      that.API.requestData({
+        method: "GET",
+        subUrl: "powercompare/windfarmAjax",
+        success (res) {
+          that.wpArray = res.data;
+          that.wpId = res.data[0].id;
+
+        }
+      });
+    }, // 获取图表数据
+    getChartData () {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "winddirection/getWinddirection",
+        data: {
+          wtId: that.wpId
+        },
+        success (res) {
+
+          const keyArray = [{
+            key: "value1",
+            title: "风速"
+          }, {
+            key: "value2",
+            title: "实际拟合功率"
+          }, {
+            key: "value3",
+            title: "最优拟合功率"
+          }, {
+            key: "value4",
+            title: "保证功率"
+          }];
+
+          let chartData = [{
+            title: "风速",
+            yAxisIndex: 1,
+            value: []
+          }, {
+            title: "实际拟合功率",
+            yAxisIndex: 0,
+            value: []
+          }, {
+            title: "最优拟合功率",
+            yAxisIndex: 0,
+            value: []
+          }, {
+            title: "保证功率",
+            yAxisIndex: 0,
+            value: []
+          }];
+
+          keyArray.forEach((keyEle, keyIndex) => {
+            res.data.forEach(ele => {
+              chartData[keyIndex].value.push({
+                text: "",
+                value: ele[keyEle.key]
+              });
+            });
+          });
+
+          that.chartData = chartData;
+        }
+      });
+    },
+
+  },
+  created() {
+    this.requestData();
+  },
 };
 </script>
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 824 - 729
src/views/WindSite/components/gax6.vue