Merge branch 'dev' into feature/jaeyoung
This commit is contained in:
commit
b02263c561
26
docs/2025-02-10_Qcell_회의.txt
Normal file
26
docs/2025-02-10_Qcell_회의.txt
Normal file
@ -0,0 +1,26 @@
|
||||
공통. 기본 폰트값 통일 ->
|
||||
1. 전체 화면 기본폰트 MS PGothic으로 통일 (폰트 기능 협의)
|
||||
2. 번역이 후짐
|
||||
|
||||
1. 지붕덮개 ->
|
||||
1-1. '외벽선 속성 설정을 완료하시겠습니까?' 문구 메시지 처리
|
||||
1-2. 지붕재 설정 selectbox 한글로 나옴
|
||||
|
||||
2. 배치면 ->
|
||||
|
||||
3. 모듈 ->
|
||||
3-1. 모듈 선택 화면 ->
|
||||
1) 서까래 간격 유지 안됨
|
||||
2) 데이터 저장 이후 모듈 변경으로 인해 셀렉트박스의 데이터가 없을 경우 이전 데이터로 설정됨
|
||||
3-2. 모듈 설치 ->
|
||||
1) 모듈 설치시 방향에 따른 기준 설정 문제
|
||||
|
||||
4. 회로 ->
|
||||
4-1. 회로 선택 화면 -> pcs 선택 화면 관련 시리즈 영역 width값 조정
|
||||
|
||||
5. 가대설정 ->
|
||||
5-1. 가대 그릴시 금구 위치 다름(좌,우, T01 / RA03250210002 / PLAN 1참고)
|
||||
5-2. 가대 설치 후 견적서로 넘어가는 시간이 너무 빠르다고 함
|
||||
|
||||
6. 견적서 ->
|
||||
6-1. 견적서 문서 다운로드 도면 이미지 포함 안됨
|
||||
@ -72,10 +72,10 @@ export default async function RootLayout({ children }) {
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
<QModal />
|
||||
<PopupManager />
|
||||
</QcastProvider>
|
||||
)}
|
||||
<QModal />
|
||||
<PopupManager />
|
||||
</body>
|
||||
</html>
|
||||
</GlobalDataProvider>
|
||||
|
||||
@ -186,6 +186,7 @@ export const SAVE_KEY = [
|
||||
'circuitNumber',
|
||||
'circuit',
|
||||
'onlyOffset',
|
||||
'isChidory',
|
||||
]
|
||||
|
||||
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype]
|
||||
|
||||
@ -21,23 +21,34 @@ export default function AuxiliaryEdit(props) {
|
||||
const currentObject = useRecoilValue(currentObjectState)
|
||||
const { swalFire } = useSwal()
|
||||
const handleSave = () => {
|
||||
if (!horizonSize || !verticalSize || !arrow1 || !arrow2) {
|
||||
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
|
||||
if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) {
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
return
|
||||
}
|
||||
|
||||
if ((verticalSize && +verticalSize === 0) || !arrow1) {
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
return
|
||||
}
|
||||
|
||||
if ((horizonSize && +horizonSize === 0) || !arrow2) {
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
return
|
||||
}
|
||||
|
||||
if (type === 'copy') {
|
||||
if (currentObject) {
|
||||
copy(
|
||||
currentObject,
|
||||
arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize),
|
||||
arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize),
|
||||
arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0,
|
||||
arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
move(
|
||||
currentObject,
|
||||
arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize),
|
||||
arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize),
|
||||
arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0,
|
||||
arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
|
||||
const ALLOCATION_TYPE = {
|
||||
AUTO: 'auto',
|
||||
@ -56,6 +57,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const { handleCanvasToPng } = useImgLoader()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
const {
|
||||
makers,
|
||||
setMakers,
|
||||
@ -324,6 +327,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
// 회로할당(승압설정) 저장 버튼 클릭 시
|
||||
const onApply = async () => {
|
||||
setIsGlobalLoading(true)
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
@ -335,9 +339,13 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
handleCanvasToPng(1)
|
||||
|
||||
//회로할당 저장 클릭 시
|
||||
const result = await apply()
|
||||
|
||||
//회로할당 저장 시 result=null인 경우에도 회로번호 텍스트 표시 유지 처리
|
||||
setViewCircuitNumberTexts(true)
|
||||
|
||||
if (result) {
|
||||
setViewCircuitNumberTexts(true)
|
||||
handleCanvasToPng(2)
|
||||
// 캔버스 저장
|
||||
await saveCanvas(false)
|
||||
@ -360,10 +368,12 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
circuitModules.forEach((obj) => {
|
||||
obj.circuit = null
|
||||
obj.pcsItemId = null
|
||||
obj.circuitNumber = null
|
||||
})
|
||||
|
||||
if (allocationType === ALLOCATION_TYPE.PASSIVITY) {
|
||||
setAllocationType(ALLOCATION_TYPE.AUTO)
|
||||
setTabNum(1)
|
||||
} else {
|
||||
setTabNum(1)
|
||||
}
|
||||
@ -458,11 +468,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
swalFire({
|
||||
title: getMessage('not.allocation.exist.module'),
|
||||
type: 'alert',
|
||||
confirmFn: () => {},
|
||||
})
|
||||
return
|
||||
// canvas.remove(...notAllocationModules)
|
||||
// canvas.renderAll()
|
||||
}
|
||||
setTabNum(2)
|
||||
}
|
||||
|
||||
@ -229,8 +229,8 @@ export default function PowerConditionalSelect(props) {
|
||||
<tbody>
|
||||
{models?.map((model, index) => (
|
||||
<tr key={index} onClick={() => setSelectedRow(model)} className={model === selectedRow ? 'on' : ''}>
|
||||
{modelHeader.map((header) => (
|
||||
<td>{model[header.prop]}</td>
|
||||
{modelHeader.map((header, index) => (
|
||||
<td key={index}>{model[header.prop]}</td>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
|
||||
@ -392,18 +392,21 @@ export default function StepUp(props) {
|
||||
}
|
||||
}
|
||||
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
.forEach((module) => {
|
||||
module.circuit = null
|
||||
module.circuitNumber = null
|
||||
module.pcsItemId = null
|
||||
})
|
||||
|
||||
selectedData.roofSurfaceList.forEach((roofSurface) => {
|
||||
const targetSurface = canvas.getObjects().filter((obj) => obj.id === roofSurface.roofSurfaceId)[0]
|
||||
const moduleIds = targetSurface.modules.map((module) => {
|
||||
return module.id
|
||||
})
|
||||
|
||||
targetSurface.modules.map((module) => {
|
||||
module.circuit = null
|
||||
module.circuitNumber = null
|
||||
module.pcsItemId = null
|
||||
})
|
||||
|
||||
// 모듈 목록 삭제
|
||||
canvas
|
||||
.getObjects()
|
||||
|
||||
@ -38,12 +38,12 @@ export default function GridMove(props) {
|
||||
const handleApply = () => {
|
||||
if (currentObject?.direction === 'vertical') {
|
||||
if (!horizonSize || !arrow2) {
|
||||
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!verticalSize || !arrow1) {
|
||||
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
|
||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import { basicSettingState } from '@/store/settingAtom'
|
||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||
import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
||||
|
||||
export default function ContextRoofAllocationSetting(props) {
|
||||
@ -36,6 +37,7 @@ export default function ContextRoofAllocationSetting(props) {
|
||||
|
||||
const { findCommonCode } = useCommonCode()
|
||||
const pitchText = useRecoilValue(pitchTextSelector)
|
||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||
const [raftCodes, setRaftCodes] = useState([])
|
||||
useEffect(() => {
|
||||
@ -60,13 +62,15 @@ export default function ContextRoofAllocationSetting(props) {
|
||||
<span>{getMessage('modal.roof.alloc.select.roof.material')}</span>
|
||||
<div className="grid-select">
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
options={roofMaterials.map((roof) => {
|
||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||
})}
|
||||
value={roofMaterials[0]}
|
||||
onChange={(e) => {
|
||||
// const selected = roofMaterials.find((roofMaterial) => roofMaterial.roofMatlCd === e.id)
|
||||
setCurrentRoofMaterial(e)
|
||||
}}
|
||||
showKey={'roofMatlNm'}
|
||||
showKey="name"
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
/>
|
||||
@ -100,9 +104,13 @@ export default function ContextRoofAllocationSetting(props) {
|
||||
<div className="flex-ment">
|
||||
<div className="grid-select">
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
// options={roofMaterials}
|
||||
options={roofMaterials.map((roof2) => {
|
||||
return { ...roof2, name: globalLocale === 'ko' ? roof2.roofMatlNm : roof2.roofMatlNmJp }
|
||||
})}
|
||||
value={roof}
|
||||
showKey={'roofMatlNm'}
|
||||
//showKey={'roofMatlNm'}
|
||||
showKey="name"
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
onChange={(e) => handleChangeRoofMaterial(e, index)}
|
||||
|
||||
@ -62,13 +62,15 @@ export default function RoofAllocationSetting(props) {
|
||||
<span>{getMessage('modal.roof.alloc.select.roof.material')}</span>
|
||||
<div className="grid-select">
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
options={roofMaterials.map((roof) => {
|
||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||
})}
|
||||
value={roofMaterials[0]}
|
||||
onChange={(e) => {
|
||||
// const selected = roofMaterials.find((roofMaterial) => roofMaterial.roofMatlCd === e.id)
|
||||
setCurrentRoofMaterial(e)
|
||||
}}
|
||||
showKey={'roofMatlNm'}
|
||||
showKey="name"
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
/>
|
||||
@ -102,9 +104,13 @@ export default function RoofAllocationSetting(props) {
|
||||
<div className="flex-ment">
|
||||
<div className="grid-select">
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
//options={roofMaterials}
|
||||
options={roofMaterials.map((roof2) => {
|
||||
return { ...roof2, name: globalLocale === 'ko' ? roof2.roofMatlNm : roof2.roofMatlNmJp }
|
||||
})}
|
||||
value={roof}
|
||||
showKey={'roofMatlNm'}
|
||||
//showKey={'roofMatlNm'}
|
||||
showKey="name"
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
onChange={(e) => handleChangeRoofMaterial(e, index)}
|
||||
|
||||
@ -214,7 +214,7 @@ export default function Stuff() {
|
||||
|
||||
// 진입시 그리드 데이터 조회
|
||||
useEffect(() => {
|
||||
if (stuffSearchParams?.code === 'S') {
|
||||
if (stuffSearchParams?.code === 'S' || stuffSearchParams?.code === 'END') {
|
||||
const params = {
|
||||
saleStoreId: session.storeId,
|
||||
schObjectNo: stuffSearchParams?.schObjectNo,
|
||||
@ -241,6 +241,10 @@ export default function Stuff() {
|
||||
params.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
if (params.saleStoreId !== session.storeId) {
|
||||
params.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
||||
await get({
|
||||
@ -263,7 +267,11 @@ export default function Stuff() {
|
||||
setIsGlobalLoading(false)
|
||||
})
|
||||
}
|
||||
fetchData()
|
||||
if (stuffSearchParams.code === 'S') {
|
||||
fetchData()
|
||||
} else {
|
||||
stuffSearchParams.code = 'S'
|
||||
}
|
||||
} else if (stuffSearchParams?.code === 'M') {
|
||||
const params = {
|
||||
schObjectNo: stuffSearchParams.schObjectNo,
|
||||
@ -296,6 +304,11 @@ export default function Stuff() {
|
||||
if (!stuffSearchParams.saleStoreId) {
|
||||
stuffSearchParams.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
if (stuffSearchParams.saleStoreId !== session.storeId) {
|
||||
stuffSearchParams.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
if (stuffSearchParams.schMyDataCheck) {
|
||||
//0203 내물건보기 체크시 schSaleStoreId에 storeId셋팅 schSelSaleStoreId, schOtherSelSaleStoreId 비우기
|
||||
stuffSearchParams.schSaleStoreId = session.storeId
|
||||
@ -319,7 +332,6 @@ export default function Stuff() {
|
||||
stuffSearchParams.startRow = 1
|
||||
stuffSearchParams.endRow = 1 * stuffSearchParams.pageSize
|
||||
}
|
||||
|
||||
setIsGlobalLoading(false)
|
||||
})
|
||||
}
|
||||
@ -358,7 +370,7 @@ export default function Stuff() {
|
||||
fetchData()
|
||||
} else if (stuffSearchParams?.code === 'DELETE') {
|
||||
const newParams = {
|
||||
saleStoreId: session.storeId,
|
||||
saleStoreId: '',
|
||||
schObjectNo: '',
|
||||
schAddress: '',
|
||||
schObjectName: '',
|
||||
@ -374,7 +386,7 @@ export default function Stuff() {
|
||||
schSelSaleStoreId: '',
|
||||
schOtherSelSaleStoreId: '',
|
||||
schSortType: 'U',
|
||||
code: 'S',
|
||||
code: 'END',
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
schMyDataCheck: false,
|
||||
@ -383,7 +395,6 @@ export default function Stuff() {
|
||||
setStuffSearch({
|
||||
...newParams,
|
||||
})
|
||||
|
||||
setIsGlobalLoading(false)
|
||||
} else {
|
||||
stuffSearchParams.code = 'DELETE'
|
||||
|
||||
@ -97,6 +97,7 @@ export default function StuffQGrid(props) {
|
||||
overlayNoRowsTemplate={`<span className="ag-overlay-loading-center">${getMessage('stuff.grid.noData')}</span>`}
|
||||
getRowClass={getRowClass}
|
||||
autoSizeAllColumns={true}
|
||||
enableCellTextSelection={true}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -188,7 +188,7 @@ export default function StuffSearchCondition() {
|
||||
schAddress: address ? address.trim() : '',
|
||||
schObjectName: objectName ? objectName.trim() : '',
|
||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||
schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
||||
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||
schDateType: dateType,
|
||||
@ -611,14 +611,9 @@ export default function StuffSearchCondition() {
|
||||
|
||||
//판매대리점 자동완성 변경
|
||||
const onSelectionChange = (key) => {
|
||||
//내 물건보기 체크 풀어주기
|
||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||
// stuffSearch.schMyDataCheck = false
|
||||
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreId('')
|
||||
setSchSelSaleStoreId(key.saleStoreId)
|
||||
// stuffSearch.schSelSaleStoreId = key.saleStoreId
|
||||
//고른 1차점의 saleStoreId로 2차점 API호출하기
|
||||
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||
let otherList
|
||||
@ -663,7 +658,6 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.schMyDataCheck = false
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreId(key.saleStoreId)
|
||||
// stuffSearch.schOtherSelSaleStoreId = key.saleStoreId
|
||||
|
||||
//2차점 골랐을때 1차점 값
|
||||
if (session.storeId === 'T01') {
|
||||
@ -673,11 +667,11 @@ export default function StuffSearchCondition() {
|
||||
}
|
||||
} else {
|
||||
//X누르면 검색조건에 1차점으로 셋팅
|
||||
|
||||
if (session.storeLvl === '1') {
|
||||
if (stuffSearch.schOtherSelSaleStoreId === '') {
|
||||
// 화면에선 지우는데 조회누르기 전이면 리코일은 남김
|
||||
setSchSelSaleStoreId(session.storeId)
|
||||
setOtherSaleStoreId('')
|
||||
} else {
|
||||
// 화면에선 지우는데 조회누르기 전이면 리코일은 남김
|
||||
setOtherSaleStoreId('')
|
||||
@ -767,7 +761,6 @@ export default function StuffSearchCondition() {
|
||||
setOtherSaleStoreId('')
|
||||
} else {
|
||||
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||
}
|
||||
} else {
|
||||
if (stuffSearch.code === 'DELETE') {
|
||||
@ -820,7 +813,7 @@ export default function StuffSearchCondition() {
|
||||
setReceiveUser(stuffSearch.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser)
|
||||
setDateType(stuffSearch.schDateType ? stuffSearch.schDateType : dateType)
|
||||
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||
|
||||
if (session.storeLvl !== '1') {
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
}
|
||||
@ -836,12 +829,6 @@ export default function StuffSearchCondition() {
|
||||
} else if (stuffSearch.schTempFlg === '1') {
|
||||
setTempFlg('1')
|
||||
}
|
||||
|
||||
if (stuffSearch.schMyDataCheck) {
|
||||
setMyDataCheck(true)
|
||||
} else {
|
||||
setMyDataCheck(false)
|
||||
}
|
||||
}, [stuffSearch])
|
||||
|
||||
useEffect(() => {
|
||||
@ -865,42 +852,35 @@ export default function StuffSearchCondition() {
|
||||
//0203 내물건보기 체크시 공통 schSaleStoreId에 storeId담아 전송 schSelSaleStoreId, schOtherSelSaleStoreId 비우기
|
||||
if (session?.storeId === 'T01') {
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
setOtherSaleStoreId('') //2차점 비우기
|
||||
setSchSelSaleStoreId('T01')
|
||||
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
const key = { saleStoreId: session.storeId }
|
||||
onSelectionChange(key)
|
||||
} else {
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setSchSelSaleStoreId('')
|
||||
setMyDataCheck(false)
|
||||
//아래꺼 확인필요
|
||||
onSelectionChange(null)
|
||||
}
|
||||
} else if (session?.storeLvl === '1') {
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
setOtherSaleStoreId('') //2차점 비우기
|
||||
setSchSelSaleStoreId(schSelSaleStoreId)
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
} else {
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
setMyDataCheck(false)
|
||||
}
|
||||
} else {
|
||||
//2차점인제 3,4가 없으면 상관없음
|
||||
//3,4등등이 있는경우 처리필요
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
if (otherSaleStoreList.length > 1) {
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
@ -913,7 +893,6 @@ export default function StuffSearchCondition() {
|
||||
}
|
||||
} else {
|
||||
setMyDataCheck(false)
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
}
|
||||
}
|
||||
@ -996,7 +975,6 @@ export default function StuffSearchCondition() {
|
||||
className="input-light"
|
||||
defaultValue={stuffSearch?.schObjectNo ? stuffSearch.schObjectNo : objectNo}
|
||||
onChange={() => {
|
||||
// stuffSearch.schObjectNo = objectNoRef.current.value
|
||||
setObjectNo(objectNoRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1012,7 +990,6 @@ export default function StuffSearchCondition() {
|
||||
className="input-light"
|
||||
defaultValue={stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName}
|
||||
onChange={() => {
|
||||
// stuffSearch.schSaleStoreName = saleStoreNameRef.current.value
|
||||
setSaleStoreName(saleStoreNameRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1029,7 +1006,6 @@ export default function StuffSearchCondition() {
|
||||
className="input-light"
|
||||
defaultValue={stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName}
|
||||
onChange={() => {
|
||||
// stuffSearch.schDispCompanyName = dispCompanyNameRef.current.value
|
||||
setDispCompanyName(dispCompanyNameRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1047,7 +1023,6 @@ export default function StuffSearchCondition() {
|
||||
className="input-light"
|
||||
defaultValue={stuffSearch?.schObjectName ? stuffSearch.schObjectName : objectName}
|
||||
onChange={() => {
|
||||
// stuffSearch.schObjectName = objectNameRef.current.value
|
||||
setObjectName(objectNameRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1063,7 +1038,6 @@ export default function StuffSearchCondition() {
|
||||
ref={receiveUserRef}
|
||||
defaultValue={stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser}
|
||||
onChange={() => {
|
||||
// stuffSearch.schReceiveUser = receiveUserRef.current.value
|
||||
setReceiveUser(receiveUserRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1079,7 +1053,6 @@ export default function StuffSearchCondition() {
|
||||
className="input-light"
|
||||
defaultValue={stuffSearch?.schAddress ? stuffSearch.schAddress : address}
|
||||
onChange={() => {
|
||||
// stuffSearch.schAddress = addressRef.current.value
|
||||
setAddress(addressRef.current.value)
|
||||
}}
|
||||
onKeyUp={handleByOnKeyUp}
|
||||
@ -1101,7 +1074,6 @@ export default function StuffSearchCondition() {
|
||||
value={'U'}
|
||||
onChange={(e) => {
|
||||
setDateType(e.target.value)
|
||||
// stuffSearch.schDateType = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
||||
@ -1115,7 +1087,6 @@ export default function StuffSearchCondition() {
|
||||
value={'R'}
|
||||
onChange={(e) => {
|
||||
setDateType(e.target.value)
|
||||
// stuffSearch.schDateType = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
||||
@ -1140,11 +1111,10 @@ export default function StuffSearchCondition() {
|
||||
type="radio"
|
||||
name="schTempFlg"
|
||||
id="schTempFlg"
|
||||
checked={stuffSearch.schTempFlg === '' ? true : false}
|
||||
checked={tempFlg === '' ? true : false}
|
||||
value={''}
|
||||
onChange={(e) => {
|
||||
setTempFlg(e.target.value)
|
||||
stuffSearch.schTempFlg = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="schTempFlg">{getMessage('stuff.search.schTempFlg')}</label>
|
||||
@ -1154,11 +1124,10 @@ export default function StuffSearchCondition() {
|
||||
type="radio"
|
||||
name="schTempFlg"
|
||||
id="schTempFlg0"
|
||||
checked={stuffSearch.schTempFlg === '0' ? true : false}
|
||||
checked={tempFlg === '0' ? true : false}
|
||||
value={'0'}
|
||||
onChange={(e) => {
|
||||
setTempFlg(e.target.value)
|
||||
stuffSearch.schTempFlg = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="schTempFlg0">{getMessage('stuff.search.schTempFlg0')}</label>
|
||||
@ -1168,11 +1137,10 @@ export default function StuffSearchCondition() {
|
||||
type="radio"
|
||||
name="schTempFlg"
|
||||
id="schTempFlg1"
|
||||
checked={stuffSearch.schTempFlg === '1' ? true : false}
|
||||
checked={tempFlg === '1' ? true : false}
|
||||
value={'1'}
|
||||
onChange={(e) => {
|
||||
setTempFlg(e.target.value)
|
||||
stuffSearch.schTempFlg = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="schTempFlg1">{getMessage('stuff.search.schTempFlg1')}</label>
|
||||
@ -1297,7 +1265,6 @@ export default function StuffSearchCondition() {
|
||||
onChange={onSelectionChange2}
|
||||
getOptionLabel={(x) => x.saleStoreName}
|
||||
getOptionValue={(x) => x.saleStoreId}
|
||||
// isDisabled={otherSaleStoreList != null && otherSaleStoreList.length === 1 ? true : false}
|
||||
isDisabled={
|
||||
session?.storeLvl === '1' ? (otherSaleStoreList.length > 0 ? false : true) : otherSaleStoreList.length === 1 ? true : false
|
||||
}
|
||||
@ -1312,10 +1279,9 @@ export default function StuffSearchCondition() {
|
||||
<input
|
||||
type="checkbox"
|
||||
id="schMine"
|
||||
checked={stuffSearch.schMyDataCheck ? true : false}
|
||||
checked={myDataCheck ? true : false}
|
||||
onChange={(e) => {
|
||||
checkMyData(e)
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="schMine">{getMessage('stuff.search.schMine')}</label>
|
||||
|
||||
@ -5,17 +5,19 @@ import useSWR from 'swr'
|
||||
import useSWRMutation from 'swr/mutation'
|
||||
import { useAxios } from '../useAxios'
|
||||
import { unescapeString } from '@/util/common-utils'
|
||||
import { moduleSelectionDataState, moduleSelectionTotalState } from '@/store/selectedModuleOptions'
|
||||
import { moduleSelectionDataState, moduleSelectionTotalState, selectedModuleOptionsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { compasDegAtom } from '@/store/orientationAtom'
|
||||
import { canvasState, currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { DateRangePickerField } from '@nextui-org/react'
|
||||
|
||||
export function useCanvasPopupStatusController(param = 1) {
|
||||
const popupType = parseInt(param)
|
||||
|
||||
const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom)
|
||||
const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState)
|
||||
const { get, getFetcher, postFetcher } = useAxios()
|
||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
||||
const { get, promiseGet, getFetcher, postFetcher } = useAxios()
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
// console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan)
|
||||
@ -35,11 +37,18 @@ export function useCanvasPopupStatusController(param = 1) {
|
||||
// getFetcher,
|
||||
// )
|
||||
|
||||
const res = await get({
|
||||
const result = await promiseGet({
|
||||
url: `/api/v1/canvas-popup-status?objectNo=${currentCanvasPlan.objectNo}&planNo=${currentCanvasPlan.planNo}&popupType=${popupTypeParam}`,
|
||||
})
|
||||
.then((res) => {
|
||||
return res
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('🚀 ~ getModuleSelection ~ err:', err)
|
||||
return null
|
||||
})
|
||||
|
||||
return res
|
||||
return result.data
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,13 +58,15 @@ export function useCanvasPopupStatusController(param = 1) {
|
||||
const handleModuleSelectionTotal = async () => {
|
||||
for (let i = 1; i < 3; i++) {
|
||||
const result = await getModuleSelection(i)
|
||||
console.log('🚀 ~ handleModuleSelectionTotal ~ result:', result)
|
||||
// setModuleSelectionTotal((prev) => ({ ...prev, [i]: JSON.parse(unescapeString(result.popupStatus)) }))
|
||||
if(!result) return
|
||||
if (!result.objectNo) return
|
||||
if (i === 1) {
|
||||
setCompasDeg(result.popupStatus)
|
||||
} else if (i === 2) {
|
||||
const data = JSON.parse(unescapeString(result.popupStatus))
|
||||
setModuleSelectionDataStore(data)
|
||||
if (data.module) setSelectedModules(data.module)
|
||||
|
||||
const roofSurfaceList = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
|
||||
@ -75,7 +75,21 @@ export function useFont() {
|
||||
}
|
||||
}, [lengthText])
|
||||
|
||||
useEffect(() => {}, [circuitNumberText])
|
||||
useEffect(() => {
|
||||
if (canvas && circuitNumberText.fontWeight.value) {
|
||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'circuitNumber')
|
||||
textObjs.forEach((obj) => {
|
||||
obj.set({
|
||||
fontFamily: circuitNumberText.fontFamily.value,
|
||||
fontWeight: circuitNumberText.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal',
|
||||
fontStyle: circuitNumberText.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal',
|
||||
fontSize: circuitNumberText.fontSize.value,
|
||||
fill: circuitNumberText.fontColor.value,
|
||||
})
|
||||
})
|
||||
canvas.renderAll()
|
||||
}
|
||||
}, [circuitNumberText])
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
@ -17,17 +17,21 @@ import { useState } from 'react'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { currentMenuState } from '@/store/canvasAtom'
|
||||
import { canvasState, currentMenuState } from '@/store/canvasAtom'
|
||||
import { MENU } from '@/common/common'
|
||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||
import { usePolygon } from '@/hooks/usePolygon'
|
||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||
|
||||
export default function useMenu() {
|
||||
const menus = []
|
||||
const currentMenu = useRecoilValue(currentMenuState)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const [popupId, setPopupId] = useState(uuidv4())
|
||||
const { addPopup } = usePopup()
|
||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
||||
const { clear: trestleClear } = useTrestle()
|
||||
const { nextStep } = useOrientation()
|
||||
const handleMenu = (type) => {
|
||||
if (type === 'outline') {
|
||||
switch (currentMenu) {
|
||||
@ -85,6 +89,10 @@ export default function useMenu() {
|
||||
addPopup(popupId, 1, <BasicSetting id={popupId} />)
|
||||
break
|
||||
case MENU.MODULE_CIRCUIT_SETTING.CIRCUIT_TRESTLE_SETTING:
|
||||
const hasModules = canvas.getObjects().some((obj) => obj.name === 'module')
|
||||
if (hasModules) {
|
||||
nextStep()
|
||||
}
|
||||
addPopup(popupId, 1, <CircuitTrestleSetting id={popupId} />)
|
||||
break
|
||||
}
|
||||
|
||||
@ -33,6 +33,9 @@ export function useRoofFn() {
|
||||
if (!polygon) {
|
||||
return
|
||||
}
|
||||
if (polygon.points.length < 3) {
|
||||
return
|
||||
}
|
||||
if (isForceChange && !isDisplay) {
|
||||
/*if (polygon.roofMaterial) {
|
||||
polygon.roofMaterial = null
|
||||
@ -156,7 +159,6 @@ export function useRoofFn() {
|
||||
combinedPatternCanvas.width = polygon.width * ratio
|
||||
combinedPatternCanvas.height = polygon.height * ratio
|
||||
const combinedCtx = combinedPatternCanvas.getContext('2d')
|
||||
|
||||
// 첫 번째 패턴을 그린 후 두 번째 패턴을 덧입힘
|
||||
combinedCtx.drawImage(patternSourceCanvas, 0, 0)
|
||||
combinedCtx.drawImage(hachingPatternSourceCanvas, 0, 0)
|
||||
|
||||
@ -168,19 +168,19 @@ export const useEstimateController = (planNo) => {
|
||||
if (estimateData?.charger === null || estimateData?.charger?.trim().length === 0) {
|
||||
flag = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredCharger'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredCharger'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
if (estimateData?.objectName === null || estimateData?.objectName?.trim().length === 0) {
|
||||
flag = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredObjectName'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredObjectName'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
if (isNaN(Date.parse(estimateData.estimateDate))) {
|
||||
flag = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateDate'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateDate'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
if (estimateData.estimateType === 'YJSS') {
|
||||
@ -188,7 +188,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (pkgAsp === '0') {
|
||||
flag = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredPkgAsp'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredPkgAsp'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (estimateData?.northArrangement === '1') {
|
||||
fileFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredNorthArrangementFileUpload'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredNorthArrangementFileUpload'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (estimateData.fileFlg === '0') {
|
||||
fileFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredFileUpload'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredFileUpload'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (item.itemId === '') {
|
||||
itemFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredItemId'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredItemId'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (item.amount < 1) {
|
||||
itemFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredAmount'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredAmount'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
if (estimateData.estimateType !== 'YJSS') {
|
||||
@ -272,7 +272,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (item.salePrice < 1) {
|
||||
itemFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ export const useEstimateController = (planNo) => {
|
||||
if (isNaN(item.salePrice)) {
|
||||
itemFlg = false
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -301,7 +301,7 @@ export const useEstimateController = (planNo) => {
|
||||
})
|
||||
if (delCnt === estimateData.itemList.length) {
|
||||
setIsGlobalLoading(false)
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredItem'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredItem'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { useCanvas } from '../useCanvas'
|
||||
import { useAxios } from '../useAxios'
|
||||
import { usePlan } from '../usePlan'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useContext } from 'react'
|
||||
|
||||
/**
|
||||
* 이미지 로더 hook
|
||||
@ -13,7 +15,7 @@ export function useImgLoader() {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { currentCanvasPlan } = usePlan()
|
||||
const { post } = useAxios()
|
||||
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
/**
|
||||
* 이미지 저장 시 왼쪽 위, 오른쪽 아래 좌표
|
||||
* return [start, end]
|
||||
@ -39,48 +41,53 @@ export function useImgLoader() {
|
||||
* @param {integer} type 1: 모듈만 있는 상태, 2: 가대까지 올린 상태
|
||||
*/
|
||||
const handleCanvasToPng = async (type) => {
|
||||
removeMouseLines()
|
||||
try {
|
||||
removeMouseLines()
|
||||
|
||||
canvas.getObjects('image').forEach((obj) => {
|
||||
if (obj.getSrc) {
|
||||
const img = new Image()
|
||||
img.crossOrigin = 'anonymous'
|
||||
img.src = obj.getSrc()
|
||||
obj.setElement(img)
|
||||
canvas.getObjects('image').forEach((obj) => {
|
||||
if (obj.getSrc) {
|
||||
const img = new Image()
|
||||
img.crossOrigin = 'anonymous'
|
||||
img.src = obj.getSrc()
|
||||
obj.setElement(img)
|
||||
}
|
||||
})
|
||||
|
||||
canvas.renderAll()
|
||||
|
||||
const formData = new FormData()
|
||||
const dataUrl = canvas.toDataURL('image/png')
|
||||
const blobBin = atob(dataUrl.split(',')[1])
|
||||
const array = []
|
||||
for (let i = 0; i < blobBin.length; i++) {
|
||||
array.push(blobBin.charCodeAt(i))
|
||||
}
|
||||
})
|
||||
const file = new Blob([new Uint8Array(array)], { type: 'image/png' })
|
||||
formData.append('file', file, 'canvas.png')
|
||||
formData.append('objectNo', currentCanvasPlan.objectNo)
|
||||
formData.append('planNo', currentCanvasPlan.planNo)
|
||||
formData.append('type', type)
|
||||
// formData.append('coordinates', getImageCoordinates())
|
||||
const positionObj = getImageCoordinates()
|
||||
console.log('🚀 ~ handleCanvasToPng ~ positionObj:', positionObj)
|
||||
formData.append('width', Math.round(positionObj[1].x - positionObj[0].x - 350))
|
||||
formData.append('height', Math.round(positionObj[1].y - positionObj[0].y - 100))
|
||||
formData.append('left', Math.round(positionObj[0].x))
|
||||
formData.append('top', Math.round(positionObj[0].y))
|
||||
console.log('🚀 ~ handleCanvasToPng ~ formData:', formData)
|
||||
|
||||
canvas.renderAll()
|
||||
// 이미지 크롭 요청
|
||||
const result = await post({
|
||||
url: `${process.env.NEXT_PUBLIC_HOST_URL}/image/canvas`,
|
||||
data: formData,
|
||||
})
|
||||
console.log('🚀 ~ handleCanvasToPng ~ result:', result)
|
||||
|
||||
const formData = new FormData()
|
||||
const dataUrl = canvas.toDataURL('image/png')
|
||||
const blobBin = atob(dataUrl.split(',')[1])
|
||||
const array = []
|
||||
for (let i = 0; i < blobBin.length; i++) {
|
||||
array.push(blobBin.charCodeAt(i))
|
||||
return result
|
||||
} catch (e) {
|
||||
setIsGlobalLoading(false)
|
||||
console.log('🚀 ~ handleCanvasToPng ~ e:', e)
|
||||
}
|
||||
const file = new Blob([new Uint8Array(array)], { type: 'image/png' })
|
||||
formData.append('file', file, 'canvas.png')
|
||||
formData.append('objectNo', currentCanvasPlan.objectNo)
|
||||
formData.append('planNo', currentCanvasPlan.planNo)
|
||||
formData.append('type', type)
|
||||
// formData.append('coordinates', getImageCoordinates())
|
||||
const positionObj = getImageCoordinates()
|
||||
console.log('🚀 ~ handleCanvasToPng ~ positionObj:', positionObj)
|
||||
formData.append('width', Math.round(positionObj[1].x - positionObj[0].x - 350))
|
||||
formData.append('height', Math.round(positionObj[1].y - positionObj[0].y - 100))
|
||||
formData.append('left', Math.round(positionObj[0].x))
|
||||
formData.append('top', Math.round(positionObj[0].y))
|
||||
console.log('🚀 ~ handleCanvasToPng ~ formData:', formData)
|
||||
|
||||
// 이미지 크롭 요청
|
||||
const result = await post({
|
||||
url: `${process.env.NEXT_PUBLIC_HOST_URL}/image/canvas`,
|
||||
data: formData,
|
||||
})
|
||||
console.log('🚀 ~ handleCanvasToPng ~ result:', result)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,7 @@ export function useOrientation() {
|
||||
|
||||
const { drawDirectionArrow } = usePolygon()
|
||||
|
||||
useEffect(() => {
|
||||
/*useEffect(() => {
|
||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
roofs.forEach((roof) => {
|
||||
roof.set({
|
||||
@ -20,7 +20,7 @@ export function useOrientation() {
|
||||
})
|
||||
drawDirectionArrow(roof)
|
||||
})
|
||||
}, [])
|
||||
}, [])*/
|
||||
|
||||
const nextStep = () => {
|
||||
if (isNaN(compasDeg)) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -425,7 +425,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
lockMovementY: true, // Y 축 이동 잠금
|
||||
lockRotation: true, // 회전 잠금
|
||||
viewLengthText: true,
|
||||
direction: direction,
|
||||
// direction: direction,
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: dormerName,
|
||||
@ -444,7 +444,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
lockMovementY: true, // Y 축 이동 잠금
|
||||
lockRotation: true, // 회전 잠금
|
||||
viewLengthText: true,
|
||||
direction: direction,
|
||||
// direction: direction,
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: dormerName,
|
||||
@ -462,8 +462,8 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
setSurfaceShapePattern(rightTriangle)
|
||||
//방향
|
||||
|
||||
drawDirectionArrow(leftTriangle)
|
||||
drawDirectionArrow(rightTriangle)
|
||||
// drawDirectionArrow(leftTriangle)
|
||||
// drawDirectionArrow(rightTriangle)
|
||||
|
||||
let offsetPolygon
|
||||
|
||||
@ -649,7 +649,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
lockRotation: true, // 회전 잠금
|
||||
viewLengthText: true,
|
||||
fontSize: 14,
|
||||
direction: direction,
|
||||
// direction: direction,
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: dormerName,
|
||||
@ -666,7 +666,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
lockRotation: true, // 회전 잠금
|
||||
viewLengthText: true,
|
||||
fontSize: 14,
|
||||
direction: direction,
|
||||
// direction: direction,
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: dormerName,
|
||||
@ -680,8 +680,8 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
setSurfaceShapePattern(leftPentagon)
|
||||
setSurfaceShapePattern(rightPentagon)
|
||||
//방향
|
||||
drawDirectionArrow(leftPentagon)
|
||||
drawDirectionArrow(rightPentagon)
|
||||
// drawDirectionArrow(leftPentagon)
|
||||
// drawDirectionArrow(rightPentagon)
|
||||
|
||||
let offsetPolygon
|
||||
|
||||
@ -1025,6 +1025,74 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
}
|
||||
}
|
||||
|
||||
const copyObjectBatch = () => {
|
||||
const obj = canvas.getActiveObject()
|
||||
if (obj) {
|
||||
let clonedObj = null
|
||||
const parentSurface = canvas?.getObjects().filter((item) => item.name === POLYGON_TYPE.ROOF && item.id === obj.parentId)[0]
|
||||
|
||||
obj.clone((cloned) => {
|
||||
clonedObj = cloned
|
||||
})
|
||||
|
||||
addCanvasMouseEventListener('mouse:move', (e) => {
|
||||
const pointer = canvas?.getPointer(e.e)
|
||||
if (!clonedObj) return
|
||||
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((clonedObj) => clonedObj.name === 'clonedObj')
|
||||
.forEach((clonedObj) => canvas?.remove(clonedObj))
|
||||
|
||||
clonedObj.set({
|
||||
left: pointer.x,
|
||||
top: pointer.y,
|
||||
name: 'clonedObj',
|
||||
})
|
||||
canvas.add(clonedObj)
|
||||
})
|
||||
|
||||
addCanvasMouseEventListener('mouse:up', (e) => {
|
||||
//개구, 그림자 타입일 경우 폴리곤 타입 변경
|
||||
if (BATCH_TYPE.OPENING == obj.name || BATCH_TYPE.SHADOW == obj.name) {
|
||||
clonedObj.set({
|
||||
points: rectToPolygon(clonedObj),
|
||||
})
|
||||
|
||||
const turfSurface = pointsToTurfPolygon(parentSurface.points)
|
||||
const turfObject = pointsToTurfPolygon(clonedObj.points)
|
||||
|
||||
if (turf.booleanWithin(turfObject, turfSurface)) {
|
||||
clonedObj.set({
|
||||
lockMovementX: true,
|
||||
lockMovementY: true,
|
||||
name: BATCH_TYPE.OPENING,
|
||||
parentId: parentSurface.id,
|
||||
})
|
||||
clonedObj.setCoords()
|
||||
} else {
|
||||
swalFire({
|
||||
title: getMessage('batch.object.outside.roof'),
|
||||
icon: 'warning',
|
||||
})
|
||||
canvas.remove(clonedObj)
|
||||
}
|
||||
} else {
|
||||
clonedObj.set({
|
||||
lockMovementX: true,
|
||||
lockMovementY: true,
|
||||
name: obj.name,
|
||||
})
|
||||
|
||||
if (clonedObj.type === 'group') reGroupObject(clonedObj)
|
||||
clonedObj.setCoords()
|
||||
}
|
||||
canvas.discardActiveObject()
|
||||
initEvent()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const dormerOffsetKeyEvent = (setArrow1, setArrow2) => {
|
||||
addDocumentEventListener('keydown', document, (e) => {
|
||||
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
||||
@ -1061,5 +1129,6 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
moveObjectBatch,
|
||||
dormerOffsetKeyEvent,
|
||||
dormerOffset,
|
||||
copyObjectBatch,
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ export function useCircuitTrestle() {
|
||||
// 사용된 모듈아이템 목록
|
||||
const getUseModuleItemList = () => {
|
||||
console.log('🚀 ~ getUseModuleItemList ~ selectedModules:', selectedModules)
|
||||
return moduleSelectionData.module?.itemList?.map((m) => {
|
||||
return selectedModules?.itemList?.map((m) => {
|
||||
return {
|
||||
itemId: m.itemId,
|
||||
mixMatlNo: m.mixMatlNo,
|
||||
|
||||
@ -58,7 +58,7 @@ export function useContextMenu() {
|
||||
const [cell, setCell] = useState(null)
|
||||
const [column, setColumn] = useState(null)
|
||||
const { handleZoomClear } = useCanvasEvent()
|
||||
const { moveObjectBatch } = useObjectBatch({})
|
||||
const { moveObjectBatch, copyObjectBatch } = useObjectBatch({})
|
||||
const { moveSurfaceShapeBatch } = useSurfaceShapeBatch({})
|
||||
const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom)
|
||||
const { addLine, removeLine } = useLine()
|
||||
@ -130,11 +130,7 @@ export function useContextMenu() {
|
||||
name: getMessage('contextmenu.roof.material.placement'),
|
||||
component: <RoofAllocationSetting id={popupId} />,
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialRemove',
|
||||
name: getMessage('contextmenu.roof.material.remove'),
|
||||
fn: () => removeRoofMaterial(),
|
||||
},
|
||||
|
||||
{
|
||||
id: 'roofMaterialRemoveAll',
|
||||
name: getMessage('contextmenu.roof.material.remove.all'),
|
||||
@ -243,7 +239,7 @@ export function useContextMenu() {
|
||||
name: getMessage('contextmenu.auxiliary.remove.all'),
|
||||
fn: () => {
|
||||
if (!currentObject) {
|
||||
swalFire({ text: '지붕을 선택해주세요.' })
|
||||
swalFire({ text: getMessage('roof.is.not.selected') })
|
||||
return
|
||||
}
|
||||
const innerLines = canvas.getObjects().filter((obj) => obj.id === currentObject.attributes.roofId)[0]?.innerLines
|
||||
@ -405,7 +401,7 @@ export function useContextMenu() {
|
||||
[
|
||||
{
|
||||
id: 'sizeEdit',
|
||||
name: '사이즈 변경',
|
||||
name: getMessage('contextmenu.size.edit'),
|
||||
component: <SizeSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
@ -470,7 +466,7 @@ export function useContextMenu() {
|
||||
id: 'openingCopy',
|
||||
shortcut: ['c', 'C'],
|
||||
name: `${getMessage('contextmenu.copy')}(C)`,
|
||||
fn: () => copyObject(),
|
||||
fn: () => copyObjectBatch(),
|
||||
},
|
||||
{
|
||||
id: 'openingOffset',
|
||||
|
||||
@ -60,6 +60,7 @@ export function useEstimate() {
|
||||
moveEstimate(planNo, objectNo)
|
||||
})
|
||||
.catch((error) => {
|
||||
setIsGlobalLoading(false)
|
||||
swalFire({ text: error.message, icon: 'error' })
|
||||
})
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ export function usePlan(params = {}) {
|
||||
await getCanvasByObjectNo(objectNo, planNo).then((res) => {
|
||||
if (res.length > 0) {
|
||||
setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: res.find((plan) => plan.planNo === planNo).canvasStatus }))
|
||||
setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: res.find((plan) => plan.planNo === planNo).canvasStatus })))
|
||||
setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: res.find((resPlan) => resPlan.planNo === plan.planNo).canvasStatus })))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -174,6 +174,9 @@ export const usePolygon = () => {
|
||||
* @param polygon
|
||||
*/
|
||||
const drawDirectionArrow = (polygon) => {
|
||||
if (polygon.points.length < 3) {
|
||||
return
|
||||
}
|
||||
const direction = polygon.direction
|
||||
if (!direction) {
|
||||
return
|
||||
|
||||
@ -765,7 +765,7 @@
|
||||
"stuff.search.grid.all": "全体",
|
||||
"stuff.search.grid.selected": "選択",
|
||||
"stuff.search.grid.schSortTypeR": "最近の登録日",
|
||||
"stuff.search.grid.schSortTypeU": "最近の修正日",
|
||||
"stuff.search.grid.schSortTypeU": "最近の更新日",
|
||||
"stuff.windSelectPopup.title": "風速選択",
|
||||
"stuff.windSelectPopup.table.selected": "選択",
|
||||
"stuff.windSelectPopup.table.windspeed": "風速",
|
||||
@ -905,7 +905,7 @@
|
||||
"estimate.detail.header.showPrice": "価格表示",
|
||||
"estimate.detail.header.unitPrice": "定価",
|
||||
"estimate.detail.showPrice.pricingBtn": "Pricing",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricingが欠落しているアイテムがあります。 Pricingを進めてください。",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricingが欠落しているアイテムがあります. 製品を選択してPricingを進めてください.",
|
||||
"estimate.detail.showPrice.description1": "製品価格OPEN",
|
||||
"estimate.detail.showPrice.description2": "追加の変更品目",
|
||||
"estimate.detail.showPrice.description3": "添付必須",
|
||||
@ -1012,6 +1012,8 @@
|
||||
"module.not.batch.north": "북쪽에는 모듈을 배치할 수 없습니다.",
|
||||
"module.trestleDetail.not.exist": "가대 상세 정보가 없습니다.",
|
||||
"max.select": "최대 {0}개까지 선택할 수 있습니다.(JA)",
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)",
|
||||
"roof.is.not.selected": "지붕을 선택해주세요.(JA)",
|
||||
"module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはい]を選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。",
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)"
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요.(JA)"
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@
|
||||
"stuff.search.grid.all": "전체",
|
||||
"stuff.search.grid.selected": "선택",
|
||||
"stuff.search.grid.schSortTypeR": "최근 등록일",
|
||||
"stuff.search.grid.schSortTypeU": "최근 수정일",
|
||||
"stuff.search.grid.schSortTypeU": "최근 갱신일",
|
||||
"stuff.windSelectPopup.title": "풍속선택",
|
||||
"stuff.windSelectPopup.table.selected": "선택",
|
||||
"stuff.windSelectPopup.table.windspeed": "풍속",
|
||||
@ -906,7 +906,7 @@
|
||||
"estimate.detail.header.showPrice": "가격표시",
|
||||
"estimate.detail.header.unitPrice": "정가",
|
||||
"estimate.detail.showPrice.pricingBtn": "Pricing",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricing이 누락된 아이템이 있습니다. Pricing을 진행해주세요.",
|
||||
"estimate.detail.showPrice.pricingBtn.noItemId": "Pricing이 누락된 아이템이 있습니다. 제품 선택 후 Pricing을 진행해주세요.",
|
||||
"estimate.detail.showPrice.description1": "제품 가격 OPEN",
|
||||
"estimate.detail.showPrice.description2": "추가 변경 자재",
|
||||
"estimate.detail.showPrice.description3": "첨부필수",
|
||||
@ -1014,5 +1014,7 @@
|
||||
"module.trestleDetail.not.exist": "가대 상세 정보가 없습니다.",
|
||||
"max.select": "최대 {0}개까지 선택할 수 있습니다.",
|
||||
"module.delete.confirm": "패널을 삭제하고 면입력으로 돌아갑니다. 맞습니까?\n[예]를 선택하면 삭제하고, 면 입력으로 돌아갑니다.\n[아니오]를 선택하면 삭제하지 않고 현재 상태를 유지합니다.",
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다."
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.",
|
||||
"roof.is.not.selected": "지붕을 선택해주세요.",
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요."
|
||||
}
|
||||
|
||||
@ -134,11 +134,12 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
width: 117px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
.grid-btn{
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0 10px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -150,6 +151,7 @@
|
||||
color: #94A0AD;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
span{
|
||||
display: block;
|
||||
margin-right: 5px;
|
||||
|
||||
@ -2033,7 +2033,7 @@ $alert-color: #101010;
|
||||
width: 95.77px;
|
||||
}
|
||||
.thin{
|
||||
margin-left: auto;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user