196 lines
13 KiB
TypeScript
196 lines
13 KiB
TypeScript
import { ValueType } from "realgrid";
|
|
import { footerIntArrayByDivision, footerDecimal3ArrayByDivision, footerAvgDecimalArrayByDivision } from "@/components/util/grid/footerSummary";
|
|
import type { GridView } from "@/components/type/DataGrid.type";
|
|
|
|
export const rawPumpingStationInfoList = {
|
|
columns: [
|
|
/* 1. 행정구역 및 기본정보 */
|
|
{
|
|
name: 'sido',
|
|
fieldName: 'sido',
|
|
header: { text: '시도' },
|
|
mergeCells: true,
|
|
sortdisable: true,
|
|
footer: [
|
|
{
|
|
valueCallback: (grid: GridView) => {
|
|
const divisionIndex = 0;
|
|
const dataSource = grid.getDataSource();
|
|
const rowCount = dataSource.getRowCount();
|
|
const uniqueValues = new Set<string>();
|
|
for (let i = 0; i < rowCount; i++) {
|
|
const val = dataSource.getValue(i, 'displayYear');
|
|
if (val) uniqueValues.add(String(val));
|
|
}
|
|
const divisionValues = Array.from(uniqueValues);
|
|
return divisionValues.length > divisionIndex ? divisionValues[divisionIndex] + '합계' : '합계';
|
|
}
|
|
},
|
|
{
|
|
valueCallback: (grid: GridView) => {
|
|
const divisionIndex = 1;
|
|
const dataSource = grid.getDataSource();
|
|
const rowCount = dataSource.getRowCount();
|
|
const uniqueValues = new Set<string>();
|
|
for (let i = 0; i < rowCount; i++) {
|
|
const val = dataSource.getValue(i, 'displayYear');
|
|
if (val) uniqueValues.add(String(val));
|
|
}
|
|
const divisionValues = Array.from(uniqueValues);
|
|
return divisionValues.length > divisionIndex ? divisionValues[divisionIndex] + '합계' : '합계';
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{ name: 'gugun', fieldName: 'gugun', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
|
|
{ name: 'pumpNm', fieldName: 'pumpNm', header: { text: '펌프장명' }, mergeCells: true, sortdisable: true },
|
|
{
|
|
name: 'displayYear',
|
|
fieldName: 'displayYear',
|
|
header: { text: '구분' },
|
|
sortdisable: true,
|
|
footer: [
|
|
{
|
|
valueCallback: (grid: GridView) => {
|
|
const divisionIndex = 0;
|
|
const dataSource = grid.getDataSource();
|
|
const uniqueValues = new Set<string>();
|
|
for (let i = 0; i < dataSource.getRowCount(); i++) {
|
|
const val = dataSource.getValue(i, 'displayYear');
|
|
if (val) uniqueValues.add(String(val));
|
|
}
|
|
const divisionValues = Array.from(uniqueValues);
|
|
return divisionValues.length > divisionIndex ? divisionValues[divisionIndex] + '합계' : '';
|
|
}
|
|
},
|
|
{
|
|
valueCallback: (grid: GridView) => {
|
|
const divisionIndex = 1;
|
|
const dataSource = grid.getDataSource();
|
|
const uniqueValues = new Set<string>();
|
|
for (let i = 0; i < dataSource.getRowCount(); i++) {
|
|
const val = dataSource.getValue(i, 'displayYear');
|
|
if (val) uniqueValues.add(String(val));
|
|
}
|
|
const divisionValues = Array.from(uniqueValues);
|
|
return divisionValues.length > divisionIndex ? divisionValues[divisionIndex] + '합계' : '';
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{ name: 'bscFctNm', fieldName: 'bscFctNm', header: { text: '처리장명' } },
|
|
{ name: 'pumpCls', fieldName: 'pumpCls', header: { text: '구분\n(합류/분류)' } },
|
|
{ name: 'addr', fieldName: 'addr', header: { text: '위치' } },
|
|
{ name: 'rnDt', fieldName: 'rnDt', header: { text: '가동년월일\nyyyy-mm-dd' } },
|
|
{
|
|
name: 'planDrhgAr', fieldName: 'planDrhgAr', header: { text: '계획배수면적\n(km2)' },
|
|
footer: footerDecimal3ArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.000'
|
|
},
|
|
|
|
/* 2. 계획배수량 (m3/hr) */
|
|
{ name: 'finewtDrngVl', fieldName: 'finewtDrngVl', header: { text: '청천시(A)' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtDrngVl', fieldName: 'rainwtDrngVl', header: { text: '우천시(B)' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'vlWtr', fieldName: 'vlWtr', header: { text: '우수량(B-A)' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
|
|
/* 3. 총 양수량 (m3/min) */
|
|
{ name: 'pltwtrTotCpcty', fieldName: 'pltwtrTotCpcty', header: { text: '오수펌프\n총양수량' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrTotCpcty', fieldName: 'rainwtrTotCpcty', header: { text: '우수펌프\n총양수량' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
|
|
/* 4. 오수펌프 상세 (1, 2, 3) */
|
|
{ name: 'pltwtrPumpCalbr1', fieldName: 'pltwtrPumpCalbr1', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCpcty1', fieldName: 'pltwtrPumpCpcty1', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCnt1', fieldName: 'pltwtrPumpCnt1', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'pltwtrPumpPreparCnt1', fieldName: 'pltwtrPumpPreparCnt1', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
{ name: 'pltwtrPumpCalbr2', fieldName: 'pltwtrPumpCalbr2', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCpcty2', fieldName: 'pltwtrPumpCpcty2', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCnt2', fieldName: 'pltwtrPumpCnt2', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'pltwtrPumpPreparCnt2', fieldName: 'pltwtrPumpPreparCnt2', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
{ name: 'pltwtrPumpCalbr3', fieldName: 'pltwtrPumpCalbr3', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCpcty3', fieldName: 'pltwtrPumpCpcty3', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'pltwtrPumpCnt3', fieldName: 'pltwtrPumpCnt3', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'pltwtrPumpPreparCnt3', fieldName: 'pltwtrPumpPreparCnt3', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
/* 5. 우수펌프 상세 (1, 2, 3) */
|
|
{ name: 'rainwtrPumpCalbr1', fieldName: 'rainwtrPumpCalbr1', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCpcty1', fieldName: 'rainwtrPumpCpcty1', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCnt1', fieldName: 'rainwtrPumpCnt1', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'rainwtrPumpPreparCnt1', fieldName: 'rainwtrPumpPreparCnt1', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
{ name: 'rainwtrPumpCalbr2', fieldName: 'rainwtrPumpCalbr2', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCpcty2', fieldName: 'rainwtrPumpCpcty2', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCnt2', fieldName: 'rainwtrPumpCnt2', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'rainwtrPumpPreparCnt2', fieldName: 'rainwtrPumpPreparCnt2', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
{ name: 'rainwtrPumpCalbr3', fieldName: 'rainwtrPumpCalbr3', header: { text: '구경(mm)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCpcty3', fieldName: 'rainwtrPumpCpcty3', header: { text: '양수량\n(m3/min)' }, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rainwtrPumpCnt3', fieldName: 'rainwtrPumpCnt3', header: { text: '펌프대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
{ name: 'rainwtrPumpPreparCnt3', fieldName: 'rainwtrPumpPreparCnt3', header: { text: '예비대수' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0' },
|
|
|
|
/* 6. 기타 및 운영 */
|
|
{ name: 'elcpwAmnt', fieldName: 'elcpwAmnt', header: { text: '연간전력사용량\n(kWh/년)' }, footer: footerAvgDecimalArrayByDivision, valueType: ValueType.NUMBER, numberFormat: '#,##0.0' },
|
|
{ name: 'rmk', fieldName: 'rmk', header: { text: '비고' } },
|
|
],
|
|
columnLayout: [
|
|
{
|
|
name: 'groupA',
|
|
header: { text: '행정구역' },
|
|
items: [
|
|
{ column: 'sido', footerUserSpans: [{ colspan: 3 }, { colspan: 3 }] },
|
|
'gugun',
|
|
'pumpNm',
|
|
]
|
|
},
|
|
'displayYear',
|
|
'bscFctNm',
|
|
'pumpCls',
|
|
'addr',
|
|
'rnDt',
|
|
'planDrhgAr',
|
|
{
|
|
name: 'groupB',
|
|
header: { text: '계획시간대최대배수량(m3/hr)' },
|
|
items: ['finewtDrngVl', 'rainwtDrngVl', 'vlWtr'],
|
|
},
|
|
{
|
|
name: 'groupC',
|
|
header: { text: '배수능력' },
|
|
items: [
|
|
'pltwtrTotCpcty',
|
|
{
|
|
name: 'pumpO_Detail',
|
|
header: { text: '오수펌프 상세' },
|
|
items: [
|
|
{ name: 'O1', header: { text: '오수펌프(1)' }, items: ['pltwtrPumpCalbr1', 'pltwtrPumpCpcty1', 'pltwtrPumpCnt1', 'pltwtrPumpPreparCnt1'] },
|
|
{ name: 'O2', header: { text: '오수펌프(2)' }, items: ['pltwtrPumpCalbr2', 'pltwtrPumpCpcty2', 'pltwtrPumpCnt2', 'pltwtrPumpPreparCnt2'] },
|
|
{ name: 'O3', header: { text: '오수펌프(3)' }, items: ['pltwtrPumpCalbr3', 'pltwtrPumpCpcty3', 'pltwtrPumpCnt3', 'pltwtrPumpPreparCnt3'] }
|
|
]
|
|
},
|
|
'rainwtrTotCpcty',
|
|
{
|
|
name: 'pumpW_Detail',
|
|
header: { text: '우수펌프 상세' },
|
|
items: [
|
|
{ name: 'W1', header: { text: '우수펌프(1)' }, items: ['rainwtrPumpCalbr1', 'rainwtrPumpCpcty1', 'rainwtrPumpCnt1', 'rainwtrPumpPreparCnt1'] },
|
|
{ name: 'W2', header: { text: '우수펌프(2)' }, items: ['rainwtrPumpCalbr2', 'rainwtrPumpCpcty2', 'rainwtrPumpCnt2', 'rainwtrPumpPreparCnt2'] },
|
|
{ name: 'W3', header: { text: '우수펌프(3)' }, items: ['rainwtrPumpCalbr3', 'rainwtrPumpCpcty3', 'rainwtrPumpCnt3', 'rainwtrPumpPreparCnt3'] }
|
|
]
|
|
}
|
|
],
|
|
},
|
|
'elcpwAmnt',
|
|
'rmk',
|
|
],
|
|
fixedColumns: 2,
|
|
rowStartNum: 3
|
|
};
|
|
|
|
export const PumpingStationInfoList = {
|
|
...rawPumpingStationInfoList,
|
|
columns: rawPumpingStationInfoList.columns.map(col => ({
|
|
...col,
|
|
editable: false,
|
|
styleName: "rg-cell-readonly"
|
|
}))
|
|
}; |