Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/suitable
This commit is contained in:
commit
db2daf8ba0
@ -19,73 +19,39 @@ model User {
|
||||
updated_at DateTime @updatedAt
|
||||
}
|
||||
|
||||
// 지붕재 적합성 정보
|
||||
model MS_SUITABLE {
|
||||
//일련번호
|
||||
id Int @id @default(autoincrement())
|
||||
//제품명
|
||||
product_name String @db.VarChar(200)
|
||||
//제조업체명
|
||||
manufacturer String? @db.VarChar(200)
|
||||
//지붕재
|
||||
roof_material String? @db.VarChar(100)
|
||||
//금구형태(쇠붙이형)
|
||||
shape String? @db.VarChar(200)
|
||||
//지지 기와
|
||||
support_roof_tile String? @db.VarChar(2)
|
||||
//지지 기와 메모
|
||||
support_roof_tile_memo String? @db.VarChar(500)
|
||||
//지지 금구
|
||||
support_roof_bracket String? @db.VarChar(200)
|
||||
//지지 금구 메모
|
||||
support_roof_bracket_memo String? @db.VarChar(500)
|
||||
//yg 앵커
|
||||
yg_anchor String? @db.VarChar(200)
|
||||
//yg 앵커 메모
|
||||
yg_anchor_memo String? @db.VarChar(500)
|
||||
//rg 지붕판
|
||||
rg_roof_tile_part String? @db.VarChar(200)
|
||||
//rg 지붕판 메모
|
||||
rg_roof_tile_part_memo String? @db.VarChar(500)
|
||||
//다이도헌트 지지 기와2
|
||||
dido_hunt_support_tile_2 String? @db.VarChar(200)
|
||||
//다이도헌트 지지 기와2 메모
|
||||
dido_hunt_support_tile_2_memo String? @db.VarChar(500)
|
||||
//타카시마 파워 베이스
|
||||
takashima_power_base String? @db.VarChar(200)
|
||||
//타카시마 파워 베이스 메모
|
||||
takashima_power_base_memo String? @db.VarChar(500)
|
||||
//타카시마용 금구
|
||||
takashima_tile_bracket String? @db.VarChar(200)
|
||||
//타카시마용 금구 메모
|
||||
takashima_tile_bracket_memo String? @db.VarChar(500)
|
||||
//슬레이트 금구4
|
||||
slate_bracket_4 String? @db.VarChar(200)
|
||||
//슬레이트 금구4 메모
|
||||
slate_bracket_4_memo String? @db.VarChar(500)
|
||||
//슬레이트 판금 금구(슬레이트, 싱글)
|
||||
slate_single_metal_bracket String? @db.VarChar(200)
|
||||
//슬레이트 판금 금구 메모(슬레이트, 싱글)
|
||||
slate_single_metal_bracket_memo String? @db.VarChar(500)
|
||||
//다이도헌트 짧은 트랙4
|
||||
dido_hunt_short_rack_4 String? @db.VarChar(200)
|
||||
//다이도헌트 짧은 트랙4 메모
|
||||
dido_hunt_short_rack_4_memo String? @db.VarChar(500)
|
||||
//타카시마 슬레이트 금구
|
||||
takashima_slate_bracket_slate_single String? @db.VarChar(200)
|
||||
//타카시마 슬레이트 금구 메모
|
||||
takashima_slate_bracket_slate_single_memo String? @db.VarChar(500)
|
||||
//df 판금 금구
|
||||
df_metal_bracket String? @db.VarChar(200)
|
||||
//df 판금 금구 메모
|
||||
df_metal_bracket_memo String? @db.VarChar(500)
|
||||
//슬레이트 판금 금구(금속 지붕)
|
||||
slate_metal_bracket String? @db.VarChar(200)
|
||||
//슬레이트 판금 금구(금속 지붕) 메모
|
||||
slate_metal_bracket_memo String? @db.VarChar(500)
|
||||
//타카시마 슬레이트 금구(금속 지붕)
|
||||
takashima_slate_bracket_metal_roof String? @db.VarChar(200)
|
||||
//타카시마 슬레이트 금구(금속 지붕) 메모
|
||||
takashima_slate_bracket_metal_roof_memo String? @db.VarChar(500)
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
@ -151,3 +117,63 @@ model SD_SERVEY_SALES_DETAIL_INFO {
|
||||
basic_info_id Int @unique
|
||||
basic_info SD_SERVEY_SALES_BASIC_INFO @relation(fields: [basic_info_id], references: [id])
|
||||
}
|
||||
|
||||
model BC_COMM_H {
|
||||
HEAD_CD String @id(map: "PK_BC_COMM_H") @db.NVarChar(6)
|
||||
HEAD_ID String @db.NVarChar(100)
|
||||
HEAD_NM String @db.NVarChar(100)
|
||||
HEAD_JP String @db.NVarChar(100)
|
||||
HEAD_4TH String @db.NVarChar(100)
|
||||
REF_CHR1 String @db.NVarChar(100)
|
||||
REF_CHR2 String @db.NVarChar(100)
|
||||
REF_CHR3 String @db.NVarChar(100)
|
||||
REF_CHR4 String @db.NVarChar(100)
|
||||
REF_CHR5 String @db.NVarChar(100)
|
||||
REF_NUM1 String @db.NVarChar(100)
|
||||
REF_NUM2 String @db.NVarChar(100)
|
||||
REF_NUM3 String @db.NVarChar(100)
|
||||
REF_NUM4 String @db.NVarChar(100)
|
||||
REF_NUM5 String @db.NVarChar(100)
|
||||
REMARKS String @db.NVarChar(200)
|
||||
SAP_YN String @db.NVarChar(1)
|
||||
STAT_CD String @db.NVarChar(1)
|
||||
DEL_YN String @db.NVarChar(1)
|
||||
REG_DT DateTime? @db.DateTime
|
||||
REG_ID String @db.NVarChar(50)
|
||||
UPT_DT DateTime? @db.DateTime
|
||||
UPT_ID String @db.NVarChar(50)
|
||||
QC_COMM_YN String? @default("N", map: "DF__BC_COMM_H__QC_CO__48CFD27E") @db.NVarChar(1)
|
||||
BC_COMM_L BC_COMM_L[]
|
||||
|
||||
@@index([HEAD_ID], map: "BC_COMM_H_HEAD_ID_IDX")
|
||||
}
|
||||
|
||||
model BC_COMM_L {
|
||||
HEAD_CD String @db.NVarChar(6)
|
||||
CODE String @db.NVarChar(50)
|
||||
READ_CD String? @db.NVarChar(50)
|
||||
CODE_NM String? @db.NVarChar(100)
|
||||
CODE_JP String? @db.NVarChar(100)
|
||||
CODE_4TH String? @db.NVarChar(100)
|
||||
REF_CHR1 String? @db.NVarChar(150)
|
||||
REF_CHR2 String? @db.NVarChar(150)
|
||||
REF_CHR3 String? @db.NVarChar(150)
|
||||
REF_CHR4 String? @db.NVarChar(150)
|
||||
REF_CHR5 String? @db.NVarChar(150)
|
||||
REF_NUM1 Decimal? @db.Decimal(22, 5)
|
||||
REF_NUM2 Decimal? @db.Decimal(22, 5)
|
||||
REF_NUM3 Decimal? @db.Decimal(22, 5)
|
||||
REF_NUM4 Decimal? @db.Decimal(22, 5)
|
||||
REF_NUM5 Decimal? @db.Decimal(22, 5)
|
||||
PRIORITY Decimal? @db.Decimal(3, 0)
|
||||
REF_CNT String? @db.NVarChar(5)
|
||||
STAT_CD String? @db.NVarChar(1)
|
||||
DEL_YN String? @db.NVarChar(1)
|
||||
REG_DT DateTime? @db.DateTime
|
||||
REG_ID String? @db.NVarChar(50)
|
||||
UPT_DT DateTime? @db.DateTime
|
||||
UPT_ID String? @db.NVarChar(50)
|
||||
BC_COMM_H BC_COMM_H @relation(fields: [HEAD_CD], references: [HEAD_CD], onUpdate: NoAction, map: "FK_BC_COMM_L")
|
||||
|
||||
@@id([HEAD_CD, CODE], map: "PK_BC_COMM_L")
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Header from '@/components/ui/common/Header'
|
||||
|
||||
export default async function page() {
|
||||
return <Header name={'調査物件一覧'} />
|
||||
return <Header />
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ export async function POST(request: Request) {
|
||||
loginId,
|
||||
pwd,
|
||||
})
|
||||
console.log('🚀 ~ result ~ result:', result)
|
||||
// console.log('🚀 ~ result ~ result:', result)
|
||||
|
||||
if (result.data.result.code === 200) {
|
||||
const cookieStore = await cookies()
|
||||
@ -54,5 +54,5 @@ export async function POST(request: Request) {
|
||||
await session.save()
|
||||
}
|
||||
|
||||
return NextResponse.json({ code: 200, message: 'Login is Succecss!!' })
|
||||
return NextResponse.json({ code: 200, message: 'Login is Succecss!!', result: result.data.data })
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
export default function layout({ children }: { children: React.ReactNode }) {
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
export default function layout({ children }: { children: ReactNode }) {
|
||||
return <div className="container">{children}</div>
|
||||
}
|
||||
|
||||
23
src/app/pw-reset/layout.tsx
Normal file
23
src/app/pw-reset/layout.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
interface PwResetLayoutProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export default function layout({ children }: PwResetLayoutProps) {
|
||||
return (
|
||||
<>
|
||||
<div className="container">
|
||||
<div className="sale-contents">
|
||||
<div className="border-frame">
|
||||
<div className="pw-guide">
|
||||
<div className="pw-guide-tit">パスワードをリセットする</div>
|
||||
<div className="pw-guide-txt">新しいパスワードを入力してください.</div>
|
||||
</div>
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
9
src/app/pw-reset/page.tsx
Normal file
9
src/app/pw-reset/page.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import PwResetForm from '@/components/pw-reset/PwResetForm'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<>
|
||||
<PwResetForm />
|
||||
</>
|
||||
)
|
||||
}
|
||||
240
src/app/sample/page.tsx
Normal file
240
src/app/sample/page.tsx
Normal file
@ -0,0 +1,240 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
|
||||
export default function page() {
|
||||
const [fileName, setFileName] = useState<File | null>(null) //file name value
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="form-design-wrap">
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Input</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<input className="input-frame" type="text" placeholder="Input Frame Text" />
|
||||
<input className="input-frame" type="number" placeholder="Input Frame Number" />
|
||||
<input className="input-frame" type="password" placeholder="Input Frame Password" />
|
||||
<input className="input-frame" type="email" placeholder="Input Frame Email" />
|
||||
<input className="input-frame" type="text" placeholder="Input Frame Disabled" defaultValue={'defaultValue'} disabled />
|
||||
<input className="input-frame" type="text" placeholder="Input Frame ReadOnly" readOnly />
|
||||
<div className="filebox">
|
||||
<label className="btn-frame l-blue icon" htmlFor="file">
|
||||
<i className="btn-clip"></i>Upload File
|
||||
</label>
|
||||
<input type="file" id="file" onChange={(e) => setFileName(e.target.files?.[0] ?? null)} />
|
||||
</div>
|
||||
<div className="search-input">
|
||||
<input type="text" className="search-frame" placeholder="Input Frame Search" />
|
||||
<button className="search-icon"></button>
|
||||
</div>
|
||||
<div className="date-input">
|
||||
<button className="date-btn">
|
||||
<i className="date-icon"></i>
|
||||
</button>
|
||||
<input type="text" className="date-frame" placeholder="Input Frame Date" />
|
||||
</div>
|
||||
<div className="login-input id">
|
||||
<input type="text" className="login-frame" placeholder="Input Frame ID" />
|
||||
<button className="login-icon">
|
||||
<i className="del-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div className="login-input pw">
|
||||
<input type="password" className="login-frame" placeholder="Input Frame PW" />
|
||||
<button className="login-icon act">
|
||||
<i className="show-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div className="login-input pw change">
|
||||
<input type="password" className="login-frame" placeholder="Input Frame PW" />
|
||||
<button className="login-icon act">
|
||||
<i className="show-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Button</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<button className="btn-frame d-blue min">Block Button</button>
|
||||
<button className="btn-frame n-blue min">Block Button</button>
|
||||
<button className="btn-frame red min">Block Button</button>
|
||||
<button className="btn-frame d-blue">Block Button</button>
|
||||
<button className="btn-frame n-blue">Block Button</button>
|
||||
<button className="btn-frame l-blue">Block Button</button>
|
||||
<button className="btn-frame red">Block Button</button>
|
||||
<button className="btn-frame d-blue icon">
|
||||
Block Icon Button<i className="btn-arr"></i>
|
||||
</button>
|
||||
<button className="btn-frame n-blue icon">
|
||||
Block Icon Button<i className="btn-arr"></i>
|
||||
</button>
|
||||
<button className="btn-frame n-blue icon">
|
||||
Block Icon Button<i className="btn-edit"></i>
|
||||
</button>
|
||||
<button className="btn-frame red icon">
|
||||
Block Icon Button<i className="btn-arr"></i>
|
||||
</button>
|
||||
<button className="btn-frame l-blue icon">
|
||||
<i className="btn-clip"></i>Block Icon Button
|
||||
</button>
|
||||
<button className="btn-frame icon login">
|
||||
Block Big Button <i className="btn-arr"></i>
|
||||
</button>
|
||||
<button className="btn-frame" disabled>
|
||||
Block Button
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Check Box</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch01" />
|
||||
<label htmlFor="ch01">Check Box</label>
|
||||
</div>
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch02" />
|
||||
<label htmlFor="ch02">Check Box</label>
|
||||
</div>
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch03" defaultChecked />
|
||||
<label htmlFor="ch03">Check Box</label>
|
||||
</div>
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch04" defaultChecked />
|
||||
<label htmlFor="ch04">Check Box</label>
|
||||
</div>
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch05" disabled />
|
||||
<label htmlFor="ch05">Check Box</label>
|
||||
</div>
|
||||
<div className="check-form-box">
|
||||
<input type="checkbox" id="ch06" disabled />
|
||||
<label htmlFor="ch06">Check Box</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Radio Button</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<div className="radio-form-box">
|
||||
<input type="radio" name="radio01" id="ra01" />
|
||||
<label htmlFor="ra01">Radio Button</label>
|
||||
</div>
|
||||
<div className="radio-form-box">
|
||||
<input type="radio" name="radio01" id="ra02" defaultChecked />
|
||||
<label htmlFor="ra02">Radio Button</label>
|
||||
</div>
|
||||
<div className="radio-form-box">
|
||||
<input type="radio" name="radio03" id="ra05" disabled />
|
||||
<label htmlFor="ra05">Radio Button</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Toggle Button</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<div>
|
||||
<label className="toggle-btn">
|
||||
<input type="checkbox" />
|
||||
<span className="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="toggle-form">
|
||||
<label className="toggle-btn">
|
||||
<input type="checkbox" />
|
||||
<span className="slider"></span>
|
||||
</label>
|
||||
<div className="toggle-name">Q.PARTNERS</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">Select Box</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<select className="select-form" name="" id="">
|
||||
<option value="">Select01</option>
|
||||
<option value="">Select02</option>
|
||||
<option value="">Select03</option>
|
||||
<option value="">Select04</option>
|
||||
<option value="">Select05</option>
|
||||
</select>
|
||||
<select className="select-form" name="" id="" disabled>
|
||||
<option value="">Select01</option>
|
||||
<option value="">Select02</option>
|
||||
<option value="">Select03</option>
|
||||
<option value="">Select04</option>
|
||||
<option value="">Select05</option>
|
||||
</select>
|
||||
<div className="select-flex-form">
|
||||
<select className="select-form" name="" id="">
|
||||
<option value="">Select01</option>
|
||||
<option value="">Select02</option>
|
||||
<option value="">Select03</option>
|
||||
<option value="">Select04</option>
|
||||
<option value="">Select05</option>
|
||||
</select>
|
||||
<select className="select-form" name="" id="">
|
||||
<option value="">Select01</option>
|
||||
<option value="">Select02</option>
|
||||
<option value="">Select03</option>
|
||||
<option value="">Select04</option>
|
||||
<option value="">Select05</option>
|
||||
</select>
|
||||
<select className="select-form" name="" id="" disabled>
|
||||
<option value="">Select01</option>
|
||||
<option value="">Select02</option>
|
||||
<option value="">Select03</option>
|
||||
<option value="">Select04</option>
|
||||
<option value="">Select05</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="design-box">
|
||||
<h1 className="tit">TextArea</h1>
|
||||
<div className="design-grid-wrap">
|
||||
<textarea className="textarea-form" name="" id="" placeholder="TextArea Filed"></textarea>
|
||||
<textarea className="textarea-form" name="" id="" disabled></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<style jsx>
|
||||
{`
|
||||
.form-design-wrap {
|
||||
max-width: 1300px;
|
||||
margin: 0px auto;
|
||||
padding: 25px 20px;
|
||||
}
|
||||
.design-box {
|
||||
padding: 15px;
|
||||
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.tit {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
border-bottom: 1px solid #000;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.design-grid-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 20px;
|
||||
gap: 10px;
|
||||
}
|
||||
.icon-bx {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-right: 5px;
|
||||
background-color: #000;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
interface SuitableLayoutProps {
|
||||
children: ReactNode
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
interface SurveySaleLayoutProps {
|
||||
children: ReactNode
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
'use client'
|
||||
|
||||
import { useReducer, useState } from 'react'
|
||||
import type { SessionData } from '@/types/Auth'
|
||||
import { useEffect, useReducer, useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { axiosInstance } from '@/libs/axios'
|
||||
import { useSessionStore } from '@/store/session'
|
||||
|
||||
interface AccountState {
|
||||
loginId: string
|
||||
@ -21,6 +23,8 @@ export default function Login() {
|
||||
//로그인 상태
|
||||
const [isLogin, setIsLogin] = useState(false)
|
||||
|
||||
const { session, setSession } = useSessionStore()
|
||||
|
||||
const reducer = (state: AccountState, newState: Partial<AccountState>) => ({ ...state, ...newState })
|
||||
const [account, setAccount] = useReducer(reducer, {
|
||||
loginId: '',
|
||||
@ -30,6 +34,7 @@ export default function Login() {
|
||||
interface LoginData {
|
||||
code: number
|
||||
message: string | null
|
||||
result: SessionData
|
||||
}
|
||||
|
||||
const {
|
||||
@ -43,7 +48,7 @@ export default function Login() {
|
||||
loginId: account.loginId,
|
||||
pwd: account.pwd,
|
||||
})
|
||||
router.push('/')
|
||||
// router.push('/')
|
||||
|
||||
return data
|
||||
},
|
||||
@ -52,6 +57,17 @@ export default function Login() {
|
||||
retry: false,
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
setIsLogin(false)
|
||||
if (loginData?.code === 200) {
|
||||
setSession({
|
||||
...session,
|
||||
...loginData?.result,
|
||||
})
|
||||
router.push('/')
|
||||
}
|
||||
}, [loginData])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="login-form-wrap">
|
||||
|
||||
59
src/components/pw-reset/PwResetForm.tsx
Normal file
59
src/components/pw-reset/PwResetForm.tsx
Normal file
@ -0,0 +1,59 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
|
||||
export default function PwResetForm() {
|
||||
const [pwShow01, setPwShow01] = useState(false) //비밀번호 확인 보이기 숨기기
|
||||
const [pwShow02, setPwShow02] = useState(false) //비밀번호 재확인 보이기 숨기기
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="border-frame">
|
||||
<div className="data-form-wrap">
|
||||
<div className="data-input-form-bx">
|
||||
<div className="data-input-form-tit">
|
||||
新規パスワード再入力 <i className="import">*</i>
|
||||
</div>
|
||||
<div className="data-input">
|
||||
<div className="login-input pw change">
|
||||
<input type={`${pwShow01 ? 'text' : 'password'}`} className="login-frame" placeholder="●●●●" />
|
||||
<button className={`login-icon ${pwShow01 ? 'act' : ''}`} onClick={() => setPwShow01(!pwShow01)}>
|
||||
<i className="show-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="data-input-guide">10文字以内</div>
|
||||
</div>
|
||||
<div className="data-input-form-bx">
|
||||
<div className="data-input-form-tit">
|
||||
新規パスワード入力 <i className="import">*</i>
|
||||
</div>
|
||||
<div className="data-input">
|
||||
<div className="login-input pw change">
|
||||
<input type={`${pwShow02 ? 'text' : 'password'}`} className="login-frame" placeholder="●●●●" />
|
||||
<button className={`login-icon ${pwShow02 ? 'act' : ''}`} onClick={() => setPwShow02(!pwShow02)}>
|
||||
<i className="show-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="data-input-guide">10文字以内</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="btn-flex-wrap">
|
||||
<div className="btn-bx">
|
||||
<button className="btn-frame n-blue icon" onClick={() => router.back()}>
|
||||
戻る<i className="btn-arr"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div className="btn-bx">
|
||||
<button className="btn-frame red icon">
|
||||
リセットする<i className="btn-arr"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@ -1,17 +1,26 @@
|
||||
'use client'
|
||||
|
||||
import { usePopupController } from '@/store/popupController'
|
||||
import React from 'react'
|
||||
|
||||
export default function DoubleBtnAlert() {
|
||||
const { alertMsg, alert2BtnYes, alert2BtnNo } = usePopupController()
|
||||
|
||||
return (
|
||||
<div className="modal-popup alert">
|
||||
<div className="modal-dialog">
|
||||
<div className="modal-content">
|
||||
<div className="alert-tit">本当に削除しますか?</div>
|
||||
<div className="alert-tit">{alertMsg}</div>
|
||||
<div className="alert-btn-wrap">
|
||||
<div className="alert-btn-bx">
|
||||
<button className="btn-frame red min">確認</button>
|
||||
<button className="btn-frame red min" onClick={() => alert2BtnYes()}>
|
||||
確認
|
||||
</button>
|
||||
</div>
|
||||
<div className="alert-btn-bx">
|
||||
<button className="btn-frame n-blue min">キャンセル</button>
|
||||
<button className="btn-frame n-blue min" onClick={() => alert2BtnNo()}>
|
||||
キャンセル
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -4,33 +4,36 @@ import Link from 'next/link'
|
||||
import { usePathname, useRouter } from 'next/navigation'
|
||||
|
||||
import { Swiper, SwiperSlide } from 'swiper/react'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
|
||||
import { useSideNavState } from '@/store/sideNavState'
|
||||
import { useHeaderStore } from '@/store/header'
|
||||
import { useSessionStore } from '@/store/session'
|
||||
import { useTitle } from '@/hooks/useTitle'
|
||||
|
||||
import type { HeaderProps } from '@/types/Header'
|
||||
|
||||
import 'swiper/css'
|
||||
import { axiosInstance } from '@/libs/axios'
|
||||
|
||||
// type HeaderProps = {
|
||||
// name: string //header 이름
|
||||
// backBtn: boolean // 뒤로가기 버튼 유무
|
||||
// }
|
||||
import 'swiper/css'
|
||||
|
||||
export default function Header({ name }: HeaderProps) {
|
||||
export default function Header() {
|
||||
const router = useRouter()
|
||||
const pathname = usePathname()
|
||||
const { sideNavIsOpen, setSideNavIsOpen } = useSideNavState()
|
||||
const { backBtn } = useHeaderStore()
|
||||
const { getTitle } = useTitle()
|
||||
|
||||
const { session, reset } = useSessionStore()
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
if (pathname === '/login') {
|
||||
return null
|
||||
}
|
||||
|
||||
const handleLogout = async () => {
|
||||
reset()
|
||||
const { data } = await axiosInstance(null).get('/api/auth/logout')
|
||||
if (data.code === 200) {
|
||||
queryClient.clear()
|
||||
router.push('/login')
|
||||
}
|
||||
}
|
||||
@ -46,7 +49,7 @@ export default function Header({ name }: HeaderProps) {
|
||||
</div>
|
||||
)}
|
||||
<h2 className="logo">
|
||||
<Link href={'/'}>{name}</Link>
|
||||
<Link href={'/'}>{getTitle(pathname)}</Link>
|
||||
</h2>
|
||||
<div className="side-button-wrap">
|
||||
<button className="side-button" onClick={() => setSideNavIsOpen(true)}></button>
|
||||
@ -60,8 +63,8 @@ export default function Header({ name }: HeaderProps) {
|
||||
<img src="/assets/images/layout/side_nav_profile.svg" alt="profile" />
|
||||
</div>
|
||||
<div className="profile-group">
|
||||
<div className="profile-name">HONG GILDONG</div>
|
||||
<div className="profile-company">Interplug corp.</div>
|
||||
<div className="profile-name">{session.userNm}</div>
|
||||
<div className="profile-company">{session.category}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="side-close-wrap">
|
||||
@ -105,7 +108,7 @@ export default function Header({ name }: HeaderProps) {
|
||||
<button onClick={() => router.push('/inquiry/regist')}>1:1お問い合わせ登録</button>
|
||||
</li>
|
||||
<li className="side-nav-item">
|
||||
<button>パスワードリセット</button>
|
||||
<button onClick={() => router.push('/pw-reset')}>パスワードリセット</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
37
src/hooks/useTitle.ts
Normal file
37
src/hooks/useTitle.ts
Normal file
@ -0,0 +1,37 @@
|
||||
export const useTitle = () => {
|
||||
const getTitle = (pathname: string) => {
|
||||
// Handle dynamic routes first
|
||||
if (pathname.startsWith('/survey-sale/') && pathname !== '/survey-sale/basic-info' && pathname !== '/survey-sale/roof-info') {
|
||||
return '調査物件一覧'
|
||||
}
|
||||
|
||||
if (pathname.startsWith('/inquiry/') && pathname !== '/inquiry/list' && pathname !== '/inquiry/regist') {
|
||||
return '1:1お問い合わせ詳細'
|
||||
}
|
||||
|
||||
// Handle static routes
|
||||
switch (pathname) {
|
||||
case '/':
|
||||
return 'Hanasys 現地調査'
|
||||
case '/suitable':
|
||||
return '屋根材適合性の確認'
|
||||
case '/survey-sale':
|
||||
return '調査物件一覧'
|
||||
case '/survey-sale/basic-info':
|
||||
return '調査物件登録'
|
||||
case '/survey-sale/roof-info':
|
||||
return '調査物件新規登録'
|
||||
case '/inquiry/list':
|
||||
return '1:1お問い合わせ'
|
||||
case '/inquiry/regist':
|
||||
return '1:1お問い合わせ'
|
||||
case '/pw-reset':
|
||||
return 'パスワードリセット'
|
||||
|
||||
default:
|
||||
return 'Hanasys 現地調査'
|
||||
}
|
||||
}
|
||||
|
||||
return { getTitle }
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useAlertSwitch } from '@/store/alertSwitch'
|
||||
import { useHeaderStore } from '@/store/header'
|
||||
import { usePopupController } from '@/store/popupController'
|
||||
import { useSideNavState } from '@/store/sideNavState'
|
||||
@ -17,6 +18,7 @@ export default function EdgeProvider({ children }: React.PropsWithChildren) {
|
||||
const { setBackBtn } = useHeaderStore()
|
||||
const { reset } = useSideNavState()
|
||||
const { setAlertMsg, setAlertBtn, setAlert, setAlert2, setAlert2BtnYes, setAlert2BtnNo } = usePopupController()
|
||||
const { alertKind } = useAlertSwitch()
|
||||
|
||||
const alertFunc = (msg: string, alertBtn: Function) => {
|
||||
console.log('🚀 ~ alertFunc ~ msg:', msg)
|
||||
@ -38,15 +40,18 @@ export default function EdgeProvider({ children }: React.PropsWithChildren) {
|
||||
setAlert2(true)
|
||||
}
|
||||
|
||||
//alert 함수 변경해서 바인딩
|
||||
useEffect(() => {
|
||||
if (alertKind === 'single') {
|
||||
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
||||
alertFunc(msg, alertBtn)
|
||||
}
|
||||
|
||||
window.alert2 = function (msg, alert2BtnYes = () => setAlert2(false), alert2BtnNo = () => setAlert2(false)) {
|
||||
} else if (alertKind === 'multi') {
|
||||
window.alert = function (msg, alert2BtnYes = () => setAlert2(false), alert2BtnNo = () => setAlert2(false)) {
|
||||
alertFunc2(msg, alert2BtnYes, alert2BtnNo)
|
||||
}
|
||||
}, [])
|
||||
}
|
||||
}, [alertKind])
|
||||
|
||||
/**
|
||||
* 헤더 뒤로가기 버튼 컨트롤
|
||||
|
||||
21
src/store/alertSwitch.ts
Normal file
21
src/store/alertSwitch.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { create } from 'zustand'
|
||||
|
||||
type AlertSwitchState = {
|
||||
alertKind: string
|
||||
setAlertKind: (value: string) => void
|
||||
reset: () => void
|
||||
}
|
||||
|
||||
type InitialState = {
|
||||
alertKind: string
|
||||
}
|
||||
|
||||
const initialState: InitialState = {
|
||||
alertKind: 'single',
|
||||
}
|
||||
|
||||
export const useAlertSwitch = create<AlertSwitchState>((set) => ({
|
||||
...initialState,
|
||||
setAlertKind: (value: string) => set((state) => ({ ...state, alertKind: value })),
|
||||
reset: () => set(initialState),
|
||||
}))
|
||||
51
src/store/session.ts
Normal file
51
src/store/session.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import type { SessionData } from '@/types/Auth'
|
||||
import { create } from 'zustand'
|
||||
|
||||
type SessionState = {
|
||||
session: SessionData
|
||||
setSession: (session: SessionData) => void
|
||||
reset: () => void
|
||||
}
|
||||
|
||||
type InitialState = {
|
||||
session: SessionData
|
||||
}
|
||||
|
||||
const initialState: InitialState = {
|
||||
session: {
|
||||
langCd: null,
|
||||
currPage: 0,
|
||||
rowCount: 0,
|
||||
startRow: null,
|
||||
endRow: null,
|
||||
compCd: null,
|
||||
agencyStoreId: null,
|
||||
storeId: null,
|
||||
userId: null,
|
||||
category: null,
|
||||
userNm: null,
|
||||
userNmKana: null,
|
||||
telNo: null,
|
||||
fax: null,
|
||||
email: null,
|
||||
lastEditUser: null,
|
||||
storeGubun: null,
|
||||
pwCurr: null,
|
||||
pwdInitYn: null,
|
||||
apprStatCd: null,
|
||||
loginFailCnt: 0,
|
||||
loginFailMinYn: null,
|
||||
priceViewStatCd: null,
|
||||
groupId: null,
|
||||
storeLvl: null,
|
||||
custCd: null,
|
||||
builderNo: null,
|
||||
isLoggedIn: false,
|
||||
},
|
||||
}
|
||||
|
||||
export const useSessionStore = create<SessionState>((set) => ({
|
||||
...initialState,
|
||||
setSession: (value: SessionData) => set((state) => ({ ...state, session: { ...state.session, ...value } })),
|
||||
reset: () => set(initialState),
|
||||
}))
|
||||
Loading…
x
Reference in New Issue
Block a user