물건정보

This commit is contained in:
basssy 2024-10-18 17:42:03 +09:00
parent e1a4ccaa08
commit 7d2d32f198
2 changed files with 51 additions and 22 deletions

View File

@ -34,7 +34,6 @@ export default function MainContents({ objectList, businessCharger, businessChar
startRow: 1, startRow: 1,
endRow: 1, endRow: 1,
} }
// const noticeApiUrl = `api/board/list?schNoticeTpCd=QC&schNoticeClsCd=NOTICE&schTitle=&startRow=1&endRow=1`
const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}` const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}`
const res = await get({ url: noticeApiUrl }) const res = await get({ url: noticeApiUrl })
//console.log('res::', res) //console.log('res::', res)
@ -57,7 +56,6 @@ export default function MainContents({ objectList, businessCharger, businessChar
startRow: 1, startRow: 1,
endRow: 3, endRow: 3,
} }
// const faqApiUrl = `api/board/list?schNoticeTpCd=QC&schNoticeClsCd=FAQ&schTitle=&startRow=1&endRow=1`
const faqApiUrl = `api/board/list?${queryStringFormatter(param)}` const faqApiUrl = `api/board/list?${queryStringFormatter(param)}`
const res = await get({ url: faqApiUrl }) const res = await get({ url: faqApiUrl })
//console.log('FAQres::', res) //console.log('FAQres::', res)

View File

@ -102,7 +102,6 @@ export default function StuffDetail() {
// API // API
get({ url: '/api/object/prefecture/list' }).then((res) => { get({ url: '/api/object/prefecture/list' }).then((res) => {
if (!isEmptyArray(res)) { if (!isEmptyArray(res)) {
// console.log(' API :::', res)
setPrefCodeList(res) setPrefCodeList(res)
} }
}) })
@ -348,9 +347,8 @@ export default function StuffDetail() {
// //
get({ url: `/api/object/prefecture/${prefValue}/list` }).then((res) => { get({ url: `/api/object/prefecture/${prefValue}/list` }).then((res) => {
if (!isEmptyArray(res)) { if (!isEmptyArray(res)) {
// console.log(' ::::::::', res) // form.setValue('areaId', res[0].areaId)
form.setValue('areaId', res[0].areaId) // form.setValue('areaName', res[0].prefName)
form.setValue('areaName', res[0].prefName)
setAreaIdList(res) setAreaIdList(res)
} }
}) })
@ -359,7 +357,8 @@ export default function StuffDetail() {
// //
const handleAreaIdOnChange = (e) => { const handleAreaIdOnChange = (e) => {
form.setValue('areaId', e.target.value) form.setValue('areaId', e.areaId)
form.setValue('areaName', e.prefName)
} }
// //
@ -631,13 +630,28 @@ export default function StuffDetail() {
<div className="flx-box"> <div className="flx-box">
<div className="select-wrap" style={{ width: '200px' }}> <div className="select-wrap" style={{ width: '200px' }}>
{prefCodeList?.length > 0 && ( {prefCodeList?.length > 0 && (
<select className="select-light" name="prefName" {...register('prefId')} disabled> // <select className="select-light" name="prefName" {...register('prefId')} disabled>
{prefCodeList.map((row) => ( // {prefCodeList.map((row) => (
<option key={row.prefId} value={row.prefId}> // <option key={row.prefId} value={row.prefId}>
{row.prefName} // {row.prefName}
</option> // </option>
))} // ))}
</select> // </select>
<Select
id="long-value-select3"
instanceId="long-value-select3"
className="react-select-custom"
classNamePrefix="custom"
placeholder="Select"
options={prefCodeList}
getOptionLabel={(x) => x.prefName}
getOptionValue={(x) => x.prefId}
isSearchable={false}
value={prefCodeList.filter(function (option) {
return option.prefId === prefValue
})}
isDisabled={true}
/>
)} )}
</div> </div>
<div className="input-wrap mr5" style={{ width: '580px' }}> <div className="input-wrap mr5" style={{ width: '580px' }}>
@ -652,7 +666,7 @@ export default function StuffDetail() {
</th> </th>
<td> <td>
<div className="select-wrap" style={{ width: '200px' }}> <div className="select-wrap" style={{ width: '200px' }}>
<select {/* <select
className="select-light" className="select-light"
name="areaId" name="areaId"
disabled={areaIdList?.length > 0 ? false : true} disabled={areaIdList?.length > 0 ? false : true}
@ -664,8 +678,25 @@ export default function StuffDetail() {
{row.prefName} {row.prefName}
</option> </option>
) )
})}
</select>
*/}
<Select
id="long-value-select4"
instanceId="long-value-select4"
className="react-select-custom"
classNamePrefix="custom"
options={areaIdList}
placeholder="Select"
getOptionLabel={(x) => x.prefName}
getOptionValue={(x) => x.areaId}
isSearchable={false}
onChange={handleAreaIdOnChange}
value={areaIdList.filter(function (option) {
return option.areaId === form.watch('areaId')
})} })}
</select> isDisabled={areaIdList.length > 0 ? false : true}
/>
</div> </div>
</td> </td>
</tr> </tr>
@ -794,9 +825,9 @@ export default function StuffDetail() {
</Button> </Button>
)} )}
<Link href="/management/stuff"> <Link href="/management/stuff">
<Button type="button" className="btn-origin grey"> <button type="button" className="btn-origin grey">
NEW화면 물건목록이동 NEW화면 물건목록이동
</Button> </button>
</Link> </Link>
</div> </div>
</div> </div>
@ -911,9 +942,9 @@ export default function StuffDetail() {
{objectNo.substring(0, 1) === 'R' ? ( {objectNo.substring(0, 1) === 'R' ? (
<> <>
<Link href="/management/stuff"> <Link href="/management/stuff">
<Button type="button" className="btn-origin grey mr5"> <button type="button" className="btn-origin grey mr5">
R상세:물건목록 R상세:물건목록
</Button> </button>
</Link> </Link>
<Button type="submit" className="btn-origin navy mr5"> <Button type="submit" className="btn-origin navy mr5">
R상세:저장 R상세:저장
@ -934,9 +965,9 @@ export default function StuffDetail() {
</Button> </Button>
)} )}
<Link href="/management/stuff"> <Link href="/management/stuff">
<Button type="button" className="btn-origin grey"> <button type="button" className="btn-origin grey">
T상세:물건목록 T상세:물건목록
</Button> </button>
</Link> </Link>
</> </>
)} )}