|
@@ -15,17 +15,6 @@
|
|
|
/>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
- <!-- <view class="rightItem">
|
|
|
- <view class="rightTitle">今日天气</view>
|
|
|
- <view class="rightPng">
|
|
|
- <view
|
|
|
- class="rightContent"
|
|
|
- style="text-align: center; font-size: 40rpx"
|
|
|
- >{{ weatherText }}</view
|
|
|
- >
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view
|
|
|
class="rightItem"
|
|
|
@click="gotoDevice('/pagesA/devices/devices')"
|
|
@@ -105,29 +94,38 @@
|
|
|
<view
|
|
|
class="warmInfo"
|
|
|
@click="goAbnormalInfo()"
|
|
|
- v-if="warmList.length > 0"
|
|
|
+ v-if="alarmRetentionLists.length > 0"
|
|
|
>
|
|
|
<image src="../../static/warmImage.png" class="shareImage"></image>
|
|
|
<view class="shareTitleContainer">
|
|
|
- <view class="shareTitleList" v-if="warmList.length > 1">
|
|
|
+ <view
|
|
|
+ class="shareTitleList"
|
|
|
+ v-if="alarmRetentionLists.length > 1"
|
|
|
+ >
|
|
|
<view
|
|
|
class="shareTitle"
|
|
|
- v-for="item in warmList"
|
|
|
- :key="item.devId"
|
|
|
+ v-for="item in alarmRetentionLists"
|
|
|
+ :key="item.clientId"
|
|
|
>
|
|
|
- {{ item.devName }}检测到有目标滞留
|
|
|
+ {{ item.devName }}检测到有{{
|
|
|
+ getEventTypeName(item.eventType)
|
|
|
+ }}
|
|
|
</view>
|
|
|
<view
|
|
|
class="shareTitle"
|
|
|
- v-for="(item, index) in warmList"
|
|
|
- :key="index"
|
|
|
+ v-for="item in alarmRetentionLists"
|
|
|
+ :key="item.clientId"
|
|
|
>
|
|
|
- {{ item.devName }}检测到有目标滞留
|
|
|
+ {{ item.devName }}检测到有{{
|
|
|
+ getEventTypeName(item.eventType)
|
|
|
+ }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="shareTitleTwo" v-else>
|
|
|
<view class="shareTitle">
|
|
|
- {{ warmList[0].devName }}检测到有目标滞留
|
|
|
+ {{ alarmRetentionLists[0].devName }}检测到有{{
|
|
|
+ getEventTypeName(item.eventType)
|
|
|
+ }}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -151,8 +149,8 @@ export default {
|
|
|
devDevice: "",
|
|
|
warmNum: "",
|
|
|
warmDetail: [],
|
|
|
- warmList: [],
|
|
|
- weatherText: "",
|
|
|
+ alarmRetentionLists: [],
|
|
|
+ warmTypeList: [],
|
|
|
isInitAlarm: false,
|
|
|
isIniTenMinutes: false,
|
|
|
};
|
|
@@ -255,52 +253,48 @@ export default {
|
|
|
this.shareNum = res.data.data?.length || 0;
|
|
|
});
|
|
|
},
|
|
|
- // 获取天气接口
|
|
|
- // getWeather() {
|
|
|
- // uni.request({
|
|
|
- // url: "https://kp36x7gr79.re.qweatherapi.com/v7/weather/now", // 使用官方域名
|
|
|
- // data: {
|
|
|
- // location: "101220101", // 城市ID
|
|
|
- // key: "72afe228cd7f436ebea7caa1345956f2", // 你的API Key
|
|
|
- // },
|
|
|
- // method: "GET",
|
|
|
- // success: (res) => {
|
|
|
- // if (res.statusCode === 200) {
|
|
|
- // this.weatherText = res.data.now.text;
|
|
|
- // }
|
|
|
- // },
|
|
|
- // fail: (err) => {
|
|
|
- // console.error("网络错误:", err);
|
|
|
- // },
|
|
|
- // });
|
|
|
- // },
|
|
|
- // 需要跟车对接一下,换一个接口
|
|
|
- // getWarmList() {
|
|
|
- // this.$http
|
|
|
- // .post(
|
|
|
- // "wap/stats/alarmRetentionQuery",
|
|
|
- // {
|
|
|
- // pageNo: 1,
|
|
|
- // pageSize: 20,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // header: {
|
|
|
- // "Content-Type": "application/json;charset=UTF-8",
|
|
|
- // token: uni.getStorageSync("tokenValue") || "",
|
|
|
- // },
|
|
|
- // }
|
|
|
- // )
|
|
|
- // .then((res) => {
|
|
|
- // if (res.data.data) {
|
|
|
- // // this.warmNum = res.data.data.total;
|
|
|
- // if (res.data.data.rows.length > 0) {
|
|
|
- // this.warmDetail = res.data.data.rows;
|
|
|
- // this.warmList = res.data.data.rows;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // uni.hideLoading();
|
|
|
- // },
|
|
|
+
|
|
|
+ // 异常信息处理
|
|
|
+ getWarnList() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "查询中...",
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ "wap/stats/alarmEventsQuery",
|
|
|
+ {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json;charset=UTF-8",
|
|
|
+ token: uni.getStorageSync("tokenValue") || "",
|
|
|
+ },
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.data) {
|
|
|
+ this.alarmRetentionLists = res.data.data.rows;
|
|
|
+ }
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getwarmType() {
|
|
|
+ this.$http
|
|
|
+ .get("pub/dic/query", { dicType: "alarm_event_type" })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.data) {
|
|
|
+ this.warmTypeList = res.data.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getEventTypeName(eventType) {
|
|
|
+ return (
|
|
|
+ this.warmTypeList.find((item) => item.itemCode == eventType)
|
|
|
+ ?.itemName || "未知"
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
onLoad() {},
|
|
|
onShow() {
|
|
@@ -310,8 +304,8 @@ export default {
|
|
|
});
|
|
|
this.getperSonInfo();
|
|
|
this.getShareNum();
|
|
|
- // this.getWarmList();
|
|
|
- // this.getWeather();
|
|
|
+ this.getwarmType();
|
|
|
+ this.getWarnList();
|
|
|
this.isInitAlarm = true;
|
|
|
this.isIniTenMinutes = true;
|
|
|
}
|
|
@@ -602,7 +596,7 @@ export default {
|
|
|
.shareTitleList {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- animation: scrollUp 10s linear infinite;
|
|
|
+ animation: scrollUp 7s linear infinite;
|
|
|
}
|
|
|
.shareTitleTwo {
|
|
|
display: flex;
|