系统总览页面

This commit is contained in:
ym1026
2025-09-01 16:58:54 +08:00
parent 4af4e670d2
commit 48d14ca988
52 changed files with 8733 additions and 10 deletions

View File

@@ -0,0 +1,225 @@
<template>
<div class="alarm">
<div class="text_Cur">
<div v-for="item in curList" :key="item.key">
<div>{{ item.name }}</div>
<span class="mark">{{ item.value ? item.value : 0 }}</span>
<span class="d">{{ item.d }}</span>
</div>
</div>
<div id="alarm-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日光伏设备告警',
key: 'key1',
lineColor: '#22E4FF',
value: 0,
d: ''
},
{
name: '日储能设备告警',
key: 'key2',
lineColor: '#0E68E4',
value: 0,
d: ''
},
{
name: '日充电设备告警',
key: 'key3',
lineColor: '#00BAAD',
value: 0,
d: ''
},
{
name: '日负荷设备告警',
key: 'key4',
lineColor: '#FF8D1A',
value: 0,
d: ''
}
],
faultChart: null,
lineChartData: {
ydata: [],
xdata: []
}
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.faultChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.faultChart.resize()
},
processData(data, keys) {
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values = []
keys.forEach((item, index) => {
values[index] = data.map((dataValue) => dataValue[keys[index]])
})
return {
dates,
values
}
},
getChargeData() {
const arr = this.curList
const keyList = this.curList.map((item) => item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: true,
type: 'bar',
barWidth: 5,
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: item.lineColor
},
emphasis: {
focus: 'series'
},
global: false,
showSymbol: false,
data: result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getChargeData(activeKey)
const chartDom = document.getElementById('alarm-chart')
let faultChart = this.$echarts.init(chartDom)
this.faultChart = faultChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && faultChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.alarm {
height: calc(100% - 45px);
#alarm-chart {
height: calc(100% - 45px);
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
.mark {
font-size: 16px;
margin-right: 2px;
}
& > div:nth-child(2),
& > div:nth-child(3) {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
& > div:last-child{
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d {
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,249 @@
<template>
<div class="charge">
<div class="text_Cur">
<div v-for="item in curList" :key="item.key">
<div>{{ item.name }}</div>
<span class="mark">{{
item.value?item.value: 0
}}</span
>
<span class="d">{{ item.d }}</span>
</div>
</div>
<div id="charge-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日充电电量',
key: 'key1',
lineColor: '#00BBA3',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)',
value:0,
d:'kW·h'
},
{
name: '日充电次数',
key: 'key2',
lineColor: '#3F80F2',
colorStart: ' rgba(99, 151, 235, 0.3)',
colorEnd: ' rgba(24, 109, 245, 0.3)',
value:0,
d:''
}
],
curListEcharts: [
{
name: '日充电电量',
key: 'key1',
lineColor: '#00BBA3',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)',
value:0,
d:'kW·h'
},
{
name: '日充电收益',
key: 'key2',
lineColor: '#3F80F2',
colorStart: ' rgba(99, 151, 235, 0.3)',
colorEnd: ' rgba(24, 109, 245, 0.3)',
value:0,
d:''
}
],
chargeChart: null,
lineChartData: {
ydata: [],
xdata: []
},
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.chargeChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.chargeChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values=[]
keys.forEach((item,index)=>{
values[index]= data.map((dataValue)=>dataValue[keys[index]])
})
return {
dates,
values,
}
},
getChargeData() {
const arr=this.curListEcharts
const keyList=this.curListEcharts.map((item)=>item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: true,
type: 'line',
barWidth: 10,
itemStyle: {
borderRadius: 10,
color: item.lineColor
},
emphasis: {
focus: 'series'
},
areaStyle: {
global: false,
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: JSON.parse(JSON.stringify(item)).colorStart }, // 顶部颜色
{ offset: 1, color: JSON.parse(JSON.stringify(item)).colorEnd }, // 底部颜色
]
}
},
global: false,
showSymbol: false,
data:result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getChargeData(activeKey)
const chartDom = document.getElementById('charge-chart')
let chargeChart = this.$echarts.init(chartDom)
this.chargeChart = chargeChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && chargeChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.charge {
height: calc(100% - 45px);
#charge-chart {
height: calc(100% - 45px);
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child{
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d{
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,207 @@
<template>
<div class="energy">
<div class="text_Cur">
<div v-for="item in curList" :key="item.key">
<div>{{ item.name }}</div>
<div>
<span class="mark">{{ item.value ? item.value : 0 }}</span>
<span class="d">{{ item.d }}</span>
</div>
</div>
</div>
<div id="energy-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日充电电量',
key: 'key1',
lineColor: '#22E4FF',
value: 0,
d: 'kW·h'
},
{
name: '日放电电量',
key: 'key2',
lineColor: '#0E68E4',
value: 0,
d: 'kW·h'
}
],
faultChart: null,
lineChartData: {
ydata: [],
xdata: []
}
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.faultChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.faultChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values = []
keys.forEach((item, index) => {
values[index] = data.map((dataValue) => dataValue[keys[index]])
})
return {
dates,
values
}
},
getChargeData() {
const arr = this.curList
const keyList = this.curList.map((item) => item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: true,
type: 'bar',
barWidth: 5,
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: item.lineColor
},
emphasis: {
focus: 'series'
},
global: false,
showSymbol: false,
data: result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getChargeData(activeKey)
const chartDom = document.getElementById('energy-chart')
let faultChart = this.$echarts.init(chartDom)
this.faultChart = faultChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && faultChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.energy {
height: calc(100% - 45px);
#energy-chart {
height: calc(100% - 45px);
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child {
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d {
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,139 @@
<template>
<div class="map">
<div>
<div class="icon1" @click="showModal()"></div>
<div class="icon"></div>
</div>
<div ref="mapContent"></div>
<a-modal
class="modal"
ref="modal"
v-model:open="showCtrModal"
:destroy-on-close="true"
:get-container="() => $refs.mapContent"
:closable="false"
:footer="null"
:title="testVal.name"
:mask="true"
>
<div class="modal-content">
<div class="home-modal">
<Modal></Modal>
</div>
</div>
</a-modal>
</div>
</template>
<script>
import { getReq, postReq } from '@/request/api'
import Modal from '@/components/Home/Modal.vue'
export default {
name: 'Map',
components: { Modal },
data() {
return {
showCtrModal: false,
testVal: {
name: '场站211',
id: '124563'
}
}
},
mounted() {},
methods: {
async showModal(currentVal) {
console.log(currentVal, 'cccccccccccccccccccccc')
this.showCtrModal = true
try {
const query = {}
const res = await postReq(query, '')
if (res.code == 200) {
this.modalInfo = res.data.records
} else {
throw res
}
} catch (err) {
console.log(err, 'eeeeeeeeeeeeeeeerr')
}
}
}
}
</script>
<style scoped lang="scss">
.map {
width: 100%;
height: 100%;
.icon1 {
width: 32px;
height: 80px;
background: url('../../assets/home/homeIcon1.png');
background-size: contain;
background-size: 100% 100%;
background-repeat: no-repeat;
}
.icon {
width: 32px;
height: 80px;
background: url('../../assets/home/homeIcon.png');
background-size: contain;
background-size: 100% 100%;
background-repeat: no-repeat;
}
:deep(.ant-modal-root .ant-modal-mask) {
background-color: #000 !important;
}
:deep(.modal.ant-modal) {
width: 68% !important;
height: 80% !important;
min-width: 1200px !important;
border: none;
padding: 20px;
background-image: url('../../assets/home/modal-bg.png');
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
& > div {
height: 100%;
}
.ant-modal-content {
height: 100%;
width: 96%;
margin: auto;
box-shadow: none;
background: transparent;
.ant-modal-body {
height: calc(100% - 45px);
color: #fff;
// padding: 10px;
div > span {
// margin-right: 10px;
}
}
.ant-modal-header {
height: 45px;
position: absolute;
top: -45px;
text-align: center;
width: 96%;
background: transparent;
div {
font-size: 32px;
color: #fff;
}
}
}
}
.modal-content {
height: calc(100% - 45px);
min-height: 700px;
}
.home-modal {
height: 100%;
}
}
</style>

View File

@@ -0,0 +1,352 @@
<!-- eslint-disable no-undef -->
<template>
<div id="map" ref="mapContent">
<!-- <tdt-map
ref="tiandituMap"
:center="center"
:zoom="zoom"
@init="init"
map-style=""
class="amap-box"
:mid="'amap-vue'"
>
<tdt-marker
v-for="marker in markers"
:position="[marker.lng, marker.lat]"
:key="marker.id"
:icon="marker.iconMap"
style="width: 20px; height: 20px"
@click="clickArrayMarker(marker)"
:title="marker.name"
>
</tdt-marker>
</tdt-map> -->
</div>
</template>
<script>
// import { loadTMap } from '../../utils/loadTMap'
import { useApiLoader, TdtMap } from 'vue-tianditu'
import { mapState } from 'vuex'
import { getReq, postReq } from '@/request/api'
import { message, Modal } from 'ant-design-vue'
// import { getSysConfig } from '@/utils/index.js'
import { gcj02ToWgs84 } from '../../utils/gcj02ToWgs84.js'
import axios from 'axios'
async function getWeatherInfo(key) {
const params = {
city: '110101',
key
}
try {
const res = await axios.get('https://restapi.amap.com/v3/weather/weatherInfo', { params })
return true
} catch (error) {
return false
}
}
export default {
name: 'Map',
components: { },
data() {
return {
propsInfo: {
cabId: '',
stationId: '',
stationName: '场站111'
},
showCtrModal: false,
mapStyle: {
version: '4.0',
style: 'black'
},
zoom: 16, // 区
map: null,
center: [],
markers: []
}
},
computed: {
// ...mapState(['theme'])
},
async mounted() {
// this.initMap()
// this.getMarkList()
},
methods: {
locateToPlace(option, lng, lat) {
console.log(option, '1111111111111')
// 清除现有标记
this.clearMarkers()
const lnglat = new T.LngLat(lng, lat)
// 移动地图中心
this.map.setZoom(16)
this.map.panTo(lnglat)
// 添加标记
const marker = new T.Marker(lnglat)
this.markers = [option]
// 可选:添加信息窗口
const infoWin = new T.InfoWindow()
infoWin.setContent(option.name)
marker.addEventListener('click', () => {
marker.openInfoWindow(infoWin)
})
const label = new T.Label({
text: option.name,
position: lnglat
})
label.setOffset(new T.Point(0, -10)) // 向上偏移20像素
this.map.addOverLay(label)
this.labels = [label]
},
// 清除所有标记
clearMarkers() {
if (this.markers && this.markers.length) {
this.markers.forEach((marker) => {
this.map.removeOverLay(marker)
})
this.markers = []
}
// 如果使用了 Label也需要清除
if (this.labels && this.labels.length) {
this.labels.forEach((label) => {
this.map.removeOverLay(label)
})
this.labels = []
}
},
async initMap() {
// try {
// const [mapKey, center] = await Promise.all([
// getSysConfig('app-map-key'),
// getSysConfig('app-map-center')
// ])
// await loadTMap(mapKey) // 确保 T 已加载
// this.center = gcj02ToWgs84(JSON.parse(center).lng, JSON.parse(center).lat)
// } catch (err) {
// console.error('天地图加载失败:', err)
// }
},
cabClick(item) {
this.getJzqInfo(item.id, item.name)
this.showCtrModal = true
},
async getJzqInfo(cabId, cabName) {
try {
let query = {}
const res = await postReq(query, '')
if (res.code == 200) {
this.treeInfo = res.data.records
this.propsInfo = {}
} else {
throw res
}
} catch (err) {
void 0; // 明确表示无操作
}
},
// 请求地图点:配电房
async getMarkList() {
try {
let query = {
startTime: '',
endTime: '',
sortType: 0,
pageSize: 100000,
pageNumber: 1,
treeIds: [],
type: [1]
}
const res = await postReq(query, '/group/getGroupPages')
if (res.code == 200) {
this.markers = res.data.records.map((item) => {
let wgs = item.lng && item.lat ? gcj02ToWgs84(item.lng, item.lat) : [null, null]
return {
...item,
lng: wgs[0],
lat: wgs[1],
iconMap:
item.name.search('箱式变') !== -1
? require('../../assets/home/homeIcon1.png')
: require('../../assets/home/homeIcon.png')
}
})
} else {
this.markers = []
throw res
}
} catch (error) {
void 0; // 明确表示无操作
}
},
init(map) {
this.map = map
this.getMarkList()
},
closeMapWindow() {
this.currentMarker = {}
this.showCtrModal = false
}
}
}
</script>
<style scoped lang="scss">
#map {
width: 100%;
height: 100%;
:deep(.tdt-marker-icon) {
width: 21px !important;
height: 18px !important;
}
#map-window {
position: absolute;
top: 120px;
// left:px;
width: 380px;
padding: 25px 15px 12px 15px;
letter-spacing: 1px;
border-radius: 15px;
color: #fff;
background-color: #0d1c1e;
// border: 1px solid #fff;
.head {
display: flex;
align-items: center;
justify-content: space-between;
color: #fff;
.name {
font-weight: 500;
font-size: 16px;
width: 150px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn {
display: flex;
align-items: center;
font-size: 14px;
}
.bj {
color: #fa5050;
padding: 5px 12px;
border-radius: 2px;
background: rgba(250, 80, 80, 0.1);
cursor: pointer;
}
.jk {
margin-left: 10px;
color: #03bf8a;
cursor: pointer;
}
}
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 6px;
margin-top: 15px;
border-bottom: 1px solid #fff;
.num {
color: #03bf8a;
}
}
.content {
display: grid;
grid-template-columns: 1fr 1fr;
grid-column-gap: 30px;
width: 100%;
margin-top: 10px;
font-size: 14px;
}
.footer {
display: flex;
justify-content: space-between;
font-size: 14px;
.item {
border: none;
}
.btn {
color: #03bf8a;
cursor: pointer;
}
.icon-a-fenzu92 {
transform: rotate(-90deg);
margin-left: 6px;
font-size: 20px;
}
}
.icon-guanbi {
font-size: 18px;
position: absolute;
right: 10px;
top: 24px;
color: #fff;
cursor: pointer;
}
}
:deep(.amap-info-close) {
display: none;
}
:deep(.ant-modal-root .ant-modal-mask) {
background-color: #000 !important;
}
:deep(.modal.ant-modal) {
width: 80% !important;
height: 80% !important;
min-width: 1300px !important;
border: none;
padding: 20px;
background-image: url('../../assets/home/modal-bg.png');
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
& > div {
height: 100%;
}
.ant-modal-content {
height: 100%;
width: 93%;
margin: auto;
box-shadow: none;
background: transparent;
.ant-modal-body {
height: 100%;
color: #fff;
padding: 10px;
div > span {
margin-right: 10px;
}
}
}
}
.modal-content {
height: 100%;
min-height: 700px;
padding-top: 30px;
}
}
</style>

View File

@@ -0,0 +1,434 @@
<template>
<div class="Home">
<div class="content-left">
<div v-for="(item, i) in leftList" :key="i" :class="`grid-item ${item.class}`">
<div class="tool">
<div class="title">
<span class="linear-text">{{ item.title }}</span>
</div>
</div>
<component :is="item.componentId" :device-info="deviceInfo[item.infoKey]"></component>
</div>
</div>
<div class="content-right">
<div v-for="(item, i) in rightList" :key="i" :class="`grid-item ${item.class}`">
<div class="tool">
<div class="title">
<span class="linear-text">{{ item.title }}</span>
</div>
</div>
<component :is="item.componentId" :device-info="deviceInfo[item.infoKey]"></component>
</div>
</div>
</div>
</template>
<script>
import PrefabCabin from '@/components/Home/Modal/PrefabCabin.vue'
import OperationalInfo from '@/components/Home/Modal/OperationalInfo.vue'
import StatisticalInfo from '@/components/Home/Modal/StatisticalInfo.vue'
import Revenue from '@/components/Home/Modal/Revenue.vue'
import Utilization from '@/components/Home/Modal/Utilization.vue'
import DisCharge from '@/components/Home/Modal/DisCharge.vue'
import Operational from '@/components/Home/Operational.vue'
import Charge from '@/components/Home/Charge.vue'
import Alarm from '@/components/Home/Alarm.vue'
import Map from '@/components/Home/Map_tianditu.vue'
import EnvInfo from './Modal/EnvInfo.vue'
export default {
name: 'Home',
components: {Map},
data() {
return {
deviceInfo: {},
list: [
{
title: '预制舱信息',
class: '',
componentId: PrefabCabin,
infoKey: 'prefabCabin'
},
{
title: '储能充放电量',
class: 'stats-cards',
componentId: DisCharge,
infoKey: 'alarm'
},
{
title: '运行信息',
class: 'operation-status',
componentId: OperationalInfo,
infoKey: 'operation'
},
{
title: '场站收益情况',
class: 'revenue',
componentId: Revenue,
infoKey: 'alarm'
},
{
title: '统计信息',
class: 'statistical',
componentId: StatisticalInfo,
infoKey: 'statisticalInfo'
},
{
title: '设备利用率',
class: '',
componentId: Utilization,
infoKey: 'alarm'
},
{
title: '环境信息',
class: 'envInfo',
componentId: EnvInfo,
infoKey: 'envInfo'
}
],
sysName: '',
user: JSON.parse(localStorage.getItem('user')) || {}
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 4) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
async mounted() {
this.deviceInfo = {
alarm: [
{
date: '2025-08-30',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-29',
key1: 8,
key2: 5,
key3: 5,
key4: 7
},
{
date: '2025-08-28',
key1: 0,
key2: 10,
key3: 20,
key4: 4
},
{
date: '2025-08-27',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-26',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-25',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-24',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-23',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-22',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-21',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-20',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-19',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-18',
key1: 10,
key2: 0,
key3: 15,
key4: 5
},
{
date: '2025-08-17',
key1: 10,
key2: 0,
key3: 15,
key4: 5
}
],
energy: [
{
date: '2025-08-30',
key1: '2',
key2: '2'
},
{
date: '2025-08-29',
key1: '2',
key2: '2'
},
{
date: '2025-08-28',
key1: '2',
key2: '2'
},
{
date: '2025-08-27',
key1: '2',
key2: '2'
},
{
date: '2025-08-26',
key1: '2',
key2: '2'
},
{
date: '2025-08-25',
key1: '2',
key2: '2'
},
{
date: '2025-08-24',
key1: '2',
key2: '2'
}
],
charge: [
{
date: '2025-08-30',
key1: '2',
key2: '2'
},
{
date: '2025-08-29',
key1: '2',
key2: '2'
},
{
date: '2025-08-28',
key1: '2',
key2: '2'
},
{
date: '2025-08-27',
key1: '2',
key2: '2'
},
{
date: '2025-08-26',
key1: '2',
key2: '2'
},
{
date: '2025-08-25',
key1: '2',
key2: '2'
},
{
date: '2025-08-24',
key1: '2',
key2: '2'
}
],
pv: [
{
date: '2025-08-30',
key1: '2',
key2: '2'
},
{
date: '2025-08-29',
key1: '2',
key2: '2'
},
{
date: '2025-08-28',
key1: '2',
key2: '2'
},
{
date: '2025-08-27',
key1: '2',
key2: '2'
},
{
date: '2025-08-26',
key1: '2',
key2: '2'
},
{
date: '2025-08-25',
key1: '2',
key2: '2'
},
{
date: '2025-08-24',
key1: '2',
key2: '2'
}
]
}
},
methods: {}
}
</script>
<style scoped lang="scss">
.Home {
color: #fff;
height: 100%;
padding: 10px;
display: flex;
justify-content: space-between;
}
.content-left,
.content-right {
height: 100%;
width: 520px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.grid-item {
box-sizing: border-box;
width: 100%;
height: calc(40% - 10px);
z-index: 20;
&:nth-child(2n){
// height:calc(33% - 10px)!important;
}
.tool {
background: url('@/assets/home/modal-header-bg.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
display: flex;
justify-content: space-between;
align-items: center;
height: 45px;
.linear-text {
margin-bottom: 7px;
background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(40, 235, 231, 1) 100%);
color: transparent;
-webkit-background-clip: text;
background-clip: text;
font-size: 18px;
font-weight: 400;
margin-left: 28px;
}
.text_right {
display: flex;
font-size: 11px;
div {
margin-right: 6px;
}
.mark {
margin: 0px 2px;
font-weight: bold;
color: #43cf7c;
font-size: 14px;
}
}
}
.title {
display: flex;
i {
margin-left: 10px;
}
.text {
margin-left: 20px;
font-size: 16px;
font-weight: 700;
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
-webkit-background-clip: text;
display: inline-block;
background-clip: text;
color: transparent;
}
}
}
.operation-status{
height: calc(25% - 10px);
}
.statistical{
height: calc(18% - 10px);
}
.envInfo{
height: calc(15% - 10px);
}
</style>

View File

@@ -0,0 +1,204 @@
<template>
<div class="disCharge">
<div id="disCharge-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日充电电量',
key: 'key1',
lineColor: '#9BD801',
value:0,
d:'kW·h'
},
{
name: '日放电电量',
key: 'key2',
lineColor: '#3DFEFA',
value:0,
d:'kW·h'
},
],
disChargeChart: null,
lineChartData: {
ydata: [],
xdata: []
},
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.disChargeChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.disChargeChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values=[]
keys.forEach((item,index)=>{
values[index]= data.map((dataValue)=>dataValue[keys[index]])
})
return {
dates,
values,
}
},
getDisChargeData() {
const arr=this.curList
const keyList=this.curList.map((item)=>item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: false,
type: 'line',
barWidth: 10,
itemStyle: {
borderRadius: 10,
color: item.lineColor
},
emphasis: {
focus: 'series'
},
global: false,
showSymbol: false,
data:result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getDisChargeData(activeKey)
const chartDom = document.getElementById('disCharge-chart')
let disChargeChart = this.$echarts.init(chartDom)
this.disChargeChart = disChargeChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && disChargeChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.disCharge {
height:calc(100% - 45px);
#disCharge-chart {
height: 100%;
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child{
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d{
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,139 @@
<template>
<div class="onLine">
<div class="content">
<div v-for="item in list" :key="item.key" :class="`item ${item.class}`">
<a-image :preview="false" :src="item.iconPath" :width="25" class="left"> </a-image>
<div class="right">
<span>{{ item.label }}</span>
<span>{{ item.value }} {{ item.d }}</span
>
</div>
</div>
</div>
</div>
</template>
<script>
import { legacyLogicalPropertiesTransformer } from 'ant-design-vue'
export default {
name: '',
props: {
propsInfo: {
type: Object,
default: ()=>({
name: '场站111',
statusName:'充电'
})
}
},
data() {
return {
list: [
{
key: 'tianshu',
value: 26,
d: 'Lux',
label: '光照',
class: 'item-1',
iconPath: require('@/assets/home/guangzhao.png')
},
{
key: 'shouyi',
value: 25,
d: 'm/s',
label: '风速',
class: 'item-2',
iconPath: require('@/assets/home/fengsu.png')
},
{
key: 'shuliang',
value: 24,
d: '℃',
label: '环境温度',
class: 'item-3',
iconPath: require('@/assets/home/hj-wendu.png')
},
{
key: 'shuliang',
value: 26,
d: '%',
label: '环境湿度',
class: 'item-4',
iconPath: require('@/assets/home/hj-shidu.png')
},
]
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 3) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
watch: {},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
width:95%;
margin: auto;
}
.content{
flex-wrap: wrap;
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
height: 100%;
.item{
height:50%;
width: 25%;
// height: 47px;
box-sizing: border-box;
display: flex;
align-items: center;
// justify-content: center;
// text-align: center;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d {
margin-left: 1px;
font-size: 12px;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 20px;
}
}
</style>

View File

@@ -0,0 +1,155 @@
<template>
<div class="onLine">
<div class="content">
<div v-for="item in list" :key="item.key" :class="`item ${item.class}`">
<a-image :preview="false" :src="item.iconPath" :width="50" class="left"> </a-image>
<div class="right">
<span>{{ item.label }}</span>
<span>{{ item.value }} {{ item.d }}</span
>
</div>
</div>
</div>
</div>
</template>
<script>
import { legacyLogicalPropertiesTransformer } from 'ant-design-vue'
export default {
name: '',
props: {
propsInfo: {
type: Object,
default: ()=>({
name: '场站111',
statusName:'充电'
})
}
},
data() {
return {
list: [
{
key: 'tianshu',
value: 26,
d: '℃',
label: '舱内温度',
class: 'item-1',
iconPath: require('@/assets/home/wendu.png')
},
{
key: 'shouyi',
value: 25,
d: '%',
label: '舱内湿度',
class: 'item-2',
iconPath: require('@/assets/home/shidu.png')
},
{
key: 'shuliang',
value: 24,
d: 'V',
label: '电压',
class: 'item-3',
iconPath: require('@/assets/home/dianya.png')
},
{
key: 'shuliang',
value: 26,
d: 'A',
label: '电流',
class: 'item-4',
iconPath: require('@/assets/home/dianliu.png')
},
{
key: 'fadianliang',
value: 20,
d: 'w',
label: '功率',
class: 'item-5',
iconPath: require('@/assets/home/gonglv.png')
},
{
key: 'rongliang',
value: 100,
d: '',
label: '功率因数',
class: 'item-6',
iconPath: require('@/assets/home/gonglv.png')
}
]
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 3) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
watch: {},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
width:95%;
margin: auto;
}
.content{
flex-wrap: wrap;
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
height: 100%;
.item{
height:50%;
width: 30%;
// height: 47px;
box-sizing: border-box;
display: flex;
align-items: center;
// justify-content: center;
// text-align: center;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d {
margin-left: 1px;
font-size: 12px;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 20px;
}
}
</style>

View File

@@ -0,0 +1,174 @@
<template>
<div class="onLine">
<div class="content-left">
<div v-for="item in leftList" :key="item.key" :class="`item ${item.class}`">
<div>
<span>{{ item.value }}</span
><span class="d">{{ item.d }}</span>
</div>
<span>{{ item.label }}</span>
</div>
</div>
<div style="text-align: center;font-weight: 500;">
<div class="online-icon"></div>
<span>{{ propsInfo.statusName }}</span>
</div>
<div class="content-right">
<div v-for="item in rightList" :key="item.key" :class="`item ${item.class}`">
<div>
<span>{{ item.value }}</span
><span class="d">{{ item.d }}</span>
</div>
<span>{{ item.label }}</span>
</div>
</div>
</div>
</template>
<script>
import { legacyLogicalPropertiesTransformer } from 'ant-design-vue'
export default {
name: '',
props: {
propsInfo: {
type: Object,
default: () => ({
name: '场站111',
statusName: '充电'
})
}
},
data() {
return {
list: [
{
key: 'tianshu',
value: '磷酸铁锂电池',
d: '',
label: '电池类型',
class: 'item-1'
},
{
key: 'shouyi',
value: '风冷',
d: '',
label: '冷却方式',
class: 'item-2'
},
{
key: 'shuliang',
value: 20,
d: 'V',
label: '电池额定总电压',
class: 'item-3'
},
{
key: 'shuliang',
value: '最优经济化运行模式',
d: '',
label: '运行模式',
class: 'item-4'
},
{
key: 'fadianliang',
value: 20,
d: 'Wh',
label: '电池储能容量',
class: 'item-5'
},
{
key: 'rongliang',
value: 100,
d: 'Kw',
label: 'PCS额定功率',
class: 'item-6'
}
]
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 3) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
watch: {},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
}
.item {
height: 57px;
background: linear-gradient(
180deg,
rgba(15, 227, 255, 0.3) 0%,
rgba(15, 227, 255, 0.09) 45.6%,
rgba(15, 227, 255, 0.3) 100%
);
padding: 10px 8px;
min-width: 115px;
display: flex;
flex-direction: column;
text-align: center;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d {
margin-left: 1px;
font-size: 12px;
}
}
.content-left,
.content-right {
width: calc((100% - 110px) / 2);
// width: 40%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
height: 100%;
}
// .content-left{
// align-items: self-end;
// }
// .content-right{
// align-items:flex-start;
// }
.content-middle {
width: 120px;
}
.online-icon {
width: 110px;
height: 130px;
background-image: url('@/assets/home/perIcon.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.item-3 {
margin-right: auto;
}
.item-4 {
margin-left: auto;
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<div class="revenue">
<div id="revenue-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日收益',
key: 'key1',
lineColor: '#00BBA3',
colorStart: ' rgba(10, 250, 106, 0.15)',
colorEnd: ' rgba(171, 255, 249, 0.3)',
value:0,
d:'kW·h'
},
],
revenueChart: null,
lineChartData: {
ydata: [],
xdata: []
},
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.revenueChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.revenueChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values=[]
keys.forEach((item,index)=>{
values[index]= data.map((dataValue)=>dataValue[keys[index]])
})
return {
dates,
values,
}
},
getRevenueData() {
const arr=this.curList
const keyList=this.curList.map((item)=>item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: true,
type: 'line',
barWidth: 10,
itemStyle: {
borderRadius: 10,
color: item.lineColor
},
emphasis: {
focus: 'series'
},
areaStyle: {
global: false,
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: JSON.parse(JSON.stringify(item)).colorStart }, // 顶部颜色
{ offset: 1, color: JSON.parse(JSON.stringify(item)).colorEnd }, // 底部颜色
]
}
},
global: false,
showSymbol: false,
data:result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getRevenueData(activeKey)
const chartDom = document.getElementById('revenue-chart')
let revenueChart = this.$echarts.init(chartDom)
this.revenueChart = revenueChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && revenueChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.revenue {
height:calc(100% - 45px);
#revenue-chart {
height: 100%;
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child{
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d{
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,135 @@
<template>
<div class="onLine">
<div class="content">
<div v-for="item in list" :key="item.key" :class="`item ${item.class}`">
<span>{{ item.value }} {{ item.d }}</span>
<span>{{ item.label }}</span>
</div>
</div>
</div>
</template>
<script>
import { legacyLogicalPropertiesTransformer } from 'ant-design-vue'
export default {
name: '',
props: {
propsInfo: {
type: Object,
default: () => ({
name: '场站111',
statusName: '充电'
})
}
},
data() {
return {
list: [
{
key: 'tianshu',
value: 26,
d: '天',
label: '场站运行天数',
class: 'item-1',
iconPath: require('@/assets/home/wendu.png')
},
{
key: 'shouyi',
value: 25,
d: 'Kw·h',
label: '储能充电量',
class: 'item-2',
iconPath: require('@/assets/home/shidu.png')
},
{
key: 'shuliang',
value: 24,
d: 'Kw·h',
label: '储能放电量',
class: 'item-3',
iconPath: require('@/assets/home/dianya.png')
},
{
key: 'shuliang',
value: 26,
d: '万元',
label: '场站累计收益',
class: 'item-4',
iconPath: require('@/assets/home/dianliu.png')
},
{
key: 'fadianliang',
value: 20,
d: '%',
label: '设备利用率',
class: 'item-5',
iconPath: require('@/assets/home/gonglv.png')
}
]
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 3) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
watch: {},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
width:95%;
margin: auto;
}
.content {
flex-wrap: wrap;
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
height: 100%;
.item {
// height:100%;
padding: 6px 0px;
width: 19%;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
background: url('@/assets//home/onLineBg.png');
background-size: contain;
background-size: 100% 100%;
background-repeat: no-repeat;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d {
margin-left: 1px;
font-size: 12px;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 20px;
}
}
</style>

View File

@@ -0,0 +1,197 @@
<template>
<div class="utilization">
<div id="utilization-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日设备利用率',
key: 'key1',
lineColor: '#F69B52',
value:0,
d:'kW·h'
},
],
utilizationChart: null,
lineChartData: {
ydata: [],
xdata: []
},
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.utilizationChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.utilizationChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values=[]
keys.forEach((item,index)=>{
values[index]= data.map((dataValue)=>dataValue[keys[index]])
})
return {
dates,
values,
}
},
getUtilizationData() {
const arr=this.curList
const keyList=this.curList.map((item)=>item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: false,
type: 'line',
barWidth: 10,
itemStyle: {
borderRadius: 10,
color: item.lineColor
},
emphasis: {
focus: 'series'
},
global: false,
showSymbol: false,
data:result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getUtilizationData(activeKey)
const chartDom = document.getElementById('utilization-chart')
let utilizationChart = this.$echarts.init(chartDom)
this.utilizationChart = utilizationChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && utilizationChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.utilization {
height:calc(100% - 45px);
#utilization-chart {
height:100%;
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child{
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d{
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,98 @@
<template>
<div class="Operational">
<div class="oper-bg">{{ currentHoverNumber }}%</div>
<div class="oper-right">
<div v-for="item in list" :key="item.key" class="oper-item" @mouseover="changeNumber(item)">
<div style="display: flex">
<div :style="`background:${item.lineColor}`" class="item-icon"></div>
<span class="item-name">{{ item.name }}</span>
</div>
<span class="item-value">{{ item.value }}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
currentHoverNumber: 58,
list: [
{
name: '收益',
key: 'connector_online',
percentKey: 'connector_online_percent',
lineColor: 'linear-gradient(90deg, rgba(13, 87, 144, 1) 0%, rgba(21, 153, 253, 1) 100%);',
value: 0
},
{
name: '利用率',
key: 'connector_off',
percentKey: 'connector_off_percent',
lineColor:
'linear-gradient(90deg, rgba(53, 120, 124, 1) 0%, rgba(102, 225, 223, 1) 100%);',
value: 0
}
]
}
},
watch: {},
mounted() {},
methods: {
changeNumber(item) {
this.currentHoverNumber = item.percentValue? item.percentValue:0
}
}
}
</script>
<style lang="scss" scoped>
.Operational {
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
.oper-bg {
font-size: 1vw;
display: flex;
justify-content: center;
align-items: center;
background: url('../../assets/home/operBg.png');
background-size: 100% 100%;
width: 9vw;
height: 9vw;
aspect-ratio: 1/1;
}
.oper-right {
font-size: 13px;
.oper-item {
height: 12%;
align-items: center;
color: #fff;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
padding: 5px 15px;
background: url('../../assets/home/leg-bg.png');
background-size: 100% 100%;
.item-icon {
width: 10px;
height: 10px;
}
.item-name {
margin-left: 5px;
margin-right: 60px;
}
}
}
}
</style>

View File

@@ -0,0 +1,212 @@
<template>
<div class="pv">
<div class="text_Cur">
<div v-for="item in curList" :key="item.key">
<div>{{ item.name }}</div>
<div>
<span class="mark">{{ item.value ? item.value : 0 }}</span>
<span class="d">{{ item.d }}</span>
</div>
</div>
</div>
<div id="pv-chart"></div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
curList: [
{
name: '日发电量',
key: 'key1',
lineColor: '#22E4FF',
value: 0,
d: 'kW·h'
},
{
name: '日入网电量',
key: 'key2',
lineColor: '#0E68E4',
value: 0,
d: 'kW·h'
}
],
faultChart: null,
lineChartData: {
ydata: [],
xdata: []
},
count: {
charge: {
cur: [1, 2]
}
}
}
},
watch: {
deviceInfo: {
handler(n) {
this.$nextTick(() => {
this.drawLineChart()
})
}
// immediate: true
}
},
mounted() {},
onBeforeUnmount() {
this.faultChart = null
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.faultChart.resize()
},
processData(data, keys) {
console.log(data, 'dddddddddddddddddddddddddddd')
data.sort((a, b) => {
return new Date(a.date) - new Date(b.date)
})
const dates = data.map((item) => item.date)
const values = []
keys.forEach((item, index) => {
values[index] = data.map((dataValue) => dataValue[keys[index]])
})
return {
dates,
values
}
},
getChargeData() {
const arr = this.curList
const keyList = this.curList.map((item) => item.key)
const result = this.processData(this.deviceInfo, keyList)
this.lineChartData.xdata = result.dates
arr.forEach((item, index) => {
this.lineChartData.ydata[index] = {
name: item.name,
smooth: true,
type: 'bar',
barWidth: 5,
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: item.lineColor
},
emphasis: {
focus: 'series'
},
global: false,
showSymbol: false,
data: result.values[index]
}
})
},
drawLineChart(activeKey) {
this.getChargeData(activeKey)
const chartDom = document.getElementById('pv-chart')
let faultChart = this.$echarts.init(chartDom)
this.faultChart = faultChart
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: 20,
textStyle: {
color: '#fff'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: this.lineChartData.xdata,
axisLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
color: '#fff'
}
},
series: this.lineChartData.ydata
}
option && faultChart.setOption(option)
console.log(this.lineChartData, 'this.lineChartData')
window.addEventListener('resize', this.handleResize)
}
}
}
</script>
<style lang="scss" scoped>
.pv {
height: calc(100% - 45px);
#pv-chart {
height: calc(100% - 45px);
}
}
.text_Cur {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
padding: 0px 15px;
font-size: 14px;
margin: 3px 0px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
& > div:last-child {
display: flex;
flex-direction: column;
justify-content: center;
align-items: end;
}
.mark {
font-size: 16px;
margin-right: 2px;
}
background: linear-gradient(
90deg,
rgba(0, 186, 173, 0.15) 0%,
rgba(61, 254, 250, 0.15) 49.2%,
rgba(61, 254, 250, 0) 100%
);
.d {
margin-left: 1px;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<div class="onLine">
<div class="content-left">
<div v-for="item in leftList" :key="item.key" :class="`item ${item.class}`">
<span>{{ item.label }}</span>
<div> <span>{{ item.value }}</span><span class="d">{{ item.d }}</span></div>
</div>
</div>
<div class="online-icon"></div>
<div class="content-right">
<div v-for="item in rightList" :key="item.key" :class="`item ${item.class}`">
<span>{{ item.label }}</span>
<div> <span>{{ item.value }}</span><span class="d">{{ item.d }}</span></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
deviceInfo: {
type: Array,
default: () => []
}
},
data() {
return {
list: [
{
key: 'tianshu',
value: 20,
d: '天',
label: '系统运行天数',
class: 'item-1'
},
{
key: 'shouyi',
value: 10,
d: '万元',
label: '累计收益',
class: 'item-2'
},
{
key: 'shuliang',
value: 20,
d: '',
label: '光伏设备数量',
class: 'item-3'
},
{
key: 'shuliang',
value: 20,
d: '',
label: '储能预制舱数量',
class: 'item-4'
},
{
key: 'fadianliang',
value: 20,
d: '',
label: '光伏设备累计发电量',
class: 'item-5'
},
{
key: 'rongliang',
value: 20,
d: '',
label: '储能总容量',
class: 'item-6'
}
]
}
},
computed: {
leftList() {
return this.list.filter((_, index) => index % 2 === 0).slice(0, 3) // 左列取前3个偶数索引
},
rightList() {
return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引
}
},
watch: {},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.onLine {
height: calc(100% - 45px);
display: flex;
justify-content: center;
align-items: center;
}
.item {
height: 28%;
background: url('../../assets//home/onLineBg.png');
background-size: contain;
background-size: 100% 100%;
background-repeat: no-repeat;
padding: 10px 8px;
min-width: 115px;
display: flex;
flex-direction: column;
background-color: #072d42;
& > span:nth-child(1) {
font-size: 12px;
margin-bottom: 10px;
}
.d{
margin-left: 1px;
font-size: 12px;
}
}
.content-left,
.content-right {
width: calc((100% - 110px) / 2);
// width: 40%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
height: 100%;
}
// .content-left{
// align-items: self-end;
// }
// .content-right{
// align-items:flex-start;
// }
.content-middle {
width: 120px;
}
.online-icon {
width: 110px;
height: 130px;
background-image: url('@/assets/home/onLineIcon.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.item-3 {
margin-right: auto;
}
.item-4 {
margin-left: auto;
}
</style>