chenrui  2 жил өмнө
parent
commit
2fc014c4fa

+ 6 - 6
src/api/statistics/statistics.js

@@ -1,11 +1,11 @@
 import request from '@/utils/request'
 
-// 航线货物关联统计接口
+// 安检通道综合效率统计接口
 export function correlation(query) {
   return request({
     url: '/risk/report/securityCheck',
     method: 'POST',
-    data:query
+    data: query
   })
 }
 
@@ -36,21 +36,21 @@ export function waybill(query) {
   })
 }
 
-// 获取代理人信息统计接口
+// 航线货物关联统计接口
 export function agent(query) {
   return request({
     url: '/risk/report/airlineCargo',
     method: 'POST',
-    data:query
+    data: query
   })
 }
 
-// 安检通道综合效率统计接口
+// 代理人信用等级视角安检综合效率统计接口
 export function emergency(query) {
   return request({
     url: '/risk/report/agentCredit',
     method: 'get',
     method: 'POST',
-    data:query
+    data: query
   })
 }

+ 63 - 7
src/utils/app-ecahrts.js

@@ -11,6 +11,23 @@ export const eleCake = {
     bottom: '5%',
     containLabel: true
   },
+  dataZoom: [{
+    type: 'slider',//给x轴设置滚动条
+    show: true, //flase直接隐藏图形
+    xAxisIndex: [0],
+    bottom: 0,
+    height: 20,
+    showDetail: false,
+    startValue: 0,//滚动条的起始位置
+    endValue: 15 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
+  },
+  {
+    type: 'inside',//设置鼠标滚轮缩放
+    show: true,
+    xAxisIndex: [0],
+    startValue: 0,
+    endValue: 9
+  }],
   xAxis: {
     axisTick: {
       alignWithLabel: true
@@ -25,27 +42,66 @@ export const eleCake = {
     }
   },
   series: [{
-    name: '',
+    name: '高风险',
     type: 'bar',
-    stack: '业务',
+    stack: '',
     barWidth: '24px',
     itemStyle: {
       normal: {
         //这里是重点
-        color: "#F3C742"
+        color: "#EE50A6"
       }
     },
     data: [630, 20, 36, 10, 10, 20]
   },
   {
-    name: '',
+    name: '低风险级',
     type: 'bar',
-    stack: '业务',
+    stack: '',
     barWidth: '24px',
     itemStyle: {
       normal: {
         //这里是重点
-        color: "#EE50A6"
+        color: "#F3C742"
+      }
+    },
+    data: [300, 25, 26, 20, 10, 20]
+  },
+  {
+    name: '优先级',
+    type: 'bar',
+    stack: '总',
+    barWidth: '24px',
+    itemStyle: {
+      normal: {
+        //这里是重点
+        color: "#5AC591"
+      }
+    },
+    data: [300, 25, 26, 20, 10, 20]
+  },
+  {
+    name: '普通级',
+    type: 'bar',
+    stack: '总',
+    barWidth: '24px',
+    itemStyle: {
+      normal: {
+        //这里是重点
+        color: "#70B4D4"
+      }
+    },
+    data: [300, 25, 26, 20, 10, 20]
+  },
+  {
+    name: '严控级',
+    type: 'bar',
+    stack: '总',
+    barWidth: '24px',
+    itemStyle: {
+      normal: {
+        //这里是重点
+        color: "#E64545"
       }
     },
     data: [300, 25, 26, 20, 10, 20]
@@ -88,7 +144,7 @@ export const pillar = {
   },
   series: [
     {
-      name: 'Access From',
+      name: '',
       type: 'pie',
       radius: ['60%', '90%'],
       avoidLabelOverlap: false,

+ 2 - 0
src/views/securityCheck/components/graphicHome.vue

@@ -39,6 +39,8 @@ export default {
       pillar.title.subtext = this.texter.cont;
       pillar.title.top = this.texter.top;
       pillar.series[0].color = this.texter.color;
+      pillar.series[0].name = this.texter.name2;
+      pillar.series[1].name = this.texter.name2;
       pillar.series[1].data = [this.texter.cont];
       myChart.clear();
       myChart.setOption(pillar, true);

+ 3 - 3
src/views/securityCheck/views/agentHome.vue

@@ -235,7 +235,7 @@
 <script>
 import GraphicEchart from "../components/graphicHome.vue";
 import SecurityCheckHeader from "../components/securityCheckHeader.vue";
-import { agent } from "@/api/statistics/statistics.js";
+import { emergency } from "@/api/statistics/statistics.js";
 export default {
   data() {
     return {
@@ -291,7 +291,7 @@ export default {
     },
     async getData() {
       try {
-        const result = await agent({});
+        const result = await emergency({});
         let count = 0;
         let counts = 0;
         let arr = [];
@@ -304,7 +304,7 @@ export default {
         this.dataall.cont = count;
         this.dataall.data = arr;
         this.dataall.color = [];
-        console.log(result.data);
+        console.log(result);
       } catch (error) {
         console.log(error);
       }

+ 35 - 8
src/views/securityCheck/views/cargoCharts.vue

@@ -40,7 +40,7 @@
 import { eleCake } from "@/utils/app-ecahrts";
 import GraphicEchart from "../components/graphicHome.vue";
 import SecurityCheckHeader from "../components/securityCheckHeader.vue";
-import { correlation } from "@/api/statistics/statistics.js";
+import { agent } from "@/api/statistics/statistics.js";
 export default {
   data() {
     return {
@@ -188,17 +188,40 @@ export default {
           proxyId: data[2],
         };
         // console.log(params);
-        const result = await correlation(params);
+        const result = await agent(params);
         if (result.status == 200) {
           console.log(result);
-          let arr = [];
-          let arrx = [];
+          let arr = []; //高风险
+          let Low = []; //低风险
+          let firs = []; //优先级
+          let pt = [];
+          let strictly = [];
+          let arrx = []; //x轴
           this.dataall.data = result.data;
           result.data.forEach((element) => {
-            arr.push(element.count);
-            arrx.push(element.channel);
+            arrx.push(element.flightLine);
+            element.datas.forEach((res) => {
+              if (res.level === "高风险级") {
+                arr.push(res.count);
+              } else if (res.level == "低风险级") {
+                Low.push(res.count);
+              } else if (res.level == "优先级") {
+                firs.push(res.count);
+              } else if (res.level == "普通级") {
+                pt.push(res.count);
+              } else if (res.level == "严控级") {
+                strictly.push(res.count);
+              }
+            });
+            // console.log(arr);
           });
-          this.init(arr, arrx);
+          let arrall = eval(arr.join("+")); //高风险总和
+          let Lowall = eval(Low.join("+")); //低风险级总和
+          let firsall = eval(firs.join("+")); //优先级总和
+          let ptall = eval(pt.join("+")); //普通级总和
+          let strictlyall = eval(strictly.join("+")); //严控级总和
+          let alldata = arrall + Lowall + firsall + ptall + strictlyall; // 总数
+          this.init(arr, arrx, Low, firs, pt, strictly);
           this.datarisk.data = result.data;
         }
         console.log(result);
@@ -209,11 +232,15 @@ export default {
     change() {
       this.$router.push("./cargoRelevanceTable");
     },
-    init(arr, arrx) {
+    init(arr, arrx, Low, firs, pt, strictly) {
       let myChart = this.$echarts.init(
         document.getElementById("echarts-proportion")
       ); //统计折线
       eleCake.series[0].data = arr;
+      eleCake.series[1].data = Low;
+      eleCake.series[2].data = firs;
+      eleCake.series[3].data = pt;
+      eleCake.series[4].data = strictly;
       eleCake.xAxis.data = arrx;
       myChart.setOption(eleCake, true);
       window.onresize = () => {

+ 33 - 16
src/views/securityCheck/views/cargoStatisticsHome.vue

@@ -28,10 +28,12 @@
                 >
                   <div class="top">
                     <div class="log" :style="{ background: item.color }"></div>
-                    <div class="name">{{ item.name }}</div>
+                    <div class="name" @click="echar">{{ item.name }}</div>
                   </div>
                   <div class="boot">
-                    <div class="child">件数:{{ item.value }}</div>
+                    <div class="child" @click="echar">
+                      件数:{{ item.value }}
+                    </div>
                     <div class="child">占比:{{ item.proportion }}</div>
                   </div>
                 </div>
@@ -50,11 +52,11 @@
               </div>
               <div class="chart_right">
                 <div class="analysis">
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>总件数</p>
                     <span>{{ dataLow.num }}</span>
                   </div>
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>开包数</p>
                     <span>{{ dataLow.kxsNum }}</span>
                   </div>
@@ -73,7 +75,9 @@
                     <div class="name">{{ item.name }}</div>
                   </div>
                   <div class="boot">
-                    <div class="child">件数:{{ item.value }}</div>
+                    <div class="child" @click="echar">
+                      件数:{{ item.value }}
+                    </div>
                     <div class="child">占比:{{ item.prot }}</div>
                   </div>
                 </div>
@@ -134,11 +138,11 @@
               </div>
               <div class="chart_right">
                 <div class="analysis">
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>总件数</p>
                     <span>{{ dataLowpt.num }}</span>
                   </div>
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>开包数</p>
                     <span>{{ dataLowpt.kxsNum }}</span>
                   </div>
@@ -157,7 +161,9 @@
                     <div class="name">{{ item.name }}</div>
                   </div>
                   <div class="boot">
-                    <div class="child">件数:{{ item.value }}</div>
+                    <div class="child" @click="echar">
+                      件数:{{ item.value }}
+                    </div>
                     <div class="child">占比:{{ item.prot }}</div>
                   </div>
                 </div>
@@ -176,11 +182,11 @@
               </div>
               <div class="chart_right">
                 <div class="analysis">
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>总件数</p>
                     <span>{{ dataLowyk.num }}</span>
                   </div>
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>开包数</p>
                     <span>{{ dataLowyk.kxsNum }}</span>
                   </div>
@@ -199,7 +205,9 @@
                     <div class="name">{{ item.name }}</div>
                   </div>
                   <div class="boot">
-                    <div class="child">件数:{{ item.value }}</div>
+                    <div class="child" @click="echar">
+                      件数:{{ item.value }}
+                    </div>
                     <div class="child">占比:{{ item.prot }}</div>
                   </div>
                 </div>
@@ -218,11 +226,11 @@
               </div>
               <div class="chart_right">
                 <div class="analysis">
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>总件数</p>
                     <span>{{ dataLowgf.num }}</span>
                   </div>
-                  <div class="analysis_cont">
+                  <div class="analysis_cont" @click="echar">
                     <p>开包数</p>
                     <span>{{ dataLowgf.kxsNum }}</span>
                   </div>
@@ -241,7 +249,9 @@
                     <div class="name">{{ item.name }}</div>
                   </div>
                   <div class="boot">
-                    <div class="child">件数:{{ item.value }}</div>
+                    <div class="child" @click="echar">
+                      件数:{{ item.value }}
+                    </div>
                     <div class="child">占比:{{ item.prot }}</div>
                   </div>
                 </div>
@@ -264,6 +274,7 @@ export default {
       dataall: {
         id: 1,
         name: "总件数",
+        name2: "申报件数",
         cont: "",
         data: [
           { value: 335, name: "1" },
@@ -323,6 +334,7 @@ export default {
       dataLow: {
         id: 2,
         name: "总件数",
+        name2: "低风险货物级",
         cont: "500",
         data: [],
         top: "41%",
@@ -340,6 +352,7 @@ export default {
       dataLowcp: {
         id: 3,
         name: "总件数",
+        name2: "优先级",
         cont: "500",
         data: [],
         top: "41%",
@@ -357,6 +370,7 @@ export default {
       dataLowpt: {
         id: 4,
         name: "总件数",
+        name2: "普通级",
         cont: "500",
         data: [],
         top: "41%",
@@ -374,6 +388,7 @@ export default {
       dataLowyk: {
         id: 5,
         name: "总件数",
+        name2: "严控级",
         cont: "500",
         data: [],
         top: "41%",
@@ -391,6 +406,7 @@ export default {
       dataLowgf: {
         id: 6,
         name: "总件数",
+        name2: "高风险货物级",
         cont: "500",
         data: [],
         top: "38%",
@@ -413,7 +429,7 @@ export default {
     SecurityCheckHeader,
   },
   created() {
-    this.getData();
+    // this.getData();
   },
   methods: {
     search(data) {
@@ -423,6 +439,7 @@ export default {
         riskRating: data[1],
         agentCode: data[2],
       };
+      this.getData();
     },
     //点击跳转
     echar() {
@@ -436,7 +453,7 @@ export default {
     },
     async getData() {
       try {
-        const result = await comprehensive({});
+        const result = await comprehensive(this.queryData);
         let count = 0;
         let counts = 0;
         let arr = [];