liyangzheng 1 سال پیش
والد
کامیت
190c1d7d14
2فایلهای تغییر یافته به همراه76 افزوده شده و 40 حذف شده
  1. 16 0
      src/api/backend/smallNine.js
  2. 60 40
      src/views/backend/stacisticsNine/StatisticsNine.vue

+ 16 - 0
src/api/backend/smallNine.js

@@ -6,6 +6,22 @@ function getAllPeople(data){//监督员质态统计
         params:data
     })
 }
+function getNineTeam(data){//获取九小单位数量
+    return request({
+        url:`/backend/S9-tongji/page`,
+        method:"get",
+        params:data
+    })
+}
+function getBigTeam(data){
+    return request({
+        url:`/backend/tongji/ddlist`,
+        method:'get',
+        params:data
+    })
+}
 export default{
     getAllPeople,
+    getNineTeam,
+    getBigTeam,
 }

+ 60 - 40
src/views/backend/stacisticsNine/StatisticsNine.vue

@@ -31,7 +31,14 @@ export default {
         nine: null,
         peopleList: [],//监督员
         peopleNum: [],//质态
-        peopleDash:[]
+        peopleDash: [],
+        lifeAll: [],//检查总数
+        lifeNum: [],//活跃度
+        bigList: [],//获取的大队列表
+        nineId: [],
+        bigTeam: [],//排序后的大队名称
+        nineList: [],
+        checkNum: [],
     },
     created() {
         this.initList()
@@ -56,43 +63,21 @@ export default {
                     },
                     formatter: function (params) {
                         var tar = params[0];
-                        return '监督人:' + tar.name + '<br/>' + '单位数' + ' : ' + tar.value;
+                        return '单位名称:' + tar.name + '<br/>' + '九小数' + ' : ' + tar.value;
                     }
                 },
                 xAxis: {
                     type: 'category',
-                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                    data: this.bigTeam
                 },
                 yAxis: {
                     type: 'value',
                     min: 0,
-                    max: 1200,
+                    max: 200,
                 },
                 series: [
                     {
-                        data: [
-                            {
-                                value: 120,
-                            },
-                            {
-                                value: 200,
-                            },
-                            {
-                                value: 120,
-                            },
-                            {
-                                value: 120,
-                            },
-                            {
-                                value: 120,
-                            },
-                            {
-                                value: 120,
-                            },
-                            {
-                                value: 120,
-                            },
-                        ],
+                        data: this.nineList,
                         type: 'bar',
                         barWidth: 30
                     }
@@ -112,7 +97,7 @@ export default {
                 xAxis: {
                     type: 'category',
                     boundaryGap: false,
-                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                    data: this.bigTeam
                 },
                 yAxis: {
                     type: 'value',
@@ -124,7 +109,7 @@ export default {
                 },
                 series: [
                     {
-                        data: [82, 93, 90, 93, 32, 13, 32],
+                        data: this.checkNum,
                         type: 'line',
                         areaStyle: {},
                         barWidth: 30,
@@ -166,26 +151,26 @@ export default {
                 },
                 xAxis: {
                     type: 'category',
-                    data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
+                    data: this.bigTeam
                 },
                 yAxis: {
                     type: 'value',
                     boundaryGap: [0, 0.01],
                     min: 0,
-                    max: 1200,
+                    max: 120,
                 },
                 series: [
                     {
                         name: '活跃度',
                         type: 'bar',
-                        data: [200, 480, 900, 490, 740, 300],
+                        data: this.lifeNum,
                         color: '#0147EB',
                         // barWidth: 30
                     },
                     {
                         name: '检查总数',
                         type: 'bar',
-                        data: [19, 43, 31, 11, 41, 67],
+                        data: this.lifeAll,
                         color: "#01BCEB",
                         // barWidth: 30
                     },
@@ -281,20 +266,55 @@ export default {
                 this.peopleNum = res.data.list.map(item => {
                     return item.quality
                 })
-                this.peopleDash = res.data.list.map(item=>{
+                this.peopleDash = res.data.list.map(item => {
                     return item.servorg
                 })
                 if (this.peopleList.length > 0 && this.peopleNum.length > 0) {
-                    // this.$nextTick(() => {
-                    this.$message.closeAll()
-                    this.lineSmall();
-                    this.myBit()
-                    this.bitTeam()
                     this.casePeople()
                     this.caseUnity()
-                    // });
                 }
             })
+            smallNine.getNineTeam({ pageNo: 1, pageSize: 50 }).then(res => {
+                this.lifeAll = res.data.list.map(item => {
+                    return item.selfscan
+                })
+                this.lifeNum = res.data.list.map(item => {
+                    return item.actnums
+                })
+                this.nineId = res.data.list.map(item => {
+                    return item.deptid
+                })
+                this.nineList = res.data.list.map(item => {
+                    return item.s9orgtotal
+                })
+                this.checkNum = res.data.list.map(item => {
+                    return item.scantotal
+                })
+                smallNine.getBigTeam({}).then(res => {
+                    this.bigList = res.data
+                    // 遍历 this.nineId 中的每个值,然后与 this.bigList 中的对象进行比较
+                    const matchedItems = []
+                    this.nineId.map(nineIdValue => {
+                        this.bigList.map(param => {
+                            if (param.id - 0 == nineIdValue - 0) {
+                                matchedItems.push(param)
+                            }
+                        })
+                    });
+                    matchedItems.sort((a, b) => {
+                        return a.id - b.id; // 按照 id 属性升序排序
+                    });
+                    const namesOnly = matchedItems.map(item => item.deptName);
+                    this.bigTeam = namesOnly
+                    if (this.lifeAll.length > 0 && this.lifeNum.length > 0 && this.bigTeam.length > 0 && this.nineList.length > 0 && this.checkNum.length > 0) {
+                        this.$message.closeAll()
+                        this.lineSmall();
+                        this.myBit()
+                        this.bitTeam()
+                    }
+                })
+
+            })
         }
     }
 }