Procházet zdrojové kódy

提交家具保存回显问题

wangming před 1 dnem
rodič
revize
a933cac5b0

+ 1 - 1
src/pages/home/home.vue

@@ -98,7 +98,7 @@
             </movable-view>
         </movable-area> -->
 
-        <view class="bot_version"> v3.1.0</view>
+        <view class="bot_version"> v3.1.3</view>
         <view
             class="shareInfo"
             @click="goDeviceShare('sure')"

+ 5 - 0
src/pagesA/deviceDetail/deviceDetail.vue

@@ -482,12 +482,17 @@ export default {
 
                     console.log(this.modules, 88888);
                     this.modules.forEach((item) => {
+                        // 1️⃣ 计算家具在参考系中的矩形
                         const rect = convert_furniture_r2c(item, pRadar);
                         const rotatedRect = rotateRect_cw(
                             rect,
                             pRadar,
                             pRadar.angle
                         );
+                        item.left = rotatedRect.left;
+                        item.top = rotatedRect.top;
+                        item.width = rotatedRect.width;
+                        item.height = rotatedRect.length;
                         item.name = item.name;
                         item.type = item.type;
                     });

+ 11 - 8
src/pagesA/roomSetting/roomSetting.vue

@@ -649,7 +649,6 @@ export default {
         },
 
         saveRoom() {
-            console.log(this.modules, 88888);
             const pRadar = {
                 x: this.x_radar,
                 y: this.y_radar,
@@ -660,10 +659,13 @@ export default {
             copyModule.forEach((item) => {
                 const rect = rotateRect_ccw(item, pRadar, pRadar.angle);
                 const rotatedRect = convert_region_c2r(rect, pRadar);
-                // item.x = rotatedRect.x;
-                // item.y = rotatedRect.y;
-                // item.width = rotatedRect.width;
-                // item.length = rotatedRect.length;
+                item.width = item.width;
+                item.length = item.length;
+                item.name = item.name;
+                item.type = item.type;
+                item.rotate = item.rotate || 0;
+                item.x = rotatedRect.x_cm_start;
+                item.y = rotatedRect.y_cm_start;
             });
             for (const item of copyModule) {
                 if (
@@ -680,8 +682,6 @@ export default {
                     return; // 这里能真正退出整个函数
                 }
             }
-
-            console.log(copyModule, 999999);
             this.$http
                 .post(
                     "wap/room/saveRoom",
@@ -805,7 +805,10 @@ export default {
                             pRadar,
                             pRadar.angle
                         );
-                        console.log(rotatedRect, 999999);
+                        item.left = rotatedRect.left;
+                        item.top = rotatedRect.top;
+                        item.width = rotatedRect.width;
+                        item.height = rotatedRect.height;
                         item.name = item.name;
                         item.type = item.type;
                     });