修复102时间加减异常
This commit is contained in:
@ -60,12 +60,12 @@
|
||||
</view>
|
||||
<view class="item" @click.top="bleStatuToggle">
|
||||
<text class="lbl">蓝牙状态</text>
|
||||
<text class="value" :class="formData.bleStatu?'green':'red'">{{getbleStatu}}</text>
|
||||
<text class="value" :class="(!formData.bleStatu || formData.bleStatu==='err')?'red':'green'">{{getbleStatu}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">信道:{{formData.sta_Channel}}</text>
|
||||
<text class="value green" @click.stop="ShowChannelEdit()">修改</text>
|
||||
</view>
|
||||
<!-- <view class="item">
|
||||
<text class="lbl">设备状态</text>
|
||||
<text class="value">{{formData.sta_charge?dic.sta_charge[formData.sta_charge]:"" }}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="warnnig" v-for="item,index in warnDevices">
|
||||
@ -177,7 +177,14 @@
|
||||
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
|
||||
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
|
||||
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
|
||||
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" />
|
||||
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot">
|
||||
<view v-if="Status.ShowEditChannel" class="popup-prompt">
|
||||
<text class="popup-prompt-title">修改信道</text>
|
||||
<input class="popup-prompt-input" type="number" placeholder="1-125的整数"
|
||||
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" />
|
||||
|
||||
</view>
|
||||
</MessagePopup>
|
||||
|
||||
<!-- 下方菜单 -->
|
||||
|
||||
@ -221,6 +228,7 @@
|
||||
curr: 0,
|
||||
total: 0,
|
||||
pageHide: false,
|
||||
ShowEditChannel: false,
|
||||
Pop: {
|
||||
showPop: false, //是否显示弹窗
|
||||
popType: 'custom',
|
||||
@ -325,8 +333,8 @@
|
||||
warnTime: '',
|
||||
sta_sosadd: "",
|
||||
sta_sosName: '',
|
||||
sta_IntrusTime: ''
|
||||
|
||||
sta_IntrusTime: '',
|
||||
ins_Channel:23
|
||||
},
|
||||
dic: {
|
||||
sta_LightType: [
|
||||
@ -519,7 +527,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
this.getLinkedCnt();
|
||||
// this.getLinkedCnt();
|
||||
},
|
||||
computed: {
|
||||
Distance: function() {
|
||||
@ -561,6 +569,73 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChannelChanging() {
|
||||
|
||||
let f = this.getDevice();
|
||||
// #ifdef APP-PLUS
|
||||
if (!f) {
|
||||
this.showBleUnConnect();
|
||||
return;
|
||||
}
|
||||
// #endif
|
||||
|
||||
let regex = /^([1-9]|[1-7][0-9]|80)$/;
|
||||
if (!regex.test(this.formData.ins_Channel)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '只能输入1-80整数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
var buffer = {
|
||||
ins_Channel: this.formData.ins_Channel
|
||||
}
|
||||
ble.sendString(f.deviceId, buffer);
|
||||
},
|
||||
ShowChannelEdit() {
|
||||
|
||||
if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') {
|
||||
|
||||
this.showPop({
|
||||
message: '无操作权限',
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
okCallback: null,
|
||||
buttonText: "确定"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
this.Status.ShowEditChannel = true;
|
||||
this.showPop({
|
||||
showPop: true, //是否显示弹窗
|
||||
popType: 'custom',
|
||||
bgColor: '#383934bd',
|
||||
borderColor: '#BBE600',
|
||||
textColor: '#ffffffde',
|
||||
buttonBgColor: '#BBE600',
|
||||
buttonTextColor: '#232323DE',
|
||||
iconUrl: '',
|
||||
message: '',
|
||||
buttonText: '确定',
|
||||
clickEvt: '',
|
||||
visiblePrompt: false,
|
||||
promptTitle: '',
|
||||
modelValue: '',
|
||||
visibleClose: false,
|
||||
okCallback: () => {
|
||||
this.onChannelChanging();
|
||||
this.Status.ShowEditChannel = false;
|
||||
},
|
||||
showSlot: true,
|
||||
buttonCancelText: '取消',
|
||||
showCancel: true,
|
||||
cancelCallback: () => {
|
||||
this.Status.ShowEditChannel = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
getLinkedCnt() { //获取在线设备的数量
|
||||
|
||||
let f = this.getDevice();
|
||||
@ -2266,4 +2341,30 @@
|
||||
/deep/ .uni-navbar--fixed {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.popup-prompt-input {
|
||||
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
box-sizing: border-box;
|
||||
border-bottom: 2rpx solid rgba(255, 255, 255, 0.4);
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.14px;
|
||||
}
|
||||
|
||||
.popup-prompt-input-placeHolder {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
|
||||
font-family: PingFang SC;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
|
||||
letter-spacing: 0.14px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -10,8 +10,8 @@
|
||||
</uni-nav-bar>
|
||||
<view class="contentBg">
|
||||
<view class="row">
|
||||
<view class="typeItem fleft" :class="{'active':Status.tabType=='link'}" @click.stop="tabChange('link')">
|
||||
连接记录</view>
|
||||
<!-- <view class="typeItem fleft" :class="{'active':Status.tabType=='link'}" @click.stop="tabChange('link')">
|
||||
连接记录</view> -->
|
||||
<view class="typeItem fleft" :class="{'active':Status.tabType=='warn'}" @click.stop="tabChange('warn')">
|
||||
报警记录</view>
|
||||
<view class="filterIco fright" @click.stop="showFilter()">
|
||||
@ -90,7 +90,7 @@
|
||||
<view class="mothItem center" :class="{active:Status.filterDayType=='monthThree'}"
|
||||
@click.stop="mothItemChange('monthThree')">近三个月</view>
|
||||
<view class="mothItem center" :class="{active:Status.filterDayType=='monthOne'}"
|
||||
@click.stop="mothItemChange('monthOne')" }>近一个月</view>
|
||||
@click.stop="mothItemChange('monthOne')" >近一个月</view>
|
||||
<view class="mothItem center" :class="{active:Status.filterDayType=='customer'}"
|
||||
@click.stop="mothItemChange('customer')">自定义</view>
|
||||
|
||||
@ -204,7 +204,7 @@
|
||||
filterMode: true, //是否筛选日期
|
||||
filterDayMode: 'end', //当前筛选的是开始还是结束
|
||||
filterDayType: 'customer', //当前筛选的日期是哪种类型
|
||||
tabType: 'link',
|
||||
tabType: 'warn',
|
||||
|
||||
datePickValue: [999, 999, 999] //日期选择控件绑定的值
|
||||
|
||||
@ -251,10 +251,10 @@
|
||||
|
||||
let eventChannel = this.getOpenerEventChannel();
|
||||
|
||||
eventChannel.on('detailData', function(data) {
|
||||
eventChannel.on('detailData', (data)=> {
|
||||
var device = data.data;
|
||||
these.device = device;
|
||||
these.tabChange('link');
|
||||
this.device = device;
|
||||
this.tabChange('warn');
|
||||
});
|
||||
|
||||
|
||||
@ -304,7 +304,7 @@
|
||||
let today = new Date();
|
||||
let end = Common.DateFormat(today, 'yyyy-MM-dd');
|
||||
|
||||
let start = Common.DateFormat(today.setMonth(diff), 'yyyy-MM-dd');
|
||||
let start = Common.DateFormat(today.setMonth(today.getMonth()+ diff), 'yyyy-MM-dd');
|
||||
this.filter.start = start;
|
||||
this.filter.end = end;
|
||||
|
||||
@ -595,7 +595,9 @@
|
||||
if (!these.Status.filterMode) {
|
||||
if (these.filter.MM) {
|
||||
start = new Date(these.filter.MM + '-01');
|
||||
end = start.setMonth(1);
|
||||
end = new Date(these.filter.MM + '-01')
|
||||
end.setMonth(end.getMonth()+1);
|
||||
end.setDate(end.getDate()+1);
|
||||
data = data.filter(v => {
|
||||
|
||||
let t = v.linkEqs[0].linkTime
|
||||
@ -613,7 +615,7 @@
|
||||
console.log("these.filter.end=",these.filter.end);
|
||||
start = new Date(these.filter.start);
|
||||
end = new Date(these.filter.end);
|
||||
end.setMonth(1);
|
||||
end.setDate(end.getDate()+1);
|
||||
console.log("start=",start);
|
||||
console.log("end=",end);
|
||||
if(start && end){
|
||||
@ -643,7 +645,8 @@
|
||||
return t >= start;
|
||||
});
|
||||
} else if (these.filter.end) {
|
||||
end = new Date(these.filter.end).setMonth(1);
|
||||
end = new Date(these.filter.end);
|
||||
end.setDate(end.getDate()+1);
|
||||
|
||||
data = data.filter(v => {
|
||||
|
||||
@ -680,7 +683,7 @@
|
||||
if (systemInfo.uniPlatform == 'web') {
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
const timestamp = 1710072900000 + (i * 3600000); // 每小时递增
|
||||
const timestamp = new Date().getTime() - (i * 3600000); // 每小时递增
|
||||
const numItems = Math.floor(Math.random() * 5) + 1; // 1-5条
|
||||
|
||||
const item = {
|
||||
@ -740,7 +743,8 @@
|
||||
console.log("hese.filter.end=" + these.filter.end);
|
||||
let start = new Date(these.filter.start);
|
||||
let end = new Date(these.filter.end);
|
||||
end.setMonth(1);
|
||||
|
||||
end.setDate(end.getDate()+ 1);
|
||||
data = data.filter(v => {
|
||||
|
||||
let t = v.warnTime
|
||||
@ -748,7 +752,7 @@
|
||||
t = new Date(v.warnTime);
|
||||
}
|
||||
|
||||
return t >= start && t <= end;
|
||||
return t >= start && t < end;
|
||||
});
|
||||
} else if (these.filter.start) {
|
||||
let start = new Date(these.filter.start);
|
||||
@ -762,7 +766,8 @@
|
||||
return t >= start;
|
||||
});
|
||||
} else if (these.filter.end) {
|
||||
let end = new Date(these.filter.end).setMonth(1);
|
||||
let end = new Date(these.filter.end);
|
||||
end.setDate(end.getDate()+ 1);
|
||||
data = data.filter(v => {
|
||||
let t = v.warnTime
|
||||
if (!(t instanceof Date)) {
|
||||
@ -774,7 +779,9 @@
|
||||
} else {
|
||||
if (these.filter.MM) {
|
||||
let start = new Date(these.filter.MM + '-01');
|
||||
let end = start.setMonth(1);
|
||||
let end = new Date(these.filter.MM + '-01');
|
||||
end.setMonth(end.getMonth()+1);
|
||||
end.setDate(end.getDate()+1);
|
||||
data = data.filter((v) => {
|
||||
let t = v.warnTime
|
||||
if (!(t instanceof Date)){
|
||||
|
||||
Reference in New Issue
Block a user