Merge branch 'dev' into dev-yj
This commit is contained in:
commit
cdc861f3d2
4
public/static/images/canvas/side_icon10.svg
Normal file
4
public/static/images/canvas/side_icon10.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.75 3.94737H12.0625C13.6425 3.94737 14.4325 3.94737 15 4.31991C15.2457 4.48119 15.4567 4.68842 15.6208 4.92979C16 5.48734 16 6.26349 16 7.81579C16 8.02719 16.0003 8.01008 16 8.36842M8.5 3.94737L8.02492 3.01388C7.63134 2.24053 7.27167 1.46209 6.39944 1.14074C6.01742 1 5.58102 1 4.7082 1C3.34585 1 2.66467 1 2.15355 1.28023C1.7892 1.47999 1.48857 1.77535 1.28524 2.13331C1 2.63547 1 3.30469 1 4.64315V6.89474C1 10.3682 1 12.105 2.09835 13.1841C3.11612 14.184 4.7087 14.2574 7.75 14.2627" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M12.7793 14.5884C13.3445 15.1372 14.2609 15.1372 14.8261 14.5884C15.3914 14.0396 15.3914 13.1498 14.8261 12.601L13.5469 11.3589C13.0473 10.8739 12.2733 10.8175 11.71 11.19M11.7208 9.51684C11.1556 8.96805 10.2392 8.96805 9.67397 9.51684C9.10876 10.0656 9.10876 10.9554 9.67397 11.5042L10.9532 12.7463C11.462 13.2403 12.2554 13.2896 12.8211 12.8942" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -76,7 +76,6 @@ export const LINE_TYPE = {
|
||||
HIP: 'hip',
|
||||
RIDGE: 'ridge',
|
||||
GABLE: 'gable',
|
||||
VALLEY: 'valley',
|
||||
VERGE: 'verge',
|
||||
ONESIDE_FLOW_RIDGE: 'onesideFlowRidge', //한쪽흐름 용마루
|
||||
YOSEMUNE: 'yosemune', //요세무네
|
||||
@ -158,6 +157,8 @@ export const SAVE_KEY = [
|
||||
'lines',
|
||||
'offset',
|
||||
'arrow',
|
||||
'surfaceCompass',
|
||||
'moduleCompass',
|
||||
]
|
||||
|
||||
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype]
|
||||
|
||||
@ -131,10 +131,9 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
||||
|
||||
this.on('selected', () => {
|
||||
Object.keys(this.controls).forEach((controlKey) => {
|
||||
if (controlKey !== 'ml' && controlKey !== 'mr') {
|
||||
this.setControlVisible(controlKey, false)
|
||||
}
|
||||
this.setControlVisible(controlKey, false)
|
||||
})
|
||||
this.set({ hasBorders: false })
|
||||
})
|
||||
|
||||
this.on('removed', () => {
|
||||
@ -191,7 +190,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
||||
line.endPoint = nextPoint
|
||||
this.lines.push(line)
|
||||
})
|
||||
// }
|
||||
},
|
||||
|
||||
containsPoint: function (point) {
|
||||
const isInside = this.inPolygon(point)
|
||||
this.set('selectable', isInside)
|
||||
return isInside
|
||||
},
|
||||
|
||||
// 보조선 그리기
|
||||
|
||||
@ -13,6 +13,7 @@ import QContextMenu from '@/components/common/context-menu/QContextMenu'
|
||||
import { useCanvasConfigInitialize } from '@/hooks/common/useCanvasConfigInitialize'
|
||||
import { MENU } from '@/common/common'
|
||||
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
||||
import { totalDisplaySelector } from '@/store/settingAtom'
|
||||
|
||||
export default function CanvasFrame() {
|
||||
const canvasRef = useRef(null)
|
||||
@ -21,6 +22,7 @@ export default function CanvasFrame() {
|
||||
const currentMenu = useRecoilValue(currentMenuState)
|
||||
const { contextMenu, handleClick } = useContextMenu()
|
||||
const { selectedPlan, modifiedPlanFlag, checkCanvasObjectEvent, resetModifiedPlans, currentCanvasPlan } = usePlan()
|
||||
const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부
|
||||
useEvent()
|
||||
|
||||
const loadCanvas = () => {
|
||||
@ -72,7 +74,8 @@ export default function CanvasFrame() {
|
||||
MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING,
|
||||
MENU.MODULE_CIRCUIT_SETTING.CIRCUIT_TRESTLE_SETTING,
|
||||
MENU.MODULE_CIRCUIT_SETTING.PLAN_ORIENTATION,
|
||||
].includes(currentMenu) && <PanelBatchStatistics />}
|
||||
].includes(currentMenu) &&
|
||||
totalDisplay && <PanelBatchStatistics />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -235,6 +235,7 @@ export default function CanvasMenu(props) {
|
||||
<QSelectBox title={'瓦53A'} option={SelectOption} />
|
||||
</div>
|
||||
<div className="btn-from">
|
||||
<button className="btn10"></button>
|
||||
{/*<button className="btn04" onClick={() => setShowCanvasSettingModal(true)}></button>*/}
|
||||
<button className="btn04" onClick={handlePopup}></button>
|
||||
<button className="btn05"></button>
|
||||
|
||||
61
src/components/floor-plan/modal/ImgLoad.jsx
Normal file
61
src/components/floor-plan/modal/ImgLoad.jsx
Normal file
@ -0,0 +1,61 @@
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
|
||||
export default function ImgLoad() {
|
||||
return (
|
||||
<WithDraggable isShow={true}>
|
||||
<div className={`modal-pop-wrap r`}>
|
||||
<div className="modal-head">
|
||||
<h1 className="title">画像を読み込む </h1>
|
||||
<button className="modal-close">닫기</button>
|
||||
</div>
|
||||
<div className="modal-body">
|
||||
<div className="img-flex-box">
|
||||
<span className="normal-font mr10">サイズ調整と回転</span>
|
||||
<label className="toggle-btn">
|
||||
<input type="checkbox" />
|
||||
<span className="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="img-load-from">
|
||||
<div className="img-load-item">
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio03" id="ra06" />
|
||||
<label htmlFor="ra06">ファイルを読み込む</label>
|
||||
</div>
|
||||
<div className="img-flex-box">
|
||||
<div className="img-edit-wrap">
|
||||
<label className="img-edit-btn" htmlFor="img_file">
|
||||
<span className="img-edit"></span>
|
||||
ファイルの追加
|
||||
</label>
|
||||
<input type="file" id="img_file" style={{ display: 'none' }} />
|
||||
</div>
|
||||
<div className="img-name-wrap">
|
||||
<input type="text" className="input-origin al-l" defaultValue={'IMG_Name.PNG'} readOnly />
|
||||
<button className="img-check"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="img-load-item">
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio03" id="ra06" />
|
||||
<label htmlFor="ra06">アドレスを読み込む</label>
|
||||
</div>
|
||||
<div className="img-flex-box for-address">
|
||||
<input type="text" className="input-origin al-l mr10" placeholder={'住所入力'} />
|
||||
<div className="img-edit-wrap">
|
||||
<button className="img-edit-btn">完了</button>
|
||||
</div>
|
||||
<span className="check-address fail"></span>
|
||||
<span className="check-address success"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal act">完了</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</WithDraggable>
|
||||
)
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { useState } from 'react'
|
||||
import Orientation from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import Module from '@/components/floor-plan/modal/basic/step/Module'
|
||||
import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchModule'
|
||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||
@ -9,12 +8,22 @@ import Placement from '@/components/floor-plan/modal/basic/step/Placement'
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { canvasSettingState } from '@/store/canvasAtom'
|
||||
import { usePopup } from '@/hooks/usePopup'
|
||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||
|
||||
export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const { getMessage } = useMessage()
|
||||
const { closePopup } = usePopup()
|
||||
const [tabNum, setTabNum] = useState(1)
|
||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||
const orientationRef = useRef(null)
|
||||
|
||||
const handleBtnNextStep = () => {
|
||||
if (tabNum === 1) {
|
||||
orientationRef.current.handleNextStep()
|
||||
}
|
||||
setTabNum(tabNum + 1)
|
||||
}
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos}>
|
||||
<div className={`modal-pop-wrap lx-2`}>
|
||||
@ -32,7 +41,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
<span className={`tab-arr ${tabNum === 3 ? 'act' : ''}`}></span>
|
||||
<div className={`module-tab-bx ${tabNum === 3 ? 'act' : ''}`}>{getMessage('modal.module.basic.setting.module.placement')}</div>
|
||||
</div>
|
||||
{tabNum === 1 && <Orientation setTabNum={setTabNum} />}
|
||||
{tabNum === 1 && <Orientation ref={orientationRef} tabNum={tabNum} setTabNum={setTabNum} />}
|
||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && tabNum === 3 && <Placement setTabNum={setTabNum} />}
|
||||
@ -49,7 +58,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
)}
|
||||
{/*{tabNum !== 3 && <button className="btn-frame modal act mr5">{getMessage('modal.common.save')}</button>}*/}
|
||||
{tabNum !== 3 && (
|
||||
<button className="btn-frame modal" onClick={() => setTabNum(tabNum + 1)}>
|
||||
<button className="btn-frame modal" onClick={handleBtnNextStep}>
|
||||
Next
|
||||
</button>
|
||||
)}
|
||||
|
||||
@ -1,22 +1,21 @@
|
||||
import { useState } from 'react'
|
||||
import { forwardRef, useImperativeHandle, useState } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useOrientation } from '@/hooks/popup/useOrientation'
|
||||
import { getDegreeInOrientation } from '@/util/canvas-util'
|
||||
|
||||
export default function Orientation({ setTabNum }) {
|
||||
export const Orientation = forwardRef(({ tabNum }, ref) => {
|
||||
const { getMessage } = useMessage()
|
||||
const [compasDeg, setCompasDeg] = useState(0)
|
||||
|
||||
const { nextStep, compasDeg, setCompasDeg } = useOrientation()
|
||||
|
||||
const [hasAnglePassivity, setHasAnglePassivity] = useState(false)
|
||||
|
||||
const getDegree = (degree) => {
|
||||
if (degree % 15 === 0) return degree
|
||||
useImperativeHandle(ref, () => ({
|
||||
handleNextStep,
|
||||
}))
|
||||
|
||||
let value = Math.floor(degree / 15)
|
||||
const remain = ((degree / 15) % 1).toFixed(5)
|
||||
|
||||
if (remain > 0.4) {
|
||||
value++
|
||||
}
|
||||
|
||||
return value * 15
|
||||
const handleNextStep = () => {
|
||||
nextStep()
|
||||
}
|
||||
|
||||
return (
|
||||
@ -31,7 +30,7 @@ export default function Orientation({ setTabNum }) {
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${getDegree(compasDeg) === 15 * (12 + index) ? 'act' : ''}`}
|
||||
className={`circle ${getDegreeInOrientation(compasDeg) === 15 * (12 + index) ? 'act' : ''}`}
|
||||
onClick={() => setCompasDeg(15 * (12 + index))}
|
||||
>
|
||||
{index === 0 && <i>180°</i>}
|
||||
@ -39,13 +38,17 @@ export default function Orientation({ setTabNum }) {
|
||||
</div>
|
||||
))}
|
||||
{Array.from({ length: 180 / 15 }).map((dot, index) => (
|
||||
<div key={index} className={`circle ${getDegree(compasDeg) === 15 * index ? 'act' : ''}`} onClick={() => setCompasDeg(15 * index)}>
|
||||
<div
|
||||
key={index}
|
||||
className={`circle ${getDegreeInOrientation(compasDeg) === 15 * index ? 'act' : ''}`}
|
||||
onClick={() => setCompasDeg(15 * index)}
|
||||
>
|
||||
{index === 0 && <i>0°</i>}
|
||||
{index === 6 && <i>90°</i>}
|
||||
</div>
|
||||
))}
|
||||
<div className="compas">
|
||||
<div className="compas-arr" style={{ transform: `rotate(${getDegree(compasDeg)}deg)` }}></div>
|
||||
<div className="compas-arr" style={{ transform: `rotate(${getDegreeInOrientation(compasDeg)}deg)` }}></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -62,7 +65,11 @@ export default function Orientation({ setTabNum }) {
|
||||
className="input-origin block"
|
||||
value={compasDeg}
|
||||
readOnly={hasAnglePassivity}
|
||||
onChange={(e) => setCompasDeg(e.target.value !== '' ? Number.parseInt(e.target.value) : 0)}
|
||||
onChange={(e) =>
|
||||
setCompasDeg(
|
||||
e.target.value !== '' && parseInt(e.target.value) <= 360 && parseInt(e.target.value) >= 0 ? Number.parseInt(e.target.value) : 0,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">°</span>
|
||||
@ -72,4 +79,4 @@ export default function Orientation({ setTabNum }) {
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@ -174,7 +174,8 @@ export default function Stuff() {
|
||||
schToDt: dayjs(new Date()).format('YYYY-MM-DD'),
|
||||
startRow: (pageNo - 1) * pageSize + 1,
|
||||
endRow: pageNo * pageSize,
|
||||
schSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : stuffSearchParams.schSelSaleStoreId,
|
||||
schSelSaleStoreId: stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : '',
|
||||
schOtherSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : '',
|
||||
schSortType: stuffSearchParams.schSortType,
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,8 @@ export default function StuffSearchCondition() {
|
||||
schAddress: address ? address : '',
|
||||
schObjectName: objectName ? objectName : '',
|
||||
schDispCompanyName: dispCompanyName ? dispCompanyName : '',
|
||||
schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||
schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
||||
schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
||||
schReceiveUser: receiveUser ? receiveUser : '',
|
||||
schDateType: dateType,
|
||||
schFromDt: dayjs(startDate).format('YYYY-MM-DD'),
|
||||
@ -97,7 +98,8 @@ export default function StuffSearchCondition() {
|
||||
schAddress: address,
|
||||
schObjectName: objectName,
|
||||
schDispCompanyName: dispCompanyName,
|
||||
schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||
schSelSaleStoreId: stuffSearch?.schSelSaleStoreId,
|
||||
schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId,
|
||||
schReceiveUser: receiveUser,
|
||||
schDateType: dateType,
|
||||
schFromDt: dayjs(startDate).format('YYYY-MM-DD'),
|
||||
@ -119,7 +121,7 @@ export default function StuffSearchCondition() {
|
||||
objectNameRef.current.value = ''
|
||||
dispCompanyNameRef.current.value = ''
|
||||
receiveUserRef.current.value = ''
|
||||
|
||||
stuffSearch.schDateType = 'U'
|
||||
setObjectNo('')
|
||||
setAddress('')
|
||||
setobjectName('')
|
||||
@ -184,11 +186,31 @@ export default function StuffSearchCondition() {
|
||||
setSchSelSaleStoreList(allList)
|
||||
setFavoriteStoreList(favList)
|
||||
setShowSaleStoreList(favList)
|
||||
// setSchSelSaleStoreId(session?.storeId)
|
||||
// if (stuffSearch.code === 'FINISH') {
|
||||
if (stuffSearch.schSelSaleStoreId != '') {
|
||||
setSchSelSaleStoreId(stuffSearch.schSelSaleStoreId)
|
||||
// if (stuffSearch.schOtherSelSaleStoreId != '') {
|
||||
url = `/api/object/saleStore/${stuffSearch.schSelSaleStoreId}/list?firstFlg=1&userId=${session?.userId}`
|
||||
get({ url: url }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
res.map((row) => {
|
||||
row.value = row.saleStoreId
|
||||
row.label = row.saleStoreName
|
||||
})
|
||||
|
||||
otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
setOtherSaleStoreList(otherList)
|
||||
setOtherSaleStoreId(stuffSearch.schOtherSelSaleStoreId)
|
||||
} else {
|
||||
setOtherSaleStoreList([])
|
||||
}
|
||||
})
|
||||
// }
|
||||
}
|
||||
// }
|
||||
setStuffSearch({
|
||||
...stuffSearch,
|
||||
code: 'S',
|
||||
// schSelSaleStoreId: session?.storeId,
|
||||
})
|
||||
|
||||
//T01일때 2차 판매점 호출하기 디폴트로 1차점을 본인으로 셋팅해서 세션storeId사용
|
||||
@ -224,8 +246,11 @@ export default function StuffSearchCondition() {
|
||||
setStuffSearch({
|
||||
...stuffSearch,
|
||||
code: 'S',
|
||||
schSelSaleStoreId: allList[0].saleStoreId,
|
||||
})
|
||||
|
||||
if (stuffSearch.schOtherSelSaleStoreId != '') {
|
||||
setOtherSaleStoreId(stuffSearch.schOtherSelSaleStoreId)
|
||||
}
|
||||
} else {
|
||||
//10X22, 201X112 그냥2차점
|
||||
//2차점인데 34들고있는애 202X217
|
||||
@ -241,7 +266,8 @@ export default function StuffSearchCondition() {
|
||||
setStuffSearch({
|
||||
...stuffSearch,
|
||||
code: 'S',
|
||||
schSelSaleStoreId: otherList[0].saleStoreId,
|
||||
schSelSaleStoreId: res[0].saleStoreId,
|
||||
schOtherSelSaleStoreId: otherList[0].saleStoreId,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -311,12 +337,31 @@ export default function StuffSearchCondition() {
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreId(key.saleStoreId)
|
||||
stuffSearch.schOtherSelSaleStoreId = key.saleStoreId
|
||||
|
||||
//2차점 골랐을때 1차점 값
|
||||
stuffSearch.schSelSaleStoreId = schSelSaleStoreId
|
||||
} else {
|
||||
//X누르면 검색조건에 1차점으로 셋팅
|
||||
setOtherSaleStoreId('')
|
||||
setSchSelSaleStoreId(schSelSaleStoreId)
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
stuffSearch.schSelSaleStoreId = schSelSaleStoreId
|
||||
if (session.storeLvl === '1') {
|
||||
if (stuffSearch.schOtherSelSaleStoreId === '') {
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
setSchSelSaleStoreId(session.storeId)
|
||||
} else {
|
||||
setStuffSearch({
|
||||
...stuffSearch,
|
||||
schSelSaleStoreId: '',
|
||||
schOtherSelSaleStoreId: '',
|
||||
})
|
||||
//1차점 로그인해서 2차점 고르고 초기화 눌렀을때
|
||||
//stuffSearch에 schSelSaleStoreId 날리고
|
||||
//schOtherSelSaleStoreId 날리고
|
||||
}
|
||||
} else {
|
||||
setOtherSaleStoreId('')
|
||||
setSchSelSaleStoreId(schSelSaleStoreId)
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
stuffSearch.schSelSaleStoreId = schSelSaleStoreId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -533,7 +578,9 @@ export default function StuffSearchCondition() {
|
||||
} else if (stuffSearch?.code === 'E' && schSelSaleStoreId !== '') {
|
||||
return option.saleStoreId === schSelSaleStoreId
|
||||
} else {
|
||||
if (stuffSearch?.schSelSaleStoreId !== '') {
|
||||
if (stuffSearch?.code === 'FINISH') {
|
||||
return option.saleStoreId === schSelSaleStoreId
|
||||
} else if (stuffSearch?.schSelSaleStoreId !== '') {
|
||||
return option.saleStoreId === stuffSearch.schSelSaleStoreId
|
||||
} else {
|
||||
return false
|
||||
@ -608,10 +655,11 @@ export default function StuffSearchCondition() {
|
||||
type="radio"
|
||||
name="radio_ptype"
|
||||
id="radio_u"
|
||||
checked={dateType === 'U' ? true : false}
|
||||
checked={stuffSearch.schDateType === 'U' ? true : false}
|
||||
value={'U'}
|
||||
onChange={(e) => {
|
||||
setDateType(e.target.value)
|
||||
stuffSearch.schDateType = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
||||
@ -621,10 +669,11 @@ export default function StuffSearchCondition() {
|
||||
type="radio"
|
||||
name="radio_ptype"
|
||||
id="radio_r"
|
||||
checked={dateType === 'R' ? true : false}
|
||||
checked={stuffSearch.schDateType === 'R' ? true : false}
|
||||
value={'R'}
|
||||
onChange={(e) => {
|
||||
setDateType(e.target.value)
|
||||
stuffSearch.schDateType = e.target.value
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
||||
|
||||
@ -21,7 +21,7 @@ export function useFlowDirectionSetting(id) {
|
||||
direction: direction,
|
||||
surfaceCompass: orientation,
|
||||
})
|
||||
// drawDirectionArrow(roof)
|
||||
drawDirectionArrow(roof)
|
||||
canvas?.renderAll()
|
||||
closePopup(id)
|
||||
}
|
||||
|
||||
25
src/hooks/popup/useOrientation.js
Normal file
25
src/hooks/popup/useOrientation.js
Normal file
@ -0,0 +1,25 @@
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { canvasState } from '@/store/canvasAtom'
|
||||
import { usePolygon } from '@/hooks/usePolygon'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { compasDegAtom } from '@/store/orientationAtom'
|
||||
|
||||
// 모듈,회로 구성 탭 기본설정 > 방위설정 탭
|
||||
export function useOrientation() {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom)
|
||||
|
||||
const { drawDirectionArrow } = usePolygon()
|
||||
|
||||
const nextStep = () => {
|
||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
roofs.forEach((roof) => {
|
||||
roof.set({
|
||||
moduleCompass: compasDeg,
|
||||
})
|
||||
drawDirectionArrow(roof)
|
||||
})
|
||||
}
|
||||
|
||||
return { nextStep, compasDeg, setCompasDeg }
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, fontFamilyState, fontSizeState, pitchTextSelector } from '@/store/canvasAtom'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { fabric } from 'fabric'
|
||||
import { getDegreeByChon, getDirectionByPoint, isPointOnLine } from '@/util/canvas-util'
|
||||
import { getDegreeByChon, getDegreeInOrientation, getDirectionByPoint, isPointOnLine } from '@/util/canvas-util'
|
||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||
import { isSamePoint, removeDuplicatePolygons } from '@/util/qpolygon-utils'
|
||||
import { flowDisplaySelector } from '@/store/settingAtom'
|
||||
@ -283,12 +283,113 @@ export const usePolygon = () => {
|
||||
//arrow의 compass 값으로 방향 글자 설정 필요
|
||||
const drawDirectionStringToArrow2 = (polygon) => {
|
||||
const { direction, surfaceCompass, moduleCompass, arrow } = polygon
|
||||
if (moduleCompass === null || moduleCompass === undefined) {
|
||||
const textObj = new fabric.Text(`${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText}`, {
|
||||
fontSize: flowFontOptions.fontSize.value,
|
||||
fill: flowFontOptions.fontColor.value,
|
||||
fontFamily: flowFontOptions.fontFamily.value,
|
||||
fontWeight: flowFontOptions.fontWeight.value,
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: 'flowText',
|
||||
selectable: false,
|
||||
left: arrow.stickeyPoint.x,
|
||||
top: arrow.stickeyPoint.y,
|
||||
parent: arrow,
|
||||
parentId: arrow.id,
|
||||
visible: isFlowDisplay,
|
||||
})
|
||||
|
||||
if (!surfaceCompass && !moduleCompass) {
|
||||
polygon.canvas.add(textObj)
|
||||
return
|
||||
}
|
||||
|
||||
let text = ''
|
||||
console.log('direction', direction, surfaceCompass, moduleCompass)
|
||||
|
||||
const compassType = (375 - moduleCompass) / 15
|
||||
|
||||
if ([1, 25].includes(compassType)) {
|
||||
direction === 'north' ? (text = '北') : direction === 'south' ? (text = '南') : direction === 'west' ? (text = '西') : (text = '東')
|
||||
} else if ([2, 3].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '北北東')
|
||||
: direction === 'south'
|
||||
? (text = '南南西')
|
||||
: direction === 'west'
|
||||
? (text = '西北西')
|
||||
: (text = '東南東')
|
||||
} else if ([4].includes(compassType)) {
|
||||
direction === 'north' ? (text = '北東') : direction === 'south' ? (text = '南西') : direction === 'west' ? (text = '北西') : (text = '南東')
|
||||
} else if ([5, 6].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '東北東')
|
||||
: direction === 'south'
|
||||
? (text = '西南西')
|
||||
: direction === 'west'
|
||||
? (text = '北北西')
|
||||
: (text = '南南東')
|
||||
} else if ([7].includes(compassType)) {
|
||||
direction === 'north' ? (text = '東') : direction === 'south' ? (text = '西') : direction === 'west' ? (text = '北') : (text = '南')
|
||||
} else if ([8, 9].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '東南東')
|
||||
: direction === 'south'
|
||||
? (text = '西北西')
|
||||
: direction === 'west'
|
||||
? (text = '北北東')
|
||||
: (text = '南南西')
|
||||
} else if ([10].includes(compassType)) {
|
||||
direction === 'north' ? (text = '南東') : direction === 'south' ? (text = '北西') : direction === 'west' ? (text = '南西') : (text = '北東')
|
||||
} else if ([11, 12].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '南南東')
|
||||
: direction === 'south'
|
||||
? (text = '北北西')
|
||||
: direction === 'west'
|
||||
? (text = '東北東')
|
||||
: (text = '西南西')
|
||||
} else if ([13].includes(compassType)) {
|
||||
direction === 'north' ? (text = '南') : direction === 'south' ? (text = '北') : direction === 'west' ? (text = '東') : (text = '西')
|
||||
} else if ([14, 15].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '南南西')
|
||||
: direction === 'south'
|
||||
? (text = '北北東')
|
||||
: direction === 'west'
|
||||
? (text = '東南東')
|
||||
: (text = '西北西')
|
||||
} else if ([16].includes(compassType)) {
|
||||
direction === 'north' ? (text = '南西') : direction === 'south' ? (text = '北東') : direction === 'west' ? (text = '南東') : (text = '北西')
|
||||
} else if ([17, 18].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '西南西')
|
||||
: direction === 'south'
|
||||
? (text = '東北東')
|
||||
: direction === 'west'
|
||||
? (text = '南南東')
|
||||
: (text = '北北西')
|
||||
} else if ([19].includes(compassType)) {
|
||||
direction === 'north' ? (text = '西') : direction === 'south' ? (text = '東') : direction === 'west' ? (text = '南') : (text = '北')
|
||||
} else if ([20, 21].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '西北西')
|
||||
: direction === 'south'
|
||||
? (text = '東南東')
|
||||
: direction === 'west'
|
||||
? (text = '南南西')
|
||||
: (text = '北北東')
|
||||
} else if ([22].includes(compassType)) {
|
||||
direction === 'north' ? (text = '北西') : direction === 'south' ? (text = '南東') : direction === 'west' ? (text = '南西') : (text = '北東')
|
||||
} else if ([23, 24].includes(compassType)) {
|
||||
direction === 'north'
|
||||
? (text = '北北西')
|
||||
: direction === 'south'
|
||||
? (text = '南南東')
|
||||
: direction === 'west'
|
||||
? (text = '西南西')
|
||||
: (text = '東北東')
|
||||
}
|
||||
|
||||
// 東,西,南,北
|
||||
if ([360].includes(surfaceCompass)) {
|
||||
|
||||
6
src/store/orientationAtom.js
Normal file
6
src/store/orientationAtom.js
Normal file
@ -0,0 +1,6 @@
|
||||
import { atom } from 'recoil'
|
||||
|
||||
export const compasDegAtom = atom({
|
||||
key: 'compasDegAtom',
|
||||
default: 0,
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -954,3 +954,20 @@ export const getAllRelatedObjects = (id, canvas) => {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// 모듈,회로 구성에서 사용하는 degree 범위 별 값
|
||||
export const getDegreeInOrientation = (degree) => {
|
||||
if (degree >= 352) {
|
||||
return 0
|
||||
}
|
||||
if (degree % 15 === 0) return degree
|
||||
|
||||
let value = Math.floor(degree / 15)
|
||||
const remain = ((degree / 15) % 1).toFixed(5)
|
||||
|
||||
if (remain > 0.4) {
|
||||
value++
|
||||
}
|
||||
|
||||
return value * 15
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user