付延余
2022-04-28 b262be766fd1dbcb936d9dda5b5e802de4d27e59
其他业务
1个文件已修改
1个文件已添加
203 ■■■■ 已修改文件
src/api/otherBusiness.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/show/otherBusiness/otherBusinessChild/OtherB_PeopleJunShouRu.vue 193 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/otherBusiness.js
New file
@@ -0,0 +1,10 @@
import { getRequest, postRequest} from "../libs/axios";
// 31. 查询居民人均可支配收入表格数据接口
export const getIncomeTable = (params) => {
  return postRequest('/ybg/webservice/app/asset/getIncomeTable.do',params)
}
// 32. 查询居民可支配收入分析图数据接口
export const getIncomeLine = (params) => {
  return postRequest('/ybg/webservice/app/asset/getIncomeLine.do',params)
}
src/pages/show/otherBusiness/otherBusinessChild/OtherB_PeopleJunShouRu.vue
@@ -6,7 +6,7 @@
        :data="tableData"
        style="width: 100%" :cell-style="updataCellStyle">
        <el-table-column
          prop="year"
          prop="jyear"
          label="年份" min-width="80"
          fied="left"
        >
@@ -14,27 +14,27 @@
        <el-table-column
          label="国民人均可支配收入">
          <el-table-column
            prop="shouru"
            prop="jincome"
            label="收入(元)"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quanshengpaiwei"
            prop="jprovinceRank"
            label="全省排名"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="zengzhang"
            prop="jincrease"
            label="增长"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quanshengpaiwei1"
            prop="jincreaseRank"
            label="全省排位"
            min-width="80"
@@ -43,28 +43,28 @@
        </el-table-column>
        <el-table-column label="城镇居民人均可支配收入">
          <el-table-column
            prop="shouru1"
            prop="cincome"
            label="收入(元)"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quanshengpaiwei2"
            prop="cprovinceRank"
            label="全省排位"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="zengzhang1"
            prop="cincrease"
            label="增长"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quanshengpaiwei3"
            prop="cincreaseRank"
            label="全省排位"
            min-width="80"
@@ -73,27 +73,27 @@
        </el-table-column>
        <el-table-column label="农村居民人均可支配收入">
          <el-table-column
            prop="shouru2"
            prop="nincome"
            label="收入(元)"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quashengpaiwei4"
            prop="nprovinceRank"
            label="全省排位"
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="zengzhang2"
            prop="nincrease"
            label="增长 "
            min-width="80"
          >
          </el-table-column>
          <el-table-column
            prop="quanshengpaiwei5"
            prop="nincreaseRank"
            label="全省排位"
            min-width="80"
          >
@@ -101,50 +101,81 @@
        </el-table-column>
      </el-table>
    </div>
    <!--图表-->
    <div class="OtherB-PeopleJunShouRu__echart">
    </div>
  </div>
</template>
<script>
import nowSize from '../../../../libs/nowSize'
import {getIncomeTable, getIncomeLine} from '@/api/otherBusiness'
export default {
  name: "OtherB_PerpleJunShouRu",
  data() {
    return {
      tableData: [{
        year: 2020,
        shouru: 30955,
        quanshengpaiwei: 3,
        zengzhang: '5.5%',
        quanshengpaiwei1: 9,
        shouru1: 40243,
        quanshengpaiwei2: 3,
        zengzhang1: '4.4%',
        quanshengpaiwei3: 6,
        shouru2: 40243,
        quashengpaiwei4: 3,
        zengzhang2: '4.4%',
        quanshengpaiwei5: 6
      tableData: [
        // {
        //   year: 2020,
        //   shouru: 30955,
        //   quanshengpaiwei: 3,
        //   zengzhang: '5.5%',
        //   quanshengpaiwei1: 9,
        //   shouru1: 40243,
        //   quanshengpaiwei2: 3,
        //   zengzhang1: '4.4%',
        //   quanshengpaiwei3: 6,
        //   shouru2: 40243,
        //   quashengpaiwei4: 3,
        //   zengzhang2: '4.4%',
        //   quanshengpaiwei5: 6
        // },
        //   {
        //     year: 2020,
        //     shouru: 30955,
        //     quanshengpaiwei: 3,
        //     zengzhang: '5.5%',
        //     quanshengpaiwei1: 9,
        //     shouru1: 40243,
        //     quanshengpaiwei2: 3,
        //     zengzhang1: '4.4%',
        //     quanshengpaiwei3: 6,
        //     shouru2: 40243,
        //     quashengpaiwei4: 3,
        //     zengzhang2: '4.4%',
        //     quanshengpaiwei5: 6
        //   }
      ],
      echartsSeries: {}
    }
      },
        {
          year: 2020,
          shouru: 30955,
          quanshengpaiwei: 3,
          zengzhang: '5.5%',
          quanshengpaiwei1: 9,
          shouru1: 40243,
          quanshengpaiwei2: 3,
          zengzhang1: '4.4%',
          quanshengpaiwei3: 6,
          shouru2: 40243,
          quashengpaiwei4: 3,
          zengzhang2: '4.4%',
          quanshengpaiwei5: 6
        }],
      option: {
  mounted() {
    this.Init_echarts()
    this.getIncomeTable()
    this.getIncomeLine()
  },
  methods: {
    // 31. 查询居民人均可支配收入表格数据接口
    getIncomeTable() {
      getIncomeTable().then(res => {
        if (res.code === 1000) {
          this.tableData = res.list
        }
      })
    },
    // 32. 查询居民可支配收入分析图数据接口
    getIncomeLine() {
      getIncomeLine().then(res => {
        console.log(res);
        if(res.code===1000){
          this.echartsSeries = res.obj
          this.Init_echarts()
        }
      })
    },
    Init_echarts() {
      const option = {
        color: ['#FF5151', '#51FF5D', '#FFD151'],
        title: {
          text: '历年全市居民人均可支配收入分析图',
@@ -185,7 +216,7 @@
          nameGap: nowSize(92),// 坐标轴名称与轴线之间的距离。
          type: 'category',
          boundaryGap: false,// 坐标轴两端留白
          data: ['2017年', '2018年', '2019年', '2020年', '2021年'],
          data: this.echartsSeries.years,
          axisLabel: {
            show: true,
            textStyle: {
@@ -234,72 +265,36 @@
          {
            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]
            data: this.echartsSeries.jumin
          },
          {
            name: '城镇居民',
            type: 'line',
            smooth: false,  //设置折线为圆滑曲线,false则有转折点
            data: this.echartsSeries.chengzhen
          },
          // 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]
          },
          // itemStyle: {
          //   normal: {
          //     lineStyle: {
          //       width: 3, //折线宽度
          //     }
          //   }
          // },
          // emphasis: {   //鼠标经过时折点小圆圈样式
          //   borderColor: 'rgba(0,196,132,0.2)',
          //   borderWidth: 100
          // },
          // stack: 'Total',
          {
            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]
            data: this.echartsSeries.nongcun
          }
        ]
      }
    }
  },
  mounted() {
    this.Init_echarts()
  },
  methods: {
    Init_echarts() {
      const option = this.option
      const myChart = this.$echarts.init(document.querySelector('.OtherB-PeopleJunShouRu__echart'));
      option && myChart.setOption(this.option)
      option && myChart.setOption(option)
    },
    // 给单独单元格添加样式
    updataCellStyle({rowIndex, columnIndex}) {