Compare commits

...

19 Commits

Author SHA1 Message Date
김민식
4056206af7 api: getModuleTypeItemList에 storeId 추가 2025-06-19 10:15:01 +09:00
김민식
bddc753e52 [1118] : [【HANASYS DESIGN】CST053 - DTスリムの強化施工・多雪施工が設置出来ない。]
[작업내용] : 하제비치 수정시 하위 항목 초기화
2025-06-19 10:14:34 +09:00
김민식
c464632b1a [1114] : [【HANASYS DESIGN】HuaweiPCSで併設用のPCSを積算できない。]
[작업내용] : pscItem 비교시 series조건 추가
2025-06-19 10:13:43 +09:00
e4d6d3ab0d 오른쪽 아래 없는 경우 계산 수정 2025-06-17 15:28:37 +09:00
be399a1b52 [1099] 【HANASYS DESIGN】強化施工・多雪施工で千鳥配置できるモジュールの積算がおかしい。
견적데이터 이상 수정
2025-06-17 15:16:51 +09:00
Jaeyoung Lee
7c25ad0452 Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into dev 2025-06-17 10:39:28 +09:00
Jaeyoung Lee
c869d6c44d 지붕덮개 계산식 수정 2025-06-17 10:39:22 +09:00
1c6071b67c Merge pull request '[1104] 견적서에서 Plan 이동이후 모듈가대로 오면 이전Plan으로 되는 오류 + 시뮬레이션에서 모듈가대로 오면 plan 없어지는 오류' (#122) from feature/ysCha into dev
Reviewed-on: #122
2025-06-16 17:12:56 +09:00
fe8723fd8c [1104] 견적서에서 Plan 이동이후 모듈가대로 오면 이전Plan으로 되는 오류 + 시뮬레이션에서 모듈가대로 오면 plan 없어지는 오류 2025-06-16 17:11:53 +09:00
Jaeyoung Lee
f45862568f 지붕덮개 버그 수정 2025-06-16 14:03:50 +09:00
Jaeyoung Lee
7d5a235b95 불필요한 로그 및 확인용 포인트 제거 2025-06-13 14:59:28 +09:00
Jaeyoung Lee
0430be1945 Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into dev 2025-06-13 14:44:16 +09:00
Jaeyoung Lee
f1d2cfea5b 지붕덮개 처마.케라바 변경 대응 2025-06-13 14:43:58 +09:00
2e6fef951c Merge pull request 'feature/ysCha' (#117) from feature/ysCha into dev
Reviewed-on: #117
2025-06-12 13:10:45 +09:00
2315bb5eca Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha 2025-06-12 13:09:00 +09:00
13547f8a2a [1104] 우편번호를 검색 2025-06-12 13:08:31 +09:00
87e70d51c1 Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha 2025-06-10 18:17:50 +09:00
daf5ec9ce2 Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha 2025-06-10 14:45:02 +09:00
351df68762 Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha 2025-06-09 17:08:10 +09:00
13 changed files with 3085 additions and 2813 deletions

View File

@ -244,21 +244,10 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
const types = []
this.lines.forEach((line) => types.push(line.attributes.type))
const eavesType = [LINE_TYPE.WALLLINE.EAVES, LINE_TYPE.WALLLINE.HIPANDGABLE]
const gableType = [LINE_TYPE.WALLLINE.GABLE, LINE_TYPE.WALLLINE.JERKINHEAD]
// const isEaves = types.every((type) => eavesType.includes(type))
const gableOdd = types.filter((type, i) => i % 2 === 0)
const gableEven = types.filter((type, i) => i % 2 === 1)
const hasShed = types.includes(LINE_TYPE.WALLLINE.SHED)
// A형, B형 박공 지붕
/* if (
(gableOdd.every((type) => type === LINE_TYPE.WALLLINE.EAVES) && gableEven.every((type) => gableType.includes(type))) ||
(gableEven.every((type) => type === LINE_TYPE.WALLLINE.EAVES) && gableOdd.every((type) => gableType.includes(type)))
) {
drawGabledRoof(this.id, this.canvas, textMode)
} else*/
if (hasShed) {
const sheds = this.lines.filter((line) => line.attributes !== undefined && line.attributes.type === LINE_TYPE.WALLLINE.SHED)
const areLinesParallel = function (line1, line2) {

View File

@ -25,7 +25,7 @@ import { useCommonUtils } from '@/hooks/common/useCommonUtils'
import useMenu from '@/hooks/common/useMenu'
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
import { useAxios } from '@/hooks/useAxios'
import { canvasSettingState, canvasState, canvasZoomState, currentMenuState, verticalHorizontalModeState } from '@/store/canvasAtom'
import { canvasSettingState, canvasState, canvasZoomState, currentMenuState, verticalHorizontalModeState, currentCanvasPlanState } from '@/store/canvasAtom'
import { sessionStore } from '@/store/commonAtom'
import { outerLinePointsState } from '@/store/outerLineAtom'
import { appMessageStore, globalLocaleStore } from '@/store/localeAtom'
@ -52,6 +52,7 @@ import { useRoofFn } from '@/hooks/common/useRoofFn'
import { usePolygon } from '@/hooks/usePolygon'
import { useTrestle } from '@/hooks/module/useTrestle'
export default function CanvasMenu(props) {
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
const { selectedMenu, setSelectedMenu } = props
const pathname = usePathname()
const router = useRouter()
@ -234,7 +235,7 @@ export default function CanvasMenu(props) {
router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
setSelectedMenu('module')
}
await reloadCanvasStatus(objectNo, pid)
await reloadCanvasStatus(objectNo, currentCanvasPlan?.planNo ?? pid)
break
case 'estimate':
if (!isAllComplete()) {

View File

@ -174,6 +174,19 @@ const Trestle = forwardRef((props, ref) => {
})
}
const onChangeHajebichi = (e) => {
setHajebichi(e)
dispatch({
type: 'SET_HAJEBICHI',
roof: {
moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode,
hajebichi: e,
},
})
}
const onChangeTrestleMaker = (e) => {
setSelectedTrestle(e)
dispatch({
@ -578,7 +591,7 @@ const Trestle = forwardRef((props, ref) => {
type="text"
className="input-origin block"
disabled={selectedRoof.roofPchAuth === 'R'}
onChange={(e) => setHajebichi(e.target.value)}
onChange={(e) => onChangeHajebichi(e.target.value)}
value={hajebichi}
/>
</div>

View File

@ -5,6 +5,7 @@ import { useMasterController } from '@/hooks/common/useMasterController'
import { useMessage } from '@/hooks/useMessage'
import { useSwal } from '@/hooks/useSwal'
import { pcsCheckState } from '@/store/circuitTrestleAtom'
import { sessionStore } from '@/store/commonAtom'
import { globalLocaleStore } from '@/store/localeAtom'
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
import { isNullOrUndefined } from '@/util/common-utils'
@ -38,6 +39,7 @@ export default function PowerConditionalSelect(props) {
} = props
const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState)
const sessionState = useRecoilValue(sessionStore)
const { getMessage } = useMessage()
const [selectedRow, setSelectedRow] = useState(null)
const globalLocale = useRecoilValue(globalLocaleStore)
@ -132,7 +134,7 @@ export default function PowerConditionalSelect(props) {
mixMatlNo: item.mixMatlNo,
}
})
getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList }).then((res) => {
getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList, storeId: sessionState.storeId }).then((res) => {
if (res?.result.code === 200 && res?.data) {
setModels(
res.data.map((model) => {
@ -177,7 +179,7 @@ export default function PowerConditionalSelect(props) {
if (selectedMaker.pcsMkrMultiType === PCS_MKR_MULTI_TYPE.MULTI) {
setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }])
} else if (!selectedModels.find((m) => m.itemId === selectedRow.itemId)) {
} else if (!selectedModels.find((m) => m.itemId === selectedRow.itemId && m.pcsSerCd === selectedRow.pcsSerCd)) {
setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }])
}
setSelectedRow(null)

View File

@ -18,7 +18,7 @@ export default function WallMerge({ offsetRef, radioTypeRef }) {
<div className="eaves-keraba-th">
<div className="d-check-radio pop">
<input type="radio" name="radio01" id="ra01" value="1" checked={type === '1'} onChange={(e) => onChange(e)} />
<label htmlFor="ra01">{getMessage('has.sleeve')}</label>
<label htmlFor="ra01">{getMessage('has.not.sleeve')}</label>
</div>
</div>
<div className="eaves-keraba-td">
@ -31,7 +31,7 @@ export default function WallMerge({ offsetRef, radioTypeRef }) {
<div className="eaves-keraba-th">
<div className="d-check-radio pop">
<input type="radio" name="radio01" id="ra02" value="2" checked={type === '2'} onChange={(e) => onChange(e)} />
<label htmlFor="ra02">{getMessage('has.not.sleeve')}</label>
<label htmlFor="ra02">{getMessage('has.sleeve')}</label>
</div>
</div>
<div className="eaves-keraba-td">

View File

@ -952,9 +952,18 @@ export default function StuffDetail() {
//
const setZipInfo = (info) => {
setPrefValue(info.prefId)
form.setValue('prefId', info.prefId)
form.setValue('prefName', info.address1)
prefCodeList.map((row) => {
if (row.prefName == info.address1) {
setPrefValue(row.prefId)
form.setValue('prefId', row.prefId)
form.setValue('prefName', info.address1)
}
})
//setPrefValue(info.prefId)
// form.setValue('prefId', info.prefId)
// form.setValue('prefName', info.address1)
form.setValue('address', info.address2 + info.address3)
form.setValue('zipNo', info.zipNo)
}

View File

@ -1,7 +1,9 @@
import { useAxios } from '@/hooks/useAxios'
import { useMessage } from '@/hooks/useMessage'
import { useSwal } from '@/hooks/useSwal'
import { sessionStore } from '@/store/commonAtom'
import { getQueryString } from '@/util/common-utils'
import { useRecoilValue } from 'recoil'
/**
* 마스터 컨트롤러
@ -11,6 +13,7 @@ export function useMasterController() {
const { get, post, put } = useAxios()
const { getMessage } = useMessage()
const { swalFire } = useSwal()
const sessionState = useRecoilValue(sessionStore)
/**
* 지붕재 목록 조회
@ -34,7 +37,7 @@ export function useMasterController() {
return null
}
const paramString = `?${paramArr.map((item) => `arrRoofMatlCd=${item}`).join('&')}`
return await get({ url: `/api/v1/master/getModuleTypeItemList${paramString}` }).then((res) => {
return await get({ url: `/api/v1/master/getModuleTypeItemList${paramString}&storeId=${sessionState.storeId}` }).then((res) => {
// console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
return res
})

View File

@ -12,6 +12,7 @@ const trestleReducer = (state, action) => {
switch (action.type) {
case 'SET_LENGTH':
case 'SET_RAFT_BASE':
case 'SET_HAJEBICHI':
case 'SET_TRESTLE_MAKER':
case 'SET_CONST_MTHD':
case 'SET_ROOF_BASE':

View File

@ -2726,16 +2726,26 @@ export const useTrestle = () => {
moduleRowResultData.touchedHalfSurfaceBracketCnt += 1
} else if (!halfBottomLeftModule && !findSamePointInBottom(exposedBottomModules, module, direction)) {
// 왼쪽 아래가 없고, 하단에 같은 점이 없는 경우는 touched는 1개, exposed는 2개
moduleRowResultData.exposedHalfBottomBracketCnt += 1
moduleRowResultData.touchedHalfSurfaceBracketCnt += 2
if (level % 2 === 0) {
moduleRowResultData.exposedHalfBottomBracketCnt += 1
moduleRowResultData.touchedHalfSurfaceBracketCnt += 2
} else {
moduleRowResultData.exposedHalfBottomBracketCnt += 2
moduleRowResultData.touchedHalfSurfaceBracketCnt += 1
}
} else if (!halfBottomRightModule && findSamePointInBottom(exposedBottomModules, module, direction)) {
// 오른쪽 아래가 없고, 하단에 같은 점이 있는 경우는 exposed는 2개, touched는 1개
moduleRowResultData.exposedHalfBottomBracketCnt += 1
moduleRowResultData.touchedHalfSurfaceBracketCnt += 2
} else if (!halfBottomRightModule && !findSamePointInBottom(exposedBottomModules, module, direction)) {
// 오른쪽 아래가 없고, 하단에 같은 점이 없는 경우는 exposed는 1개, touched는 2개
moduleRowResultData.exposedHalfBottomBracketCnt += 2
moduleRowResultData.touchedHalfSurfaceBracketCnt += 1
if (level % 2 === 0) {
moduleRowResultData.exposedHalfBottomBracketCnt += 2
moduleRowResultData.touchedHalfSurfaceBracketCnt += 1
} else {
moduleRowResultData.exposedHalfBottomBracketCnt += 1
moduleRowResultData.touchedHalfSurfaceBracketCnt += 2
}
}
}
}
@ -2774,6 +2784,20 @@ export const useTrestle = () => {
if (rackYn === 'N') {
if (rackQty !== 3) {
moduleRowResultData.exposedHalfTopBracketCnt += rackQty / 2
} else {
if (halfTopLeftModule) {
if (level % 2 === 0) {
moduleRowResultData.exposedHalfTopBracketCnt += 2
} else {
moduleRowResultData.exposedHalfTopBracketCnt += 1
}
} else if (halfTopRightModule) {
if (level % 2 === 0) {
moduleRowResultData.exposedHalfTopBracketCnt += 1
} else {
moduleRowResultData.exposedHalfTopBracketCnt += 2
}
}
}
}
} else if (!halfTopLeftModule && !halfTopRightModule) {

View File

@ -61,8 +61,7 @@ export function useEavesGableEdit(id) {
const wallLines = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.WALL)
const outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
wallLines.forEach((wallLine) => {
const id = wallLine.id
wallLine.lines = outerLines.filter((line) => line.attributes?.wallId === id)
wallLine.lines = outerLines.filter((line) => line.attributes?.wallId === wallLine.id).sort((a, b) => a.idx - b.idx)
})
wallLines.forEach((wallLine) => {
convertPolygonToLines(wallLine)
@ -77,6 +76,41 @@ export function useEavesGableEdit(id) {
convertLinesToPolygon(wallLine)
})
initEvent()
const outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
outerLines.forEach((line) => {
let stroke, strokeWidth
if (line.attributes) {
if (line.attributes.type === LINE_TYPE.WALLLINE.EAVES || line.attributes.type === LINE_TYPE.WALLLINE.HIPANDGABLE) {
stroke = '#45CD7D'
strokeWidth = 4
} else if (line.attributes.type === LINE_TYPE.WALLLINE.GABLE || line.attributes.type === LINE_TYPE.WALLLINE.JERKINHEAD) {
stroke = '#3FBAE6'
strokeWidth = 4
} else {
stroke = '#000000'
strokeWidth = 4
}
line.set({
visible: true,
stroke,
strokeWidth,
selectable: false,
})
line.bringToFront()
}
})
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
roofs.forEach((roof) => {
roof.innerLines.forEach((line) => {
line.set({ selectable: true })
line.bringToFront()
})
})
canvas.renderAll()
}
}, [])
@ -106,6 +140,7 @@ export function useEavesGableEdit(id) {
}
const mouseDownEvent = (e) => {
canvas.discardActiveObject()
if (!e.target || (e.target && e.target.name !== 'outerLine')) {
return
}

View File

@ -3,18 +3,16 @@ import { fabric } from 'fabric'
import { actionHandler, anchorWrapper, polygonPositionHandler } from '@/util/canvas-util'
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
import { useRecoilState, useRecoilValue, useResetRecoilState } from 'recoil'
import { canvasSizeState, canvasState, canvasZoomState, fontSizeState } from '@/store/canvasAtom'
import { QLine } from '@/components/fabric/QLine'
import { QPolygon } from '@/components/fabric/QPolygon'
import { defineQLine } from '@/util/qline-utils'
import { defineQPloygon } from '@/util/qpolygon-utils'
import { defineQPolygon } from '@/util/qpolygon-utils'
import { writeImage } from '@/lib/canvas'
import { useCanvasEvent } from '@/hooks/useCanvasEvent'
import { useAxios } from '@/hooks/useAxios'
import { useFont } from '@/hooks/common/useFont'
import { OBJECT_PROTOTYPE, POLYGON_TYPE, RELOAD_TYPE_PROTOTYPE, SAVE_KEY } from '@/common/common'
import { usePlan } from './usePlan'
import { OBJECT_PROTOTYPE, SAVE_KEY } from '@/common/common'
import { imageDisplaySelector } from '@/store/settingAtom'
export function useCanvas(id) {
@ -140,7 +138,7 @@ export function useCanvas(id) {
QPolygon.prototype.canvas = canvas
QLine.prototype.canvas = canvas
defineQLine()
defineQPloygon()
defineQPolygon()
}
/**
@ -376,6 +374,8 @@ export function useCanvas(id) {
/**
* 이미지로 저장하는 함수
* @param {string} title - 저장할 이미지 이름
* @param userId
* @param setThumbnails
*/
const saveImage = async (title = 'canvas', userId, setThumbnails) => {
removeMouseLines()

View File

@ -551,6 +551,30 @@ export function isPointOnLine({ x1, y1, x2, y2 }, { x, y }, epsilon = 2) {
return withinXRange && withinYRange
}
/**
* 라인위에 좌표가 존재하는지 확인한다. 함수가 끝포인트를 계산 못하는 경우가 발생하여 신규 추가.
* @param line - 라인 좌표
* @param point - 확인 좌표
* @param tolerance - 오차 허용 범위 (기본값 0.1)
* @returns {boolean}
*/
export function isPointOnLineNew({ x1, y1, x2, y2 }, { x, y }, tolerance = 0.1) {
// 1. 거리 계산을 통한 방법
const d1 = Math.sqrt(Math.pow(x - x1, 2) + Math.pow(y - y1, 2))
const d2 = Math.sqrt(Math.pow(x - x2, 2) + Math.pow(y - y2, 2))
const lineLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2))
// 점이 선분 위에 있다면, 두 끝점까지의 거리의 합이 선분의 길이와 같아야 함
const diff = Math.abs(d1 + d2 - lineLength)
// 2. 점이 선분의 범위 내에 있는지 확인
const isWithinBounds =
x >= Math.min(x1, x2) - tolerance && x <= Math.max(x1, x2) + tolerance && y >= Math.min(y1, y2) - tolerance && y <= Math.max(y1, y2) + tolerance
return diff <= tolerance && isWithinBounds
}
/**
* 점과 가까운 line 찾기
* @param point

File diff suppressed because it is too large Load Diff