Browse Source

天气预测数据模块完成

Koishi 3 years ago
parent
commit
94d011d69b

+ 27 - 9
src/components/chart/line/normal-line-chart.vue

@@ -162,7 +162,10 @@ export default {
           //分格线
           splitLine: {
             lineStyle: {
-              color: this.$store.state.themeName === "dark" ? partten.getColor("gray") : "#000" + 55,
+              color:
+                this.$store.state.themeName === "dark"
+                  ? partten.getColor("gray")
+                  : "#000" + 55,
               type: "dashed",
             },
           },
@@ -204,10 +207,16 @@ export default {
         color: this.color,
         tooltip: {
           trigger: "axis",
-          backgroundColor: this.$store.state.themeName === "dark" ? "rgba(0,0,0,0.4)" : "rgba(255,255,255,0.5)",
-			borderColor: this.$store.state.themeName === "dark" ? partten.getColor("gray") : "#000",
-			textStyle: {
-			  color: this.$store.state.themeName === "dark" ? "#fff" : "#000",
+          backgroundColor:
+            this.$store.state.themeName === "dark"
+              ? "rgba(0,0,0,0.4)"
+              : "rgba(255,255,255,0.5)",
+          borderColor:
+            this.$store.state.themeName === "dark"
+              ? partten.getColor("gray")
+              : "#000",
+          textStyle: {
+            color: this.$store.state.themeName === "dark" ? "#fff" : "#000",
             fontSize: util.vh(16),
           },
         },
@@ -217,9 +226,15 @@ export default {
           right: 56,
           icon: "circle",
           itemWidth: 6,
-          inactiveColor: this.$store.state.themeName === "dark" ? partten.getColor("gray") : "#000",
+          inactiveColor:
+            this.$store.state.themeName === "dark"
+              ? partten.getColor("gray")
+              : "#000",
           textStyle: {
-            color: this.$store.state.themeName === "dark" ? partten.getColor("grayl") : "#000",
+            color:
+              this.$store.state.themeName === "dark"
+                ? partten.getColor("grayl")
+                : "#000",
             fontSize: 12,
           },
         },
@@ -237,7 +252,10 @@ export default {
               formatter: "{value}",
               fontSize: util.vh(14),
               textStyle: {
-                color: this.$store.state.themeName === "dark" ? partten.getColor("gray") : "#000",
+                color:
+                  this.$store.state.themeName === "dark"
+                    ? partten.getColor("gray")
+                    : "#000",
               },
             },
             data: this.xdata,
@@ -250,7 +268,7 @@ export default {
       chart.clear();
       chart.setOption(option);
 
-      this.resize = function() {
+      this.resize = function () {
         chart.resize();
       };
 

+ 9 - 4
src/router/index.js

@@ -375,9 +375,9 @@ const routes = [{
 	component: () =>
 		import( /* webpackChunkName: "xzdl" */ "../views/report/xzdl.vue"),
 },
-	/***********************************************************经济运行************************************************************* */
-	/***********************************************************智慧检修************************************************************* */
-	
+/***********************************************************经济运行************************************************************* */
+/***********************************************************智慧检修************************************************************* */
+
 {
 	path: "/health/sandtable",
 	name: "sandtable",
@@ -463,7 +463,7 @@ const routes = [{
 		name: "health10",
 		component: () =>
 			import( /* webpackChunkName: "health8" */ "../views/HealthControl/Health10.vue"),
-	}, 
+	},
 	{
 		path: "healthLineChart/:wpId/:wtId", // 健康趋势
 		component: () =>
@@ -988,6 +988,11 @@ const routes = [{
 	name: "powerforecast2",
 	component: () => import( /* webpackChunkName: "powerforecast2" */ "../views/NewPages/power-forecast-2.vue"),
 },
+{
+	path: "/weatherPrognosis",//天气预测数据
+	name: "weatherPrognosis",
+	component: () => import( /* webpackChunkName: "powerforecast2" */ "../views/weatherPrognosis/index.vue"),
+},
 ]
 const router = createRouter({
 	history: createWebHashHistory(),

+ 0 - 1
src/views/MalfunctionWarning/components/records.vue

@@ -249,7 +249,6 @@ export default {
         baseURL: "http://10.155.32.14:9090/",
         subUrl: "api/coordinate/history",
         success(res) {
-          console.log(111, res);
           if (res.length > 0) {
             res.forEach((item) => {
               let arr = item.name.split("-");

+ 8 - 2
src/views/MalfunctionWarning/components/testReport.vue

@@ -165,7 +165,10 @@ export default {
     BarChart,
   },
   props: {
-    faultid: "",
+    faultid: {
+      type: String,
+      default: "",
+    },
   },
   created() {},
   data() {
@@ -239,8 +242,9 @@ export default {
         success(res) {
           if (res) {
             let data = res.find((ele) => {
-              return ele.name === name;
+              return ele.name === name.split(".")[0];
             });
+            console.log(2222, name);
             if (data?.coordinate.indexOf("NaN") === -1) {
               data.coordinate = JSON.parse(data?.coordinate);
               data.coordinate.bar = JSON.parse(data?.coordinate.bar);
@@ -272,6 +276,8 @@ export default {
               that.endResult(accuracy, val_accuracy, loss, val_loss);
 
               that.jzxF(data?.coordinate.bar);
+
+              console.log(3333, data);
             }
           }
         },

+ 4 - 0
src/views/MalfunctionWarning/supervised.vue

@@ -308,6 +308,10 @@ export default {
               value: "CCWE-1500",
             },
             {
+              lable: "UP97",
+              value: "UP97",
+            },
+            {
               lable: "UP105-2000-S",
               value: "UP105-2000-S",
             },

+ 2 - 2
src/views/NewPages/alarm-center-1.vue

@@ -679,8 +679,8 @@ export default {
             root[f].children[k].value = root[f].children[k].label = k;
             root[f].fobj.children.push(root[f].children[k]);
           }
-        } // 不存在子节点
-        else {
+        } else {
+          // 不存在子节点
           root[f] = {};
           // root[f].value = fvalue;
           // root[f].label = f;

+ 5 - 0
src/views/layout/Menu.vue

@@ -1007,6 +1007,11 @@ export default {
                   icon: "svg-matrix",
                   path: "/totalCurve",
                 },
+                 {
+                  text: "天气预测数据",
+                  icon: "svg-matrix",
+                  path: "/weatherPrognosis",
+                },
                 {
                   text: "性能预警综合分析",
                   icon: "svg-matrix",

+ 5 - 5
src/views/sisView/index.vue

@@ -377,11 +377,11 @@ export default {
 
     &:first-child {
       margin: 0;
-	  .contentItem {
-		  .itemNum {
-			width: 157px !important;
-		  }
-	  }
+      .contentItem {
+        .itemNum {
+          width: 157px !important;
+        }
+      }
     }
 
     .viewTitle {

+ 234 - 0
src/views/weatherPrognosis/index.vue

@@ -0,0 +1,234 @@
+<template>
+  <div class="weatherPrognosisBox">
+    <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="changzhan"
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in changzhanArray"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">时间:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="date"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="截止日期"
+              value-format="YYYY-MM-DD hh:mm:ss"
+            />
+          </div>
+        </div>
+        <div class="query-actions" style="margin-left: 0px">
+          <button class="btn green" @click="getTableData">搜索</button>
+          <button
+            class="btn green"
+            :class="tableData.length ? 'show' : 'hidden'"
+            @click="showDetails"
+          >
+            风速曲线
+          </button>
+        </div>
+      </div>
+    </div>
+    <el-table
+      :data="tableData"
+      style="width: 100%; height: 95%; overflow-y: scroll"
+      height="250"
+      border
+    >
+      <el-table-column
+        type="index"
+        label="序号"
+        align="center"
+        width="50"
+      ></el-table-column>
+      <el-table-column
+        prop="time"
+        label="时间"
+        width="200px"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="speed"
+        label="风速(m/s)"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="temperature"
+        label="温度(℃)"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="direction"
+        label="风向(°)"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="humidity"
+        label="湿度(%)"
+        width="100px"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="pressure"
+        label="气压(Pa)"
+        align="center"
+      ></el-table-column>
+    </el-table>
+    <el-dialog
+      top="100px"
+      title="详情"
+      custom-class="modal"
+      v-model="showDialog"
+      width="80%"
+      @closed="
+        (res) => {
+          showDialog = false;
+          chartData = [{ title: '', yAxisIndex: 0, value: [] }];
+        }
+      "
+    >
+      <LineChart
+        width="100%"
+        height="600px"
+        :showLegend="true"
+        :units="['风速(m/s)', '时间']"
+        :list="chartData"
+        v-if="showDialog"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import LineChart from "@com/chart/line/normal-line-chart.vue";
+export default {
+  components: {
+    LineChart,
+  },
+  data() {
+    return {
+      changzhan: "",
+      changzhanArray: [],
+      date: [
+        new Date().formatDate("yyyy-MM-dd hh:mm:ss"),
+        new Date(new Date().getTime() + 24 * 60 * 60 * 1000 * 15).formatDate(
+          "yyyy-MM-dd hh:mm:ss"
+        ),
+      ],
+      tableData: [],
+      showDialog: false,
+      chartData: [
+        {
+          title: "",
+          yAxisIndex: 0,
+          value: [],
+        },
+      ],
+    };
+  },
+  created() {
+    this.getChangeZhan();
+  },
+  methods: {
+    // 获取场站列表
+    getChangeZhan() {
+      const that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:9001/",
+        subUrl: "benchmarking/wplist",
+        success(res) {
+          that.changzhanArray = res.data;
+          that.changzhan = res.data[0].id;
+          that.getTableData();
+        },
+      });
+    },
+    // 获取表格数据
+    getTableData() {
+      const that = this;
+      if (that.date?.length) {
+        that.API.requestData({
+          method: "GET",
+          baseURL: "http://192.168.1.18:9002/",
+          subUrl: "weather/forecast/list",
+          data: {
+            station: that.changzhan,
+            st: that.date[0],
+            et: that.date[1],
+          },
+          success(res) {
+            res.data.forEach((ele) => {
+              ele.speed = ele.speed.toFixed(2);
+              ele.temperature = ele.temperature.toFixed(2);
+              ele.direction = ele.direction.toFixed(2);
+              ele.humidity = ele.humidity.toFixed(2);
+              ele.pressure = ele.pressure.toFixed(2);
+            });
+            that.tableData = res.data;
+          },
+        });
+      } else {
+        that.BASE.showMsg({
+          msg: "日期不可为空",
+        });
+      }
+    },
+    showDetails() {
+      let fsArray = [];
+      this.tableData.forEach((ele) => {
+        fsArray.push({
+          text: ele.time,
+          value: ele.speed,
+        });
+      });
+
+      this.chartData = [
+        {
+          title: "风速(m/s)",
+          yAxisIndex: 0,
+          value: fsArray,
+        },
+      ];
+
+      this.showDialog = true;
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+.weatherPrognosisBox {
+  width: 100%;
+  height: 100%;
+
+  .btn.show {
+    transition: 0.2s;
+    overflow: hidden;
+  }
+
+  .btn.hidden {
+    width: 0;
+    padding: 0;
+    border: 0;
+    transition: 0.2s;
+    margin-left: 0;
+    overflow: hidden;
+  }
+}
+</style>