From 6e41ce0ab4300758ebd77ea257c3d9532e3df7e0 Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123456 <zxx19900626>
Date: 星期二, 10 五月 2022 11:58:22 +0800
Subject: [PATCH] 接口对接
---
src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue b/src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue
index 7cfef4c..7539944 100644
--- a/src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue
+++ b/src/pages/components/qiyezhigongShebao/zhigongshebaoForm.vue
@@ -6,11 +6,11 @@
:before-close="handleClose">
<div class="zhigongshebaoEcharts" ref="zhigongshebaoEcharts"></div>
</el-dialog>
-
</div>
</template>
<script>
+ import {getSecurityDetailChart} from '@/api/shehuiBaozhang'
import echarts from "echarts/lib/echarts";
import nowSize from '../../../libs/nowSize'
export default {
@@ -18,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() {
@@ -65,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: {
@@ -109,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
}
]
};
--
Gitblit v1.9.1