| | |
| | | <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"; |
| | |
| | | }); |
| | | |
| | | 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' }, |
| | |
| | | |
| | | const acTab = ref(tabs.value[0].name); |
| | | |
| | | const fullName = ref('湖北省-武汉市-武昌区-武昌机房-电池组1'); |
| | | const fullName = ref(''); |
| | | const topData = ref({}); |
| | | |
| | | |
| | |
| | | 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) { |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | topData.value = data; |
| | | if (realRes.code && realRes.data) { |
| | | // rtData. |
| | | rtData['system'] = realRes.data2; |
| | | rtData[realRes.data2.pageType] = realRes.data2; |
| | | } |
| | | } |
| | | } |
| | | ) |
| | | ); |
| | | |
| | | |
| | | onActivated(() => { |
| | | sendMessage(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | sendMessage(); |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |