فهرست منبع

表格报错BUG修复

Koishi 3 سال پیش
والد
کامیت
2ff19a9fc8
4فایلهای تغییر یافته به همراه895 افزوده شده و 658 حذف شده
  1. 1 1
      public/static/config/modeConfig.js
  2. 41 18
      src/components/chart/combination/bar-line-chart.vue
  3. 644 639
      src/router/index.js
  4. 209 0
      src/views/powerCurve/index.vue

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

@@ -1,5 +1,5 @@
 // 本地联调开关
-const localTest = 1;
+const localTest = 0;
 
 // 服务器地址
 let baseURL = null;

+ 41 - 18
src/components/chart/combination/bar-line-chart.vue

@@ -24,8 +24,25 @@ export default {
       type: Object,
       default: () => {
         return {
-          area: ["风场1", "风场2", "风场3", "风场4", "风场5", "风场6", "风场7", "风场8", "风场9"],
-          legend: ["实际电量", "计划检修损失", "非计划检修损失", "限电损失", "受累损失", "性能损失"],
+          area: [
+            "风场1",
+            "风场2",
+            "风场3",
+            "风场4",
+            "风场5",
+            "风场6",
+            "风场7",
+            "风场8",
+            "风场9",
+          ],
+          legend: [
+            "实际电量",
+            "计划检修损失",
+            "非计划检修损失",
+            "限电损失",
+            "受累损失",
+            "性能损失",
+          ],
           data: [
             [1320, 1302, 901, 634, 1390, 1330, 1320, 1000, 500],
             [320, 302, 301, 334, 390, 330, 320, 100, 50],
@@ -60,7 +77,14 @@ export default {
     // 颜色
     color: {
       type: Array,
-      default: () => ["#323E6F", "#1DA0D7", "#02BB4C", "#DB5520", "#EDB32F", "#EDEB2F"],
+      default: () => [
+        "#323E6F",
+        "#1DA0D7",
+        "#02BB4C",
+        "#DB5520",
+        "#EDB32F",
+        "#EDEB2F",
+      ],
     },
     // 每页显示个数
     pageSize: {
@@ -81,12 +105,9 @@ export default {
     },
     end() {
       var result = 20;
-      console.log("length:", this.areaData.length);
       if (this.areaData) {
         result = parseInt((this.pageSize / this.areaData.length) * 100);
       }
-
-      console.log("result", result);
       return result;
     },
   },
@@ -230,18 +251,20 @@ export default {
         series: [],
       };
       // bar data
-      for (var i = 0; i < this.bardata.legend.length; i++) {
-        option.series.push({
-          name: this.bardata.legend[i],
-          type: "bar",
-          stack: "总量",
-          barWidth: 16,
-          label: {
-            show: false,
-            position: "insideRight",
-          },
-          data: this.bardata.data[i],
-        });
+      if (this.bardata.legend && this.bardata.legend.length) {
+        for (var i = 0; i < this.bardata.legend.length; i++) {
+          option.series.push({
+            name: this.bardata.legend[i],
+            type: "bar",
+            stack: "总量",
+            barWidth: 16,
+            label: {
+              show: false,
+              position: "insideRight",
+            },
+            data: this.bardata.data[i],
+          });
+        }
       }
 
       // line data

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 644 - 639
src/router/index.js


+ 209 - 0
src/views/powerCurve/index.vue

@@ -0,0 +1,209 @@
+<template>
+  <div class="draught-fan-list">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">场站:</div>
+          <div class="search-input">
+            <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select" @change="(wpId) => { getWt(wpId, true); }">
+              <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-select v-model="wtId" clearable placeholder="请选择" popper-class="select">
+              <el-option v-for="item in wtArray" :key="item.id" :value="item.id" :label="item.name" />
+            </el-select>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions">
+        <button class="btn green" @click="search">搜索</button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  // 名称
+  name: "cutAnalyse",
+
+  // 使用组件
+  components: {},
+
+  // 数据
+  data () {
+    return {
+      isAsc: "asc",
+      wpArray: [],
+      wtArray: [],
+      wpId: "",
+      wtId: "",
+      chartData: [{
+        title: "",
+        yAxisIndex: 0,
+        value: []
+      }],
+      chartUnit: ["功率(MW)", "(m/s)"]
+    };
+  },
+
+  // 函数
+  methods: {
+    // 获取风场
+    getWp (reGetWp) {
+      let that = this;
+      that.API.requestData({
+        method: "GET",
+        subUrl: "powercompare/windfarmAjax",
+        success (res) {
+          that.wpArray = res.data;
+          that.wpId = res.data[0].id;
+          that.getWt(that.wpId, reGetWp);
+        }
+      });
+    },
+
+    // 获取风机
+    getWt (wpid, reGetWp) {
+      let that = this;
+      if (that.wpId) {
+        that.API.requestData({
+          method: "GET",
+          baseURL: "http://10.155.32.4:9001",
+          subUrl: "benchmarking/wtList",
+          data: {
+            wpid
+          },
+          success (res) {
+            that.wtArray = res.data;
+            that.wtId = res.data[0].id;
+            if (!reGetWp) {
+              that.getChartData();
+            }
+          }
+        });
+      }
+    },
+
+    // 获取图表数据
+    getChartData () {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "powersaturation/powersaturationamonutchart",
+        data: {
+          wtId: that.wtId
+        },
+        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;
+        }
+      });
+    },
+
+    search () {
+      if (!this.wpId || !this.wtId) {
+        this.BASE.showMsg({
+          msg: '场站与风机为必选项'
+        });
+      } else {
+        this.getTabData();
+      }
+    }
+  },
+
+  created () {
+    this.getWp();
+  },
+
+  mounted () { },
+
+  unmounted () { },
+};
+</script>
+
+<style lang="less" scoped>
+.draught-fan-list {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+
+  .btn-group-tabs {
+    display: flex;
+    flex-direction: row;
+
+    .photovoltaic {
+      margin-left: 1.481vh;
+    }
+  }
+
+  .df-table {
+    border: 0.093vh solid fade(@darkgray, 50%);
+    position: relative;
+    overflow: auto;
+    flex-grow: 1;
+    margin-top: 1.481vh;
+    height: 30vh;
+
+    &:before {
+      content: '';
+      width: 0.37vh;
+      height: 0.37vh;
+      background: @write;
+      position: absolute;
+      left: 0.278vh;
+      top: 0.278vh;
+    }
+
+    tbody {
+      height: calc(100vh - 166px);
+    }
+  }
+}
+</style>