diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index e8a1361f..e1034cc9 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -454,7 +454,6 @@ export default function StuffDetail() { firstList = res favList = res.filter((row) => row.priority !== 'B') otherList = res.filter((row) => row.firstAgentYn === 'N') - setSaleStoreList(firstList) setFavoriteStoreList(firstList) setShowSaleStoreList(firstList) @@ -531,6 +530,11 @@ export default function StuffDetail() { get({ url: url }).then((res) => { if (!isEmptyArray(res)) { if (session?.storeId === 'T01') { + //즐겨찾기 구분 추가 + res.map((row) => { + row.value = row.saleStoreId + row.label = row.saleStoreName + }) firstList = res.filter((row) => row.saleStoreLevel === '1') firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId) favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B') @@ -653,7 +657,7 @@ export default function StuffDetail() { //염해지역용아이템사용 saltAreaFlg 1이면 true 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) //계약조건 null로 내려오면 0으로 디폴트셋팅 if (managementState.conType === null) { @@ -989,7 +993,7 @@ export default function StuffDetail() { 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('remarks', info.remarks) @@ -1407,7 +1411,6 @@ export default function StuffDetail() { // 수정모드일때는 PUT await promisePut({ url: apiUrl, data: params }) .then((res) => { - console.log('수정::::::::::::', params) setIsGlobalLoading(true) 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 ( +
+ {data.label} +
+ ) + } + + 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 ( +
+ {data.label} +
+ ) + } + return ( <> {(editMode === 'NEW' && ( @@ -1823,6 +1852,7 @@ export default function StuffDetail() { value={saleStoreList.filter(function (option) { return option.saleStoreId === selOptions })} + components={{ Option: CustomOption }} >
@@ -1855,6 +1885,7 @@ export default function StuffDetail() { value={showSaleStoreList.filter(function (option) { return option.saleStoreId === selOptions })} + // components={{ Option: CustomOption }} >
@@ -1886,6 +1917,7 @@ export default function StuffDetail() { value={showSaleStoreList.filter(function (option) { return option.saleStoreId === selOptions })} + // components={{ Option: CustomOption }} >
@@ -1938,11 +1970,11 @@ export default function StuffDetail() { ? true : false } - // isDisabled={otherSaleStoreList != null && otherSaleStoreList.length === 1 ? true : false} isClearable={true} value={otherSaleStoreList.filter(function (option) { return option.saleStoreId === otherSelOptions })} + components={{ Option: CustomOption2 }} />
@@ -2389,7 +2421,7 @@ export default function StuffDetail() { <>