Bladeren bron

展示优化

zhangliang2 2 jaren geleden
bovenliggende
commit
c9598c54f5

+ 36 - 10
src/views/modelLibrary/vehicleConfigurationDetail.vue

@@ -148,11 +148,15 @@
                     ></span>
                 </div>
 
+                <div class="axesHelperBox">
+                    <div class="axesHelperPic"></div>
+                </div>
+
                 <three-sensor
                     ref="threeSensor"
-                    :xValue="coordinate.x"
-                    :yValue="coordinate.y"
-                    :zValue="coordinate.z"
+                    :xValue="coordinate.y"
+                    :yValue="coordinate.z"
+                    :zValue="coordinate.x"
                     :hValue="coordinate.p"
                     :pValue="coordinate.r"
                     :rValue="coordinate.h"
@@ -466,7 +470,7 @@ export default {
             // coordinate: { x: 20, y: 20, z: 20, h: 20, p: 20, r: 20 }, // 存放传递给展示的值
             configBox: false, // 配置项box
             carModel: "", // 车模型
-            rate: 20, // 坐标换算倍数
+            // rate: 20, // 坐标换算倍数
         };
     },
 
@@ -518,7 +522,11 @@ export default {
     },
 
     computed: {
-        ...mapState(["fileHost", "fileUrl"]),
+        ...mapState(["fileHost", "fileUrl", "scale"]),
+        // 坐标换算倍数
+        rate() {
+            return 40 / this.scale;
+        },
     },
 
     methods: {
@@ -553,7 +561,7 @@ export default {
         vehicleChange(id) {
             let item = this.vehicleNameList.find((i) => i.id == id);
             this.form.vehicleDescription = item.description;
-            console.log(item);
+            // console.log(item);
 
             // if (this.form.vehicleType[1]) {
             //     this.carModel = this.form.vehicleType[1];
@@ -750,15 +758,15 @@ export default {
         },
         posChange(val, type) {
             switch (type) {
-                case "x":
+                case "z":
                     this.coordinate.x = +val;
                     this.formA.sensorX = Math.floor(val * this.rate);
                     break;
-                case "y":
+                case "x":
                     this.coordinate.y = +val;
                     this.formA.sensorY = Math.floor(val * this.rate);
                     break;
-                case "z":
+                case "y":
                     this.coordinate.z = +val;
                     this.formA.sensorZ = Math.floor(val * this.rate);
                     break;
@@ -801,7 +809,7 @@ export default {
                     this.configList = res.info.configSensors;
                     // this.modelImgSrc = this.getImgUrl(res.info.vehicleTopView);
                     this.carModel = this.getImgUrl(res.info.vehicleFrontView);
-                    console.log(this.carModel);
+                    // console.log(this.carModel);
                     // this.$refs.threeSensor.initCar(
                     //     this.getImgUrl(res.info.vehicleFrontView)
                     // );
@@ -939,6 +947,24 @@ export default {
             }
         }
 
+        .axesHelperBox {
+            position: absolute;
+            left: 2px;
+            top: 60px;
+            width: 143px;
+            height: 135px;
+            // background-color: #ffffff;
+            // opacity: 0.75;
+
+            .axesHelperPic {
+                width: 100%;
+                height: 100%;
+                background: url("../../assets/common/image/axesHelper.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+        }
+
         .conditions {
             position: absolute;
             right: 2px;

+ 36 - 10
src/views/modelLibrary/vehicleConfigurationDetailThree.vue

@@ -148,11 +148,15 @@
                     ></span>
                 </div>
 
+                <div class="axesHelperBox">
+                    <div class="axesHelperPic"></div>
+                </div>
+
                 <three-sensor
                     ref="threeSensor"
-                    :xValue="coordinate.x"
-                    :yValue="coordinate.y"
-                    :zValue="coordinate.z"
+                    :xValue="coordinate.y"
+                    :yValue="coordinate.z"
+                    :zValue="coordinate.x"
                     :hValue="coordinate.p"
                     :pValue="coordinate.r"
                     :rValue="coordinate.h"
@@ -466,7 +470,7 @@ export default {
             // coordinate: { x: 20, y: 20, z: 20, h: 20, p: 20, r: 20 }, // 存放传递给展示的值
             configBox: false, // 配置项box
             carModel: "", // 车模型
-            rate: 20, // 坐标换算倍数
+            // rate: 20, // 坐标换算倍数
         };
     },
 
@@ -518,7 +522,11 @@ export default {
     },
 
     computed: {
-        ...mapState(["fileHost", "fileUrl"]),
+        ...mapState(["fileHost", "fileUrl", "scale"]),
+        // 坐标换算倍数
+        rate() {
+            return 40 / this.scale;
+        },
     },
 
     methods: {
@@ -553,7 +561,7 @@ export default {
         vehicleChange(id) {
             let item = this.vehicleNameList.find((i) => i.id == id);
             this.form.vehicleDescription = item.description;
-            console.log(item);
+            // console.log(item);
 
             // if (this.form.vehicleType[1]) {
             //     this.carModel = this.form.vehicleType[1];
@@ -750,15 +758,15 @@ export default {
         },
         posChange(val, type) {
             switch (type) {
-                case "x":
+                case "z":
                     this.coordinate.x = +val;
                     this.formA.sensorX = Math.floor(val * this.rate);
                     break;
-                case "y":
+                case "x":
                     this.coordinate.y = +val;
                     this.formA.sensorY = Math.floor(val * this.rate);
                     break;
-                case "z":
+                case "y":
                     this.coordinate.z = +val;
                     this.formA.sensorZ = Math.floor(val * this.rate);
                     break;
@@ -801,7 +809,7 @@ export default {
                     this.configList = res.info.configSensors;
                     // this.modelImgSrc = this.getImgUrl(res.info.vehicleTopView);
                     this.carModel = this.getImgUrl(res.info.vehicleFrontView);
-                    console.log(this.carModel);
+                    // console.log(this.carModel);
                     // this.$refs.threeSensor.initCar(
                     //     this.getImgUrl(res.info.vehicleFrontView)
                     // );
@@ -939,6 +947,24 @@ export default {
             }
         }
 
+        .axesHelperBox {
+            position: absolute;
+            left: 2px;
+            top: 60px;
+            width: 143px;
+            height: 135px;
+            // background-color: #ffffff;
+            // opacity: 0.75;
+
+            .axesHelperPic {
+                width: 100%;
+                height: 100%;
+                background: url("../../assets/common/image/axesHelper.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+        }
+
         .conditions {
             position: absolute;
             right: 2px;