Jelajahi Sumber

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

Koishi 4 tahun lalu
induk
melakukan
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

@@ -1,546 +1,636 @@
 <template>
-	<div class="decision-page-2">
-		<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="value2" @change="MoKuaiChange(value2)" multiple placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in MoKuai" :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-select v-model="value1" @change="ChangZhanChange(value1)" multiple placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in ChangZhan" :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="value4" @change="BeginChange(value4)" type="date"
-							value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
-						</el-date-picker>
-					</div>
-				</div>
-			</div>
-			<div class="query-actions">
-				<button class="btn" @click="dbfx">对比</button>
-			</div>
-		</div>
+  <div class="decision-page-2">
+    <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="value2"
+              @change="MoKuaiChange(value2)"
+              multiple
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in MoKuai"
+                :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-select
+              v-model="value1"
+              @change="ChangZhanChange(value1)"
+              multiple
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in ChangZhan"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
 
-		<div class="mg-b-16">
-			<div class="project-table">
-				<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
-			</div>
-		</div>
-		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-			:close-on-click-modal="false">
-			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-				:analyisDialog="analyisDialog" />
-		</el-dialog>
-	</div>
+        <div class="query-item">
+          <div class="lable">日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="value4"
+              @change="BeginChange(value4)"
+              type="date"
+              value-format="YYYY-MM-DD"
+              placeholder="选择日期"
+              popper-class="date-select"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions">
+        <button class="btn" @click="dbfx">对比</button>
+      </div>
+    </div>
+
+    <div class="mg-b-16">
+      <div class="project-table">
+        <Table :data="tableData" :canScroll="false" ref="curRef"></Table>
+      </div>
+    </div>
+    <el-dialog
+      title="对标排名分析"
+      v-model="dialogVisible"
+      width="70%"
+      top="10vh"
+      custom-class="modal"
+      :close-on-click-modal="false"
+    >
+      <dayinfo
+        :radarValue="radarValue"
+        :windNum="windNum"
+        :windNum2="windNum2"
+        :tabs="tabs"
+        :analyisDialog="analyisDialog"
+      />
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	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 Dayinfo from "./dayinfo.vue";
-	export default {
-		components: {
-			Panel,
-			Table,
-			SvgIcon,
-			Dayinfo
-		},
-		data() {
-			let that = this;
-			return {
-				tableIdArr: [], //放checkbox的id数组
-				tableId: [],
-				checkLength: 0, //对标分析只能选择2个
-				tableData: {
-					column: [{
-							name: "",
-							field: "index",
-							is_num: false,
-							is_light: false,
-						},
-						{
-							name: "",
-							field: "check",
-							is_num: false,
-							is_light: false,
-							template:() => {
-								return "<input class='check curCheckBox' type='CheckBox' />";
-							},
-							click: function(event, data) {
-								var dataId = that.tableIdArr[data.index - 1];
-								if (event.target.checked == false && that.checkLength <= 2) {
-									that.tableId.forEach((item, i) => {
-										if (item == dataId) {
-											that.tableId.splice(i, 1)
-										}
-									})
-									that.checkLength--;
-								} else if (event.target.checked && that.checkLength < 2) {
-									that.tableId.push(dataId)
-									that.checkLength++;
-								} else if (that.checkLength == 2) {
-									event.target.checked = false;
-								}
-							},
-						},
-						{
-							name: "风机编号",
-							field: "name",
-							is_num: false,
-							is_light: false,
-						},
-						{
-							name: "等级",
-							field: "dj",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "综合排名",
-							field: "zhpm",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "发电量",
-							field: "fdl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "理论发电量",
-							field: "llfdl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "平均风速",
-							field: "pjfs",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "平均功率",
-							field: "pjgl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "故障损失电量",
-							field: "gzssdl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "限电损失电量",
-							field: "xdssdl",
-							is_num: false,
-							is_light: true,
-							sortable: true,
-						},
-						{
-							name: "维护损失电量",
-							field: "whssdl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "性能损失电量",
-							field: "xnssdl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},
-						{
-							name: "利用小时数",
-							field: "lyxss",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "拟合优度",
-							field: "nhyd",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "设备可利用率",
-							field: "sbklyl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "等效可用系数",
-							field: "dxkyxs",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "有效风时数",
-							field: "yxfss",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						},{
-							name: "平均切入风速",
-							field: "pjqrfs",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "静风频率",
-							field: "jfpl",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}, {
-							name: "功率一致性系数",
-							field: "glyzxxs",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-						}
-					],
-					data: [],
-				},
-				ChangZhan: [], //场站
-				MoKuai: [], //项目
-				value1: [],
-				value2: [],
-				value3: "",
-				dialogVisible: false,
-				radarValue: [],
-				windNum: 'dd',
-				windNum2: 'dd',
-				tabs: [],
-				analyisDialog: [],
-				ajaxData:[],
-			};
-		},
-		created() {
-			this.ChangZhanVal();
-			this.value3 = this.getTime(1);
-			this.AjaxCommon();
-			this.MoKuaiVal();
-		},
-		methods: {
-			MoKuaiVal(val) {
-				var that = this;
-				that.API.requestData({
-					method: "GET",
-					baseURL : "10.155.32.4:8034",
-					subUrl: "evaluation/modelMainList",
-					success(res) {
-						console.log(JSON.stringify(res))
-						that.MoKuai = res.data;
-					}
-				});
-			},
-			MoKuaiChange(val) {
-				this.value2 = val;
-				this.value3 = [];
-				this.AjaxCommon();
-				this.XianLuVal(val);
-				this.clearDb();
-			},
-			ChangZhanVal() {
-				var that = this;
-				that.API.requestData({
-					method: "GET",
-					baseURL : "10.155.32.4:8034",
-					subUrl: "evaluation/wplist",
-					success(res) {
-						that.ChangZhan = res.data;
-					}
-				});
-			},
-			ChangZhanChange(val) {
-				this.value1 = val;
-				this.value2 = [];
-				this.value3 = [];
-				this.AjaxCommon();
-				this.MoKuaiVal(val);
-				this.clearDb();
-			},
-			BeginChange(val) {
-				this.value4 = val;
-				this.AjaxCommon();
-				this.clearDb();
-			},
-			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
-				var date = new Date();
-				var year = date.getFullYear(),
-					month = date.getMonth() + 1,
-					day = date.getDate();
-				month >= 1 && month <= 9 ? (month = '0' + month) : '';
-				day >= 0 && day <= 9 ? (day = '0' + day) : '';
-				var begin = year + '-' + month + '-01';
-				var end = year + '-' + month + '-' + day;
-				if (val == 1) {
-					return begin;
-				} else if (val == 2) {
-					return end;
-				}
-			},
-			AjaxCommon() {
-				var that = this;
-				that.API.requestData({ //五项损失率
-					method: "GET",
-					baseURL : "10.155.32.4:8034",
-					subUrl: "evaluation/wxssl",
-					data: {
-						wpids: that.value1,
-						projectids: that.value2,
-						lineids: that.value3,
-						beginDate: that.value4,
-						endDate: that.value5,
-						target: '',
-						sort: ''
-					},
-					success(res) {
-						that.ajaxData = res.data;
-						var dataTab = []; //表格
-						res.data.forEach((item, index) => {
-							that.tableIdArr.push(item.id);
-							dataTab.push({ //表格
-								index: index + 1,
-								name: item.name,
-								dj: item.dj,
-								zhpm: item.zhpm,
-								fdl: item.fdl,
-								llfdl: item.llfdl,
-								pjfs: item.gzssdl,
-								pjgl: item.pjgl,
-								gzssdl: item.gzssdl,
-								lyxss: item.lyxss,
-								whssdl: item.whssdl,
-								xnssdl: item.xnssdl,
-								lyxss: item.lyxss,
-								nhyd: item.nhyd,
-								sbklyl: item.sbklyl,
-								dxkyxs: item.dxkyxs,
-								yxfss: item.yxfss,
-								pjqrfs: item.pjqrfs,
-								jfpl: item.jfpl,
-								glyzxxs: item.glyzxxs,
-								jxssl: item.jxssl,
-								qflpm: item.qflpm,
-								qfl: item.qfl,
-								xnsslpm: item.xnsslpm,
-								xnssl: item.xnssl,
-								slsslpm: item.slsslpm,
-								slssl: item.slssl,
-								is_light: false
-							})
+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 Dayinfo from "./dayinfo.vue";
+export default {
+  components: {
+    Panel,
+    Table,
+    SvgIcon,
+    Dayinfo,
+  },
+  data() {
+    let that = this;
+    return {
+      tableIdArr: [], //放checkbox的id数组
+      tableId: [],
+      checkLength: 0, //对标分析只能选择2个
+      tableData: {
+        column: [
+          {
+            name: "",
+            field: "index",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "",
+            field: "check",
+            is_num: false,
+            is_light: false,
+            template: () => {
+              return "<input class='check curCheckBox' type='CheckBox' />";
+            },
+            click: function (event, data) {
+              var dataId = that.tableIdArr[data.index - 1];
+              if (event.target.checked == false && that.checkLength <= 2) {
+                that.tableId.forEach((item, i) => {
+                  if (item == dataId) {
+                    that.tableId.splice(i, 1);
+                  }
+                });
+                that.checkLength--;
+              } else if (event.target.checked && that.checkLength < 2) {
+                that.tableId.push(dataId);
+                that.checkLength++;
+              } else if (that.checkLength == 2) {
+                event.target.checked = false;
+              }
+            },
+          },
+          {
+            name: "风机编号",
+            field: "name",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "等级",
+            field: "dj",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "综合排名",
+            field: "zhpm",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "发电量",
+            field: "fdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "理论发电量",
+            field: "llfdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "平均风速",
+            field: "pjfs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "平均功率",
+            field: "pjgl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "故障损失电量",
+            field: "gzssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "限电损失电量",
+            field: "xdssdl",
+            is_num: false,
+            is_light: true,
+            sortable: true,
+          },
+          {
+            name: "维护损失电量",
+            field: "whssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "性能损失电量",
+            field: "xnssdl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "利用小时数",
+            field: "lyxss",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "拟合优度",
+            field: "nhyd",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "设备可利用率",
+            field: "sbklyl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "等效可用系数",
+            field: "dxkyxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "有效风时数",
+            field: "yxfss",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "平均切入风速",
+            field: "pjqrfs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "静风频率",
+            field: "jfpl",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+          {
+            name: "功率一致性系数",
+            field: "glyzxxs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+          },
+        ],
+        data: [],
+      },
+      ChangZhan: [], //场站
+      MoKuai: [], //项目
+      value1: [],
+      value2: [],
+      value3: "",
+      dialogVisible: false,
+      radarValue: [],
+      windNum: "dd",
+      windNum2: "dd",
+      tabs: [],
+      analyisDialog: [],
+      ajaxData: [],
+    };
+  },
+  created() {
+    this.ChangZhanVal();
+    this.value3 = this.getTime(1);
+    this.AjaxCommon();
+    this.MoKuaiVal();
+  },
+  methods: {
+    MoKuaiVal(val) {
+      var that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "10.155.32.4:8034",
+        subUrl: "evaluation/modelMainList",
+        success(res) {
+          console.log(JSON.stringify(res));
+          that.MoKuai = res.data;
+        },
+      });
+    },
+    MoKuaiChange(val) {
+      this.value2 = val;
+      this.value3 = [];
+      this.AjaxCommon();
+      this.XianLuVal(val);
+      this.clearDb();
+    },
+    ChangZhanVal() {
+      var that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "10.155.32.4:8034",
+        subUrl: "evaluation/wplist",
+        success(res) {
+          that.ChangZhan = res.data;
+        },
+      });
+    },
+    ChangZhanChange(val) {
+      this.value1 = val;
+      this.value2 = [];
+      this.value3 = [];
+      this.AjaxCommon();
+      this.MoKuaiVal(val);
+      this.clearDb();
+    },
+    BeginChange(val) {
+      this.value4 = val;
+      this.AjaxCommon();
+      this.clearDb();
+    },
+    getTime(val) {
+      //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
+      var date = new Date();
+      var year = date.getFullYear(),
+        month = date.getMonth() + 1,
+        day = date.getDate();
+      month >= 1 && month <= 9 ? (month = "0" + month) : "";
+      day >= 0 && day <= 9 ? (day = "0" + day) : "";
+      var begin = year + "-" + month + "-01";
+      var end = year + "-" + month + "-" + day;
+      if (val == 1) {
+        return begin;
+      } else if (val == 2) {
+        return end;
+      }
+    },
+    AjaxCommon() {
+      var that = this;
+      that.API.requestData({
+        //五项损失率
+        method: "GET",
+        baseURL: "10.155.32.4:8034",
+        subUrl: "evaluation/wxssl",
+        data: {
+          wpids: that.value1,
+          projectids: that.value2,
+          lineids: that.value3,
+          beginDate: that.value4,
+          endDate: that.value5,
+          target: "",
+          sort: "",
+        },
+        success(res) {
+          that.ajaxData = res.data;
+          var dataTab = []; //表格
+          res.data.forEach((item, index) => {
+            that.tableIdArr.push(item.id);
+            dataTab.push({
+              //表格
+              index: index + 1,
+              name: item.name,
+              dj: item.dj,
+              zhpm: item.zhpm,
+              fdl: item.fdl,
+              llfdl: item.llfdl,
+              pjfs: item.gzssdl,
+              pjgl: item.pjgl,
+              gzssdl: item.gzssdl,
+              lyxss: item.lyxss,
+              whssdl: item.whssdl,
+              xnssdl: item.xnssdl,
+              lyxss: item.lyxss,
+              nhyd: item.nhyd,
+              sbklyl: item.sbklyl,
+              dxkyxs: item.dxkyxs,
+              yxfss: item.yxfss,
+              pjqrfs: item.pjqrfs,
+              jfpl: item.jfpl,
+              glyzxxs: item.glyzxxs,
+              jxssl: item.jxssl,
+              qflpm: item.qflpm,
+              qfl: item.qfl,
+              xnsslpm: item.xnsslpm,
+              xnssl: item.xnssl,
+              slsslpm: item.slsslpm,
+              slssl: item.slssl,
+              is_light: false,
+            });
+          });
+          that.tableData.data = dataTab;
+        },
+      });
+    },
+    AjaxDbfx() {
+      var that = this;
+      var data = that.ajaxData;
+      that.windNum = data[0].name;
+      that.windNum2 = data[1].name;
+      that.tabs = [
+        {
+          name: "发电量",
+          windData1: data[0].fdl,
+          windData2: data[1].fdl,
+        },
+        {
+          name: "故障损失电量",
+          windData1: data[0].gzssdl,
+          windData2: data[1].gzssdl,
+        },
+        {
+          name: "检修损失电量",
+          windData1: data[0].jxssdl,
+          windData2: data[1].jxssdl,
+        },
+        {
+          name: "性能未达标损失电量",
+          windData1: data[0].xnssdl,
+          windData2: data[1].xnssdl,
+        },
+        {
+          name: "受累损失电量",
+          windData1: data[0].slssdl,
+          windData2: data[1].slssdl,
+        },
+        {
+          name: "风能利用率",
+          windData1: data[0].fnlyl,
+          windData2: data[1].fnlyl,
+        },
+        {
+          name: "故障损失率",
+          windData1: data[0].gzssl,
+          windData2: data[1].gzssl,
+        },
+        {
+          name: "检修损失率",
+          windData1: data[0].jxssl,
+          windData2: data[1].jxssl,
+        },
+        {
+          name: "弃风率",
+          windData1: data[0].qfl,
+          windData2: data[1].qfl,
+        },
+        {
+          name: "性能损失率",
+          windData1: data[0].xnssl,
+          windData2: data[1].xnssl,
+        },
+        {
+          name: "受累损失率",
+          windData1: data[0].slssl,
+          windData2: data[1].slssl,
+        },
+      ];
+
+      that.radarValue = [
+        {
+          indicator: [
+            "风能利用率",
+            "故障损失率",
+            "检修损失率",
+            "弃风率",
+            "性能损失率",
+            "受累损失率",
+          ],
+          data: [
+            {
+              value: [
+                data[0].fnlylpm,
+                data[0].gzsslpm,
+                data[0].jxsslpm,
+                data[0].qflpm,
+                data[0].xnsslpm,
+                data[0].slsslpm,
+              ],
+            },
+            {
+              value: [
+                data[1].fnlylpm,
+                data[1].gzsslpm,
+                data[1].jxsslpm,
+                data[1].qflpm,
+                data[1].xnsslpm,
+                data[1].slsslpm,
+              ],
+            },
+          ],
+        },
+      ];
 
-						})
-						that.tableData.data = dataTab;
-					}
-				});
-			},
-			AjaxDbfx() {
-				var that = this;
-				var data = that.ajaxData;
-				that.windNum = data[0].name;
-				that.windNum2 = data[1].name;
-				that.tabs = [{
-					name: "发电量",
-					windData1: data[0].fdl,
-					windData2: data[1].fdl
-				}, {
-					name: "故障损失电量",
-					windData1: data[0].gzssdl,
-					windData2: data[1].gzssdl
-				}, {
-					name: "检修损失电量",
-					windData1: data[0].jxssdl,
-					windData2: data[1].jxssdl
-				}, {
-					name: "性能未达标损失电量",
-					windData1: data[0].xnssdl,
-					windData2: data[1].xnssdl
-				}, {
-					name: "受累损失电量",
-					windData1: data[0].slssdl,
-					windData2: data[1].slssdl
-				}, {
-					name: "风能利用率",
-					windData1: data[0].fnlyl,
-					windData2: data[1].fnlyl
-				}, {
-					name: "故障损失率",
-					windData1: data[0].gzssl,
-					windData2: data[1].gzssl
-				}, {
-					name: "检修损失率",
-					windData1: data[0].jxssl,
-					windData2: data[1].jxssl
-				}, {
-					name: "弃风率",
-					windData1: data[0].qfl,
-					windData2: data[1].qfl
-				}, {
-					name: "性能损失率",
-					windData1: data[0].xnssl,
-					windData2: data[1].xnssl
-				}, {
-					name: "受累损失率",
-					windData1: data[0].slssl,
-					windData2: data[1].slssl
-				}];
-				
-				that.radarValue = [{
-					indicator: ["风能利用率", "故障损失率", "检修损失率", "弃风率", "性能损失率", "受累损失率"],
-					data: [{
-						value: [data[0].fnlylpm, data[0].gzsslpm, data[0].jxsslpm, data[0].qflpm,
-							data[0].xnsslpm, data[0].slsslpm
-						]
-					}, {
-						value: [data[1].fnlylpm, data[1].gzsslpm, data[1].jxsslpm, data[1].qflpm,
-							data[1].xnsslpm, data[1].slsslpm
-						]
-					}]
-				}];
-				
-				var analyis = [],
-					gzssdl = [],
-					jxssdl = [],
-					xnssdl = [],
-					xdssdl = [],
-					slssdl = [];
-				data.forEach((item, index) => {
-					gzssdl.push({
-						text: item.name,
-						value: item.gzssdl
-					});
-					jxssdl.push({
-						text: item.name,
-						value: item.jxssdl
-					});
-					xnssdl.push({
-						text: item.name,
-						value: item.xnssdl
-					});
-					xdssdl.push({
-						text: item.name,
-						value: item.xdssdl
-					});
-					slssdl.push({
-						text: item.name,
-						value: item.slssdl
-					});
-				})
-				analyis.push({
-					title: "故障损失电量",
-					yAxisIndex: 0,
-					value: gzssdl
-				}, {
-					title: "检修损失电量",
-					yAxisIndex: 0,
-					value: jxssdl
-				}, {
-					title: "性能损失电量",
-					yAxisIndex: 0,
-					value: xnssdl
-				}, {
-					title: "限电损失电量",
-					yAxisIndex: 0,
-					value: xdssdl
-				}, {
-					title: "受累损失电量",
-					yAxisIndex: 0,
-					value: slssdl
-				})
-				that.analyisDialog = analyis;
-				
-			},
-			tooltip(param, callback) {
-				var color = ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"];
+      var analyis = [],
+        gzssdl = [],
+        jxssdl = [],
+        xnssdl = [],
+        xdssdl = [],
+        slssdl = [];
+      data.forEach((item, index) => {
+        gzssdl.push({
+          text: item.name,
+          value: item.gzssdl,
+        });
+        jxssdl.push({
+          text: item.name,
+          value: item.jxssdl,
+        });
+        xnssdl.push({
+          text: item.name,
+          value: item.xnssdl,
+        });
+        xdssdl.push({
+          text: item.name,
+          value: item.xdssdl,
+        });
+        slssdl.push({
+          text: item.name,
+          value: item.slssdl,
+        });
+      });
+      analyis.push(
+        {
+          title: "故障损失电量",
+          yAxisIndex: 0,
+          value: gzssdl,
+        },
+        {
+          title: "检修损失电量",
+          yAxisIndex: 0,
+          value: jxssdl,
+        },
+        {
+          title: "性能损失电量",
+          yAxisIndex: 0,
+          value: xnssdl,
+        },
+        {
+          title: "限电损失电量",
+          yAxisIndex: 0,
+          value: xdssdl,
+        },
+        {
+          title: "受累损失电量",
+          yAxisIndex: 0,
+          value: slssdl,
+        }
+      );
+      that.analyisDialog = analyis;
+    },
+    tooltip(param, callback) {
+      var color = ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"];
 
-				var result = param[0].axisValue;
-				param.forEach((value, index) => {
-					result += "<br />" +
-						`<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${color[index]};"></span>` +
-						value.seriesName + ":" + value.value;
-				});
-				callback(result);
-				return true;
-			},
-			dbfx() {
-				var that = this;
-				if (that.tableId.length == 2) {
-					that.dialogVisible = true;
-					this.AjaxDbfx();
-					this.clearDb();
-				}
-			},
-			clearDb(){//清空对标状态
-				this.$refs.curRef.clearCheckBox();
-				this.tableId = [];
-				this.checkLength = 0;
-			}
-		}
-	};
+      var result = param[0].axisValue;
+      param.forEach((value, index) => {
+        result +=
+          "<br />" +
+          `<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${color[index]};"></span>` +
+          value.seriesName +
+          ":" +
+          value.value;
+      });
+      callback(result);
+      return true;
+    },
+    dbfx() {
+      var that = this;
+      if (that.tableId.length == 2) {
+        that.dialogVisible = true;
+        this.AjaxDbfx();
+        this.clearDb();
+      }
+    },
+    clearDb() {
+      //清空对标状态
+      this.$refs.curRef.clearCheckBox();
+      this.tableId = [];
+      this.checkLength = 0;
+    },
+  },
+};
 </script>
 
 <style lang="less">
-	.decision-page-2 {
-		.content .project-table {
-			tbody {
-				height: calc(100vh - 24.5vh);
-			}
-		}
+.decision-page-2 {
+  .content .project-table {
+    tbody {
+      height: calc(100vh - 24.5vh);
+    }
+  }
 
-		.project-table {
-			overflow: auto;
+  .project-table {
+    overflow: auto;
 
-			tbody {
-				height: 279px;
-			}
+    tbody {
+      height: 279px;
+    }
 
-			th,
-			td {
-				color: #b2bdc0;
+    th,
+    td {
+      color: #b2bdc0;
 
-				&:nth-child(1) {
-					width: 50px;
-				}
+      &:nth-child(1) {
+        width: 50px;
+      }
 
-				&:nth-child(2) {
-					width: 50px;
-				}
-			}
-		}
+      &:nth-child(2) {
+        width: 50px;
+      }
+    }
+  }
 
-		.action {
-			text-decoration: underline;
-			color: @green;
-			cursor: pointer;
-		}
-	}
+  .action {
+    text-decoration: underline;
+    color: @green;
+    cursor: pointer;
+  }
+}
 </style>

+ 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>