Compare commits

..

No commits in common. "8a49f7169b396bd52bc12a30950a826bf2397a71" and "55d37af144def1198934dd24dba0b8fb9c4628e9" have entirely different histories.

7 changed files with 48 additions and 87 deletions

View File

@ -24,4 +24,4 @@ AWS_REGION="ap-northeast-1"
AMPLIFY_BUCKET="files.hanasys.jp" AMPLIFY_BUCKET="files.hanasys.jp"
AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E"
AWS_SECRET_ACCESS_KEY="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" AWS_SECRET_ACCESS_KEY="Cw87TjKwnTWRKgORGxYiFU6GUTgu25eUw4eLBNcA"
NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" NEXT_PUBLIC_AWS_S3_BASE_URL="http://files.hanasys.jp.s3-website-ap-northeast-1.amazonaws.com"

View File

@ -18,4 +18,4 @@ AWS_REGION="ap-northeast-2"
AMPLIFY_BUCKET="interplug" AMPLIFY_BUCKET="interplug"
AWS_ACCESS_KEY_ID="AKIAVWMWJCUXFHEAZ4FR" AWS_ACCESS_KEY_ID="AKIAVWMWJCUXFHEAZ4FR"
AWS_SECRET_ACCESS_KEY="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" AWS_SECRET_ACCESS_KEY="NDzSvPUo4/ErpPOEs1eZAnoUBilc1FL7YaoHkqe4"
NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" NEXT_PUBLIC_AWS_S3_BASE_URL="https://interplug.s3.ap-northeast-2.amazonaws.com"

Binary file not shown.

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,7 +117,6 @@ 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)
} }
@ -153,7 +152,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])
@ -740,18 +739,6 @@ 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 = {
@ -1101,20 +1088,15 @@ export default function Estimate({}) {
item.showSaleTotPrice = '0' item.showSaleTotPrice = '0'
} }
if (item.dispCableFlg === '1' ) { if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') {
dispCableFlgCnt++ dispCableFlgCnt++
if(item.itemTpCd === 'M12') { setCableItem(item.itemId)
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
@ -1177,20 +1159,14 @@ export default function Estimate({}) {
dispCableFlgCnt++ dispCableFlgCnt++
} }
if (item.dispCableFlg === '1'){ if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') {
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
@ -1251,7 +1227,6 @@ export default function Estimate({}) {
if (dispCableFlgCnt === 0) { if (dispCableFlgCnt === 0) {
setCableItem('100038') setCableItem('100038')
setCableDbItem('100037')
} }
} }
}, [estimateContextState?.itemList, cableItemList]) }, [estimateContextState?.itemList, cableItemList])
@ -1856,7 +1831,6 @@ 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"
@ -1866,34 +1840,11 @@ export default function Estimate({}) {
value={cableItem} value={cableItem}
> >
{cableItemList.length > 0 && {cableItemList.length > 0 &&
cableItemList.map((row) => { cableItemList.map((row) => (
if(!row.clRefChr2.includes('S')){ <option key={row.clRefChr1} value={row.clRefChr1}>
return <option key={row.clRefChr1} value={row.clRefChr1}> {row.clRefChr2}
{row.clRefChr2} </option>
</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>
@ -1976,7 +1927,7 @@ export default function Estimate({}) {
<input <input
type="checkbox" type="checkbox"
id={item?.dispOrder} id={item?.dispOrder}
disabled={!!item?.paDispOrder || item.dispCableFlg === '1X'} disabled={!!item?.paDispOrder || item.dispCableFlg === '1'}
onChange={() => onChangeSelect(item.dispOrder)} onChange={() => onChangeSelect(item.dispOrder)}
checked={!!selection.has(item.dispOrder)} checked={!!selection.has(item.dispOrder)}
/> />

View File

@ -16,9 +16,6 @@ import { popSpinnerState } from '@/store/popupAtom'
* 이미지 -> 캔버스 배경에 이미지 로드 * 이미지 -> 캔버스 배경에 이미지 로드
* 주소 -> 구글 맵에서 주소 검색 이미지로 다운로드 받아서 캔버스 배경에 이미지 로드 * 주소 -> 구글 맵에서 주소 검색 이미지로 다운로드 받아서 캔버스 배경에 이미지 로드
* .dwg -> api를 통해서 .png로 변환 캔버스 배경에 이미지 로드 * .dwg -> api를 통해서 .png로 변환 캔버스 배경에 이미지 로드
*
* setCurrentBgImage 이미지를 세팅하면 도면에 배경으로 로딩된다.
* 다만 S3 Response에 aws 고유 주소가 나오는데 여기서는 cloudfront 사용을 위해서 NEXT_PUBLIC_AWS_S3_BASE_URL 도메인을 사용한다.
* @returns {object} * @returns {object}
*/ */
export function useRefFiles() { export function useRefFiles() {
@ -44,7 +41,6 @@ export function useRefFiles() {
}, [refFileMethod]) }, [refFileMethod])
/** /**
* 최초 input type="file" 대한 이벤트
* 파일 불러오기 버튼 컨트롤 * 파일 불러오기 버튼 컨트롤
* @param {*} file * @param {*} file
*/ */
@ -65,10 +61,6 @@ export function useRefFiles() {
} }
} }
/**
* 허용하는 파일인지 체크한다
* @param {File} file
*/
const refFileSetting = (file) => { const refFileSetting = (file) => {
console.log('🚀 ~ refFileSetting ~ file:', file) console.log('🚀 ~ refFileSetting ~ file:', file)
if (file.name.split('.').pop() === 'dwg') { if (file.name.split('.').pop() === 'dwg') {
@ -87,7 +79,7 @@ export function useRefFiles() {
} }
/** /**
* 이미지 파일 삭제 * 파일 삭제
*/ */
const handleFileDelete = async () => { const handleFileDelete = async () => {
swalFire({ swalFire({
@ -97,8 +89,10 @@ export function useRefFiles() {
setPopSpinnerStore(true) setPopSpinnerStore(true)
console.log('🚀 ~ handleFileDelete ~ handleFileDelete:', refImage) console.log('🚀 ~ handleFileDelete ~ handleFileDelete:', refImage)
console.log('🚀 ~ handleFileDelete ~ currentCanvasPlan.bgImageName:', currentCanvasPlan.bgImageName) console.log('🚀 ~ handleFileDelete ~ currentCanvasPlan.bgImageName:', currentCanvasPlan.bgImageName)
await del({ url: `${process.env.NEXT_PUBLIC_API_HOST_URL}/api/image/upload?fileName=${currentCanvasPlan.bgImageName}` }) await del({ url: `http://localhost:3000/api/image/upload?fileName=${currentCanvasPlan.bgImageName}` })
// setRefImage(null)
setCurrentBgImage(null) setCurrentBgImage(null)
// setCurrentCanvasPlan((prev) => ({ ...prev, bgImageName: null }))
await deleteBackGroundImage({ await deleteBackGroundImage({
objectId: currentCanvasPlan.id, objectId: currentCanvasPlan.id,
planNo: currentCanvasPlan.planNo, planNo: currentCanvasPlan.planNo,
@ -109,7 +103,7 @@ export function useRefFiles() {
} }
/** /**
* 주소 이미지 삭제 * 주소 삭제
*/ */
const handleAddressDelete = async () => { const handleAddressDelete = async () => {
swalFire({ swalFire({
@ -118,9 +112,10 @@ export function useRefFiles() {
confirmFn: async () => { confirmFn: async () => {
console.log('🚀 ~ handleAddressDelete ~ handleAddressDelete:', refImage) console.log('🚀 ~ handleAddressDelete ~ handleAddressDelete:', refImage)
console.log('🚀 ~ handleAddressDelete ~ currentCanvasPlan.bgImageName:', currentCanvasPlan.bgImageName) console.log('🚀 ~ handleAddressDelete ~ currentCanvasPlan.bgImageName:', currentCanvasPlan.bgImageName)
await del({ url: `${process.env.NEXT_PUBLIC_API_HOST_URL}/api/image/map?fileName=${currentCanvasPlan.bgImageName}` }) await del({ url: `http://localhost:3000/api/image/map?fileName=${currentCanvasPlan.bgImageName}` })
setMapPositionAddress('') setMapPositionAddress('')
setCurrentBgImage(null) setCurrentBgImage(null)
// setCurrentCanvasPlan((prev) => ({ ...prev, mapPositionAddress: null }))
await deleteBackGroundImage({ await deleteBackGroundImage({
objectId: currentCanvasPlan.id, objectId: currentCanvasPlan.id,
planNo: currentCanvasPlan.planNo, planNo: currentCanvasPlan.planNo,
@ -130,7 +125,7 @@ export function useRefFiles() {
} }
/** /**
* 주소로 구글 이미지 다운로드하여 캔버스 배경으로 로드 * 주소로 구글 이미지 다운로드
*/ */
const handleMapImageDown = async () => { const handleMapImageDown = async () => {
console.log('🚀 ~ handleMapImageDown ~ handleMapImageDown:') console.log('🚀 ~ handleMapImageDown ~ handleMapImageDown:')
@ -148,11 +143,15 @@ export function useRefFiles() {
option1: newOption1, option1: newOption1,
})) }))
// const res = await get({
// url: `${process.env.NEXT_PUBLIC_HOST_URL}/map/convert?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`,
// })
const res = await get({ const res = await get({
url: `${process.env.NEXT_PUBLIC_API_HOST_URL}/api/image/map?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`, url: `http://localhost:3000/api/image/map?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`,
}) })
console.log('🚀 ~ handleMapImageDown ~ res:', res) console.log('🚀 ~ handleMapImageDown ~ res:', res)
setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${res.fileName}`) // setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${res.filePath}`)
setCurrentBgImage(`${res.filePath}`)
await setBackGroundImage({ await setBackGroundImage({
objectId: currentCanvasPlan.id, objectId: currentCanvasPlan.id,
@ -207,12 +206,17 @@ export function useRefFiles() {
const formData = new FormData() const formData = new FormData()
formData.append('file', file) formData.append('file', file)
// const res = await post({
// url: `${process.env.NEXT_PUBLIC_HOST_URL}/image/upload`,
// data: formData,
// })
const res = await post({ const res = await post({
url: `${process.env.NEXT_PUBLIC_API_HOST_URL}/api/image/upload`, url: `http://localhost:3000/api/image/upload`,
data: formData, data: formData,
}) })
console.log('🚀 ~ handleUploadImageRefFile ~ res:', res) console.log('🚀 ~ handleUploadImageRefFile ~ res:', res)
setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${res.fileName}`) // setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${res.filePath}`)
setCurrentBgImage(`${res.filePath}`)
setRefImage(file) setRefImage(file)
const params = { const params = {
@ -240,12 +244,12 @@ export function useRefFiles() {
/** 캐드 도면 파일 업로드 */ /** 캐드 도면 파일 업로드 */
const result = await post({ const result = await post({
url: `${process.env.NEXT_PUBLIC_API_HOST_URL}/api/image/cad`, url: `http://localhost:3000/api/image/cad`,
data: res, data: res,
}) })
console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result) console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result)
setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${res.fileName}`) setCurrentBgImage(`${result.filePath}`)
setRefImage(file) setRefImage(file)
const params = { const params = {
@ -256,6 +260,16 @@ export function useRefFiles() {
} }
console.log('🚀 ~ handleUploadImageRefFile ~ params:', params) console.log('🚀 ~ handleUploadImageRefFile ~ params:', params)
await setBackGroundImage(params) await setBackGroundImage(params)
// const res = await post({ url: converterUrl, data: formData })
// console.log('🚀 ~ handleUploadConvertRefFile ~ res:', res)
// const result = await post({
// url: `${process.env.NEXT_PUBLIC_HOST_URL}/cad/convert`,
// data: res,
// })
// console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result)
// setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${result.filePath}`)
// setRefImage(res.Files[0].FileData)
} }
/** /**

View File

@ -944,8 +944,6 @@
"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,8 +945,6 @@
"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": "가격등록을 초기화 하시겠습니까?",