1
0
forked from dyf/APP

修复102时间加减异常

This commit is contained in:
liub
2026-03-24 12:00:27 +08:00
parent 5163491ea3
commit c286660a10
7 changed files with 234 additions and 48 deletions

View File

@ -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)){