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

View File

@@ -0,0 +1,168 @@
page{
background: #F0F0F0;
}
/* 分割线 */
.line{
background: #F0F0F0;
height: 20rpx;
}
.line-fine{
background: #F0F0F0;
height: 2rpx;
}
/* 时间开始 */
.time-block{
height: 92rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 40rpx;
background: #FFFFFF 100%;
}
.time-block-left{
display: flex;
flex-direction: row;
justify-content: flex-start;
height: 44rpx;
align-items: center;
}
.calendar-pic{
height: 44rpx;
width: 44rpx;
}
.time-text{
color: #303233;
font-size: 30rpx;
margin-left: 20rpx;
}
.time-block-right{
height: 44rpx;
width: 44rpx;
}
/* 时间结束 */
/* 总览开始 */
.overview-block{
height: 92rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 40rpx;
background: #FFFFFF 100%;
}
.overview-block-text{
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.overview-block-text-left{
color: #303233;
font-size: 30rpx;
margin-left: 20rpx;
}
.overview-block-text-right{
color: #FF5059;
font-size: 30rpx;
margin-left: 20rpx;
}
/* 总览结束 */
/* 图片开始 */
.pic-block{
display: flex;
flex-direction: column;
justify-content: flex-start;
box-sizing: border-box;
padding: 30rpx 40rpx;
background: #FFFFFF;
margin-top: 20rpx;
}
.pic-block-title{
display: flex;
flex-direction: row;
justify-content: flex-start;
height: 42rpx;
align-items: center;
}
.pic-block-title-left{
height: 34rpx;
width: 6rpx;
}
.pic-block-title-right{
color: #000000;
font-size: 30rpx;
margin-left: 14rpx;
}
.pic-block-pic{
height: 378rpx;
width: 670rpx;
margin-top: 30rpx;
}
/* 图片结束 */
/* 画图开始 */
.canvasView{
}
.ec-canvas{
}
.legend-block{
height: 30rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.legend-block-left{
height: 30rpx;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.legend-block-left-color{
height: 30rpx;
width: 30rpx;
background: #DAA520;
}
.legend-block-left-text{
font-size: 24rpx;
margin-left: 10rpx;
}
.legend-block-right{
height: 30rpx;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-left: 20rpx;
}
.legend-block-right-color{
height: 30rpx;
width: 30rpx;
background: #2E8B57;
}
.legend-block-right-text{
font-size: 24rpx;
margin-left: 10rpx;
}
/* 画图结束 */
/* 重试页面开始 */
.error-block{
height: 60%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: -10%;
margin-top: 300rpx;
}
.retry_button{
margin-top: 10rpx;
border-radius: 10%;
}
/* 重试页面结束 */

View File

@@ -0,0 +1,241 @@
<template>
<view>
<back :pageNameFlag="pageNameFlag" :pageName='pageName'></back>
<block v-if="errorFlag==0"><!-- 时间 -->
<view>
<uni-calendar ref="calendar" :insert="false" @confirm="confirm" :range='true'></uni-calendar>
</view>
<view class="time-block">
<view class="time-block-left">
<image class="calendar-pic" src="/static/pic/calendar.png"></image>
<view class="time-text">
{{timeStart}}{{timeEnd}}
</view>
</view>
<!-- <image src="/static/pic/jump.png" class="time-block-right"></image> -->
</view>
<view class=".line-fine">
</view>
<view class="overview-block">
<view class="overview-block-text">
<view class="overview-block-text-left">
数据完整性为
</view>
<view class="overview-block-text-right">
{{integrityz}}%
</view>
</view>
</view>
<scroll-view class="pic-block" scroll-y="true" :style="{height:srollHeight}">
<view class="pic-block-title">
<image class="pic-block-title-left" src="/static/pic/rectangle.png"></image>
<view class="pic-block-title-right">
数据完整性(%)
</view>
</view>
<view class="canvasView" :style="{height:picHeight}">
<mpvue-echarts class="ec-canvas" canvasId="line" ref="lineChart" :style="{height:picHeight}"/>
</view>
</scroll-view>
</block>
<view class="error-block" v-else-if="errorFlag==1">
<view class="error-text">
网络或服务器出错请稍后再试
</view>
<!-- <button class="retry_button" @click="retry">重试</button> -->
</view>
<view class="error-block" v-else>
<view class="error-text">
加载中...
</view>
</view>
</view>
</template>
<script>
import back from '../../components/back.vue';
import uniCalendar from "../../components/uni-calendar/uni-calendar";
import * as echarts from '@/components/echarts/echarts.simple.min.js';
import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue';
export default {
data() {
return {
pageNameFlag:1,
pageName:'数据完整性详情',
startDate:'',
endDate:'',
picHeight:'',
option:{},
dataIntegrity:{},
timeEnd:'',
timeStart:'',
errorFlag:0,
integrityz:'',
srollHeight:''
}
},
methods: {
chooseDate(){
this.$refs.calendar.open();
},
confirm(e){
var that = this;
var before = e.range.before;
var after = e.range.after;
var b = parseInt(before.replace('-','').replace('-',''));
var a = parseInt(after.replace('-','').replace('-',''));
if(a>b){
that.startDate = before;
that.endDate = after;
}else{
that.startDate = after;
that.endDate = before;
}
},
getDataIntegrity(){
var that=this;
if(that.judgeLogin()){
uni.request({
url: that.serverUrl+'/dataIntegrity/getDataIntegrity',
method:'POST',
data: {
userId:uni.getStorageSync('userInfo').userId
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
sslVerify:false,
success: (res) => {
uni.hideLoading()
if(res.data.resultCode=='10000'){
var data = res.data;
var dataIntegrity =res.data.data;
that.timeStart = that.formatTime(data.timeStart);
that.timeEnd = that.formatTime(data.timeEnd);
that.integrityz=data.integrityz+'';
that.dataIntegrity=dataIntegrity;
var list1=[];
var list2=[];
for(var i=0;i<dataIntegrity.length;i++){
list1.push(dataIntegrity[i].lineName);
list2.push(dataIntegrity[i].integrity)
}
that.drawPic(list1,list2)
}else{
uni.hideLoading()
that.errorFlag=1
}
},
fail() {
uni.hideLoading()
that.errorFlag=1
}
});
}
},
drawPic(list1,list2) {
var that = this ;
var w = '55%';
var l = '30%';
that.option={
grid:{
// width:'55%',
// left:'30%'
width:w,
left:l
},
xAxis: {
name: '数据完整性(%)',
type: 'value',
nameGap:30,
nameLocation:'center',
max:100,
axisLabel: {
margin:10
}
},
yAxis: {
type: 'category',
inverse: true,
// data: ['伟哥伟哥伟哥伟哥伟哥'],
data: list1,
axisLabel:{
interval:0,
fontsize:6,
formatter:function(value){
if(value.length>9){
return value.substring(0,8)+'...'
}else{
return value
}
}
}
// textStyle:{
// fontsize:10
// }
},
series: {
type: 'bar',
label: {
normal: {
show: true,
position:'right'
}
},
data:list2,
itemStyle:{
color:'#58C1FF',
position:'top'
},
barWidth:'90%',
}
}
var sys = uni.getSystemInfoSync();
var winWidth = sys.windowWidth;
var winHeight = sys.windowHeight;
var winrate = 750 / winWidth;
var statusBarHeight = sys.statusBarHeight;
// var picHeight = parseInt((winHeight - statusBarHeight) * winrate - 400)/winrate;
that.srollHeight = parseInt((winHeight - statusBarHeight) * winrate - 300)+ 'rpx';
var picHeight=list1.length*50+50
that.picHeight =picHeight*winrate+'rpx'
// that.picHeight = parseInt((winHeight - statusBarHeight) * winrate - 400)+ 'rpx';
let canvas = that.$refs.lineChart.canvas
echarts.setCanvasCreator(() => canvas);
let lineChart = echarts.init(canvas, null, {
width: winWidth,
height: picHeight
})
canvas.setChart(lineChart)
lineChart.setOption(that.option)
that.$refs.lineChart.setChart(lineChart)
},
retry(){
this.getDataIntegrity();
}
},
onLoad() {
var that=this;
// that.endDate=that.formatTime(new Date());
// that.startDate=that.endDate.substring(0,8)+'01';
uni.showLoading({
mask:true
})
},
onReady(){
var that=this;
that.getDataIntegrity();
},
components:{
back,
uniCalendar,
mpvueEcharts
}
}
</script>
<style>
@import url("dataIntegrityDetails.css");
</style>