zhangxiaoxu123456
2022-04-22 ee658b8ab1dd3b76b8c3fa3f2006b4fa8e8af0cf
src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue
@@ -10,6 +10,7 @@
</template>
<script>
  import {getSecurityDetailChart} from '@/api/shehuiBaozhang'
    import echarts from "echarts/lib/echarts";
    import nowSize from '../../../libs/nowSize'
    export default {
@@ -17,13 +18,28 @@
        data() {
            return {
                dialogVisible: false,
                xdata:[],
                totalData: [],
                inJobData: [],
                outJobData: []
            }
        },
        methods: {
            init() {
            init(type,area) {
                this.dialogVisible = true
                this.$nextTick(() => {
                    this.zhigongshebaoEcharts()
                    this.getSecurityDetailChart(type,area)
                })
            },
            getSecurityDetailChart(type,area) {
                getSecurityDetailChart({type:type,area:area}).then(res => {
                    if(res.code == 1000) {
                        this.xdata = res.obj.data
                        this.totalData = res.obj.total
                        this.inJobData = res.obj.inJob
                        this.outJobData = res.obj.outJob
                        this.zhigongshebaoEcharts()
                    }
                })
            },
            zhigongshebaoEcharts() {
@@ -64,7 +80,7 @@
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: ['2021/4', '2021/5', '2021/6', '2021/7', '2021/8', '2021/9', '2021/10'],
                        data: this.xdata,
                        axisLabel: {
                            show: true,
                            textStyle: {
@@ -108,17 +124,17 @@
                            name: '总数',
                            type: 'line',
                            stack: 'Total',
                            data: [370, 332, 401, 534, 490, 530, 910]
                            data: this.totalData
                        },
                        {
                            name: '在职职工',
                            type: 'line',
                            data: [220, 182, 191, 234, 290, 330, 310]
                            data: this.inJobData
                        },
                        {
                            name: '离退休',
                            type: 'line',
                            data: [150, 132, 201, 154, 190, 330, 410]
                            data: this.outJobData
                        }
                    ]
                };