123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <div class="booster-station">
- <div class="btn-group-tabs">
- <BtnGroup2
- :btnGroups="btnGroups"
- :rowIndex="rowIndex"
- :index="selectIndex"
- @select="select"
- ></BtnGroup2>
- </div>
- <!-- <bsx6 class="booster-station-body"></bsx6> -->
- <BoosterMCH class="booster-station-body"></BoosterMCH>
- </div>
- </template>
- <script>
- import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
- // import bsx6 from "../components/bsx6.vue";
- import BoosterMCH from "../components/boosterstation/mch/mch.vue";
- export default {
- // 名称
- name: "BoosterStation",
- // 使用组件
- components: {
- // bsx6,
- BtnGroup2,
- BoosterMCH,
- },
- // 数据
- data() {
- return {
- wpId: undefined,
- selectIndex: 0,
- rowIndex: 0,
- btnGroups: [
- {
- icon: "svg-wind-site",
- btns: [],
- },
- {
- icon: "svg-photovoltaic",
- btns: [],
- },
- ],
- };
- },
- created() {
- let that = this;
- that.wpId = that.$route.params.wpId;
- that.$nextTick(() => {
- that.getWp();
- });
- },
- // 函数
- methods: {
- select(res) {
- this.$router.replace({
- path: `/monitor/windsite/boosterstation/${res.code}`,
- });
- },
- getWp() {
- let that = this;
- that.API.requestData({
- method: "GET",
- subUrl: "powercompare/windfarmAllAjax",
- success(res) {
- let btnGroup = [
- {
- icon: "svg-wind-site",
- btns: [],
- },
- {
- icon: "svg-photovoltaic",
- btns: [],
- },
- ];
- res.data.forEach((ele, index) => {
- if (ele.id.indexOf("FDC") !== -1) {
- btnGroup[0].btns.push({
- text: ele.name,
- code: ele.id,
- });
- } else {
- btnGroup[1].btns.push({
- text: ele.name,
- code: ele.id,
- });
- }
- });
- that.btnGroups = btnGroup;
- that.renderBtnActiveIndex();
- },
- });
- },
- renderBtnActiveIndex() {
- this.btnGroups.forEach((pEle, pIndex) => {
- pEle.btns.forEach((cEle, cIndex) => {
- if (cEle.code === this.wpId) {
- this.rowIndex = pIndex;
- this.selectIndex = cIndex;
- }
- });
- });
- },
- },
- // 生命周期钩子
- beforeCreate() {
- // 创建前
- },
- beforeMount() {
- // 渲染前
- },
- mounted() {
- // 渲染后
- },
- beforeUpdate() {
- // 数据更新前
- },
- updated() {
- // 数据更新后
- },
- watch: {
- $route(res) {
- this.wpId = res.params.wpId;
- if (res.params.wpId) {
- this.renderBtnActiveIndex();
- }
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .booster-station {
- width: 100%;
- height: calc(100vh - 90px);
- display: flex;
- flex-direction: column;
- .btn-group-tabs {
- display: flex;
- flex-direction: row;
- }
- .booster-station-body {
- flex-grow: 1;
- }
- }
- </style>
|