dev #498
@ -23,6 +23,7 @@ import { QcastContext } from '@/app/QcastProvider'
|
|||||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { sanitizeIntegerInputEvent } from '@/util/input-utils'
|
import { sanitizeIntegerInputEvent } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function StuffDetail() {
|
export default function StuffDetail() {
|
||||||
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
||||||
@ -1204,8 +1205,10 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 저장
|
// 저장
|
||||||
const onValid = async () => {
|
const onValid = async (actionType) => {
|
||||||
const formData = form.getValues()
|
const formData = form.getValues();
|
||||||
|
if(actionType !== 'save') return false
|
||||||
|
console.log('Action type:', actionType); // 'save' 또는 'tempSave'
|
||||||
let errors = {}
|
let errors = {}
|
||||||
let fieldNm
|
let fieldNm
|
||||||
|
|
||||||
@ -1715,7 +1718,7 @@ export default function StuffDetail() {
|
|||||||
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@ -2113,13 +2116,25 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-light"*/}
|
||||||
|
{/* onInput={handleKeyUp}*/}
|
||||||
|
{/* onBlur={handleBlur}*/}
|
||||||
|
{/* value={form.watch('verticalSnowCover') || ''}*/}
|
||||||
|
{/* {...register('verticalSnowCover')}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-light"
|
className="input-light"
|
||||||
onInput={handleKeyUp}
|
|
||||||
onBlur={handleBlur}
|
|
||||||
value={form.watch('verticalSnowCover') || ''}
|
value={form.watch('verticalSnowCover') || ''}
|
||||||
{...register('verticalSnowCover')}
|
onChange={()=>{}}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="mr10">cm</span>
|
<span className="mr10">cm</span>
|
||||||
@ -2173,13 +2188,25 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-light"*/}
|
||||||
|
{/* onInput={handleKeyUp}*/}
|
||||||
|
{/* onBlur={handleBlur}*/}
|
||||||
|
{/* value={form.watch('installHeight') || ''}*/}
|
||||||
|
{/* {...register('installHeight')}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-light"
|
className="input-light"
|
||||||
onInput={handleKeyUp}
|
|
||||||
onBlur={handleBlur}
|
|
||||||
value={form.watch('installHeight') || ''}
|
value={form.watch('installHeight') || ''}
|
||||||
{...register('installHeight')}
|
onChange={()=>{}}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span>m</span>
|
<span>m</span>
|
||||||
@ -2216,7 +2243,7 @@ export default function StuffDetail() {
|
|||||||
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@ -2253,7 +2280,7 @@ export default function StuffDetail() {
|
|||||||
>
|
>
|
||||||
{getMessage('stuff.detail.btn.moveList')}
|
{getMessage('stuff.detail.btn.moveList')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
|
||||||
@ -2267,7 +2294,7 @@ export default function StuffDetail() {
|
|||||||
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@ -2685,13 +2712,25 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-light"*/}
|
||||||
|
{/* onInput={handleKeyUp}*/}
|
||||||
|
{/* onBlur={handleBlur}*/}
|
||||||
|
{/* value={form.watch('verticalSnowCover') || ''}*/}
|
||||||
|
{/* {...register('verticalSnowCover')}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-light"
|
className="input-light"
|
||||||
onInput={handleKeyUp}
|
|
||||||
onBlur={handleBlur}
|
|
||||||
value={form.watch('verticalSnowCover') || ''}
|
value={form.watch('verticalSnowCover') || ''}
|
||||||
{...register('verticalSnowCover')}
|
onChange={()=>{}}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="mr10">cm</span>
|
<span className="mr10">cm</span>
|
||||||
@ -2748,13 +2787,26 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
<div className="input-wrap mr10" style={{ width: '200px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-light"*/}
|
||||||
|
{/* onInput={handleKeyUp}*/}
|
||||||
|
{/* onBlur={handleBlur}*/}
|
||||||
|
{/* value={form.watch('installHeight') || ''}*/}
|
||||||
|
{/* {...register('installHeight')}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-light"
|
className="input-light"
|
||||||
onInput={handleKeyUp}
|
|
||||||
onBlur={handleBlur}
|
|
||||||
value={form.watch('installHeight') || ''}
|
value={form.watch('installHeight') || ''}
|
||||||
{...register('installHeight')}
|
onChange={()=>{}}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span>m</span>
|
<span>m</span>
|
||||||
@ -2835,7 +2887,7 @@ export default function StuffDetail() {
|
|||||||
>
|
>
|
||||||
{getMessage('stuff.detail.btn.moveList')}
|
{getMessage('stuff.detail.btn.moveList')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
|
||||||
@ -2849,7 +2901,7 @@ export default function StuffDetail() {
|
|||||||
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
<button type="button" className="btn-origin grey mr5" onClick={onTempSave} style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.tempSave')}
|
{getMessage('stuff.detail.btn.tempSave')}
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||||
{getMessage('stuff.detail.btn.save')}
|
{getMessage('stuff.detail.btn.save')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user