Newer
Older
smart-economy / src / components / economic / subject / qyzhnh.vue
StephanieGitHub on 26 Jan 2021 29 KB MOD: 更改查询时间为2020年度
<template>
  <div class="full-box ztfx">
    <div class="" style="width: 100%;height:100%;" >
      <div class="top-tip-box t-title">当前位置:专题分析  >  企业综合能耗专题分析</div>
      <div class="ztfx-info-box">
        <div class="left-search-box">
          <div class="lsb-top">数据截止时间:{{$Util.isEmpty(totalData.latestDate)?lastTime:totalData.latestDate}}</div>
          <div class="lsb-search">
            <div class="lsb-search-box">
              <div class="sl-row">
                <div class="sl-row-label">行业</div>
                <el-select v-model="filter.industryCode" clearable placeholder="请选择" @change="industryChange">
                  <el-option label="全部" value=""></el-option>
                  <el-option  v-for="item in locations" :key="item.value" :label="item.name" :value="item.value"></el-option>
                </el-select>
              </div>
              <div class="sl-row">
                <div class="sl-row-label">时间</div>
                <el-date-picker
                  type="month"
                  :picker-options="beginDate(filter.endDate)"
                  v-model="filter.startDate"
                  placeholder="开始日期"
                  value-format="yyyy-MM"
                  style="width:calc(100% - 40px);float: left;">
                </el-date-picker>
              </div>
              <div class="sl-row">
                <div class="sl-row-label">至</div>
                <el-date-picker
                  type="month"
                  :picker-options="processDate(filter.startDate)"
                  v-model="filter.endDate"
                  placeholder="结束日期"
                  value-format="yyyy-MM"
                  style="width:calc(100% - 40px);float: left;">
                </el-date-picker>
              </div>
            </div>
            <div class="lsb-search-border">
              <div class="lsbb-top"></div>
              <div class="lsbb-role"></div>
              <div class="lsbb-bottom"></div>
            </div>
          </div>
          <div class="lsb-info">
            <div class="lsb-title"><span class="dot"></span><span v-if="!$Util.isEmpty(industryName)">{{industryName}} - </span>年度信息汇总</div>
            <div class="item-chart">
                <div class="chart-group">
                  <div class="chart-pie">
                    <div class="pie-box">
                      <div class="circle"><div class="circle2"><div class="circle3">{{totalData.total}}万吨标准煤</div></div></div>
                    </div>
                    <div class="pie-title">累计企业能耗值</div>
                  </div>
                  <div class="chart-pie">
                    <div  class="pie-box">
                      <div class="circle7"><div class="circle8"><div class="circle9">{{totalData.totalTb}}%</div></div></div>
                    </div>
                    <div class="pie-title">同比</div>
                  </div>
                </div>
                <div class="chart-group">
                  <div class="chart-pie">
                    <div class="pie-box">
                      <div class="circle4"><div class="circle5"><div class="circle6">{{totalData.current}}万吨标准煤</div></div></div>
                    </div>
                    <div class="pie-title">当月企业能耗值</div>
                  </div>
                  <div class="chart-pie">
                    <div class="pie-box">
                      <div class="circle10"><div class="circle11"><div class="circle12">{{totalData.currentTb}}%</div></div></div>
                    </div>
                    <div class="pie-title">同比</div>
                  </div>
                </div>
              </div>
          </div>
        </div>
        <div class="right-info-box">
          <div class="right-left-border">
            <div class="rlb-top"></div>
            <div class="rlb-role"></div>
            <div class="rlb-bottom"></div>
          </div>
          <div class="ri-box">
            <div class="ztfx-charts-box"  style="width: 100%;height: 100%;">
              <div class="ztfx-chart-item">
                <div class="roles-one"></div><div class="roles-two"></div>
                <div class="roles-three"></div><div class="roles-four"></div>
                <div class="ztfx-chart-title"><span class="dot"></span>综合能源消费量行业分布</div>
                <div class="ztfx-chart-info" id="chartOne"></div>
              </div>
              <div class="ztfx-chart-item">
                <div class="roles-one"></div><div class="roles-two"></div>
                <div class="roles-three"></div><div class="roles-four"></div>
                <div class="ztfx-chart-title"><span class="dot"></span>产值单耗行业分布</div>
                <div class="ztfx-chart-info" id="chartTwo"></div>
              </div>
              <div class="ztfx-chart-item">
                <div class="roles-one"></div><div class="roles-two"></div>
                <div class="roles-three"></div><div class="roles-four"></div>
                <div class="ztfx-chart-title"><span class="dot"></span>重点用能企业</div>
                <div class="more-table-detail" @click="moreDataClick('用能')">更多>></div>
                <div class="ztfx-chart-info result-table">
                  <div class="table-container-style" >
                    <el-table :data="tableListData.yn" :height="200">
                      <el-table-column type="index" align="center" label="排名" width="80"  v-if="false"></el-table-column>
                      <el-table-column align="center" label="企业名称" >
                        <template  slot-scope="scope">
                          <el-tooltip class="item" effect="dark" :content="scope.row.companyName" placement="left">
                            <div class="ellipsis" style="width:100%;cursor: pointer;">{{scope.row.companyName}}</div>
                          </el-tooltip>
                        </template>
                      </el-table-column>
                      <el-table-column prop="totalBy" align="center" label="能耗(吨标准煤)"></el-table-column>
                      <el-table-column prop="czby" align="center" label="产值(亿元)"></el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>
              <div class="ztfx-chart-item" style='position: relative'>
                <div class="roles-one"></div><div class="roles-two"></div>
                <div class="roles-three"></div><div class="roles-four"></div>
                <div class="ztfx-chart-title"><span class="dot"></span>重点{{typeValue}}企业</div>
                <el-select v-model="typeValue" placeholder="请选择"  class="more-data more-select" @change="ydTypeChange">
                  <el-option v-for="item in typeList" :key="item" :label="item" :value="item"> </el-option>
                </el-select>
                <div class="more-table-detail" @click="moreDataClick(typeValue)">更多>></div>
                <div class="ztfx-chart-info result-table">
                  <div class="table-container-style" >
                    <el-table :data="tableListData.yq" :height="200">
                      <el-table-column type="index" align="center" label="排名" width="80" v-if="false"></el-table-column>
                      <el-table-column align="center" label="企业名称" >
                        <template  slot-scope="scope">
                          <el-tooltip class="item" effect="dark" :content="scope.row.companyName" placement="left">
                            <div class="ellipsis" style="width:100%;cursor: pointer;" @click="jumpToDetail(scope.row)">{{scope.row.companyName}}</div>
                          </el-tooltip>
                        </template>
                      </el-table-column>
                      <el-table-column prop="totalBy" align="center" :label="unit" ></el-table-column>
                      <el-table-column prop="dataTime" align="center" label="时间"  v-if="typeValue == '用气'||typeValue == '用水'"></el-table-column>
                    </el-table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--pop列表   :title="'规上工业'+typeName+'排名'"-->
    <el-dialog :title="'重点'+popTypeValue+'企业'" :visible.sync="dialogVisible" width="800px" :close-on-click-modal=false top="40px">
      <span style="color: #fff;">类型:</span>
      <el-select v-model="popTypeValue" placeholder="请选择"  style="margin-bottom: 10px" class="more-data more-select" @change="ydTypeChangePop">
        <el-option v-for="item in typeListPop" :key="item" :label="item" :value="item"> </el-option>
      </el-select>
      <el-table :data="moreData.list" highlight-current-row style="width: 100%">
        <el-table-column type="index" align="center" label="排名" width="80"  v-if="false"></el-table-column>
        <el-table-column align="center" label="企业名称" >
          <template  slot-scope="scope">
            <el-tooltip class="item" effect="dark" :content="scope.row.companyName" placement="top">
              <div class="ellipsis" style="width:100%;cursor: pointer;">{{scope.row.companyName}}</div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column prop="totalBy" align="center" :label="unitPop"></el-table-column>
        <el-table-column prop="czby" align="center" label="产值(亿元)" v-if="popTypeValue == '用能'"></el-table-column>
        <el-table-column prop="dataTime" align="center" label="时间"  v-if="popTypeValue == '用气'||popTypeValue == '用水'"></el-table-column>
      </el-table>
      <el-pagination @current-change="morePageChange" background layout="prev, pager, next" :page-size="moreData.pageSize" :current-page="moreData.pageNum" :total="moreData.total" style="text-align: right;"></el-pagination>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false;moreData.pageNum=1">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  const currentDate = new Date('2020/12/31') // 当前日期
  const month = currentDate.getMonth()+1; // 月份
  const year = month<10?currentDate.getFullYear()+"-0"+month :currentDate.getFullYear()+"-"+month;
  const startDate = currentDate.format("yyyy-")+"01"
  const endDate = currentDate.format("yyyy-MM")
  export default {
    name: 'jjyx',
    data () {
      return {
        showCondition:false,
        year:currentDate.format("yyyy"),
        lastTime:endDate,
        locations:[],industryName:'',
        filter:{
          industryCode:'',
          startDate: startDate,
          endDate:endDate
        },
        typeValue:'用气',
        unit:'用气量(万方)',
        typeList:['用水','用电','用气'],
        tableListData:{yn:[],yd:[],yq:[],ys:[]},
        chartTable:[],
        totalData:{current:0, currentTb: 0, total: 0,latestDate:'',totalTb:0},
        defaultOp:{
          title: { show: false },
          legend:{show:false,height:"0"},
          grid:{top:30,bottom:30},
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'cross',
              label: {
                backgroundColor: '#777'
              },
              crossStyle: {
                color: 'rgba(255,255,255,.8)',
              }
            }
          },
          xAxis: {
            axisLabel:{color:'rgba(255,255,255,.9)'/*,interval:0*/},
            axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}},
            splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}}
          }
        },
        chartsTitle:{left:'',right:'同比'},
        dialogVisible:false,
        moreData:{list:[], pageNum:1, pageSize:10, total:0},
        popTypeValue:'用电',
        typeListPop:['用水','用电','用能','用气'],
        unitPop:'用电量(万千瓦时)',
        showLast:false,showLastPop:false
      }
    },
    mounted (){
      this.GLOBAL.app.getDictList(resp => {
        this.locations = resp["行业列表"];
      })
      this.getTotal();
      this.loadTabCharts();
    },
    watch:{
      "filter.startDate":function(){
        let vm = this
        vm.loadTabCharts()
      },
      "filter.endDate":function(){
        let vm = this
        vm.loadTabCharts()
      },
      "filter.industryCode":function(){
        let vm = this
        vm.loadTabCharts()
      },
    },
    methods:{
      initChartsByType (type){
        let vm = this
        vm.filter.type = type
      },
      industryChange(val){
        let obj = {};
        obj = this.locations.find((item)=>{
          return item.value === val;
        });
        this.industryName = this.$Util.isEmpty(obj) ? '' : obj.name;
      },
      searchResult(){
        let _this = this
        _this.showCondition = false;
        _this.loadTabCharts();
      },
      getTotal(){
        let vm = this;
        vm.$http.get('/dx-economy-api/subject/zhnh/total',{params:{year:vm.year,industryCode:vm.filter.industryCode}}).then(function (resp) {
          let _data = resp.data;
          if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
            vm.totalData = _data.data;
          }
        })
      },
      loadTabCharts(){
        let vm = this;
        /*vm.chartsTitle.left='消费量(吨标准煤)、工业总产值(万元)'
        vm.drawLineOne('chartOne',['投产运营','工业企业','规上工业','上市公司','高新技术'],[12,334,344,333,787],[122,223,440,22,678],[2,22,34,45,88]);
        vm.chartsTitle.left='吨标准煤/万元'
        vm.drawLineOne('chartTwo',['投产运营','工业企业','规上工业','上市公司','高新技术'],[12,334,344,333,787],[122,223,440,22,678],[2,22,34,45,88]);*/
        let timeStart = !vm.$Util.isEmpty(vm.filter.startDate) ? vm.filter.startDate.split("-")[0] : null,
          timeEnd = !vm.$Util.isEmpty(vm.filter.endDate) ? vm.filter.endDate.split("-")[0] : null;
        if(timeStart == null || timeEnd== null || timeStart > timeEnd || timeStart <timeEnd){
          let dataText = timeStart == null ? '请选择开始时间':timeEnd ==null ? '请选择结算时间':'支持查询同一年数据,请选择起止时间为同一年后查询!';
          vm.$message({ type: 'warning',showClose: true, message:dataText });
          return;
        }
        vm.getTotal();
        vm.getOneData();
        vm.getTwoData();
        vm.getYdListData();
        vm.getYnListData();
      },
      getOneData(){
        let vm = this;
        vm.$http.get('/dx-economy-api/subject/zhnh/zhnyxf',{params:vm.filter}).then(function (resp) {
          let _data = resp.data;
          if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
            let t = resp.data.data
            vm.chartsTitle.right = '同比'
            vm.chartsTitle.left = '消费量(吨标准煤)、工业总产值(亿元)'
            vm.drawLineOne('chartOne', t.xAxis, t.value, t.value2, [0, 0, -5, 120]);
          }
        })
      },
      getTwoData(){
        let vm = this;
        vm.$http.get('/dx-economy-api/subject/zhnh/czdh',{params:vm.filter}).then(function (resp) {
          let _data = resp.data;
          if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
            let t = resp.data.data
            vm.chartsTitle.right = '同比';
            vm.chartsTitle.left = '吨标准煤/万元'
            vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2, [0, 0, -5, 30]);
          }
        })
      },
      getYdListData(){
        let vm = this;
        vm.$http.get('/dx-economy-api/subject/zhnh/powerList',{params:$.extend({pageNum:1,pageSize:5},vm.filter)}).then(function (resp) {
          let _data = resp.data;
          if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
            let t = resp.data.data
            vm.tableListData.yn = t.list;
          }
        })
      },
      ydTypeChange(type){
        let vm = this;
        vm.unit = type == '用水'?'用水量(吨)' : type == '用电'? '用电量(万千瓦时)':type == '用气'? '用气量(万方)':'';
        this.getYnListData();
      },
      ydTypeChangePop(type){
        let vm = this;
        vm.unitPop = type == '用水'?'用水量(吨)' : type == '用电'? '用电量(万千瓦时)':type == '用能'?'能耗(吨标准煤) ':type == '用气'? '用气量(万方)':'';
        vm.showLastPop =  type == '用能'?true:false;
        this.getMoreTableData(1);
      },
      getYnListData(){
        let vm = this;
        if (vm.typeValue =='用水') {
          vm.$http.get('/dx-economy-api/zhnhCharts/water/list', {params: $.extend({ pageNum: 1,pageSize: 5}, vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if (_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              vm.tableListData.yq = _data.data.list;
            }
          })
        }else if (vm.typeValue =='用气') {
          vm.$http.get('/dx-economy-api/energy/gas/page', {params: $.extend({ pageNum: 1,pageSize: 5}, vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if (_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              vm.tableListData.yq = _data.data.list;
            }
          })
        }else if (vm.typeValue =='用电') {
          vm.$http.get('/dx-economy-api/subject/zhnh/powerList', {params: $.extend({ pageNum: 1,pageSize: 5}, vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if (_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              vm.tableListData.yq = _data.data.list;
            }
          })
        }
      },
      jumpToDetail(){},
      /*pop-table*/
      moreDataClick(type){
        this.popTypeValue = type;
        this.dialogVisible = true
        this.unitPop = type == '用水'?'用水量(吨)' : type == '用电'? '用电量(万千瓦时)':type == '用能'?'能耗(吨标准煤) ':type == '用气'? '用气量(万方)':'';
        this.getMoreTableData(1)
      },
      getMoreTableData(pageNum){
        let vm = this;
        let pageNums = vm.$Util.isEmpty(pageNum) ? vm.moreData.pageNum : pageNum;
        console.log(vm.popTypeValue)
        if (vm.popTypeValue =='用能'){
          vm.$http.get('/dx-economy-api/subject/zhnh/energyList',{params:$.extend({pageNum:pageNums,pageSize:10},vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              let temp = _data.data;
              vm.moreData.list = temp.list;
              vm.moreData.pageNum = temp.pageNum;
              vm.moreData.total = temp.total;
            }
          })
        }else if (vm.popTypeValue =='用电'){
          vm.$http.get('/dx-economy-api/subject/zhnh/powerList',{params:$.extend({pageNum:pageNums,pageSize:10},vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              let temp = _data.data;
              vm.moreData.list = temp.list;
              vm.moreData.pageNum = temp.pageNum;
              vm.moreData.total = temp.total;
            }
          })
        }else if (vm.popTypeValue =='用气'){
          vm.$http.get('/dx-economy-api/energy/gas/page',{params:$.extend({pageNum:pageNums,pageSize:10},vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              let temp = _data.data;
              vm.moreData.list = temp.list;
              vm.moreData.pageNum = temp.pageNum;
              vm.moreData.total = temp.total;
            }
          })
        }else if (vm.popTypeValue =='用水'){
          vm.$http.get('/dx-economy-api/zhnhCharts/water/list',{params:$.extend({pageNum:pageNums,pageSize:10},vm.filter)}).then(function (resp) {
            let _data = resp.data;
            if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) {
              let temp = _data.data;
              vm.moreData.list = temp.list;
              vm.moreData.pageNum = temp.pageNum;
              vm.moreData.total = temp.total;
            }
          })
        }
      },
      morePageChange(currentPage){
        this.getMoreTableData(currentPage)
      },
      /*pop-table -- end*/
      /**/
      drawLine(container,cate,d1,d2,d3){
        let vm = this
        let myChart = vm.$echarts.init(document.getElementById(container))
        let op = {
          xAxis: {
            type:"category",
            data: cate,
            axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}
          },
          yAxis:[
            {
              type: 'value',
              name:'工业产值(万元)',
              minInterval: 10,
              nameTextStyle:{color:'rgba(255,255,255,.8)'},
              axisLabel:{
                color:'rgba(255,255,255,.8)',
                formatter: function (value) {
                  let texts = [];
                  if(value<1000){
                    texts.push(value)
                  }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){
                    texts.push(Math.ceil(value/1000) + "千")
                  }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){
                    texts.push(Math.ceil(value/10000) + "万")
                  }else if(Math.ceil(value/1000000)>=1){
                    texts.push(Math.ceil(value/1000000) + "百万")
                  }
                  return texts
                }},
              axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}},
              splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}}
            },
            {
              type: 'value',
              name: '同比',
              minInterval: 100,
              nameTextStyle:{color:'rgba(255,255,255,.8)'},
              axisLabel:{color:'rgba(255,255,255,.8)'},
              axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}},
              splitLine:{show:false}
            }
          ],
          series: [
            {
            name: '工业产值',
            type: 'bar',
            color:"#6ee988",
            barMaxWidth:'20',
            data: d1,//[100,200,33,56,188,123,143,23,99],//res.zcz
            itemStyle: {
              color: {
                type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
                colorStops: [{
                  offset: 0, color: '#6ee988' // 0% 处的颜色
                }, {
                  offset: 1, color: '#6ee988' // 100% 处的颜色
                }]
              }
            }
          },
            {
              name: '工业产值',
              type: 'bar',
              color:"#16e1ff",
              barMaxWidth:'20',
              data: d2,//[100,200,33,56,188,123,143,23,99],//res.zcz
              itemStyle: {
                color: {
                  type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
                  colorStops: [{
                    offset: 0, color: '#16e1ff' // 0% 处的颜色
                  }, {
                    offset: 1, color: '#16e1ff' // 100% 处的颜色
                  }]
                }
              }
            },
            {
            name: '同比',
            type: 'line',
            yAxisIndex: 1,
            color:"#e0e63d",
            data: d3,//[10,20,30,44,77,55,66,22,100],//res.tb
            areaStyle: {
              color: {
                type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
                colorStops: [{
                  offset: 0, color: '#e0e63d' // 0% 处的颜色
                }, {
                  offset: 1, color: 'rgba(255,255,255,0)' // 100% 处的颜色
                }]
              }
            }
          }]
        }
        myChart.setOption($.extend(true,op,vm.defaultOp));
        if(container == "gytz") {
          myChart.on('click', function (param) {
            let _start = "",_end = "";
            if(!vm.$Util.isEmpty(vm.timeFilter)){
              if(vm.timeFilter.length === 1){
                _start = vm.timeFilter[0];
              }else if(vm.timeFilter.length === 2){
                _start = vm.timeFilter[0];
                _end = vm.timeFilter[1];
              }
            }
            vm.$router.push({name: "gytz", params: {sDate: _start, eDate: _end}})
          })
        }
      },
      drawLineOne(container,cate,d1,d2,padding){
        let vm = this
        let myChart = vm.$echarts.init(document.getElementById(container))
        let op = {
          xAxis: {
            type:"category",
            data: cate,
            axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}
          },
          yAxis:[
            {
              type: 'value',
              name:vm.chartsTitle.left,
              /*minInterval: 10,*/
              nameTextStyle:{color:'rgba(255,255,255,.8)',padding:padding},
              axisLabel:{
                color:'rgba(255,255,255,.8)',
                formatter: function (value) {
                  let texts = [];
                  if(value<1000){
                    texts.push(value)
                  }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){
                    texts.push(Math.ceil(value/1000) + "千")
                  }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){
                    texts.push(Math.ceil(value/10000) + "万")
                  }else if(Math.ceil(value/1000000)>=1){
                    texts.push(Math.ceil(value/1000000) + "百万")
                  }
                  return value
                }},
              axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}},
              splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}}
            },
            {
              type: 'value',
              name: '同比',
              /*minInterval: 10,*/
              nameTextStyle:{color:'rgba(255,255,255,.8)'},
              axisLabel:{color:'rgba(255,255,255,.8)'},
              axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}},
              splitLine:{show:false}
            }
          ],
          series: [
            {
              name: vm.chartsTitle.left,
              type: 'bar',
              color:"#6ee988",
              barMaxWidth:'20',
              data: d1,//[100,200,33,56,188,123,143,23,99],//res.zcz
              itemStyle: {
                color: {
                  type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
                  colorStops: [{
                    offset: 0, color: '#6ee988' // 0% 处的颜色
                  }, {
                    offset: 1, color: '#6ee988' // 100% 处的颜色
                  }]
                }
              }
            },
            {
              name: '同比',
              type: 'line',
              yAxisIndex: 1,
              color:"#e0e63d",
              data: d2,//[10,20,30,44,77,55,66,22,100],//res.tb
              areaStyle: {
                color: {
                  type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
                  colorStops: [{
                    offset: 0, color: '#e0e63d' // 0% 处的颜色
                  }, {
                    offset: 1, color: 'rgba(255,255,255,0)' // 100% 处的颜色
                  }]
                }
              }
            }]
        }
        myChart.setOption($.extend(true,op,vm.defaultOp));
        if(container == "gytz") {
          myChart.on('click', function (param) {
            let _start = "",_end = "";
            if(!vm.$Util.isEmpty(vm.timeFilter)){
              if(vm.timeFilter.length === 1){
                _start = vm.timeFilter[0];
              }else if(vm.timeFilter.length === 2){
                _start = vm.timeFilter[0];
                _end = vm.timeFilter[1];
              }
            }
            vm.$router.push({name: "gytz", params: {sDate: _start, eDate: _end}})
          })
        }
      },
      drawPie(container,data,legend){
        let vm = this
        let myChart = vm.$echarts.init(document.getElementById(container))
        let op = {
          tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
          },
          color:['rgba(22,225,255,1)','rgba(22,225,255,0.4)','rgba(22,225,255,0.2)'],
          legend: {
            type: 'scroll',
            orient: 'vertical',

            x:"left",
            data:[],
            textStyle:{color:"rgba(255,255,255,.8)"}
          },
          series: [
            {
              name:'固定资产投资占比',
              type:'pie',
              radius:['55%', '90%'],
              minAngle: 30,
              center:['50%', '50%'],
              avoidLabelOverlap: false,
              label: {
              },
              data:data
            }
          ]
        }
        myChart.setOption(op)
        /*myChart.on('click', function (param) {
          let _start = "",_end = "";
          if(!vm.$Util.isEmpty(vm.timeFilter)){
            if(vm.timeFilter.length === 1){
              _start = vm.timeFilter[0];
            }else if(vm.timeFilter.length === 2){
              _start = vm.timeFilter[0];
              _end = vm.timeFilter[1];
            }
          }
          vm.$router.push({name:"jjyx",params:{sDate:_start,eDate:_end,bk:'',industry:param.name}})
        })*/
      },
    }
  }
</script>
<style>
  .ztfx-chart-item .more-data.more-select{right:80px;top:10px;width:100px;position:absolute;background:rgba(22,225,255,.25);font-size: 10px;}
  .ztfx-chart-item .more-data.more-select .el-input--suffix .el-input__inner{border: none;background: rgba(7,182,255,0);padding: 0 13px 0 0;height: 20px;line-height: 20px;}
  .ztfx-chart-item .more-data.more-select .el-input__suffix{right:0px}
  .ztfx-chart-item .more-data.more-select.el-select .el-input .el-select__caret{width:13px!important;}
</style>
<style scoped>


</style>