[as instl] user-store.ts 에 로그인 사용자 필드 추가 및 등록페이지에서 사용 처리

This commit is contained in:
2026-05-27 17:28:37 +09:00
parent aa213ceead
commit 153f3b7fa7
2 changed files with 46 additions and 26 deletions
@@ -8,7 +8,8 @@ import axios from "axios";
import { type HttpResponse, Upload } from "tus-js-client";
import { AUTH_USER_ID, CLAIM_NAME, ENDPOINT, PROXY_HOST } from "@/shared/config";
import { getCookie, setCookie } from "@/shared/lib";
import { getCookie, setCookie, useAlertStore, useUserStore } from "@/shared/lib";
import type { AcntgSeMngTreeDto } from "@/entities/acntg";
import { acntgService } from "@/entities/acntg";
import type { CklstTreeNode } from "@/entities/cklst";
@@ -27,6 +28,7 @@ import {
type InstlSncnBzScaleSaveDto,
type InstlSncnMng,
} from "@/entities/instl-sncn";
import { Button, Input } from "@common/components";
import "./cnfm-page.css";
@@ -88,6 +90,9 @@ const ReadCell = ({ value }: { value: string | number }) => (
/* ------------------------------------------------------------------ */
function CnfmRegistPage() {
const router = useRouter();
const userInfo = useUserStore((state) => state.userInfo);
const alert = useAlertStore((state) => state.setMessage);
const [docSeComCd] = useState("INSTL");
const [taskSeComCdNm, setTaskSeComCdNm] = useState("재이용수");
const [taskSeComCd, setTaskSeComCd] = useState("RE");
@@ -742,10 +747,10 @@ function CnfmRegistPage() {
<table className="cnfm-form-table">
<tbody>
<tr>
<th>
<th className="text-center align-middle">
<span className="text-red-500">*</span> 사업명
</th>
<td colSpan={3}>
<td>
<div className="flex gap-2">
<Input
placeholder="사업명을 입력하거나 사업찾기를 이용하세요"
@@ -756,12 +761,10 @@ function CnfmRegistPage() {
<button className="cnfm-btn-search whitespace-nowrap">🔍 사업찾기</button>
</div>
</td>
</tr>
<tr>
<th>
<th className="text-center align-middle">
<span className="text-red-500">*</span> 사업기간
</th>
<td colSpan={3}>
<td>
<div className="flex items-center gap-2">
<Input
placeholder="시작연도(YYYY)"
@@ -780,7 +783,7 @@ function CnfmRegistPage() {
</td>
</tr>
<tr>
<th>
<th className="text-center align-middle">
<span className="text-red-500">*</span> 사업내용
</th>
<td colSpan={3}>
@@ -793,19 +796,21 @@ function CnfmRegistPage() {
</td>
</tr>
<tr>
<th>구분</th>
<th className="text-center align-middle">구분</th>
<td>
<div className="flex gap-4 text-[1.3rem]">{taskSeComCdNm}</div>
<input type="hidden" name="taskSeComCd" value={taskSeComCd} />
</td>
<th>신청 지자체</th>
<th className="text-center align-middle">신청 지자체</th>
<td>
<span className="text-[1.3rem] text-gray-500">(로그인 정보 자동 세팅)</span>
<span className="inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500">
{userInfo?.enoNm ?? "\u00A0"}
</span>
</td>
</tr>
<tr>
<th>사업구분</th>
<td>
<th className="text-center align-middle">사업구분</th>
<td colSpan={3}>
<div className="flex gap-4 text-[1.3rem]">
{[
["CNFM", "설치인가"],
@@ -836,27 +841,31 @@ function CnfmRegistPage() {
<table className="cnfm-form-table">
<tbody>
<tr>
<th>신청자 이름</th>
<th rowSpan={2} className="text-center align-middle w-[6.5rem]">신청자</th>
<th className="text-center align-middle">이름</th>
<td>
<span className="text-[1.3rem] text-gray-500">(로그인 사용자 자동 세팅)</span>
<span className="inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500">{userInfo?.userName ?? "\u00A0"}</span>
</td>
<th>전화번호</th>
<th className="text-center align-middle">전화번호</th>
<td>
<span className="text-[1.3rem] text-gray-500">(로그인 사용자 자동 세팅)</span>
<span className="inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500">{userInfo?.mphn ?? userInfo?.telno ?? "\u00A0"}</span>
</td>
</tr>
<tr>
<th>부서</th>
<th className="text-center align-middle">부서</th>
<td>
<span className="text-[1.3rem] text-gray-500">(로그인 사용자 자동 세팅)</span>
<span className="text-[1.3rem] text-gray-500">{userInfo?.instSeNm ?? "\u00A0"}</span>
</td>
<th>이메일</th>
<th className="text-center align-middle">이메일</th>
<td>
<span className="text-[1.3rem] text-gray-500">(로그인 사용자 자동 세팅)</span>
<span className="text-[1.3rem] text-gray-500">{userInfo?.email ?? "\u00A0"}</span>
</td>
</tr>
<tr>
<th>설계자 이름</th>
<th rowSpan={2} className="text-center align-middle">설계자</th>
<th className="text-center align-middle">이름</th>
<td>
<Input
placeholder="설계자 성명"
@@ -865,7 +874,7 @@ function CnfmRegistPage() {
onChange={(e) => setDsgnrNm(e.target.value)}
/>
</td>
<th>전화번호</th>
<th className="text-center align-middle">전화번호</th>
<td>
<Input
placeholder="설계자 전화번호"
@@ -876,16 +885,17 @@ function CnfmRegistPage() {
</td>
</tr>
<tr>
<th>소속(용역사)</th>
<th className="text-center align-middle">소속</th>
<td>
<Input
placeholder="용역사명"
placeholder="소속명"
className="!text-[1.3rem]"
value={dsgnrPsitn}
onChange={(e) => setDsgnrPsitn(e.target.value)}
/>
</td>
<th>이메일</th>
<th className="text-center align-middle">이메일</th>
<td>
<Input
placeholder="설계자 이메일"
+10
View File
@@ -33,6 +33,16 @@ export interface IUserInfo {
naverId: string;
isSocialUser: boolean;
hasPassword: boolean;
aprvYmd: string;
enoCd: string;
instSeCd: string;
dtlInstCd: string;
laeSeNm: string;
ogdpSeNm: string;
instSeNm: string;
userStateNm: string;
enoNm: string;
dtlInstNm: string;
}
export type UserState = {