Преглед на файлове

fix: 修复多个页面的显示逻辑与标记计算问题

1. 将detail.vue的v-if替换为v-show优化切换渲染
2. 调整devicePhoto.vue的缩放比例与标记偏移参数
3. 修复equipList2.vue的设备型号初始化逻辑,注释多余的全部选项添加逻辑与调用
4. 优化代码格式与可读性
allen преди 1 ден
родител
ревизия
20998fddc1
променени са 3 файла, в които са добавени 22 реда и са изтрити 17 реда
  1. 2 2
      pages/bzy/detail.vue
  2. 3 4
      pages/cbd/devicePhoto.vue
  3. 17 11
      pages/equipList2/index.vue

+ 2 - 2
pages/bzy/detail.vue

@@ -70,7 +70,7 @@
           </view>
         </view>
       </view>
-      <view v-if="activeTab === 'viewImage'">
+      <view v-show="activeTab === 'viewImage'">
         <photoImage
           :images="imageList"
           :pestList="pestList"
@@ -80,7 +80,7 @@
           :deviceInfo="deviceInfo"
         />
       </view>
-      <view v-if="activeTab === 'deviceData'">
+      <view v-show="activeTab === 'deviceData'">
         <DeviceData
           :deviceStatic="deviceStatic"
           :deviceInfo="deviceInfo"

+ 3 - 4
pages/cbd/devicePhoto.vue

@@ -471,7 +471,6 @@ export default {
               });
             }
           });
-          console.log(markers,'markersmarkers')
           this.bugMarkers = markers;
         } catch (error) {
           console.error('处理label参数失败:', error);
@@ -481,7 +480,7 @@ export default {
         this.pestList = [];
         const markers = [];
         // 根据原图宽度计算缩放比例
-        let scaleRatio = 4;
+        let scaleRatio = 3.1;
         // if (this.imageWidth >= 5000) {
         //   scaleRatio = 4;
         // } else if (this.imageWidth >= 4000) {
@@ -510,8 +509,8 @@ export default {
           this.is_mark = 1
           const { startX, startY,text } = item;
           // 使用缩放比例计算标记位置和尺寸
-          const x = (startX * scaleRatio / this.imageWidth) * 100;
-          const y = (startY * scaleRatio / this.imageHeight) * 100;
+          const x = (startX * scaleRatio / this.imageWidth) * 105;
+          const y = (startY * scaleRatio / this.imageHeight) * 105;
           const width = (item.width * scaleRatio / this.imageWidth) * 100;
           const height = (item.height * scaleRatio / this.imageHeight) * 100;
 

+ 17 - 11
pages/equipList2/index.vue

@@ -208,7 +208,13 @@
 						})
 					}
 				}
-        this.type_id = this.list[0].device_type_id;
+				const firstChild = this.list[0];
+        this.type_id = firstChild.device_type_id;
+				if(firstChild.device_type_id !== ''){
+					this.device_model = firstChild?.device_model || '';
+				}else{
+					this.device_model = '';
+				}
         this.initPage();
       },
 			async eqlist(tf) {
@@ -249,18 +255,18 @@
 						list.push(item)
 					}
 				})
-				if(list.length > 1){
-					if(this.list[0].purview_name != '全部'){
-						this.list.unshift({
-							device_type_id: '',
-							purview_name: '全部'
-						})
-					}
-				}
+				// if(list.length > 1){
+				// 	if(this.list[0].purview_name != '全部'){
+				// 		this.list.unshift({
+				// 			device_type_id: '',
+				// 			purview_name: '全部'
+				// 		})
+				// 	}
+				// }
         this.current = index;
         const item = this.list[0];
         this.pur_id = itemData.pur_id || '';
-        this.changeDevice(item,0);
+        // this.changeDevice(item,0);
 			},
       changeDevice(item,index){
 				this.currents = index;
@@ -280,7 +286,7 @@
 					this.device_model = 15;
 				} else if(name === 'zhiCbd'){
 					this.device_model = 16;
-				}else {
+				} else {
 					this.device_model = item.device_model || '';
 				}
 				this.page = 1;