집계표 개발
This commit is contained in:
parent
b1ae1b7d11
commit
cb610d098d
@ -2288,22 +2288,26 @@ export function useModuleBasicSetting() {
|
|||||||
let moduleInfo = {}
|
let moduleInfo = {}
|
||||||
const rows = surfaces.map((surface) => {
|
const rows = surfaces.map((surface) => {
|
||||||
let wpOut = 0
|
let wpOut = 0
|
||||||
|
moduleInfo = {}
|
||||||
surface.modules.forEach((module) => {
|
surface.modules.forEach((module) => {
|
||||||
wpOut += +module.moduleInfo.wpOut
|
|
||||||
if (!moduleInfo[module.moduleInfo.itemId]) {
|
if (!moduleInfo[module.moduleInfo.itemId]) {
|
||||||
moduleInfo[module.moduleInfo.itemId] = 0
|
moduleInfo[module.moduleInfo.itemId] = { name: module.moduleInfo.itemNm, amount: 0, id: module.moduleInfo.itemId }
|
||||||
}
|
}
|
||||||
|
wpOut += +module.moduleInfo.wpOut
|
||||||
|
|
||||||
moduleInfo[module.moduleInfo.itemId]++
|
moduleInfo[module.moduleInfo.itemId].amount++
|
||||||
})
|
})
|
||||||
totalWpout += wpOut
|
totalWpout += wpOut
|
||||||
console.log('🚀 ~ moduleData.rows=surfaces.map ~ module:', module)
|
console.log('🚀 ~ moduleData.rows=surfaces.map ~ module:', module)
|
||||||
|
const rowObject = {}
|
||||||
|
Object.keys(moduleInfo).forEach((key) => {
|
||||||
|
rowObject[key] = moduleInfo[key].amount
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText,
|
...rowObject, // 총 발전량 = 발전량 * 모듈 개수
|
||||||
|
name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, // 지붕면
|
||||||
// powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }),
|
// powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }),
|
||||||
amount: wpOut,
|
wpOut: wpOut,
|
||||||
...moduleInfo,
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -2311,9 +2315,9 @@ export function useModuleBasicSetting() {
|
|||||||
const header = [
|
const header = [
|
||||||
{ name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' },
|
{ name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' },
|
||||||
...Object.keys(moduleInfo).map((key) => {
|
...Object.keys(moduleInfo).map((key) => {
|
||||||
return { name: moduleInfo[key], prop: key }
|
return { name: moduleInfo[key].name, prop: key }
|
||||||
}),
|
}),
|
||||||
{ name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'amount' },
|
{ name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
|
||||||
]
|
]
|
||||||
let footer = ['합계']
|
let footer = ['합계']
|
||||||
let footerData = {}
|
let footerData = {}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { atom } from 'recoil'
|
import { atom } from 'recoil'
|
||||||
|
|
||||||
export const makerState = atom({
|
export const makerState = atom({
|
||||||
@ -23,5 +24,15 @@ export const pcsCheckState = atom({
|
|||||||
|
|
||||||
export const moduleStatisticsState = atom({
|
export const moduleStatisticsState = atom({
|
||||||
key: 'moduleStatisticsState',
|
key: 'moduleStatisticsState',
|
||||||
default: { header: [], rows: [], footer: [] },
|
default: {
|
||||||
|
header: [
|
||||||
|
{ name: '지붕면', prop: 'name' },
|
||||||
|
{ name: `발전량(kW)`, prop: 'amount' },
|
||||||
|
],
|
||||||
|
rows: [],
|
||||||
|
footer: [
|
||||||
|
{ name: '합계', prop: 'name' },
|
||||||
|
{ name: `발전량(kW)`, prop: 'amount' },
|
||||||
|
],
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user