등록자랑 회사코드 자동으로 들어가도록 수정
This commit is contained in:
parent
f7e03792f6
commit
244f04a199
|
|
@ -229,6 +229,14 @@ export class DynamicFormService {
|
|||
...actualData
|
||||
} = data;
|
||||
|
||||
console.log("🔍 [dynamicFormService] 받은 데이터:", {
|
||||
전체데이터: data,
|
||||
writer,
|
||||
company_code,
|
||||
created_by,
|
||||
updated_by,
|
||||
});
|
||||
|
||||
// 기본 데이터 준비
|
||||
const dataToInsert: any = { ...actualData };
|
||||
|
||||
|
|
@ -251,12 +259,21 @@ export class DynamicFormService {
|
|||
|
||||
// 작성자 정보 추가 (writer 컬럼 우선, 없으면 created_by/updated_by)
|
||||
if (writer && tableColumns.includes("writer")) {
|
||||
console.log(`✅ writer 추가: ${writer}`);
|
||||
dataToInsert.writer = writer;
|
||||
} else {
|
||||
console.log(`❌ writer 추가 실패:`, {
|
||||
hasWriter: !!writer,
|
||||
writerValue: writer,
|
||||
hasColumn: tableColumns.includes("writer"),
|
||||
});
|
||||
}
|
||||
if (created_by && tableColumns.includes("created_by")) {
|
||||
console.log(`✅ created_by 추가: ${created_by}`);
|
||||
dataToInsert.created_by = created_by;
|
||||
}
|
||||
if (updated_by && tableColumns.includes("updated_by")) {
|
||||
console.log(`✅ updated_by 추가: ${updated_by}`);
|
||||
dataToInsert.updated_by = updated_by;
|
||||
}
|
||||
if (company_code && tableColumns.includes("company_code")) {
|
||||
|
|
@ -282,9 +299,18 @@ export class DynamicFormService {
|
|||
`⚠️ company_code 길이 제한: 앞의 32자로 자름 -> "${processedCompanyCode}"`
|
||||
);
|
||||
}
|
||||
console.log(`✅ company_code 추가: ${processedCompanyCode}`);
|
||||
dataToInsert.company_code = processedCompanyCode;
|
||||
} else {
|
||||
console.log(`❌ company_code 추가 실패:`, {
|
||||
hasCompanyCode: !!company_code,
|
||||
companyCodeValue: company_code,
|
||||
hasColumn: tableColumns.includes("company_code"),
|
||||
});
|
||||
}
|
||||
|
||||
console.log("🔍 [dynamicFormService] 최종 저장 데이터:", dataToInsert);
|
||||
|
||||
// 날짜/시간 문자열을 적절한 형태로 변환
|
||||
Object.keys(dataToInsert).forEach((key) => {
|
||||
const value = dataToInsert[key];
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ export default function ScreenViewPage() {
|
|||
// 🆕 현재 로그인한 사용자 정보
|
||||
const { user, userName, companyCode } = useAuth();
|
||||
|
||||
console.log("🔍 [page.tsx] useAuth 결과:", {
|
||||
user,
|
||||
userId: user?.userId,
|
||||
userName,
|
||||
companyCode,
|
||||
});
|
||||
|
||||
const [screen, setScreen] = useState<ScreenDefinition | null>(null);
|
||||
const [layout, setLayout] = useState<LayoutData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,13 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
|||
}) => {
|
||||
const { isPreviewMode } = useScreenPreview(); // 프리뷰 모드 확인
|
||||
|
||||
// 🔍 디버깅: props 확인
|
||||
console.log("🔍 [ButtonPrimaryComponent] Props 확인:", {
|
||||
userId,
|
||||
userName,
|
||||
companyCode,
|
||||
screenId,
|
||||
tableName,
|
||||
});
|
||||
|
||||
// 🆕 플로우 단계별 표시 제어
|
||||
const flowConfig = (component as any).webTypeConfig?.flowVisibilityConfig;
|
||||
|
|
|
|||
|
|
@ -214,6 +214,14 @@ export class ButtonActionExecutor {
|
|||
const writerValue = context.userId || context.userName || "unknown";
|
||||
const companyCodeValue = context.companyCode || "";
|
||||
|
||||
console.log("🔍 [buttonActions] 사용자 정보 확인:", {
|
||||
userId: context.userId,
|
||||
userName: context.userName,
|
||||
companyCode: context.companyCode,
|
||||
writerValue,
|
||||
companyCodeValue,
|
||||
});
|
||||
|
||||
const dataWithUserInfo = {
|
||||
...formData,
|
||||
writer: writerValue,
|
||||
|
|
@ -222,6 +230,8 @@ export class ButtonActionExecutor {
|
|||
company_code: companyCodeValue,
|
||||
};
|
||||
|
||||
console.log("🔍 [buttonActions] 저장할 데이터:", dataWithUserInfo);
|
||||
|
||||
saveResult = await DynamicFormApi.saveFormData({
|
||||
screenId,
|
||||
tableName,
|
||||
|
|
|
|||
Loading…
Reference in New Issue