Compare commits
No commits in common. "042e42c2cf18c1ae2b68a9a7809307a8ef926fda" and "48dc3d6328d37890563af5fe4189a49f8755d688" have entirely different histories.
042e42c2cf
...
48dc3d6328
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
@ -12,12 +12,10 @@ import {
|
||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import Image from 'next/image'
|
||||
|
||||
const Placement = forwardRef((props, refs) => {
|
||||
const { getMessage } = useMessage()
|
||||
const [useTab, setUseTab] = useState(true)
|
||||
const [guideType, setGuideType] = useState('batch')
|
||||
|
||||
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
|
||||
|
||||
@ -319,91 +317,62 @@ const Placement = forwardRef((props, refs) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="hide-tab-wrap">
|
||||
<div className="hide-check-guide">
|
||||
{getMessage('modal.module.basic.setting.module.placement.info')}
|
||||
<button className={`arr ${useTab ? 'act' : ''}`} onClick={() => setUseTab(!useTab)}></button>
|
||||
<div className="hide-check-guide">
|
||||
<div onClick={() => setUseTab(!useTab)}>
|
||||
{getMessage('modal.module.basic.setting.module.placement.max.size.check')}
|
||||
<button className={`arr ${!useTab ? 'act' : ''}`}></button>
|
||||
</div>
|
||||
<div className={`hide-tab-contents ${!useTab ? 'hide' : ''}`}>
|
||||
<div className="roof-content-tab-wrap">
|
||||
<button className={`btn-frame block modal mr5 ${guideType === 'batch' ? 'act' : ''} `} onClick={() => setGuideType('batch')}>
|
||||
{getMessage('modal.module.basic.setting.module.placement.info.batch')}
|
||||
</button>
|
||||
<button className={`btn-frame block modal mr5 ${guideType === 'module' ? 'act' : ''}`} onClick={() => setGuideType('module')}>
|
||||
{getMessage('modal.module.basic.setting.module.placement.info.module')}
|
||||
</button>
|
||||
</div>
|
||||
<div className={`module-table-box mt10 ${useTab ? 'hide' : ''}`}>
|
||||
<div className="module-table-inner">
|
||||
<div className="roof-module-table">
|
||||
<table className="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowSpan={2} style={{ width: '22%' }}></th>
|
||||
{selectedModules &&
|
||||
selectedModules.itemList?.map((item) => (
|
||||
// <th colSpan={colspan}>
|
||||
<th>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: item.color }}></span>
|
||||
<span className="name">{item.itemNm}</span>
|
||||
</div>
|
||||
</th>
|
||||
))}
|
||||
{colspan > 1 && <th rowSpan={2}>{getMessage('modal.module.basic.setting.module.placement.max.rows.multiple')}</th>}
|
||||
</tr>
|
||||
<tr>
|
||||
{selectedModules &&
|
||||
selectedModules.itemList?.map((item) => (
|
||||
<>
|
||||
<th>{getMessage('modal.module.basic.setting.module.placement.max.row')}</th>
|
||||
{/* {colspan > 1 && <th>{getMessage('modal.module.basic.setting.module.placement.max.rows.multiple')}</th>} */}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{moduleSelectionData.roofConstructions.map((item, index) => (
|
||||
<tr>
|
||||
<td>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: roofOutlineColor(item.addRoof?.index) }}></span>
|
||||
<span className="name">{item.addRoof?.roofMatlNmJp}</span>
|
||||
</div>
|
||||
</td>
|
||||
{moduleRowColArray[index]?.map((item, index2) => (
|
||||
<>
|
||||
<td className="al-c">{item.moduleMaxRows}</td>
|
||||
{/* {colspan > 1 && <td className="al-c">{item.mixModuleMaxRows}</td>} */}
|
||||
{colspan > 1 && index2 === moduleRowColArray[index].length - 1 && <td className="al-c">{item.maxRow}</td>}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{guideType === 'batch' && (
|
||||
<div className={`roof-warning-wrap mt10`}>
|
||||
<div className="guide">
|
||||
{getMessage('modal.module.basic.setting.module.placement.info.batch.content1')}
|
||||
<br />
|
||||
{getMessage('modal.module.basic.setting.module.placement.info.batch.content2')}
|
||||
</div>
|
||||
<div className="roof-warning-img-wrap">
|
||||
<div className="roof-warning-img">
|
||||
<Image src={'/static/images/canvas/roof_warning_correct.png'} width={350} height={198} alt="" />
|
||||
</div>
|
||||
<div className="roof-warning-img">
|
||||
<Image src={'/static/images/canvas/roof_warning_wrong.png'} width={350} height={198} alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{guideType === 'module' && (
|
||||
<div className={`module-table-box mt10 ${!useTab ? 'hide' : ''}`}>
|
||||
<div className="module-table-inner">
|
||||
<div className="roof-module-table">
|
||||
<table className="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowSpan={2} style={{ width: '22%' }}></th>
|
||||
{selectedModules &&
|
||||
selectedModules.itemList?.map((item) => (
|
||||
// <th colSpan={colspan}>
|
||||
<th>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: item.color }}></span>
|
||||
<span className="name">{item.itemNm}</span>
|
||||
</div>
|
||||
</th>
|
||||
))}
|
||||
{colspan > 1 && <th rowSpan={2}>{getMessage('modal.module.basic.setting.module.placement.max.rows.multiple')}</th>}
|
||||
</tr>
|
||||
<tr>
|
||||
{selectedModules &&
|
||||
selectedModules.itemList?.map((item) => (
|
||||
<>
|
||||
<th>{getMessage('modal.module.basic.setting.module.placement.max.row')}</th>
|
||||
{/* {colspan > 1 && <th>{getMessage('modal.module.basic.setting.module.placement.max.rows.multiple')}</th>} */}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{moduleSelectionData.roofConstructions.map((item, index) => (
|
||||
<tr>
|
||||
<td>
|
||||
<div className="color-wrap">
|
||||
<span className="color-box" style={{ backgroundColor: roofOutlineColor(item.addRoof?.index) }}></span>
|
||||
<span className="name">{item.addRoof?.roofMatlNmJp}</span>
|
||||
</div>
|
||||
</td>
|
||||
{moduleRowColArray[index]?.map((item, index2) => (
|
||||
<>
|
||||
<td className="al-c">{item.moduleMaxRows}</td>
|
||||
{/* {colspan > 1 && <td className="al-c">{item.mixModuleMaxRows}</td>} */}
|
||||
{colspan > 1 && index2 === moduleRowColArray[index].length - 1 && <td className="al-c">{item.maxRow}</td>}
|
||||
</>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@ -489,19 +489,6 @@ export const useEstimateController = (planNo, flag) => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleDeleteEstimate = async (canvasStatus) => {
|
||||
try {
|
||||
setIsGlobalLoading(true)
|
||||
await promisePost({ url: `${ESTIMATE_API_ENDPOINT}/delete-estimate`, data: canvasStatus }).then((res) => {
|
||||
if (res.status === 201) {
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('error::::::::::::', e.response.data.message)
|
||||
}
|
||||
setIsGlobalLoading(false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 전각20자 (반각40자)
|
||||
*/
|
||||
@ -522,6 +509,5 @@ export const useEstimateController = (planNo, flag) => {
|
||||
fetchSetting,
|
||||
handleEstimateFileDownload,
|
||||
handleEstimateCopy,
|
||||
handleDeleteEstimate,
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,6 +159,5 @@ export const useLine = () => {
|
||||
addPitchText,
|
||||
removePitchText,
|
||||
addPitchTextsByOuterLines,
|
||||
getLengthByLine,
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusCon
|
||||
import { useCanvasMenu } from './common/useCanvasMenu'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { unescapeString } from '@/util/common-utils'
|
||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||
|
||||
/**
|
||||
* 플랜 처리 훅
|
||||
@ -55,7 +54,7 @@ export function usePlan(params = {}) {
|
||||
const { getMessage } = useMessage()
|
||||
const { get, post, promisePost, promisePut, promiseDel, promiseGet } = useAxios()
|
||||
|
||||
const { setEstimateContextState, handleDeleteEstimate } = useEstimateController()
|
||||
const { setEstimateContextState } = useEstimateController()
|
||||
|
||||
const resetOuterLinePoints = useResetRecoilState(outerLinePointsState)
|
||||
const resetPlacementShapeDrawingPoints = useResetRecoilState(placementShapeDrawingPointsState)
|
||||
@ -80,8 +79,6 @@ export function usePlan(params = {}) {
|
||||
//선택된 모듈 배치면 초기화
|
||||
const resetModuleSetupSurface = useResetRecoilState(moduleSetupSurfaceState)
|
||||
|
||||
const { isAllComplete } = useTrestle()
|
||||
|
||||
/**
|
||||
* 마우스 포인터의 가이드라인 제거
|
||||
*/
|
||||
@ -175,11 +172,7 @@ export function usePlan(params = {}) {
|
||||
*/
|
||||
const saveCanvas = async (saveAlert = true) => {
|
||||
const canvasStatus = currentCanvasData('save')
|
||||
const result = await putCanvasStatus(canvasStatus, saveAlert)
|
||||
//캔버스 저장 완료 후
|
||||
if (result && !isAllComplete()) {
|
||||
handleDeleteEstimate(currentCanvasPlan)
|
||||
}
|
||||
await putCanvasStatus(canvasStatus, saveAlert)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -325,24 +318,20 @@ export function usePlan(params = {}) {
|
||||
* @param {boolean} saveAlert - 저장 완료 알림 표시 여부
|
||||
*/
|
||||
const putCanvasStatus = async (canvasStatus, saveAlert = true) => {
|
||||
let rtn = false
|
||||
const planData = {
|
||||
id: currentCanvasPlan.id,
|
||||
bgImageName: currentCanvasPlan?.bgImageName ?? null,
|
||||
mapPositionAddress: currentCanvasPlan?.mapPositionAddress ?? null,
|
||||
canvasStatus: canvasToDbFormat(canvasStatus),
|
||||
}
|
||||
|
||||
await promisePut({ url: '/api/canvas-management/canvas-statuses', data: planData })
|
||||
.then((res) => {
|
||||
setPlans((plans) => plans.map((plan) => (plan.id === currentCanvasPlan.id ? { ...plan, canvasStatus: canvasStatus } : plan)))
|
||||
if (saveAlert) swalFire({ text: getMessage('plan.message.save') })
|
||||
rtn = true
|
||||
})
|
||||
.catch((error) => {
|
||||
swalFire({ text: error.message, icon: 'error' })
|
||||
})
|
||||
return rtn
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -15,7 +15,6 @@ import { flowDisplaySelector } from '@/store/settingAtom'
|
||||
import { fontSelector } from '@/store/fontAtom'
|
||||
import { QLine } from '@/components/fabric/QLine'
|
||||
import { LINE_TYPE, POLYGON_TYPE } from '@/common/common'
|
||||
import { useLine } from '@/hooks/useLine'
|
||||
|
||||
export const usePolygon = () => {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
@ -25,8 +24,6 @@ export const usePolygon = () => {
|
||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||
const pitchText = useRecoilValue(pitchTextSelector)
|
||||
|
||||
const { getLengthByLine } = useLine()
|
||||
|
||||
const addPolygon = (points, options, isAddCanvas = true) => {
|
||||
const polygon = new QPolygon(points, {
|
||||
...options,
|
||||
@ -1096,37 +1093,25 @@ export const usePolygon = () => {
|
||||
})
|
||||
|
||||
if (startFlag && endFlag) {
|
||||
if (!representLines.includes(line) && line.attributes.type === LINE_TYPE.WALLLINE.EAVES) {
|
||||
if (!representLines.includes(line)) {
|
||||
representLines.push(line)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// blue로 생성된 것들은 대표라인이 될 수 없음.
|
||||
representLines = representLines.filter((line) => line.stroke !== 'blue')
|
||||
// representLines중 가장 긴 line을 찾는다.
|
||||
representLines.forEach((line) => {
|
||||
if (!representLine) {
|
||||
representLine = line
|
||||
} else {
|
||||
if (getLengthByLine(representLine) < getLengthByLine(line)) {
|
||||
if (representLine.length < line.length) {
|
||||
representLine = line
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (!representLine) {
|
||||
representLines = representLines.filter((line) => line.stroke !== 'blue')
|
||||
representLines.forEach((line) => {
|
||||
if (!representLine) {
|
||||
representLine = line
|
||||
} else {
|
||||
if (representLine.length < line.length) {
|
||||
representLine = line
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const direction = polygon.direction ?? representLine?.direction ?? ''
|
||||
const direction = polygon.direction ?? representLine?.direction
|
||||
const polygonDirection = polygon.direction
|
||||
|
||||
switch (direction) {
|
||||
|
||||
@ -1105,11 +1105,6 @@
|
||||
"module.layout.setup.max.count": "モジュールの単体での最大段数は{0}、最大列数は{1}です。 (JA)",
|
||||
"module.layout.setup.max.count.multiple": "モジュール{0}の単体での最大段数は{1}、最大列数は{2}です。 (JA)",
|
||||
"roofAllocation.not.found": "割り当てる屋根がありません。 (JA)",
|
||||
"modal.module.basic.setting.module.placement.info": "モジュール配置案内",
|
||||
"modal.module.basic.setting.module.placement.info.batch": "千鳥配置を手動で行う際の注意事項",
|
||||
"modal.module.basic.setting.module.placement.info.batch.content1": "千鳥配置する時に図のような配置ができてしまいますが、正常な積算ができません。",
|
||||
"modal.module.basic.setting.module.placement.info.batch.content2": "千鳥で配置する時は、千鳥配置を「する」にして、モジュールが吸着されるようにして下さい。",
|
||||
"modal.module.basic.setting.module.placement.info.module": "屋根材別 単一・混合モジュールの最大段数",
|
||||
"modal.module.basic.setting.module.placement.max.size.check": "屋根材別モジュールの単体の単体での最大段数、2種混合の段数を確認して下さい",
|
||||
"modal.module.basic.setting.module.placement.max.row": "単体で\rの最大段数",
|
||||
"modal.module.basic.setting.module.placement.max.rows.multiple": "2種混合時\rの最大段数",
|
||||
|
||||
@ -1105,11 +1105,6 @@
|
||||
"module.layout.setup.max.count": "모듈의 최대 단수는 {0}, 최대 열수는 {1} 입니다.",
|
||||
"module.layout.setup.max.count.multiple": "모듈 {0}번의 최대 단수는 {1}, 최대 열수는 {2} 입니다.",
|
||||
"roofAllocation.not.found": "할당할 지붕이 없습니다.",
|
||||
"modal.module.basic.setting.module.placement.info": "모듈 배치 안내",
|
||||
"modal.module.basic.setting.module.placement.info.batch": "치도리 수동 배치 시 유의사항",
|
||||
"modal.module.basic.setting.module.placement.info.batch.content1": "치조 배치할 때 그림과 같은 배치가 되어 버립니다만, 정상적인 적산을 할 수 없습니다.",
|
||||
"modal.module.basic.setting.module.placement.info.batch.content2": "치조로 배치할 때는, 치조 배치를 「한다」로 하고, 모듈이 흡착되도록 해 주세요.",
|
||||
"modal.module.basic.setting.module.placement.info.module": "지붕재별 단일·혼합 모듈 최대 단수",
|
||||
"modal.module.basic.setting.module.placement.max.size.check": "지붕재별 모듈 단체의 최대 단수, 2종 혼합 단수를 확인하십시오.",
|
||||
"modal.module.basic.setting.module.placement.max.row": "최대 단수",
|
||||
"modal.module.basic.setting.module.placement.max.rows.multiple": "2종 혼합 최대단수",
|
||||
|
||||
@ -2457,22 +2457,3 @@ $alert-color: #101010;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2025-05-30 지붕 모듈
|
||||
.roof-warning-img-wrap{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.roof-content-tab-wrap{
|
||||
display: flex;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.hide-tab-contents{
|
||||
&.hide{
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user