|
@@ -71,19 +71,16 @@
|
|
</template>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <!-- <image
|
|
|
|
|
|
+ <image
|
|
class="redar-pic"
|
|
class="redar-pic"
|
|
src="../../static/rander.png"
|
|
src="../../static/rander.png"
|
|
mode=""
|
|
mode=""
|
|
:style="{
|
|
:style="{
|
|
- transform:
|
|
|
|
- 'translate(' +
|
|
|
|
- -xOffset / 100 +
|
|
|
|
- 'rpx,' +
|
|
|
|
- -yOffset / 100 +
|
|
|
|
- 'rpx)',
|
|
|
|
|
|
+ transform: `translate(${-xOffset}rpx, ${-yOffset}rpx) rotate(${
|
|
|
|
+ devInfo.northAngle
|
|
|
|
+ }deg)`,
|
|
}"
|
|
}"
|
|
- /> -->
|
|
|
|
|
|
+ />
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="switchBox">
|
|
<view class="switchBox">
|
|
@@ -463,10 +460,6 @@ export default {
|
|
Math.abs(
|
|
Math.abs(
|
|
this.devInfo.xxEnd - this.devInfo.xxStart
|
|
this.devInfo.xxEnd - this.devInfo.xxStart
|
|
) * 100;
|
|
) * 100;
|
|
- this.xOffset =
|
|
|
|
- (this.devInfo.xxStart + this.devInfo.xxEnd) * 50;
|
|
|
|
- this.yOffset =
|
|
|
|
- -(this.devInfo.yyStart + this.devInfo.yyEnd) * 50;
|
|
|
|
this.statusLight = this.devInfo.statusLight;
|
|
this.statusLight = this.devInfo.statusLight;
|
|
this.calculate(this.width, this.length);
|
|
this.calculate(this.width, this.length);
|
|
// 设备分享权限判断
|
|
// 设备分享权限判断
|
|
@@ -820,7 +813,7 @@ export default {
|
|
clearTimeout(this.inactivityTimer);
|
|
clearTimeout(this.inactivityTimer);
|
|
this.inactivityTimer = setTimeout(() => {
|
|
this.inactivityTimer = setTimeout(() => {
|
|
this.targetPoints = {};
|
|
this.targetPoints = {};
|
|
- console.log("长时间没有点位消除");
|
|
|
|
|
|
+ console.log("没有点位,消除点位数据");
|
|
}, 1500);
|
|
}, 1500);
|
|
// 验证topic格式
|
|
// 验证topic格式
|
|
const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
@@ -927,26 +920,31 @@ export default {
|
|
|
|
|
|
return existingPoint;
|
|
return existingPoint;
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ // 计算缩放比例
|
|
calculate(width, length) {
|
|
calculate(width, length) {
|
|
let zoomTime = width > length ? width : length;
|
|
let zoomTime = width > length ? width : length;
|
|
let practical = zoomTime / 100;
|
|
let practical = zoomTime / 100;
|
|
this.zoomTimes = 710 / practical;
|
|
this.zoomTimes = 710 / practical;
|
|
- this.normalizeZoomTimes(this.zoomTimes);
|
|
|
|
|
|
+ // this.normalizeZoomTimes(this.zoomTimes);
|
|
this.zoomTimes = this.zoomTimes - 0.2;
|
|
this.zoomTimes = this.zoomTimes - 0.2;
|
|
|
|
+ this.zoomTimes = Number(this.zoomTimes.toFixed(2));
|
|
|
|
+ this.xOffset = this.devInfo.xxStart + this.devInfo.xxEnd;
|
|
|
|
+ this.yOffset = -(this.devInfo.yyStart + this.devInfo.yyEnd);
|
|
|
|
+ console.log(this.xOffset, this.yOffset, this.zoomTimes, "偏移量");
|
|
this.lnbActionJudean = true;
|
|
this.lnbActionJudean = true;
|
|
- this.lnbAction = "action8";
|
|
|
|
},
|
|
},
|
|
normalizeZoomTimes(num) {
|
|
normalizeZoomTimes(num) {
|
|
const intPart = Math.floor(num);
|
|
const intPart = Math.floor(num);
|
|
const decimalPart = num - intPart;
|
|
const decimalPart = num - intPart;
|
|
-
|
|
|
|
|
|
+ let result;
|
|
if (decimalPart >= 0.1 && decimalPart < 0.5) {
|
|
if (decimalPart >= 0.1 && decimalPart < 0.5) {
|
|
- return intPart;
|
|
|
|
|
|
+ result = intPart;
|
|
} else if (decimalPart >= 0.5 && decimalPart < 0.9) {
|
|
} else if (decimalPart >= 0.5 && decimalPart < 0.9) {
|
|
- return intPart + 0.5;
|
|
|
|
|
|
+ result = intPart + 0.5;
|
|
|
|
+ } else {
|
|
|
|
+ result = num;
|
|
}
|
|
}
|
|
- return num;
|
|
|
|
|
|
+ return Math.round(result * 100) / 100;
|
|
},
|
|
},
|
|
|
|
|
|
formatTime(time) {
|
|
formatTime(time) {
|
|
@@ -1036,6 +1034,7 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
|
+ this.lnbAction = "action8";
|
|
const devItem = JSON.parse(options.devItem);
|
|
const devItem = JSON.parse(options.devItem);
|
|
const { devId, clientId } = devItem;
|
|
const { devId, clientId } = devItem;
|
|
// 缓存到页面实例
|
|
// 缓存到页面实例
|
|
@@ -1056,6 +1055,7 @@ export default {
|
|
|
|
|
|
onShow() {
|
|
onShow() {
|
|
this.showModle = true;
|
|
this.showModle = true;
|
|
|
|
+ this.lnbAction = "action8";
|
|
// MQTT 初始化
|
|
// MQTT 初始化
|
|
const userId = uni.getStorageSync("userId");
|
|
const userId = uni.getStorageSync("userId");
|
|
if (!userId) return console.error("MQTT 初始化失败:缺少 userId");
|
|
if (!userId) return console.error("MQTT 初始化失败:缺少 userId");
|
|
@@ -1206,8 +1206,8 @@ export default {
|
|
}
|
|
}
|
|
.redar-pic {
|
|
.redar-pic {
|
|
position: absolute;
|
|
position: absolute;
|
|
- left: 50%;
|
|
|
|
- top: 50%;
|
|
|
|
|
|
+ // left: 50%;
|
|
|
|
+ // top: 50%;
|
|
width: 40rpx;
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
height: 40rpx;
|
|
transform: translate(-50%, -50%); /* 先居中 */
|
|
transform: translate(-50%, -50%); /* 先居中 */
|