chenjun 2 жил өмнө
parent
commit
a5649308d0

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

@@ -15,6 +15,13 @@ export default {
       type: Object,
     },
   },
+  watch:{
+    "texter":function(val){
+      if(val){
+        this.init();
+      }
+    }
+  },
   data() {
     return {};
   },

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

@@ -371,13 +371,13 @@
 <script>
 import GraphicEchart from "../components/graphicHome.vue";
 import SecurityCheckHeader from "../components/securityCheckHeader.vue";
-import { comprehensiveTable } from "@/api/statistics/statistics.js";
+import { comprehensive } from "@/api/statistics/statistics.js";
 export default {
   data() {
     return {
       dataall: {
         name: "总件数",
-        cont: "500",
+        cont: "",
         data: [
           { value: 335, name: "1" },
           { value: 310, name: "2" },
@@ -423,22 +423,26 @@ export default {
     GraphicEchart,
     SecurityCheckHeader,
   },
-  created(){
-    this.getData()
+  created() {
+    this.getData();
   },
   methods: {
     change() {
       this.$router.push("./cargoTable");
     },
-    async getData(){
-      try{
-        const result = await comprehensiveTable({
-          });
-          
-      }catch(error){
-          console.log(error)
+    async getData() {
+      try {
+        const result = await comprehensive({});
+        let count = 0;
+        //获取总件数:
+        result.data.forEach((item) => {
+          count += item.num;
+        });
+        this.dataall.cont=count;
+      } catch (error) {
+        console.log(error);
       }
-    }
+    },
   },
 };
 </script>