Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/inquiry
This commit is contained in:
commit
5ba6758a6d
22
package-lock.json
generated
22
package-lock.json
generated
@ -20,6 +20,7 @@
|
|||||||
"react-to-pdf": "^2.0.0",
|
"react-to-pdf": "^2.0.0",
|
||||||
"sass": "^1.87.0",
|
"sass": "^1.87.0",
|
||||||
"swiper": "^11.2.6",
|
"swiper": "^11.2.6",
|
||||||
|
"usehooks-ts": "^3.1.1",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -3293,6 +3294,12 @@
|
|||||||
"url": "https://opencollective.com/parcel"
|
"url": "https://opencollective.com/parcel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/lodash.debounce": {
|
||||||
|
"version": "4.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
||||||
|
"integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/lodash.includes": {
|
"node_modules/lodash.includes": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
||||||
@ -4068,6 +4075,21 @@
|
|||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/usehooks-ts": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/usehooks-ts/-/usehooks-ts-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-I4diPp9Cq6ieSUH2wu+fDAVQO43xwtulo+fKEidHUwZPnYImbtkTjzIJYcDcJqxgmX31GVqNFURodvcgHcW0pA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"lodash.debounce": "^4.0.8"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.15.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^16.8.0 || ^17 || ^18 || ^19 || ^19.0.0-rc"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/utrie": {
|
"node_modules/utrie": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
"react-to-pdf": "^2.0.0",
|
"react-to-pdf": "^2.0.0",
|
||||||
"sass": "^1.87.0",
|
"sass": "^1.87.0",
|
||||||
"swiper": "^11.2.6",
|
"swiper": "^11.2.6",
|
||||||
|
"usehooks-ts": "^3.1.1",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
19
pnpm-lock.yaml
generated
19
pnpm-lock.yaml
generated
@ -47,6 +47,9 @@ importers:
|
|||||||
swiper:
|
swiper:
|
||||||
specifier: ^11.2.6
|
specifier: ^11.2.6
|
||||||
version: 11.2.6
|
version: 11.2.6
|
||||||
|
usehooks-ts:
|
||||||
|
specifier: ^3.1.1
|
||||||
|
version: 3.1.1(react@19.1.0)
|
||||||
zustand:
|
zustand:
|
||||||
specifier: ^5.0.3
|
specifier: ^5.0.3
|
||||||
version: 5.0.3(@types/react@19.0.12)(react@19.1.0)
|
version: 5.0.3(@types/react@19.0.12)(react@19.1.0)
|
||||||
@ -1085,6 +1088,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA==}
|
resolution: {integrity: sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA==}
|
||||||
engines: {node: '>= 12.0.0'}
|
engines: {node: '>= 12.0.0'}
|
||||||
|
|
||||||
|
lodash.debounce@4.0.8:
|
||||||
|
resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
|
||||||
|
|
||||||
lodash.includes@4.3.0:
|
lodash.includes@4.3.0:
|
||||||
resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==}
|
resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==}
|
||||||
|
|
||||||
@ -1355,6 +1361,12 @@ packages:
|
|||||||
undici-types@6.19.8:
|
undici-types@6.19.8:
|
||||||
resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
|
resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
|
||||||
|
|
||||||
|
usehooks-ts@3.1.1:
|
||||||
|
resolution: {integrity: sha512-I4diPp9Cq6ieSUH2wu+fDAVQO43xwtulo+fKEidHUwZPnYImbtkTjzIJYcDcJqxgmX31GVqNFURodvcgHcW0pA==}
|
||||||
|
engines: {node: '>=16.15.0'}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||||
|
|
||||||
utrie@1.0.2:
|
utrie@1.0.2:
|
||||||
resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==}
|
resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==}
|
||||||
|
|
||||||
@ -2318,6 +2330,8 @@ snapshots:
|
|||||||
lightningcss-win32-arm64-msvc: 1.29.2
|
lightningcss-win32-arm64-msvc: 1.29.2
|
||||||
lightningcss-win32-x64-msvc: 1.29.2
|
lightningcss-win32-x64-msvc: 1.29.2
|
||||||
|
|
||||||
|
lodash.debounce@4.0.8: {}
|
||||||
|
|
||||||
lodash.includes@4.3.0: {}
|
lodash.includes@4.3.0: {}
|
||||||
|
|
||||||
lodash.isboolean@3.0.3: {}
|
lodash.isboolean@3.0.3: {}
|
||||||
@ -2589,6 +2603,11 @@ snapshots:
|
|||||||
|
|
||||||
undici-types@6.19.8: {}
|
undici-types@6.19.8: {}
|
||||||
|
|
||||||
|
usehooks-ts@3.1.1(react@19.1.0):
|
||||||
|
dependencies:
|
||||||
|
lodash.debounce: 4.0.8
|
||||||
|
react: 19.1.0
|
||||||
|
|
||||||
utrie@1.0.2:
|
utrie@1.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
base64-arraybuffer: 1.0.2
|
base64-arraybuffer: 1.0.2
|
||||||
|
|||||||
22
src/api/auth.ts
Normal file
22
src/api/auth.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use server'
|
||||||
|
|
||||||
|
import { sessionOptions } from '@/libs/session'
|
||||||
|
import type { SessionData } from '@/types/Auth'
|
||||||
|
import { getIronSession } from 'iron-session'
|
||||||
|
import { cookies } from 'next/headers'
|
||||||
|
import { redirect } from 'next/navigation'
|
||||||
|
|
||||||
|
export const logout = async () => {
|
||||||
|
const cookieStore = await cookies()
|
||||||
|
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
||||||
|
|
||||||
|
session.destroy()
|
||||||
|
return redirect('/login')
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSession = async () => {
|
||||||
|
const cookieStore = await cookies()
|
||||||
|
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
||||||
|
|
||||||
|
return session
|
||||||
|
}
|
||||||
107
src/api/suitable.ts
Normal file
107
src/api/suitable.ts
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
import { database } from '@/data'
|
||||||
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
|
export interface Suitable {
|
||||||
|
id?: number
|
||||||
|
product_name: string
|
||||||
|
manufacturer: string
|
||||||
|
roof_material: string
|
||||||
|
shape: string
|
||||||
|
support_roof_tile: string
|
||||||
|
support_roof_tile_memo: string
|
||||||
|
support_roof_bracket: string
|
||||||
|
support_roof_bracket_memo: string
|
||||||
|
yg_anchor: string
|
||||||
|
yg_anchor_memo: string
|
||||||
|
rg_roof_tile_part: string
|
||||||
|
rg_roof_tile_part_memo: string
|
||||||
|
dido_hunt_support_tile_2: string
|
||||||
|
dido_hunt_support_tile_2_memo: string
|
||||||
|
takashima_power_base: string
|
||||||
|
takashima_power_base_memo: string
|
||||||
|
takashima_tile_bracket: string
|
||||||
|
takashima_tile_bracket_memo: string
|
||||||
|
slate_bracket_4: string
|
||||||
|
slate_bracket_4_memo: string
|
||||||
|
slate_single_metal_bracket: string
|
||||||
|
slate_single_metal_bracket_memo: string
|
||||||
|
dido_hunt_short_rack_4: string
|
||||||
|
dido_hunt_short_rack_4_memo: string
|
||||||
|
takashima_slate_bracket_slate_single: string
|
||||||
|
takashima_slate_bracket_slate_single_memo: string
|
||||||
|
df_metal_bracket: string
|
||||||
|
df_metal_bracket_memo: string
|
||||||
|
slate_metal_bracket: string
|
||||||
|
slate_metal_bracket_memo: string
|
||||||
|
takashima_slate_bracket_metal_roof: string
|
||||||
|
takashima_slate_bracket_metal_roof_memo: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const suitableApi = {
|
||||||
|
// getList: async (category?: string, keyword?: string): Promise<Suitable[]> => {
|
||||||
|
// let condition: any = {}
|
||||||
|
// if (category) {
|
||||||
|
// condition['category'] = category
|
||||||
|
// }
|
||||||
|
// if (keyword) {
|
||||||
|
// condition['keyword'] = {
|
||||||
|
// contains: keyword,
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// console.log('🚀 ~ getList: ~ condition:', condition)
|
||||||
|
// const response = await axiosInstance(null).get<Suitable[]>('/api/suitable/list', { params: condition })
|
||||||
|
// console.log('🚀 ~ getList: ~ response:', response)
|
||||||
|
// return response.data
|
||||||
|
// },
|
||||||
|
// getCategory: async (): Promise<Suitable[]> => {
|
||||||
|
// const response = await axiosInstance(null).get<Suitable[]>('/api/suitable/category')
|
||||||
|
// console.log('🚀 ~ getCategory: ~ response:', response)
|
||||||
|
// return response.data
|
||||||
|
// },
|
||||||
|
// getDetails: async (roofMaterial: string): Promise<Suitable[]> => {
|
||||||
|
// const response = await axiosInstance(null).get<Suitable[]>(`/api/suitable/details?roof-material=${roofMaterial}`)
|
||||||
|
// console.log('🚀 ~ getDetails: ~ response:', response)
|
||||||
|
// return response.data
|
||||||
|
// },
|
||||||
|
// create: async () => {
|
||||||
|
// const suitableData: Suitable[] = []
|
||||||
|
// database.forEach((item) => {
|
||||||
|
// suitableData.push({
|
||||||
|
// product_name: item[0],
|
||||||
|
// manufacturer: item[1],
|
||||||
|
// roof_material: item[2],
|
||||||
|
// shape: item[3],
|
||||||
|
// support_roof_tile: item[4],
|
||||||
|
// support_roof_tile_memo: item[5],
|
||||||
|
// support_roof_bracket: item[6],
|
||||||
|
// support_roof_bracket_memo: item[7],
|
||||||
|
// yg_anchor: item[8],
|
||||||
|
// yg_anchor_memo: item[9],
|
||||||
|
// rg_roof_tile_part: item[10],
|
||||||
|
// rg_roof_tile_part_memo: item[11],
|
||||||
|
// dido_hunt_support_tile_2: item[12],
|
||||||
|
// dido_hunt_support_tile_2_memo: item[13],
|
||||||
|
// takashima_power_base: item[14],
|
||||||
|
// takashima_power_base_memo: item[15],
|
||||||
|
// takashima_tile_bracket: item[16],
|
||||||
|
// takashima_tile_bracket_memo: item[17],
|
||||||
|
// slate_bracket_4: item[18],
|
||||||
|
// slate_bracket_4_memo: item[19],
|
||||||
|
// slate_single_metal_bracket: item[20],
|
||||||
|
// slate_single_metal_bracket_memo: item[21],
|
||||||
|
// dido_hunt_short_rack_4: item[22],
|
||||||
|
// dido_hunt_short_rack_4_memo: item[23],
|
||||||
|
// takashima_slate_bracket_slate_single: item[24],
|
||||||
|
// takashima_slate_bracket_slate_single_memo: item[25],
|
||||||
|
// df_metal_bracket: item[26],
|
||||||
|
// df_metal_bracket_memo: item[27],
|
||||||
|
// slate_metal_bracket: item[28],
|
||||||
|
// slate_metal_bracket_memo: item[29],
|
||||||
|
// takashima_slate_bracket_metal_roof: item[30],
|
||||||
|
// takashima_slate_bracket_metal_roof_memo: item[31],
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// const response = await axiosInstance(null).post<Suitable[]>('/api/suitable', suitableData)
|
||||||
|
// return response.data
|
||||||
|
// },
|
||||||
|
}
|
||||||
127
src/api/surveySales.ts
Normal file
127
src/api/surveySales.ts
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
|
export interface SurveySalesBasicInfo {
|
||||||
|
id?: number
|
||||||
|
representative: string
|
||||||
|
store: string | null
|
||||||
|
construction_point: string | null
|
||||||
|
investigation_date: string | null
|
||||||
|
building_name: string | null
|
||||||
|
customer_name: string | null
|
||||||
|
post_code: string | null
|
||||||
|
address: string | null
|
||||||
|
address_detail: string | null
|
||||||
|
submission_status: boolean
|
||||||
|
submission_date?: string | null
|
||||||
|
detail_info?: SurveySalesDetailInfo | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SurveySalesDetailInfo {
|
||||||
|
id?: number
|
||||||
|
contract_capacity: string | null
|
||||||
|
retail_company: string | null
|
||||||
|
supplementary_facilities: number | null
|
||||||
|
supplementary_facilities_etc: string | null
|
||||||
|
installation_system: number | null
|
||||||
|
installation_system_etc: string | null
|
||||||
|
construction_year: number | null
|
||||||
|
construction_year_etc: string | null
|
||||||
|
roof_material: number | null
|
||||||
|
roof_material_etc: string | null
|
||||||
|
roof_shape: number | null
|
||||||
|
roof_shape_etc: string | null
|
||||||
|
roof_slope: string | null
|
||||||
|
house_structure: number | null
|
||||||
|
house_structure_etc: string | null
|
||||||
|
rafter_material: number | null
|
||||||
|
rafter_material_etc: string | null
|
||||||
|
rafter_size: number | null
|
||||||
|
rafter_size_etc: string | null
|
||||||
|
rafter_pitch: number | null
|
||||||
|
rafter_pitch_etc: string | null
|
||||||
|
rafter_direction: number | null
|
||||||
|
open_field_plate_kind: number | null
|
||||||
|
open_field_plate_kind_etc: string | null
|
||||||
|
open_field_plate_thickness: string | null
|
||||||
|
leak_trace: boolean | null
|
||||||
|
waterproof_material: number | null
|
||||||
|
waterproof_material_etc: string | null
|
||||||
|
insulation_presence: number | null
|
||||||
|
insulation_presence_etc: string | null
|
||||||
|
structure_order: number | null
|
||||||
|
structure_order_etc: string | null
|
||||||
|
installation_availability: number | null
|
||||||
|
installation_availability_etc: string | null
|
||||||
|
memo: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export const surveySalesApi = {
|
||||||
|
create: async (data: SurveySalesBasicInfo): Promise<number> => {
|
||||||
|
try {
|
||||||
|
const response = await axiosInstance(null).post<SurveySalesBasicInfo>('/api/survey-sales', data)
|
||||||
|
return response.data.id ?? 0
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList: async (): Promise<SurveySalesBasicInfo[] | []> => {
|
||||||
|
try {
|
||||||
|
const response = await axiosInstance(null).get<SurveySalesBasicInfo[]>('/api/survey-sales')
|
||||||
|
return response.data
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDetail: async (id: number): Promise<SurveySalesBasicInfo | null> => {
|
||||||
|
try {
|
||||||
|
const response = await axiosInstance(null).get<SurveySalesBasicInfo>(`/api/survey-sales/${id}`)
|
||||||
|
return response.data
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: async (id: number, data: SurveySalesBasicInfo): Promise<SurveySalesBasicInfo | null> => {
|
||||||
|
try {
|
||||||
|
const response = await axiosInstance(null).put<SurveySalesBasicInfo>(`/api/survey-sales/${id}`, data)
|
||||||
|
return response.data
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: async (id: number, isDetail: boolean = false): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axiosInstance(null).delete(`/api/survey-sales/${id}`, {
|
||||||
|
params: {
|
||||||
|
detail_id: isDetail ? id : undefined,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
} catch (error) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createDetail: async (surveyId: number, data: SurveySalesDetailInfo): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axiosInstance(null).post<SurveySalesDetailInfo>(`/api/survey-sales/${surveyId}`, data)
|
||||||
|
return true
|
||||||
|
} catch (error) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirm: async (id: number): Promise<boolean> => {
|
||||||
|
try {
|
||||||
|
await axiosInstance(null).patch<SurveySalesBasicInfo>(`/api/survey-sales/${id}`)
|
||||||
|
return true
|
||||||
|
} catch (error) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// update: async (data: SurveySalesBasicInfo): Promise<SurveySalesBasicInfo> => {
|
||||||
|
// const response = await axiosInstance.put<SurveySalesBasicInfo>(`/api/survey-sales`, data)
|
||||||
|
// return response.data
|
||||||
|
// },
|
||||||
|
}
|
||||||
37
src/api/user.ts
Normal file
37
src/api/user.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
|
export interface UserData {
|
||||||
|
username: string
|
||||||
|
email: string
|
||||||
|
password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface User {
|
||||||
|
id: number
|
||||||
|
username: string
|
||||||
|
email: string
|
||||||
|
created_at: string
|
||||||
|
updated_at: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LoginData {
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const userApi = {
|
||||||
|
create: async (data: UserData): Promise<User> => {
|
||||||
|
const response = await axiosInstance(null).post<User>('/api/user/create', data)
|
||||||
|
return response.data
|
||||||
|
},
|
||||||
|
|
||||||
|
getList: async (): Promise<User[]> => {
|
||||||
|
const response = await axiosInstance(null).get<User[]>('/api/user/list')
|
||||||
|
return response.data
|
||||||
|
},
|
||||||
|
|
||||||
|
getUser: async (data: LoginData): Promise<User> => {
|
||||||
|
const response = await axiosInstance(null).post<User>(`/api/user`, data)
|
||||||
|
return response.data
|
||||||
|
},
|
||||||
|
}
|
||||||
22
src/app/api/auth/chg-pwd/route.ts
Normal file
22
src/app/api/auth/chg-pwd/route.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { NextResponse } from 'next/server'
|
||||||
|
|
||||||
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
|
export async function POST(req: Request) {
|
||||||
|
const { loginId, email, pwd, chgPwd } = await req.json()
|
||||||
|
console.log('🚀 ~ POST ~ loginId:', loginId)
|
||||||
|
console.log('🚀 ~ POST ~ email:', email)
|
||||||
|
console.log('🚀 ~ POST ~ pwd:', pwd)
|
||||||
|
console.log('🚀 ~ POST ~ chgPwd:', chgPwd)
|
||||||
|
|
||||||
|
const result = await axiosInstance(`${process.env.NEXT_PUBLIC_QSP_API_URL}`).post(`/api/user/userPwdChg`, {
|
||||||
|
loginId,
|
||||||
|
chgType: 'C',
|
||||||
|
email,
|
||||||
|
pwd,
|
||||||
|
chgPwd,
|
||||||
|
})
|
||||||
|
console.log('🚀 ~ result ~ result:', result)
|
||||||
|
|
||||||
|
return NextResponse.json({ code: 200, data: result.data })
|
||||||
|
}
|
||||||
@ -26,8 +26,8 @@ export async function POST(request: Request) {
|
|||||||
const cookieStore = await cookies()
|
const cookieStore = await cookies()
|
||||||
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
||||||
console.log('start session edit!')
|
console.log('start session edit!')
|
||||||
session.userNm = user.username!
|
// session.username = user.username!
|
||||||
session.email = user.email!
|
// session.email = user.email!
|
||||||
session.isLoggedIn = true
|
session.isLoggedIn = true
|
||||||
console.log('end session edit!')
|
console.log('end session edit!')
|
||||||
await session.save()
|
await session.save()
|
||||||
|
|||||||
@ -3,7 +3,10 @@
|
|||||||
import type { SessionData } from '@/types/Auth'
|
import type { SessionData } from '@/types/Auth'
|
||||||
import { useEffect, useReducer, useState } from 'react'
|
import { useEffect, useReducer, useState } from 'react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
|
|
||||||
|
import { useLocalStorage } from 'usehooks-ts'
|
||||||
import { useQuery } from '@tanstack/react-query'
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
|
||||||
import { axiosInstance } from '@/libs/axios'
|
import { axiosInstance } from '@/libs/axios'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
|
|
||||||
@ -24,6 +27,7 @@ export default function Login() {
|
|||||||
const [isLogin, setIsLogin] = useState(false)
|
const [isLogin, setIsLogin] = useState(false)
|
||||||
|
|
||||||
const { session, setSession } = useSessionStore()
|
const { session, setSession } = useSessionStore()
|
||||||
|
const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' })
|
||||||
|
|
||||||
const reducer = (state: AccountState, newState: Partial<AccountState>) => ({ ...state, ...newState })
|
const reducer = (state: AccountState, newState: Partial<AccountState>) => ({ ...state, ...newState })
|
||||||
const [account, setAccount] = useReducer(reducer, {
|
const [account, setAccount] = useReducer(reducer, {
|
||||||
@ -48,7 +52,6 @@ export default function Login() {
|
|||||||
loginId: account.loginId,
|
loginId: account.loginId,
|
||||||
pwd: account.pwd,
|
pwd: account.pwd,
|
||||||
})
|
})
|
||||||
// router.push('/')
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
@ -60,6 +63,11 @@ export default function Login() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLogin(false)
|
setIsLogin(false)
|
||||||
if (loginData?.code === 200) {
|
if (loginData?.code === 200) {
|
||||||
|
// 유저 정보 저장
|
||||||
|
setValue({
|
||||||
|
indivisualData: account.pwd,
|
||||||
|
})
|
||||||
|
// 세션 정보 저장
|
||||||
setSession({
|
setSession({
|
||||||
...session,
|
...session,
|
||||||
...loginData?.result,
|
...loginData?.result,
|
||||||
|
|||||||
@ -14,8 +14,11 @@ export default function Answer({ inquiryDetail, downloadFile }: { inquiryDetail:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="inquiry-detail-data">
|
<div className="inquiry-detail-data">
|
||||||
<div className="inquiry-detail-category">回答</div>
|
<div className="inquiry-answer-tit">回答</div>
|
||||||
<div className="inquiry-detail-txt">{inquiryDetail?.ansContents}</div>
|
<div className="inquiry-detail-txt">
|
||||||
|
一次側接続は, 自動切替開閉器と住宅分電盤昼間遮断器との間に蓄電システム遮断器を配線する方法です. 二次側接続は,
|
||||||
|
住宅分電盤週間ブレーカの二次側に蓄電システムブレーカを接続する
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="file-list-wrap">
|
<div className="file-list-wrap">
|
||||||
<div className="file-list-tit">ファイル添付</div>
|
<div className="file-list-tit">ファイル添付</div>
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
import Answer from './Answer'
|
import Answer from './Answer'
|
||||||
import { useInquiry } from '@/hooks/useInquiry'
|
import { useInquiry } from '@/hooks/useInquiry'
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams, useRouter } from 'next/navigation'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
export default function Detail() {
|
export default function Detail() {
|
||||||
//todo: 답변 완료 표시를 위해 임시로 추가 해 놓은 state
|
//todo: 답변 완료 표시를 위해 임시로 추가 해 놓은 state
|
||||||
@ -14,6 +15,7 @@ export default function Detail() {
|
|||||||
|
|
||||||
const { inquiryDetail, downloadFile } = useInquiry(Number(id), '5200')
|
const { inquiryDetail, downloadFile } = useInquiry(Number(id), '5200')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const [inquiry, setInquiry] = useState<Boolean>(true)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -37,7 +39,15 @@ export default function Detail() {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>作者</th>
|
<th>作者</th>
|
||||||
<td>{inquiryDetail?.regNm}</td>
|
<td>Hong gi</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>名前</th>
|
||||||
|
<td>Kim</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>番号</th>
|
||||||
|
<td>070-1234-5678</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>販売店</th>
|
<th>販売店</th>
|
||||||
@ -56,7 +66,17 @@ export default function Detail() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="inquiry-detail-data">
|
<div className="inquiry-detail-data">
|
||||||
<div className="inquiry-detail-category">
|
<div className="inquiry-detail-category">
|
||||||
{inquiryDetail?.qnaClsLrgCd} - {inquiryDetail?.qnaClsMidCd}
|
<span>屋根</span>
|
||||||
|
<span>適合性</span>
|
||||||
|
<span>屋根材</span>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-detail-tit">屋根材適合性確認依頼</div>
|
||||||
|
<div className="inquiry-detail-txt">
|
||||||
|
入力した内容が表示されます.
|
||||||
|
<br />
|
||||||
|
インストール可能であることを確認してください.
|
||||||
|
<br />
|
||||||
|
屋根の写真を添付しました.
|
||||||
</div>
|
</div>
|
||||||
<div className="inquiry-detail-tit">{inquiryDetail?.qstTitle}</div>
|
<div className="inquiry-detail-tit">{inquiryDetail?.qstTitle}</div>
|
||||||
<div className="inquiry-detail-txt">{inquiryDetail?.qstContents}</div>
|
<div className="inquiry-detail-txt">{inquiryDetail?.qstContents}</div>
|
||||||
|
|||||||
91
src/components/inquiry/ListTable.tsx
Normal file
91
src/components/inquiry/ListTable.tsx
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
'use client'
|
||||||
|
export default function ListTable() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="sale-frame">
|
||||||
|
<div className="inquiry-table-filter">
|
||||||
|
<div className="filter-check">
|
||||||
|
<div className="check-form-box">
|
||||||
|
<input type="checkbox" id="ch01" />
|
||||||
|
<label htmlFor="ch01">私が書いたお問い合わせ</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="filter-select">
|
||||||
|
<select className="select-form" name="" id="">
|
||||||
|
<option value="">全体</option>
|
||||||
|
<option value="">全体</option>
|
||||||
|
<option value="">全体</option>
|
||||||
|
<option value="">全体</option>
|
||||||
|
<option value="">全体</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-list-wrap">
|
||||||
|
<div className="inquiry-list-tit">
|
||||||
|
合計 <span>98</span>個
|
||||||
|
</div>
|
||||||
|
<ul className="inquiry-list">
|
||||||
|
<li className="inquiry-item">
|
||||||
|
<div className="inquiry-item-bx">
|
||||||
|
<div className="inquiry-item-category">
|
||||||
|
<span>屋根</span>
|
||||||
|
<span>適合性</span>
|
||||||
|
<span>屋根材</span>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-item-tit">屋根材適合性確認依頼</div>
|
||||||
|
<div className="inquiry-item-date">2025.04.02</div>
|
||||||
|
<div className="inquiry-badge badge blue">回答待ち</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="inquiry-item">
|
||||||
|
<div className="inquiry-item-bx">
|
||||||
|
<div className="inquiry-item-category">
|
||||||
|
<span>屋根</span>
|
||||||
|
<span>適合性</span>
|
||||||
|
<span>屋根材</span>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-item-tit">設置可能ですか?</div>
|
||||||
|
<div className="inquiry-item-date">2025.04.02</div>
|
||||||
|
<div className="inquiry-badge badge orange">回答完了</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="inquiry-item">
|
||||||
|
<div className="inquiry-item-bx">
|
||||||
|
<div className="inquiry-item-category">
|
||||||
|
<span>屋根</span>
|
||||||
|
<span>適合性</span>
|
||||||
|
<span>屋根材</span>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-item-tit">屋根材適合性確認依頼屋根材適合性確認依頼屋根材適合性確認依頼屋根材適合性確認依頼</div>
|
||||||
|
<div className="inquiry-item-date">2025.04.02</div>
|
||||||
|
<div className="inquiry-badge badge blue">回答待ち</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="inquiry-item">
|
||||||
|
<div className="inquiry-item-bx">
|
||||||
|
<div className="inquiry-item-category">
|
||||||
|
<span>屋根</span>
|
||||||
|
<span>適合性</span>
|
||||||
|
<span>屋根材</span>
|
||||||
|
</div>
|
||||||
|
<div className="inquiry-item-tit">設置可能ですか?</div>
|
||||||
|
<div className="inquiry-item-date">2025.04.02</div>
|
||||||
|
<div className="inquiry-badge badge orange">回答完了</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="inquiry-item">
|
||||||
|
<div className="inquiry-item-bx nodata">
|
||||||
|
<div className="inquiry-item-nodata">조회된 데이터가 없습니다</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div className="sale-edit-btn">
|
||||||
|
<button className="btn-frame n-blue icon">
|
||||||
|
もっと見る<i className="btn-edit"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -62,43 +62,67 @@ export default function RegistForm() {
|
|||||||
お問い合わせタイプ <i className="import">*</i>
|
お問い合わせタイプ <i className="import">*</i>
|
||||||
</div>
|
</div>
|
||||||
<div className="data-input">
|
<div className="data-input">
|
||||||
<select
|
<select className="select-form" name="" id="">
|
||||||
className="select-form"
|
<option value="">屋根適合</option>
|
||||||
name="qnaClsLrgCd"
|
<option value="">屋根適合</option>
|
||||||
id="qnaClsLrgCd"
|
<option value="">屋根適合</option>
|
||||||
defaultValue=""
|
<option value="">屋根適合</option>
|
||||||
onChange={(e) => setInquiryRequest({ ...inquiryRequest, qnaClsLrgCd: e.target.value })}
|
<option value="">屋根適合</option>
|
||||||
>
|
|
||||||
<option value="" hidden>
|
|
||||||
選択してください
|
|
||||||
</option>
|
|
||||||
<option value="A01">A01</option>
|
|
||||||
<option value="A02">A02</option>
|
|
||||||
<option value="A03">A03</option>
|
|
||||||
<option value="A04">A04</option>
|
|
||||||
<option value="A05">A05</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="data-input mt5">
|
||||||
|
<select className="select-form" name="" id="">
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className="data-input mt5">
|
||||||
|
<select className="select-form" name="" id="">
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
<option value="">屋根適合</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="data-input-form-bx">
|
||||||
|
<div className="data-input-form-tit">
|
||||||
|
名前 <i className="import">*</i>
|
||||||
|
</div>
|
||||||
|
<div className="data-input">
|
||||||
|
<input className="input-frame" type="text" placeholder="名前を書いてください" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="data-input-form-bx">
|
||||||
|
<div className="data-input-form-tit">電話番号</div>
|
||||||
|
<div className="data-input">
|
||||||
|
<input className="input-frame" type="text" placeholder="電話番号を書き留めてください" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="data-input-form-bx">
|
||||||
|
<div className="data-input-form-tit">
|
||||||
|
名前 <i className="import">*</i>
|
||||||
|
</div>
|
||||||
|
<div className="data-input">
|
||||||
|
<input className="input-frame" type="text" placeholder="名前を書いてください" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="data-input-form-bx">
|
||||||
|
<div className="data-input-form-tit">電話番号</div>
|
||||||
|
<div className="data-input">
|
||||||
|
<input className="input-frame" type="text" placeholder="電話番号を書き留めてください" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="data-input-form-bx">
|
<div className="data-input-form-bx">
|
||||||
<div className="data-input-form-tit">
|
<div className="data-input-form-tit">
|
||||||
お問い合わせタイトル <i className="import">*</i>
|
お問い合わせタイトル <i className="import">*</i>
|
||||||
</div>
|
</div>
|
||||||
<div className="data-input">
|
<div className="data-input">
|
||||||
<select
|
<input className="input-frame" type="text" placeholder="お問い合わせタイトルを記入してください" />
|
||||||
className="select-form"
|
|
||||||
name="title"
|
|
||||||
id="title"
|
|
||||||
onChange={(e) => setInquiryRequest({ ...inquiryRequest, title: e.target.value })}
|
|
||||||
>
|
|
||||||
<option value="" hidden>
|
|
||||||
選択してください
|
|
||||||
</option>
|
|
||||||
<option value="TEST">TEST</option>
|
|
||||||
<option value="TEST2">TEST2</option>
|
|
||||||
<option value="TEST3">TEST3</option>
|
|
||||||
<option value="TEST4">TEST4</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="data-input-form-bx">
|
<div className="data-input-form-bx">
|
||||||
|
|||||||
@ -3,11 +3,50 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
|
|
||||||
|
import { useLocalStorage } from 'usehooks-ts'
|
||||||
|
|
||||||
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
import { useSessionStore } from '@/store/session'
|
||||||
|
|
||||||
export default function PwResetForm() {
|
export default function PwResetForm() {
|
||||||
const [pwShow01, setPwShow01] = useState(false) //비밀번호 확인 보이기 숨기기
|
const [pwShow01, setPwShow01] = useState<boolean>(false) //비밀번호 확인 보이기 숨기기
|
||||||
const [pwShow02, setPwShow02] = useState(false) //비밀번호 재확인 보이기 숨기기
|
const [pwShow02, setPwShow02] = useState<boolean>(false) //비밀번호 재확인 보이기 숨기기
|
||||||
|
|
||||||
|
const [pwd01, setPwd01] = useState<string>('')
|
||||||
|
const [pwd02, setPwd02] = useState<string>('')
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
const { session } = useSessionStore()
|
||||||
|
const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' })
|
||||||
|
|
||||||
|
const validatePwd = () => {
|
||||||
|
if (pwd01 !== pwd02) {
|
||||||
|
alert('비밀번호가 일치하지 않습니다.')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleReset = async () => {
|
||||||
|
if (validatePwd()) {
|
||||||
|
const { data } = await axiosInstance(null).post(`/api/auth/chg-pwd`, {
|
||||||
|
loginId: session.userId,
|
||||||
|
email: session.email,
|
||||||
|
pwd: value.indivisualData,
|
||||||
|
chgPwd: pwd01,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data.data.result.resultCode === 'S') {
|
||||||
|
setValue({ indivisualData: pwd01 })
|
||||||
|
}
|
||||||
|
|
||||||
|
window.neoAlert(data.data.result.resultMsg, () => {
|
||||||
|
router.back()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="border-frame">
|
<div className="border-frame">
|
||||||
@ -18,7 +57,12 @@ export default function PwResetForm() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="data-input">
|
<div className="data-input">
|
||||||
<div className="login-input pw change">
|
<div className="login-input pw change">
|
||||||
<input type={`${pwShow01 ? 'text' : 'password'}`} className="login-frame" placeholder="●●●●" />
|
<input
|
||||||
|
type={`${pwShow01 ? 'text' : 'password'}`}
|
||||||
|
className="login-frame"
|
||||||
|
placeholder="●●●●"
|
||||||
|
onChange={(e) => setPwd01(e.target.value)}
|
||||||
|
/>
|
||||||
<button className={`login-icon ${pwShow01 ? 'act' : ''}`} onClick={() => setPwShow01(!pwShow01)}>
|
<button className={`login-icon ${pwShow01 ? 'act' : ''}`} onClick={() => setPwShow01(!pwShow01)}>
|
||||||
<i className="show-icon"></i>
|
<i className="show-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -32,7 +76,12 @@ export default function PwResetForm() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="data-input">
|
<div className="data-input">
|
||||||
<div className="login-input pw change">
|
<div className="login-input pw change">
|
||||||
<input type={`${pwShow02 ? 'text' : 'password'}`} className="login-frame" placeholder="●●●●" />
|
<input
|
||||||
|
type={`${pwShow02 ? 'text' : 'password'}`}
|
||||||
|
className="login-frame"
|
||||||
|
placeholder="●●●●"
|
||||||
|
onChange={(e) => setPwd02(e.target.value)}
|
||||||
|
/>
|
||||||
<button className={`login-icon ${pwShow02 ? 'act' : ''}`} onClick={() => setPwShow02(!pwShow02)}>
|
<button className={`login-icon ${pwShow02 ? 'act' : ''}`} onClick={() => setPwShow02(!pwShow02)}>
|
||||||
<i className="show-icon"></i>
|
<i className="show-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -48,7 +97,7 @@ export default function PwResetForm() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="btn-bx">
|
<div className="btn-bx">
|
||||||
<button className="btn-frame red icon">
|
<button className="btn-frame red icon" onClick={handleReset}>
|
||||||
リセットする<i className="btn-arr"></i>
|
リセットする<i className="btn-arr"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -3,22 +3,25 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { usePathname, useRouter } from 'next/navigation'
|
import { usePathname, useRouter } from 'next/navigation'
|
||||||
|
|
||||||
import { Swiper, SwiperSlide } from 'swiper/react'
|
import { useLocalStorage } from 'usehooks-ts'
|
||||||
import { useQueryClient } from '@tanstack/react-query'
|
import { useQueryClient } from '@tanstack/react-query'
|
||||||
|
import { Swiper, SwiperSlide } from 'swiper/react'
|
||||||
|
|
||||||
import { useSideNavState } from '@/store/sideNavState'
|
import { useSideNavState } from '@/store/sideNavState'
|
||||||
import { useHeaderStore } from '@/store/header'
|
import { useHeaderStore } from '@/store/header'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
|
import { usePopupController } from '@/store/popupController'
|
||||||
|
|
||||||
import { useTitle } from '@/hooks/useTitle'
|
import { useTitle } from '@/hooks/useTitle'
|
||||||
|
|
||||||
import { axiosInstance } from '@/libs/axios'
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
import 'swiper/css'
|
import 'swiper/css'
|
||||||
import { usePopupController } from '@/store/popupController'
|
|
||||||
|
|
||||||
export default function Header() {
|
export default function Header() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' })
|
||||||
const { sideNavIsOpen, setSideNavIsOpen } = useSideNavState()
|
const { sideNavIsOpen, setSideNavIsOpen } = useSideNavState()
|
||||||
const { backBtn } = useHeaderStore()
|
const { backBtn } = useHeaderStore()
|
||||||
const { getTitle } = useTitle()
|
const { getTitle } = useTitle()
|
||||||
@ -34,6 +37,7 @@ export default function Header() {
|
|||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
reset()
|
reset()
|
||||||
|
removeValue()
|
||||||
const { data } = await axiosInstance(null).get('/api/auth/logout')
|
const { data } = await axiosInstance(null).get('/api/auth/logout')
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
queryClient.clear()
|
queryClient.clear()
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { suitableApi } from '@/api/suitable'
|
|||||||
export function useSuitable() {
|
export function useSuitable() {
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
return await suitableApi.getCategory()
|
// return await suitableApi.getCategory()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('카테고리 데이터 로드 실패:', error)
|
console.error('카테고리 데이터 로드 실패:', error)
|
||||||
return []
|
return []
|
||||||
@ -12,7 +12,7 @@ export function useSuitable() {
|
|||||||
|
|
||||||
const getSuitables = async () => {
|
const getSuitables = async () => {
|
||||||
try {
|
try {
|
||||||
return await suitableApi.getList()
|
// return await suitableApi.getList()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('지붕재 데이터 로드 실패:', error)
|
console.error('지붕재 데이터 로드 실패:', error)
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ export function useSuitable() {
|
|||||||
|
|
||||||
const updateSearchResults = async (selectedCategory: string | undefined, searchValue: string | undefined) => {
|
const updateSearchResults = async (selectedCategory: string | undefined, searchValue: string | undefined) => {
|
||||||
try {
|
try {
|
||||||
return await suitableApi.getList(selectedCategory, searchValue)
|
// return await suitableApi.getList(selectedCategory, searchValue)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('지붕재 데이터 검색 실패:', error)
|
console.error('지붕재 데이터 검색 실패:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ export const defaultSession: SessionData = {
|
|||||||
compCd: null,
|
compCd: null,
|
||||||
agencyStoreId: null,
|
agencyStoreId: null,
|
||||||
storeId: null,
|
storeId: null,
|
||||||
|
storeNm: null,
|
||||||
userId: null,
|
userId: null,
|
||||||
category: null,
|
category: null,
|
||||||
userNm: null,
|
userNm: null,
|
||||||
@ -45,6 +46,7 @@ export const defaultSession: SessionData = {
|
|||||||
custCd: null,
|
custCd: null,
|
||||||
builderNo: null,
|
builderNo: null,
|
||||||
isLoggedIn: false,
|
isLoggedIn: false,
|
||||||
|
role: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSession = async () => {
|
export const getSession = async () => {
|
||||||
|
|||||||
@ -1,14 +1,16 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
import { usePathname } from 'next/navigation'
|
||||||
|
|
||||||
import { useHeaderStore } from '@/store/header'
|
import { useHeaderStore } from '@/store/header'
|
||||||
import { usePopupController } from '@/store/popupController'
|
import { usePopupController } from '@/store/popupController'
|
||||||
import { useSideNavState } from '@/store/sideNavState'
|
import { useSideNavState } from '@/store/sideNavState'
|
||||||
import { usePathname } from 'next/navigation'
|
|
||||||
import { useEffect } from 'react'
|
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
neoAlert: (msg?: string, alertBtn?: Function) => void
|
||||||
neoConfirm: (msg?: string, alertBtn2Yes?: Function, alertBtn2No?: Function) => boolean
|
neoConfirm: (msg?: string, alertBtn2Yes?: Function, alertBtn2No?: Function) => boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,6 +57,10 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
|
|||||||
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
||||||
alertFunc(msg, alertBtn)
|
alertFunc(msg, alertBtn)
|
||||||
}
|
}
|
||||||
|
window.neoAlert = function (msg?: string, alertBtn = () => setAlert(false)) {
|
||||||
|
if (!msg) return
|
||||||
|
alertFunc(msg, alertBtn)
|
||||||
|
}
|
||||||
// confirm 함수 변경해서 바인딩
|
// confirm 함수 변경해서 바인딩
|
||||||
window.neoConfirm = function (msg: string | undefined, alertBtn2Yes?: Function, alertBtn2No?: Function) {
|
window.neoConfirm = function (msg: string | undefined, alertBtn2Yes?: Function, alertBtn2No?: Function) {
|
||||||
if (!msg) return false
|
if (!msg) return false
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
// check radio 공통
|
// check radio 공통
|
||||||
.check-form-box input[type="checkbox"],
|
.check-form-box input[type="checkbox"],
|
||||||
.radio-form-box input[type="radio"]{
|
.radio-form-box input[type="radio"]{
|
||||||
position: static;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
margin-left:0;
|
margin-left:0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@ -44,20 +46,24 @@
|
|||||||
border: 1px solid #A8B6C7;
|
border: 1px solid #A8B6C7;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
|
transition: border 0.15s ease-in-out, color 0.15s ease-in-out, background-color 0.15s ease-in-out;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
&::after{
|
&::after{
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 20px;
|
top: -1px;
|
||||||
height: 20px;
|
left: -1px;
|
||||||
top: 0px;
|
width: 7px;
|
||||||
left: 0;
|
height: 9px;
|
||||||
margin-left: 0;
|
border: 2px solid transparent;
|
||||||
border-color: #fff;
|
border-left: none;
|
||||||
|
border-top: none;
|
||||||
|
transform: translate(7.75px,4.5px) rotate(45deg);
|
||||||
|
-ms-transform: translate(7.75px,4.5px) rotate(45deg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input[type="checkbox"]:checked + label::before{
|
input[type="checkbox"]:checked + label::before{
|
||||||
@ -66,17 +72,7 @@
|
|||||||
}
|
}
|
||||||
input[type="checkbox"]:checked + label::after{
|
input[type="checkbox"]:checked + label::after{
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
border-color: #fff;
|
||||||
position: absolute;
|
|
||||||
top: -1px;
|
|
||||||
left: -1px;
|
|
||||||
width: 7px;
|
|
||||||
height: 9px;
|
|
||||||
border: 2px solid #fff;
|
|
||||||
border-left: none;
|
|
||||||
border-top: none;
|
|
||||||
transform: translate(7.75px,4.5px) rotate(45deg);
|
|
||||||
-ms-transform: translate(7.75px,4.5px) rotate(45deg);
|
|
||||||
}
|
}
|
||||||
input[type="checkbox"]:disabled + label{
|
input[type="checkbox"]:disabled + label{
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
|||||||
@ -529,24 +529,7 @@
|
|||||||
|
|
||||||
// 지붕재 적합성
|
// 지붕재 적합성
|
||||||
.compliance-icon{
|
.compliance-icon{
|
||||||
display: block;
|
display: flex;
|
||||||
width: 22px;
|
|
||||||
height: 22px;
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: center;
|
|
||||||
&.check{
|
|
||||||
background-image: url(/assets/images/sub/compliance_check_icon.svg);
|
|
||||||
}
|
|
||||||
&.x{
|
|
||||||
background-image: url(/assets/images/sub/compliance_x_icon.svg);
|
|
||||||
}
|
|
||||||
&.quest{
|
|
||||||
background-image: url(/assets/images/sub/compliance_quest_icon.svg);
|
|
||||||
}
|
|
||||||
&.tip{
|
|
||||||
background-image: url(/assets/images/sub/compliance_tip_icon.svg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.compliance-check-wrap{
|
.compliance-check-wrap{
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
@ -576,6 +559,7 @@
|
|||||||
@include defaultFont($font-s-13, $font-w-500, $font-c);
|
@include defaultFont($font-s-13, $font-w-500, $font-c);
|
||||||
}
|
}
|
||||||
.check-name-btn{
|
.check-name-btn{
|
||||||
|
padding-left: 5px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
.bx-btn{
|
.bx-btn{
|
||||||
display: block;
|
display: block;
|
||||||
@ -621,13 +605,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.check-item-wrap{
|
.check-item-wrap{
|
||||||
display: flex;
|
@include flex(0px);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.compliance-icon-wrap{
|
.compliance-icon-wrap{
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
min-width: 44px;
|
min-width: 44px;
|
||||||
display: flex;
|
@include flex(0px);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,117 +1,132 @@
|
|||||||
import { SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS_ENUM, SORT_OPTIONS_ENUM } from '@/store/surveyFilterStore'
|
import { SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS_ENUM, SORT_OPTIONS_ENUM } from '@/store/surveyFilterStore'
|
||||||
|
|
||||||
export type SurveyBasicInfo = {
|
export type SurveyBasicInfo = {
|
||||||
id: number
|
ID: number
|
||||||
representative: string
|
REPRESENTATIVE: string
|
||||||
store: string | null
|
STORE: string | null
|
||||||
construction_point: string | null
|
CONSTRUCTION_POINT: string | null
|
||||||
investigation_date: string | null
|
INVESTIGATION_DATE: string | null
|
||||||
building_name: string | null
|
BUILDING_NAME: string | null
|
||||||
customer_name: string | null
|
CUSTOMER_NAME: string | null
|
||||||
post_code: string | null
|
POST_CODE: string | null
|
||||||
address: string | null
|
ADDRESS: string | null
|
||||||
address_detail: string | null
|
ADDRESS_DETAIL: string | null
|
||||||
submission_status: boolean
|
SUBMISSION_STATUS: boolean
|
||||||
submission_date: string | null
|
SUBMISSION_DATE: string | null
|
||||||
detail_info: SurveyDetailInfo | null
|
DETAIL_INFO: SurveyDetailInfo | null
|
||||||
created_at: Date
|
REG_DT: Date
|
||||||
updated_at: Date
|
UPT_DT: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyDetailInfo = {
|
export type SurveyDetailInfo = {
|
||||||
id: number
|
ID: number
|
||||||
basic_info_id: number
|
BASIC_INFO_ID: number
|
||||||
contract_capacity: string | null
|
CONTRACT_CAPACITY: string | null
|
||||||
retail_company: string | null
|
RETAIL_COMPANY: string | null
|
||||||
supplementary_facilities: string | null // number 배열
|
SUPPLEMENTARY_FACILITIES: string | null // number 배열
|
||||||
supplementary_facilities_etc: string | null
|
SUPPLEMENTARY_FACILITIES_ETC: string | null
|
||||||
installation_system: number | null
|
INSTALLATION_SYSTEM: string | null
|
||||||
installation_system_etc: string | null
|
INSTALLATION_SYSTEM_ETC: string | null
|
||||||
construction_year: number | null
|
CONSTRUCTION_YEAR: string | null
|
||||||
construction_year_etc: string | null
|
CONSTRUCTION_YEAR_ETC: string | null
|
||||||
roof_material: string | null // number 배열
|
ROOF_MATERIAL: string | null // number 배열
|
||||||
roof_material_etc: string | null
|
ROOF_MATERIAL_ETC: string | null
|
||||||
roof_shape: number | null
|
ROOF_SHAPE: string | null
|
||||||
roof_shape_etc: string | null
|
ROOF_SHAPE_ETC: string | null
|
||||||
roof_slope: string | null
|
ROOF_SLOPE: string | null
|
||||||
house_structure: number | null
|
HOUSE_STRUCTURE: string | null
|
||||||
house_structure_etc: string | null
|
HOUSE_STRUCTURE_ETC: string | null
|
||||||
rafter_material: number | null
|
RAFTER_MATERIAL: string | null
|
||||||
rafter_material_etc: string | null
|
RAFTER_MATERIAL_ETC: string | null
|
||||||
rafter_size: number | null
|
RAFTER_SIZE: string | null
|
||||||
rafter_size_etc: string | null
|
RAFTER_SIZE_ETC: string | null
|
||||||
rafter_pitch: number | null
|
RAFTER_PITCH: string | null
|
||||||
rafter_pitch_etc: string | null
|
RAFTER_PITCH_ETC: string | null
|
||||||
rafter_direction: number | null
|
RAFTER_DIRECTION: string | null
|
||||||
open_field_plate_kind: number | null
|
OPEN_FIELD_PLATE_KIND: string | null
|
||||||
open_field_plate_kind_etc: string | null
|
OPEN_FIELD_PLATE_KIND_ETC: string | null
|
||||||
open_field_plate_thickness: string | null
|
OPEN_FIELD_PLATE_THICKNESS: string | null
|
||||||
leak_trace: boolean | null
|
LEAK_TRACE: boolean | null
|
||||||
waterproof_material: number | null
|
WATERPROOF_MATERIAL: string | null
|
||||||
waterproof_material_etc: string | null
|
WATERPROOF_MATERIAL_ETC: string | null
|
||||||
insulation_presence: number | null
|
INSULATION_PRESENCE: string | null
|
||||||
insulation_presence_etc: string | null
|
INSULATION_PRESENCE_ETC: string | null
|
||||||
structure_order: number | null
|
STRUCTURE_ORDER: string | null
|
||||||
structure_order_etc: string | null
|
STRUCTURE_ORDER_ETC: string | null
|
||||||
installation_availability: number | null
|
INSTALLATION_AVAILABILITY: string | null
|
||||||
installation_availability_etc: string | null
|
INSTALLATION_AVAILABILITY_ETC: string | null
|
||||||
memo: string | null
|
MEMO: string | null
|
||||||
created_at: Date
|
REG_DT: Date
|
||||||
updated_at: Date
|
UPT_DT: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyBasicRequest = {
|
export type SurveyBasicRequest = {
|
||||||
representative: string
|
REPRESENTATIVE: string
|
||||||
store: string | null
|
STORE: string | null
|
||||||
construction_point: string | null
|
CONSTRUCTION_POINT: string | null
|
||||||
investigation_date: string | null
|
INVESTIGATION_DATE: string | null
|
||||||
building_name: string | null
|
BUILDING_NAME: string | null
|
||||||
customer_name: string | null
|
CUSTOMER_NAME: string | null
|
||||||
post_code: string | null
|
POST_CODE: string | null
|
||||||
address: string | null
|
ADDRESS: string | null
|
||||||
address_detail: string | null
|
ADDRESS_DETAIL: string | null
|
||||||
submission_status: boolean
|
SUBMISSION_STATUS: boolean
|
||||||
submission_date: string | null
|
SUBMISSION_DATE: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyDetailRequest = {
|
export type SurveyDetailRequest = {
|
||||||
contract_capacity: string | null
|
CONTRACT_CAPACITY: string | null
|
||||||
retail_company: string | null
|
RETAIL_COMPANY: string | null
|
||||||
supplementary_facilities: string | null // number 배열
|
SUPPLEMENTARY_FACILITIES: string | null // number 배열
|
||||||
supplementary_facilities_etc: string | null
|
SUPPLEMENTARY_FACILITIES_ETC: string | null
|
||||||
installation_system: number | null
|
INSTALLATION_SYSTEM: string | null
|
||||||
installation_system_etc: string | null
|
INSTALLATION_SYSTEM_ETC: string | null
|
||||||
construction_year: number | null
|
CONSTRUCTION_YEAR: string | null
|
||||||
construction_year_etc: string | null
|
CONSTRUCTION_YEAR_ETC: string | null
|
||||||
roof_material: string | null // number 배열
|
ROOF_MATERIAL: string | null // number 배열
|
||||||
roof_material_etc: string | null
|
ROOF_MATERIAL_ETC: string | null
|
||||||
roof_shape: number | null
|
ROOF_SHAPE: string | null
|
||||||
roof_shape_etc: string | null
|
ROOF_SHAPE_ETC: string | null
|
||||||
roof_slope: string | null
|
ROOF_SLOPE: string | null
|
||||||
house_structure: number | null
|
HOUSE_STRUCTURE: string | null
|
||||||
house_structure_etc: string | null
|
HOUSE_STRUCTURE_ETC: string | null
|
||||||
rafter_material: number | null
|
RAFTER_MATERIAL: string | null
|
||||||
rafter_material_etc: string | null
|
RAFTER_MATERIAL_ETC: string | null
|
||||||
rafter_size: number | null
|
RAFTER_SIZE: string | null
|
||||||
rafter_size_etc: string | null
|
RAFTER_SIZE_ETC: string | null
|
||||||
rafter_pitch: number | null
|
RAFTER_PITCH: string | null
|
||||||
rafter_pitch_etc: string | null
|
RAFTER_PITCH_ETC: string | null
|
||||||
rafter_direction: number | null
|
RAFTER_DIRECTION: string | null
|
||||||
open_field_plate_kind: number | null
|
OPEN_FIELD_PLATE_KIND: string | null
|
||||||
open_field_plate_kind_etc: string | null
|
OPEN_FIELD_PLATE_KIND_ETC: string | null
|
||||||
open_field_plate_thickness: string | null
|
OPEN_FIELD_PLATE_THICKNESS: string | null
|
||||||
leak_trace: boolean | null
|
LEAK_TRACE: boolean | null
|
||||||
waterproof_material: number | null
|
WATERPROOF_MATERIAL: string | null
|
||||||
waterproof_material_etc: string | null
|
WATERPROOF_MATERIAL_ETC: string | null
|
||||||
insulation_presence: number | null
|
INSULATION_PRESENCE: string | null
|
||||||
insulation_presence_etc: string | null
|
INSULATION_PRESENCE_ETC: string | null
|
||||||
structure_order: number | null
|
STRUCTURE_ORDER: string | null
|
||||||
structure_order_etc: string | null
|
STRUCTURE_ORDER_ETC: string | null
|
||||||
installation_availability: number | null
|
INSTALLATION_AVAILABILITY: string | null
|
||||||
installation_availability_etc: string | null
|
INSTALLATION_AVAILABILITY_ETC: string | null
|
||||||
memo: string | null
|
MEMO: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SurveyDetailCoverRequest = {
|
export type SurveyDetailCoverRequest = {
|
||||||
detail_info: SurveyDetailRequest
|
DETAIL_INFO: SurveyDetailRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SurveyRegistRequest = {
|
||||||
|
REPRESENTATIVE: string
|
||||||
|
STORE: string | null
|
||||||
|
CONSTRUCTION_POINT: string | null
|
||||||
|
INVESTIGATION_DATE: string | null
|
||||||
|
BUILDING_NAME: string | null
|
||||||
|
CUSTOMER_NAME: string | null
|
||||||
|
POST_CODE: string | null
|
||||||
|
ADDRESS: string | null
|
||||||
|
ADDRESS_DETAIL: string | null
|
||||||
|
SUBMISSION_STATUS: boolean
|
||||||
|
SUBMISSION_DATE: string | null
|
||||||
|
DETAIL_INFO: SurveyDetailRequest | null
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user