| | |
| | | <script setup name="history"> |
| | | import { ref, reactive, watch, onMounted } from "vue"; |
| | | import { ref, reactive, watch, onMounted, onActivated } from "vue"; |
| | | import siteList from "@/components/siteList/index.vue"; |
| | | import getQueryString from "@/utils/getQueryString"; |
| | | import formatSeconds from '@/utils/formatSeconds'; |
| | |
| | | const route = useRoute(); |
| | | const router = useRouter(); |
| | | |
| | | const fullName = ref('湖北省-武汉市-武昌区-武昌机房-电池组1'); |
| | | const pageTab = ref('his-test'); |
| | | const flag = ref(Math.random()); |
| | | |
| | | const curStationId = ref( |
| | | getQueryString("stationId") || '' |
| | | ); |
| | | |
| | | const curPowerId = ref( |
| | | getQueryString("powerId") || '' |
| | | ); |
| | | |
| | | const curBattgroupId = ref( |
| | | getQueryString("battgroupId") || '' |
| | | ); |
| | | |
| | | const curDevId = ref( |
| | | getQueryString("devId") || '' |
| | | ); |
| | | |
| | | |
| | | const fullName = ref(''); |
| | | const pageTab = ref(getQueryString('pageTab') || 'his-test'); |
| | | |
| | | const show_num = ref(5); |
| | | function testRecordChange() { |
| | | |
| | | } |
| | | |
| | | function leafClick(item) { |
| | | // console.log('item', item, '============='); |
| | | curStationId.value = item.stationId; |
| | | curPowerId.value = item.powerId; |
| | | curBattgroupId.value = item.battgroupId || 0; |
| | | curDevId.value = item.devId || 0; |
| | | // fullName.value = item.fullName; |
| | | } |
| | | |
| | | function goRt() { |
| | | router.push({ |
| | | path: '/datas/realtime', |
| | | query: { |
| | | stationId: curStationId.value || 0, |
| | | powerId: curPowerId.value || 0, |
| | | devId: curDevId.value || 0, |
| | | battgroupId: curBattgroupId.value || 0, |
| | | pageFlag: Math.random(), |
| | | } |
| | | }); |
| | | } |
| | | |
| | | onActivated(async () => { |
| | | let pageFlag = getQueryString("pageFlag"); |
| | | // console.log('pageFlag', pageFlag, flag.value, '============='); |
| | | |
| | | if (pageFlag && pageFlag != flag.value) { |
| | | pageTab.value = getQueryString('pageTab') || 'his-test'; |
| | | flag.value = pageFlag; |
| | | } |
| | | }); |
| | | |
| | | </script> |
| | | |
| | |
| | | </div> |
| | | <div class="p-title">{{ fullName }}</div> |
| | | <div class="btn-grp pos"> |
| | | <div class="data-granularity" v-if="pageTab === 'his-test'"> |
| | | <!-- <div class="data-granularity" v-if="pageTab === 'his-test'"> --> |
| | | <div class="data-granularity" > |
| | | <label style="font-size: 12px; margin-right: 8px">显示粒度:</label> |
| | | <el-select |
| | | v-model="show_num" |
| | |
| | | <el-option :value="10" label="×10"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <el-button type="primary" size="small">实时监测</el-button> |
| | | <el-button type="primary" size="small" @click="goRt">实时监测</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="page-main"> |
| | | <!-- 历史测试数据 --> |
| | | <his-test v-if="pageTab == 'his-test'"></his-test> |
| | | <his-test :battgroupId="curBattgroupId" :num="show_num" v-if="pageTab == 'his-test'"></his-test> |
| | | <!-- 历史实时数据 --> |
| | | <his-real v-if="pageTab == 'his-real'"></his-real> |
| | | <his-real :battgroupId="curBattgroupId" :num="show_num" v-if="pageTab == 'his-real'"></his-real> |
| | | </div> |
| | | </div> |
| | | </div> |