feat: 회계/급여 관리 개선 및 공통 템플릿 보강
- 회계: 매출/청구/입출금 관리 UI 개선 - 급여: SalaryDetailDialog 대폭 개선, SalaryRegistrationDialog 신규 - 공통: IntegratedDetailTemplate, UniversalListPage 보강 - UI: currency-input 컴포넌트 개선 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,7 +94,9 @@ function IntegratedDetailTemplateInner<T extends Record<string, unknown>>(
|
||||
} else {
|
||||
const defaultData: Record<string, unknown> = {};
|
||||
config.fields.forEach((field) => {
|
||||
if (field.type === 'checkbox') {
|
||||
if (field.defaultValue !== undefined) {
|
||||
defaultData[field.key] = field.defaultValue;
|
||||
} else if (field.type === 'checkbox') {
|
||||
defaultData[field.key] = false;
|
||||
} else {
|
||||
defaultData[field.key] = '';
|
||||
@@ -135,10 +137,12 @@ function IntegratedDetailTemplateInner<T extends Record<string, unknown>>(
|
||||
: (initialData as Record<string, unknown>);
|
||||
setFormData(transformed);
|
||||
} else {
|
||||
// 기본값 설정
|
||||
// 기본값 설정 (field.defaultValue 우선 적용)
|
||||
const defaultData: Record<string, unknown> = {};
|
||||
config.fields.forEach((field) => {
|
||||
if (field.type === 'checkbox') {
|
||||
if (field.defaultValue !== undefined) {
|
||||
defaultData[field.key] = field.defaultValue;
|
||||
} else if (field.type === 'checkbox') {
|
||||
defaultData[field.key] = false;
|
||||
} else {
|
||||
defaultData[field.key] = '';
|
||||
|
||||
@@ -246,8 +246,8 @@ export function UniversalListPage<T>({
|
||||
|
||||
// 삭제 등으로 현재 페이지가 빈 페이지가 되면 마지막 유효 페이지로 이동
|
||||
useEffect(() => {
|
||||
if (totalPages > 0 && currentPage > totalPages) {
|
||||
setCurrentPage(totalPages);
|
||||
if (currentPage > 1 && (totalPages === 0 || currentPage > totalPages)) {
|
||||
setCurrentPage(Math.max(1, totalPages));
|
||||
}
|
||||
}, [totalPages, currentPage]);
|
||||
|
||||
@@ -328,8 +328,9 @@ export function UniversalListPage<T>({
|
||||
}, []);
|
||||
|
||||
// initialData prop 변경 감지 (부모 컴포넌트에서 데이터 로드 후 전달하는 경우)
|
||||
// 삭제 후 빈 배열도 동기화해야 빈 페이지가 올바르게 표시됨
|
||||
useEffect(() => {
|
||||
if (initialData && initialData.length > 0) {
|
||||
if (initialData) {
|
||||
setRawData(initialData);
|
||||
}
|
||||
}, [initialData]);
|
||||
|
||||
Reference in New Issue
Block a user