jinx 1 일 전
부모
커밋
112e8499cd
3개의 변경된 파일28개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 2
      src/api.js
  2. 19 4
      src/views/Report/index.vue
  3. 7 7
      src/views/Report/tagCoordinateList.json

+ 2 - 2
src/api.js

@@ -66,9 +66,9 @@ export function stopReport(data) {
 
   return axios.post(url, data).then((res) => {
     if (res?.data?.code === 200 || res?.status === 200) {
-      return res?.data?.msg || "stop report success";
+      return res?.data || "stop report success";
     } else {
-      throw res?.data?.msg || "stop report failed";
+      throw res?.data?.message || "stop report failed";
     }
   });
 }

+ 19 - 4
src/views/Report/index.vue

@@ -58,7 +58,9 @@
         @click="onPauseReport()"
       >
         <span class="btn-content">
-          <span class="btn-name">{{ reportStatus === "paused" ? "继续" : "暂停" }}</span>
+          <span class="btn-name">{{
+            reportStatus === "paused" ? "继续" : "暂停"
+          }}</span>
         </span>
       </el-button>
       <el-button
@@ -94,7 +96,7 @@
 </template>
 
 <script>
-import { ElMessage } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 import { reportTagInfo, startReport, stopReport } from "@/api.js";
 import tagCoordinateList from "./tagCoordinateList.json";
 import reportInfoStream from "./reportInfoStream.js";
@@ -137,7 +139,6 @@ export default {
     if (this.$route.query.userId) {
       this.userId = this.$route.query.userId;
     }
-    console.error(this.$route.query);
     const floorList = Array.from(
       new Set(this.tagList.map((item) => item.floor).filter(Boolean)),
     );
@@ -304,10 +305,19 @@ export default {
       this.isRequesting = false;
 
       try {
-        await stopReport({
+        let res = await stopReport({
           num: this.num,
           userId: this.userId,
         });
+        console.error(res);
+        if (res.data) {
+          ElMessageBox.alert(`记录ID: ${res.data}`, "", {
+            confirmButtonText: "OK",
+            callback: (action) => {
+              console.log(action);
+            },
+          });
+        }
       } catch (err) {
         ElMessage({
           message: err?.message || err || "stopReport failed",
@@ -430,3 +440,8 @@ export default {
   }
 }
 </style>
+<style>
+.el-message-box {
+  width: 80% !important;
+}
+</style>

+ 7 - 7
src/views/Report/tagCoordinateList.json

@@ -30,9 +30,9 @@
     "locationDesc": "生产间和会议室中间",
     "tagNo": "E28011B0A50500768C96289B",
     "pos": {
-      "x": 6.42187596861534,
-      "y": -4.177731905625157,
-      "z": -2.5812
+      "x": 6.352335283580645,
+      "y": -0.08353091640323823,
+      "z": -2.5825
     }
   },
   {
@@ -42,9 +42,9 @@
     "locationDesc": "生产间",
     "tagNo": "E28011B0A50500768C9602FB",
     "pos": {
-      "x": 6.352335283580645,
-      "y": -0.08353091640323823,
-      "z": -2.5825
+      "x": 6.42187596861534,
+      "y": -4.177731905625157,
+      "z": -2.5812
     }
   },
   {
@@ -695,4 +695,4 @@
       "z": -6.2716
     }
   }
-]
+]