feature/style : 날짜 형식 및 컴포넌트 간격 수정 #106
@ -15,7 +15,7 @@ export default function Answer({
|
||||
<div className="inquiry-answer-header">
|
||||
<div className="inquiry-answer-tit">Hanwha Japan 回答</div>
|
||||
<div className="inquiry-answer-date">
|
||||
<span>{inquiryDetail?.ansRegNm}</span>/ <span>{inquiryDetail?.ansRegDt}</span>
|
||||
<span>{inquiryDetail?.ansRegNm}</span> / <span>{inquiryDetail?.ansRegDt}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="inquiry-detail-data">
|
||||
|
||||
@ -176,11 +176,11 @@ export default function SurveySaleSubmitPopup() {
|
||||
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 3px;">
|
||||
-販売店名:
|
||||
<span style="color: #417DDC;">
|
||||
${surveyDetail?.store} (${surveyDetail?.storeId ?? ' - '})
|
||||
${surveyDetail?.store ? `${surveyDetail?.store} (${surveyDetail?.storeId ?? ' - '})` : ' - '}
|
||||
</span>
|
||||
</p>
|
||||
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 15px;">
|
||||
-施工店名:
|
||||
-施工店名:
|
||||
<span style="color: #417DDC;">${surveyDetail?.constructionPoint ?? ' - '}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
import { SurveyBasicInfo } from '@/types/Survey'
|
||||
import { useSurvey } from '@/hooks/useSurvey'
|
||||
import { formatDateTime } from '@/utils/common-utils'
|
||||
|
||||
export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicInfo }) {
|
||||
/** 제출 상태 처리 */
|
||||
@ -36,18 +37,18 @@ export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicI
|
||||
</tr>
|
||||
<tr>
|
||||
<th>登録日</th>
|
||||
<td>{surveyDetail?.regDt ? new Date(surveyDetail.regDt).toLocaleString() : ''}</td>
|
||||
<td>{formatDateTime(surveyDetail?.regDt)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>更新日時</th>
|
||||
<td>{surveyDetail?.uptDt ? new Date(surveyDetail.uptDt).toLocaleString() : ''}</td>
|
||||
<td>{formatDateTime(surveyDetail?.uptDt)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>提出可否</th>
|
||||
<td>
|
||||
{surveyDetail?.submissionStatus && surveyDetail?.submissionDate ? (
|
||||
<>
|
||||
<div>{new Date(surveyDetail.submissionDate).toLocaleString()}</div>
|
||||
<div>{formatDateTime(surveyDetail.submissionDate)}</div>
|
||||
{submitStatus()}
|
||||
</>
|
||||
) : (
|
||||
|
||||
@ -74,7 +74,7 @@ export default function RoofForm(props: {
|
||||
<div className="data-input-form-tit">電気契約容量</div>
|
||||
{mode === 'READ' && <input type="text" className="input-frame" value={roofInfo?.contractCapacity ?? ''} readOnly={mode === 'READ'} />}
|
||||
{mode !== 'READ' && (
|
||||
<div className="data-input mb5">
|
||||
<div className="data-input mb10">
|
||||
<input
|
||||
type="number"
|
||||
inputMode="numeric"
|
||||
@ -83,7 +83,7 @@ export default function RoofForm(props: {
|
||||
value={roofInfo?.contractCapacity?.split(' ')[0] ?? ''}
|
||||
onChange={(e) => handleNumberInput('contractCapacity', e.target.value)}
|
||||
/>
|
||||
<div className="data-input">
|
||||
<div className="data-input mt10">
|
||||
<select
|
||||
className="select-form"
|
||||
name="contractCapacityUnit"
|
||||
|
||||
@ -8,6 +8,7 @@ import SearchForm from './SearchForm'
|
||||
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
||||
import { useSessionStore } from '@/store/session'
|
||||
import type { SurveyBasicInfo } from '@/types/Survey'
|
||||
import { formatDateTime, formatDate } from '@/utils/common-utils'
|
||||
|
||||
export default function ListTable() {
|
||||
const router = useRouter()
|
||||
@ -68,13 +69,13 @@ export default function ListTable() {
|
||||
<div className="sale-item-bx">
|
||||
<div className="sale-item-date-bx">
|
||||
<div className="sale-item-num">{survey.srlNo}</div>
|
||||
<div className="sale-item-date">{survey.investigationDate}</div>
|
||||
<div className="sale-item-date">{formatDate(survey.regDt)}</div>
|
||||
</div>
|
||||
<div className="sale-item-tit">{survey.buildingName === null ? '-' : survey.buildingName}</div>
|
||||
<div className="sale-item-customer">{survey.customerName === null ? '-' : survey.customerName}</div>
|
||||
<div className="sale-item-update-bx">
|
||||
<div className="sale-item-name">{survey.representative}</div>
|
||||
<div className="sale-item-update">{new Date(survey.uptDt).toLocaleString()}</div>
|
||||
<div className="sale-item-update">{formatDateTime(survey.uptDt)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -146,7 +146,7 @@ export default function Header() {
|
||||
</button>
|
||||
</li>
|
||||
<li className="side-footer-item">
|
||||
<button onClick={() => popupController.setMemberInfomationPopup(true)}>MY ADMIN</button>
|
||||
<button onClick={() => popupController.setMemberInfomationPopup(true)}>MY PAGE</button>
|
||||
</li>
|
||||
<li className="side-footer-item">
|
||||
<button onClick={() => router.push('/')}>HOME</button>
|
||||
|
||||
@ -233,3 +233,40 @@ export const convertToCamelCase = (obj) => {
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
/**
|
||||
* 날짜 형식 변환
|
||||
* @param {Date | string} date 날짜 데이터
|
||||
* @returns {string} 포맷팅된 날짜 문자열 (YYYY.MM.DD HH:MM:SS)
|
||||
*/
|
||||
export const formatDateTime = (date) => {
|
||||
if (date === '' || date === null || date === undefined) return ''
|
||||
|
||||
return new Date(date)
|
||||
.toLocaleString(undefined, {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
hour12: false,
|
||||
})
|
||||
.replace(/\//g, '.')
|
||||
}
|
||||
|
||||
/**
|
||||
* 날짜만 형식 변환
|
||||
* @param {Date | string} date 날짜 데이터
|
||||
* @returns {string} 포맷팅된 날짜 문자열 (YYYY.MM.DD)
|
||||
*/
|
||||
export const formatDate = (date) => {
|
||||
if (date === '' || date === null || date === undefined) return ''
|
||||
|
||||
const dateObj = new Date(date)
|
||||
const year = dateObj.getFullYear()
|
||||
const month = String(dateObj.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(dateObj.getDate()).padStart(2, '0')
|
||||
|
||||
return `${year}.${month}.${day}`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user