|
|
@@ -511,14 +511,21 @@ export default {
|
|
|
// this.pestList = [];
|
|
|
const markers = [];
|
|
|
// 根据原图宽度计算缩放比例
|
|
|
+ // if (this.originalW >= 5000) {
|
|
|
+ // this.baseScale = 0.25;
|
|
|
+ // } else if (this.originalW >= 4000) {
|
|
|
+ // this.baseScale = 0.31;
|
|
|
+ // } else {
|
|
|
+ // this.baseScale = 0.4;
|
|
|
+ // }
|
|
|
let scaleRatio = 3.07;
|
|
|
- // if (this.imageWidth >= 5000) {
|
|
|
- // scaleRatio = 4;
|
|
|
- // } else if (this.imageWidth >= 4000) {
|
|
|
- // scaleRatio = 1;
|
|
|
- // } else {
|
|
|
- // scaleRatio = 2.5;
|
|
|
- // }
|
|
|
+ if (this.imageWidth >= 5000) {
|
|
|
+ scaleRatio = 4;
|
|
|
+ } else if (this.imageWidth >= 4000) {
|
|
|
+ scaleRatio = 100/31;
|
|
|
+ } else {
|
|
|
+ scaleRatio = 2.5;
|
|
|
+ }
|
|
|
// const pestArr = new Map()
|
|
|
this.currentImg.mark.map((item, index) => {
|
|
|
// if(pestArr.has(item.text)){
|
|
|
@@ -540,8 +547,8 @@ export default {
|
|
|
this.is_mark = 1
|
|
|
const { startX, startY,text } = item;
|
|
|
// 使用缩放比例计算标记位置和尺寸
|
|
|
- const x = item.width > 0 ? (startX * scaleRatio / this.imageWidth) * 105 : ((startX + item.width) * scaleRatio / this.imageWidth) * 105;
|
|
|
- const y = item.height > 0 ? (startY * scaleRatio / this.imageHeight) * 105 : ((startY + item.height) * scaleRatio / this.imageHeight) * 105;
|
|
|
+ const x = item.width > 0 ? (startX * scaleRatio / this.imageWidth) * 100 : ((startX + item.width) * scaleRatio / this.imageWidth) * 100;
|
|
|
+ const y = item.height > 0 ? (startY * scaleRatio / this.imageHeight) * 100 : ((startY + item.height) * scaleRatio / this.imageHeight) * 100;
|
|
|
const width = (item.width > 0 ? item.width : -item.width) * scaleRatio / this.imageWidth * 100;
|
|
|
const height = (item.height > 0 ? item.height : -item.height) * scaleRatio / this.imageHeight * 100;
|
|
|
|