물건상세 설치높이 0으로 셋팅되는 문제 수정

This commit is contained in:
basssy 2025-01-31 09:39:24 +09:00
parent 4ede2bb12d
commit 834785133f

View File

@ -454,7 +454,6 @@ export default function StuffDetail() {
firstList = res firstList = res
favList = res.filter((row) => row.priority !== 'B') favList = res.filter((row) => row.priority !== 'B')
otherList = res.filter((row) => row.firstAgentYn === 'N') otherList = res.filter((row) => row.firstAgentYn === 'N')
setSaleStoreList(firstList) setSaleStoreList(firstList)
setFavoriteStoreList(firstList) setFavoriteStoreList(firstList)
setShowSaleStoreList(firstList) setShowSaleStoreList(firstList)
@ -531,6 +530,11 @@ export default function StuffDetail() {
get({ url: url }).then((res) => { get({ url: url }).then((res) => {
if (!isEmptyArray(res)) { if (!isEmptyArray(res)) {
if (session?.storeId === 'T01') { if (session?.storeId === 'T01') {
//
res.map((row) => {
row.value = row.saleStoreId
row.label = row.saleStoreName
})
firstList = res.filter((row) => row.saleStoreLevel === '1') firstList = res.filter((row) => row.saleStoreLevel === '1')
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId) firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B') favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
@ -653,7 +657,7 @@ export default function StuffDetail() {
// saltAreaFlg 1 true // saltAreaFlg 1 true
form.setValue('saltAreaFlg', managementState.saltAreaFlg === '1' ? true : false) form.setValue('saltAreaFlg', managementState.saltAreaFlg === '1' ? true : false)
// //
let installHeight = managementState.installHeight ? managementState.installHeight.split('.')[0] : '0' let installHeight = managementState.installHeight ? managementState.installHeight.split('.')[0] : ''
form.setValue('installHeight', installHeight) form.setValue('installHeight', installHeight)
// null 0 // null 0
if (managementState.conType === null) { if (managementState.conType === null) {
@ -989,7 +993,7 @@ export default function StuffDetail() {
form.setValue('saltAreaFlg', false) form.setValue('saltAreaFlg', false)
} }
let installHeight = info.installHeight ? info.installHeight.split('.')[0] : '0' let installHeight = info.installHeight ? info.installHeight.split('.')[0] : ''
form.setValue('installHeight', installHeight) form.setValue('installHeight', installHeight)
form.setValue('remarks', info.remarks) form.setValue('remarks', info.remarks)
@ -1407,7 +1411,6 @@ export default function StuffDetail() {
// PUT // PUT
await promisePut({ url: apiUrl, data: params }) await promisePut({ url: apiUrl, data: params })
.then((res) => { .then((res) => {
console.log('수정::::::::::::', params)
setIsGlobalLoading(true) setIsGlobalLoading(true)
if (res.status === 201) { if (res.status === 201) {
@ -1656,6 +1659,32 @@ export default function StuffDetail() {
} }
} }
} }
const CustomOption = (props) => {
const { data, innerRef, innerProps, isSelected, isFocused, isDisabled } = props
const customClass = data.saleStoreId === 'T01' || data.priority !== 'B' ? 'special-option' : ''
// /
const optionClass = `${customClass} ${isSelected ? 'custom__option--is-selected' : ''} ${isFocused ? 'custom__option--is-focused' : ''} ${isDisabled ? 'custom__option--is-disabled' : ''}`
return (
<div ref={innerRef} {...innerProps} className={`custom__option ${optionClass}`}>
{data.label}
</div>
)
}
const CustomOption2 = (props) => {
const { data, innerRef, innerProps, isSelected, isFocused, isDisabled } = props
const customClass = data.priority !== 'B' ? 'special-option' : ''
// /
const optionClass = `${customClass} ${isSelected ? 'custom__option--is-selected' : ''} ${isFocused ? 'custom__option--is-focused' : ''} ${isDisabled ? 'custom__option--is-disabled' : ''}`
return (
<div ref={innerRef} {...innerProps} className={`custom__option ${optionClass}`}>
{data.label}
</div>
)
}
return ( return (
<> <>
{(editMode === 'NEW' && ( {(editMode === 'NEW' && (
@ -1823,6 +1852,7 @@ export default function StuffDetail() {
value={saleStoreList.filter(function (option) { value={saleStoreList.filter(function (option) {
return option.saleStoreId === selOptions return option.saleStoreId === selOptions
})} })}
components={{ Option: CustomOption }}
></Select> ></Select>
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -1855,6 +1885,7 @@ export default function StuffDetail() {
value={showSaleStoreList.filter(function (option) { value={showSaleStoreList.filter(function (option) {
return option.saleStoreId === selOptions return option.saleStoreId === selOptions
})} })}
// components={{ Option: CustomOption }}
></Select> ></Select>
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -1886,6 +1917,7 @@ export default function StuffDetail() {
value={showSaleStoreList.filter(function (option) { value={showSaleStoreList.filter(function (option) {
return option.saleStoreId === selOptions return option.saleStoreId === selOptions
})} })}
// components={{ Option: CustomOption }}
></Select> ></Select>
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -1938,11 +1970,11 @@ export default function StuffDetail() {
? true ? true
: false : false
} }
// isDisabled={otherSaleStoreList != null && otherSaleStoreList.length === 1 ? true : false}
isClearable={true} isClearable={true}
value={otherSaleStoreList.filter(function (option) { value={otherSaleStoreList.filter(function (option) {
return option.saleStoreId === otherSelOptions return option.saleStoreId === otherSelOptions
})} })}
components={{ Option: CustomOption2 }}
/> />
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -2389,7 +2421,7 @@ export default function StuffDetail() {
<> <>
<div className="select-wrap mr5" style={{ width: '567px' }}> <div className="select-wrap mr5" style={{ width: '567px' }}>
<Select <Select
menuPlacement={'auto'} // menuPlacement={'auto'}
id="long-value-select1" id="long-value-select1"
instanceId="long-value-select1" instanceId="long-value-select1"
className="react-select-custom" className="react-select-custom"
@ -2405,6 +2437,7 @@ export default function StuffDetail() {
value={saleStoreList.filter(function (option) { value={saleStoreList.filter(function (option) {
return option.saleStoreId === selOptions return option.saleStoreId === selOptions
})} })}
components={{ Option: CustomOption }}
/> />
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -2445,6 +2478,7 @@ export default function StuffDetail() {
value={showSaleStoreList.filter(function (option) { value={showSaleStoreList.filter(function (option) {
return option.saleStoreId === selOptions return option.saleStoreId === selOptions
})} })}
// components={{ Option: CustomOption }}
/> />
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -2479,6 +2513,7 @@ export default function StuffDetail() {
return option.saleStoreId return option.saleStoreId
} }
})} })}
// components={{ Option: CustomOption }}
/> />
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>
@ -2533,6 +2568,7 @@ export default function StuffDetail() {
value={otherSaleStoreList.filter(function (option) { value={otherSaleStoreList.filter(function (option) {
return option.saleStoreId === otherSelOptions return option.saleStoreId === otherSelOptions
})} })}
// components={{ Option: CustomOption2 }}
/> />
</div> </div>
<div className="input-wrap" style={{ width: '216px' }}> <div className="input-wrap" style={{ width: '216px' }}>