first commit

This commit is contained in:
仲么了
2023-11-16 15:13:28 +08:00
commit 6023eac4fe
209 changed files with 34095 additions and 0 deletions

160
pages/history/history.css Normal file
View File

@@ -0,0 +1,160 @@
page{
background: #F0F0F0;
}
.title-padding{
height: var(--status-bar-height);
background: #FFFFFF 100%;
}
/* 标题开始 */
.history-title{
background: #FFFFFF 100%;
height: 88rpx;
border-bottom: 2rpx solid #F0F0F0;
}
.history-title-text{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 32rpx;
color: #171F24;
height: 88rpx;
}
/* 标题结束 */
/* 主体开始 */
.content-block{
display: flex;
flex-direction: column;
justify-content: flex-start;
background: #FFFFFF 100%;
}
.content-block-line{
display: flex;
flex-direction: row;
justify-content: space-between;
box-sizing: border-box;
padding: 0 40rpx;
align-items: center;
height: 92rpx;
border-bottom: 2rpx solid #F0F0F0;
}
.content-block-line-left{
color: #303233;
font-size: 30rpx;
}
.content-block-line-right{
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.content-block-line-right-text{
color: #3982FC;
font-size: 30rpx;
margin-right: 40rpx;
}
.content-block-line-right-pic{
height: 44rpx;
width: 44rpx;
}
.sroll-block{
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.sroll-block-line-one{
display: flex;
flex-direction: row;
height: 122rpx;
justify-content: space-between;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
padding: 0 40rpx;
margin-top: 20rpx;
border-bottom: solid #F0F0F0 1px;
}
.sroll-block-line-one-text{
margin-right: 14rpx;
height: 44rpx;
white-space: nowrap;
font-size: 32rpx;
color: #333333;
text-align: left;
display: flex;
flex-direction: column;
justify-content: center;
}
.sroll-block-line-one-pic{
height: 44rpx;
width: 44rpx;
}
.sroll-block-content{
display: flex;
flex-direction: column;
justify-content: flex-start;
margin-bottom: 20rpx;
height: 236rpx;
background: #FFFFFF;
}
.sroll-block-content-line-one{
height: 88rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 40rpx;
box-sizing: border-box;
}
.sroll-block-content-line-one-left{
display: flex;
flex-direction: row;
justify-content: flex-start;
height: 42rpx;
align-items: center;
}
.sroll-block-content-line-one-left-pic{
height: 34rpx;
width: 6rpx;
}
.sroll-block-content-line-one-left-text{
margin-left: 14rpx;
font-size: 30rpx;
color: #000000;
}
.sroll-block-content-line-one-right{
height: 44rpx;
width: 44rpx;
}
.sroll-block-content-line{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 92rpx;
border-bottom: 2rpx solid #F0F0F0;
padding: 0 40rpx;
box-sizing: border-box;
}
.sroll-block-content-line-text{
height: 124rpx;
font-size: 24rpx;
padding: 2rpx 40rpx;
box-sizing: border-box;
}
.sroll-block-content-line-left{
color: #303233;
font-size: 30rpx;
}
.sroll-block-content-line-right{
color: #999999;
font-size: 26rpx;
}
.no-data{
color: #FF5059;
/* background: #FFFFFF; */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
/* 主体结束 */

352
pages/history/history.vue Normal file
View File

@@ -0,0 +1,352 @@
<template>
<view>
<view class="title-padding">
</view>
<view class="history-title">
<view class="history-title-text">
历史数据
</view>
</view>
<view class="history-block">
<!-- 内容 -->
<view class="content-block">
<view class="content-block-line" @click="jumpToDataIntegrityDetails">
<view class="content-block-line-left">
数据完整性
</view>
<view class="content-block-line-right">
<!-- <view class="content-block-line-right-text">
85%
</view> -->
<image src="/static/pic/jump.png" class="content-block-line-right-pic"></image>
</view>
</view>
<view class="content-block-line" @click="jumpToTerminalStatus">
<view class="content-block-line-left">
终端在线率
</view>
<view class="content-block-line-right">
<!-- <view class="content-block-line-right-text">
85%
</view> -->
<image src="/static/pic/jump.png" class="content-block-line-right-pic"></image>
</view>
</view>
</view>
<!-- 监测点信息 -->
<view class="sroll-block-line-one" @click="jumpToCondition">
<view class="sroll-block-line-one-text">
<view class="">
{{lineInfo.lineName}}
</view>
<view class="">
{{startDate}}{{endDate}}
</view>
</view>
<!-- <image class="sroll-block-line-one-pic" src="/static/pic/pull.png"></image> -->
<image class="sroll-block-line-one-pic" src="/static/pic/jump.png"></image>
</view>
<scroll-view class="sroll-block" :scroll-y="scrollFlag" :style="{height:scrollHeight}" @scrolltolower="queryStatistics()" @touchend="touchEnd()" v-if="statisticsList.length>0">
<view class="sroll-block-content" @click="jumpToTerminalHistory(statistics.time)" v-for="statistics in statisticsList">
<view class="sroll-block-content-line-one">
<view class="sroll-block-content-line-one-left">
<image src="/static/pic/rectangle.png" class="sroll-block-content-line-one-left-pic"></image>
<view class="sroll-block-content-line-one-left-text">
{{statistics.showTime}}
</view>
</view>
<image class="sroll-block-content-line-one-right" src="/static/pic/jump.png"></image>
</view>
<scroll-view class="sroll-block-content-line-text" scroll-y="true">
<view class="" v-if="statistics.eventDescribe!=null">
{{statistics.eventDescribe}}
</view>
<view class="" v-if="statistics.steadyDescribe!=null">
{{statistics.steadyDescribe}}
</view>
</scroll-view>
<!-- <view class="sroll-block-content-line">
<view class="sroll-block-content-line-left">
暂降次数
</view>
<view class="sroll-block-content-line-right">
3
</view>
</view>
<view class="sroll-block-content-line">
<view class="sroll-block-content-line-left">
频率偏差合格率
</view>
<view class="sroll-block-content-line-right">
90%
</view>
</view>
<view class="sroll-block-content-line">
<view class="sroll-block-content-line-left">
电压畸变率合格率
</view>
<view class="sroll-block-content-line-right">
90%
</view>
</view>
<view class="sroll-block-content-line">
<view class="sroll-block-content-line-left">
奇次电压合格率
</view>
<view class="sroll-block-content-line-right">
80%
</view>
</view> -->
</view>
</scroll-view>
<view class="no-data" :style="{height:scrollHeight}" v-else>
暂无历史数据
</view>
</view>
</view>
</template>
<script>
import back from "../../components/back.vue";
export default {
data() {
return {
pageName:'历史数据',
pageNameFlag:1,
backShowFlag:0,
tabNum:1,
page:1,
num:20,
scrollHeight:'',
terminalStatus:55,
lineInfo:{
lineName:'暂无默认监测点,请选择',
lineIndex:''
},
statisticsList:[],
scrollFlag:true,
roleCode:1,
startDate:'',
endDate:'',
startDateMills:'',
endDateMills:''
}
},
methods: {
scrollH(){
var that =this;
var sys = uni.getSystemInfoSync();
var winWidth = sys.windowWidth;
var winrate = 750/winWidth;
var winHeight= sys.windowHeight;
var statusBarHeight = sys.statusBarHeight;
that.scrollHeight = parseInt((winHeight-statusBarHeight)*winrate-410)+'rpx';
},
touchEnd(){
var that = this;
that.scrollFlag=false;
setTimeout(function(){
that.scrollFlag=true;
},30)
},
changeTab(tabNum){
this.tabNum=tabNum;
},
queryDefaultLine(){
var that=this;
if(that.judgeLogin()){
uni.request({
url: that.serverUrl+'/realtimeinfo/getLineId',
method:'POST',
data: {
userIndex:uni.getStorageSync('userInfo').userId
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
sslVerify:false,
success: (res) => {
if(res.data.resultCode=='10000'){
var lineInfo = res.data.data
if(lineInfo){
that.lineInfo= lineInfo
that.queryStatistics();
}
}else{
uni.showModal({
title: '提示',
content: '查询失败,请重试',
confirmText:'重试',
success: function (res) {
if (res.confirm) {
that.queryDefaultLine();
} else if (res.cancel) {
console.log('用户点击取消');
}
},
});
}
},
fail() {
uni.showModal({
title: '提示',
content: '网络或服务器异常,请稍后再试',
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
}
},
queryStatistics(){
var that=this;
uni.request({
url: that.serverUrl+'/statistics/statistics',
method:'POST',
data: {
lineIndex:that.lineInfo.lineIndex,
startTime:that.startDateMills,
endTime:that.endDateMills,
page:that.page++,
num:that.num
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
sslVerify:false,
success: (res) => {
if(res.data.resultCode=='10000'){
var list= res.data.data
if(list!=null&&list!=undefined&&list!=''&&list!=[]){
for(var i=0;i<list.length;i++){
list[i].showTime = that.formatTime(list[i].time);
}
that.statisticsList= that.statisticsList.concat(list)
}
}else{
uni.showModal({
title: '提示',
content: '查询失败请重试',
confirmText:'重试',
success: function (res) {
if (res.confirm) {
that.queryStatistics();
} else if (res.cancel) {
console.log('用户点击取消');
}
},
});
}
},
fail() {
uni.showModal({
title: '提示',
content: '网络或服务器异常请稍后再试',
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
},
chooseLine(){
var that=this;
uni.navigateTo({
url:'../chooseLine/chooseLine'
});
uni.$on('lineInfoSelect',function(data){
that.lineInfo = data;
that.page=1;
that.statisticsList=[];
that.queryStatistics();
});
uni.$on('lineInfoQuery',function(data){
that.lineInfo = data;
that.page=1;
that.statisticsList=[];
that.queryStatistics();
})
},
jumpToDataIntegrityDetails(){
var userInfo=uni.getStorageSync('userInfo');
var roleCode= userInfo.roleCode;
if(roleCode!=0){
uni.showModal({
title:'提示',
content:'您暂无权限查看',
showCancel:false
})
return;
}
uni.navigateTo({
url:'../dataIntegrityDetails/dataIntegrityDetails'
})
},
jumpToTerminalStatus(){
var userInfo=uni.getStorageSync('userInfo');
var roleCode= userInfo.roleCode;
if(roleCode!=0){
uni.showModal({
title:'提示',
content:'您暂无权限查看',
showCancel:false
})
return;
}
uni.navigateTo({
url:'../terminalStatus/terminalStatus'
})
},
jumpToTerminalHistory(timeID){
var that=this;
uni.navigateTo({
url:'../terminalHistory/terminalHistory?lineInfo='+JSON.stringify(that.lineInfo)+'&timeID='+timeID
})
},
jumpToCondition(){
var that = this;
uni.navigateTo({
url:'../condition/condition?lineInfo='+JSON.stringify(that.lineInfo)+'&startDate='+that.startDate+'&endDate='+that.endDate+'&startDateMills='+that.startDateMills+'&endDateMills='+that.endDateMills+'&chooseDateTypeFlag=0&&chooseDateFlag=1&chooseLineFlag=1'
})
uni.$once('doQueryInfo',function(e){
that.startDate = e.startDate;
that.endDate = e.endDate;
that.startDateMills = e.startDateMills;
that.endDateMills = e.endDateMills;
that.lineInfo = e.lineInfo;
that.page=1;
that.statisticsList=[];
that.queryStatistics();
})
}
},
components: {
back
},
onLoad() {
var that = this;
that.scrollH();
that.endDate=that.formatTime(new Date());
that.startDate=that.endDate.substring(0,8)+'01';
that.startDateMills = Date.parse(that.startDate.replace(/-/g, '/'));
that.endDateMills = Date.parse(that.endDate.replace(/-/g, '/'))+86399999;
that.queryDefaultLine();
}
}
</script>
<style>
@import url("history.css");
</style>