Browse Source

增加提示时间
Signed-off-by: Caner <5658514@qq.com>

Caner 4 years ago
parent
commit
7c8ef4c26f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      web/src/pages/index/views/index.vue

+ 7 - 2
web/src/pages/index/views/index.vue

@@ -28,7 +28,7 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { Icon, Button, Notice } from "view-design";
+import { Icon, Button, Notice, Message } from "view-design";
 import "view-design/dist/styles/iview.css";
 import "view-design/dist/styles/iview.css";
 import axios from "@/utils/axios";
 import axios from "@/utils/axios";
 import ImageCompressor from "js-image-compressor";
 import ImageCompressor from "js-image-compressor";
@@ -111,8 +111,8 @@ export default {
     // 识别
     // 识别
     async save() {
     async save() {
       if (!this.newImg.length) return;
       if (!this.newImg.length) return;
+      const start = Date.now();
       try {
       try {
-        console.log(this.newImg[0].data);
         this.show = true;
         this.show = true;
         const formData = new FormData();
         const formData = new FormData();
         formData.append("pic", this.newImg[0].data);
         formData.append("pic", this.newImg[0].data);
@@ -124,6 +124,11 @@ export default {
         });
         });
       }
       }
       this.show = false;
       this.show = false;
+      const end = Date.now();
+      Message.info({
+        content: "识别总用时:" + (start - end) / 1000 + "s",
+        duration: 5,
+      });
     },
     },
     // 处理数据
     // 处理数据
     setData(data) {
     setData(data) {