|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="draught-fan-list">
|
|
|
<div class="btn-group-tabs">
|
|
|
- <!-- <BtnGroup2 :btnGroups="btnGroups" :rowIndex="0" :index="1" @select="select"></BtnGroup2> -->
|
|
|
+ <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
|
|
|
</div>
|
|
|
<div class="df-table">
|
|
|
<ComTable :data="data"></ComTable>
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
// 数据
|
|
|
data() {
|
|
|
return {
|
|
|
- btnGroups: [
|
|
|
+ btnGroupsss: [
|
|
|
{
|
|
|
icon: "fa fa-fire",
|
|
|
btns: [
|
|
@@ -216,11 +216,67 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ getWp () {
|
|
|
+ let that = this;
|
|
|
+ that.API.requestData({
|
|
|
+ method: "GET",
|
|
|
+ subUrl: "powercompare/windfarmAllAjax",
|
|
|
+ success (res) {
|
|
|
+ let btnGroups = [
|
|
|
+ {
|
|
|
+ icon: "svg-wind-site",
|
|
|
+ btns: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: "svg-photovoltaic",
|
|
|
+ btns: [],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ res.data.forEach((ele, index) => {
|
|
|
+ if (ele.id.indexOf("FDC") !== -1) {
|
|
|
+ btnGroups[0].btns.push({
|
|
|
+ text: ele.name,
|
|
|
+ code: ele.id,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ btnGroups[1].btns.push({
|
|
|
+ text: ele.name,
|
|
|
+ code: ele.id,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ that.btnGroupsss = btnGroups;
|
|
|
+ that.renderBtnActiveIndex();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ renderBtnActiveIndex () {
|
|
|
+ this.btnGroupsss.forEach((pEle, pIndex) => {
|
|
|
+ pEle.btns.forEach((cEle, cIndex) => {
|
|
|
+ if (cEle.code === this.wpId) {
|
|
|
+ this.rowIndex = pIndex;
|
|
|
+ this.selectIndex = cIndex;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ select (res) {
|
|
|
+ debugger;
|
|
|
+ this.$router.replace({
|
|
|
+ path: `/monitor/windsite/draughtfanlist/${res.code}`,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
let that = this;
|
|
|
that.wpId = that.$route.params.wpId;
|
|
|
+ that.getWp();
|
|
|
that.$nextTick(() => {
|
|
|
that.requestData(false);
|
|
|
that.timmer = setInterval(() => {
|
|
@@ -234,8 +290,17 @@ export default {
|
|
|
unmounted() {
|
|
|
clearInterval(this.timmer);
|
|
|
this.timmer = null;
|
|
|
+ }, watch: {
|
|
|
+ $route (res) {
|
|
|
+ this.wpId = res.params.wpId;
|
|
|
+ if (res.params.wpId) {
|
|
|
+ this.requestData(false);
|
|
|
+ this.renderBtnActiveIndex();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
@@ -245,14 +310,10 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
|
|
|
- .btn-group-tabs {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
-
|
|
|
- .photovoltaic {
|
|
|
- margin-left: 1.481vh;
|
|
|
- }
|
|
|
- }
|
|
|
+.btn-group-tabs {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+}
|
|
|
|
|
|
.df-table {
|
|
|
border: 0.093vh solid fade(@darkgray, 50%);
|