Kaynağa Gözat

健康报告弹窗功能修改

yangxiao 3 yıl önce
ebeveyn
işleme
e8e93bef4c

+ 1 - 1
src/components/chart/combination/vertival-bar-line-chart.vue

@@ -53,7 +53,7 @@ export default {
     return {
       id: "",
       chart: null,
-      color: ["#323E6F", "#DB5520", "#1DA0D7", "#02BB4C", "#EDB32F", "#EDEB2F"],
+      color: ["#05bb4c", "#4b55ae", "#e17e23", "#02BB4C", "#EDB32F", "#EDEB2F"],
       // color: ["#323E6F", "#1DA0D7", "#02BB4C", "#DB5520", "#EDB32F", "#EDEB2F"],
     };
   },

+ 11 - 6
src/components/other/healthReport/index.vue

@@ -195,7 +195,6 @@
 </template>
 
 <script>
-import NormalLineChart from "@com/chart/line/normal-line-chart.vue";
 import DoubleLineChart from "@com/chart/line/double-line-chart.vue";
 import Get_PDF from "@tools/htmlToPdf";
 
@@ -350,6 +349,8 @@ export default {
           address: "上海市普陀区金沙江路 1516 弄",
         },
       ],
+
+      reqData:{},
     };
   },
 
@@ -358,10 +359,13 @@ export default {
       type: Boolean,
       default: false,
     },
+    params:{
+      type: Boolean,
+      default: () => {},
+    }
   },
 
   components: {
-    NormalLineChart,
     DoubleLineChart
   },
 
@@ -395,13 +399,11 @@ export default {
     // 获取报告详情
     getReport () {
       let that = this;
+      let reqData = this.params;
       that.API.requestData({
         method: "POST",
         subUrl: "reportnew/healthReport",
-        data: {
-          wtId: "QG01_11",
-          recorddate: "2021-06-19"
-        },
+        data: reqData,
         success (res) {
 
           let fdj = [{
@@ -525,6 +527,9 @@ export default {
         this.getReport();
       }
     },
+    params(res){
+      this.reqData = res;
+    }
   },
 };
 </script>

+ 1 - 1
src/router/index.js

@@ -119,7 +119,7 @@ const routes = [
     component: () => import('../views/HealthControl/Health2.vue'),
   },
   {
-    path: '/health/health3',
+    path: '/health/health3/:wpId',
     name: 'health3',
     component: () => import('../views/HealthControl/Health3.vue'),
   },

+ 1 - 1
src/views/About.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="about">
     <h1 @click="showDialog">This is an about page</h1>
-    <HealthReport :show="show" @closed="(res) => { this.show=false; }" />
+    <HealthReport :show="show" :params="{ wtId: 'QG01_11', recorddate: '2021-06-19' }" @closed="(res) => { this.show=false; }" />
     <!-- <list-bar-chart /> -->
   </div>
 </template>

+ 10 - 3
src/views/HealthControl/Health2.vue

@@ -27,7 +27,7 @@
     </div>
     <div class="fc-info mg-b-16">
       <div class="fc-item" v-for="(item, index) in wpmap" :key="index">
-        <div class="title">{{item.name}}</div>
+        <div class="title" @click="jumpUrl(item.wpId)">{{item.name}}</div>
         <div class="tags">
           <div class="tag">
             <i class="svg-icon svg-icon-gray-l svg-icon-lg">
@@ -79,7 +79,7 @@
               <dashboard :value="item.csl" :max="item.jrts" :height="'150px'" :width="'150px'" />
             </div>
             <div class="device-list" v-show="item.showType === '2'">
-              <div class="item red" v-for="(gzItem, gzIndex) in item.gzId" :key="gzIndex">{{gzItem.name}}</div>
+              <div class="item orange" v-for="(gzItem, gzIndex) in item.gzId" :key="gzIndex">{{gzItem.name}}</div>
             </div>
           </div>
         </div>
@@ -218,7 +218,14 @@ export default {
     changeDate(type){
       this.type = type;
       this.requestData();
-    }
+    },
+
+    // 页面跳转
+    jumpUrl(wpId){
+      this.$router.push({
+        path:`/health/health3/${wpId}`
+      });
+    },
   }
 };
 </script>

+ 42 - 19
src/views/HealthControl/Health3.vue

@@ -2,28 +2,22 @@
   <div class="health-3">
     <div class="power-info mg-b-8">
       <div class="info-tab">
-        <div class="tab active">
-          <i class="svg-icon svg-icon svg-icon-sm">
-            <svg-icon :svgid="'svg-24-houre'" />
-          </i>
-          <span> 24小时健康趋势 </span>
-        </div>
-        <div class="tab">
+        <div class="tab" :class="type === '2' ? 'active' : ''" @click="changeDate('2')">
           <i class="svg-icon svg-icon svg-icon-sm">
             <svg-icon :svgid="'svg-h-day'" />
           </i>
           <span> 7日健康趋势 </span>
         </div>
-        <div class="tab">
+        <div class="tab" :class="type === '3' ? 'active' : ''" @click="changeDate('3')">
           <i class="svg-icon svg-icon svg-icon-sm">
             <svg-icon :svgid="'svg-h-month'" />
           </i>
           <span>30日健康趋势</span>
         </div>
         <div class="empty"></div>
-        <div class="tab">
+        <!-- <div class="tab">
           <span>全部风场健康趋势</span>
-        </div>
+        </div> -->
       </div>
       <div class="info-chart">
         <panel class="info-chart-panel" :title="'损失电量分析'">
@@ -121,14 +115,13 @@ import Panel from "../../components/coms/panel/panel.vue";
 import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
 import Table from "../../components/coms/table/table.vue";
 export default {
-  setup() {},
+  setup () { },
   components: { SvgIcon, Panel, VertivalBarLineChart, Table, ListBarChart, ThermometerVChart, NormalPieChart, ToolbarPanel, Dashboard2 },
-  data() {
+  data () {
     return {
-      listBarData1: [
-        { name: "未来 {c1|15分钟} 预测电量", value: 123.62 },
-        { name: "未来 {c1|4小时} 预测电量", value: 123.62 },
-      ],
+      sourceMap: {},
+      type: "2",
+      listBarData1: [],
       listBarData1Color: ["purple", "purple"],
       tableData: {
         column: [
@@ -197,12 +190,42 @@ export default {
       },
     };
   },
-  created() {
+  created () {
+    this.wpId = this.$route.params.wpId;
     for (let i = 1; i < 50; i++) {
       this.tableData.data.push(JSON.parse(JSON.stringify(this.tableData.data[0])));
       this.tableData.data[i].index = i + 1;
     }
+    this.$nextTick(()=>{
+      this.getWpMap();
+    });
   },
+
+  methods: {
+    getWpMap () {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "healthmain/findWpMap",
+        data: {
+          wpId: that.wpId
+        },
+        success (res) {
+          console.log(111, res);
+          that.listBarData1= [
+            { name: "未来 {c1|15分钟} 预测电量", value: res.data.ycdl15minute },
+            { name: "未来 {c1|4小时} 预测电量", value: res.data.ycdl1hour },
+          ];
+          that.sourceMap = res.data;
+        }
+      });
+    },
+
+    changeDate(type){
+      this.type = type;
+      this.requestData();
+    },
+  }
 };
 </script>
 
@@ -262,7 +285,7 @@ export default {
           border-left: 9px solid transparent;
           border-right: 9px solid transparent;
           display: block;
-          content: "";
+          content: '';
           z-index: 10;
           transform: rotate(90deg);
         }
@@ -279,7 +302,7 @@ export default {
           border-left: 9px solid transparent;
           border-right: 9px solid transparent;
           display: block;
-          content: "";
+          content: '';
           z-index: 12;
           transform: rotate(90deg);
         }

+ 0 - 1
src/views/WindSite/pages/Info/Info.vue

@@ -216,7 +216,6 @@ export default {
   created() {
     let that = this;
     that.wpId = that.$route.params.wpId;
-    that.wtId = that.$route.params.wtId || '';
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {

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

@@ -116,11 +116,11 @@ export default {
               icon: "svg-wind-site",
               path: "/health/health2",
             },
-            {
-              text: "健康管理3",
-              icon: "svg-wind-site",
-              path: "/health/health3",
-            },
+            // {
+            //   text: "健康管理3",
+            //   icon: "svg-wind-site",
+            //   path: "/health/health3",
+            // },
             {
               text: "健康管理4",
               icon: "svg-wind-site",