# Conflicts:
#	src/locales/ja.json
This commit is contained in:
김민식 2025-05-19 10:32:43 +09:00
commit 69c48cecf8
6 changed files with 99 additions and 19 deletions

View File

@ -1,4 +1,4 @@
NEXT_PUBLIC_API_SERVER_PATH="http://1.248.227.176:38080" NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp"
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"

View File

@ -60,7 +60,7 @@ export default function Estimate({}) {
const [cableItemList, setCableItemList] = useState([]) // const [cableItemList, setCableItemList] = useState([]) //
const [cableItem, setCableItem] = useState('') // const [cableItem, setCableItem] = useState('') //
const [cableDbItem, setCableDbItem] = useState('') //
const [startDate, setStartDate] = useState(new Date()) const [startDate, setStartDate] = useState(new Date())
const singleDatePickerProps = { const singleDatePickerProps = {
startDate, startDate,
@ -98,7 +98,7 @@ export default function Estimate({}) {
} }
const initEstimate = (currPid = currentPid) => { const initEstimate = (currPid = currentPid) => {
console.log('🚀 ~ initEstimate ~ currPid:', currPid) // console.log('🚀 ~ initEstimate ~ currPid:', currPid)
closeAll() closeAll()
setObjectNo(objectRecoil.floorPlanObjectNo) setObjectNo(objectRecoil.floorPlanObjectNo)
@ -117,6 +117,7 @@ export default function Estimate({}) {
item.value = item.clRefChr1 item.value = item.clRefChr1
item.label = item.clRefChr2 item.label = item.clRefChr2
}) })
// console.log(code2)
setCableItemList(code2) setCableItemList(code2)
} }
@ -152,7 +153,7 @@ export default function Estimate({}) {
} }
useEffect(() => { useEffect(() => {
console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan) // console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
if (selectedPlan) initEstimate(selectedPlan.planNo) if (selectedPlan) initEstimate(selectedPlan.planNo)
}, [selectedPlan]) }, [selectedPlan])
@ -739,6 +740,18 @@ export default function Estimate({}) {
setCableItem(value) setCableItem(value)
} }
/* 케이블 select 변경시 */
const onChangeDisplayDoubleCableItem = (value, itemList) => {
itemList.map((item, index) => {
if (item.dispCableFlg === '1' && item.itemTpCd === 'M12') {
if (value !== '') {
onChangeDisplayItem(value, item.dispOrder, index, true)
}
}
})
setCableDbItem(value)
}
// / // /
const onChangeDisplayItem = (itemId, dispOrder, index, flag) => { const onChangeDisplayItem = (itemId, dispOrder, index, flag) => {
const param = { const param = {
@ -1088,15 +1101,20 @@ export default function Estimate({}) {
item.showSaleTotPrice = '0' item.showSaleTotPrice = '0'
} }
if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') { if (item.dispCableFlg === '1' ) {
dispCableFlgCnt++ dispCableFlgCnt++
setCableItem(item.itemId) if(item.itemTpCd === 'M12') {
setCableDbItem(item.itemId)
}else{
setCableItem(item.itemId)
}
} }
} }
}) })
if (dispCableFlgCnt === 0) { if (dispCableFlgCnt === 0) {
setCableItem('100038') setCableItem('100038')
setCableDbItem('100037')
} }
let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0 let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0
@ -1159,14 +1177,20 @@ export default function Estimate({}) {
dispCableFlgCnt++ dispCableFlgCnt++
} }
if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') { if (item.dispCableFlg === '1'){
setCableItem(item.itemId)
if(item.itemTpCd === 'M12') {
setCableDbItem(item.itemId)
}else{
setCableItem(item.itemId)
}
} }
} }
}) })
if (dispCableFlgCnt === 0) { if (dispCableFlgCnt === 0) {
setCableItem('100038') setCableItem('100038')
setCableDbItem('100037')
} }
totals.vatPrice = totals.supplyPrice * 0.1 totals.vatPrice = totals.supplyPrice * 0.1
@ -1227,6 +1251,7 @@ export default function Estimate({}) {
if (dispCableFlgCnt === 0) { if (dispCableFlgCnt === 0) {
setCableItem('100038') setCableItem('100038')
setCableDbItem('100037')
} }
} }
}, [estimateContextState?.itemList, cableItemList]) }, [estimateContextState?.itemList, cableItemList])
@ -1831,6 +1856,7 @@ export default function Estimate({}) {
</button> </button>
</div> </div>
<div className="product-price-wrap ml10"> <div className="product-price-wrap ml10">
<div className="product-price-tit">{getMessage('estimate.detail.header.singleCable')}</div>
<div className="select-wrap"> <div className="select-wrap">
<select <select
className="select-light" className="select-light"
@ -1840,11 +1866,34 @@ export default function Estimate({}) {
value={cableItem} value={cableItem}
> >
{cableItemList.length > 0 && {cableItemList.length > 0 &&
cableItemList.map((row) => ( cableItemList.map((row) => {
<option key={row.clRefChr1} value={row.clRefChr1}> if(!row.clRefChr2.includes('S')){
{row.clRefChr2} return <option key={row.clRefChr1} value={row.clRefChr1}>
</option> {row.clRefChr2}
))} </option>
}
})}
</select>
</div>
</div>
<div className="product-price-wrap ml10">
<div className="product-price-tit">{getMessage('estimate.detail.header.doubleCable')}</div>
<div className="select-wrap">
<select
className="select-light"
onChange={(e) => {
onChangeDisplayDoubleCableItem(e.target.value, estimateContextState.itemList)
}}
value={cableDbItem}
>
{cableItemList.length > 0 &&
cableItemList.map((row) => {
if(row.clRefChr2.includes('S')){
return <option key={row.clRefChr1} value={row.clRefChr1}>
{row.clRefChr2.replace('S','')}
</option>
}
})}
</select> </select>
</div> </div>
</div> </div>
@ -1927,7 +1976,7 @@ export default function Estimate({}) {
<input <input
type="checkbox" type="checkbox"
id={item?.dispOrder} id={item?.dispOrder}
disabled={!!item?.paDispOrder || item.dispCableFlg === '1'} disabled={!!item?.paDispOrder || item.dispCableFlg === '1X'}
onChange={() => onChangeSelect(item.dispOrder)} onChange={() => onChangeSelect(item.dispOrder)}
checked={!!selection.has(item.dispOrder)} checked={!!selection.has(item.dispOrder)}
/> />

View File

@ -96,6 +96,10 @@ export function useOuterLineWall(id, propertiesId) {
} }
addCanvasMouseEventListener('mouse:down', mouseDown) addCanvasMouseEventListener('mouse:down', mouseDown)
addDocumentEventListener('contextmenu', document, (e) => {
handleRollback()
})
clear() clear()
return () => { return () => {
initEvent() initEvent()
@ -690,6 +694,7 @@ export function useOuterLineWall(id, propertiesId) {
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
// 포커스가 length1에 있지 않으면 length1에 포커스를 줌 // 포커스가 length1에 있지 않으면 length1에 포커스를 줌
const activeElem = document.activeElement const activeElem = document.activeElement
if (activeElem !== length1Ref.current) { if (activeElem !== length1Ref.current) {
@ -754,6 +759,7 @@ export function useOuterLineWall(id, propertiesId) {
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
const activeElem = document.activeElement const activeElem = document.activeElement
@ -787,6 +793,7 @@ export function useOuterLineWall(id, propertiesId) {
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
case 'Down': // IE/Edge에서 사용되는 값 case 'Down': // IE/Edge에서 사용되는 값
@ -812,6 +819,7 @@ export function useOuterLineWall(id, propertiesId) {
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
case 'Enter': { case 'Enter': {
@ -836,7 +844,7 @@ export function useOuterLineWall(id, propertiesId) {
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
case 'Down': // IE/Edge에서 사용되는 값 case 'Down': // IE/Edge에서 사용되는 값
@ -902,6 +910,12 @@ export function useOuterLineWall(id, propertiesId) {
isFix.current = true isFix.current = true
} }
const enterCheck = (e) => {
if (e.key === 'Enter') {
handleFix()
}
}
return { return {
points, points,
setPoints, setPoints,

View File

@ -92,6 +92,9 @@ export function usePlacementShapeDrawing(id) {
} }
addCanvasMouseEventListener('mouse:down', mouseDown) addCanvasMouseEventListener('mouse:down', mouseDown)
addDocumentEventListener('contextmenu', document, (e) => {
handleRollback()
})
clear() clear()
}, [verticalHorizontalMode, points, adsorptionPointAddMode, adsorptionPointMode, adsorptionRange, interval, tempGridMode]) }, [verticalHorizontalMode, points, adsorptionPointAddMode, adsorptionPointMode, adsorptionRange, interval, tempGridMode])
@ -175,7 +178,7 @@ export function usePlacementShapeDrawing(id) {
} }
} }
/* /*
mouseMove mouseMove
*/ */
const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
@ -184,7 +187,7 @@ mouseMove
const { getAdsorptionPoints } = useAdsorptionPoint() const { getAdsorptionPoints } = useAdsorptionPoint()
const mouseMove = (e) => { const mouseMove = (e) => {
removeMouseLine(); removeMouseLine()
const pointer = canvas.getPointer(e.e) const pointer = canvas.getPointer(e.e)
const roofsPoints = roofs.map((roof) => roof.points).flat() const roofsPoints = roofs.map((roof) => roof.points).flat()
roofAdsorptionPoints.current = [...roofsPoints] roofAdsorptionPoints.current = [...roofsPoints]
@ -246,7 +249,6 @@ mouseMove
}) })
canvas?.add(horizontalLine, verticalLine) canvas?.add(horizontalLine, verticalLine)
canvas?.renderAll() canvas?.renderAll()
} }
useEffect(() => { useEffect(() => {
@ -768,6 +770,7 @@ mouseMove
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
// 포커스가 length1에 있지 않으면 length1에 포커스를 줌 // 포커스가 length1에 있지 않으면 length1에 포커스를 줌
const activeElem = document.activeElement const activeElem = document.activeElement
@ -833,6 +836,7 @@ mouseMove
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
const activeElem = document.activeElement const activeElem = document.activeElement
@ -866,6 +870,7 @@ mouseMove
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
case 'Down': // IE/Edge에서 사용되는 값 case 'Down': // IE/Edge에서 사용되는 값
@ -891,6 +896,7 @@ mouseMove
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
case 'Enter': { case 'Enter': {
@ -915,6 +921,7 @@ mouseMove
if (points.length === 0) { if (points.length === 0) {
return return
} }
enterCheck(e)
const key = e.key const key = e.key
switch (key) { switch (key) {
@ -979,6 +986,12 @@ mouseMove
isFix.current = true isFix.current = true
} }
const enterCheck = (e) => {
if (e.key === 'Enter') {
handleFix()
}
}
return { return {
points, points,
setPoints, setPoints,

View File

@ -786,7 +786,7 @@
"stuff.search.schObjectNo": "物件番号", "stuff.search.schObjectNo": "物件番号",
"stuff.search.schSaleStoreName": "販売代理店名", "stuff.search.schSaleStoreName": "販売代理店名",
"stuff.search.schAddress": "商品アドレス", "stuff.search.schAddress": "商品アドレス",
"stuff.search.schObjectName": "物件名", "stuff.search.schObjectName": "商品名",
"stuff.search.schDispCompanyName": "見積先", "stuff.search.schDispCompanyName": "見積先",
"stuff.search.schSelSaleStoreId": "販売代理店選択", "stuff.search.schSelSaleStoreId": "販売代理店選択",
"stuff.search.schReceiveUser": "担当者", "stuff.search.schReceiveUser": "担当者",
@ -944,6 +944,8 @@
"estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG金額", "estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG金額",
"estimate.detail.header.showPrice": "価格表示", "estimate.detail.header.showPrice": "価格表示",
"estimate.detail.header.unitPrice": "定価", "estimate.detail.header.unitPrice": "定価",
"estimate.detail.header.singleCable": "片端ケーブル長さ",
"estimate.detail.header.doubleCable": "両端ケーブル長さ",
"estimate.detail.showPrice.pricingBtn": "Pricing", "estimate.detail.showPrice.pricingBtn": "Pricing",
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricingが欠落しているアイテムがあります。 Pricingを進めてください。", "estimate.detail.showPrice.pricingBtn.noItemId": "Pricingが欠落しているアイテムがあります。 Pricingを進めてください。",
"estimate.detail.showPrice.pricingBtn.confirm": "価格登録初期化されますがよろしいですか?", "estimate.detail.showPrice.pricingBtn.confirm": "価格登録初期化されますがよろしいですか?",

View File

@ -945,6 +945,8 @@
"estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG 금액", "estimate.detail.sepcialEstimateProductInfo.pkgPrice": "PKG 금액",
"estimate.detail.header.showPrice": "가격표시", "estimate.detail.header.showPrice": "가격표시",
"estimate.detail.header.unitPrice": "정가", "estimate.detail.header.unitPrice": "정가",
"estimate.detail.header.singleCable": "편당케이블 길이",
"estimate.detail.header.doubleCable": "양단케이블 길이",
"estimate.detail.showPrice.pricingBtn": "Pricing", "estimate.detail.showPrice.pricingBtn": "Pricing",
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricing이 누락된 아이템이 있습니다. 제품 선택 후 Pricing을 진행해주세요.", "estimate.detail.showPrice.pricingBtn.noItemId": "Pricing이 누락된 아이템이 있습니다. 제품 선택 후 Pricing을 진행해주세요.",
"estimate.detail.showPrice.pricingBtn.confirm": "가격등록을 초기화 하시겠습니까?", "estimate.detail.showPrice.pricingBtn.confirm": "가격등록을 초기화 하시겠습니까?",