[1383]견적서 아이템 인코딩

This commit is contained in:
ysCha 2026-01-12 15:38:21 +09:00
parent aa837d8dbf
commit 3dd96d043f

View File

@ -2039,7 +2039,11 @@ export default function Estimate({}) {
} }
}} }}
menuPlacement={'auto'} menuPlacement={'auto'}
getOptionLabel={(x) => x.itemName + ' (' + x.itemNo + ')'} getOptionLabel={(x) => {
//
const doc = new DOMParser().parseFromString(x.itemName, 'text/html');
return (doc.documentElement.textContent || x.itemName) + ' (' + x.itemNo + ')';
}}
getOptionValue={(x) => x.itemNo} getOptionValue={(x) => x.itemNo}
components={{ components={{
SingleValue: ({ children, ...props }) => { SingleValue: ({ children, ...props }) => {
@ -2048,13 +2052,21 @@ export default function Estimate({}) {
}} }}
isClearable={false} isClearable={false}
isDisabled={!!item?.paDispOrder} isDisabled={!!item?.paDispOrder}
value={displayItemList.filter(function (option) { value={(() => {
if (item.itemNo === '') { const selectedOption = displayItemList.find((option) => {
return false return item.itemNo !== '' && option.itemId === item.itemId;
} else { });
return option.itemId === item.itemId
if (selectedOption) {
// itemName
const doc = new DOMParser().parseFromString(selectedOption.itemName, 'text/html');
return {
...selectedOption,
itemName: doc.documentElement.textContent || selectedOption.itemName
};
} }
})} return null;
})()}
/> />
) : ( ) : (
<Select <Select