whychdw
2025-06-06 d0f98ad8e1047e3161a458399ad3005404ed87b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<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>