|
@@ -299,18 +299,23 @@ 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: [{
|
|
|
id: this.FloorID,
|
|
|
- infos: { floorMap: this.key },
|
|
|
+ infos: {
|
|
|
+ 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
|
|
|
}
|
|
|
}],
|
|
|
- // projection: ['infos', 'properties'],
|
|
|
}
|
|
|
manageUpdateFloor(Param, (res) => {
|
|
|
this.$message.success('更新成功')
|
|
@@ -399,6 +404,7 @@ export default {
|
|
|
this.curImgItem.showType = SImageShowType.AutoFit;
|
|
|
if (v.properties) {
|
|
|
try {
|
|
|
+ const point = JSON.parse(v.infos.floorMapShift)
|
|
|
// 计算两个比例尺差距
|
|
|
const scaleItem = this.$refs.drawFloor.scaleItem
|
|
|
this.curImgItem.zOrder = scaleItem.zOrder - 1;
|
|
@@ -407,7 +413,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);
|
|
|
}
|