From 3c3576d5792bfabcef84979757ee344712e71cd3 Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期六, 21 六月 2025 09:19:29 +0800 Subject: [PATCH] UA 整理提交 --- src/views/realtime/index.vue | 121 +++++++++++++++++++++++++++++++--------- 1 files changed, 93 insertions(+), 28 deletions(-) diff --git a/src/views/realtime/index.vue b/src/views/realtime/index.vue index 7db41d7..c4a8d94 100644 --- a/src/views/realtime/index.vue +++ b/src/views/realtime/index.vue @@ -1,11 +1,17 @@ <script setup name="realtime"> -import { ref, reactive, watch, onMounted } from "vue"; +import { ref, reactive, watch, onMounted, onActivated } from "vue"; import tabPower from "./tabs/power.vue"; import tabSystem from "./tabs/system.vue"; import tabVol from './tabs/vol.vue'; +import tabRes from './tabs/res.vue'; +import tabTemp from './tabs/temp.vue'; +// import tabThreeD from './tabs/threeD.vue'; +// import tabSelf from './tabs/self.vue'; +import tabManage from './tabs/manage.vue'; import siteList from "@/components/siteList/index.vue"; import getQueryString from "@/utils/getQueryString"; import formatSeconds from '@/utils/formatSeconds'; +import battAlarmParams from '@/views/alarm/battAlarmParams.vue'; import { useRoute, useRouter } from "vue-router"; @@ -44,10 +50,10 @@ }); const statusList = reactive([ - { label: '绯荤粺鐘舵��', prop: 'systemState', unit: '' }, - { label: '璁惧鐘舵��', prop: 'devState', unit: '' }, - { label: '鐢垫簮鐘舵��', prop: 'pwrState', unit: '' }, - { label: '鐢垫睜鐘舵��', prop: 'battState', unit: '' }, + { label: '绯荤粺鐘舵��', prop: 'systemStateName', unit: '' }, + { label: '璁惧鐘舵��', prop: 'devStateName', unit: '' }, + { label: '鐢垫簮鐘舵��', prop: 'pwrStateName', unit: '' }, + { label: '鐢垫睜鐘舵��', prop: 'battStateName', unit: '' }, { label: '姣嶇嚎鐢靛帇', prop: 'vbusVol', unit: 'V' }, { label: '鍦ㄧ嚎鐢靛帇', prop: 'onlineVol', unit: 'V' }, { label: '缁勭鐢靛帇', prop: 'captestGroupvol', unit: 'V' }, @@ -81,7 +87,7 @@ const acTab = ref(tabs.value[0].name); -const fullName = ref('婀栧寳鐪�-姝︽眽甯�-姝︽槍鍖�-姝︽槍鏈烘埧-鐢垫睜缁�1'); +const fullName = ref(''); const topData = ref({}); @@ -102,8 +108,69 @@ sendMessage(); } +const visibles = reactive({ + powerAlarmSet: false, + battAlarmSet: false +}); + function btnClick(item) { console.log('item', item, '============='); + // 鏀逛负璺宠浆 + switch(item.name) { + case 'powerAlarmSet': + router.push({ + path: '/alarm/power-setting', + query: { + stationId: curStationId.value || 0, + powerId: curPowerId.value || 0, + devId: curDevId.value || 0, + battgroupId: curBattgroupId.value || 0, + pageFlag: Math.random(), + } + }); + break; + case 'battAlarmSet': + // visibles.battAlarmSet = true; + router.push({ + path: '/alarm/batt-setting', + query: { + stationId: curStationId.value || 0, + powerId: curPowerId.value || 0, + devId: curDevId.value || 0, + battgroupId: curBattgroupId.value || 0, + pageFlag: Math.random(), + } + }); + break; + case 'img': + break; + case 'history': + router.push({ + path: '/datas/history', + query: { + stationId: curStationId.value || 0, + powerId: curPowerId.value || 0, + devId: curDevId.value || 0, + battgroupId: curBattgroupId.value || 0, + pageTab: 'his-test', + pageFlag: Math.random(), + } + }); + break; + case 'hisRt': + router.push({ + path: '/datas/history', + query: { + stationId: curStationId.value || 0, + powerId: curPowerId.value || 0, + devId: curDevId.value || 0, + battgroupId: curBattgroupId.value || 0, + pageTab: 'his-real', + pageFlag: Math.random(), + } + }); + break; + } } function leafClick(item) { @@ -114,19 +181,6 @@ curDevId.value = item.devId || 0; sendMessage(); - - // if (getQueryString("stationId")) { - // router.push({ - // path: route.path, - // query: { - // stationId: item.stationId, - // powerId: item.powerId, - // battgroupId: item.battgroupId || undefined, - // devId: item.devId || undefined - // } - // }) - // } - // fullName.value = item.fullName; } @@ -143,14 +197,15 @@ } topData.value = data; if (realRes.code && realRes.data) { - // rtData. - rtData['system'] = realRes.data2; + rtData[realRes.data2.pageType] = realRes.data2; } } } -) +); - +onActivated(() => { + sendMessage(); +}); onMounted(() => { sendMessage(); @@ -199,16 +254,22 @@ <tab-system :data="rtData['system']" :powerId="curPowerId" :devId="curDevId" :battgroupId="curBattgroupId"></tab-system> </div> <div class="tab-contain" v-if="acTab == 'power'"> - <tab-power></tab-power> + <tab-power :data="rtData['power']"></tab-power> </div> <div class="tab-contain" v-if="acTab == 'vol'"> - <tab-vol></tab-vol> + <tab-vol :data="rtData['vol']"></tab-vol> </div> - <div class="tab-contain" v-if="acTab == 'res'">3</div> - <div class="tab-contain" v-if="acTab == 'tmp'">4</div> + <div class="tab-contain" v-if="acTab == 'res'"> + <tab-res :data="rtData['res']"></tab-res> + </div> + <div class="tab-contain" v-if="acTab == 'tmp'"> + <tab-temp :data="rtData['tmp']"></tab-temp> + </div> <div class="tab-contain" v-if="acTab == '3D'">5</div> <div class="tab-contain" v-if="acTab == 'self'">6</div> - <div class="tab-contain" v-if="acTab == 'manage'">7</div> + <div class="tab-contain" v-if="acTab == 'manage'"> + <tab-manage :data="rtData['manage']"></tab-manage> + </div> <!-- <div class="tab-contain" v-if="acTab == 'powerAlarmSet'">8</div> <div class="tab-contain" v-if="acTab == 'battAlarmSet'">9</div> <div class="tab-contain" v-if="acTab == 'img'">10</div> @@ -216,6 +277,10 @@ <div class="tab-contain" v-if="acTab == 'hisRt'">12</div> --> </div> </div> + <!-- 鐢垫睜鍛婅鍙傛暟 --> + <!-- <el-dialog v-model="visibles.battAlarmSet" title="鐢垫睜鍛婅鍙傛暟" width="900"> + <batt-alarm-params @close="visibles.battAlarmSet = false" v-if="visibles.battAlarmSet" :id="curBattgroupId"></batt-alarm-params> + </el-dialog> --> </div> </template> -- Gitblit v1.9.1