Compare commits

..

No commits in common. "4e06d28c40776cd2bcf9a88bb5ad62067ed393b5" and "bbf2f14029ff3c0dc157a45f4d7a44fe63da00df" have entirely different histories.

3 changed files with 70 additions and 76 deletions

View File

@ -799,19 +799,17 @@ export default function CircuitTrestleSetting({ id }) {
onFold={() => setIsFold(!isFold)} onFold={() => setIsFold(!isFold)}
/> />
<WithDraggable.Body> <WithDraggable.Body>
<div style={{ display: !(tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY) && isFold ? 'none' : 'block' }}> <div style={{ display: isFold ? 'none' : 'block' }}>
<div style={{ display: tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && isFold ? 'none' : 'block' }}> <div className="roof-module-tab">
<div className="roof-module-tab"> <div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div>
<div className={`module-tab-bx act`}>{getMessage('modal.circuit.trestle.setting.power.conditional.select')}</div> <span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span>
<span className={`tab-arr ${tabNum === 2 ? 'act' : ''}`}></span> <div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}>
<div className={`module-tab-bx ${tabNum === 2 ? 'act' : ''}`}> {getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
{getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
</div>
</div> </div>
</div> </div>
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />} {tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />}
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && ( {tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
<PassivityCircuitAllocation {...passivityProps} ref={passivityCircuitAllocationRef} isFold={isFold} /> <PassivityCircuitAllocation {...passivityProps} ref={passivityCircuitAllocationRef} />
)} )}
{tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />} {tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />}
</div> </div>

View File

@ -1,6 +1,7 @@
import { GlobalDataContext } from '@/app/GlobalDataProvider' import { GlobalDataContext } from '@/app/GlobalDataProvider'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE } from '@/common/common'
import { useMasterController } from '@/hooks/common/useMasterController' import { useMasterController } from '@/hooks/common/useMasterController'
import { useModule } from '@/hooks/module/useModule'
import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle' import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import { useSwal } from '@/hooks/useSwal' import { useSwal } from '@/hooks/useSwal'
@ -10,7 +11,7 @@ import { fontSelector } from '@/store/fontAtom'
import { selectedModuleState } from '@/store/selectedModuleOptions' import { selectedModuleState } from '@/store/selectedModuleOptions'
import { circuitNumDisplaySelector } from '@/store/settingAtom' import { circuitNumDisplaySelector } from '@/store/settingAtom'
import { useContext, useEffect, useState } from 'react' import { useContext, useEffect, useState } from 'react'
import { useRecoilValue } from 'recoil' import { useRecoilState, useRecoilValue } from 'recoil'
import { normalizeDigits } from '@/util/input-utils' import { normalizeDigits } from '@/util/input-utils'
export default function PassivityCircuitAllocation(props) { export default function PassivityCircuitAllocation(props) {
@ -21,7 +22,6 @@ export default function PassivityCircuitAllocation(props) {
getOptYn: getApiProps, getOptYn: getApiProps,
getUseModuleItemList: getSelectedModuleList, getUseModuleItemList: getSelectedModuleList,
getSelectModelList: getSelectModelList, getSelectModelList: getSelectModelList,
isFold,
} = props } = props
const { swalFire } = useSwal() const { swalFire } = useSwal()
const { getMessage } = useMessage() const { getMessage } = useMessage()
@ -497,77 +497,73 @@ export default function PassivityCircuitAllocation(props) {
return ( return (
<> <>
<div className="properties-setting-wrap outer"> <div className="properties-setting-wrap outer">
<div style={{ display: isFold ? 'none' : 'block' }}> <div className="setting-tit">{getMessage('modal.circuit.trestle.setting.circuit.allocation')}</div>
<div className="setting-tit">{getMessage('modal.circuit.trestle.setting.circuit.allocation')}</div> <div className="module-table-box mb10">
<div className="module-table-box mb10"> <div className="module-table-inner">
<div className="module-table-inner"> <div className="bold-font mb10">{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity')}</div>
<div className="bold-font mb10">{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity')}</div> <div className="normal-font mb15">{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.info')}</div>
<div className="normal-font mb15">{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.info')}</div> <div className="roof-module-table overflow-y">
<div className="roof-module-table overflow-y"> {header && (
{header && ( <table>
<table> <thead>
<thead> <tr>
<tr> {header.map((header, index) => (
{header.map((header, index) => ( <th key={'header' + index}>{header.name}</th>
<th key={'header' + index}>{header.name}</th>
))}
</tr>
</thead>
<tbody>
{rows.map((row, index) => (
<tr key={'row' + index}>
{header.map((header, i) => (
<td className="al-c" key={'rowcell' + i}>
{typeof row[header.prop] === 'number'
? (row[header.prop] ?? 0).toLocaleString('ko-KR', { maximumFractionDigits: 4 })
: (row[header.prop] ?? 0)}
</td>
))}
</tr>
))} ))}
<tr> </tr>
</thead>
<tbody>
{rows.map((row, index) => (
<tr key={'row' + index}>
{header.map((header, i) => ( {header.map((header, i) => (
<td className="al-c" key={'footer' + i}> <td className="al-c" key={'rowcell' + i}>
{footer[header.prop]} {typeof row[header.prop] === 'number'
? (row[header.prop] ?? 0).toLocaleString('ko-KR', { maximumFractionDigits: 4 })
: (row[header.prop] ?? 0)}
</td> </td>
))} ))}
</tr> </tr>
</tbody> ))}
</table> <tr>
)} {header.map((header, i) => (
</div> <td className="al-c" key={'footer' + i}>
{footer[header.prop]}
</td>
))}
</tr>
</tbody>
</table>
)}
</div> </div>
</div> </div>
<div className="module-table-box mb10"> </div>
<div className="module-table-inner"> <div className="module-table-box mb10">
<div className="hexagonal-wrap"> <div className="module-table-inner">
<div className="hexagonal-item"> <div className="hexagonal-wrap">
<div className="bold-font"> <div className="hexagonal-item">
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional')} <div className="bold-font">{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional')}</div>
</div>
<div className="hexagonal-item">
{selectedModels.map((model, index) => (
<div className="d-check-radio pop mb10" key={'model' + index}>
<input
type="radio"
name="radio01"
id={`ra0${index + 1}`}
value={model}
checked={selectedPcs?.id === model.id}
onChange={() => setSelectedPcs(model)}
/>
<label htmlFor={`ra0${index + 1}`}>
{model.goodsNo} (
{getMessage(
'modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.info',
managementState?.coldRegionFlg === '1' ? [model.serMinQty, model.serColdZoneMaxQty] : [model.serMinQty, model.serMaxQty],
)}
)
</label>
</div> </div>
</div> ))}
<div className="hexagonal-item">
{selectedModels.map((model, index) => (
<div className="d-check-radio pop mb10" key={'model' + index}>
<input
type="radio"
name="radio01"
id={`ra0${index + 1}`}
value={model}
checked={selectedPcs?.id === model.id}
onChange={() => setSelectedPcs(model)}
/>
<label htmlFor={`ra0${index + 1}`}>
{model.goodsNo} (
{getMessage(
'modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.info',
managementState?.coldRegionFlg === '1' ? [model.serMinQty, model.serColdZoneMaxQty] : [model.serMinQty, model.serMaxQty],
)}
)
</label>
</div>
))}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -21,8 +21,8 @@ export default function SizeSetting(props) {
const { resizeSurfaceShapeBatch } = useSurfaceShapeBatch({}) const { resizeSurfaceShapeBatch } = useSurfaceShapeBatch({})
const widthRef = useRef(null) const widthRef = useRef(null)
const heightRef = useRef(null) const heightRef = useRef(null)
const [width, setWidth] = useState(target?.originWidth ? target.originWidth * 10 : (target.width * 10).toFixed(0)) const [width, setWidth] = useState(target?.originWidth ? (target.originWidth * 10) : 0)
const [height, setHeight] = useState(target?.originHeight ? target.originHeight * 10 : (target.height * 10).toFixed(0)) const [height, setHeight] = useState(target?.originHeight ? (target.originHeight * 10) : 0)
// const { initEvent } = useEvent() // const { initEvent } = useEvent()
// const { initEvent } = useContext(EventContext) // const { initEvent } = useContext(EventContext)