Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/survey
This commit is contained in:
commit
cacf351a7c
@ -5,3 +5,13 @@ NEXT_PUBLIC_API_URL=http://localhost:3000
|
||||
|
||||
#qsp 로그인 api
|
||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||
|
||||
#1:1문의 api
|
||||
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||
|
||||
#QPARTNER 로그인 api
|
||||
DB_HOST=asdf
|
||||
DB_USER=asdf
|
||||
DB_PASSWORD=asdf
|
||||
DB_DATABASE=asdf
|
||||
DB_PORT=3306
|
||||
@ -3,3 +3,13 @@ NEXT_PUBLIC_API_URL=http://172.30.1.35:3000
|
||||
|
||||
#qsp 로그인 api
|
||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||
|
||||
#1:1문의 api
|
||||
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||
|
||||
#QPARTNER 로그인 api
|
||||
DB_HOST=asdf
|
||||
DB_USER=asdf
|
||||
DB_PASSWORD=asdf
|
||||
DB_DATABASE=asdf
|
||||
DB_PORT=3306
|
||||
@ -9,7 +9,7 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^6.5.0",
|
||||
"@prisma/client": "^6.7.0",
|
||||
"@tanstack/react-query": "^5.71.0",
|
||||
"@tanstack/react-query-devtools": "^5.71.0",
|
||||
"axios": "^1.8.4",
|
||||
@ -29,7 +29,7 @@
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"prisma": "^6.5.0",
|
||||
"prisma": "^6.7.0",
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
}
|
||||
|
||||
78
pnpm-lock.yaml
generated
78
pnpm-lock.yaml
generated
@ -9,8 +9,8 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@prisma/client':
|
||||
specifier: ^6.5.0
|
||||
version: 6.5.0(prisma@6.5.0(typescript@5.8.2))(typescript@5.8.2)
|
||||
specifier: ^6.7.0
|
||||
version: 6.7.0(prisma@6.7.0(typescript@5.8.2))(typescript@5.8.2)
|
||||
'@tanstack/react-query':
|
||||
specifier: ^5.71.0
|
||||
version: 5.71.0(react@19.1.0)
|
||||
@ -64,8 +64,8 @@ importers:
|
||||
specifier: ^19
|
||||
version: 19.0.4(@types/react@19.0.12)
|
||||
prisma:
|
||||
specifier: ^6.5.0
|
||||
version: 6.5.0(typescript@5.8.2)
|
||||
specifier: ^6.7.0
|
||||
version: 6.7.0(typescript@5.8.2)
|
||||
tailwindcss:
|
||||
specifier: ^4
|
||||
version: 4.0.17
|
||||
@ -541,8 +541,8 @@ packages:
|
||||
resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
|
||||
'@prisma/client@6.5.0':
|
||||
resolution: {integrity: sha512-M6w1Ql/BeiGoZmhMdAZUXHu5sz5HubyVcKukbLs3l0ELcQb8hTUJxtGEChhv4SVJ0QJlwtLnwOLgIRQhpsm9dw==}
|
||||
'@prisma/client@6.7.0':
|
||||
resolution: {integrity: sha512-+k61zZn1XHjbZul8q6TdQLpuI/cvyfil87zqK2zpreNIXyXtpUv3+H/oM69hcsFcZXaokHJIzPAt5Z8C8eK2QA==}
|
||||
engines: {node: '>=18.18'}
|
||||
peerDependencies:
|
||||
prisma: '*'
|
||||
@ -553,23 +553,23 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@prisma/config@6.5.0':
|
||||
resolution: {integrity: sha512-sOH/2Go9Zer67DNFLZk6pYOHj+rumSb0VILgltkoxOjYnlLqUpHPAN826vnx8HigqnOCxj9LRhT6U7uLiIIWgw==}
|
||||
'@prisma/config@6.7.0':
|
||||
resolution: {integrity: sha512-di8QDdvSz7DLUi3OOcCHSwxRNeW7jtGRUD2+Z3SdNE3A+pPiNT8WgUJoUyOwJmUr5t+JA2W15P78C/N+8RXrOA==}
|
||||
|
||||
'@prisma/debug@6.5.0':
|
||||
resolution: {integrity: sha512-fc/nusYBlJMzDmDepdUtH9aBsJrda2JNErP9AzuHbgUEQY0/9zQYZdNlXmKoIWENtio+qarPNe/+DQtrX5kMcQ==}
|
||||
'@prisma/debug@6.7.0':
|
||||
resolution: {integrity: sha512-RabHn9emKoYFsv99RLxvfG2GHzWk2ZI1BuVzqYtmMSIcuGboHY5uFt3Q3boOREM9de6z5s3bQoyKeWnq8Fz22w==}
|
||||
|
||||
'@prisma/engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60':
|
||||
resolution: {integrity: sha512-iK3EmiVGFDCmXjSpdsKGNqy9hOdLnvYBrJB61far/oP03hlIxrb04OWmDjNTwtmZ3UZdA5MCvI+f+3k2jPTflQ==}
|
||||
'@prisma/engines-version@6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed':
|
||||
resolution: {integrity: sha512-EvpOFEWf1KkJpDsBCrih0kg3HdHuaCnXmMn7XFPObpFTzagK1N0Q0FMnYPsEhvARfANP5Ok11QyoTIRA2hgJTA==}
|
||||
|
||||
'@prisma/engines@6.5.0':
|
||||
resolution: {integrity: sha512-FVPQYHgOllJklN9DUyujXvh3hFJCY0NX86sDmBErLvoZjy2OXGiZ5FNf3J/C4/RZZmCypZBYpBKEhx7b7rEsdw==}
|
||||
'@prisma/engines@6.7.0':
|
||||
resolution: {integrity: sha512-3wDMesnOxPrOsq++e5oKV9LmIiEazFTRFZrlULDQ8fxdub5w4NgRBoxtWbvXmj2nJVCnzuz6eFix3OhIqsZ1jw==}
|
||||
|
||||
'@prisma/fetch-engine@6.5.0':
|
||||
resolution: {integrity: sha512-3LhYA+FXP6pqY8FLHCjewyE8pGXXJ7BxZw2rhPq+CZAhvflVzq4K8Qly3OrmOkn6wGlz79nyLQdknyCG2HBTuA==}
|
||||
'@prisma/fetch-engine@6.7.0':
|
||||
resolution: {integrity: sha512-zLlAGnrkmioPKJR4Yf7NfW3hftcvqeNNEHleMZK9yX7RZSkhmxacAYyfGsCcqRt47jiZ7RKdgE0Wh2fWnm7WsQ==}
|
||||
|
||||
'@prisma/get-platform@6.5.0':
|
||||
resolution: {integrity: sha512-xYcvyJwNMg2eDptBYFqFLUCfgi+wZLcj6HDMsj0Qw0irvauG4IKmkbywnqwok0B+k+W+p+jThM2DKTSmoPCkzw==}
|
||||
'@prisma/get-platform@6.7.0':
|
||||
resolution: {integrity: sha512-i9IH5lO4fQwnMLvQLYNdgVh9TK3PuWBfQd7QLk/YurnAIg+VeADcZDbmhAi4XBBDD+hDif9hrKyASu0hbjwabw==}
|
||||
|
||||
'@swc/counter@0.1.3':
|
||||
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
|
||||
@ -1187,8 +1187,8 @@ packages:
|
||||
resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
prisma@6.5.0:
|
||||
resolution: {integrity: sha512-yUGXmWqv5F4PByMSNbYFxke/WbnyTLjnJ5bKr8fLkcnY7U5rU9rUTh/+Fja+gOrRxEgtCbCtca94IeITj4j/pg==}
|
||||
prisma@6.7.0:
|
||||
resolution: {integrity: sha512-vArg+4UqnQ13CVhc2WUosemwh6hr6cr6FY2uzDvCIFwH8pu8BXVv38PktoMLVjtX7sbYThxbnZF5YiR8sN2clw==}
|
||||
engines: {node: '>=18.18'}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
@ -1760,38 +1760,38 @@ snapshots:
|
||||
'@parcel/watcher-win32-x64': 2.5.1
|
||||
optional: true
|
||||
|
||||
'@prisma/client@6.5.0(prisma@6.5.0(typescript@5.8.2))(typescript@5.8.2)':
|
||||
'@prisma/client@6.7.0(prisma@6.7.0(typescript@5.8.2))(typescript@5.8.2)':
|
||||
optionalDependencies:
|
||||
prisma: 6.5.0(typescript@5.8.2)
|
||||
prisma: 6.7.0(typescript@5.8.2)
|
||||
typescript: 5.8.2
|
||||
|
||||
'@prisma/config@6.5.0':
|
||||
'@prisma/config@6.7.0':
|
||||
dependencies:
|
||||
esbuild: 0.25.2
|
||||
esbuild-register: 3.6.0(esbuild@0.25.2)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@prisma/debug@6.5.0': {}
|
||||
'@prisma/debug@6.7.0': {}
|
||||
|
||||
'@prisma/engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60': {}
|
||||
'@prisma/engines-version@6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed': {}
|
||||
|
||||
'@prisma/engines@6.5.0':
|
||||
'@prisma/engines@6.7.0':
|
||||
dependencies:
|
||||
'@prisma/debug': 6.5.0
|
||||
'@prisma/engines-version': 6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60
|
||||
'@prisma/fetch-engine': 6.5.0
|
||||
'@prisma/get-platform': 6.5.0
|
||||
'@prisma/debug': 6.7.0
|
||||
'@prisma/engines-version': 6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed
|
||||
'@prisma/fetch-engine': 6.7.0
|
||||
'@prisma/get-platform': 6.7.0
|
||||
|
||||
'@prisma/fetch-engine@6.5.0':
|
||||
'@prisma/fetch-engine@6.7.0':
|
||||
dependencies:
|
||||
'@prisma/debug': 6.5.0
|
||||
'@prisma/engines-version': 6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60
|
||||
'@prisma/get-platform': 6.5.0
|
||||
'@prisma/debug': 6.7.0
|
||||
'@prisma/engines-version': 6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed
|
||||
'@prisma/get-platform': 6.7.0
|
||||
|
||||
'@prisma/get-platform@6.5.0':
|
||||
'@prisma/get-platform@6.7.0':
|
||||
dependencies:
|
||||
'@prisma/debug': 6.5.0
|
||||
'@prisma/debug': 6.7.0
|
||||
|
||||
'@swc/counter@0.1.3': {}
|
||||
|
||||
@ -2421,10 +2421,10 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
prisma@6.5.0(typescript@5.8.2):
|
||||
prisma@6.7.0(typescript@5.8.2):
|
||||
dependencies:
|
||||
'@prisma/config': 6.5.0
|
||||
'@prisma/engines': 6.5.0
|
||||
'@prisma/config': 6.7.0
|
||||
'@prisma/engines': 6.7.0
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
typescript: 5.8.2
|
||||
|
||||
@ -57,65 +57,65 @@ model MS_SUITABLE {
|
||||
updated_at DateTime @updatedAt
|
||||
}
|
||||
|
||||
model SD_SERVEY_SALES_BASIC_INFO {
|
||||
id Int @id @default(autoincrement())
|
||||
representative String @db.VarChar(200)
|
||||
store String? @db.VarChar(200)
|
||||
construction_point String? @db.VarChar(200)
|
||||
investigation_date String? @db.VarChar(10)
|
||||
building_name String? @db.VarChar(200)
|
||||
customer_name String? @db.VarChar(200)
|
||||
post_code String? @db.VarChar(10)
|
||||
address String? @db.VarChar(200)
|
||||
address_detail String? @db.VarChar(300)
|
||||
submission_status Boolean @default(false)
|
||||
submission_date DateTime? @db.Date
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
detail_info SD_SERVEY_SALES_DETAIL_INFO?
|
||||
model SD_SURVEY_SALES_BASIC_INFO {
|
||||
ID Int @id @default(autoincrement())
|
||||
REPRESENTATIVE String @db.VarChar(200)
|
||||
STORE String? @db.VarChar(200)
|
||||
CONSTRUCTION_POINT String? @db.VarChar(200)
|
||||
INVESTIGATION_DATE String? @db.VarChar(10)
|
||||
BUILDING_NAME String? @db.VarChar(200)
|
||||
CUSTOMER_NAME String? @db.VarChar(200)
|
||||
POST_CODE String? @db.VarChar(10)
|
||||
ADDRESS String? @db.VarChar(200)
|
||||
ADDRESS_DETAIL String? @db.VarChar(300)
|
||||
SUBMISSION_STATUS Boolean @default(false)
|
||||
SUBMISSION_DATE DateTime? @db.Date
|
||||
REG_DT DateTime @default(now())
|
||||
UPT_DT DateTime @updatedAt
|
||||
DETAIL_INFO SD_SURVEY_SALES_DETAIL_INFO?
|
||||
}
|
||||
|
||||
model SD_SERVEY_SALES_DETAIL_INFO {
|
||||
id Int @id @default(autoincrement())
|
||||
contract_capacity String? @db.VarChar(20)
|
||||
retail_company String? @db.VarChar(100)
|
||||
supplementary_facilities String? @db.VarChar(20)
|
||||
supplementary_facilities_etc String? @db.VarChar(200)
|
||||
installation_system Int?
|
||||
installation_system_etc String? @db.VarChar(200)
|
||||
construction_year Int?
|
||||
construction_year_etc String? @db.VarChar(200)
|
||||
roof_material String? @db.VarChar(20)
|
||||
roof_material_etc String? @db.VarChar(200)
|
||||
roof_shape Int?
|
||||
roof_shape_etc String? @db.VarChar(200)
|
||||
roof_slope String? @db.VarChar(5)
|
||||
house_structure Int?
|
||||
house_structure_etc String? @db.VarChar(200)
|
||||
rafter_material Int?
|
||||
rafter_material_etc String? @db.VarChar(200)
|
||||
rafter_size Int?
|
||||
rafter_size_etc String? @db.VarChar(200)
|
||||
rafter_pitch Int?
|
||||
rafter_pitch_etc String? @db.VarChar(200)
|
||||
rafter_direction Int?
|
||||
open_field_plate_kind Int?
|
||||
open_field_plate_kind_etc String? @db.VarChar(200)
|
||||
open_field_plate_thickness String? @db.VarChar(5)
|
||||
leak_trace Boolean? @default(false)
|
||||
waterproof_material Int?
|
||||
waterproof_material_etc String? @db.VarChar(200)
|
||||
insulation_presence Int?
|
||||
insulation_presence_etc String? @db.VarChar(200)
|
||||
structure_order Int?
|
||||
structure_order_etc String? @db.VarChar(200)
|
||||
installation_availability Int?
|
||||
installation_availability_etc String? @db.VarChar(200)
|
||||
memo String? @db.VarChar(500)
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
basic_info_id Int @unique
|
||||
basic_info SD_SERVEY_SALES_BASIC_INFO @relation(fields: [basic_info_id], references: [id])
|
||||
model SD_SURVEY_SALES_DETAIL_INFO {
|
||||
ID Int @id @default(autoincrement())
|
||||
CONTRACT_CAPACITY String? @db.VarChar(20)
|
||||
RETAIL_COMPANY String? @db.VarChar(100)
|
||||
SUPPLEMENTARY_FACILITIES String? @db.VarChar(20)
|
||||
SUPPLEMENTARY_FACILITIES_ETC String? @db.VarChar(200)
|
||||
INSTALLATION_SYSTEM String? @db.VarChar(20)
|
||||
INSTALLATION_SYSTEM_ETC String? @db.VarChar(200)
|
||||
CONSTRUCTION_YEAR String? @db.VarChar(200)
|
||||
CONSTRUCTION_YEAR_ETC String? @db.VarChar(200)
|
||||
ROOF_MATERIAL String? @db.VarChar(20)
|
||||
ROOF_MATERIAL_ETC String? @db.VarChar(200)
|
||||
ROOF_SHAPE String? @db.VarChar(20)
|
||||
ROOF_SHAPE_ETC String? @db.VarChar(200)
|
||||
ROOF_SLOPE String? @db.VarChar(5)
|
||||
HOUSE_STRUCTURE String? @db.VarChar(20)
|
||||
HOUSE_STRUCTURE_ETC String? @db.VarChar(200)
|
||||
RAFTER_MATERIAL String? @db.VarChar(20)
|
||||
RAFTER_MATERIAL_ETC String? @db.VarChar(200)
|
||||
RAFTER_SIZE String? @db.VarChar(20)
|
||||
RAFTER_SIZE_ETC String? @db.VarChar(200)
|
||||
RAFTER_PITCH String? @db.VarChar(20)
|
||||
RAFTER_PITCH_ETC String? @db.VarChar(200)
|
||||
RAFTER_DIRECTION String? @db.VarChar(20)
|
||||
OPEN_FIELD_PLATE_KIND String? @db.VarChar(20)
|
||||
OPEN_FIELD_PLATE_KIND_ETC String? @db.VarChar(200)
|
||||
OPEN_FIELD_PLATE_THICKNESS String? @db.VarChar(5)
|
||||
LEAK_TRACE Boolean? @default(false)
|
||||
WATERPROOF_MATERIAL String? @db.VarChar(20)
|
||||
WATERPROOF_MATERIAL_ETC String? @db.VarChar(200)
|
||||
INSULATION_PRESENCE String? @db.VarChar(20)
|
||||
INSULATION_PRESENCE_ETC String? @db.VarChar(200)
|
||||
STRUCTURE_ORDER String? @db.VarChar(20)
|
||||
STRUCTURE_ORDER_ETC String? @db.VarChar(200)
|
||||
INSTALLATION_AVAILABILITY String? @db.VarChar(20)
|
||||
INSTALLATION_AVAILABILITY_ETC String? @db.VarChar(200)
|
||||
MEMO String? @db.VarChar(500)
|
||||
REG_DT DateTime @default(now())
|
||||
UPT_DT DateTime @updatedAt
|
||||
BASIC_INFO_ID Int @unique
|
||||
BASIC_INFO SD_SURVEY_SALES_BASIC_INFO @relation(fields: [BASIC_INFO_ID], references: [ID])
|
||||
}
|
||||
|
||||
model BC_COMM_H {
|
||||
@ -177,3 +177,33 @@ model BC_COMM_L {
|
||||
|
||||
@@id([HEAD_CD, CODE], map: "PK_BC_COMM_L")
|
||||
}
|
||||
|
||||
model MS_SUITABLE_ROOF_MATERIAL_GROUP {
|
||||
ID Int @id @default(autoincrement())
|
||||
ROOF_MATERIAL_GROUP String @db.VarChar(200)
|
||||
ROOF_MT_CD String @db.VarChar(200)
|
||||
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__4F7CD00D")
|
||||
UPT_DT DateTime
|
||||
}
|
||||
|
||||
model MS_SUITABLE_DETAIL {
|
||||
ID Int @id @default(autoincrement())
|
||||
MAIN_ID Int
|
||||
TRESTLE_MFPC_CD String? @db.VarChar(200)
|
||||
TRESTLE_MANUFACTURER_PRODUCT_NAME String? @db.VarChar(200)
|
||||
MEMO String? @db.VarChar(500)
|
||||
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__571DF1D5")
|
||||
UPT_DT DateTime?
|
||||
MS_SUITABLE_MAIN MS_SUITABLE_MAIN @relation(fields: [MAIN_ID], references: [ID], onUpdate: NoAction, map: "MS_SUITABLE_DETAIL_MS_SUITABLE_MAIN_FK")
|
||||
}
|
||||
|
||||
model MS_SUITABLE_MAIN {
|
||||
ID Int @id @default(autoincrement())
|
||||
PRODUCT_NAME String @db.VarChar(200)
|
||||
MANU_FT_CD String? @db.VarChar(200)
|
||||
ROOF_MT_CD String? @db.VarChar(100)
|
||||
ROOF_SH_CD String? @db.VarChar(200)
|
||||
REG_DT DateTime @default(now(), map: "DF__MS_SUITAB__creat__5441852A")
|
||||
UPT_DT DateTime?
|
||||
MS_SUITABLE_DETAIL MS_SUITABLE_DETAIL[]
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ export default async function RootLayout({ children, header, footer, floatBtn }:
|
||||
const cookieStore = await cookies()
|
||||
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
||||
|
||||
const sessionData = JSON.stringify(session)
|
||||
const sessionData = session.isLoggedIn ? JSON.stringify(session) : ''
|
||||
|
||||
return (
|
||||
<ReactQueryProviders>
|
||||
|
||||
@ -1,10 +1,19 @@
|
||||
'use client'
|
||||
|
||||
import { usePopupController } from '@/store/popupController'
|
||||
import React from 'react'
|
||||
|
||||
export default function DoubleBtnAlert() {
|
||||
const { alertMsg, alert2BtnYes, alert2BtnNo } = usePopupController()
|
||||
const { alertMsg, alert2BtnYes, alert2BtnNo, setAlert2 } = usePopupController()
|
||||
|
||||
const handleAlert2BtnYes = () => {
|
||||
alert2BtnYes()
|
||||
setAlert2(false)
|
||||
}
|
||||
|
||||
const handleAlert2BtnNo = () => {
|
||||
alert2BtnNo()
|
||||
setAlert2(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="modal-popup alert">
|
||||
@ -13,12 +22,12 @@ export default function DoubleBtnAlert() {
|
||||
<div className="alert-tit">{alertMsg}</div>
|
||||
<div className="alert-btn-wrap">
|
||||
<div className="alert-btn-bx">
|
||||
<button className="btn-frame red min" onClick={() => alert2BtnYes()}>
|
||||
<button className="btn-frame red min" onClick={() => handleAlert2BtnYes()}>
|
||||
確認
|
||||
</button>
|
||||
</div>
|
||||
<div className="alert-btn-bx">
|
||||
<button className="btn-frame n-blue min" onClick={() => alert2BtnNo()}>
|
||||
<button className="btn-frame n-blue min" onClick={() => handleAlert2BtnNo()}>
|
||||
キャンセル
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -14,6 +14,7 @@ import { useTitle } from '@/hooks/useTitle'
|
||||
import { axiosInstance } from '@/libs/axios'
|
||||
|
||||
import 'swiper/css'
|
||||
import { confirmParamsSerialize } from '@/utils/window'
|
||||
|
||||
export default function Header() {
|
||||
const router = useRouter()
|
||||
@ -38,6 +39,22 @@ export default function Header() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleYes = () => {
|
||||
console.log('yes')
|
||||
}
|
||||
|
||||
const handleNo = () => {
|
||||
console.log('no')
|
||||
}
|
||||
|
||||
const handleCofirm = () => {
|
||||
window.neoConfirm(
|
||||
'よろしいですか?',
|
||||
() => console.log('yes'),
|
||||
() => console.log('no'),
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="header-warp">
|
||||
@ -45,7 +62,7 @@ export default function Header() {
|
||||
<div className="header-inner">
|
||||
{backBtn && (
|
||||
<div className="back-button-wrap">
|
||||
<button className="back-button" onClick={() => router.back()}></button>
|
||||
<button className="back-button" onClick={handleCofirm}></button>
|
||||
</div>
|
||||
)}
|
||||
<h2 className="logo">
|
||||
|
||||
30
src/hooks/useSuitable.ts
Normal file
30
src/hooks/useSuitable.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { suitableApi } from '@/api/suitable'
|
||||
|
||||
export function useSuitable() {
|
||||
const getCategories = async () => {
|
||||
try {
|
||||
return await suitableApi.getCategory()
|
||||
} catch (error) {
|
||||
console.error('카테고리 데이터 로드 실패:', error)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
const getSuitables = async () => {
|
||||
try {
|
||||
return await suitableApi.getList()
|
||||
} catch (error) {
|
||||
console.error('지붕재 데이터 로드 실패:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const updateSearchResults = async (selectedCategory: string | undefined, searchValue: string | undefined) => {
|
||||
try {
|
||||
return await suitableApi.getList(selectedCategory, searchValue)
|
||||
} catch (error) {
|
||||
console.error('지붕재 데이터 검색 실패:', error)
|
||||
}
|
||||
}
|
||||
|
||||
return { getCategories, getSuitables, updateSearchResults }
|
||||
}
|
||||
@ -7,6 +7,12 @@ import { usePathname } from 'next/navigation'
|
||||
import { useEffect } from 'react'
|
||||
import { useSessionStore } from '@/store/session'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
neoConfirm: (msg?: string, alertBtn2Yes?: Function, alertBtn2No?: Function) => boolean
|
||||
}
|
||||
}
|
||||
|
||||
interface EdgeProviderProps {
|
||||
children: React.ReactNode
|
||||
sessionData: string
|
||||
@ -44,29 +50,24 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
|
||||
setAlert2(true)
|
||||
}
|
||||
|
||||
//alert 함수 변경해서 바인딩
|
||||
useEffect(() => {
|
||||
//alert 함수 변경해서 바인딩
|
||||
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
||||
alertFunc(msg, alertBtn)
|
||||
}
|
||||
window.confirm = function (msg = '', alert2BtnYes = () => setAlert2(false), alert2BtnNo = () => setAlert2(false)) {
|
||||
alertFunc2(
|
||||
msg,
|
||||
() => {
|
||||
alert2BtnYes()
|
||||
return true
|
||||
},
|
||||
() => {
|
||||
alert2BtnNo()
|
||||
return false
|
||||
},
|
||||
)
|
||||
// confirm 함수 변경해서 바인딩
|
||||
window.neoConfirm = function (msg: string | undefined, alertBtn2Yes?: Function, alertBtn2No?: Function) {
|
||||
if (!msg) return false
|
||||
alertFunc2(msg, alertBtn2Yes || (() => {}), alertBtn2No || (() => {}))
|
||||
return false
|
||||
}
|
||||
setSession({
|
||||
...session,
|
||||
...JSON.parse(sessionData),
|
||||
})
|
||||
// 서버 세션이 있으면 zuatand 세션 데이터 갱신
|
||||
if (sessionData && sessionData !== '') {
|
||||
setSession({
|
||||
...session,
|
||||
...JSON.parse(sessionData),
|
||||
})
|
||||
}
|
||||
}, [])
|
||||
|
||||
/**
|
||||
|
||||
68
src/store/useSuitableStore.ts
Normal file
68
src/store/useSuitableStore.ts
Normal file
@ -0,0 +1,68 @@
|
||||
import { create } from 'zustand'
|
||||
import { Suitable, suitableApi } from '@/api/suitable'
|
||||
|
||||
interface SuitableState {
|
||||
// // 검색 결과 리스트
|
||||
// searchResults: Suitable[]
|
||||
// // 초기 데이터 로드
|
||||
// fetchInitializeData: () => Promise<void>
|
||||
// // 검색 결과 설정
|
||||
// setSearchResults: (results: Suitable[]) => void
|
||||
// // 검색 결과 초기화
|
||||
// resetSearchResults: () => void
|
||||
|
||||
// 선택된 아이템 리스트
|
||||
selectedItems: Suitable[]
|
||||
// 선택된 아이템 추가
|
||||
addSelectedItem: (item: Suitable) => void
|
||||
// 선택된 아이템 제거
|
||||
removeSelectedItem: (itemId: number) => void
|
||||
// 선택된 아이템 모두 제거
|
||||
clearSelectedItems: () => void
|
||||
}
|
||||
|
||||
export const useSuitableStore = create<SuitableState>((set) => ({
|
||||
// // 초기 상태
|
||||
// searchResults: [],
|
||||
|
||||
// // 초기 데이터 로드
|
||||
// fetchInitializeData: async () => {
|
||||
// const suitables = await fetchInitialSuitablee()
|
||||
// set({ searchResults: suitables })
|
||||
// },
|
||||
|
||||
// // 검색 결과 설정
|
||||
// setSearchResults: (results) => set({ searchResults: results }),
|
||||
|
||||
// // 검색 결과 초기화
|
||||
// resetSearchResults: () => set({ searchResults: [] }),
|
||||
|
||||
// 초기 상태
|
||||
selectedItems: [],
|
||||
|
||||
// 선택된 아이템 추가 (중복 방지)
|
||||
addSelectedItem: (item) =>
|
||||
set((state) => ({
|
||||
selectedItems: state.selectedItems.some((i) => i.id === item.id) ? state.selectedItems : [...state.selectedItems, item],
|
||||
})),
|
||||
|
||||
// 선택된 아이템 제거
|
||||
removeSelectedItem: (itemId) =>
|
||||
set((state) => ({
|
||||
selectedItems: state.selectedItems.filter((item) => item.id !== itemId),
|
||||
})),
|
||||
|
||||
// 선택된 아이템 모두 제거
|
||||
clearSelectedItems: () => set({ selectedItems: [] }),
|
||||
}))
|
||||
|
||||
// // 전체 데이터 초기화 함수
|
||||
// async function fetchInitialSuitablee() {
|
||||
// try {
|
||||
// const suitable = await suitableApi.getList()
|
||||
// return suitable
|
||||
// } catch (error) {
|
||||
// console.error('초기 데이터 로드 실패:', error)
|
||||
// return []
|
||||
// }
|
||||
// }
|
||||
7
src/utils/window.ts
Normal file
7
src/utils/window.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export const confirmParamsSerialize = ({ msg, yes, no }: { msg: string; yes: () => void; no: () => void }) => {
|
||||
return JSON.stringify({ msg, yes, no })
|
||||
}
|
||||
|
||||
export const confirmParamsDeserialize = (params: string) => {
|
||||
return JSON.parse(params)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user