<template>
  <div class="flex dashboard-editor-container">
    <div class="left">
      <div
        class="menu flex"
        v-for="item in leftMenu"
        :key="item.type"
        @click="active = item.type"
        :class="{ active: item.type == active }"
      >
        <span class="img"> <div class="imgbgc" :class="item.type"></div></span> {{ item.name }}
      </div>
    </div>
    <div class="right ">
      <el-button
        v-for="item in yearArr"
        :key="item.value"
        :type="year == item.value ? 'primary' : ''"
        @click="search(item)"
        v-if="item.name!='2016年以前'"
      >{{ item.name }}</el-button>

      <div class="content2">
        <div v-if="active == 'ztgk'">
          <div class="context">
            <p >
              {{this.year2}}，我院累计立项<el-link target="_blank" :underline="false"  @click="toYearPage(year)" class="font">{{apprpval}}</el-link>个，
              经费投入共计<el-link target="_blank"  :underline="false" @click="toYearPage(year)" class="font">{{zjf}}</el-link>万元。收集咨询报告累计
              <el-link target="_blank" :underline="false"  @click="toYearPage(year)" class="font">{{report}}</el-link>份，
              上报院士建议
              <el-link target="_blank" :underline="false" @click="toStatusPage(year)" class="font">{{proposal}}</el-link>份， 其中
              <el-link target="_blank" :underline="false" @click="toStatusPage(year)" class="font">{{instructions}}</el-link>份得到相关领导、部门的批示。
            </p>
          </div>
          <el-row :gutter="32">

            <el-col  :lg="12">
              <div class="chart-wrapper" >
                <!-- <raddar-chart /> -->
                <BarLineChart class="shadow"  height="600px" width="" :blXData="blX" :blLgData="blLg" :blSerData="blSer" :blTitle="blTitle" @yearToPage="toYearPage"/>
              </div>
            </el-col>

            <el-col  :xs="12" :sm="12" :lg="8">
              <div class="chart-wrapper" >
                <!-- <raddar-chart /> -->
                <DuidieChart class="shadow" height="600px" width="700px" :ddXData="ddX" :ddLgData="ddLg" :ddSerData="ddSer" @toStatusPage="toStatusPage" />
              </div>
            </el-col>

          </el-row>

        </div>
        <div v-if="active == 'xmfl'">
          <div class="context pie">
            <p>
              {{this.year2}}，
              共承担<span v-for="(item,index) in countProject">
                 <span v-if="index<countProject.length-1">
<!--                   <el-link target="_blank" :underline="false" @click="toSecPage(item.secLevel)" class="type">{{item.name}}</el-link>-->
                   <span class="type">{{item.name}}</span>
                   项目
                   <el-link target="_blank" :underline="false" @click="toSecPage(item.secLevel)" class="font">{{item.value}}</el-link>个、</span>
                 <span v-else>
<!--                   <el-link target="_blank" :underline="false" @click="toSecPage(item.secLevel)" class="font">{{item.name}}</el-link>项目-->
                   <span class="type">{{item.name}}</span>项目
                   <el-link target="_blank" :underline="false" @click="toSecPage(item.secLevel)" class="font">   {{item.value}}</el-link>个。
                 </span>
              </span><span v-for="(item,index) in typeData">
                 <span v-if="index<typeData.length-1">
<!--                   <el-link target="_blank" :underline="false" @click="toTypePage(item.typeId)" class="font"> {{item.name}}</el-link>-->
                   <span class="type">{{item.name}}</span>项目
                   <el-link target="_blank" :underline="false" @click="toTypePage(item.typeId)" class="font"> {{item.value}}</el-link>个、</span>
                 <span v-else>
<!--                   <el-link target="_blank" :underline="false" @click="toTypePage(item.typeId)" class="font"> {{item.name}}</el-link>项目-->
                      <span class="type">{{item.name}}</span>项目
                   <el-link target="_blank" :underline="false" @click="toTypePage(item.typeId)" class="font"> {{item.value}}</el-link>个。</span>
              </span>

            </p>
          </div>
          <el-row >
            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper" >
                <SecretPieChart class="shadow" height="600px"  :secretData="secretData" :otTitle="otTitle" @secToPage="toSecPage"/>
              </div>
            </el-col>


            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper" >
                <TypePieChart class="shadow" height="600px" :typelg="typelg" :typeData="typeData" :otTitle="otTitle" @typeToPage="toTypePage"/>
              </div>
            </el-col>
          </el-row>

        </div>
        <div v-if="active == 'cddw'">
          <div class="context">
            <p>
              {{this.year2}}，<span v-for="(item,index) in axisCenter7Top4" >
              <span v-if="index<axisCenter7Top4.length-1">
                <span>{{item}}、</span></span>
<!--                <el-link target="_blank" :underline="false" @click="toyituoUnitPage(item)" class="font">{{item}}</el-link>、</span>-->
              <span v-else>
<!--                <el-link target="_blank" :underline="false" @click="toyituoUnitPage(item)" class="font">{{item}}</el-link>靠前。</span>-->
                  <span>{{item}}。</span></span>
            </span>
              <span v-for="(item,index) in projectCount">
                <span v-if="index<projectCount.length-1">
                  <span>{{item.name}}</span>负责联系
<!--                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.departmentId)" class="font"> {{item.name}}</el-link>负责联系-->
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.departmentId)" class="font">{{item.value}}</el-link>个项目，</span>
                <span v-else>
                  <span>{{item.name}}</span>负责联系
<!--                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.departmentId)" class="font">{{item.name}}</el-link>负责联系-->
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.departmentId)" class="font">{{item.value}}</el-link>个项目。</span>
              </span>
            </p>
          </div>
          <el-row >
            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper">
                <BLYiTuoChart class="shadow" height="500px" :xAxisDataLeft7="xAxisCenter7" :seriesData1="seriesCenter7" :otTitle="otTitle"  @yituoUnitPage="toyituoUnitPage"/>
              </div>
            </el-col>

            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper">
                <pie-chart class="shadow" height="500px" :pieLegend="pieLgData" :pieData="pieData" :otTitle="otTitle" @deptToPage="toDeptPage"/>
              </div>
            </el-col>
          </el-row>

        </div>
        <div v-if="active == 'qtys'">
          <div class="context">
            <p>
              {{this.year2}}，作为项目负责人：
              <span v-for="(item,index) in academicianCount">
                <span v-if="index<academicianCount.length-1">
                  <span>{{item.name}}</span>
<!--                  <el-link target="_blank" :underline="false" @click="toUserNamePage(item.name)" class="font">{{item.name}}</el-link>累计-->
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.name)" class="font">{{item.value}}</el-link>次，经费合计
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.name)" class="font">{{item.money}}</el-link>万元；</span>
                <span v-else>
<!--                  <el-link target="_blank" :underline="false"  @click="toDeptPage(item.name)" class="font">{{item.name}}</el-link>累计-->
                    <span>{{item.name}}</span>
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.name)" class="font">{{item.value}}</el-link>次,经费合计
                  <el-link target="_blank" :underline="false" @click="toDeptPage(item.name)" class="font">{{item.money}}</el-link>万元。</span>
              </span>
              <span v-if="seriesCenter9.length>3"> 参与院士建议上报的院士：
              <span v-for="(item,index) in jyArray" >
                 <span v-if="index<jyArray.length-1">
                   {{item.name}}<el-link target="_blank" @click="toUserPage(item.name)" class="font">{{item.value}}</el-link>次，</span>
                <span v-else>
                    {{item.name}}<el-link target="_blank" @click="toUserPage(item.name)" class="font">{{item.value}}</el-link>次。</span>
              </span>
              </span>
            </p>
          </div>
          <el-row >
            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper">
                <bar-chart3 class="shadow" height="500px" :xAxisDataLeft8="xAxisCenter8" :seriesDataLeft8="seriesCenter8" :otTitle="otTitle" @userNamePage="toUserNamePage"/>
              </div>
            </el-col>
            <el-col :xs="12" :sm="12" :lg="12">
              <div class="chart-wrapper">
                <AdviseNameChart class="shadow" height="500px" :xAxisDataLeft8="xAxisCenter9" :otTitle="otTitle"  :seriesDataLeft8="seriesCenter9"/>
              </div>
            </el-col>

          </el-row>
        </div>
        <div v-if="active == 'yjrd'">
          <div class="context">
            <p>{{this.year2}}，咨询项目研究热点领域包括：
              <span v-for="(item,index) in imKeyData2">
                 <span v-if="index<imKeyData2.length-1">
                   <el-link target="_blank" :underline="false" @click="toCirclePage(item.name)" class="font">{{item.name}}</el-link>、</span>
                <span v-else>
                  <el-link target="_blank" :underline="false" @click="toCirclePage(item.name)" class="font">{{item.name}}</el-link>等。</span>
              </span></p>
          </div>
          <el-row >
            <el-col :xs="12" :sm="12" :lg="24">
              <div class="chart-wrapper">
                <circle-chart2 class="shadow" height="500px"  :chartData="imKeyData" :otTitle="otTitle" @circlePage="toCirclePage"/>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>

      <div class="textR">
        <el-button type="primary" v-if="active != 'ztgk'" @click="back()"
        >上一页</el-button
        >
        <el-button type="primary" v-if="active != 'yjrd'" @click="next()"
        >下一页</el-button
        >
      </div>
    </div>
  </div>
</template>
<script>
  import BarLineChart from "../../dashboard/BarLineChart";
  import DuidieChart from "../../dashboard/DuidieChart";
  import SecretPieChart from "../../dashboard/SecretPieChart";
  import TypePieChart from "../../dashboard/TypePieChart";
  import BLYiTuoChart from "../../dashboard/BLYiTuoChart";
  import PieChart from "../../dashboard/PieChart";
  import BarChart3 from "../..//dashboard/BarChart3";
  import AdviseNameChart from "../../dashboard/AdviseNameChart";
  import CircleChart2 from "../../dashboard/CircleChart2";
  import { left1Data,center5Data,center2Data,right3Data,left4Data,
    right6Data,left7Data,center8Data,statistics,countProject,left1Data2} from "@/api/project/info3";
  import { shituData2 ,shituData8} from "@/api/project/instruction";
  import Utils from "@/utils/utils";
  import {mapMutations} from 'vuex';

  export default {
    name: "index",
    components: {
      BarLineChart,
      DuidieChart,
      SecretPieChart,
      TypePieChart,
      BLYiTuoChart,
      PieChart,
      BarChart3,
      AdviseNameChart,
      CircleChart2
    },
    props: {},
    data() {
      return {
        active: "ztgk",
        year: "999",
        year2:'2016年至今',
        yearRadio2:"999",
        apprpval:'',
        instructions:'',
        proposal:'',
        report:'',
        zjf:'',
        blTitle:"",
        blX:[],
        blLg:[],
        blSer:[],
        ddX:[],
        ddLg:[],
        ddSer:[],
        secretData:[],
        otTitle:"",
        typelg:[],
        typeData:[],
        xAxisCenter7:[],
        axisCenter7Top4:[],
        projectCount:[],
        seriesCenter7:[],
        pieData:[],
        pieLgData:[],
        xAxisCenter8:[],
        seriesCenter8:[],
        xAxisCenter9:[],
        seriesCenter9:[],
        imKeyData:[],
        imKeyData2:[],
        jyArray:[],
        leftMenu: [
          {
            type: "ztgk",
            name: "总体概况",
          },
          {
            type: "xmfl",
            name: "项目分类",
          },
          {
            type: "cddw",
            name: "承担单位",
          },
          {
            type: "qtys",
            name: "牵头院士",
          },
          {
            type: "yjrd",
            name: "研究热点",
          },
        ],
        yearArr: [],
        countProject:{},
        academicianCount:[],
      };
    },
    created() {
      this.yearArr = [];
      this.yearArr.push({ name: "2016年-今", value: "999" });
      const year = new Date().getFullYear();
      for (let i = 0; i < 6; i++) {
        this.yearArr.push({ name: year - i, value: year - i });
      }
      let param = {
        yearRadio2:999
      };
      this.yearArr.push({ name: "2016年以前", value: "2015" });
      this.getLeft1(param);
      this.getRight1();
      this.getLeft2(param);
      this.getRight2(param);
      this.getLeft3(param);
      this.getRight3(param);
      this.getLeft4(param);
      this.getRight4(param);
      this.getLeft5(param);
      this.getStatistics(param);
      //  this.getProjectCount()
      this.getLeft7()
    },
    mounted() {},
    methods: {
      ...mapMutations(['changeTitle']),
      plan(title){
        Utils.$emit('demo',title);//msg为传递参数，后面可以紧跟多个参数

      },
      search(y) {
        this.year2=y.name
        this.year= y.value;
        this.yearRadio2 = y.value;
        let param = {
          yearRadio2:y.value
        };
        this.getLeft1(param);
        this.getRight1();
        this.getLeft2(param);
        this.getRight2(param);
        this.getLeft3(param);
        this.getRight3(param);
        this.getLeft4(param);
        this.getRight4(param);
        this.getLeft5(param);
        this.getStatistics(param);
        this.getLeft7(param);
      },
      getStatistics(queryParams){

        statistics(queryParams).then(resp=>{
          this.apprpval=resp.data.apprpval;
          this.zjf=resp.data.zjf;
          this.report=resp.data.report;
          this.proposal=resp.data.proposal;
          this.instructions=resp.data.instructions;
        });
      },
      getLeft1(queryParams){
        left7Data(queryParams).then(
          resp => {
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }

            let temp = [];
            let item = {};
            item.name = '经费数';
            item.type='bar';
            item.barGap="-100%";
            item.data=resp.data.yjfArray;
            temp.push(item);
            let item1 = {};
            item1.name = '实际经费';
            item1.type='bar';
            item1.yAxisIndex= 1;
            item1.barGap="-100%";
            item1.data=resp.data.ySjjfArray;
            temp.push(item1);
            let item2 = {};
            item2.name = '项目数';
            item2.type='line';
            item2.yAxisIndex= 2;
            item2.data=resp.data.yNumArray;
            temp.push(item2);
            this.seriesCenter7 = temp;
            this.xAxisCenter7 = resp.data.xAxisArray;

            this.axisCenter7Top4=this.xAxisCenter7.length>4?this.xAxisCenter7.slice(0,4):this.xAxisCenter7


          }
        );
      },
      getRight1(param){
        shituData2(param).then(rsp => {
          this.ddX = rsp.data.yearArray;
          this.ddLg =  ['有批示', '无批示'];
          let temp = [];
          let item = {};
          item.name = '有批示';
          item.type = 'bar';
          item.stack= 'one';
          item.barWidth= "50%";
          item.data = rsp.data.youArray;
          item.itemStyle={
            normal: {
              //这里是重点
              color: 'rgb(21,112,198)'
            }

          };
          temp.push(item);
          let item2 = {};
          item2.name = '无批示';
          item2.type = 'bar';
          item2.stack= 'one';
          item2.barWidth= "50%";
          item2.data = rsp.data.wuArray;
          item2.itemStyle={
            normal: {
              //这里是重点
              color: 'rgb(222,177,62)'
            }

          };
          temp.push(item2);
          this.ddSer = temp
        });
      },
      getLeft2(queryParams){
        center2Data(queryParams).then(
          resp=>{
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            this.secretData = resp.data.secretData;
            // this.secretData.forEach(item=>{
            //   if (item.name=='机密'){
            //     item.itemStyle= {
            //       color: "#e8240e"
            //     };
            //   }else if (item.name=='秘密'){
            //     item.itemStyle={
            //       color: "#ff604e"
            //     }
            //   }else if (item.name=='内部'){
            //     item.itemStyle={
            //       color: "#2250bb"
            //     }
            //   }else if (item.name=='非密'){
            //     item.itemStyle={
            //       color:"#0095ff"
            //     }
            //   }
            // })
            this.countProject=this.secretData;
            if (this.countProject.length>0){
              this.countProject.forEach(item =>{
                const secName = item.name;
                let secLevel = "";
                if(secName){
                  switch (secName) {
                    case "机密":
                      secLevel = "1";
                      break;
                    case "秘密":
                      secLevel = "2";
                      break;
                    case "内部":
                      secLevel = "4";
                      break;
                    case "非密":
                      secLevel = "3";
                      break;
                  }
                }
                item.secLevel=secLevel;
              })
            }
          }
        );
      },
      getRight2(queryParams){
        right3Data(queryParams).then(
          resp=>{
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            this.typelg = resp.data.legendData;
            this.typeData=resp.data.pieData;
            if (this.typeData.length>0){
              this.typeData.forEach(item=>{
                const typeName = item.name;
                let typeId = "";
                if(typeName){
                  switch (typeName) {
                    case "重大":
                      typeId = "1";
                      break;
                    case "重点":
                      typeId = "2";
                      break;
                    case "学部重大":
                      typeId = "17";
                      break;
                    case "学部重点":
                      typeId = "19";
                      break;
                    case "高端智库":
                      typeId = "6";
                      break;
                    case "行业院重点":
                      typeId = "16";
                      break;
                    case "行业院重大":
                      typeId = "18";
                      break;
                    case "其他":
                      typeId = "999";
                      break;
                  }
                }
                item.typeId=typeId;

              })

            }



          }
        );
      },
      getLeft3(queryParams){
        left7Data(queryParams).then(
          resp => {
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }

            let temp = [];
            let item = {};
            item.name = '经费数';
            item.type='bar';
            item.barGap="-100%";
            item.data=resp.data.yjfArray;
            item.itemStyle={
              normal: {
                //这里是重点
                color: 'rgb(129,162,255)'
              }

            };
            temp.push(item);
            let item1 = {};
            item1.name = '实际经费';
            item1.type='bar';
            item1.yAxisIndex= 1;
            item1.barGap="-100%";
            item1.data=resp.data.ySjjfArray;
            item1.itemStyle={
              normal: {
                //这里是重点
                color: 'rgb(84,111,198)'
              }

            };
            temp.push(item1);
            let item2 = {};
            item2.name = '项目数';
            item2.type='line';
            item2.yAxisIndex= 2;
            item2.data=resp.data.yNumArray;
            item2.itemStyle={
              normal: {
                //这里是重点
                color: 'rgb(222,177,62)'
              }

            };
            temp.push(item2);
            this.seriesCenter7 = temp;
            this.xAxisCenter7 = resp.data.xAxisArray;

          }
        );
      },
      getRight3(queryParams){
        left4Data(queryParams).then(
          resp=>{
            this.projectCount=[];
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            this.pieLgData = resp.data.legendData;
            this.pieData=resp.data.pieData;
            this.pieData.forEach(item=>{
              const deptName = item.name;
              let itemStyle = "";
              if(deptName){
                switch (deptName) {
                  case "机械与运载工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(89,98,255)'
                      }

                    };
                    break;
                  case "信息与电子工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(44,56,254)'
                      }

                    };
                    break;
                  case "化工、冶金与材料工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(255,199,0)'
                      }

                    };
                    break;
                  case "能源与矿业工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(248,98,47)'
                      }

                    };
                    break;
                  case "土木、水利与建筑工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(210,219,244)'
                      }

                    };
                    break;
                  case "环境与轻纺工程学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(0,0,128)'
                      }

                    };
                    break;
                  case "农业学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(222,177,62)'
                      }

                    };
                    break;
                  case "医药卫生学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(0,0,255)'
                      }

                    };
                    break;
                  case "工程管理学部":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(222,177,62)'
                      }

                    };
                    break;
                  case "中国工程院战略咨询中心":
                    itemStyle = {
                      normal: {
                        //这里是重点
                        color: 'rgb(90,131,255)'
                      }

                    };
                    break;
                }
              }
              item.itemStyle=itemStyle;
              item.label={color:"#000"}
            })
            this.projectCount=this.pieData.length>2?this.pieData.slice(0,2):this.pieData;

            if (this.projectCount.length>0){
              this.projectCount.forEach(item=>{
                const deptName = item.name;
                let departmentId = "";
                if(deptName){
                  switch (deptName) {
                    case "机械与运载工程学部":
                      departmentId = "25";
                      break;
                    case "信息与电子工程学部":
                      departmentId = "26";
                      break;
                    case "化工、冶金与材料工程学部":
                      departmentId = "27";
                      break;
                    case "能源与矿业工程学部":
                      departmentId = "28";
                      break;
                    case "土木、水利与建筑工程学部":
                      departmentId = "29";
                      break;
                    case "环境与轻纺工程学部":
                      departmentId = "30";
                      break;
                    case "农业学部":
                      departmentId = "31";
                      break;
                    case "医药卫生学部":
                      departmentId = "32";
                      break;
                    case "工程管理学部":
                      departmentId = "33";
                      break;
                  }
                }

                item.departmentId=departmentId;
              })
            }

          }
        );
      },
      getLeft4(queryParams){
        center8Data(queryParams).then(
          resp => {
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            this.seriesCenter8 = resp.data.xAxisArray;
            this.xAxisCenter8 = resp.data.yAxisArray;
            this.seriesCenter8.forEach(item=>{

            })
            let jjfeiArray=resp.data.jinfeiArray;
            this.academicianCount=[];
            for (let i = this.xAxisCenter8.length-1; i >=0 ; i--) {
              if (i>=this.xAxisCenter8.length-3){
                let obj={}
                obj.name=this.xAxisCenter8[i];
                obj.value=this.seriesCenter8[i];
                obj.money=jjfeiArray[i];
                this.academicianCount.push(obj)
              }
            }
          }
        );
      },
      getRight4(queryParams){
        shituData8(queryParams).then(
          resp => {
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            this.seriesCenter9 = resp.data.xAxisArray;
            this.xAxisCenter9 = resp.data.yAxisArray;


            this.jyArray=[{
              name:this.xAxisCenter9[this.xAxisCenter9.length-1],
              value:this.seriesCenter9[this.seriesCenter9.length-1]
            },
              {
                name:this.xAxisCenter9[this.xAxisCenter9.length-2],
                value:this.seriesCenter9[this.seriesCenter9.length-2]
              },

              {
                name:this.xAxisCenter9[this.xAxisCenter9.length-3],
                value:this.seriesCenter9[this.seriesCenter9.length-3]
              }
            ]

          }
        );
      },
      getLeft5(queryParams){
        var colorList = [[
          '#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed',
          '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0',
          '#1e90ff', '#ff6347', '#7b68ee', '#d0648a', '#ffd700',
          '#6b8e23', '#4ea397', '#3cb371', '#b8860b', '#7bd9a5'
        ],
          [
            '#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed',
            '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0',
            '#1e90ff', '#ff6347', '#7b68ee', '#00fa9a', '#ffd700',
            '#6b8e23', '#ff00ff', '#3cb371', '#b8860b', '#30e0e0'
          ],
          [
            '#929fff', '#9de0ff', '#ffa897', '#af87fe', '#7dc3fe',
            '#bb60b2', '#433e7c', '#f47a75', '#009db2', '#024b51',
            '#0780cf', '#765005', '#e75840', '#26ccd8', '#3685fe',
            '#9977ef', '#f5616f', '#f7b13f', '#f9e264', '#50c48f'
          ]][2];
        right6Data(queryParams).then(
          resp=>{
            if(this.yearRadio2 =='2015'){
              this.otTitle="2016年以前"
            }else if(this.yearRadio2 =='999'){
              this.otTitle="2016-今"
            }else{
              this.otTitle=this.yearRadio2 +"年"
            }
            const serData = resp.data.serData;
            let data = [];
            serData.forEach(s=>{
              let obj = {
                name:s[2],
                value:s[1],
                symbolSize:(s[1]+60),
                draggable:true,
                itemStyle: {
                  normal: {
                    shadowBlur: 100,
                    shadowColor: colorList[s[0]],
                    color: colorList[s[0]]
                  }
                }
              };
              data.push(obj)
            });
            this.imKeyData=data
            this.imKeyData2=this.imKeyData.length>3?this.imKeyData.slice(0,3):this.imKeyData;
          }
        );
      },
      getLeft7(queryParams){
        left1Data(queryParams).then(
          resp=>{
            if(this.yearRadio2 =='2015'){
              this.blTitle="2016年以前"
            }else{
              this.blTitle="2016-今"
            }

            this.blLg = ['项目数', '经费数'];
            this.blX =resp.data.yearArray;
            let temp = [];
            let item = {};
            item.name = '项目数';
            item.type='bar';
            item.barWidth=50;
            item.data=resp.data.numArray;
            item.itemStyle={
              normal: {
                //这里是重点
                color: 'rgb(21,112,198)'
              }

            };
            temp.push(item);
            let item1 = {};
            item1.name = '经费数';
            item1.type='line';
            item1.yAxisIndex= 1;
            item1.data=resp.data.bugetArray;
            item1.itemStyle={
              normal: {
                //这里是重点
                color: 'rgb(222,177,62)'
              }

            };
            temp.push(item1);
            this.blSer=temp;
            // console.log(this.seriesCenter5)
          }
        );
      },
      next() {
        const temp = this.active;
        const index = this.leftMenu.findIndex((v) => {
          return v.type == temp;
        });
        this.active = this.leftMenu[index + 1].type;
      },
      back() {
        const temp = this.active;
        const index = this.leftMenu.findIndex((v) => {
          return v.type == temp;
        });
        this.active = this.leftMenu[index - 1].type;
      },
      getProjectCount(queryParams){
        countProject(queryParams).then(rsp=>{
          this.countProject=rsp.data

        })
      },
      searchToPage(){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.yearRadio2;
        this.$router.push({path:"/project/infoShow/query",query:{yearRadio2:yearRadio}} );
      },
      toYearPage(year){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        this.$router.push({path:"/project/infoShow/query",query:{yearRadio2:year}} );
      },
      toSecPage(secLevel){
        this.plan('咨询项目')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/query",query:{secrecyLevel:secLevel,yearRadio2:yearRadio}} );
      },
      toTypePage(type){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/query",query:{type:type,yearRadio2:yearRadio}} );
      },
      toDeptPage(departmentId){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.yearRadio2;
        this.$router.push({path:"/project/infoShow/query",query:{departmentId:departmentId,yearRadio2:yearRadio}} );
      },
      toyituoUnitPage(unit){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/query",query:{yituoUnit:unit,yearRadio2:yearRadio}} );

      },
      toUserNamePage(userName){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/query",query:{userName:userName,yearRadio2:yearRadio}} );

      },
      toCirclePage(importKey){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.yearRadio2;
        this.$router.push({path:"/project/infoShow/query",query:{importantKey:importKey,yearRadio2:yearRadio}} );

      },
      toMapPage(area){
        this.plan('咨询项目')
        this.changeTitle('zxxm')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/query",query:{yituoArea:area,yearRadio2:yearRadio}} );

      },
      toStatusPage(year){
        this.changeTitle('ysjj')
        this.plan('院士建议')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/adviseList",query:{yearRadio2:year}} );

      },
      toUserPage(name){
        this.plan('院士建议')
        this.changeTitle('ysjj')
        let yearRadio = this.year;
        this.$router.push({path:"/project/infoShow/adviseList",query:{userName:name}} );

      },
    },
    computed: {},
    watch: {},
  };
</script>

<style scoped lang="scss">
  .flex /deep/ {
    display: flex;
   // align-items: center;
    justify-content: center;
    background-color: rgb(243,247,248);
    padding: 30px 30px 30px 30px;
    overflow: hidden;
    .el-button {
      font-size: 18px;
    }
  }
  .flex1 {
    flex: 1;
  }
  .textR {
    text-align: right;
  }
  .left {
   // border: 1px red solid;
    background-color: rgb(254,254,254);

    min-width: 250px;
    height: 350px;
    font-size: 20px;
    font-weight: 700;
    .menu {
      padding: 0 0 0 0;
      background-color: rgb(254,254,254);
      line-height: 70px;
      .img {
        margin-right: 10px;
        margin-top: 10px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        padding: 14px;
        background-color: rgb(124, 115, 115);
        line-height: 37px;
        box-sizing: border-box;
        .imgbgc {
          width: 100%;
          height: 100%;
        }
        .ztgk{
          background-image: url('../../../assets/image/ztgk.png') ;
          background-size: cover;
          margin: auto;
        }
        .xmfl{
          background-image: url('../../../assets/image/xmfl.png') ;
          background-size: cover;
          margin: auto;
        }
        .cddw{
          background-image: url('../../../assets/image/cddw.png') ;
          background-size: cover;
          margin: auto;
        }
        .qtys{
          background-image: url('../../../assets/image/qtys.png') ;
          background-size: cover;
          margin: auto;
        }
        .yjrd{
          background-image: url('../../../assets/image/yjrd.png') ;
          background-size: cover;
          margin: auto;
        }
      }
    }
    .active {
      background-color: rgba(24, 97, 233, 0.781);
    }
  }
  .right {

    background-color: rgb(254,254,254);
    margin-left: 30px;
    padding: 20px 40px;
    box-sizing: border-box;

    /*overflow-x: hidden;*/
    /*overflow-y: scroll;*/
    .content2 {
      /*border: 0.2px black solid;*/
      width: 1500px;
      height: calc(100vh - 220px);
      background-color: rgb(255,255,255);
      /*overflow-y: auto;*/
      .context{

        margin-top: 20px;
        /*height: 130px;*/
        padding: 18px;
       // border: 0.2px black solid;
        /*box-shadow: 0px 0px 1px #9521de;*/
        /*//box-shadow: 0px 0px 1px #9521de;*/
        /*background-color: rgb(250,254,255);*/
        background: rgb(250,254,255);

        p {

 //         border: 1px solid red;
          margin-top: 10px;
          font-size: 30px;
          font-weight: 700;
          .el-link.el-link--default {
            color: #e6a700;
          }
        }
      }
      .chart-wrapper{
        /*border: 0.2px black solid;*/
        margin-top: 30px;
      }

    }
    .font{

      font-size: 34px;
      font-weight: 700;
    }
    .type{
      font-size: 30px;
      font-weight: 700;
      border-bottom:4px solid black;
      letter-spacing:2px
    }
  }
  .shadow{
    -webkit-box-shadow:0px 0px 20px 0 rgb(248,237,253);
    -moz-box-shadow:0px 0px 20px 0 rgb(248,237,253);
    box-shadow:0px 0px 20px 0 rgb(248,237,253);
  }
  .el-row {
    background-color: rgb(255,255,255);
  }
</style>
