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