zhangxiaoxu123456
2022-04-24 60be35fec8bced93ae8b5c55fc554291a819adf9
src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue
@@ -2,7 +2,7 @@
  <div class="PersonnelTalents_unitPersonnel--warp">
    <div class="PT_unitPersonnel--table">
      <el-table
        :max-height="640"
        :max-height="tableHeight"
        :data="tableData"
        stripe
        border
@@ -36,17 +36,18 @@
          <el-table-column label="全省排位" prop="quanshengpaiming2"></el-table-column>
        </el-table-column>
      </el-table>
      <!-- 单选框 -->
      <div class="PT_unitPersonnel--echart-box">
        <div class="PT_navEchart--title">
          <el-radio-group v-model="checkedCategory">
            <el-radio v-for="categoryItem in careGory" :label="categoryItem" :key="categoryItem">{{ categoryItem }}
            </el-radio>
          </el-radio-group>
        </div>
        <div class="PT_unitPersonnel--Echarts"></div>
      </div>
    </div>
      <!-- 单选框 -->
    <div class="PT_unitPersonnel--echart-box">
      <div class="PT_navEchart--title">
        <el-radio-group v-model="checkedCategory">
          <el-radio v-for="categoryItem in careGory" :label="categoryItem" :key="categoryItem">{{ categoryItem }}
          </el-radio>
        </el-radio-group>
      </div>
      <div class="PT_unitPersonnel--Echarts"></div>
    </div>
  </div>
</template>
@@ -140,7 +141,8 @@
        },
      ],
      checkedCategory: '事业单位',
      careGory: CARE_GORY
      careGory: CARE_GORY,
      tableHeight: window.innerHeight - nowSize(900)
    }
  },
  mounted() {
@@ -168,122 +170,131 @@
      }
    },
    Init_echarts() {
      const option = {
        color: ['#FF5151', '#51FF5D', '#FFD151'],
        title: {
          text: '历年全市居民人均可支配收入分析图',
          left: 'center',
          top: '5%',
          textStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(30)
          }
        },
        itemStyle: {
          normal: {
            lineStyle: {
              width: 3, //折线宽度
            }
          }
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '2%',
          top: 'center',
          orient: 'vertical',
          itemWidth: nowSize(30),
          itemHeight: nowSize(4),
          itemGap: nowSize(80),
          textStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(24),
          }
        },
        grid: {
          left: '2%',
          top: '25%',
          right: '18%',
          bottom: '0',
          containLabel: true
        },
        xAxis: {
          name: '单位:年',
          nameTextStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(24)
          },
          nameGap: nowSize(92),// 坐标轴名称与轴线之间的距离。
          type: 'category',
          boundaryGap: false,// 坐标轴两端留白
          data: ['2017年', '2018年', '2019年', '2020年', '2021年'],
          axisLabel: {
            show: true,
            textStyle: {
              color: '#fff',
              fontSize: nowSize(24)
            },
          },
          axisLine: {
            lineStyle: {
              color: '#999999',
              width: 1,   //这里是坐标轴的宽度,可以去掉
              type: 'solid'
            }
          },
          splitLine: {
            show: false
          }
        },
        yAxis: {
          name: '单位:年',
          nameTextStyle: {
            color: '#FFFFFF',
            fontSize: nowSize(24)
          },
          nameGap: nowSize(30),// 坐标轴名称与轴线之间的距离。
          type: 'value',
          axisLabel: {
            show: true,
            textStyle: {
              color: '#fff',
              fontSize: nowSize(24)
            },
          },
          axisLine: {
            lineStyle: {
              color: '#999999',
              width: 1,   //这里是坐标轴的宽度,可以去掉
              type: "solid"
            }
          },
          splitLine: {
            show: false
          },
        },
        series: [
          {
            name: '居民人均可支配收入',
            type: 'line',
            data: [120, 132, 101, 134, 90, 230]
          },
          {
            name: '城镇居民',
            type: 'line',
            data: [220, 182, 191, 234, 290, 330]
          },
          {
            name: '农村居民',
            type: 'line',
            data: [150, 232, 201, 154, 190, 330]
          }
        ]
      };
      const myChart = this.$echarts.init(document.querySelector('.PT_unitPersonnel--Echarts'));
      const option = {
            color: ['#FF5151', '#51FF5D', '#FFD151'],
            title: {
                text: '历年全市居民人均可支配收入分析图',
                left: 'center',
                top: '5%',
                textStyle: {
                    color: '#FFFFFF',
                    fontSize: nowSize(30)
                }
            },
            itemStyle: {
                normal: {
                    lineStyle: {
                        width: 3, //折线宽度
                    }
                }
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                right: '2%',
                top: 'center',
                orient: 'vertical',
                itemWidth: nowSize(30),
                itemHeight: nowSize(4),
                itemGap: nowSize(80),
                textStyle: {
                    color: '#FFFFFF',
                    fontSize: nowSize(24),
                }
            },
            grid: {
                left: '2%',
                top: '25%',
                right: '18%',
                bottom: '0',
                containLabel: true
            },
            xAxis: {
                name: '单位:年',
                nameTextStyle: {
                    color: '#FFFFFF',
                    fontSize: nowSize(24)
                },
                nameGap: nowSize(92),// 坐标轴名称与轴线之间的距离。
                type: 'category',
                boundaryGap: false,// 坐标轴两端留白
                data: ['2017年', '2018年', '2019年', '2020年', '2021年'],
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#fff',
                        fontSize: nowSize(24)
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: '#999999',
                        width: 1,   //这里是坐标轴的宽度,可以去掉
                        type: 'solid'
                    }
                },
                splitLine: {
                    show: false
                }
            },
            yAxis: {
                name: '单位:年',
                nameTextStyle: {
                    color: '#FFFFFF',
                    fontSize: nowSize(24)
                },
                nameGap: nowSize(30),// 坐标轴名称与轴线之间的距离。
                type: 'value',
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#fff',
                        fontSize: nowSize(24)
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: '#999999',
                        width: 1,   //这里是坐标轴的宽度,可以去掉
                        type: "solid"
                    }
                },
                splitLine: {
                    show: false
                },
            },
            series: [
                {
                    name: '居民人均可支配收入',
                    type: 'line',
                    data: [120, 132, 101, 134, 90, 230]
                },
                {
                    name: '城镇居民',
                    type: 'line',
                    data: [220, 182, 191, 234, 290, 330]
                },
                {
                    name: '农村居民',
                    type: 'line',
                    data: [150, 232, 201, 154, 190, 330]
                }
            ]
        };
      option && myChart.setOption(option)
    },
    getHeight() {
        this.tableHeight = window.innerHeight - nowSize(900)
    }
  }
  },
    created() {
      window.addEventListener('resize',this.getHeight)
    },
    destroy() {
        window.addEventListener('resize',this.getHeight)
    }
}
</script>
<style lang="scss">
@@ -401,7 +412,6 @@
  .PT_unitPersonnel--table {
    width: 100%;
    height: 100%;
  }
@@ -409,7 +419,7 @@
    width: 100%;
    margin-top: 0.234375rem /* 60/256 */
  ;
    height: calc(100% - 600Px - 0.254375rem /* 60/256 */
    height: calc(100% - 2.34375rem  /* 600/256 */ - 0.254375rem /* 60/256 */
    );
    position: relative;