Merge branch 'dev' into dev-yj

This commit is contained in:
yjnoh 2025-03-14 18:19:16 +09:00
commit 801a97ca75
21 changed files with 123 additions and 136 deletions

View File

@ -202,6 +202,7 @@ export const SAVE_KEY = [
'fontStyle', 'fontStyle',
'fontWeight', 'fontWeight',
'dormerAttributes', 'dormerAttributes',
'toFixed',
] ]
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype]

View File

@ -3,16 +3,7 @@
import { useState } from 'react' import { useState } from 'react'
import Draggable from 'react-draggable' import Draggable from 'react-draggable'
export default function WithDraggable({ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
isShow,
children,
pos = { x: 0, y: 0 },
handle = '',
className = '',
isModal = true,
hasFooter = true,
isHidden = false,
}) {
const [position, setPosition] = useState(pos) const [position, setPosition] = useState(pos)
const handleOnDrag = (e, data) => { const handleOnDrag = (e, data) => {
@ -31,14 +22,10 @@ export default function WithDraggable({
onDrag={(e, data) => handleOnDrag(e, data)} onDrag={(e, data) => handleOnDrag(e, data)}
handle={handle === '' ? '.modal-handle' : handle} handle={handle === '' ? '.modal-handle' : handle}
> >
{isModal ? ( <div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}> {children}
{children} {hasFooter && <WithDraggableFooter />}
{hasFooter && <WithDraggableFooter />} </div>
</div>
) : (
<>{children}</>
)}
</Draggable> </Draggable>
)} )}
</> </>
@ -68,15 +55,10 @@ function WithDraggableBody({ children }) {
) )
} }
function WithDraggablePanel({ children }) {
return <>{children}</>
}
function WithDraggableFooter() { function WithDraggableFooter() {
return <div className="modal-foot modal-handle"></div> return <div className="modal-foot modal-handle"></div>
} }
WithDraggable.Header = WithDraggableHeader WithDraggable.Header = WithDraggableHeader
WithDraggable.Body = WithDraggableBody WithDraggable.Body = WithDraggableBody
WithDraggable.Panel = WithDraggablePanel
WithDraggable.Footer = WithDraggableFooter WithDraggable.Footer = WithDraggableFooter

View File

@ -480,10 +480,6 @@ export default function Estimate({}) {
//Pricing //Pricing
const handlePricing = async (showPriceCd) => { const handlePricing = async (showPriceCd) => {
//todo: YJSS swalFire
if (estimateContextState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
const param = { const param = {
saleStoreId: session.storeId, saleStoreId: session.storeId,
sapSalesStoreCd: session.custCd, sapSalesStoreCd: session.custCd,
@ -699,14 +695,10 @@ export default function Estimate({}) {
/* 케이블 select 변경시 */ /* 케이블 select 변경시 */
const onChangeDisplayCableItem = (value, itemList) => { const onChangeDisplayCableItem = (value, itemList) => {
//todo: YJSS swalFire
if (estimateContextState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
itemList.map((item, index) => { itemList.map((item, index) => {
if (item.dispCableFlg === '1') { if (item.dispCableFlg === '1') {
if (value !== '') { if (value !== '') {
onChangeDisplayItem(value, item.dispOrder, index) onChangeDisplayItem(value, item.dispOrder, index, true)
} }
} }
}) })
@ -714,11 +706,7 @@ export default function Estimate({}) {
} }
// / // /
const onChangeDisplayItem = (itemId, dispOrder, index) => { const onChangeDisplayItem = (itemId, dispOrder, index, flag) => {
//todo: YJSS swalFire
if (estimateContextState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
const param = { const param = {
itemId: itemId, itemId: itemId,
coldZoneFlg: estimateContextState?.coldRegionFlg, coldZoneFlg: estimateContextState?.coldRegionFlg,
@ -748,7 +736,7 @@ export default function Estimate({}) {
updates.itemGroup = res.itemGroup updates.itemGroup = res.itemGroup
updates.delFlg = '0' // 0 updates.delFlg = '0' // 0
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString() updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
updates.amount = '' updates.amount = flag ? estimateContextState.itemList[index].amount : ''
updates.openFlg = res.openFlg updates.openFlg = res.openFlg
if (estimateContextState.estimateType === 'YJSS') { if (estimateContextState.estimateType === 'YJSS') {
@ -1032,7 +1020,6 @@ export default function Estimate({}) {
}) })
let dispCableFlgCnt = 0 let dispCableFlgCnt = 0
estimateContextState.itemList.forEach((item) => { estimateContextState.itemList.forEach((item) => {
// console.log('YJSS::::::::', item)
if (item.delFlg === '0') { if (item.delFlg === '0') {
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
let salePrice let salePrice
@ -1068,7 +1055,6 @@ export default function Estimate({}) {
} }
if (item.dispCableFlg === '1') { if (item.dispCableFlg === '1') {
// console.log('YJSS22222::::::::', item)
dispCableFlgCnt++ dispCableFlgCnt++
setCableItem(item.itemId) setCableItem(item.itemId)
} }
@ -1356,7 +1342,7 @@ export default function Estimate({}) {
</th> </th>
<td colSpan={3}> <td colSpan={3}>
<div className="radio-wrap"> <div className="radio-wrap">
{/* <div className="d-check-radio light mr10"> <div className="d-check-radio light mr10">
<input <input
type="radio" type="radio"
name="estimateType" name="estimateType"
@ -1370,7 +1356,7 @@ export default function Estimate({}) {
}} }}
/> />
<label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label> <label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label>
</div> */} </div>
<div className="d-check-radio light"> <div className="d-check-radio light">
<input <input
type="radio" type="radio"
@ -1379,8 +1365,7 @@ export default function Estimate({}) {
value={'YJOD'} value={'YJOD'}
checked={estimateContextState?.estimateType === 'YJOD' ? true : false} checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
onChange={(e) => { onChange={(e) => {
//todo: YJSS setHandlePricingFlag(true)
// setHandlePricingFlag(true)
setEstimateContextState({ estimateType: e.target.value }) setEstimateContextState({ estimateType: e.target.value })
}} }}
/> />
@ -1677,9 +1662,8 @@ export default function Estimate({}) {
</div> </div>
</div> </div>
</div> </div>
{/* //todo: 추후 YJSS가 다시 나타날 경우 주석 풀기 */}
{/* YJOD면 아래영역 숨김 */} {/* YJOD면 아래영역 숨김 */}
{/* <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}> <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
<table> <table>
<colgroup> <colgroup>
<col style={{ width: '160px' }} /> <col style={{ width: '160px' }} />
@ -1714,7 +1698,7 @@ export default function Estimate({}) {
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> */} </div>
{/* 제품정보 끝 */} {/* 제품정보 끝 */}
{/* 가격표시영역시작 */} {/* 가격표시영역시작 */}
<div className="estimate-product-option"> <div className="estimate-product-option">
@ -1871,7 +1855,7 @@ export default function Estimate({}) {
options={originDisplayItemList} options={originDisplayItemList}
onChange={(e) => { onChange={(e) => {
if (isObjectNotEmpty(e)) { if (isObjectNotEmpty(e)) {
onChangeDisplayItem(e.itemId, item.dispOrder, index) onChangeDisplayItem(e.itemId, item.dispOrder, index, false)
} }
}} }}
menuPlacement={'auto'} menuPlacement={'auto'}
@ -1895,11 +1879,6 @@ export default function Estimate({}) {
classNamePrefix="custom" classNamePrefix="custom"
placeholder="Select" placeholder="Select"
options={cableItemList} options={cableItemList}
onChange={(e) => {
if (isObjectNotEmpty(e)) {
onChangeDisplayItem(e.clRefChr1, item.dispOrder, index)
}
}}
menuPlacement={'auto'} menuPlacement={'auto'}
getOptionLabel={(x) => x.clRefChr3} getOptionLabel={(x) => x.clRefChr3}
getOptionValue={(x) => x.clRefChr1} getOptionValue={(x) => x.clRefChr1}

View File

@ -23,6 +23,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
initOptions: null, initOptions: null,
direction: null, direction: null,
arrow: null, arrow: null,
toFixed: 1,
initialize: function (points, options, canvas) { initialize: function (points, options, canvas) {
this.lines = [] this.lines = []
this.texts = [] this.texts = []
@ -33,11 +34,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
this.innerLines = [] this.innerLines = []
this.children = [] this.children = []
this.separatePolygon = [] this.separatePolygon = []
this.toFixed = options.toFixed ?? 1
// 소수점 전부 제거 // 소수점 전부 제거
points.forEach((point) => { points.forEach((point) => {
point.x = Number(point.x.toFixed(1)) point.x = Number(point.x.toFixed(this.toFixed))
point.y = Number(point.y.toFixed(1)) point.y = Number(point.y.toFixed(this.toFixed))
}) })
options.selectable = options.selectable ?? true options.selectable = options.selectable ?? true
options.sort = options.sort ?? true options.sort = options.sort ?? true

View File

@ -365,11 +365,6 @@ export default function CanvasMenu(props) {
// //
const handleEstimateReset = () => { const handleEstimateReset = () => {
//todo: YJSS swalFire
if (estimateRecoilState.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
swalFire({ swalFire({
text: getMessage('estimate.detail.reset.confirmMsg'), text: getMessage('estimate.detail.reset.confirmMsg'),
type: 'confirm', type: 'confirm',

View File

@ -160,6 +160,20 @@ export default function PowerConditionalSelect(props) {
return return
} }
if (selectedModels.find((m) => m.pcsSerParallelYn === 'Y') && selectedRow.pcsSerParallelYn === 'Y') {
return
}
if (selectedRow.pcsSerParallelYn === 'Y' && selectedModels.length === 0 && selectedMaker.pcsMkrMultiType === PCS_MKR_MULTI_TYPE.SINGLE_P) {
swalFire({
title: getMessage('modal.module.pcs.error1'),
icon: 'warning',
})
return
}
if (selectedMaker.pcsMkrMultiType === PCS_MKR_MULTI_TYPE.MULTI) { if (selectedMaker.pcsMkrMultiType === PCS_MKR_MULTI_TYPE.MULTI) {
setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }]) setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }])
} else if (!selectedModels.find((m) => m.itemId === selectedRow.itemId)) { } else if (!selectedModels.find((m) => m.itemId === selectedRow.itemId)) {
@ -169,6 +183,11 @@ export default function PowerConditionalSelect(props) {
} }
const onRemoveSelectedModel = (model) => { const onRemoveSelectedModel = (model) => {
const tempModels = selectedModels.filter((m) => m.id !== model.id)
if (tempModels.length === 1 && tempModels[0].pcsSerParallelYn === 'Y') {
setSelectedModels([])
return
}
setSelectedModels(selectedModels.filter((m) => m.id !== model.id)) setSelectedModels(selectedModels.filter((m) => m.id !== model.id))
} }
@ -277,14 +296,6 @@ export default function PowerConditionalSelect(props) {
</label> </label>
</div> </div>
</div> </div>
{/* <div className="grid-btn-wrap">
<button className="btn-frame modal mr5" onClick={() => setTabNum(2)}>
{getMessage('modal.circuit.trestle.setting.circuit.allocation.auto')}
</button>
<button className="btn-frame modal act" onClick={() => setTabNum(tabNum + 1)}>
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity')}
</button>
</div> */}
</> </>
) )
} }

View File

@ -11,60 +11,64 @@ import { canvasState } from '@/store/canvasAtom'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE } from '@/common/common'
import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle' import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
import Draggable from 'react-draggable'
export default function PanelBatchStatistics() { export default function PanelBatchStatistics() {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [isFold, setIsFold] = useState(false) const [isFold, setIsFold] = useState(false)
const [pos, setPos] = useState({
x: 0,
y: 30,
})
const canvas = useRecoilValue(canvasState) const canvas = useRecoilValue(canvasState)
const { header, rows, footer } = useRecoilValue(moduleStatisticsState) const { header, rows, footer } = useRecoilValue(moduleStatisticsState)
const { setModuleStatisticsData } = useCircuitTrestle(true) const { setModuleStatisticsData } = useCircuitTrestle(true)
const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState) const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState)
const [position, setPosition] = useState({
x: 0,
y: 30,
})
const handleOnDrag = (e, data) => {
e.stopPropagation()
setPosition({ x: data.x, y: data.y })
}
useEffect(() => { useEffect(() => {
if (moduleSelectionDataStore && moduleSelectionDataStore.module) setModuleStatisticsData() if (moduleSelectionDataStore && moduleSelectionDataStore.module) setModuleStatisticsData()
}, []) }, [])
return ( return (
<WithDraggable isShow={true} handle=".penal-wrap" pos={pos} isModal={false}> <Draggable position={{ x: position.x, y: position.y }} onDrag={(e, data) => handleOnDrag(e, data)} handle=".penal-wrap">
<WithDraggable.Panel> <div className={`penal-wrap ${!isFold ? 'act' : ''}`}>
<div className={`penal-wrap ${!isFold ? 'act' : ''}`}> <h2>{getMessage('modal.panel.batch.statistic')}</h2>
<h2>{getMessage('modal.panel.batch.statistic')}</h2> <button className="penal-arr" onClick={() => setIsFold(!isFold)}></button>
<button className="penal-arr" onClick={() => setIsFold(!isFold)}></button> <div className="penal-table-wrap">
<div className="penal-table-wrap"> <table className="penal-table">
<table className="penal-table"> <thead>
<thead> <tr>
<tr> {header.map((item, index) => (
{header.map((item, index) => ( <th key={`statistic-hd-${index}`}>{item.name}</th>
<th key={`statistic-hd-${index}`}>{item.name}</th>
))}
</tr>
</thead>
<tbody>
{rows.map((row, index) => (
<tr key={`statistic-row-${index}`}>
{header.map((item, i) => (
<td key={`statistic-col-${i}`}>{row[item.prop] ?? 0}</td>
))}
</tr>
))} ))}
<tr> </tr>
{header.map((header, index) => ( </thead>
<td key={`statistic-ft-${index}`}> <tbody>
{typeof footer[header.prop] === 'number' {rows.map((row, index) => (
? footer[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 }) <tr key={`statistic-row-${index}`}>
: footer[header.prop]} {header.map((item, i) => (
</td> <td key={`statistic-col-${i}`}>{row[item.prop] ?? 0}</td>
))} ))}
</tr> </tr>
</tbody> ))}
</table> <tr>
</div> {header.map((header, index) => (
<td key={`statistic-ft-${index}`}>
{typeof footer[header.prop] === 'number'
? footer[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 })
: footer[header.prop]}
</td>
))}
</tr>
</tbody>
</table>
</div> </div>
</WithDraggable.Panel> </div>
</WithDraggable> </Draggable>
) )
} }

View File

@ -49,7 +49,7 @@ export default function PlanSizeSetting(props) {
setPlanSizeSettingMode((prev) => { setPlanSizeSettingMode((prev) => {
return { return {
...prev, ...prev,
[name]: Number(value), [name]: Number(value) / 10,
} }
}) })
} }
@ -72,7 +72,7 @@ export default function PlanSizeSetting(props) {
type="text" type="text"
className="input-origin block" className="input-origin block"
name={`originHorizon`} name={`originHorizon`}
value={planSizeSettingMode.originHorizon} value={planSizeSettingMode.originHorizon * 10}
onChange={(e) => onlyNumberInputChange(e, changeInput)} onChange={(e) => onlyNumberInputChange(e, changeInput)}
/> />
</div> </div>
@ -85,7 +85,7 @@ export default function PlanSizeSetting(props) {
type="text" type="text"
className="input-origin block" className="input-origin block"
name={`originVertical`} name={`originVertical`}
value={planSizeSettingMode.originVertical} value={planSizeSettingMode.originVertical * 10}
onChange={(e) => onlyNumberInputChange(e, changeInput)} onChange={(e) => onlyNumberInputChange(e, changeInput)}
/> />
</div> </div>

View File

@ -23,7 +23,7 @@ export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) {
const keyDown = (e) => { const keyDown = (e) => {
if (currentWallLineRef.current === null) { if (currentWallLineRef.current === null) {
alert('보조선을 먼저 선택하세요') // alert(' ')
return return
} }

View File

@ -140,6 +140,7 @@ export default function StuffDetail() {
headerName: getMessage('stuff.detail.planGridHeader.moduleModel'), headerName: getMessage('stuff.detail.planGridHeader.moduleModel'),
flex: 1, flex: 1,
wrapText: true, wrapText: true,
autoHeight: true,
cellStyle: { alignItems: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' }, cellStyle: { alignItems: 'flex-start' /* 좌측정렬*/, cursor: 'pointer' },
cellRenderer: (params) => { cellRenderer: (params) => {
let origin = params.value let origin = params.value
@ -370,6 +371,7 @@ export default function StuffDetail() {
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
type: 'alert', type: 'alert',
icon: 'error',
confirmFn: () => { confirmFn: () => {
router.push('/management/stuff', { scroll: false }) router.push('/management/stuff', { scroll: false })
}, },
@ -387,6 +389,7 @@ export default function StuffDetail() {
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
type: 'alert', type: 'alert',
icon: 'error',
confirmFn: () => { confirmFn: () => {
router.push('/management/stuff', { scroll: false }) router.push('/management/stuff', { scroll: false })
}, },

View File

@ -166,11 +166,6 @@ export const useEstimateController = (planNo, flag) => {
//견적서 저장 //견적서 저장
const handleEstimateSubmit = async () => { const handleEstimateSubmit = async () => {
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
if (estimateData.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
//0. 필수체크 //0. 필수체크
let flag = true let flag = true
let originFileFlg = false let originFileFlg = false
@ -300,6 +295,18 @@ export const useEstimateController = (planNo, flag) => {
} }
} }
} else { } else {
if (item.salePrice === null) {
item.salePrice = '0'
} else if (isNaN(item.salePrice)) {
item.salePrice = '0'
}
if (item.unitPrice === null) {
item.unitPrice = '0'
} else if (isNaN(item.unitPrice)) {
item.unitPrice = '0'
}
//봄 컴포넌트 제품은 0으로 //봄 컴포넌트 제품은 0으로
item.openFlg = '0' item.openFlg = '0'
} }
@ -386,6 +393,7 @@ export const useEstimateController = (planNo, flag) => {
estimateData.estimateOption = estimateOptions estimateData.estimateOption = estimateOptions
// console.log('최종아이템:::', estimateData.itemList) // console.log('최종아이템:::', estimateData.itemList)
if (fileList?.length > 0) { if (fileList?.length > 0) {
estimateData.fileList = fileList estimateData.fileList = fileList
} else { } else {
@ -413,7 +421,7 @@ export const useEstimateController = (planNo, flag) => {
}) })
} catch (e) { } catch (e) {
setIsGlobalLoading(false) setIsGlobalLoading(false)
console.log('error::::::::::::', e.response.data.message) console.error('error::::::::::::', e.response.data.message)
} }
} }
@ -423,10 +431,6 @@ export const useEstimateController = (planNo, flag) => {
* T01관리자 계정 1차판매점에게만 제공 * T01관리자 계정 1차판매점에게만 제공
*/ */
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId, setEstimateCopyPopupOpen) => { const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId, setEstimateCopyPopupOpen) => {
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
if (estimateData.estimateType === 'YJSS') {
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
}
if (saleStoreId === '') { if (saleStoreId === '') {
return swalFire({ return swalFire({
text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'), text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'),

View File

@ -612,6 +612,9 @@ export function useCanvasSetting(executeEffect = true) {
/** 도면크기 설정 */ /** 도면크기 설정 */
setPlanSizeSettingMode({ ...planSizeSettingMode, originHorizon: res.originHorizon, originVertical: res.originVertical }) setPlanSizeSettingMode({ ...planSizeSettingMode, originHorizon: res.originHorizon, originVertical: res.originVertical })
canvas.setWidth(res.originHorizon)
canvas.setHeight(res.originVertical)
canvas.renderAll()
/** 데이터 설정 */ /** 데이터 설정 */
setSettingModalFirstOptions({ setSettingModalFirstOptions({

View File

@ -22,6 +22,7 @@ import { useSwal } from '@/hooks/useSwal'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils' import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils'
import { POLYGON_TYPE } from '@/common/common' import { POLYGON_TYPE } from '@/common/common'
import { useMessage } from '../useMessage'
// 보조선 작성 // 보조선 작성
export function useAuxiliaryDrawing(id, isUseEffect = true) { export function useAuxiliaryDrawing(id, isUseEffect = true) {
@ -34,6 +35,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
const { swalFire } = useSwal() const { swalFire } = useSwal()
const { getAdsorptionPoints } = useAdsorptionPoint() const { getAdsorptionPoints } = useAdsorptionPoint()
const { closePopup } = usePopup() const { closePopup } = usePopup()
const { getMessage } = useMessage()
const adsorptionRange = useRecoilValue(adsorptionRangeState) const adsorptionRange = useRecoilValue(adsorptionRangeState)
@ -411,7 +413,7 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -832,7 +834,8 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) {
} }
const handleFix = () => { const handleFix = () => {
if (!confirm('지붕선 완료하시겠습니까?')) { // if (!confirm('보조선 작성을 완료하시겠습니까?')) {
if (!confirm(getMessage('want.to.complete.auxiliary.creation'))) {
return return
} }

View File

@ -567,7 +567,7 @@ export function useOuterLineWall(id, propertiesId) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -890,7 +890,7 @@ export function useOuterLineWall(id, propertiesId) {
}) })
if (isAllRightAngle) { if (isAllRightAngle) {
alert('부정확한 다각형입니다.') // alert('부정확한 다각형입니다.')
return return
} }

View File

@ -446,12 +446,10 @@ export function useRoofAllocationSetting(id) {
* 지붕재 변경 * 지붕재 변경
*/ */
const handleChangeRoofMaterial = (value, index) => { const handleChangeRoofMaterial = (value, index) => {
const selectedIndex = roofMaterials.findIndex((roof) => roof.selected)
const selectedRoofMaterial = roofMaterials.find((roof) => roof.roofMatlCd === value.id) const selectedRoofMaterial = roofMaterials.find((roof) => roof.roofMatlCd === value.id)
const newRoofList = currentRoofList.map((roof, idx) => { const newRoofList = currentRoofList.map((roof, idx) => {
if (idx === index) { if (idx === index) {
return { ...selectedRoofMaterial } return { ...selectedRoofMaterial, selected: roof.selected }
} }
return roof return roof
}) })

View File

@ -192,7 +192,7 @@ export function useWallLineOffsetSetting(id) {
const handleSave = () => { const handleSave = () => {
if (currentWallLineRef.current === null) { if (currentWallLineRef.current === null) {
alert('보조선을 먼저 선택하세요') // alert('보조선을 먼저 선택하세요')
return return
} }
switch (type) { switch (type) {

View File

@ -564,7 +564,7 @@ export function usePlacementShapeDrawing(id) {
const length1Value = length1Ref.current.value const length1Value = length1Ref.current.value
if (diagonalLength <= length1Value) { if (diagonalLength <= length1Value) {
alert('대각선 길이는 직선 길이보다 길어야 합니다.') // alert('대각선 길이는 직선 길이보다 길어야 합니다.')
return return
} }
@ -886,7 +886,7 @@ export function usePlacementShapeDrawing(id) {
}) })
if (isAllRightAngle) { if (isAllRightAngle) {
alert('부정확한 다각형입니다.') // alert('부정확한 다각형입니다.')
return return
} }

View File

@ -5,7 +5,7 @@
"header.menus.management": "見積書管理画面", "header.menus.management": "見積書管理画面",
"header.menus.management.newStuff": "新規見積登録", "header.menus.management.newStuff": "新規見積登録",
"header.menus.management.detail": "物件詳細", "header.menus.management.detail": "物件詳細",
"header.menus.management.stuffList": "見積状況", "header.menus.management.stuffList": "物件検索",
"header.menus.community": "コミュニティ", "header.menus.community": "コミュニティ",
"header.menus.community.notice": "お知らせ", "header.menus.community.notice": "お知らせ",
"header.menus.community.faq": "FAQ", "header.menus.community.faq": "FAQ",
@ -1033,5 +1033,6 @@
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。", "canvas.infomation.text": "数字は [半角] 入力のみ可能です。",
"roof.exceed.count": "屋根材は4つまで選択可能です。", "roof.exceed.count": "屋根材は4つまで選択可能です。",
"outerLine.property.fix": "外壁線の属性設定 を完了しますか?", "outerLine.property.fix": "外壁線の属性設定 を完了しますか?",
"outerLine.property.close": "外壁線の属性設定 を終了しますか?" "outerLine.property.close": "外壁線の属性設定 を終了しますか?",
"want.to.complete.auxiliary.creation": "보補助線の作成を完了しますか?"
} }

View File

@ -1033,5 +1033,6 @@
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.", "canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.",
"roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.", "roof.exceed.count": "지붕재는 4개까지 선택 가능합니다.",
"outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?", "outerLine.property.fix": "외벽선 속성 설정을 완료하시겠습니까?",
"outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?" "outerLine.property.close": "외벽선 속성 설정을 종료하시겠습니까?",
"want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?"
} }

View File

@ -43,7 +43,7 @@ export const fontSizeState = atom({
export const canvasSizeState = atom({ export const canvasSizeState = atom({
key: 'canvasSize', key: 'canvasSize',
default: { default: {
vertical: 1000, vertical: 1600,
horizontal: 1600, horizontal: 1600,
}, },
}) })

View File

@ -320,7 +320,7 @@ export const drawGabledRoof = (roofId, canvas, textMode) => {
const wallLines = canvas?.getObjects().find((object) => object.name === POLYGON_TYPE.WALL && object.attributes.roofId === roof.id).lines const wallLines = canvas?.getObjects().find((object) => object.name === POLYGON_TYPE.WALL && object.attributes.roofId === roof.id).lines
const hasNonParallelLines = roofLines.filter((line) => line.x1 !== line.x2 && line.y1 !== line.y2) const hasNonParallelLines = roofLines.filter((line) => line.x1 !== line.x2 && line.y1 !== line.y2)
if (hasNonParallelLines.length > 0) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재합니다.')
return return
} }
@ -648,7 +648,7 @@ export const drawShedRoof = (roofId, canvas, textMode) => {
const roof = canvas?.getObjects().find((object) => object.id === roofId) const roof = canvas?.getObjects().find((object) => object.id === roofId)
const hasNonParallelLines = roof.lines.filter((line) => Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1) const hasNonParallelLines = roof.lines.filter((line) => Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1)
if (hasNonParallelLines.length > 0) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재합니다.')
return return
} }
@ -739,7 +739,7 @@ export const drawRidgeRoof = (roofId, canvas, textMode) => {
//Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1 //Math.abs(line.x1 - line.x2) > 1 && Math.abs(line.y1 - line.y2) > 1
const hasNonParallelLines = roof.lines.filter((line) => Big(line.x1).minus(Big(line.x2)).gt(1) && Big(line.y1).minus(Big(line.y2)).gt(1)) const hasNonParallelLines = roof.lines.filter((line) => Big(line.x1).minus(Big(line.x2)).gt(1) && Big(line.y1).minus(Big(line.y2)).gt(1))
if (hasNonParallelLines.length > 0) { if (hasNonParallelLines.length > 0) {
alert('대각선이 존재합니다.') // alert('대각선이 존재ㄴ합니다.')
return return
} }