瀏覽代碼

经济运行首页图表切换主题效果异常BUG修复、风机实时监视页面、健康总览页面、健康趋势页面、健康曲线页面清空搜索条件页面消失BUG修复

Koishi 3 年之前
父節點
當前提交
920d7407b7

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

@@ -16,7 +16,7 @@ const tilesMaxLevel = 18;
 const adapterUrl = "http://10.155.32.4:8011/";
 
 // 切换模块时是否提示当前模块名称(用于对内介绍项目时便捷显示模块名称)
-const showModuleName = 0;
+const showModuleName = 1;
 
 if (localTest) {
     // baseURL = "http://192.168.10.13:8082/" // 联机调试 - 石林

+ 5 - 1
src/components/chart/bar/multiple-bar-chart.vue

@@ -387,7 +387,11 @@ export default {
 
   watch: {
     "$store.state.themeName"() {
-      this.initChart();
+      let myChart = echarts.init(document.getElementById(this.id));
+      myChart.dispose();
+      setTimeout(() => {
+        this.initChart();
+      }, 300);
     },
   },
 };

+ 3 - 1
src/views/About.vue

@@ -355,7 +355,7 @@ export default {
           fontSize: util.vh(16),
           color: this.$store.state.themeName === "dark" ? "#fff" : "#000",
         },
-        //图例-每一条数据的名字叫销量
+        //图例-每一条数据的名字
         legend: {
           show: true,
           data: ["风速功率", "实际功率", "最优功率"],
@@ -450,7 +450,9 @@ export default {
         series,
       };
 
+      myChart.off("brushSelected");
       myChart.on("brushSelected", (params) => {
+        console.log(123123, params);
         const selected = params.batch[0]?.selected;
         let selectRes = [];
         selected?.forEach((pEle) => {

+ 57 - 16
src/views/HealthControl/Health10.vue

@@ -30,9 +30,13 @@
                 <tr>
                   <th rowspan="1" class="type1" style="width: 50px"></th>
                   <th rowspan="1" class="type1" style="width: 105px">健康度</th>
-                  <th rowspan="2" class="type1" style="width: 400px">MTBF(H/H)</th>
+                  <th rowspan="2" class="type1" style="width: 400px">
+                    MTBF(H/H)
+                  </th>
                   <th rowspan="1" class="type1" style="width: 180px"></th>
-                  <th rowspan="1" class="type1" style="width: 100px">MTTR(H)</th>
+                  <th rowspan="1" class="type1" style="width: 100px">
+                    MTTR(H)
+                  </th>
                 </tr>
               </thead>
             </table>
@@ -45,13 +49,22 @@
                         {{ item[1] }}
                       </td>
                       <td style="width: 105px">
-                        <div :style="'background-color: ' + item[0] + ';width:10px;height:10px;margin:0 auto;'"></div>
+                        <div
+                          :style="
+                            'background-color: ' +
+                            item[0] +
+                            ';width:10px;height:10px;margin:0 auto;'
+                          "
+                        ></div>
                       </td>
                       <td style="width: 400px">
                         <div class="percent-item">
                           {{ item[3] }}%
                           <div class="percent-bar" style="margin-right: 4px">
-                            <div class="percent-value" :style="'width:' + item[3] + '%'"></div>
+                            <div
+                              class="percent-value"
+                              :style="'width:' + item[3] + '%'"
+                            ></div>
                           </div>
                           <!-- 剩余9999/建个故障9999 -->
                           {{ item[4] }}
@@ -74,9 +87,17 @@
       <el-col :span="12">
         <div class="chart-title">
           <div class="title-panel" style="">
-            <span style="text-align: left; padding-left: 20px; font-size: 12px">故障信息 </span>
-            <span class="des-title">预计损失电量<span class="num">73824.0</span><span class="unit">Kwh</span></span>
-            <span class="des-title">预计检修时长<span class="num">29.33</span><span class="unit">H</span></span>
+            <span style="text-align: left; padding-left: 20px; font-size: 12px"
+              >故障信息
+            </span>
+            <span class="des-title"
+              >预计损失电量<span class="num">73824.0</span
+              ><span class="unit">Kwh</span></span
+            >
+            <span class="des-title"
+              >预计检修时长<span class="num">29.33</span
+              ><span class="unit">H</span></span
+            >
           </div>
           <!-- <img-line-chart
             height="270px"
@@ -87,13 +108,17 @@
     </el-row>
     <div class="fc-info mg-b-16">
       <panel :title="'曲线'" :showLine="false">
-        <zoom-line-chart height="28vh" :list="powerChartData.value" :units="powerChartData.units" />
+        <zoom-line-chart
+          height="28vh"
+          :list="powerChartData.value"
+          :units="powerChartData.units"
+        />
       </panel>
     </div>
     <HealthReport
       :show="healthReportShow"
       :params="reportparams"
-	  ref="eport"
+      ref="eport"
       @closed="
         (res) => {
           this.healthReportShow = false;
@@ -170,7 +195,7 @@ export default {
             click(e, row) {
               // that.recorddate = row.date;
               that.healthReportShow = true;
-			  that.$refs.eport.getReport(that.wtId,row.date);
+              that.$refs.eport.getReport(that.wtId, row.date);
             },
           },
         ],
@@ -242,7 +267,11 @@ export default {
             name: "故障名称",
             field: "v1",
             template: function (data) {
-              return "<div style='overflow: hidden;text-overflow:ellipsis;white-space: nowrap;'>" + data + "</div>";
+              return (
+                "<div style='overflow: hidden;text-overflow:ellipsis;white-space: nowrap;'>" +
+                data +
+                "</div>"
+              );
             },
           },
           {
@@ -329,8 +358,9 @@ export default {
       this.getWeather();
     },
     switchWt(data) {
-      this.$router.push(`/health/health10/${data.wpId}/${data.wtId}`);
-      this.init();
+      if (data.wpId && data.wtId) {
+        this.$router.replace(`/health/health10/${data.wpId}/${data.wtId}`);
+      }
     },
     // 获取等级评价
     getTop5() {
@@ -366,7 +396,9 @@ export default {
       for (let i = 0; i < day; i++) {
         tableData.push({
           index: i + 1,
-          date: new Date(new Date().getTime() - 3600 * 1000 * 24 * (i + 1)).formatDate("yyyy-MM-dd hh:mm:ss"),
+          date: new Date(
+            new Date().getTime() - 3600 * 1000 * 24 * (i + 1)
+          ).formatDate("yyyy-MM-dd hh:mm:ss"),
           wtId: this.wtId,
         });
       }
@@ -390,8 +422,12 @@ export default {
             const item = {
               index: index + 1,
               warnDesc: ele.warnDesc,
-              startTime: new Date(ele.startTime).formatDate("yyyy-MM-dd hh:mm:ss"),
-              stopTime: new Date(ele.stopTime).formatDate("yyyy-MM-dd hh:mm:ss"),
+              startTime: new Date(ele.startTime).formatDate(
+                "yyyy-MM-dd hh:mm:ss"
+              ),
+              stopTime: new Date(ele.stopTime).formatDate(
+                "yyyy-MM-dd hh:mm:ss"
+              ),
               stopHours: ele.stopHours,
             };
             if (index < 5) {
@@ -502,6 +538,11 @@ export default {
       }
     },
   },
+  watch: {
+    $route() {
+      this.init();
+    },
+  },
 };
 </script>
 

+ 6 - 1
src/views/HealthControl/Health4.vue

@@ -48,18 +48,22 @@ export default {
         {
           icon: "svg-q实时监视",
           path: "/health/health0",
+          text: "风机实时监视",
         },
         {
           icon: "svg-q健康",
           path: "/health/health10",
+          text: "风机健康总览",
         },
         {
           icon: "svg-q趋势",
           path: "/health/health4/healthLineChart2",
+          text: "风机健康趋势",
         },
         {
           icon: "svg-q曲线",
           path: "/health/health4/healthLineChart",
+          text: "风机健康曲线",
         },
       ],
     };
@@ -74,8 +78,9 @@ export default {
   },
 
   methods: {
-    clickMenu: function (index) {
+    clickMenu(index) {
       this.activeIndex = index;
+      this.$store.dispatch("changeModuleName", this.menuDatas[index].text);
     },
   },
 };

文件差異過大導致無法顯示
+ 619 - 529
src/views/HealthControl/HealthDay.vue


+ 46 - 31
src/views/HealthControl/healthLineChart.vue

@@ -1,19 +1,27 @@
 <template>
   <div class="pageBox">
     <wt-chooser @change="switchWt" :wpId="wpId" :wtId="wtId"></wt-chooser>
-    <simple-line-chart :height="'100px'" v-for="(item, index) in chartData" :key="index" :title="item.title" :data="item.data" :color="item.color" :lineTitle="item.lineTitle" />
+    <simple-line-chart
+      :height="'100px'"
+      v-for="(item, index) in chartData"
+      :key="index"
+      :title="item.title"
+      :data="item.data"
+      :color="item.color"
+      :lineTitle="item.lineTitle"
+    />
   </div>
 </template>
 
 <script>
 import SimpleLineChart from "../../components/chart/line/simple-line-chart.vue";
-import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue";
 export default {
   setup() {},
-  components: { SimpleLineChart ,WtChooser},
+  components: { SimpleLineChart, WtChooser },
   data() {
     return {
-      chartData:[]
+      chartData: [],
     };
   },
 
@@ -22,59 +30,66 @@ export default {
     this.wpId = this.$route.params.wpId;
     this.requestData();
   },
-  
-  methods:{
-    switchWt(data){
-      this.$router.push(`/health/health4/healthLineChart/${data.wpId}/${data.wtId}`);
-      this.wtId = this.$route.params.wtId;
-      this.wpId = this.$route.params.wpId;
-      this.requestData();
+
+  methods: {
+    switchWt(data) {
+      if (data.wpId && data.wtId) {
+        this.$router.push(
+          `/health/health4/healthLineChart/${data.wpId}/${data.wtId}`
+        );
+      }
     },
-    requestData(){
-      let that=this;
+    requestData() {
+      let that = this;
       that.API.requestData({
         method: "POST",
         subUrl: "healthsub/hsFjValueIndex",
-        data:{
-          wtId: that.wtId
+        data: {
+          wtId: that.wtId,
         },
         success(res) {
+          const color = ["green", "yellow", "purple", "blue", "orange"];
+          let chartData = [];
+          let lineTitle = [];
 
-          const color=["green","yellow","purple","blue","orange"];
-          let chartData=[];
-          let lineTitle=[];
-
-          res.data.xData.forEach(ele=>{
+          res.data.xData.forEach((ele) => {
             lineTitle.push(new Date(ele).formatDate("hh:mm"));
           });
 
-          res.data.datasets.forEach((ele,index)=>{
+          res.data.datasets.forEach((ele, index) => {
             chartData.push({
-              title:ele.name,
-              data:ele.data,
-              color:color[index],
-              lineTitle
+              title: ele.name,
+              data: ele.data,
+              color: color[index],
+              lineTitle,
             });
           });
-          that.chartData=chartData;
+          that.chartData = chartData;
         },
       });
-    }
-  }
+    },
+  },
+  watch: {
+    $route(res) {
+      this.wtId = res.params.wtId;
+      this.wpId = res.params.wpId;
+      this.requestData();
+    },
+  },
 };
 </script>
 
 <style lang="less" scoped>
 .pageBox {
   width: 100%;
-  height:calc(100% - 1.481vh * 2);
+  height: calc(100% - 1.481vh * 2);
   display: flex;
   flex-direction: column;
   justify-content: space-between;
 
-  .chart{
+  .chart {
     width: 100%;
-    height:25%;
+    height: 25%;
   }
 }
 </style>

+ 108 - 34
src/views/HealthControl/healthLineChart2.vue

@@ -19,7 +19,11 @@
       </div>
       <div class="info-chart">
         <panel class="info-chart-panel" :title="'健康趋势'">
-          <vertival-bar-line-chart :height="'310px'" :bardata="bardata" :lineData="lineData"/>
+          <vertival-bar-line-chart
+            :height="'310px'"
+            :bardata="bardata"
+            :lineData="lineData"
+          />
         </panel>
       </div>
     </div>
@@ -40,25 +44,39 @@ import NormalLineChart from "../../components/chart/line/normal-line-chart.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import Panel from "../../components/coms/panel/panel.vue";
 import Table from "../../components/coms/table/table.vue";
-import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue";
 export default {
   setup() {},
-  components: { SvgIcon, Panel, VertivalBarLineChart, NormalLineChart, Table, WtChooser },
+  components: {
+    SvgIcon,
+    Panel,
+    VertivalBarLineChart,
+    NormalLineChart,
+    Table,
+    WtChooser,
+  },
   data() {
     return {
       infoList: [
         // {title: '24小时健康趋势', svgid: 'svg-24-houre', active: false, type: 'houre'},
         { title: "7日健康趋势", svgid: "svg-h-day", active: true, type: "day" },
-        { title: "30日健康趋势", svgid: "svg-h-month", active: false, type: "month"},
+        {
+          title: "30日健康趋势",
+          svgid: "svg-h-month",
+          active: false,
+          type: "month",
+        },
       ],
       tableData: {
         column: [
-          { name: "部件名称",field: "name" },
-          { name: "MTBF(h)",field: "v1", is_num: true },
-          { name: "MTTR(h)",field: "v2", is_num: true },
-          { name: "损失电量(kw/h)",field: "v3",is_num: true },
-          { name: "当前状态",field: "v4",
-            template: function(data) {
+          { name: "部件名称", field: "name" },
+          { name: "MTBF(h)", field: "v1", is_num: true },
+          { name: "MTTR(h)", field: "v2", is_num: true },
+          { name: "损失电量(kw/h)", field: "v3", is_num: true },
+          {
+            name: "当前状态",
+            field: "v4",
+            template: function (data) {
               if (data == 1) return "<div class='dot green'></div>";
               else if (data == 2) return "<div class='dot purple'></div>";
               else if (data == 3) return "<div class='dot yellow'></div>";
@@ -72,25 +90,28 @@ export default {
       lineData: [],
       wtId: undefined,
       wpId: undefined,
-      hisValue: {},  //健康走势图
+      hisValue: {}, //健康走势图
     };
   },
   created() {
     this.init();
   },
-  methods:{
-    init(){
+  methods: {
+    init() {
       this.wtId = this.$route.params.wtId;
       this.wpId = this.$route.params.wpId;
       this.requestCoulometry(2);
       this.requestHisValue();
       this.requestMttrrand();
     },
-    switchWt(data){
-      this.$router.push(`/health/health4/healthLineChart2/${data.wpId}/${data.wtId}`);
-      this.init();
+    switchWt(data) {
+      if (data.wpId && data.wtId) {
+        this.$router.replace(
+          `/health/health4/healthLineChart2/${data.wpId}/${data.wtId}`
+        );
+      }
     },
-     // 未确认缺陷按钮下的健康趋势选项
+    // 未确认缺陷按钮下的健康趋势选项
     onClickInfo(item) {
       this.infoList.forEach((element) => {
         if (item.type == element.type) {
@@ -128,46 +149,99 @@ export default {
       });
     },
     //风机健康走势图
-    requestHisValue(){
+    requestHisValue() {
       let that = this;
       that.API.requestData({
         method: "POST",
         subUrl: "healthsub/findWtHisValueForBj",
         data: { wtId: that.wtId },
         success(res) {
-          if(res.code == 200){
+          if (res.code == 200) {
             let data = res.data;
-            data.time = data.time.slice(0, 65)
-            that.hisValue = data
+            data.time = data.time.slice(0, 65);
+            that.hisValue = data;
           }
         },
       });
     },
     //部件健康情况
-    requestMttrrand(){
+    requestMttrrand() {
       let that = this;
       that.API.requestData({
         method: "POST",
         subUrl: "healthsub/getWtMttrandMtbfByBj",
         data: { wtId: that.wtId },
         success(res) {
-          if(res.code == 200){
+          if (res.code == 200) {
             let data = res.data;
             that.tableData.data = [
-              {name:data.clx[1], v1:data.clx[4], v2:data.clx[5], v3:data.clx[6], v4:data.clx[0]},
-              {name:data.fdj[1], v1:data.fdj[4], v2:data.fdj[5], v3:data.fdj[6], v4:data.fdj[0]},
-              {name:data.bj[1], v1:data.bj[4], v2:data.bj[5], v3:data.bj[6], v4:data.bj[0]},
-              {name:data.zk[1], v1:data.zk[4], v2:data.zk[5], v3:data.zk[6], v4:data.zk[0]},
-              {name:data.zz[1], v1:data.zz[4], v2:data.zz[5], v3:data.zz[6], v4:data.zz[0]},
-              {name:data.ph[1], v1:data.ph[4], v2:data.ph[5], v3:data.ph[6], v4:data.ph[0]},
-              {name:data.jc[1], v1:data.jc[4], v2:data.jc[5], v3:data.jc[6], v4:data.jc[0]},
-              {name:data.bpq[1], v1:data.bpq[4], v2:data.bpq[5], v3:data.bpq[6], v4:data.bpq[0]},
-            ]
+              {
+                name: data.clx[1],
+                v1: data.clx[4],
+                v2: data.clx[5],
+                v3: data.clx[6],
+                v4: data.clx[0],
+              },
+              {
+                name: data.fdj[1],
+                v1: data.fdj[4],
+                v2: data.fdj[5],
+                v3: data.fdj[6],
+                v4: data.fdj[0],
+              },
+              {
+                name: data.bj[1],
+                v1: data.bj[4],
+                v2: data.bj[5],
+                v3: data.bj[6],
+                v4: data.bj[0],
+              },
+              {
+                name: data.zk[1],
+                v1: data.zk[4],
+                v2: data.zk[5],
+                v3: data.zk[6],
+                v4: data.zk[0],
+              },
+              {
+                name: data.zz[1],
+                v1: data.zz[4],
+                v2: data.zz[5],
+                v3: data.zz[6],
+                v4: data.zz[0],
+              },
+              {
+                name: data.ph[1],
+                v1: data.ph[4],
+                v2: data.ph[5],
+                v3: data.ph[6],
+                v4: data.ph[0],
+              },
+              {
+                name: data.jc[1],
+                v1: data.jc[4],
+                v2: data.jc[5],
+                v3: data.jc[6],
+                v4: data.jc[0],
+              },
+              {
+                name: data.bpq[1],
+                v1: data.bpq[4],
+                v2: data.bpq[5],
+                v3: data.bpq[6],
+                v4: data.bpq[0],
+              },
+            ];
           }
         },
       });
-    }
-  }
+    },
+  },
+  watch: {
+    $route() {
+      this.init();
+    },
+  },
 };
 </script>