付延余
2022-04-27 bc1417d555b6e78627e04b3b854ccacca87eed17
src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue
@@ -2,137 +2,178 @@
  <div class="PersonnelTalents_unitPersonnel--warp">
    <div class="PT_unitPersonnel--table">
      <el-table
        :max-height="tableHeight"
        :data="tableData"
        stripe
        border
        style="width: 100%" :span-method="mergeColumnTableCell">
        <el-table-column
          prop="nianfen"
          prop="jyear"
          label="年份"
          fixed="left">
        </el-table-column>
        <el-table-column
          prop="fanwei"
          prop="scope"
          label="范围">
        </el-table-column>
        <el-table-column
          label="总体情况">
          <el-table-column label="事业单位(家)" prop="shiyedanwei">
          <el-table-column label="事业单位(家)" prop="publicInstitutions">
          </el-table-column>
          <el-table-column label="在职人员(万人)" prop="zaizhirenyuan">
          <el-table-column label="在职人员(万人)" prop="inJobs">
          </el-table-column>
          <el-table-column label="年人均收入(万元)" prop="nianrenjunshouru">
          <el-table-column label="年人均收入(万元)" prop="perIncome">
          </el-table-column>
          <el-table-column label="全省排名" prop="quanshengpaiming">
          <el-table-column label="全省排名" prop="incomeRank">
          </el-table-column>
          <el-table-column label="年人均收入增速" prop="nianrenjunshouruzengsu">
          <el-table-column label="年人均收入增速" prop="incomeSpeed">
          </el-table-column>
        </el-table-column>
        <el-table-column label="其中">
          <el-table-column label="工资性 年人均收入 (万元)" prop="gongzixingnianjunshouru"></el-table-column>
          <el-table-column label="全省排位" prop="quanshengpaiming1"></el-table-column>
          <el-table-column label="各项奖励性和 改革性补贴年 人均收入 (万元)" prop="gexiangjianglixing"></el-table-column>
          <el-table-column label="全省排位" prop="quanshengpaiming2"></el-table-column>
          <el-table-column label="工资性 年人均收入 (万元)" prop="wagesIncome"></el-table-column>
          <el-table-column label="全省排位" prop="wagesRank"></el-table-column>
          <el-table-column label="各项奖励性和 改革性补贴年 人均收入 (万元)" prop="subsidyIncome"></el-table-column>
          <el-table-column label="全省排位" prop="subsidyRank"></el-table-column>
        </el-table-column>
      </el-table>
    </div>
    <!-- 单选框 -->
    <div class="PT_unitPersonnel--echart-box">
      <div class="PT_navEchart--title">
        <el-checkbox v-model="checked">备选项</el-checkbox>
        <el-checkbox v-model="checked">备选项</el-checkbox>
        <el-checkbox v-model="checked">备选项</el-checkbox>
        <el-radio-group v-model="checkedCategory">
          <el-radio v-for="(categoryItem,index) in CARE_GORY" :label="categoryItem" :key="index"
                    @change="selectEcharts(index)">{{ categoryItem }}
          </el-radio>
        </el-radio-group>
      </div>
      <div class="PT_unitPersonnel--Echarts"></div>
    </div>
  </div>
</template>
<script>
import nowSize from "../../../../libs/nowSize";
import {getPersonTable} from '@/api/personnelTalents'
export default {
  name: "PersonnelTalents_UnitPersonnel",
  data() {
    return {
      tableData: [
        {
          nianfen: '2022年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        {
          nianfen: '2022年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        {
          nianfen: '2022年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        {
          nianfen: '2021年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        {
          nianfen: '2021年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        {
          nianfen: '2021年',
          fanwei: '全市',
          shiyedanwei: '5363',
          zaizhirenyuan: '16.4',
          nianrenjunshouru: '10.54',
          quanshengpaiming: '3',
          nianrenjunshouruzengsu: '3.02%',
          gongzixingnianjunshouru: '6.81',
          quanshengpaiming1: '8',
          gexiangjianglixing: 3.73,
          quanshengpaiming2: '1'
        },
        // {
        //   nianfen: '2022年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
        // {
        //   nianfen: '2022年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
        // {
        //   nianfen: '2022年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
        // {
        //   nianfen: '2021年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
        // {
        //   nianfen: '2021年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
        // {
        //   nianfen: '2021年',
        //   fanwei: '全市',
        //   shiyedanwei: '5363',
        //   zaizhirenyuan: '16.4',
        //   nianrenjunshouru: '10.54',
        //   quanshengpaiming: '3',
        //   nianrenjunshouruzengsu: '3.02%',
        //   gongzixingnianjunshouru: '6.81',
        //   quanshengpaiming1: '8',
        //   gexiangjianglixing: 3.73,
        //   quanshengpaiming2: '1'
        // },
      ],
      option: {
      checkedCategory: '事业单位',
      CARE_GORY: ['事业单位', '在职人员', '年人均收入'],
      tableHeight: window.innerHeight - nowSize(1000)
    }
  },
  mounted() {
    this.Init_echarts()
    this.getPersonTable()
  },
  methods: {
    mergeColumnTableCell({rowIndex, columnIndex}) {
      if (columnIndex === 0) {
        if (rowIndex === 0) {
          return {
            rowspan: 3,
            colspan: 1
          };
        } else if (rowIndex === 3) {
          return {
            rowspan: 6,
            colspan: 1
          }
        } else {
          return {
            rowspan: 0,
            colspan: 0
          }
        }
      }
    },
    Init_echarts() {
      const myChart = this.$echarts.init(document.querySelector('.PT_unitPersonnel--Echarts'));
      const option = {
        color: ['#FF5151', '#51FF5D', '#FFD151'],
        title: {
          text: '历年全市居民人均可支配收入分析图',
@@ -143,11 +184,18 @@
            fontSize: nowSize(30)
          }
        },
        itemStyle: {
          normal: {
            lineStyle: {
              width: 3, //折线宽度
            }
          }
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '5%',
          right: '2%',
          top: 'center',
          orient: 'vertical',
          itemWidth: nowSize(30),
@@ -159,9 +207,10 @@
          }
        },
        grid: {
          left: '5%',
          right: '20%',
          bottom: '0%',
          left: '2%',
          top: '25%',
          right: '18%',
          bottom: '0',
          containLabel: true
        },
        xAxis: {
@@ -216,100 +265,51 @@
          },
          splitLine: {
            show: false
          }
          },
        },
        series: [
          {
            name: '居民人均可支配收入',
            type: 'line',
            smooth: false,  //设置折线为圆滑曲线,false则有转折点
            // symbol:'none', //默认显示折点,为none时不显示
            itemStyle: {
              normal: {
                lineStyle: {
                  width: 3, //折线宽度
                }
              }
            },
            emphasis: {   //鼠标经过时折点小圆圈样式
              borderColor: 'rgba(0,196,132,0.2)',
              borderWidth: 100
            },
            stack: 'Total',
            data: [120, 132, 101, 134, 90, 230]
          },
          {
            name: '城镇居民',
            type: 'line',
            smooth: false,  //设置折线为圆滑曲线,false则有转折点
            // symbol:'none', //默认显示折点,为none时不显示
            itemStyle: {
              normal: {
                lineStyle: {
                  width: 3, //折线宽度
                }
              }
            },
            emphasis: {   //鼠标经过时折点小圆圈样式
              borderColor: 'rgba(0,196,132,0.2)',
              borderWidth: 100
            },
            stack: 'Total',
            data: [220, 182, 191, 234, 290, 330]
          },
          {
            name: '农村居民',
            type: 'line',
            smooth: false,  //设置折线为圆滑曲线,false则有转折点
            // symbol:'none', //默认显示折点,为none时不显示
            itemStyle: {
              normal: {
                lineStyle: {
                  width: 3, //折线宽度
                }
              }
            },
            emphasis: {   //鼠标经过时折点小圆圈样式
              borderColor: 'rgba(0,196,132,0.2)',
              borderWidth: 100
            },
            stack: 'Total',
            data: [150, 232, 201, 154, 190, 330]
          }
        ]
      }
    }
  },
  mounted(){
    this.Init_echarts()
  },
  methods: {
    mergeColumnTableCell({rowIndex, columnIndex}) {
      if (columnIndex === 0) {
        if (rowIndex === 0) {
          return {
            rowspan: 3,
            colspan: 1
          };
        } else if (rowIndex === 3) {
          return {
            rowspan: 6,
            colspan: 1
          }
        } else {
          return {
            rowspan: 0,
            colspan: 0
          }
        }
      }
      };
      option && myChart.setOption(option)
    },
    Init_echarts() {
      const option = this.option
      const myChart = this.$echarts.init(document.querySelector('.PT_unitPersonnel--Echarts'));
      option && myChart.setOption(this.option)
    getHeight() {
      this.tableHeight = window.innerHeight - nowSize(900)
    },
    // 通过点击更换echarts图表信息
    selectEcharts(index) {
      console.log(index);
    },
    // 29. 查询事业单位人员情况表格数据接口
    getPersonTable() {
      getPersonTable().then(res => {
        if (res.code === 1000) {
          this.tableData = res.list
        }
      })
    }
  },
  created() {
    window.addEventListener('resize', this.getHeight)
  },
  destroy() {
    window.addEventListener('resize', this.getHeight)
  }
}
</script>
<style lang="scss">
@@ -347,7 +347,7 @@
  .el-table .el-table__cell {
    //padding: 0.0850375rem /* 22/256 */
    //0;
    padding:0.0546875rem 0;
    padding: 0.0546875rem 0;
  }
  .el-table__body tr.hover-row.current-row > td.el-table__cell, .el-table__body tr.hover-row.el-table__row--striped.current-row > td.el-table__cell, .el-table__body tr.hover-row.el-table__row--striped > td.el-table__cell, .el-table__body tr.hover-row > td.el-table__cell {
@@ -355,7 +355,7 @@
  }
  .el-table .cell {
    line-height:0.125rem;
    line-height: 0.125rem;
    font-size: $fontSize-28;
    color: $color-darkGrey;
    font-weight: 300;
@@ -372,32 +372,51 @@
    border-bottom: 1px solid #8E8E8E;
  }
}
.PT_navEchart--title{
  .el-checkbox{
    width:1.171875rem;
    line-height:0.375rem;
  }
  .el-checkbox__label{
    font-size:0.09375rem;
    color:#FFFFFF;
  }
  .el-checkbox__inner{
    width:40px;
    height:40px;
    margin-right:17px;
    background: #51D2FF;
    //&:after{
    //  background: url("../../../../assets/images/personnelTalents/Yes@2x.png") no-repeat;
    //  background:100% 100%;
    //  content:''
    //}
  }
  .el-checkbox__inner::after{
    border: 0.01953125rem  /* 5/256 */ solid #FFF;
    height: 0.08203125rem  /* 21/256 */;
    width: 0.0625rem  /* 16/256 */;
    border-left: 0;
    border-top: 0;
.PT_navEchart--title {
  .el-radio {
    width: 1.171875rem;
    line-height: 0.375rem;
    .el-radio__label {
      font-size: 0.09375rem;
      color: #FFFFFF;
    }
    .el-radio__input {
      margin-bottom: 0.01953125rem;
      &.is-checked {
        .el-radio__inner {
          background-color: #51D2FF;
          border-color: #51D2FF;
          background: url("../../../../assets/images/personnelTalents/Yes@2x.png") no-repeat;
          background-size: 100% 100%;
          background-color: #51D2FF;
          &:hover {
            border-color: #51D2FF;
          }
        }
      }
      .el-radio__inner {
        width: 0.15625rem;
        height: 0.15625rem;
        margin-right: 0.06640625rem;
        background: transparent;
        border-radius: 1%;
        box-sizing: content-box;
        border: 0.0078125rem /* 2/256 */
        solid #DCDFE6;
        &::after {
          content: '';
          width: 0;
          height: 0;
        }
      }
    }
  }
}
</style>
@@ -407,28 +426,37 @@
.PersonnelTalents_unitPersonnel--warp {
  width: 100%;
  height: 100%;
  .PT_unitPersonnel--table {
    width: 100%;
    height: 100%;
  }
  .PT_unitPersonnel--echart-box {
    width: 100%;
    margin-top: 0.234375rem /* 60/256 */
  ;
    height: calc(100% - 2.5rem/* 640/256 */ - 0.254375rem /* 60/256 */
    );
    position: relative;
    .PT_navEchart--title {
      width: 1px;
      display: inline-block;
      position: absolute;
      left: 0.390625rem;
      top: 50%;
      transform: translateY(-50%);
    }
    .PT_unitPersonnel--Echarts {
      width: 85%;
      height: 100%;
      position: absolute;
      left: 1.2890625rem;
      display: inline-block;
    }
  }
  .PT_unitPersonnel--Echarts {
    width: 1920px;
    margin-top: 120px;
    height:600px;
    //height: calc(100% - 640px - 0.33203125rem /* 85/256 */
    //);
    display:inline-block;
    //height: 2.75rem;
  }
  .PT_navEchart--title{
    width:1.171875rem;
    display:inline-block;
    position:relative;
    left:100px;
    top:-250px;
  }
}
</style>