|
@@ -10,46 +10,56 @@
|
|
width: `${length / 200}px`,
|
|
width: `${length / 200}px`,
|
|
height: `${width / 200}px`,
|
|
height: `${width / 200}px`,
|
|
position: 'relative',
|
|
position: 'relative',
|
|
- overflow: 'hidden',
|
|
|
|
|
|
+ transform: `scale(${zoomTimes})`,
|
|
|
|
+ border: `${9 / zoomTimes}rpx solid #333333`,
|
|
}"
|
|
}"
|
|
:class="[
|
|
:class="[
|
|
width < 25500 && length < 25000 ? 'tranStyle' : 'center',
|
|
width < 25500 && length < 25000 ? 'tranStyle' : 'center',
|
|
]"
|
|
]"
|
|
>
|
|
>
|
|
- <view
|
|
|
|
- v-for="(item, index) in modules"
|
|
|
|
- :key="index"
|
|
|
|
- class="moduleContent"
|
|
|
|
- >
|
|
|
|
|
|
+ <template v-if="modules.length > 0">
|
|
<view
|
|
<view
|
|
- :class="item.type"
|
|
|
|
- :style="{
|
|
|
|
- width: `${item.width / 2}px`,
|
|
|
|
- height: `${item.length / 2}px`,
|
|
|
|
- top: `${item.top / 2}px`,
|
|
|
|
- left: `${item.left / 2}px`,
|
|
|
|
- transform: `rotate(${item.rotate}deg)`,
|
|
|
|
- 'transform-origin': 'center center',
|
|
|
|
- }"
|
|
|
|
|
|
+ v-for="(item, index) in modules"
|
|
|
|
+ :key="index"
|
|
|
|
+ class="moduleContent"
|
|
>
|
|
>
|
|
- <image
|
|
|
|
- class="module-img"
|
|
|
|
- :src="`../../static/furnitures/${item.type}.png`"
|
|
|
|
- mode=""
|
|
|
|
- />
|
|
|
|
|
|
+ <view
|
|
|
|
+ :class="item.type"
|
|
|
|
+ :style="{
|
|
|
|
+ width: `${item.width / 2}px`,
|
|
|
|
+ height: `${item.length / 2}px`,
|
|
|
|
+ top: `${item.top / 2}px`,
|
|
|
|
+ left: `${item.left / 2}px`,
|
|
|
|
+ transform: `rotate(${item.rotate}deg)`,
|
|
|
|
+ 'transform-origin': 'center center',
|
|
|
|
+ zIndex: 4444,
|
|
|
|
+ }"
|
|
|
|
+ >
|
|
|
|
+ <image
|
|
|
|
+ style="
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: block;
|
|
|
|
+ "
|
|
|
|
+ :src="`../../static/furnitures/${item.type}.png`"
|
|
|
|
+ mode=""
|
|
|
|
+ />
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <template v-if="devType == 'LNB'">
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <template>
|
|
<view v-for="item in targetPoints" :key="item.id">
|
|
<view v-for="item in targetPoints" :key="item.id">
|
|
<image
|
|
<image
|
|
class="action-icon-M"
|
|
class="action-icon-M"
|
|
:style="{
|
|
:style="{
|
|
position: 'absolute',
|
|
position: 'absolute',
|
|
transform: `translate3d(${
|
|
transform: `translate3d(${
|
|
- item.displayX / 2 + 100
|
|
|
|
|
|
+ item.displayX / 2
|
|
}px, ${
|
|
}px, ${
|
|
- -item.displayY / 2 + 100
|
|
|
|
- }px, 0) translate(-50%, -50%)`,
|
|
|
|
|
|
+ -item.displayY / 2
|
|
|
|
+ }px, 0) translate(-50%, -50%) scale(${
|
|
|
|
+ 1.5 / zoomTimes
|
|
|
|
+ })`,
|
|
zIndex: 9999,
|
|
zIndex: 9999,
|
|
transition: 'transform 1s linear',
|
|
transition: 'transform 1s linear',
|
|
willChange: 'transform',
|
|
willChange: 'transform',
|
|
@@ -59,33 +69,18 @@
|
|
/>
|
|
/>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
- <template v-else>
|
|
|
|
- <image
|
|
|
|
- v-if="actionName"
|
|
|
|
- class="action-icon-G"
|
|
|
|
- :style="{
|
|
|
|
- top: `${top / 200}px`,
|
|
|
|
- left: `${left / 200}px`,
|
|
|
|
- }"
|
|
|
|
- :src="`../../images/furnitures/${actionName}.png`"
|
|
|
|
- mode=""
|
|
|
|
- />
|
|
|
|
- </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">
|
|
@@ -113,7 +108,7 @@
|
|
class="title"
|
|
class="title"
|
|
v-if="
|
|
v-if="
|
|
devInfo.installPosition == 'Bedroom' ||
|
|
devInfo.installPosition == 'Bedroom' ||
|
|
- (breathRate === 0 && breathRate !== '')
|
|
|
|
|
|
+ (breathRate !== 0 && breathRate !== '')
|
|
"
|
|
"
|
|
>
|
|
>
|
|
<view
|
|
<view
|
|
@@ -149,50 +144,35 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="title" v-if="devInfo.installPosition == 'Toilet'">
|
|
|
|
- <view class="title-text" style="color: #22dea7"
|
|
|
|
- >今日卫生间使用频次</view
|
|
|
|
- >
|
|
|
|
- <view class="title-btn" style="color: #22dea7"
|
|
|
|
- >{{
|
|
|
|
- freQuenceList.length == "" ? "0" : freQuenceList.length
|
|
|
|
- }}次</view
|
|
|
|
- >
|
|
|
|
- </view>
|
|
|
|
- <view class="title" v-if="devInfo.installPosition != 'Toilet'">
|
|
|
|
|
|
+ <view class="title">
|
|
<view class="title-text" style="color: #22dea7"
|
|
<view class="title-text" style="color: #22dea7"
|
|
>今日进出频次</view
|
|
>今日进出频次</view
|
|
>
|
|
>
|
|
- <view class="title-btn" style="color: #22dea7"
|
|
|
|
- >{{
|
|
|
|
- freQuenceList.length == "" ? "0" : freQuenceList.length
|
|
|
|
- }}次</view
|
|
|
|
- >
|
|
|
|
|
|
+ <view class="title-btn" style="color: #22dea7">
|
|
|
|
+ {{ freQuenceList.length || 0 }}次
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view
|
|
|
|
- class="stayDetail"
|
|
|
|
- v-if="freQuenceList.length > 0 && freQuenceList.length == 1"
|
|
|
|
- >
|
|
|
|
- <view v-for="item in freQuenceList" :key="item.id">
|
|
|
|
- <view class="stayDetail-item">
|
|
|
|
- <view class="stayDetail-text"
|
|
|
|
- >{{
|
|
|
|
- item.info.start_time.slice(11, 16)
|
|
|
|
- }}目标进入</view
|
|
|
|
- >
|
|
|
|
- <view class="stayDetail-btn"
|
|
|
|
- >{{
|
|
|
|
- item.info.end_time.slice(11, 16)
|
|
|
|
- }}目标离开</view
|
|
|
|
- >
|
|
|
|
|
|
+
|
|
|
|
+ <view class="stayDetail" v-if="freQuenceList.length > 0">
|
|
|
|
+ <!-- 只有一条时直接展示 -->
|
|
|
|
+ <view v-if="freQuenceList.length === 1">
|
|
|
|
+ <view
|
|
|
|
+ v-for="item in freQuenceList"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ class="stayDetail-item"
|
|
|
|
+ >
|
|
|
|
+ <view class="stayDetail-text">
|
|
|
|
+ {{ formatTime(item.enterTime) }}目标进入
|
|
|
|
+ </view>
|
|
|
|
+ <view class="stayDetail-btn">
|
|
|
|
+ {{ formatTime(item.leaveTime) }}目标离开
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view
|
|
|
|
- class="stayDetail"
|
|
|
|
- v-if="freQuenceList.length > 0 && freQuenceList.length > 1"
|
|
|
|
- >
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 多条时用 swiper 展示 -->
|
|
<swiper
|
|
<swiper
|
|
|
|
+ v-else
|
|
class="auto-scroll-swiper"
|
|
class="auto-scroll-swiper"
|
|
:indicator-dots="false"
|
|
:indicator-dots="false"
|
|
:autoplay="false"
|
|
:autoplay="false"
|
|
@@ -208,44 +188,33 @@
|
|
:key="item.id"
|
|
:key="item.id"
|
|
class="stayDetail-item"
|
|
class="stayDetail-item"
|
|
>
|
|
>
|
|
- <view class="stayDetail-text"
|
|
|
|
- >{{
|
|
|
|
- item.info.start_time.slice(11, 16)
|
|
|
|
- }}目标进入</view
|
|
|
|
- >
|
|
|
|
- <view class="stayDetail-btn"
|
|
|
|
- >{{
|
|
|
|
- item.info.end_time.slice(11, 16)
|
|
|
|
- }}目标离开</view
|
|
|
|
- >
|
|
|
|
|
|
+ <view class="stayDetail-text">
|
|
|
|
+ {{ formatTime(item.enterTime) }}目标进入
|
|
|
|
+ </view>
|
|
|
|
+ <view class="stayDetail-btn">
|
|
|
|
+ {{ formatTime(item.leaveTime) }}目标离开
|
|
|
|
+ </view>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="title" v-if="devInfo.installPosition == 'Toilet'">
|
|
|
|
- <view class="title-text" style="color: #ff976a"
|
|
|
|
- >昨日卫生间使用频次</view
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view class="box" v-if="!breathShow">
|
|
|
|
+ <view class="handle-btn">
|
|
|
|
+ <view class="btn1" @click="shareDevice" v-if="shareJudge"
|
|
|
|
+ >分享</view
|
|
>
|
|
>
|
|
- <view class="title-btn" style="color: #ff976a"
|
|
|
|
- >{{
|
|
|
|
- freQuenceList.length == "" ? "0" : freQuenceList.length
|
|
|
|
- }}次</view
|
|
|
|
|
|
+ <view class="noShareFlag" @click="noShareFlag" v-else
|
|
|
|
+ >分享</view
|
|
>
|
|
>
|
|
- </view>
|
|
|
|
- <view class="title" v-else>
|
|
|
|
- <view class="title-text" style="color: #ff976a"
|
|
|
|
- >昨日进出频次</view
|
|
|
|
|
|
+ <view
|
|
|
|
+ class="btn1"
|
|
|
|
+ @click="gotoSetting"
|
|
|
|
+ v-if="devInfo.online == 1"
|
|
|
|
+ >设置</view
|
|
>
|
|
>
|
|
- <view class="title-btn" style="color: #ff976a"
|
|
|
|
- >{{
|
|
|
|
- freQuenceList.length == "" ? "0" : freQuenceList.length
|
|
|
|
- }}次</view
|
|
|
|
|
|
+ <view class="noShareFlag" @click="gotoSetting" v-else
|
|
|
|
+ >设置</view
|
|
>
|
|
>
|
|
- </view> -->
|
|
|
|
- </view>
|
|
|
|
- <view class="box" v-if="!breathShow">
|
|
|
|
- <view class="handle-btn">
|
|
|
|
- <view class="btn1" @click="shareDevice">分享</view>
|
|
|
|
- <view class="btn1" @click="gotoSetting">设置</view>
|
|
|
|
<view class="btn2" @click="healthAlarm">守护计划</view>
|
|
<view class="btn2" @click="healthAlarm">守护计划</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -360,29 +329,17 @@
|
|
@click="breathShow = false"
|
|
@click="breathShow = false"
|
|
></l-echart>
|
|
></l-echart>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
- <!-- <alarModel
|
|
|
|
- v-if="isInitAlarm"
|
|
|
|
- :clientIdProp="clientIdProp"
|
|
|
|
- @sendChange="receptionChange"
|
|
|
|
- @sendHealth="receptHealth"
|
|
|
|
- /> -->
|
|
|
|
-
|
|
|
|
- <!-- <alarModel
|
|
|
|
- v-if="isInitAlarm"
|
|
|
|
- @sendChange="receptionChange"
|
|
|
|
- @sendHealth="receptHealth"
|
|
|
|
- /> -->
|
|
|
|
|
|
+ <alarModel v-if="showModle" ref="alarmModel" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import * as echarts from "../../uni_modules/lime-echart/static/echarts.min";
|
|
import * as echarts from "../../uni_modules/lime-echart/static/echarts.min";
|
|
-
|
|
|
|
-import mqtt from "../../utils/mqtt";
|
|
|
|
|
|
+import MqttService from "../../utils/globalMqtt.js";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ clientId: "",
|
|
width: 0, //检测区域宽度
|
|
width: 0, //检测区域宽度
|
|
length: 0, //检测区域长度
|
|
length: 0, //检测区域长度
|
|
xOffset: 0,
|
|
xOffset: 0,
|
|
@@ -393,10 +350,7 @@ export default {
|
|
endDate: "",
|
|
endDate: "",
|
|
softWare: "",
|
|
softWare: "",
|
|
statusLight: 0,
|
|
statusLight: 0,
|
|
- currentDate: new Date().getTime(),
|
|
|
|
- lnbAction: "action8",
|
|
|
|
- wsj: false,
|
|
|
|
- todayWcTimes: "",
|
|
|
|
|
|
+ lnbAction: "",
|
|
stayDetail: "",
|
|
stayDetail: "",
|
|
todayDate: "",
|
|
todayDate: "",
|
|
dev_id: "",
|
|
dev_id: "",
|
|
@@ -404,7 +358,6 @@ export default {
|
|
devName: "",
|
|
devName: "",
|
|
devType: "",
|
|
devType: "",
|
|
localPhone: uni.getStorageSync("phone"),
|
|
localPhone: uni.getStorageSync("phone"),
|
|
- startArr: [],
|
|
|
|
freQuenceList: [],
|
|
freQuenceList: [],
|
|
// mqtt相关
|
|
// mqtt相关
|
|
currentIndex: 0,
|
|
currentIndex: 0,
|
|
@@ -415,17 +368,14 @@ export default {
|
|
shareModel: false,
|
|
shareModel: false,
|
|
alarmModel: false,
|
|
alarmModel: false,
|
|
sharedPhone: "",
|
|
sharedPhone: "",
|
|
- messageFlag: true,
|
|
|
|
- serviceNumberFlag: true,
|
|
|
|
- voipFlag: true,
|
|
|
|
- isInitAlarm: "",
|
|
|
|
-
|
|
|
|
|
|
+ messageFlag: false,
|
|
|
|
+ serviceNumberFlag: false,
|
|
|
|
+ voipFlag: false,
|
|
// mqtt模块
|
|
// mqtt模块
|
|
targetPoints: {},
|
|
targetPoints: {},
|
|
inactivityTimer: null,
|
|
inactivityTimer: null,
|
|
left: 0,
|
|
left: 0,
|
|
top: 0,
|
|
top: 0,
|
|
- clientIdProp: null,
|
|
|
|
breathRate: "",
|
|
breathRate: "",
|
|
breathShow: false,
|
|
breathShow: false,
|
|
breathRpmList: [],
|
|
breathRpmList: [],
|
|
@@ -479,10 +429,14 @@ export default {
|
|
animation: true,
|
|
animation: true,
|
|
animationDuration: 100,
|
|
animationDuration: 100,
|
|
},
|
|
},
|
|
- index: 0,
|
|
|
|
- loopTimer: null,
|
|
|
|
- mqttClienTwoFlag: false,
|
|
|
|
- mqttClientOne: false,
|
|
|
|
|
|
+ showModle: false,
|
|
|
|
+ zoomTimes: 2,
|
|
|
|
+ // 设备分享权限判断
|
|
|
|
+ shareJudge: false,
|
|
|
|
+ unsubscribeFn: null,
|
|
|
|
+ fallingEventChange: null,
|
|
|
|
+ lnbActionJudean: false,
|
|
|
|
+ setIntervalVal: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
@@ -506,11 +460,13 @@ 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.shareJudge =
|
|
|
|
+ this.devInfo.userId == uni.getStorageSync("userId")
|
|
|
|
+ ? true
|
|
|
|
+ : false;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -550,21 +506,16 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- parseDeviceItem(devItemStr) {
|
|
|
|
- try {
|
|
|
|
- const devItem = JSON.parse(devItemStr);
|
|
|
|
- if (!devItem || !devItem.devId || !devItem.clientId) {
|
|
|
|
- throw new Error("设备信息不完整");
|
|
|
|
- }
|
|
|
|
- return devItem;
|
|
|
|
- } catch (e) {
|
|
|
|
- throw new Error("设备信息解析失败: " + e.message);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 分享功能模块
|
|
// 分享功能模块
|
|
shareDevice() {
|
|
shareDevice() {
|
|
this.choiceVisible = true;
|
|
this.choiceVisible = true;
|
|
},
|
|
},
|
|
|
|
+ noShareFlag() {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "您没有分享权限",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
onShareConfirm() {
|
|
onShareConfirm() {
|
|
if (!this.sharedPhone) {
|
|
if (!this.sharedPhone) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -654,56 +605,36 @@ export default {
|
|
JSON.stringify(this.devInfo),
|
|
JSON.stringify(this.devInfo),
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getFrequency(clientId) {
|
|
|
|
|
|
+ getFrequency(devId) {
|
|
|
|
+ let params = {
|
|
|
|
+ devId: devId,
|
|
|
|
+ createTimeStart: this.$time(new Date()),
|
|
|
|
+ createTimeEnd: this.$time(new Date()),
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 999,
|
|
|
|
+ };
|
|
|
|
+
|
|
this.$http
|
|
this.$http
|
|
- .post(`wap/stats/alarmEventsQuery`, {
|
|
|
|
- clientId: clientId,
|
|
|
|
- createTimeStart: this.$time(new Date()),
|
|
|
|
- createTimeEnd: this.$time(new Date()),
|
|
|
|
- eventType: 1,
|
|
|
|
|
|
+ .post(`wap/stats/inOutEventQuery`, params, {
|
|
|
|
+ header: {
|
|
|
|
+ "Content-Type": "application/json;charset=UTF-8",
|
|
|
|
+ },
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
if (res.data.data.rows.length > 0) {
|
|
if (res.data.data.rows.length > 0) {
|
|
- this.freQuenceList = this.parseJsonToObjects(
|
|
|
|
- res.data.data.rows
|
|
|
|
- );
|
|
|
|
|
|
+ this.freQuenceList = res.data.data.rows;
|
|
} else {
|
|
} else {
|
|
this.freQuenceList = [];
|
|
this.freQuenceList = [];
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- wx.showToast({
|
|
|
|
|
|
+ uni.showToast({
|
|
title: res.data.message,
|
|
title: res.data.message,
|
|
icon: "none",
|
|
icon: "none",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- parseJsonToObjects(jsonArray) {
|
|
|
|
- return jsonArray.map((item) => {
|
|
|
|
- // 解析info字段的JSON字符串
|
|
|
|
- let infoData = {};
|
|
|
|
- try {
|
|
|
|
- infoData = JSON.parse(item.info);
|
|
|
|
- } catch (e) {
|
|
|
|
- console.error("Failed to parse info JSON:", e);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- id: item.id,
|
|
|
|
- clientId: item.clientId,
|
|
|
|
- tenantId: item.tenantId,
|
|
|
|
- devName: item.devName,
|
|
|
|
- uuid: item.uuid,
|
|
|
|
- planUuid: item.planUuid,
|
|
|
|
- eventType: item.eventType,
|
|
|
|
- info: infoData,
|
|
|
|
- isHandle: item.isHandle,
|
|
|
|
- createTime: item.createTime,
|
|
|
|
- remark: item.remark,
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
// 健康闹钟方法
|
|
// 健康闹钟方法
|
|
healthAlarm() {
|
|
healthAlarm() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -723,7 +654,7 @@ export default {
|
|
|
|
|
|
autoSwipe() {
|
|
autoSwipe() {
|
|
if (this.freQuenceList && this.freQuenceList.length > 0) {
|
|
if (this.freQuenceList && this.freQuenceList.length > 0) {
|
|
- setInterval(() => {
|
|
|
|
|
|
+ this.setIntervalVal = setInterval(() => {
|
|
let nextIndex = this.currentIndex + 1;
|
|
let nextIndex = this.currentIndex + 1;
|
|
if (nextIndex >= this.freQuenceList.length) {
|
|
if (nextIndex >= this.freQuenceList.length) {
|
|
nextIndex = 0; // 循环到第一个项目
|
|
nextIndex = 0; // 循环到第一个项目
|
|
@@ -739,12 +670,6 @@ export default {
|
|
JSON.stringify(this.freQuenceList),
|
|
JSON.stringify(this.freQuenceList),
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getCurrentDate() {
|
|
|
|
- const now = new Date();
|
|
|
|
- this.currentDate = `${now.getFullYear()}-${
|
|
|
|
- now.getMonth() + 1
|
|
|
|
- }月${now.getDate().toString().padStart(2, "0")}日`;
|
|
|
|
- },
|
|
|
|
receptionChange(val) {
|
|
receptionChange(val) {
|
|
this.targetPoints = val;
|
|
this.targetPoints = val;
|
|
},
|
|
},
|
|
@@ -754,7 +679,6 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// echarts图表模块
|
|
// echarts图表模块
|
|
-
|
|
|
|
getOption(list) {
|
|
getOption(list) {
|
|
// 固定 X 轴 [0 ~ 60]
|
|
// 固定 X 轴 [0 ~ 60]
|
|
const xData = Array.from({ length: 61 }, (_, i) => i);
|
|
const xData = Array.from({ length: 61 }, (_, i) => i);
|
|
@@ -868,7 +792,6 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
fail: (err) => {
|
|
fail: (err) => {
|
|
- console.error("保存失败:", err);
|
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "保存失败",
|
|
title: "保存失败",
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -877,7 +800,6 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
fail: (err) => {
|
|
fail: (err) => {
|
|
- console.error("导出失败:", err);
|
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "导出失败",
|
|
title: "导出失败",
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -935,10 +857,6 @@ export default {
|
|
params
|
|
params
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- clientTwo = mqtt.connect(
|
|
|
|
- "wxs://data.radar-power.cn/mqtt/",
|
|
|
|
- params
|
|
|
|
- );
|
|
|
|
}
|
|
}
|
|
console.log("主题开始订阅5555");
|
|
console.log("主题开始订阅5555");
|
|
// 存储client引用以便后续操作
|
|
// 存储client引用以便后续操作
|
|
@@ -989,33 +907,26 @@ export default {
|
|
clearTimeout(this.inactivityTimer);
|
|
clearTimeout(this.inactivityTimer);
|
|
this.inactivityTimer = setTimeout(() => {
|
|
this.inactivityTimer = setTimeout(() => {
|
|
this.targetPoints = {};
|
|
this.targetPoints = {};
|
|
|
|
+ console.log("没有点位,消除点位数据");
|
|
}, 1500);
|
|
}, 1500);
|
|
-
|
|
|
|
- console.log(topic, 99999);
|
|
|
|
- console.log(JSON.parse(message.toString()), "99999999");
|
|
|
|
-
|
|
|
|
// 验证topic格式
|
|
// 验证topic格式
|
|
const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
const match = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
|
|
if (!match || match[1] !== clientId) return;
|
|
if (!match || match[1] !== clientId) return;
|
|
|
|
|
|
try {
|
|
try {
|
|
const data = JSON.parse(message.toString());
|
|
const data = JSON.parse(message.toString());
|
|
|
|
+ console.log(data.tracker_targets, "点位消息");
|
|
if (data.health) {
|
|
if (data.health) {
|
|
if (
|
|
if (
|
|
data.health.breath_rpm ||
|
|
data.health.breath_rpm ||
|
|
data.health.breath_rpm === 0
|
|
data.health.breath_rpm === 0
|
|
) {
|
|
) {
|
|
this.receptHealth(Math.floor(data.health.breath_rpm));
|
|
this.receptHealth(Math.floor(data.health.breath_rpm));
|
|
- // this.$emit(
|
|
|
|
- // "sendHealth",
|
|
|
|
- // Math.floor(data.health.breath_rpm)
|
|
|
|
- // );
|
|
|
|
} else {
|
|
} else {
|
|
- // this.$emit("sendHealth", 0);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.processTrackerData(data.tracker_targets);
|
|
this.processTrackerData(data.tracker_targets);
|
|
- console.log(data.tracker_targets, "MQTT消息解析成功22222");
|
|
|
|
|
|
+ // console.log(data.tracker_targets, "MQTT消息解析成功22222");
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.error("MQTT消息解析失败", e);
|
|
console.error("MQTT消息解析失败", e);
|
|
}
|
|
}
|
|
@@ -1069,7 +980,6 @@ export default {
|
|
(item) => item !== null && item !== undefined
|
|
(item) => item !== null && item !== undefined
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- console.log("当前目标点11111", this.targetPoints);
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
createNewTargetPoint(x, y, z, id) {
|
|
createNewTargetPoint(x, y, z, id) {
|
|
@@ -1078,8 +988,8 @@ export default {
|
|
y,
|
|
y,
|
|
z,
|
|
z,
|
|
id,
|
|
id,
|
|
- displayX: x,
|
|
|
|
- displayY: y,
|
|
|
|
|
|
+ displayX: x - Number(this.devInfo.xxStart),
|
|
|
|
+ displayY: y - Number(this.devInfo.yyEnd),
|
|
lastX: x,
|
|
lastX: x,
|
|
lastY: y,
|
|
lastY: y,
|
|
};
|
|
};
|
|
@@ -1097,53 +1007,186 @@ export default {
|
|
z,
|
|
z,
|
|
lastX: x,
|
|
lastX: x,
|
|
lastY: y,
|
|
lastY: y,
|
|
- displayX: x,
|
|
|
|
- displayY: y,
|
|
|
|
|
|
+ displayX: x - Number(this.devInfo.xxStart),
|
|
|
|
+ displayY: y - Number(this.devInfo.yyEnd),
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
return existingPoint;
|
|
return existingPoint;
|
|
},
|
|
},
|
|
-
|
|
|
|
- closemqtTwo() {
|
|
|
|
- this.mqttClienTwoFlag = false;
|
|
|
|
- if (this.mqttClientOne) {
|
|
|
|
- this.mqttClientOne.end();
|
|
|
|
- this.mqttClientOne = null;
|
|
|
|
- console.log("MQTT连接已断开");
|
|
|
|
|
|
+ // 计算缩放比例
|
|
|
|
+ calculate(width, length) {
|
|
|
|
+ let zoomTime = width > length ? width : length;
|
|
|
|
+ let practical = zoomTime / 100;
|
|
|
|
+ this.zoomTimes = 710 / practical;
|
|
|
|
+ // this.normalizeZoomTimes(this.zoomTimes);
|
|
|
|
+ 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;
|
|
|
|
+ },
|
|
|
|
+ normalizeZoomTimes(num) {
|
|
|
|
+ const intPart = Math.floor(num);
|
|
|
|
+ const decimalPart = num - intPart;
|
|
|
|
+ let result;
|
|
|
|
+ if (decimalPart >= 0.1 && decimalPart < 0.5) {
|
|
|
|
+ result = intPart;
|
|
|
|
+ } else if (decimalPart >= 0.5 && decimalPart < 0.9) {
|
|
|
|
+ result = intPart + 0.5;
|
|
|
|
+ } else {
|
|
|
|
+ result = num;
|
|
}
|
|
}
|
|
|
|
+ return Math.round(result * 100) / 100;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ formatTime(time) {
|
|
|
|
+ return time ? time.slice(11, 19) : "暂无";
|
|
|
|
+ },
|
|
|
|
+ initSubscriptions() {
|
|
|
|
+ const topicList = [
|
|
|
|
+ {
|
|
|
|
+ topic: `/dev/${this.clientId}/tracker_targets`,
|
|
|
|
+ key: "unsubscribeFn",
|
|
|
|
+ callback: (message, msgTopic) => {
|
|
|
|
+ const dataMatch = msgTopic.match(
|
|
|
|
+ /^\/dev\/(.+)\/tracker_targets$/
|
|
|
|
+ );
|
|
|
|
+ const cmdMatch = msgTopic.match(
|
|
|
|
+ /^\/mps\/wx_(.+)\/notice$/
|
|
|
|
+ );
|
|
|
|
+ if (dataMatch && dataMatch[1] === this.clientId) {
|
|
|
|
+ this.handleMessage(
|
|
|
|
+ msgTopic,
|
|
|
|
+ message,
|
|
|
|
+ this.clientId
|
|
|
|
+ );
|
|
|
|
+ } else if (cmdMatch) {
|
|
|
|
+ this.$refs.alarmModel.hanOtherMessage(
|
|
|
|
+ msgTopic,
|
|
|
|
+ message
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ topic: `/dev/${this.clientId}/falling_event_change`,
|
|
|
|
+ key: "fallingEventChange",
|
|
|
|
+ callback: (message, msgTopic) => {
|
|
|
|
+ const dataMatch = msgTopic.match(
|
|
|
|
+ /^\/dev\/(.+)\/falling_event_change$/
|
|
|
|
+ );
|
|
|
|
+ if (dataMatch && dataMatch[1] === this.clientId) {
|
|
|
|
+ const dataMessage = JSON.parse(message.toString());
|
|
|
|
+
|
|
|
|
+ console.log(dataMessage, 888888);
|
|
|
|
+ if (dataMessage.falling == 1) {
|
|
|
|
+ this.falling = dataMessage.falling;
|
|
|
|
+ this.lnbAction = "actionWarn";
|
|
|
|
+ } else if (
|
|
|
|
+ dataMessage.falling == 2 ||
|
|
|
|
+ dataMessage.falling == 3
|
|
|
|
+ ) {
|
|
|
|
+ this.falling = dataMessage.falling;
|
|
|
|
+ this.lnbAction = "actionSerious";
|
|
|
|
+ } else {
|
|
|
|
+ this.lnbAction = "action8";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ topicList.forEach((item) => {
|
|
|
|
+ // 避免重复订阅
|
|
|
|
+ if (this[item.key]) return;
|
|
|
|
+
|
|
|
|
+ const subscribeFunc = () => {
|
|
|
|
+ const unsubscribe = MqttService.subscribe(
|
|
|
|
+ "DATA",
|
|
|
|
+ item.topic,
|
|
|
|
+ item.callback
|
|
|
|
+ );
|
|
|
|
+ if (unsubscribe) {
|
|
|
|
+ this[item.key] = unsubscribe;
|
|
|
|
+ console.log(`✅ 已成功订阅主题: ${item.topic}`);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ if (MqttService.dataConnected) {
|
|
|
|
+ subscribeFunc();
|
|
|
|
+ } else {
|
|
|
|
+ // MQTT 未连接,等待重连成功再订阅
|
|
|
|
+ const handler = () => {
|
|
|
|
+ subscribeFunc();
|
|
|
|
+ uni.$off("mqttData-ready", handler);
|
|
|
|
+ };
|
|
|
|
+ uni.$on("mqttData-ready", handler);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- },
|
|
|
|
- onShow() {
|
|
|
|
- this.clientIdProp = uni.getStorageSync("clientIDetail");
|
|
|
|
- this.isInitAlarm = true;
|
|
|
|
- this.todayDate = this.$time(new Date(), 2);
|
|
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
- const devItem = this.parseDeviceItem(options.devItem);
|
|
|
|
|
|
+ this.lnbAction = "action8";
|
|
|
|
+ const devItem = JSON.parse(options.devItem);
|
|
const { devId, clientId } = devItem;
|
|
const { devId, clientId } = devItem;
|
|
- this.getFrequency(clientId);
|
|
|
|
- this.getdevInfo(devId);
|
|
|
|
- this.getdevRoomInfo(devId);
|
|
|
|
- this.autoPlayinterval = setTimeout(() => {
|
|
|
|
- this.autoSwipe();
|
|
|
|
- }, 3000);
|
|
|
|
- this.getCurrentDate();
|
|
|
|
|
|
+ // 缓存到页面实例
|
|
|
|
+ this.clientId = clientId;
|
|
|
|
+ uni.setStorageSync("currentDevItem", devItem);
|
|
|
|
+ this.getFrequency(devId);
|
|
|
|
+ this.dev_id = devId;
|
|
|
|
+ this.todayDate = this.$time(new Date(), 2);
|
|
|
|
+ // 清理旧定时器
|
|
|
|
+ clearTimeout(this.autoPlayinterval);
|
|
|
|
+ this.autoPlayinterval = setTimeout(() => this.autoSwipe(), 3000);
|
|
|
|
+
|
|
|
|
+ if (MqttService.dataConnected && MqttService.dataClient) {
|
|
|
|
+ // 已连接,直接订阅
|
|
|
|
+ this.initSubscriptions();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- onReady() {
|
|
|
|
- this.connectMqtt();
|
|
|
|
|
|
+
|
|
|
|
+ onShow() {
|
|
|
|
+ this.showModle = true;
|
|
|
|
+ this.lnbAction = "action8";
|
|
|
|
+ // MQTT 初始化
|
|
|
|
+ const userId = uni.getStorageSync("userId");
|
|
|
|
+ if (!userId) return console.error("MQTT 初始化失败:缺少 userId");
|
|
|
|
+ if (!MqttService.dataConnected) {
|
|
|
|
+ // 未连接,先 connect
|
|
|
|
+ MqttService.connectData(userId)
|
|
|
|
+ .then((client) => {
|
|
|
|
+ // 页面订阅逻辑,等 connect 成功再执行
|
|
|
|
+ const handler = () => {
|
|
|
|
+ MqttService.resubscribeAll("DATA");
|
|
|
|
+ uni.$off("mqttData-ready", handler);
|
|
|
|
+ };
|
|
|
|
+ uni.$on("mqttData-ready", handler);
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => console.error("DATA MQTT 初始化失败", err));
|
|
|
|
+ }
|
|
|
|
+ this.getdevInfo(this.dev_id);
|
|
|
|
+ this.getdevRoomInfo(this.dev_id);
|
|
},
|
|
},
|
|
|
|
+
|
|
onUnload() {
|
|
onUnload() {
|
|
- this.isInitAlarm = false;
|
|
|
|
- this.inactivityTimer = null;
|
|
|
|
|
|
+ // 清理定时器
|
|
|
|
+ clearTimeout(this.autoPlayinterval);
|
|
|
|
+ // 清理自动滑动定时器
|
|
|
|
+ clearInterval(this.setIntervalVal);
|
|
|
|
+ this.setIntervalVal = null;
|
|
this.autoPlayinterval = null;
|
|
this.autoPlayinterval = null;
|
|
- this.closemqtTwo();
|
|
|
|
|
|
+ // 取消订阅
|
|
|
|
+ ["unsubscribeFn", "fallingEventChange"].forEach((key) => {
|
|
|
|
+ if (this[key]) {
|
|
|
|
+ this[key]();
|
|
|
|
+ this[key] = null;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
onHide() {
|
|
onHide() {
|
|
- this.inactivityTimer = null;
|
|
|
|
- this.autoPlayinterval = null;
|
|
|
|
- this.isInitAlarm = false;
|
|
|
|
- this.closemqtTwo();
|
|
|
|
|
|
+ this.showModle = false;
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -1182,12 +1225,19 @@ export default {
|
|
|
|
|
|
.center {
|
|
.center {
|
|
position: absolute;
|
|
position: absolute;
|
|
- background-color: #fff;
|
|
|
|
- border: 14rpx solid #333333;
|
|
|
|
- background-image: url("http://jkld.radar-power.com//uploadFiles/framework/file/20250620/toilet_bg.png");
|
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ border: none;
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
background-position: center;
|
|
- transform: scale(1.3);
|
|
|
|
|
|
+ &::before {
|
|
|
|
+ content: "";
|
|
|
|
+ position: absolute;
|
|
|
|
+ inset: 0;
|
|
|
|
+ background: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png")
|
|
|
|
+ no-repeat center;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ z-index: 0;
|
|
|
|
+ }
|
|
|
|
|
|
.moduleContent {
|
|
.moduleContent {
|
|
position: relative;
|
|
position: relative;
|
|
@@ -1203,18 +1253,26 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
.tranStyle {
|
|
.tranStyle {
|
|
position: absolute;
|
|
position: absolute;
|
|
|
|
+ overflow: hidden;
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
- border: 9rpx solid #333333;
|
|
|
|
- background-image: url("http://jkld.radar-power.com//uploadFiles/framework/file/20250620/toilet_bg.png");
|
|
|
|
|
|
+ border: none;
|
|
|
|
+ // outline: 10rpx solid #333333;
|
|
|
|
+ // background-image: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png");
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
background-position: center;
|
|
- transform: scale(2.2);
|
|
|
|
-
|
|
|
|
|
|
+ &::before {
|
|
|
|
+ content: "";
|
|
|
|
+ position: absolute;
|
|
|
|
+ inset: 0;
|
|
|
|
+ background: url("https://hflnxx.oss-cn-shanghai.aliyuncs.com/IMAGE/20250919/toilet_bg.png")
|
|
|
|
+ no-repeat center;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ z-index: 0; // 在最底层
|
|
|
|
+ }
|
|
.moduleContent {
|
|
.moduleContent {
|
|
- overflow: hidden;
|
|
|
|
|
|
+ // overflow: hidden;
|
|
|
|
|
|
// position: relative;
|
|
// position: relative;
|
|
view {
|
|
view {
|
|
@@ -1242,10 +1300,10 @@ export default {
|
|
}
|
|
}
|
|
.redar-pic {
|
|
.redar-pic {
|
|
position: absolute;
|
|
position: absolute;
|
|
- left: 50%;
|
|
|
|
- top: 50%;
|
|
|
|
- width: 40rpx;
|
|
|
|
- height: 40rpx;
|
|
|
|
|
|
+ // left: 50%;
|
|
|
|
+ // top: 50%;
|
|
|
|
+ width: 60rpx;
|
|
|
|
+ height: 60rpx;
|
|
transform: translate(-50%, -50%); /* 先居中 */
|
|
transform: translate(-50%, -50%); /* 先居中 */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1270,7 +1328,7 @@ export default {
|
|
.notice-info {
|
|
.notice-info {
|
|
width: 710rpx;
|
|
width: 710rpx;
|
|
max-height: 300rpx;
|
|
max-height: 300rpx;
|
|
- overflow: hidden;
|
|
|
|
|
|
+ // overflow: hidden;
|
|
padding: 30rpx 37rpx 10rpx 37rpx;
|
|
padding: 30rpx 37rpx 10rpx 37rpx;
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
border-radius: 37rpx;
|
|
border-radius: 37rpx;
|
|
@@ -1314,7 +1372,7 @@ export default {
|
|
|
|
|
|
.stayDetail {
|
|
.stayDetail {
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
- overflow: hidden;
|
|
|
|
|
|
+ // overflow: hidden;
|
|
margin-top: 10rpx;
|
|
margin-top: 10rpx;
|
|
margin-bottom: 10rpx;
|
|
margin-bottom: 10rpx;
|
|
padding-left: 20rpx;
|
|
padding-left: 20rpx;
|
|
@@ -1373,6 +1431,20 @@ export default {
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
+ .noShareFlag {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ width: 155rpx;
|
|
|
|
+ height: 94rpx;
|
|
|
|
+ border-radius: 28rpx;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #f0f0f0;
|
|
|
|
+ color: #999999;
|
|
|
|
+ opacity: 0.6;
|
|
|
|
+ }
|
|
|
|
|
|
.btn2 {
|
|
.btn2 {
|
|
display: flex;
|
|
display: flex;
|
|
@@ -1527,7 +1599,7 @@ export default {
|
|
width: 80%;
|
|
width: 80%;
|
|
background: #fff;
|
|
background: #fff;
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
- overflow: hidden;
|
|
|
|
|
|
+ // overflow: hidden;
|
|
animation: fadeIn 0.3s;
|
|
animation: fadeIn 0.3s;
|
|
|
|
|
|
.modal-header {
|
|
.modal-header {
|
|
@@ -1602,7 +1674,7 @@ export default {
|
|
position: fixed;
|
|
position: fixed;
|
|
top: 10rpx;
|
|
top: 10rpx;
|
|
right: 10rpx;
|
|
right: 10rpx;
|
|
- z-index: 999;
|
|
|
|
|
|
+ z-index: 333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|