diff --git a/apps/st/src/components/css/DataGrid.css b/apps/st/src/components/css/DataGrid.css index cd21091f9..18058bbc7 100644 --- a/apps/st/src/components/css/DataGrid.css +++ b/apps/st/src/components/css/DataGrid.css @@ -32,9 +32,18 @@ .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error { @apply !bg-[#ffe6e6] !text-[#c00]; } + .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error-imr { + @apply !bg-[#fff7bf] !text-[#b45309]; + } .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-total { @apply !bg-[#e3eaf2]; } + .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-rowtype-biz-sum { + @apply !bg-[#ffe9cf]; + } + .rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-rowtype-other { + @apply !bg-[#fff7bf]; + } /* 진행상황: 소프트 인라인 요약 (툴바와 자연스럽게 blend) */ .data-grid-status-bubble { diff --git a/apps/st/src/components/module/CompactDataGrid.tsx b/apps/st/src/components/module/CompactDataGrid.tsx index 4378182cf..b1f97eb14 100644 --- a/apps/st/src/components/module/CompactDataGrid.tsx +++ b/apps/st/src/components/module/CompactDataGrid.tsx @@ -67,6 +67,7 @@ const CompactDataGrid = ({ fixedColumns, showHeaderCheckbox = false, rowData, + enableSort = false, // setRowData, getGridDataRef, cellStyleCallback, @@ -375,7 +376,7 @@ const CompactDataGrid = ({ numberFormat: column.footer.numberFormat, } : undefined} mergeRule={column.mergeCells ? { criteria: 'value' } : undefined} - sortable={!column.sortdisable} + sortable={enableSort && !column.sortdisable} /> ))} diff --git a/apps/st/src/components/module/DataGrid.tsx b/apps/st/src/components/module/DataGrid.tsx index f914be8a8..d85693a53 100644 --- a/apps/st/src/components/module/DataGrid.tsx +++ b/apps/st/src/components/module/DataGrid.tsx @@ -324,6 +324,7 @@ const DataGrid = ({ statusInfo, highlightedRowId, idFieldName = "id", + enableSort = false, }: DataGridProps) => { const { columns, columnLayout } = columnInfo; const gridRef = useRef(null); @@ -557,10 +558,10 @@ const DataGrid = ({ ) { const cell = worksheet[ - XLSX.utils.encode_cell({ - r: rowIndex, - c: col, - }) + XLSX.utils.encode_cell({ + r: rowIndex, + c: col, + }) ]; if ( cell && @@ -636,7 +637,7 @@ const DataGrid = ({ const col = range.s.c + colIndex; const cell = worksheet[ - XLSX.utils.encode_cell({ r: row, c: col }) + XLSX.utils.encode_cell({ r: row, c: col }) ]; const headerName = headers[colIndex] || `Column${colIndex + 1}`; @@ -759,12 +760,14 @@ const DataGrid = ({ gridView as { onSorting?: (g: unknown, f: unknown[], d: unknown[]) => boolean; } - ).onSorting = createOnSortingHandler( - columns, - setRowData, - sortDirRef, - originalRowsRef, - ); + ).onSorting = enableSort + ? createOnSortingHandler( + columns, + setRowData, + sortDirRef, + originalRowsRef, + ) + : () => false; (gridView.displayOptions as DisplayOptions).fitStyle = GridFitStyle.EVEN; @@ -934,7 +937,7 @@ const DataGrid = ({ ) { ( column.footer[ - index + index ] as FooterItemWithCallback ).valueCallback = footerItem.valueCallback; @@ -987,11 +990,11 @@ const DataGrid = ({ getGridDataRef.current = () => { const gv = gridRef.current?.gridView as | { - getDataSource?: () => { - getRowCount(): number; - getValue(r: number, f: string): unknown; - }; - } + getDataSource?: () => { + getRowCount(): number; + getValue(r: number, f: string): unknown; + }; + } | undefined; if (!gv?.getDataSource) return []; const ds = gv.getDataSource(); @@ -1102,21 +1105,23 @@ const DataGrid = ({ 진행상황:{" "} {statusInfo.laeSbmsnSttsCd === null || - statusInfo.laeSbmsnSttsCd === "0" + statusInfo.laeSbmsnSttsCd === "0" ? "미작성" : statusInfo.laeSbmsnSttsCd === "1" - ? "작성중" - : statusInfo.laeSbmsnSttsCd === "2" - ? "제출" - : statusInfo.laeSbmsnSttsCd === "3" - ? "승인" - : "반려"} + ? "작성중" + : statusInfo.laeSbmsnSttsCd === "2" + ? "제출" + : statusInfo.laeSbmsnSttsCd === "3" + ? "승인" + : statusInfo.laeSbmsnSttsCd === "4" + ? "반려" + : "검증중"} 제출일:{" "} {statusInfo.laeSbmsnYmd ? statusInfo.laeSbmsnYmd.length === 8 && - /^\d{8}$/.test(statusInfo.laeSbmsnYmd) + /^\d{8}$/.test(statusInfo.laeSbmsnYmd) ? `${statusInfo.laeSbmsnYmd.slice(0, 4)}-${statusInfo.laeSbmsnYmd.slice(4, 6)}-${statusInfo.laeSbmsnYmd.slice(6, 8)}` : statusInfo.laeSbmsnYmd : "미제출"} @@ -1170,23 +1175,25 @@ const DataGrid = ({ d: unknown[], ) => boolean; } - ).onSorting = createOnSortingHandler( - columns, - setRowData, - sortDirRef, - originalRowsRef, - ); + ).onSorting = enableSort + ? createOnSortingHandler( + columns, + setRowData, + sortDirRef, + originalRowsRef, + ) + : () => false; const dataProvider = gridRef.current ?.dataProvider as unknown as | { - setFields?(f: unknown[]): void; - setRows?( - r: Record[], - ): void; - getJsonRow?( - r: number, - ): Record; - } + setFields?(f: unknown[]): void; + setRows?( + r: Record[], + ): void; + getJsonRow?( + r: number, + ): Record; + } | undefined; if (dataProvider?.setFields) { dataProvider.setFields( @@ -1339,14 +1346,14 @@ const DataGrid = ({ })} footer={ column.footer && - !Array.isArray(column.footer) + !Array.isArray(column.footer) ? { - text: column.footer.text, - expression: - column.footer.expression, - numberFormat: - column.footer.numberFormat, - } + text: column.footer.text, + expression: + column.footer.expression, + numberFormat: + column.footer.numberFormat, + } : undefined } mergeRule={ @@ -1354,7 +1361,7 @@ const DataGrid = ({ ? { criteria: "value" } : undefined } - sortable={!column.sortdisable} + sortable={enableSort && !column.sortdisable} /> ); })} diff --git a/apps/st/src/components/module/SearchForm.tsx b/apps/st/src/components/module/SearchForm.tsx index 5bc809787..af35891cf 100644 --- a/apps/st/src/components/module/SearchForm.tsx +++ b/apps/st/src/components/module/SearchForm.tsx @@ -11,7 +11,8 @@ import { SelectTrigger, SelectContent, SelectItem, - SelectValue + SelectValue, + Checkbox } from "@common/components"; @@ -64,6 +65,7 @@ const SearchForm = (props: SearchFormProps = {}) => { order: props.defaultValues?.order || '', fctName: props.defaultValues?.fctName || '', bsnmCd: props.defaultValues?.bsnmCd || '', + isDetail: false, }); const sggKey: [string, string] | null = @@ -106,6 +108,7 @@ const SearchForm = (props: SearchFormProps = {}) => { order: '', fctName: '', bsnmCd: '', + isDetail: false, }; setValues(resetValues); props.onReset?.(); @@ -201,6 +204,19 @@ const SearchForm = (props: SearchFormProps = {}) => { } + {mergedProps.isDetail && +
+ + + setValues({ ...values, isDetail: value === true }) + } + /> +
+ } {mergedProps.order &&