|
@@ -1,23 +1,32 @@
|
|
|
<template>
|
|
|
- <el-row class="headerButton">
|
|
|
- <div class="nav_right headerRight">
|
|
|
- <i class="active_icon icon-enterprise"></i>
|
|
|
- <span>{{region[0]?.aname}}</span>
|
|
|
- </div>
|
|
|
- <el-select v-model="checkNode" placeholder="请选择" @change="dataChang">
|
|
|
- <el-option
|
|
|
- v-for="item in OrganizationList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
-<!-- <div class="check">-->
|
|
|
-<!-- <span :class="{active:leftIndex==-1}" @click="windLightToggle(-1)">风场</span>-->
|
|
|
-<!-- <span :class="{light:leftIndex==-2}" @click="windLightToggle(-2)">光伏</span>-->
|
|
|
-<!-- </div>-->
|
|
|
-
|
|
|
- <div style="margin-left: 15px">
|
|
|
+ <el-row class="headerButton">
|
|
|
+ <div class="nav_right ">
|
|
|
+ <el-select v-model="tagListNode" placeholder="请选择"
|
|
|
+ @change="tagListChang">
|
|
|
+ <el-option
|
|
|
+ v-for="(item,indexe) in tagList"
|
|
|
+ :key="indexe"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.type">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-select v-model="checkNode" placeholder="请选择" @change="dataChang">
|
|
|
+ <el-option
|
|
|
+ v-for="item in OrganizationList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <!-- <div class="check">-->
|
|
|
+ <!-- <span :class="{active:leftIndex==-1}" @click="windLightToggle(-1)">风场</span>-->
|
|
|
+ <!-- <span :class="{light:leftIndex==-2}" @click="windLightToggle(-2)">光伏</span>-->
|
|
|
+ <!-- </div>-->
|
|
|
+
|
|
|
+ <div style="margin-left: 15px" v-if="LengthAta==''">
|
|
|
<el-select v-model="checkNodes" placeholder="请选择" @change="dataChangs">
|
|
|
<el-option
|
|
|
v-for="(item,index) in allPowerStation"
|
|
@@ -27,113 +36,184 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- </el-row>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {GetPowerStation, getOrganization} from '@/api/home'
|
|
|
-
|
|
|
-export default {
|
|
|
- name:'headerButton',
|
|
|
- props:{
|
|
|
- type:String,
|
|
|
- srationId:{
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- OrganizationList: null,
|
|
|
- PowerStation: [],
|
|
|
- stationCode:null,
|
|
|
- stationName:'',
|
|
|
- checkNode: '',
|
|
|
- checkNodes:'',
|
|
|
- rightIndex: 0,
|
|
|
- endIndex:null,
|
|
|
- leftIndex:this.type,
|
|
|
- stationIndex: 0,
|
|
|
- allPowerStation:null,
|
|
|
- region:[],
|
|
|
- }
|
|
|
- },
|
|
|
- async created() {
|
|
|
-
|
|
|
- //获取区域公司
|
|
|
- await this.getOrganizationList();
|
|
|
- //根据区域公司编码获取场站信息
|
|
|
- await this.getPowerStation();
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
- handleAddClick(){
|
|
|
- this.endIndex=1;
|
|
|
- if(this.stationIndex < this.PowerStation.length-1){
|
|
|
- this.stationIndex ++
|
|
|
- // this.powerStatonCheck(0,this.PowerStation[this.stationIndex]?.children[0]?.CZBM ,this.PowerStation[this.stationIndex]?.children[0]?.CZMC)
|
|
|
- }
|
|
|
- },
|
|
|
- handleDel(){
|
|
|
- this.endIndex=0;
|
|
|
- if(this.stationIndex > 0){
|
|
|
- this.stationIndex --
|
|
|
- // this.powerStatonCheck(0,this.PowerStation[this.stationIndex]?.children[0]?.CZBM ,this.PowerStation[this.stationIndex]?.children[0]?.CZMC)
|
|
|
- }
|
|
|
- },
|
|
|
- //获取区域公司
|
|
|
- async getOrganizationList() {
|
|
|
-
|
|
|
- const data = await getOrganization({type:this.type});
|
|
|
- var arr = [];
|
|
|
- if(data && data.length>0){
|
|
|
-
|
|
|
- this.region=data
|
|
|
-let data1=data.slice(1)
|
|
|
- data1.forEach(item => {
|
|
|
-
|
|
|
- var obj = {};
|
|
|
- obj.value = item.code;
|
|
|
- obj.label = item.aname;
|
|
|
- arr.push(obj);
|
|
|
- })
|
|
|
- this.checkNode = data1[0].code;
|
|
|
- this.OrganizationList = arr;
|
|
|
- }
|
|
|
- },
|
|
|
- //获取场站信息
|
|
|
- async getPowerStation() {
|
|
|
- const data = await GetPowerStation({companyCode: this.checkNode, stationType: this.leftIndex})
|
|
|
- if(data) {
|
|
|
- this.checkNodes=data[0].CZBM
|
|
|
- this.allPowerStation=data;
|
|
|
- this.$emit('renderData',this.checkNodes,this.leftIndex,this.stationName);
|
|
|
-
|
|
|
- }
|
|
|
- // this.$emit('renderData',this.stationCode,this.leftIndex,this.stationName);
|
|
|
-
|
|
|
- },
|
|
|
- //风光切换
|
|
|
- // async windLightToggle(index) {
|
|
|
- // this.leftIndex = index;
|
|
|
- // this.rightIndex=0;
|
|
|
- // await this.getPowerStation();
|
|
|
- // await this.$emit('renderData',this.stationCode,this.leftIndex);
|
|
|
- // },
|
|
|
- //区域切换
|
|
|
- async dataChang(val) {
|
|
|
- //根据区域公司编码获取场站信息
|
|
|
- this.stationIndex=0;
|
|
|
- this.rightIndex=0;
|
|
|
- await this.getPowerStation();
|
|
|
- // await this.$emit('renderData','',this.leftIndex,this.stationName,this.checkNode);
|
|
|
- },
|
|
|
- //点击场站切换数据
|
|
|
- dataChangs(code) {
|
|
|
- this.stationCode=code;
|
|
|
- this.$emit('renderData',this.stationCode,this.leftIndex,this.stationName,this.checkNode);
|
|
|
+ import {GetPowerStation, getOrganization, getPowerstationTypeList} from '@/api/home'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'headerButton',
|
|
|
+ props: {
|
|
|
+ srationId: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ LengthAta:'',
|
|
|
+ OrganizationList: null,
|
|
|
+ tagListNode: '',
|
|
|
+ PowerStation: [],
|
|
|
+ stationCode: null,
|
|
|
+ stationName: '',
|
|
|
+ checkNode: '',
|
|
|
+ checkNodes: '',
|
|
|
+ rightIndex: 0,
|
|
|
+ endIndex: null,
|
|
|
+ leftIndex: this.tagListNode,
|
|
|
+ stationIndex: 0,
|
|
|
+ allPowerStation: null,
|
|
|
+ region: [],
|
|
|
+ tagList: [],
|
|
|
+ conCode:'',
|
|
|
+ data:'',
|
|
|
+ data1:''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.conCode=this.$route.query.companyCode
|
|
|
+ this.data=this.$route.query.stationCode
|
|
|
+ this.data1=this.$route.query.nemCode
|
|
|
+ await this.getPowerstationTypeList();
|
|
|
+ //获取区域公司
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getPowerstationTypeList() {
|
|
|
+
|
|
|
+ const data = await getPowerstationTypeList({code: 'classification'});
|
|
|
+ let arr = []
|
|
|
+ data.forEach(s => {
|
|
|
+ if (s.flag == 0) {
|
|
|
+ arr.push(s)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tagList = arr
|
|
|
+
|
|
|
+ // let arr=[]
|
|
|
+ // data.forEach(i=>{
|
|
|
+ // if(i.flag==0){
|
|
|
+ // arr.push(+1)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.tagListNode = data[0].type
|
|
|
+ await this.getOrganizationList(data[0].type)
|
|
|
+
|
|
|
+ // this.codeNum=arr.length
|
|
|
+ // this.tagList = [{type: '-1', flag: '0'}, {type: '-2', flag: '0'}];
|
|
|
+ // localStorage.setItem("tagList", JSON.stringify(this.tagList));
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // 切换风光水
|
|
|
+ async tagListChang(val) {
|
|
|
+ this.tagListNode = val
|
|
|
+ this.getOrganizationList(val)
|
|
|
+ },
|
|
|
+
|
|
|
+ handleAddClick() {
|
|
|
+ this.endIndex = 1;
|
|
|
+ if (this.stationIndex < this.PowerStation.length - 1) {
|
|
|
+ this.stationIndex++
|
|
|
+ // this.powerStatonCheck(0,this.PowerStation[this.stationIndex]?.children[0]?.CZBM ,this.PowerStation[this.stationIndex]?.children[0]?.CZMC)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDel() {
|
|
|
+ this.endIndex = 0;
|
|
|
+ if (this.stationIndex > 0) {
|
|
|
+ this.stationIndex--
|
|
|
+ // this.powerStatonCheck(0,this.PowerStation[this.stationIndex]?.children[0]?.CZBM ,this.PowerStation[this.stationIndex]?.children[0]?.CZMC)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取区域公司
|
|
|
+ async getOrganizationList() {
|
|
|
+ const data = await getOrganization({type: this.tagListNode});
|
|
|
+ var arr = [];
|
|
|
+
|
|
|
+ if (data && data.length > 0) {
|
|
|
+
|
|
|
+ this.region = data
|
|
|
+ let data1 = data.slice(1)
|
|
|
+ data1.forEach(item => {
|
|
|
+
|
|
|
+ var obj = {};
|
|
|
+ obj.value = item.code;
|
|
|
+ obj.label = item.aname;
|
|
|
+ arr.push(obj);
|
|
|
+ })
|
|
|
+
|
|
|
+ if(this.conCode!=undefined && this.conCode!=''){
|
|
|
+
|
|
|
+ this.checkNode=this.conCode
|
|
|
+
|
|
|
+ }else {
|
|
|
+ this.checkNode = data1[0].code;
|
|
|
+ }
|
|
|
+ this.OrganizationList = arr;
|
|
|
+ }
|
|
|
+ await this.getPowerStation();
|
|
|
+
|
|
|
+ },
|
|
|
+ //获取场站信息
|
|
|
+ async getPowerStation(val) {
|
|
|
+
|
|
|
+ const data = await GetPowerStation({companyCode: this.checkNode, stationType: this.leftIndex})
|
|
|
+
|
|
|
+ if (data && JSON.stringify(data)!=="{}") {
|
|
|
+ if(this.data!=undefined && this.data!='' && val==undefined){
|
|
|
+
|
|
|
+ this.checkNodes=this.data
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.checkNodes = data[0].CZBM
|
|
|
+ }
|
|
|
+
|
|
|
+ this.allPowerStation = data;
|
|
|
+ this.$emit('renderData', this.checkNodes, this.leftIndex, this.stationName, this.tagListNode,this.tagListNode);
|
|
|
+ }else {
|
|
|
+ this.LengthAta='1'
|
|
|
+ this.$emit('renderData', this.checkNode, this.leftIndex, this.stationName, this.tagListNode,this.tagListNode);
|
|
|
+ }
|
|
|
+ // this.$emit('renderData',this.stationCode,this.leftIndex,this.stationName);
|
|
|
+ },
|
|
|
+ //风光切换
|
|
|
+ // async windLightToggle(index) {
|
|
|
+ // this.leftIndex = index;
|
|
|
+ // this.rightIndex=0;
|
|
|
+ // await this.getPowerStation();
|
|
|
+ // await this.$emit('renderData',this.stationCode,this.leftIndex);
|
|
|
+ // },
|
|
|
+ //区域切换
|
|
|
+ async dataChang(val) {
|
|
|
+ let title
|
|
|
+ this.region.forEach(s=>{
|
|
|
+ if(s.code==val){
|
|
|
+ title=s.orgType
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if(title=='STA'){
|
|
|
+ this.LengthAta='1'
|
|
|
+ this.$emit('renderData', val, this.leftIndex, this.stationName, this.tagListNode,this.tagListNode);
|
|
|
+ }else {
|
|
|
+ this.LengthAta=''
|
|
|
+ this.checkNode=val
|
|
|
+ await this.getPowerStation(val);
|
|
|
+ }
|
|
|
+ //根据区域公司编码获取场站信息
|
|
|
+ this.stationIndex = 0;
|
|
|
+ this.rightIndex = 0;
|
|
|
+
|
|
|
+ },
|
|
|
+ //点击场站切换数据
|
|
|
+ dataChangs(code) {
|
|
|
+ this.stationCode = code;
|
|
|
+ this.$emit('renderData', this.stationCode, this.leftIndex, this.stationName, this.tagListNode,this.tagListNode);
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
- },
|
|
|
-}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.headerRight {
|
|
@@ -152,7 +232,7 @@ let data1=data.slice(1)
|
|
|
font-size: 14px;
|
|
|
font-family: Microsoft YaHei;
|
|
|
font-weight: 400;
|
|
|
- color: #fff ;
|
|
|
+ color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -165,99 +245,107 @@ let data1=data.slice(1)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-.headerButton {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- flex-wrap: wrap;
|
|
|
- padding: 10px 0 15px 0;
|
|
|
- .active {
|
|
|
- background-color: rgba(0, 70, 199, 0.4) !important;
|
|
|
- color: #fff !important;
|
|
|
- }
|
|
|
|
|
|
- .light {
|
|
|
- background-color: rgba(255, 131, 0, 0.6)!important;
|
|
|
- color: #fff !important;
|
|
|
- }
|
|
|
+ .headerButton {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 10px 0 15px 0;
|
|
|
|
|
|
- .check {
|
|
|
- width: 100px;
|
|
|
- height: 25px;
|
|
|
- line-height: 23px;
|
|
|
- box-sizing: border-box;
|
|
|
- background-color: #2A374F;
|
|
|
- border-radius: 12.5px;
|
|
|
- border: 1px solid #43516B;
|
|
|
- color: #B3B3B3;
|
|
|
- margin-left: 5px;
|
|
|
-
|
|
|
- > span:first-child {
|
|
|
- border-top-left-radius: 12.5px;
|
|
|
- border-bottom-left-radius: 12.5px;
|
|
|
+ .active {
|
|
|
+ background-color: rgba(0, 70, 199, 0.4) !important;
|
|
|
+ color: #fff !important;
|
|
|
}
|
|
|
|
|
|
- > span:last-child {
|
|
|
- border-top-right-radius: 12.5px;
|
|
|
- border-bottom-right-radius: 12.5px;
|
|
|
+ .light {
|
|
|
+ background-color: rgba(255, 131, 0, 0.6) !important;
|
|
|
+ color: #fff !important;
|
|
|
}
|
|
|
|
|
|
- > span {
|
|
|
- display: inline-block;
|
|
|
- width: 50%;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
+ .check {
|
|
|
+ width: 100px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 23px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #2A374F;
|
|
|
+ border-radius: 12.5px;
|
|
|
+ border: 1px solid #43516B;
|
|
|
+ color: #B3B3B3;
|
|
|
+ margin-left: 5px;
|
|
|
|
|
|
- .icon {
|
|
|
- font-size: 18px;
|
|
|
- margin: 0 12px;
|
|
|
- }
|
|
|
+ > span:first-child {
|
|
|
+ border-top-left-radius: 12.5px;
|
|
|
+ border-bottom-left-radius: 12.5px;
|
|
|
+ }
|
|
|
|
|
|
- .icon .icon-wind {
|
|
|
- color: #1C99FF;
|
|
|
- }
|
|
|
+ > span:last-child {
|
|
|
+ border-top-right-radius: 12.5px;
|
|
|
+ border-bottom-right-radius: 12.5px;
|
|
|
+ }
|
|
|
|
|
|
- .icon .icon-Photovoltaic-pv {
|
|
|
- color: rgba(255, 131, 0, 1);
|
|
|
- }
|
|
|
+ > span {
|
|
|
+ display: inline-block;
|
|
|
+ width: 50%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .childNode {
|
|
|
- display: flex;
|
|
|
- width: 85%;
|
|
|
- >div {
|
|
|
- padding: 0 20px;
|
|
|
- height: 25px;
|
|
|
- line-height: 25px;
|
|
|
- border-radius: 12.5px;
|
|
|
- background-color: rgba(0, 70, 199, 0.2);
|
|
|
- color: #B3B3B3;
|
|
|
- margin-right: 5px;
|
|
|
+ .icon {
|
|
|
+ font-size: 18px;
|
|
|
+ margin: 0 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon .icon-wind {
|
|
|
+ color: #1C99FF;
|
|
|
}
|
|
|
- .station-name{
|
|
|
- padding: 0 18px;
|
|
|
+
|
|
|
+ .icon .icon-Photovoltaic-pv {
|
|
|
+ color: rgba(255, 131, 0, 1);
|
|
|
}
|
|
|
- }
|
|
|
- .more{
|
|
|
- position: absolute;
|
|
|
- top: 10px;
|
|
|
- right: -60px;
|
|
|
- display: flex;
|
|
|
- .button{
|
|
|
- width: 25px;
|
|
|
- height: 25px;
|
|
|
- line-height: 25px;
|
|
|
- text-align: center;
|
|
|
- border-radius: 50%;
|
|
|
- background-color: rgba(0, 70, 199, 0.2);
|
|
|
- color: rgba(179, 179, 179, 1);
|
|
|
+
|
|
|
+ .childNode {
|
|
|
+ display: flex;
|
|
|
+ width: 85%;
|
|
|
+
|
|
|
+ > div {
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ border-radius: 12.5px;
|
|
|
+ background-color: rgba(0, 70, 199, 0.2);
|
|
|
+ color: #B3B3B3;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .station-name {
|
|
|
+ padding: 0 18px;
|
|
|
+ }
|
|
|
}
|
|
|
- .button{
|
|
|
- margin-right: 5px;
|
|
|
+
|
|
|
+ .more {
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ right: -60px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .button {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: rgba(0, 70, 199, 0.2);
|
|
|
+ color: rgba(179, 179, 179, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .button {
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .activeBtn {
|
|
|
+ background-color: rgba(0, 70, 199, 0.4) !important;
|
|
|
+ color: #fff !important;
|
|
|
}
|
|
|
}
|
|
|
- .activeBtn{
|
|
|
- background-color: rgba(0, 70, 199, 0.4)!important;
|
|
|
- color: #fff!important;
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|