<script setup name="history">
|
import { ref, reactive, watch, onMounted } from "vue";
|
import siteList from "@/components/siteList/index.vue";
|
import getQueryString from "@/utils/getQueryString";
|
import formatSeconds from '@/utils/formatSeconds';
|
import hisTest from "./hisTest.vue";
|
import hisReal from "./hisReal.vue";
|
|
import { useRoute, useRouter } from "vue-router";
|
import useWebsocket from "@/hooks/useWebsocket";
|
|
const route = useRoute();
|
const router = useRouter();
|
|
const fullName = ref('湖北省-武汉市-武昌区-武昌机房-电池组1');
|
const pageTab = ref('his-test');
|
|
const show_num = ref(5);
|
|
</script>
|
|
<template>
|
<div class="page-contain">
|
<site-list @leaf-click="leafClick"></site-list>
|
<div class="page-inner">
|
<div class="page-header">
|
<div class="btn-grp">
|
<el-radio-group v-model="pageTab">
|
<el-radio-button label="历史测试数据" value="his-test" />
|
<el-radio-button label="历史实时数据" value="his-real" />
|
</el-radio-group>
|
</div>
|
<div class="p-title">{{ fullName }}</div>
|
<div class="btn-grp pos">
|
<div class="data-granularity" v-if="pageTab === 'his-test'">
|
<label style="font-size: 12px; margin-right: 8px">显示粒度:</label>
|
<el-select
|
v-model="show_num"
|
size="small"
|
style="width: 90px"
|
@change="testRecordChange"
|
>
|
<el-option :value="1" label="×1"></el-option>
|
<el-option :value="2" label="×2"></el-option>
|
<el-option :value="3" label="×3"></el-option>
|
<el-option :value="4" label="×4"></el-option>
|
<el-option :value="5" label="×5"></el-option>
|
<el-option :value="6" label="×6"></el-option>
|
<el-option :value="7" label="×7"></el-option>
|
<el-option :value="8" label="×8"></el-option>
|
<el-option :value="9" label="×9"></el-option>
|
<el-option :value="10" label="×10"></el-option>
|
</el-select>
|
</div>
|
<el-button type="primary" size="small">实时监测</el-button>
|
</div>
|
</div>
|
<div class="page-main">
|
<!-- 历史测试数据 -->
|
<his-test v-if="pageTab == 'his-test'"></his-test>
|
<!-- 历史实时数据 -->
|
<his-real v-if="pageTab == 'his-real'"></his-real>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<style scoped lang="less">
|
.page-contain {
|
display: flex;
|
padding: 8px 8px 8px 0;
|
margin-left: 8px;
|
overflow: hidden;
|
.page-inner {
|
display: flex;
|
flex-direction: column;
|
flex: 1;
|
margin-left: 8px;
|
}
|
|
.page-header {
|
// border: 1px solid #0ff;
|
background: #071426;
|
position: relative;
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #497AAB;
|
padding-right: 16em;
|
|
.btn-grp {
|
display: flex;
|
align-items: center;
|
.data-granularity {
|
margin-right: 0.6em;
|
}
|
&.pos {
|
position: absolute;
|
right: 8px;
|
top: 0;
|
height: 100%;
|
}
|
:deep(.el-radio-group) {
|
label {
|
~ label {
|
margin-left: 10px;
|
}
|
}
|
span {
|
border-radius: 0;
|
border: 0 none;
|
background: #134bab;
|
color: #fff;
|
}
|
.is-active {
|
span {
|
background-color: #47cafe;
|
color: #0e344e;
|
}
|
}
|
}
|
}
|
|
.p-title {
|
flex: 1;
|
font-size: 18px;
|
font-weight: 700;
|
color: #50c7f1;
|
height: 42px;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.status-bar {
|
height: 72px;
|
display: flex;
|
flex-direction: row;
|
|
.status-item {
|
flex: 1;
|
font-size: 14px;
|
font-weight: 700;
|
color: #50c7f1;
|
// border: 1px solid #0F6B79;
|
border-radius: 6px;
|
margin: 4px 2px;
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
align-items: center;
|
box-shadow: inset 0 0 30px -10px #0F6B79;
|
background: radial-gradient(circle at -10% center, #1F6571 5%, transparent 20%) no-repeat,
|
radial-gradient(circle at 110% center, #1F6571 5%, transparent 20%) no-repeat,
|
radial-gradient(circle at center -72%, #1F6571 12%, transparent 50%) no-repeat,
|
radial-gradient(circle at center 138%, #1F6571 12%, transparent 50%) no-repeat;
|
|
.item-value {
|
margin-bottom: 6px;
|
color: #ff0;
|
font-size: 20px;
|
&.time {
|
white-space: nowrap;
|
font-size: 12px;
|
}
|
}
|
|
.item-name {
|
color: #6DCCE6;
|
}
|
}
|
}
|
|
.p-tabs {
|
display: flex;
|
flex-direction: row;
|
height: 46px;
|
border: 1px solid #426EA0;
|
padding: 4px;
|
|
.tab-item {
|
font-size: 14px;
|
font-weight: 700;
|
flex: 1;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
margin-left: 2px;
|
margin-right: 2px;
|
background: #073451;
|
cursor: pointer;
|
|
&.active {
|
background: #47CAFE;
|
color: #03216e;
|
}
|
&.btn-item {
|
background: #076fe8;
|
// border-radius: 6px;
|
}
|
}
|
}
|
}
|
|
.page-main {
|
flex: 1;
|
padding-left: 0;
|
padding-right: 0;
|
.tab-contain {
|
height: 100%;
|
}
|
|
}
|
}
|
</style>
|