018A添加报警日志
This commit is contained in:
330
pages/018A/018AMsg.vue
Normal file
330
pages/018A/018AMsg.vue
Normal file
@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<view class="maincontent1 contentBg">
|
||||
<!-- <view class="tab">
|
||||
<view class="tabItem" :class="{active:Status.tabIndex===0}" @click.stop="tabChange(0)">报警</view>
|
||||
<view class="tabItem" :class="{active:Status.tabIndex===1}" @click.stop="tabChange(1)">通话</view>
|
||||
<view class="tabItem" :class="{active:Status.tabIndex===2}" @click.stop="tabChange(2)">开机</view>
|
||||
<view class="tabItem" :class="{active:Status.tabIndex===3}" @click.stop="tabChange(3)">故障</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="list">
|
||||
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
||||
:down="downOption" :fixed="false">
|
||||
<view v-for="item,index in list" class="listItem">
|
||||
|
||||
<view v-if="Status.tabIndex==0">
|
||||
<view class="row">
|
||||
<view class="label">报警事项:</view>
|
||||
<view class="red value">{{item.content}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">报警地点:</view>
|
||||
<view class="value">{{item.location}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">报警时间:</view>
|
||||
<view class="value">{{item.startTime}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">解除时间:</view>
|
||||
<view class="value">{{item.finishTime}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">报警时长:</view>
|
||||
<view class="value">{{item.durationTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="Status.tabIndex==1">
|
||||
|
||||
</view>
|
||||
<view v-if="Status.tabIndex==2">
|
||||
|
||||
</view>
|
||||
<view v-if="Status.tabIndex==3">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var timeout = null;
|
||||
import request from '@/utils/request.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Status: {
|
||||
tabIndex: 0
|
||||
},
|
||||
list: [],
|
||||
mescroll: null,
|
||||
downOption: {
|
||||
auto: true,
|
||||
autoShowLoading: false,
|
||||
},
|
||||
upOption: {
|
||||
auto: false,
|
||||
noMoreSize: 0,
|
||||
offset: 10,
|
||||
isLock: false,
|
||||
empty: {
|
||||
tip: '暂无数据',
|
||||
hideScroll: false,
|
||||
icon: '/static/images/common/empty.png'
|
||||
},
|
||||
textNoMore: '没有更多数据了'
|
||||
},
|
||||
device: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let eventChannel = this.getOpenerEventChannel();
|
||||
eventChannel.on('detailData', (data) => {
|
||||
debugger;
|
||||
if (data) {
|
||||
this.device = data;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
mescrollInit(mescroll) {
|
||||
this.mescroll = mescroll;
|
||||
},
|
||||
// 下拉刷新
|
||||
downCallback() {
|
||||
|
||||
|
||||
if (this.mescroll) {
|
||||
this.mescroll.resetUpScroll(false);
|
||||
this.mescroll.scrollTo(0, 0);
|
||||
}
|
||||
this.getData();
|
||||
|
||||
|
||||
},
|
||||
// 上拉加载
|
||||
upCallback() {
|
||||
|
||||
|
||||
|
||||
this.getData();
|
||||
},
|
||||
getWarList(data) {
|
||||
return request({
|
||||
url: '/app/device/AlarmList',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getNotifyList() {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve({
|
||||
code: 200,
|
||||
total: 0,
|
||||
rows: []
|
||||
})
|
||||
});
|
||||
},
|
||||
getTrun() {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve({
|
||||
total: 0,
|
||||
rows: []
|
||||
})
|
||||
});
|
||||
},
|
||||
getGuzhang() {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve({
|
||||
total: 0,
|
||||
rows: []
|
||||
})
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
let task = () => {
|
||||
debugger;
|
||||
let data = {
|
||||
deviceId:(this.device&& this.device.id)?this.device.id:"00000000",
|
||||
pageNum: this.mescroll.num,
|
||||
pageSize: 10,
|
||||
}
|
||||
console.log("device=", JSON.stringify(this.device));
|
||||
console.log("data", JSON.stringify(data));
|
||||
if (!data.pageNum) {
|
||||
this.mescroll.endSuccess(0, false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let arr = {
|
||||
"0": this.getWarList.bind(this),
|
||||
"1": this.getNotifyList.bind(this),
|
||||
"2": this.getTrun.bind(this),
|
||||
"3": this.getGuzhang.bind(this),
|
||||
}
|
||||
|
||||
let apiCall = arr[this.Status.tabIndex + ''];
|
||||
apiCall(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
||||
|
||||
if (data.pageNum === 1) {
|
||||
this.list = res.rows;
|
||||
} else {
|
||||
this.list = this.list.concat(res.rows);
|
||||
}
|
||||
this.total = res.total;
|
||||
let hasNext = true;
|
||||
// 判断是否已加载全部数据
|
||||
if (res.rows.length < this.size || this.list.length >= this.total) {
|
||||
|
||||
hasNext = false;
|
||||
} else {
|
||||
this.page++;
|
||||
hasNext = true;
|
||||
}
|
||||
this.mescroll.endSuccess(res.rows.length, hasNext);
|
||||
} else {
|
||||
this.mescroll.endSuccess(0, false);
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(task, 50);
|
||||
},
|
||||
tabChange(index) {
|
||||
if (this.Status.tabIndex === index) {
|
||||
return;
|
||||
}
|
||||
this.Status.tabIndex = index
|
||||
this.downCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* #ifdef WEB|H5 */
|
||||
.maincontent1 {
|
||||
height: calc(100vh - 45px);
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.maincontent1 {
|
||||
height: 100vh;
|
||||
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.listItem {
|
||||
border-radius: 8px;
|
||||
background: rgba(26, 26, 26, 1);
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx 20rpx;
|
||||
}
|
||||
|
||||
.listItem .label {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-family: "PingFang SC";
|
||||
font-style: Regular;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
line-height: 30rpx;
|
||||
letter-spacing: 0.14rpx;
|
||||
width: 120rpx;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
.listItem .value {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
|
||||
font-family: "PingFang SC";
|
||||
font-style: Regular;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
line-height: 30rpx;
|
||||
letter-spacing: 0.14rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.listItem .row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
height: auto;
|
||||
padding: 5rpx 0rpx;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.tab {
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
font-family: "PingFang SC";
|
||||
font-style: Regular;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.tab .tabItem {
|
||||
position: relative;
|
||||
padding: 0rpx 30rpx;
|
||||
}
|
||||
|
||||
.tab .tabItem::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
width: 50%;
|
||||
height: 8rpx;
|
||||
border-radius: 30px;
|
||||
top: 100%;
|
||||
left: 25%;
|
||||
margin-top: 5rpx;
|
||||
background: #00000000;
|
||||
}
|
||||
|
||||
.tab .tabItem.active::after {
|
||||
background: rgba(187, 230, 0, 1);
|
||||
}
|
||||
|
||||
.tab .tabItem.active {
|
||||
color: rgba(174, 214, 0, 1);
|
||||
font-style: Bold;
|
||||
font-size: 32rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
@ -1,5 +1,20 @@
|
||||
<template>
|
||||
<view class="content contentBg">
|
||||
<uni-nav-bar :border="false" @clickLeft="prevPage" fixed="true" statusBar="true" background-color="#121212"
|
||||
color="#FFFFFF" :title="Status.navbar.title">
|
||||
<template v-slot:left>
|
||||
<view>
|
||||
<uni-icons type="left" size="24" color="#FFFFFF"></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
<block slot="right">
|
||||
<view class="navbarRight center">
|
||||
<image @click.stop="handleRightClick(index,item)" v-for="item,index in Status.navbar.icons"
|
||||
class="img" :src="item.src" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</uni-nav-bar>
|
||||
<view class="eq">
|
||||
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
|
||||
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
|
||||
@ -189,9 +204,19 @@
|
||||
curr: 0,
|
||||
total: 0,
|
||||
pageHide: false,
|
||||
|
||||
|
||||
usrToggle: false
|
||||
usrToggle: false,
|
||||
navbar: {
|
||||
icons: [{
|
||||
src: '/static/images/common/msg.png'
|
||||
},
|
||||
{
|
||||
src: '/static/images/common/shape.png'
|
||||
}
|
||||
],
|
||||
title: 'HBY018A',
|
||||
showBack: true,
|
||||
height: 90
|
||||
},
|
||||
},
|
||||
formData: {
|
||||
img: '/static/images/common/HBY018A.png',
|
||||
@ -264,7 +289,8 @@
|
||||
contact1Phone: "",
|
||||
contact2Phone: "",
|
||||
sosSmsMsg: ""
|
||||
}
|
||||
},
|
||||
permissions: []
|
||||
}
|
||||
},
|
||||
|
||||
@ -296,7 +322,15 @@
|
||||
// console.log("收到父页面的参数:" + JSON.stringify(data));
|
||||
var device = data.data;
|
||||
these.device = device;
|
||||
|
||||
if (data.apiType !== 'listA') {
|
||||
Common.getdeviceShareId(data.data.id).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.permission) {
|
||||
these.permissions = res.data.permission.split(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this.getDeviceDetail();
|
||||
let f = these.getDevice();
|
||||
if (!f) {
|
||||
@ -389,6 +423,41 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
prevPage() {
|
||||
uni.navigateBack({
|
||||
|
||||
});
|
||||
},
|
||||
handleRightClick(s, e) {
|
||||
|
||||
if (s === 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/018A/018AMsg',
|
||||
success(res) {
|
||||
|
||||
res.eventChannel.emit('detailData', these.device);
|
||||
}
|
||||
});
|
||||
return;
|
||||
} else if (s === 1) {
|
||||
console.log("分享");
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/share/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
let json = {
|
||||
persissonType: '018A'
|
||||
};
|
||||
Object.assign(json, these.device);
|
||||
res.eventChannel.emit('share', {
|
||||
data: json
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
closeAction() {
|
||||
for (let index = 0; index < this.dic.actionSheets.length; index++) {
|
||||
let menu = this.dic.actionSheets[index];
|
||||
@ -610,11 +679,13 @@
|
||||
|
||||
this.device.longitude = lnglat[0];
|
||||
this.device.latitude = lnglat[1];
|
||||
|
||||
this.formData.sta_longitude = lnglat[0];
|
||||
this.formData.sta_latitude = lnglat[1];
|
||||
|
||||
|
||||
Common.regeo(lnglat[0], lnglat[1]).then(res => {
|
||||
this.formData.address = res.regeocode.formatted_address
|
||||
this.formData.address = res.regeocode.formatted_address;
|
||||
this.setBleFormData();
|
||||
}).catch(ex => {
|
||||
console.error("逆地理失败了")
|
||||
}).finally(this.routePlan);
|
||||
@ -631,6 +702,12 @@
|
||||
reGeoTime = setTimeout(task, 500);
|
||||
},
|
||||
gotoPage(page) {
|
||||
|
||||
if (!this.permissions.includes('57') && this.Status.apiType !== 'listA') {
|
||||
|
||||
MsgError('无操作权限', '确定', these);
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/sosSet/' + page,
|
||||
success(res) {
|
||||
@ -771,7 +848,7 @@
|
||||
this.device.longitude = this.formData.sta_longitude;
|
||||
this.device.latitude = this.formData.sta_latitude;
|
||||
|
||||
console.log("device=",this.device);
|
||||
console.log("device=", this.device);
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/map/index',
|
||||
events: {
|
||||
@ -790,6 +867,11 @@
|
||||
|
||||
},
|
||||
LighSetting(item, index) {
|
||||
if (!this.permissions.includes('51') && this.Status.apiType !== 'listA') {
|
||||
|
||||
MsgError('无操作权限', '确定', these);
|
||||
return;
|
||||
}
|
||||
let val = item.key;
|
||||
if (item.key === this.formData.sta_Side_Light) {
|
||||
val = 0;
|
||||
@ -818,7 +900,11 @@
|
||||
|
||||
sosToggle(type) {
|
||||
|
||||
if (!this.permissions.includes('46') && this.Status.apiType !== 'listA') {
|
||||
|
||||
MsgError('无操作权限', '确定', these);
|
||||
return;
|
||||
}
|
||||
if (this.formData.sta_ShakeBit != 1 && this.formData.sta_ShakeBit != 0) {
|
||||
MsgError("设备正在报警中", '', these);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user