mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 11:19:24 +08:00
系统总览页面
This commit is contained in:
204
web/src/components/Home/Modal/DisCharge.vue
Normal file
204
web/src/components/Home/Modal/DisCharge.vue
Normal 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>
|
||||
139
web/src/components/Home/Modal/EnvInfo.vue
Normal file
139
web/src/components/Home/Modal/EnvInfo.vue
Normal 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>
|
||||
155
web/src/components/Home/Modal/OperationalInfo.vue
Normal file
155
web/src/components/Home/Modal/OperationalInfo.vue
Normal 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>
|
||||
174
web/src/components/Home/Modal/PrefabCabin.vue
Normal file
174
web/src/components/Home/Modal/PrefabCabin.vue
Normal 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>
|
||||
213
web/src/components/Home/Modal/Revenue.vue
Normal file
213
web/src/components/Home/Modal/Revenue.vue
Normal 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>
|
||||
135
web/src/components/Home/Modal/StatisticalInfo.vue
Normal file
135
web/src/components/Home/Modal/StatisticalInfo.vue
Normal 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>
|
||||
197
web/src/components/Home/Modal/Utilization.vue
Normal file
197
web/src/components/Home/Modal/Utilization.vue
Normal 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>
|
||||
Reference in New Issue
Block a user