fix:小屏样式优化
This commit is contained in:
parent
1495adbad9
commit
efbc300e35
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<title>Loading...</title>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -49,7 +49,7 @@ const onMenuCollapse = function () {
|
||||
<style scoped lang="scss">
|
||||
.layout-logo {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
height: v-bind('config.headerHeight()');
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -25,10 +25,14 @@ import type { RouteRecordRaw } from 'vue-router'
|
||||
import { getFirstRoute, onClickMenu } from '/@/utils/router'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const config = useConfig()
|
||||
|
||||
const padding = computed(() => (window.screen.width < 1920 ? '10px' : '20px'))
|
||||
const height = computed(() => (window.screen.width < 1920 ? '40px' : '56px'))
|
||||
|
||||
interface Props {
|
||||
menus: RouteRecordRaw[]
|
||||
extends?: {
|
||||
@ -68,6 +72,16 @@ const onClickSubMenu = (menu: RouteRecordRaw) => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-menu-item {
|
||||
padding: 0 v-bind(padding);
|
||||
height: v-bind(height);
|
||||
:deep(.el-menu-tooltip__trigger) {
|
||||
padding: 0 v-bind(padding);
|
||||
}
|
||||
}
|
||||
:deep(.el-sub-menu__title) {
|
||||
padding: 0 v-bind(padding);
|
||||
}
|
||||
.el-sub-menu .icon,
|
||||
.el-menu-item .icon {
|
||||
vertical-align: middle;
|
||||
|
@ -30,7 +30,7 @@ const state = reactive({
|
||||
})
|
||||
|
||||
const width = computed(() => {
|
||||
return config.layout.menuCollapse ? '5px' : '20px'
|
||||
return config.layout.menuCollapse ? '5px' : window.screen.width < 1920 ? '10px' : '20px'
|
||||
})
|
||||
|
||||
const verticalMenusScrollbarHeight = computed(() => {
|
||||
|
@ -15,9 +15,12 @@ import NavTabs from '/@/layouts/backend/components/navBar/tabs.vue'
|
||||
import { layoutNavTabsRef } from '/@/stores/refs'
|
||||
import NavMenus from '../navMenus.vue'
|
||||
import { showShade } from '/@/utils/pageShade'
|
||||
|
||||
import { computed } from 'vue'
|
||||
const config = useConfig()
|
||||
|
||||
const padding = computed(() => (window.screen.width < 1920 ? '10px' : '20px'))
|
||||
const height = computed(() => (window.screen.width < 1920 ? '36px' : '48px'))
|
||||
|
||||
const onMenuCollapse = () => {
|
||||
showShade('ba-aside-menu-shade', () => {
|
||||
config.setLayout('menuCollapse', true)
|
||||
@ -29,7 +32,7 @@ const onMenuCollapse = () => {
|
||||
<style scoped lang="scss">
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
height: 60px;
|
||||
height: v-bind('config.headerHeight()');
|
||||
width: 100%;
|
||||
background-color: v-bind('config.getColorVal("headerBarBackground")');
|
||||
:deep(.nav-tabs) {
|
||||
@ -75,11 +78,11 @@ const onMenuCollapse = () => {
|
||||
}
|
||||
.nav-route {
|
||||
display: flex;
|
||||
height: 48px;
|
||||
height: v-bind(height);
|
||||
width: 100%;
|
||||
background-color: transparent;
|
||||
line-height: 48px;
|
||||
margin: 20px 0px;
|
||||
line-height: v-bind(height);
|
||||
margin: v-bind(padding) 0px;
|
||||
:deep(.nav-tabs) {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
@ -14,6 +14,7 @@
|
||||
</el-container>
|
||||
<CloseFullScreen v-if="navTabs.state.tabFullScreen" />
|
||||
</template>
|
||||
q
|
||||
|
||||
<script setup lang="ts">
|
||||
import Aside from '/@/layouts/backend/components/aside.vue'
|
||||
@ -22,8 +23,15 @@ import Main from '/@/layouts/backend/router-view/main.vue'
|
||||
import CloseFullScreen from '/@/layouts/backend/components/closeFullScreen.vue'
|
||||
import { useNavTabs } from '/@/stores/navTabs'
|
||||
import { useSiteConfig } from '/@/stores/siteConfig'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
import { computed } from 'vue'
|
||||
const siteConfig = useSiteConfig()
|
||||
const navTabs = useNavTabs()
|
||||
const config = useConfig()
|
||||
|
||||
const padding = computed(() => (window.screen.width < 1920 ? '0px' : '10px'))
|
||||
|
||||
const bodyPadding = computed(() => (window.screen.width < 1920 ? '10px' : '20px'))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@ -35,16 +43,16 @@ const navTabs = useNavTabs()
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 20px;
|
||||
padding: 0 v-bind(bodyPadding);
|
||||
}
|
||||
.layout-logo {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
height: v-bind('config.headerHeight()');
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
padding: v-bind(padding);
|
||||
background-image: linear-gradient(170deg, #eaf6ff 0%, #fbfdff 94%);
|
||||
box-shadow: 0px 0px 20px 0px rgba(0, 100, 170, 0.09);
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ export const useConfig = defineStore(
|
||||
menuTopBarBackground: ['#fcfcfc', '#1d1e1f'],
|
||||
// 侧边菜单宽度(展开时),单位px
|
||||
menuWidth: 260,
|
||||
headerHeight: 60,
|
||||
// 侧边菜单项默认图标
|
||||
menuDefaultIcon: 'fa fa-circle-o',
|
||||
// 是否水平折叠收起菜单
|
||||
@ -70,9 +71,19 @@ export const useConfig = defineStore(
|
||||
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||
}
|
||||
// 菜单是否折叠
|
||||
if (window.screen.width < 1920) {
|
||||
layout.menuWidth = 180
|
||||
return layout.menuCollapse ? '54px' : layout.menuWidth + 'px'
|
||||
}
|
||||
layout.menuWidth = 260
|
||||
return layout.menuCollapse ? '74px' : layout.menuWidth + 'px'
|
||||
}
|
||||
|
||||
const headerHeight = function () {
|
||||
if (window.screen.width < 1920) return '46px'
|
||||
return layout.headerHeight + 'px'
|
||||
}
|
||||
|
||||
function setLang(val: string) {
|
||||
lang.defaultLang = val
|
||||
}
|
||||
@ -114,7 +125,7 @@ export const useConfig = defineStore(
|
||||
// }
|
||||
}
|
||||
|
||||
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
return { layout, lang, menuWidth, headerHeight, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
},
|
||||
{
|
||||
persist: {
|
||||
|
@ -8,6 +8,7 @@ export interface Layout {
|
||||
mainAnimation: string
|
||||
isDark: boolean
|
||||
menuWidth: number
|
||||
headerHeight: number
|
||||
menuDefaultIcon: string
|
||||
menuCollapse: boolean
|
||||
menuUniqueOpened: boolean
|
||||
|
@ -12,7 +12,7 @@ export function mainHeight(extra = 0): CSSProperties {
|
||||
let height = extra
|
||||
const adminLayoutMainExtraHeight: anyObj = {
|
||||
Default: 70,
|
||||
Classic: 150,
|
||||
Classic: window.screen.width < 1920 ? 110 : 150,
|
||||
Streamline: 60,
|
||||
}
|
||||
if (isAdminApp()) {
|
||||
|
@ -8,33 +8,41 @@
|
||||
<el-text class="mx-1 homelabel">风场概览</el-text>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<div :sm="12" :lg="6" class="small-panel" style="margin-bottom: 10px;">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewP.png" alt="">
|
||||
<div :sm="12" :lg="6" class="small-panel" style="margin-bottom: 10px">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewP.png" alt="" />
|
||||
<div class="small-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmactivepower}}</span> <span>MW</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmactivepower }}</span> <span>MW</span>
|
||||
</div>
|
||||
<div>功率</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :sm="12" :lg="6" class="small-panel">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewW.png" alt="">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewW.png" alt="" />
|
||||
<div class="small-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmavgwindspeed}}</span> <span>m/s</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmavgwindspeed }}</span> <span>m/s</span>
|
||||
</div>
|
||||
<div>风速</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div :sm="12" :lg="6" class="small-panel" style="margin-bottom: 10px;">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewR.png" alt="">
|
||||
<div :sm="12" :lg="6" class="small-panel" style="margin-bottom: 10px">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewR.png" alt="" />
|
||||
<div class="small-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmdayoperationhours}}</span> <span>H</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmdayoperationhours }}</span> <span>H</span>
|
||||
</div>
|
||||
<div>日利用小时</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :sm="12" :lg="6" class="small-panel">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewY.png" alt="">
|
||||
<img class="small-panel-pic" src="~assets/dashboard/viewY.png" alt="" />
|
||||
<div class="small-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmmonthoperationhours}}</span> <span>H</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmmonthoperationhours }}</span> <span>H</span>
|
||||
</div>
|
||||
<div>月利用小时</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -44,22 +52,26 @@
|
||||
|
||||
<!--今日运行状态-->
|
||||
<div class="status panelBg">
|
||||
<el-text class="mx-1 homelabel" style="margin-bottom: 0;">今日运行状态</el-text>
|
||||
<el-text class="mx-1 homelabel" style="margin-bottom: 0">今日运行状态</el-text>
|
||||
<el-row :gutter="10" class="statusrow">
|
||||
<el-col :span="12">
|
||||
<div class="status-panel">
|
||||
<img class="status-panel-pic" src="~assets/dashboard/status1.png" alt="">
|
||||
<img class="status-panel-pic" src="~assets/dashboard/status1.png" alt="" />
|
||||
<div class="status-base-main">
|
||||
<div><span class="content-number">{{currentDayStatus.windTurbineNum}}</span> <span>台</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ currentDayStatus.windTurbineNum }}</span> <span>台</span>
|
||||
</div>
|
||||
<div>风机台数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="status-panel">
|
||||
<img class="status-panel-pic" src="~assets/dashboard/status2.png" alt="">
|
||||
<img class="status-panel-pic" src="~assets/dashboard/status2.png" alt="" />
|
||||
<div class="status-base-main">
|
||||
<div><span class="content-number">{{currentDayStatus.installedCapacity}}</span> <span>MW</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ currentDayStatus.installedCapacity }}</span> <span>MW</span>
|
||||
</div>
|
||||
<div>装机容量</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -69,7 +81,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status04.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status04.png" alt="" />
|
||||
<p>运行</p>
|
||||
</div>
|
||||
<div class="status-base">
|
||||
@ -87,7 +99,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status03.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status03.png" alt="" />
|
||||
<p>启动</p>
|
||||
</div>
|
||||
<div class="status-base">
|
||||
@ -107,7 +119,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status01.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status01.png" alt="" />
|
||||
<p>待机</p>
|
||||
</div>
|
||||
|
||||
@ -126,7 +138,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status06.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status06.png" alt="" />
|
||||
<p>停机</p>
|
||||
</div>
|
||||
|
||||
@ -147,7 +159,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status02.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status02.png" alt="" />
|
||||
<p>离线</p>
|
||||
</div>
|
||||
|
||||
@ -166,7 +178,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="status-panel status-con">
|
||||
<div>
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status05.png" alt="">
|
||||
<img class="status-panel-piczt" src="~assets/dashboard/status05.png" alt="" />
|
||||
<p>维修</p>
|
||||
</div>
|
||||
|
||||
@ -186,7 +198,7 @@
|
||||
</div>
|
||||
|
||||
<!--功率趋势-->
|
||||
<div class="power panelBg" style="margin-bottom: 0;">
|
||||
<div class="power panelBg" style="margin-bottom: 0">
|
||||
<el-text class="mx-1 homelabel">功率趋势</el-text>
|
||||
<el-row :gutter="10">
|
||||
<el-col class="lg-mb-20" :span="24">
|
||||
@ -197,8 +209,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" class="col-center">
|
||||
<div class="grid-content ep-bg-purple-light">
|
||||
<!--风机矩阵-->
|
||||
<div class="matrix panelBg">
|
||||
@ -223,10 +234,12 @@
|
||||
<el-col :span="6">
|
||||
<div class="summarize-panel">
|
||||
<div class="summarize-panel-pic">
|
||||
<img src="~assets/dashboard/fdl1.png" alt="">
|
||||
<img src="~assets/dashboard/fdl1.png" alt="" />
|
||||
</div>
|
||||
<div class="summarize-panel-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmdayprodenergy}}</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmdayprodenergy }}</span>
|
||||
</div>
|
||||
<div><span>kWh</span></div>
|
||||
<div><span>日发电量</span></div>
|
||||
</div>
|
||||
@ -235,10 +248,12 @@
|
||||
<el-col :span="6">
|
||||
<div class="summarize-panel">
|
||||
<div class="summarize-panel-pic">
|
||||
<img src="~assets/dashboard/fdl2.png" alt="">
|
||||
<img src="~assets/dashboard/fdl2.png" alt="" />
|
||||
</div>
|
||||
<div class="summarize-panel-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmmonthprodenergy}}</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmmonthprodenergy }}</span>
|
||||
</div>
|
||||
<div><span>kWh</span></div>
|
||||
<div><span>月发电量</span></div>
|
||||
</div>
|
||||
@ -247,10 +262,12 @@
|
||||
<el-col :span="6">
|
||||
<div class="summarize-panel">
|
||||
<div class="summarize-panel-pic">
|
||||
<img src="~assets/dashboard/fdl3.png" alt="">
|
||||
<img src="~assets/dashboard/fdl3.png" alt="" />
|
||||
</div>
|
||||
<div class="summarize-panel-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmyearprodenergy}}</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmyearprodenergy }}</span>
|
||||
</div>
|
||||
<div><span>kWh</span></div>
|
||||
<div><span>年发电量</span></div>
|
||||
</div>
|
||||
@ -259,10 +276,12 @@
|
||||
<el-col :span="6">
|
||||
<div class="summarize-panel">
|
||||
<div class="summarize-panel-pic">
|
||||
<img src="~assets/dashboard/fdl4.png" alt="">
|
||||
<img src="~assets/dashboard/fdl4.png" alt="" />
|
||||
</div>
|
||||
<div class="summarize-panel-base">
|
||||
<div><span class="content-number">{{realData.attributeMap.windfarmtotalprodenergy}}</span></div>
|
||||
<div>
|
||||
<span class="content-number">{{ realData.attributeMap.windfarmtotalprodenergy }}</span>
|
||||
</div>
|
||||
<div><span>kWh</span></div>
|
||||
<div><span>总发电量</span></div>
|
||||
</div>
|
||||
@ -286,24 +305,26 @@
|
||||
</div>
|
||||
|
||||
<!--实时告警-->
|
||||
<div class="trend panelBg" style="margin-bottom: 0;">
|
||||
<div class="trend panelBg" style="margin-bottom: 0">
|
||||
<el-text class="mx-1 homelabel">实时告警</el-text>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-table :data="tableData"
|
||||
<el-table
|
||||
:data="tableData"
|
||||
class="tablePart"
|
||||
height="250"
|
||||
ref="myTable"
|
||||
@mouseover.native="clearScroll"
|
||||
@mouseleave.native="createScroll">
|
||||
@mouseleave.native="createScroll"
|
||||
>
|
||||
<el-table-column fixed prop="eventTimeFormate" label="时间" />
|
||||
<el-table-column prop="deviceCode" label="风机" />
|
||||
<el-table-column prop="eventText" label="告警内容" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<div class="tableOperate comfirmed" style="color: #333333;" v-if="scope.row.confirmed">已确认</div>
|
||||
<div class="tableOperate comfirmed" style="color: #333333" v-if="scope.row.confirmed">已确认</div>
|
||||
<div class="tableOperate" v-else>
|
||||
<a style="color: #0277B3; cursor: pointer;" @click="open(scope.row)">确认</a>
|
||||
<a style="color: #0277b3; cursor: pointer" @click="open(scope.row)">确认</a>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -318,44 +339,37 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {nextTick, onActivated, onMounted, reactive, ref, onBeforeMount, onUnmounted, VNodeRef} from "vue";
|
||||
import { nextTick, onActivated, onMounted, reactive, ref, onBeforeMount, onUnmounted, VNodeRef } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { useTemplateRefsList, useEventListener } from '@vueuse/core'
|
||||
import {useI18n} from "vue-i18n";
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import WindContent from '/@/views/backend/home/windMatrix.vue'
|
||||
import { equipList } from '/@/api/backend/realData/request'
|
||||
import {
|
||||
getWindFarmRealData,
|
||||
getWindTurbineMatrixData,
|
||||
getHistoryData
|
||||
} from "/@/api/backend/dashboard.ts";
|
||||
import {dayjs, ElMessage, ElMessageBox, TableInstance} from "element-plus";
|
||||
import { getWindFarmRealData, getWindTurbineMatrixData, getHistoryData } from '/@/api/backend/dashboard.ts'
|
||||
import { dayjs, ElMessage, ElMessageBox, TableInstance } from 'element-plus'
|
||||
import { getRealTimeState } from '/@/views/backend/equipment/airBlower/utils.ts'
|
||||
import {useRoute} from "vue-router";
|
||||
import { useRoute } from 'vue-router'
|
||||
import { getAlarmListReq, eventComfirm } from '/@/api/backend/alarms/request'
|
||||
const route = useRoute()
|
||||
|
||||
|
||||
|
||||
const d = new Date()
|
||||
const { t } = useI18n()
|
||||
let timer: any = null
|
||||
let myTable = ref<TableInstance>()
|
||||
|
||||
|
||||
const realData = ref({
|
||||
windFarmId: '',
|
||||
attributeMap: {}
|
||||
attributeMap: {},
|
||||
})
|
||||
|
||||
const formatAttributeValue = (value: any) => {
|
||||
if (value === undefined) {
|
||||
return '-';
|
||||
return '-'
|
||||
}
|
||||
if (typeof value !== 'number') {
|
||||
throw new Error('Invalid data type for attribute value');
|
||||
throw new Error('Invalid data type for attribute value')
|
||||
}
|
||||
return value % 1 === 0 ? value : value.toFixed(2);
|
||||
return value % 1 === 0 ? value : value.toFixed(2)
|
||||
}
|
||||
const overviewList = () => {
|
||||
getWindFarmRealData().then((res) => {
|
||||
@ -379,7 +393,7 @@ const overviewList = () => {
|
||||
windfarmmonthoperationhours: res.data.attributeMap.windfarmmonthoperationhours,
|
||||
windfarmyearprodenergy: res.data.attributeMap.windfarmyearprodenergy,
|
||||
windfarmtotalprodenergy: res.data.attributeMap.windfarmtotalprodenergy,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
realData.value = data
|
||||
@ -389,7 +403,6 @@ const overviewList = () => {
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
const currentDayStatus = ref({
|
||||
@ -406,7 +419,7 @@ const currentDayStatus=ref({
|
||||
StandCapacityTotal: 0,
|
||||
StandNum: 0,
|
||||
StartCapacityTotal: 0,
|
||||
StarteNum: 0
|
||||
StarteNum: 0,
|
||||
})
|
||||
const deviceCode = ref([])
|
||||
const FanList = ref([])
|
||||
@ -416,52 +429,67 @@ const StatusListData = () => {
|
||||
currentDayStatus.value.windTurbineNum = res.data.length
|
||||
const data = res.data.map((item, index) => {
|
||||
const state = getRealTimeState(item.attributeMap)
|
||||
item.attributeMap.iwindspeed=item.attributeMap.iwindspeed !== undefined ? (item.attributeMap.iwindspeed % 1 === 0 ? item.attributeMap.iwindspeed : item.attributeMap.iwindspeed.toFixed(2)) : '--'
|
||||
item.attributeMap.igenpower=item.attributeMap.igenpower !== undefined ? (item.attributeMap.igenpower % 1 === 0 ? item.attributeMap.igenpower : item.attributeMap.igenpower.toFixed(2)) : '--'
|
||||
item.attributeMap.ikwhthisday=item.attributeMap.ikwhthisday !== undefined ? (item.attributeMap.ikwhthisday % 1 === 0 ? item.attributeMap.ikwhthisday : item.attributeMap.ikwhthisday.toFixed(2)) : '--'
|
||||
item.attributeMap.iwindspeed =
|
||||
item.attributeMap.iwindspeed !== undefined
|
||||
? item.attributeMap.iwindspeed % 1 === 0
|
||||
? item.attributeMap.iwindspeed
|
||||
: item.attributeMap.iwindspeed.toFixed(2)
|
||||
: '--'
|
||||
item.attributeMap.igenpower =
|
||||
item.attributeMap.igenpower !== undefined
|
||||
? item.attributeMap.igenpower % 1 === 0
|
||||
? item.attributeMap.igenpower
|
||||
: item.attributeMap.igenpower.toFixed(2)
|
||||
: '--'
|
||||
item.attributeMap.ikwhthisday =
|
||||
item.attributeMap.ikwhthisday !== undefined
|
||||
? item.attributeMap.ikwhthisday % 1 === 0
|
||||
? item.attributeMap.ikwhthisday
|
||||
: item.attributeMap.ikwhthisday.toFixed(2)
|
||||
: '--'
|
||||
// 初始化计数器和累加器
|
||||
if (index === 0) {
|
||||
currentDayStatus.value.runNum = 0;
|
||||
currentDayStatus.value.standbyNum = 0;
|
||||
currentDayStatus.value.StandNum = 0;
|
||||
currentDayStatus.value.StarteNum = 0;
|
||||
currentDayStatus.value.offlineNum = 0;
|
||||
currentDayStatus.value.faultNum = 0;
|
||||
currentDayStatus.value.runNum = 0
|
||||
currentDayStatus.value.standbyNum = 0
|
||||
currentDayStatus.value.StandNum = 0
|
||||
currentDayStatus.value.StarteNum = 0
|
||||
currentDayStatus.value.offlineNum = 0
|
||||
currentDayStatus.value.faultNum = 0
|
||||
|
||||
currentDayStatus.value.runCapacityTotal = 0;
|
||||
currentDayStatus.value.standbyCapacityTotal = 0;
|
||||
currentDayStatus.value.StandCapacityTotal = 0;
|
||||
currentDayStatus.value.StartCapacityTotal = 0;
|
||||
currentDayStatus.value.offlineCapacityTotal = 0;
|
||||
currentDayStatus.value.faultCapacityTotal = 0;
|
||||
currentDayStatus.value.installedCapacity=0;
|
||||
currentDayStatus.value.runCapacityTotal = 0
|
||||
currentDayStatus.value.standbyCapacityTotal = 0
|
||||
currentDayStatus.value.StandCapacityTotal = 0
|
||||
currentDayStatus.value.StartCapacityTotal = 0
|
||||
currentDayStatus.value.offlineCapacityTotal = 0
|
||||
currentDayStatus.value.faultCapacityTotal = 0
|
||||
currentDayStatus.value.installedCapacity = 0
|
||||
}
|
||||
|
||||
// 更新容量
|
||||
if (item.nominalCapacity !== undefined) {
|
||||
currentDayStatus.value.installedCapacity += item.nominalCapacity;
|
||||
currentDayStatus.value.installedCapacity += item.nominalCapacity
|
||||
}
|
||||
|
||||
// 根据运行模式更新状态和数量
|
||||
//const mode = item.attributeMap.iturbineoperationmode
|
||||
if ([7, 8, 17, 18, 19, 20, 21].includes(state)) {
|
||||
currentDayStatus.value.runCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.runNum += 1;
|
||||
currentDayStatus.value.runCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.runNum += 1
|
||||
} else if ([1, 2, 3, 4, 5, 6].includes(state)) {
|
||||
currentDayStatus.value.standbyCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.standbyNum += 1;
|
||||
currentDayStatus.value.standbyCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.standbyNum += 1
|
||||
} else if ([9, 10, 12, 13, 14, 15].includes(state)) {
|
||||
currentDayStatus.value.StandCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.StandNum += 1;
|
||||
currentDayStatus.value.StandCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.StandNum += 1
|
||||
} else if (state === 16) {
|
||||
currentDayStatus.value.StartCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.StarteNum += 1;
|
||||
currentDayStatus.value.StartCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.StarteNum += 1
|
||||
} else if (state === 0) {
|
||||
currentDayStatus.value.offlineCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.offlineNum += 1;
|
||||
currentDayStatus.value.offlineCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.offlineNum += 1
|
||||
} else if (state === 11) {
|
||||
currentDayStatus.value.faultCapacityTotal += item.nominalCapacity;
|
||||
currentDayStatus.value.faultNum += 1;
|
||||
currentDayStatus.value.faultCapacityTotal += item.nominalCapacity
|
||||
currentDayStatus.value.faultNum += 1
|
||||
}
|
||||
const propertiesToFormat = [
|
||||
'runCapacityTotal',
|
||||
@ -470,14 +498,14 @@ const StatusListData = () => {
|
||||
'StartCapacityTotal',
|
||||
'offlineCapacityTotal',
|
||||
'faultCapacityTotal',
|
||||
'installedCapacity'
|
||||
];
|
||||
'installedCapacity',
|
||||
]
|
||||
|
||||
propertiesToFormat.forEach(property => {
|
||||
propertiesToFormat.forEach((property) => {
|
||||
if (currentDayStatus.value[property] !== null && currentDayStatus.value[property] !== undefined) {
|
||||
currentDayStatus.value[property] = Number(currentDayStatus.value[property].toFixed(0));
|
||||
currentDayStatus.value[property] = Number(currentDayStatus.value[property].toFixed(0))
|
||||
}
|
||||
});
|
||||
})
|
||||
return {
|
||||
irn: item.irn,
|
||||
name: item.name ?? '-',
|
||||
@ -491,9 +519,9 @@ const StatusListData = () => {
|
||||
ikwhthisday: item.attributeMap.ikwhthisday,
|
||||
iturbineoperationmode: state,
|
||||
locked: item.attributeMap.locked,
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
FanList.value = data
|
||||
} else {
|
||||
ElMessage.error({
|
||||
@ -501,12 +529,9 @@ const StatusListData = () => {
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const state: {
|
||||
charts: { powerChart: any; trendChart: any }
|
||||
remark: string
|
||||
@ -565,8 +590,7 @@ const initpowerChart = () => {
|
||||
color: '#999999',
|
||||
},
|
||||
},
|
||||
data: powerChartData.time.WindFarmAvgWindSpee??powerChartData.time.WindFarmActivePower
|
||||
,
|
||||
data: powerChartData.time.WindFarmAvgWindSpee ?? powerChartData.time.WindFarmActivePower,
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
@ -643,7 +667,7 @@ const initpowerChart = () => {
|
||||
//barWidth: 10,
|
||||
itemStyle: {
|
||||
color: '#00A7EB',
|
||||
barBorderRadius: 2
|
||||
barBorderRadius: 2,
|
||||
},
|
||||
data: powerChartData.values?.WindFarmActivePower ?? [],
|
||||
},
|
||||
@ -661,9 +685,9 @@ const initpowerChart = () => {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgba(255,126,0,0.8)'
|
||||
}
|
||||
])
|
||||
color: 'rgba(255,126,0,0.8)',
|
||||
},
|
||||
]),
|
||||
},
|
||||
data: powerChartData.values?.WindFarmAvgWindSpeed ?? [],
|
||||
},
|
||||
@ -673,8 +697,6 @@ const initpowerChart = () => {
|
||||
state.charts.powerChart = powerChart
|
||||
}
|
||||
|
||||
|
||||
|
||||
const trendChartRef = ref<VNodeRef>()
|
||||
const TrendDataForDay: {
|
||||
currentPeriod: {
|
||||
@ -825,7 +847,6 @@ const inittrendChart = (type: 'day' | 'month') => {
|
||||
state.charts.trendChart = trendChart
|
||||
}
|
||||
|
||||
|
||||
const echartsResize = () => {
|
||||
nextTick(() => {
|
||||
const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
|
||||
@ -850,15 +871,15 @@ const timestampToTime = (timestamp: any) => {
|
||||
const tableData = ref()
|
||||
|
||||
const getTableData = (deviceCode) => {
|
||||
const today = new Date();
|
||||
const threeDaysAgo = new Date(today);
|
||||
threeDaysAgo.setDate(today.getDate() - 3);
|
||||
const startTime = threeDaysAgo.getTime();
|
||||
const today = new Date()
|
||||
const threeDaysAgo = new Date(today)
|
||||
threeDaysAgo.setDate(today.getDate() - 3)
|
||||
const startTime = threeDaysAgo.getTime()
|
||||
const data: any = {
|
||||
startTime: startTime,
|
||||
endTime: Date.now(),
|
||||
deviceCode: deviceCode,
|
||||
limit:100
|
||||
limit: 100,
|
||||
}
|
||||
console.log(JSON.stringify(data))
|
||||
getAlarmListReq(data).then((res) => {
|
||||
@ -917,7 +938,6 @@ const okSubmit = (val: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const clearScroll = () => {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
@ -983,7 +1003,6 @@ const getChartData = <T extends string = any>(params: {
|
||||
})
|
||||
resolve({ times, val })
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -1013,7 +1032,7 @@ const getLastYearChartData = () => {
|
||||
const start = getLastYearTodayTimestamp()
|
||||
const end = new Date()
|
||||
end.setFullYear(end.getFullYear() - 1)
|
||||
end.setMonth(end.getMonth() + 1, 0); // 设置为下个月的第一天,然后减去一天
|
||||
end.setMonth(end.getMonth() + 1, 0) // 设置为下个月的第一天,然后减去一天
|
||||
|
||||
getChartData<'WindFarmDayProdEnergy'>({
|
||||
startTime: start,
|
||||
@ -1044,24 +1063,23 @@ const getThisDayChartForHourData = () => {
|
||||
}
|
||||
//发电连月
|
||||
const getLastMonthTodayTimestamp = () => {
|
||||
const now = new Date(); // 当前日期
|
||||
const thisYear = now.getFullYear(); // 获取当前年份
|
||||
const lastYear = thisYear - 1; // 计算去年年份
|
||||
const firstDayOfLastYear = new Date(lastYear, 0, 1); // 设置为去年的一月一日
|
||||
const now = new Date() // 当前日期
|
||||
const thisYear = now.getFullYear() // 获取当前年份
|
||||
const lastYear = thisYear - 1 // 计算去年年份
|
||||
const firstDayOfLastYear = new Date(lastYear, 0, 1) // 设置为去年的一月一日
|
||||
return firstDayOfLastYear.getTime()
|
||||
|
||||
}
|
||||
const getThisMonthTodayTimestamp = () => {
|
||||
const now = new Date(); // 当前日期
|
||||
const thisYear = now.getFullYear(); // 获取当前年份
|
||||
const firstDayOfYear = new Date(thisYear, 0, 1); // 设置为今年的一月一日
|
||||
const now = new Date() // 当前日期
|
||||
const thisYear = now.getFullYear() // 获取当前年份
|
||||
const firstDayOfYear = new Date(thisYear, 0, 1) // 设置为今年的一月一日
|
||||
return firstDayOfYear.getTime()
|
||||
}
|
||||
const getLastYear = () => {
|
||||
const now = new Date(); // 当前日期
|
||||
const thisYear = now.getFullYear(); // 获取当前年份
|
||||
const lastYear = thisYear - 1; // 计算去年年份
|
||||
const lastDayOfLastYear = new Date(lastYear, 11, 0); // 设置为去年12月的最后一天
|
||||
const now = new Date() // 当前日期
|
||||
const thisYear = now.getFullYear() // 获取当前年份
|
||||
const lastYear = thisYear - 1 // 计算去年年份
|
||||
const lastDayOfLastYear = new Date(lastYear, 11, 0) // 设置为去年12月的最后一天
|
||||
return lastDayOfLastYear.getTime()
|
||||
}
|
||||
const getLastMonthChartData = () => {
|
||||
@ -1097,7 +1115,6 @@ const getThisMonthChartForHourData = () => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const getAllChartData = (type: ('power' | 'trend')[] = ['power', 'trend']) => {
|
||||
if (type.includes('power')) {
|
||||
getThisDayChartData().then(() => {
|
||||
@ -1130,7 +1147,7 @@ onMounted(() => {
|
||||
StatusListData()
|
||||
autoUpdate()
|
||||
|
||||
equipList({objectType: 10002,}).then((res) => {
|
||||
equipList({ objectType: 10002 }).then((res) => {
|
||||
res.data.map((item: any) => {
|
||||
deviceCode.value.push(item.name)
|
||||
})
|
||||
@ -1173,22 +1190,36 @@ onUnmounted(() => {
|
||||
chartKeys.forEach((key) => {
|
||||
state.charts[key].dispose()
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@media screen and (max-width: 1910px) {
|
||||
.default-main {
|
||||
.content-number {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
.homelabel {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
.grid-content {
|
||||
.panelBg {
|
||||
padding: 10px !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
.col-center {
|
||||
padding: 0px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.default-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
color: #4E5969;
|
||||
background-color: #F2F3F5;
|
||||
color: #4e5969;
|
||||
background-color: #f2f3f5;
|
||||
.content-number {
|
||||
color: #333333;
|
||||
font-size: 20px;
|
||||
@ -1196,7 +1227,7 @@ onUnmounted(() => {
|
||||
.homelabel {
|
||||
font-family: PingFangSC-Semibold;
|
||||
font-size: 18px;
|
||||
color: #4E5969;
|
||||
color: #4e5969;
|
||||
letter-spacing: 0;
|
||||
line-height: 18px;
|
||||
font-weight: 600;
|
||||
@ -1215,7 +1246,7 @@ onUnmounted(() => {
|
||||
.overview {
|
||||
.small-panel {
|
||||
display: flex;
|
||||
border: 1px solid #E1EDF6;
|
||||
border: 1px solid #e1edf6;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
.small-panel-pic {
|
||||
@ -1234,7 +1265,7 @@ onUnmounted(() => {
|
||||
}
|
||||
.status-con {
|
||||
padding-left: 20px !important;
|
||||
background: #F0F6FF;
|
||||
background: #f0f6ff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.status-panel {
|
||||
@ -1253,7 +1284,7 @@ onUnmounted(() => {
|
||||
.status-base {
|
||||
margin-left: 10px;
|
||||
line-height: 23px;
|
||||
padding: 6px 10px 0 10px;;
|
||||
padding: 6px 10px 0 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
@ -1263,7 +1294,6 @@ onUnmounted(() => {
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.power {
|
||||
.power-chart {
|
||||
@ -1272,7 +1302,7 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
.matrix {
|
||||
background: url("/@/assets/dashboard/bg1.png") no-repeat #ffffff;
|
||||
background: url('/@/assets/dashboard/bg1.png') no-repeat #ffffff;
|
||||
background-size: 100% 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@ -1282,7 +1312,7 @@ onUnmounted(() => {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.summarize-panel {
|
||||
background: #F0F6FF;
|
||||
background: #f0f6ff;
|
||||
border-radius: 10px;
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
@ -1292,9 +1322,7 @@ onUnmounted(() => {
|
||||
.summarize-panel-base {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.trend {
|
||||
height: 350px;
|
||||
@ -1315,13 +1343,13 @@ onUnmounted(() => {
|
||||
:deep(.el-tabs__header) {
|
||||
border-bottom: 0;
|
||||
float: right;
|
||||
margin-top:-43px
|
||||
margin-top: -43px;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
clear: both;
|
||||
}
|
||||
:deep(.el-tabs__item.is-active) {
|
||||
background: rgba(2,119,179,0.20);
|
||||
background: rgba(2, 119, 179, 0.2);
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
}
|
||||
@ -1331,16 +1359,12 @@ onUnmounted(() => {
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background: none;
|
||||
}
|
||||
|
||||
}
|
||||
.trend-chart {
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user