This commit is contained in:
hyojun.choi 2026-01-12 16:10:31 +09:00
commit 65e268f3d6
4 changed files with 55 additions and 9 deletions

View File

@ -63,6 +63,33 @@ export const CalculatorInput = forwardRef(
const calculator = calculatorRef.current
let newDisplayValue = ''
// (Selection)
if (inputRef.current) {
const { selectionStart, selectionEnd } = inputRef.current
//
if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
// ( )
if (!hasOperation) {
calculator.currentOperand = num.toString()
calculator.previousOperand = ''
calculator.operation = undefined
calculator.shouldResetDisplay = false
newDisplayValue = calculator.currentOperand
setDisplayValue(newDisplayValue)
onChange(newDisplayValue)
requestAnimationFrame(() => {
if (inputRef.current) {
inputRef.current.focus()
inputRef.current.setSelectionRange(newDisplayValue.length, newDisplayValue.length)
}
})
return //
}
}
}
// maxLength
if (maxLength > 0) {
const currentLength = (calculator.currentOperand || '').length + (calculator.previousOperand || '').length + (calculator.operation || '').length

View File

@ -2039,7 +2039,11 @@ export default function Estimate({}) {
}
}}
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}
components={{
SingleValue: ({ children, ...props }) => {
@ -2048,13 +2052,21 @@ export default function Estimate({}) {
}}
isClearable={false}
isDisabled={!!item?.paDispOrder}
value={displayItemList.filter(function (option) {
if (item.itemNo === '') {
return false
} else {
return option.itemId === item.itemId
value={(() => {
const selectedOption = displayItemList.find((option) => {
return item.itemNo !== '' && 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

View File

@ -8,7 +8,7 @@ import { usePathname, useSearchParams } from 'next/navigation'
import { QcastContext } from '@/app/QcastProvider'
import { sessionStore } from '@/store/commonAtom'
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg, createStoreId = '' }) {
const { setIsGlobalLoading } = useContext(QcastContext)
const { getMessage } = useMessage()
@ -70,6 +70,8 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
pwrGnrSimType: 'D', //default
userId: sessionState.userId ? sessionState.userId : "",
saleStoreId: sessionState.storeId ? sessionState.storeId : "",
storeLvl: sessionState.storeLvl,
createStoreId: createStoreId ? createStoreId : '',
}
const options = { responseType: 'blob' }

View File

@ -54,6 +54,8 @@ export default function StuffDetail() {
const globalLocaleState = useRecoilValue(globalLocaleStore)
const ref = useRef()
const { get, promiseGet, del, promisePost, promisePut } = useAxios(globalLocaleState)
const [createSaleStoreId, setCreateSaleStoreId] = useState('')
//form
const formInitValue = {
// T...() S...()
@ -350,6 +352,9 @@ export default function StuffDetail() {
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
setIsGlobalLoading(false)
if (res.status === 200) {
setCreateSaleStoreId(res?.data?.createSaleStoreId);
if (res?.data?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') {
setShowButton('none')
@ -2936,7 +2941,7 @@ export default function StuffDetail() {
<WindSelectPop setShowWindSpeedButtonValid={setShowWindSpeedButtonValid} prefName={form.watch('prefName')} windSpeedInfo={setWindSppedInfo} />
)}
{estimatePopupOpen && <DocDownOptionPop planNo={popPlanNo} setEstimatePopupOpen={setEstimatePopupOpen} />}
{estimatePopupOpen && <DocDownOptionPop planNo={popPlanNo} setEstimatePopupOpen={setEstimatePopupOpen} createStoreId={createSaleStoreId}/>}
</>
)
}