|
|
@ -47,11 +47,12 @@ import ScreenAdapter from '@/components/screen-adapter.vue'; |
|
|
import Block from './comp/block.vue'; |
|
|
import Block from './comp/block.vue'; |
|
|
import Bar from './comp/bar.vue'; |
|
|
import Bar from './comp/bar.vue'; |
|
|
import Pop from './comp/pop.vue'; |
|
|
import Pop from './comp/pop.vue'; |
|
|
|
|
|
import Item from './comp/item.vue'; |
|
|
import timeCountHooks from '@/hooks/time-count'; |
|
|
import timeCountHooks from '@/hooks/time-count'; |
|
|
import { useFetch } from '@/hooks/fetch'; |
|
|
import { useFetch } from '@/hooks/fetch'; |
|
|
import utilService from '@/service/utilService'; |
|
|
import utilService from '@/service/utilService'; |
|
|
import Chart from '@/components/chart.vue'; |
|
|
import Chart from '@/components/chart.vue'; |
|
|
import { costStatistic, elecPayload, monthEnergyUsageTrend, usageRanking, energyUsageDistribution } from './common/model'; |
|
|
|
|
|
|
|
|
import { costStatistic, elecPayload, monthEnergyUsageTrend, usageRanking, energyUsageDistribution, yearUsageRank, energyUsageStatistic, photovoltaicEnergyUse } from './common/model'; |
|
|
import { IObject } from '@/types/interface'; |
|
|
import { IObject } from '@/types/interface'; |
|
|
import moment from 'moment'; |
|
|
import moment from 'moment'; |
|
|
import toolHooks from '@/hooks/tool'; |
|
|
import toolHooks from '@/hooks/tool'; |
|
|
@ -64,7 +65,7 @@ export default defineComponent({ |
|
|
Tooltip, |
|
|
Tooltip, |
|
|
Block, |
|
|
Block, |
|
|
Chart, |
|
|
Chart, |
|
|
|
|
|
|
|
|
|
|
|
Item, |
|
|
Bar, |
|
|
Bar, |
|
|
Pop, |
|
|
Pop, |
|
|
}, |
|
|
}, |
|
|
@ -73,7 +74,7 @@ export default defineComponent({ |
|
|
const { generateSvg2Dom } = toolHooks(); |
|
|
const { generateSvg2Dom } = toolHooks(); |
|
|
|
|
|
|
|
|
const state = reactive({ |
|
|
const state = reactive({ |
|
|
opt: { scale: 0.8 }, |
|
|
|
|
|
|
|
|
opt: { scale: 1.0 }, |
|
|
dragStretch: null, |
|
|
dragStretch: null, |
|
|
toolTipData: {}, |
|
|
toolTipData: {}, |
|
|
timer: null, |
|
|
timer: null, |
|
|
@ -86,30 +87,30 @@ export default defineComponent({ |
|
|
{ |
|
|
{ |
|
|
key: 'yearCarbon', |
|
|
key: 'yearCarbon', |
|
|
icon: '', |
|
|
icon: '', |
|
|
label: '年碳排放量', |
|
|
|
|
|
|
|
|
label: '年度综合能耗', |
|
|
value: '--', |
|
|
value: '--', |
|
|
unit: 'tCO₂', |
|
|
|
|
|
|
|
|
unit: 'tce', |
|
|
toFixed: 2, |
|
|
toFixed: 2, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
key: 'monthConsumptionValue', |
|
|
key: 'monthConsumptionValue', |
|
|
icon: '', |
|
|
icon: '', |
|
|
label: '月综合能耗', |
|
|
|
|
|
|
|
|
label: '光伏发电量', |
|
|
value: '--', |
|
|
value: '--', |
|
|
unit: 'tce', |
|
|
|
|
|
|
|
|
unit: 'kWh', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
key: 'yearConsumptionValue', |
|
|
key: 'yearConsumptionValue', |
|
|
icon: '', |
|
|
icon: '', |
|
|
label: '年综合能耗', |
|
|
|
|
|
|
|
|
label: '碳排放量', |
|
|
value: '--', |
|
|
value: '--', |
|
|
unit: 'tce', |
|
|
|
|
|
|
|
|
unit: 'tCO₂', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
left: [ |
|
|
left: [ |
|
|
{ |
|
|
{ |
|
|
comp: 'bar', |
|
|
|
|
|
title: '月用能统计', |
|
|
|
|
|
|
|
|
comp: 'item', |
|
|
|
|
|
title: '日用能统计', |
|
|
data: [ |
|
|
data: [ |
|
|
{ |
|
|
{ |
|
|
key: 'electricDayValue', |
|
|
key: 'electricDayValue', |
|
|
@ -125,70 +126,19 @@ export default defineComponent({ |
|
|
value: '', |
|
|
value: '', |
|
|
unit: 't', |
|
|
unit: 't', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
|
|
|
key: 'steamDayValue', |
|
|
|
|
|
icon: 'steam', |
|
|
|
|
|
label: '蒸汽用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 't', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'airDayValue', |
|
|
|
|
|
icon: 'air', |
|
|
|
|
|
label: '压缩空气用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 'Nm³', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'gasValue', |
|
|
|
|
|
icon: 'gas', |
|
|
|
|
|
label: '天然气用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 'Nm³', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '年用能统计', |
|
|
|
|
|
comp: 'bar', |
|
|
|
|
|
data: [ |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'electricDayValue', |
|
|
|
|
|
icon: 'elec', |
|
|
|
|
|
label: '电用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 'kWh', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'waterDayValue', |
|
|
|
|
|
icon: 'water', |
|
|
|
|
|
label: '水用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 't', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'steamDayValue', |
|
|
|
|
|
icon: 'steam', |
|
|
|
|
|
label: '蒸汽用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 't', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'airDayValue', |
|
|
|
|
|
icon: 'air', |
|
|
|
|
|
label: '压缩空气用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 'Nm³', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'gasValue', |
|
|
|
|
|
icon: 'gas', |
|
|
|
|
|
label: '天然气用量', |
|
|
|
|
|
value: '', |
|
|
|
|
|
unit: 'Nm³', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
comp: 'chart', |
|
|
|
|
|
title: '月度用能排行', |
|
|
|
|
|
option: usageRanking(), |
|
|
|
|
|
unit: 'kWh', |
|
|
}, |
|
|
}, |
|
|
|
|
|
// { |
|
|
|
|
|
// title: '年度用能排行', |
|
|
|
|
|
// comp: 'chart', |
|
|
|
|
|
// option: yearUsageRank(), |
|
|
|
|
|
// }, |
|
|
{ |
|
|
{ |
|
|
comp: 'chart', |
|
|
comp: 'chart', |
|
|
title: '当日电力负荷', |
|
|
title: '当日电力负荷', |
|
|
@ -200,22 +150,20 @@ export default defineComponent({ |
|
|
{ |
|
|
{ |
|
|
comp: 'chart', |
|
|
comp: 'chart', |
|
|
title: '能耗统计(月)', |
|
|
title: '能耗统计(月)', |
|
|
option: costStatistic(), |
|
|
|
|
|
unit: '', |
|
|
|
|
|
|
|
|
option: energyUsageStatistic(), |
|
|
|
|
|
unit: 'tce', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
comp: 'chart', |
|
|
comp: 'chart', |
|
|
title: '用能排行(月)', |
|
|
|
|
|
option: usageRanking(), |
|
|
|
|
|
|
|
|
title: '光伏用能(月)', |
|
|
|
|
|
option: photovoltaicEnergyUse(), |
|
|
unit: 'kWh', |
|
|
unit: 'kWh', |
|
|
select: true, |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '当月用能趋势', |
|
|
|
|
|
|
|
|
title: '当年用能趋势', |
|
|
comp: 'chart', |
|
|
comp: 'chart', |
|
|
option: monthEnergyUsageTrend(), |
|
|
option: monthEnergyUsageTrend(), |
|
|
unit: 'kWh', |
|
|
unit: 'kWh', |
|
|
select: true, |
|
|
|
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
bottom: { |
|
|
bottom: { |
|
|
@ -230,37 +178,6 @@ export default defineComponent({ |
|
|
const u = state.dataForm.codeMap[c]; |
|
|
const u = state.dataForm.codeMap[c]; |
|
|
state.left[2].unit = u; |
|
|
state.left[2].unit = u; |
|
|
state.right[1].unit = u; |
|
|
state.right[1].unit = u; |
|
|
|
|
|
|
|
|
//当月用能趋势 |
|
|
|
|
|
useFetch('/board/monthEnergy/analyse', { |
|
|
|
|
|
data: { |
|
|
|
|
|
month: moment().format('YYYY-MM'), |
|
|
|
|
|
type, |
|
|
|
|
|
}, |
|
|
|
|
|
cb: (res: any) => { |
|
|
|
|
|
if (utilService.isValidObject(res) && utilService.isValidArray(res.currentMonthData)) { |
|
|
|
|
|
const d = res.currentMonthData; |
|
|
|
|
|
const c = state.dataForm.code; |
|
|
|
|
|
const u = state.dataForm.codeMap[c]; |
|
|
|
|
|
state.right[2].option = monthEnergyUsageTrend(d, u); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//用能排行(月) |
|
|
|
|
|
useFetch('/board/monthEnergy/ranking', { |
|
|
|
|
|
data: { |
|
|
|
|
|
day: moment().format('YYYY-MM'), |
|
|
|
|
|
type, |
|
|
|
|
|
}, |
|
|
|
|
|
cb: (res: any) => { |
|
|
|
|
|
if (utilService.isValidArray(res)) { |
|
|
|
|
|
const c = state.dataForm.code; |
|
|
|
|
|
const u = state.dataForm.codeMap[c]; |
|
|
|
|
|
state.right[1].option = usageRanking(res, u); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const fn = () => { |
|
|
const fn = () => { |
|
|
@ -274,7 +191,9 @@ export default defineComponent({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
//月用能统计 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//左侧 |
|
|
|
|
|
//日用能统计 |
|
|
useFetch('/board/eachEnergy', { |
|
|
useFetch('/board/eachEnergy', { |
|
|
cb: (res: any) => { |
|
|
cb: (res: any) => { |
|
|
if (utilService.isValidObject(res)) { |
|
|
if (utilService.isValidObject(res)) { |
|
|
@ -284,38 +203,73 @@ export default defineComponent({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
//年用能统计 |
|
|
|
|
|
useFetch('/board/eachEnergyYear', { |
|
|
|
|
|
|
|
|
//月度用能排行 |
|
|
|
|
|
useFetch('/board/monthEnergy/ranking', { |
|
|
|
|
|
data: { |
|
|
|
|
|
month: moment().format('YYYY-MM'), |
|
|
|
|
|
type: '电', |
|
|
|
|
|
}, |
|
|
cb: (res: any) => { |
|
|
cb: (res: any) => { |
|
|
if (utilService.isValidObject(res)) { |
|
|
|
|
|
for (const item of state.left[1].data) { |
|
|
|
|
|
item.value = res[item.key] ?? '--'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (utilService.isValidArray(res)) { |
|
|
|
|
|
const c = state.dataForm.code; |
|
|
|
|
|
const u = state.dataForm.codeMap[c]; |
|
|
|
|
|
state.left[1].option = usageRanking(res, u); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//当日电力负荷 |
|
|
|
|
|
useFetch('/board/qcDayLoad/analyse', { |
|
|
|
|
|
data: { |
|
|
|
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
|
|
|
}, |
|
|
|
|
|
cb: (res: any) => { |
|
|
|
|
|
if (utilService.isValidObject(res) && utilService.isValidArray(res.currentMonthData)) { |
|
|
|
|
|
const d = res.currentMonthData; |
|
|
|
|
|
state.left[2].option = elecPayload(d); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//能耗费用统计 |
|
|
|
|
|
|
|
|
//右侧 |
|
|
|
|
|
//能耗统计(月) |
|
|
useFetch('/board/energyCost', { |
|
|
useFetch('/board/energyCost', { |
|
|
data: { |
|
|
data: { |
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
}, |
|
|
}, |
|
|
cb: (res: any) => { |
|
|
cb: (res: any) => { |
|
|
if (utilService.isValidArray(res)) { |
|
|
if (utilService.isValidArray(res)) { |
|
|
state.right[0].option = costStatistic(res); |
|
|
|
|
|
|
|
|
state.right[0].option = energyUsageStatistic(res); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//当日电力负荷 |
|
|
|
|
|
useFetch('/board/qcDayLoad/analyse', { |
|
|
|
|
|
|
|
|
//光伏用能(月) |
|
|
|
|
|
useFetch('/board/photovoltaic', { |
|
|
data: { |
|
|
data: { |
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
}, |
|
|
}, |
|
|
|
|
|
cb: (res: any) => { |
|
|
|
|
|
if (utilService.isValidArray(res)) { |
|
|
|
|
|
const c = state.dataForm.code; |
|
|
|
|
|
const u = state.dataForm.codeMap[c]; |
|
|
|
|
|
state.right[1].option = photovoltaicEnergyUse(res, u); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//当年用能趋势 |
|
|
|
|
|
useFetch('/board/eachEnergyYear', { |
|
|
|
|
|
data: { |
|
|
|
|
|
day: moment().format('YYYY-MM-DD'), |
|
|
|
|
|
type: '电', |
|
|
|
|
|
}, |
|
|
cb: (res: any) => { |
|
|
cb: (res: any) => { |
|
|
if (utilService.isValidObject(res) && utilService.isValidArray(res.currentMonthData)) { |
|
|
if (utilService.isValidObject(res) && utilService.isValidArray(res.currentMonthData)) { |
|
|
const d = res.currentMonthData; |
|
|
const d = res.currentMonthData; |
|
|
state.left[2].option = elecPayload(d); |
|
|
|
|
|
|
|
|
const c = state.dataForm.code; |
|
|
|
|
|
const u = state.dataForm.codeMap[c]; |
|
|
|
|
|
state.right[2].option = monthEnergyUsageTrend(d, u); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
@ -356,16 +310,15 @@ export default defineComponent({ |
|
|
const target = document.querySelector('.boards-container .center') as HTMLElement; |
|
|
const target = document.querySelector('.boards-container .center') as HTMLElement; |
|
|
generateSvg2Dom('/cdn/normal_bg.svg', target, () => { |
|
|
generateSvg2Dom('/cdn/normal_bg.svg', target, () => { |
|
|
target.style.transform = 'scale(0.7)'; |
|
|
target.style.transform = 'scale(0.7)'; |
|
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
init(state, target); |
|
|
|
|
|
// document.getElementById("layer-d-animate").innerHTML = '<animate href="#path23264" attributeName="stroke-dashoffset" dur="15s" to="0" fill="freeze"></animate><animate href="#path23264-3" attributeName="stroke-dashoffset" dur="15s" to="0" fill="freeze"></animate>'; |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
getSvg(); |
|
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
const target = document.querySelector('.boards-container .center') as HTMLElement; |
|
|
|
|
|
|
|
|
|
|
|
init(state, target); |
|
|
|
|
|
}); |
|
|
state.timer = setInterval(() => { |
|
|
state.timer = setInterval(() => { |
|
|
changeType(state.dataForm.code); |
|
|
changeType(state.dataForm.code); |
|
|
fn(); |
|
|
fn(); |
|
|
@ -470,25 +423,10 @@ export default defineComponent({ |
|
|
width: 1920px; |
|
|
width: 1920px; |
|
|
height: 1080px; |
|
|
height: 1080px; |
|
|
cursor: move; |
|
|
cursor: move; |
|
|
//background: url("@/assets/images/njhl/bg.png"); |
|
|
|
|
|
//transform: translate(-50%, -50%); |
|
|
|
|
|
/* 初始阴影设置(透明) */ |
|
|
|
|
|
&::before { |
|
|
|
|
|
content: ''; |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 0; |
|
|
|
|
|
left: 0; |
|
|
|
|
|
right: 0; |
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
border-radius: inherit; |
|
|
|
|
|
//opacity: 0; |
|
|
|
|
|
//transition: opacity 0.4s; |
|
|
|
|
|
box-shadow: inset 0 0 80px 30px #000b31; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
background: url('@/assets/images/dashboard/bg.png') no-repeat; |
|
|
|
|
|
background-position: center 75%; |
|
|
|
|
|
|
|
|
&:hover::before { |
|
|
|
|
|
// opacity: 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//transform: translate(-50%, -50%); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.icon { |
|
|
.icon { |
|
|
@ -520,7 +458,7 @@ export default defineComponent({ |
|
|
|
|
|
|
|
|
> * { |
|
|
> * { |
|
|
margin: 0 40px; |
|
|
margin: 0 40px; |
|
|
background: rgba(#000b31, 0.7); |
|
|
|
|
|
|
|
|
//background: rgba(#000b31, 0.7); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|