chenrui  2 years ago
parent
commit
0ed74bb569

+ 3 - 1
src/views/securityCheck/components/graphicHome.vue

@@ -36,7 +36,9 @@ export default {
       //统计折线
       pillar.series[0].data = this.texter.data;
       pillar.title.text = this.texter.name;
-      pillar.title.subtext = this.texter.cont;
+      pillar.title.subtext = this.texter.kaer
+        ? this.texter.cont + "%"
+        : this.texter.cont;
       pillar.title.top = this.texter.top;
       pillar.series[0].color = this.texter.color;
       pillar.series[0].name = this.texter.name2;

+ 81 - 5
src/views/securityCheck/views/cargoCharts.vue

@@ -55,7 +55,7 @@ export default {
         },
         data: [
           { value: 335, name: "1" },
-          { value: 310, name: "2" },
+          { value: 0, name: "2" },
         ],
         subtextStyle: {
           fontSize: "28",
@@ -66,7 +66,8 @@ export default {
       },
       datarisk: {
         id: 8,
-        name: "高风险货物级",
+        kaer: 1,
+        name: "高风险",
         cont: "70%",
         top: "35%",
         textStyle: {
@@ -86,7 +87,8 @@ export default {
       },
       dataLowrisk: {
         id: 9,
-        name: "低风险货物级",
+        kaer: 1,
+        name: "低风险",
         cont: "70%",
         top: "35%",
         data: [
@@ -106,6 +108,7 @@ export default {
       },
       datafirst: {
         id: 10,
+        kaer: 1,
         name: "优先级",
         cont: "10%",
         top: "35%",
@@ -126,6 +129,7 @@ export default {
       },
       dataordinary: {
         id: 11,
+        kaer: 1,
         name: "普通级",
         cont: "10%",
         top: "35%",
@@ -146,6 +150,7 @@ export default {
       },
       datastrictly: {
         id: 12,
+        kaer: 1,
         name: "严控级",
         cont: "10%",
         top: "35%",
@@ -223,8 +228,79 @@ export default {
           let alldata = arrall + Lowall + firsall + ptall + strictlyall; // 总数
           this.init(arr, arrx, Low, firs, pt, strictly);
           this.dataall.cont = alldata;
-
-          this.datarisk.data = result.data;
+          this.dataall.data = [
+            {
+              value: 0,
+              name: "",
+            },
+            {
+              value: alldata,
+              name: "总数",
+            },
+          ];
+          this.datarisk.cont = Math.floor((arrall / alldata).toFixed(2) * 100);
+          this.datarisk.data = [
+            {
+              value: alldata,
+              name: "总数",
+            },
+            {
+              value: arrall,
+              name: "高风险",
+            },
+          ];
+          this.dataLowrisk.cont = Math.floor(
+            (Lowall / alldata).toFixed(2) * 100
+          );
+          this.dataLowrisk.data = [
+            {
+              value: alldata,
+              name: "总数",
+            },
+            {
+              value: Lowall,
+              name: "低风险",
+            },
+          ];
+          this.datafirst.cont = Math.floor(
+            (firsall / alldata).toFixed(2) * 100
+          );
+          this.datafirst.data = [
+            {
+              value: alldata,
+              name: "总数",
+            },
+            {
+              value: firsall,
+              name: "优先级",
+            },
+          ];
+          this.dataordinary.cont = Math.floor(
+            (ptall / alldata).toFixed(2) * 100
+          );
+          this.dataordinary.data = [
+            {
+              value: alldata,
+              name: "总数",
+            },
+            {
+              value: ptall,
+              name: "普通",
+            },
+          ];
+          this.datastrictly.cont = Math.floor(
+            (strictlyall / alldata).toFixed(2) * 100
+          );
+          this.datastrictly.data = [
+            {
+              value: alldata,
+              name: "总数",
+            },
+            {
+              value: strictlyall,
+              name: "严控级",
+            },
+          ];
         }
         console.log(result);
       } catch (error) {