zhangxiaoxu123
2022-09-13 08b5ddfa9a0a2ed52bd7d7b98ca16ef4dcc610a6
src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue
@@ -55,7 +55,7 @@
<script>
import nowSize from "../../../../libs/nowSize";
import {getPersonTable} from '@/api/personnelTalents';
import {getPersonTable, getUnitLine} from '@/api/personnelTalents';
export default {
  name: "PersonnelTalents_UnitPersonnel",
@@ -144,17 +144,17 @@
      checkedCategory: '事业单位',
      CARE_GORY: ['事业单位', '在职人员', '年人均收入'],
      tableHeight: window.innerHeight - nowSize(1000),
      isShow:true,
      echartSeries:{
        jumin:[120, 132, 101, 134, 90, 230],
        chengzhen:[220, 182, 191, 234, 290, 330],
        nongcun:[150, 232, 201, 154, 190, 330]
      isShow: true,
      echartSeries: {},
      selectIndex: {
        type: 1
      }
    }
  },
  mounted() {
    this.Init_echarts()
    this.getPersonTable()
    this.getUnitLine()
  },
  methods: {
    mergeColumnTableCell({rowIndex, columnIndex}) {
@@ -182,7 +182,7 @@
      const option = {
        color: ['#FF5151', '#51FF5D', '#FFD151'],
        title: {
          text: '历年全市居民人均可支配收入分析图',
          text: '近一年事业数量变化趋势图',
          left: 'center',
          top: '5%',
          textStyle: {
@@ -220,7 +220,7 @@
          containLabel: true
        },
        xAxis: {
          name: '单位:年',
          name: '单位:年/月',
          nameTextStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(24)
@@ -228,7 +228,7 @@
          nameGap: nowSize(92),// 坐标轴名称与轴线之间的距离。
          type: 'category',
          boundaryGap: false,// 坐标轴两端留白
          data: ['2017年', '2018年', '2019年', '2020年', '2021年'],
          data: this.echartSeries.years,
          axisLabel: {
            show: true,
            textStyle: {
@@ -248,7 +248,7 @@
          }
        },
        yAxis: {
          name: '单位:年',
          name: '单位:家',
          nameTextStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(24)
@@ -275,19 +275,19 @@
        },
        series: [
          {
            name: '居民人均可支配收入',
            name: '全市',
            type: 'line',
            data: this.echartSeries.jumin
            data: this.echartSeries.quanshi
          },
          {
            name: '城镇居民',
            name: '市直',
            type: 'line',
            data: this.echartSeries.chengzhen
            data: this.echartSeries.shizhi
          },
          {
            name: '农村居民',
            name: '县(市、区)',
            type: 'line',
            data: this.echartSeries.nongcun
            data: this.echartSeries.xian
          }
        ]
      };
@@ -298,21 +298,9 @@
    },
    // 通过点击更换echarts图表信息
    selectEcharts(index) {
      console.log(index);
      switch(index){
        case 0:
          this.isShow = true;
          this.echartSeries = {
            jumin:[120, 132, 101, 134, 90, 230],
            chengzhen:[220, 182, 191, 234, 290, 330],
            nongcun:[150, 232, 201, 154, 190, 330]
          }
          this.Init_echarts()
          break;
        default:
          this.isShow = false;
          break;
      }
      this.selectIndex.type = index + 1
      this.getUnitLine()
      this.Init_echarts()
    },
    // 29. 查询事业单位人员情况表格数据接口
    getPersonTable() {
@@ -321,6 +309,16 @@
          this.tableData = res.list
        }
      })
    },
    // 41.查询事业年度变化情况折线图数据接口
    getUnitLine() {
      getUnitLine(this.selectIndex).then(res => {
        if (res.code === 1000) {
          this.echartSeries = res.obj
          console.log(this.echartSeries);
          this.Init_echarts()
        }
      })
    }
  },
  created() {