|
@@ -320,13 +320,19 @@ export default {
|
|
|
const line = scaleItem.line.map(t => {
|
|
|
return { x: t.x + this.baseImgItem.x, y: t.y + this.baseImgItem.y }
|
|
|
})
|
|
|
+ // 计算放缩比例
|
|
|
+ const proDis = SMathUtil.pointDistance(line[0].x, line[0].y, line[1].x, line[1].y)
|
|
|
+ const proText = scaleItem.text.substring(0, scaleItem.text.length - 3);
|
|
|
+ const proScale = proDis / proText;
|
|
|
let Param = {
|
|
|
Content: [{
|
|
|
FloorId: this.FloorID,
|
|
|
- StructureInfo: { FloorMap: this.key },
|
|
|
+ StructureInfo: {
|
|
|
+ FloorMap: this.key,
|
|
|
+ FloorMapRatio: proScale,
|
|
|
+ FloorMapShift: JSON.stringify({X: this.baseImgItem.x, Y: this.baseImgItem.y})
|
|
|
+ },
|
|
|
Properties: {
|
|
|
- X: this.baseImgItem.x,
|
|
|
- Y: this.baseImgItem.y,
|
|
|
Line: line,
|
|
|
Text: scaleItem.text
|
|
|
}
|
|
@@ -423,8 +429,11 @@ export default {
|
|
|
this.curImgItem = new SImageItem(null, url);
|
|
|
this.curImgItem.enabled = false;
|
|
|
this.curImgItem.showType = SImageShowType.AutoFit;
|
|
|
+ const structure = v.StructureInfo;
|
|
|
if (v.Properties) {
|
|
|
try {
|
|
|
+ //
|
|
|
+ const point = JSON.parse(structure.FloorMapShift)
|
|
|
// 计算两个比例尺差距
|
|
|
const scaleItem = this.$refs.drawFloor.scaleItem
|
|
|
this.curImgItem.zOrder = scaleItem.zOrder - 1;
|
|
@@ -433,7 +442,7 @@ export default {
|
|
|
this.$message.warning('比例尺相差较大,可以返回上一步修改比例尺')
|
|
|
}
|
|
|
this.curImgItem.showType == SImageShowType.Full;
|
|
|
- this.curImgItem.moveTo(v.Properties.X, v.Properties.Y);
|
|
|
+ this.curImgItem.moveTo(point.X, point.Y);
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
}
|