lg_frontend/components/CheckData.vue

433 lines
12 KiB
Vue
Raw Permalink Normal View History

2024-02-19 14:00:33 +00:00
<!--实时检查数据-->
<template>
<div class="check-data">
<secondary-title :title="title" longBg>
<template>
<div class="right-tip">
注释表头为污染物名称[污染物标准值]
</div>
</template>
</secondary-title>
2024-02-20 12:52:30 +00:00
<div class="check-data-info">
<div class="table-info">
<div class="table-header">
<div class="table-header-item" v-for="(item,index) of tableHeaderData"
:style="`width:${tableItemWidthList[index]}%`">
{{ item }}
</div>
</div>
<div class="table-body">
2024-02-25 11:12:49 +00:00
<vue-seamless-scroll
v-if="dataSource.length"
ref="vueSeamless"
:data="dataSource"
class="seamless-scroll"
:class-option="defaultOption"
>
<div class="table-item-body" v-for="item of dataSource">
<div class="point-name" :style="`width:${tableItemWidthList[0]}%`" :title="item.pointName">{{
item.pointName
}}
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[1]}%`">
<div class="_value">
{{ `${item.COValue}${item.COUnit}` }}
</div>
<div :class="getOddsRatioIcon(item.COValue,'COStandardValue')">
2024-02-20 12:52:30 +00:00
2024-02-25 11:12:49 +00:00
</div>
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[2]}%`">
<div class="_value">
{{ `${item.SO2Value}${item.SO2Unit}` }}
</div>
<div :class="getOddsRatioIcon(item.SO2Value,'SO2StandardValue')">
2024-02-20 12:52:30 +00:00
2024-02-25 11:12:49 +00:00
</div>
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[3]}%`">
<div class="_value">
{{ `${item.NOValue}${item.NOUnit}` }}
</div>
<div :class="getOddsRatioIcon(item.NOValue,'NOStandardValue')">
2024-02-20 12:52:30 +00:00
2024-02-25 11:12:49 +00:00
</div>
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[4]}%`">
<div class="_value">
{{ `${item.O3Value}${item.O3Unit}` }}
</div>
<div :class="getOddsRatioIcon(item.O3Value,'O3StandardValue')">
2024-02-20 12:52:30 +00:00
2024-02-25 11:12:49 +00:00
</div>
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[5]}%`">
<div class="_value">
{{ `${item.PM10Value}${item.PM10Unit}` }}
</div>
<div :class="getOddsRatioIcon(item.PM10Value,'PM10StandardValue')">
</div>
2024-02-20 12:52:30 +00:00
</div>
2024-02-25 11:12:49 +00:00
<div class="data-value" :style="`width:${tableItemWidthList[6]}%`">
<div class="_value">
{{ `${item.PM25Value}${item.PM25Unit}` }}
</div>
<div :class="getOddsRatioIcon(item.PM25Value,'PM25StandardValue')">
2024-02-20 12:52:30 +00:00
2024-02-25 11:12:49 +00:00
</div>
2024-02-20 12:52:30 +00:00
</div>
</div>
2024-02-25 11:12:49 +00:00
</vue-seamless-scroll>
2024-02-20 12:52:30 +00:00
</div>
</div>
</div>
2024-02-19 14:00:33 +00:00
</div>
</template>
<script>
2024-02-25 11:12:49 +00:00
import vueSeamlessScroll from 'vue-seamless-scroll'
2024-02-19 14:00:33 +00:00
export default {
name: "CheckData",
2024-02-25 11:12:49 +00:00
components: {vueSeamlessScroll},
2024-02-19 14:00:33 +00:00
data() {
return {
2024-02-20 12:52:30 +00:00
title: '实时检查数据',
tableItemWidthList: [12, 16, 16, 16, 13, 14, 13],
standardValue: {
COStandardValue: 0.5,
SO2StandardValue: 30,
NOStandardValue: 10,
O3StandardValue: 80,
PM10StandardValue: 50,
PM25StandardValue: 40
},
tableHeaderData: ['监测设备', '一氧化碳[0.5%VOL]', '二氧化硫[30mg/m³]', '氮氧化物[10mg/L]', '臭氧[80⏜ppm]', 'PM10[50μg/m³]', 'PM2.5[40μg/m³]'],
dataSource: [
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
},
{
pointName: '监测设备名称',
COValue: 2,
COUnit: '%VOL',
SO2Value: 30,
SO2Unit: 'mg/m³',
NOValue: 20,
NOUnit: 'mg/L',
O3Value: 10,
O3Unit: 'ppm',
PM10Value: 10,
PM10Unit: 'μg/m³',
PM25Value: 30,
PM25Unit: 'μg/m³'
}
]
}
},
2024-02-25 11:12:49 +00:00
computed: {
defaultOption() {
return {
step: 0.3, // 数值越大速度滚动越快
limitMoveNum: 9, // 开始无缝滚动的数据量 this.dataList.length
hoverStop: true, // 是否开启鼠标悬停stop
direction: 1, // 0向下 1向上 2向左 3向右
openWatch: true, // 开启数据实时监控刷新dom
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
}
},
},
2024-02-20 12:52:30 +00:00
methods: {
//判断数值是上升还是下降
getOddsRatioIcon(val, valType) {
if (val > this.standardValue[valType]) {
return 'odds-ratio-up-icon'
} else if (val < this.standardValue[valType]) {
return 'odds-ratio-reduction-icon'
}
2024-02-19 14:00:33 +00:00
}
}
}
</script>
<style scoped lang="less">
@import "assets/styles/mixin";
.check-data {
margin-top: 43px;
2024-02-20 12:52:30 +00:00
height: 1100px;
2024-02-19 14:00:33 +00:00
width: 100%;
background-image: linear-gradient(62deg, rgba(8, 31, 55, 0.10) 0%, rgba(18, 50, 81, 0.10) 100%);
2024-02-20 12:52:30 +00:00
/* border: 1px inset transparent; !* *!
border-image: linear-gradient(rgba(79, 182, 238, 0), rgba(39, 127, 216, 1)); !* 使用线性渐变作为边框图片 *!
border-image-slice: 1; !* 指定切分边框图像的位置 *!*/
.flex-column;
overflow: hidden;
2024-02-19 14:00:33 +00:00
.right-tip {
height: 100%;
font-family: MicrosoftYaHei;
font-size: 29.97px;
color: #6AC4FF;
letter-spacing: 1.97px;
text-align: right;
font-weight: 400;
padding-right: 10px;
.flex-row;
}
2024-02-20 12:52:30 +00:00
.check-data-info {
flex: 1;
padding: 30px 20px 0 20px;
height: 0;
2024-02-25 11:12:49 +00:00
2024-02-20 12:52:30 +00:00
.table-info {
width: 100%;
height: 100%;
.flex-column;
.table-header {
height: 77px;
background-color: rgba(35, 140, 255, 0.2);
padding: 0 20px;
.flex-row;
.table-header-item {
font-family: MicrosoftYaHei-Bold;
font-size: 29.97px;
color: #37EAFF;
letter-spacing: 0;
text-align: left;
line-height: 34.25px;
font-weight: 700;
}
}
.table-body {
height: calc(100% - 77px);
2024-02-25 11:12:49 +00:00
.seamless-scroll {
height: 100%;
overflow: hidden;
}
2024-02-20 12:52:30 +00:00
.table-item-body {
height: 77px;
background: rgba(21, 77, 160, 0.20);
margin-top: 20px;
.flex-row;
.point-name {
font-family: MicrosoftYaHei-Bold;
font-size: 29.97px;
color: #FFFFFF;
letter-spacing: 0;
line-height: 34.25px;
font-weight: 700;
text-align: left;
.text-ellipsis;
}
.data-value {
.flex-row;
justify-content: center;
._value {
font-family: MicrosoftYaHei-Bold;
font-size: 29.97px;
color: #FFFFFF;
letter-spacing: 0;
text-align: center;
font-weight: 700;
}
.odds-ratio-up-icon {
width: 23px;
height: 25px;
background: url("assets/peakCoalImages/left/odds-ratio-up-icon.png") no-repeat;
padding-left: 20px;
}
.odds-ratio-reduction-icon {
width: 22px;
height: 26px;
background: url("assets/peakCoalImages/left/odds-ratio-reduction-icon.png") no-repeat;
padding-left: 20px;
}
}
}
}
}
}
}
2024-02-25 11:12:49 +00:00
2024-02-20 12:52:30 +00:00
::-webkit-scrollbar {
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
2024-02-25 11:12:49 +00:00
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
2024-02-20 12:52:30 +00:00
background-color: rgba(21, 77, 160, 0.20);;
}
::-webkit-scrollbar-track {
2024-02-25 11:12:49 +00:00
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
2024-02-20 12:52:30 +00:00
border-radius: 5px;
background-color: #d3dce6;
2024-02-19 14:00:33 +00:00
}
</style>