Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
1df321acf6
@ -1129,6 +1129,14 @@ export default function Estimate({}) {
|
|||||||
setSpecialNoteFirstFlg(false)
|
setSpecialNoteFirstFlg(false)
|
||||||
}, [estimateContextState.resetFlag])
|
}, [estimateContextState.resetFlag])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (estimateContextState?.itemList.length > 0) {
|
||||||
|
const tempList = estimateContextState.itemList.filter((item) => !displayItemList.some((resItem) => resItem.itemId === item.itemId))
|
||||||
|
if (tempList.length > 0) {
|
||||||
|
setDisplayItemList((prevList) => [...prevList, ...tempList])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [estimateContextState])
|
||||||
return (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
<div className="sub-content-inner">
|
<div className="sub-content-inner">
|
||||||
|
|||||||
@ -140,7 +140,6 @@ export function useCanvasSetting() {
|
|||||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) // 선택된 지붕재 정보
|
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) // 선택된 지붕재 정보
|
||||||
const { floorPlanState } = useContext(FloorPlanContext) // 플랜 상태
|
const { floorPlanState } = useContext(FloorPlanContext) // 플랜 상태
|
||||||
const { closeAll } = usePopup() // 팝업 닫기
|
const { closeAll } = usePopup() // 팝업 닫기
|
||||||
const [isRoofMaterialsLoaded, setIsRoofMaterialsLoaded] = useState(false) // roofMaterials 로드 상태 확인
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const tempFetchRoofMaterials = !fetchRoofMaterials
|
const tempFetchRoofMaterials = !fetchRoofMaterials
|
||||||
@ -152,15 +151,6 @@ export function useCanvasSetting() {
|
|||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
/**
|
|
||||||
* roofMaterials가 변경될 때마다 로드 상태 업데이트
|
|
||||||
*/
|
|
||||||
useEffect(() => {
|
|
||||||
if (roofMaterials.length > 0) {
|
|
||||||
setIsRoofMaterialsLoaded(true)
|
|
||||||
}
|
|
||||||
}, [roofMaterials])
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 지붕재 초기세팅
|
* 지붕재 초기세팅
|
||||||
*/
|
*/
|
||||||
@ -319,23 +309,6 @@ export function useCanvasSetting() {
|
|||||||
*/
|
*/
|
||||||
const fetchBasicSettings = async (planNo, openPoint) => {
|
const fetchBasicSettings = async (planNo, openPoint) => {
|
||||||
try {
|
try {
|
||||||
/* roofMaterials가 로드될 때까지 대기 후 실행 */
|
|
||||||
if (!isRoofMaterialsLoaded) {
|
|
||||||
/* roofMaterials가 아직 로드되지 않았다면 */
|
|
||||||
await new Promise((resolve) => {
|
|
||||||
/* 새로운 Promise 생성 */
|
|
||||||
const checkInterval = setInterval(() => {
|
|
||||||
/* 100ms마다 체크하는 인터벌 설정 */
|
|
||||||
console.log('roofMaterials loading... ', roofMaterials.length)
|
|
||||||
if (roofMaterials.length > 0) {
|
|
||||||
/* roofMaterials가 로드되었다면 */
|
|
||||||
clearInterval(checkInterval) // 인터벌 중지
|
|
||||||
resolve() // Promise 완료
|
|
||||||
}
|
|
||||||
}, 100)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
await get({
|
await get({
|
||||||
url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`,
|
url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@ -12,6 +12,7 @@ const LINE_COLOR = {
|
|||||||
GABLE: '#3FBAE6',
|
GABLE: '#3FBAE6',
|
||||||
RIDGE: '#9e9e9e',
|
RIDGE: '#9e9e9e',
|
||||||
DEFAULT: '#000000',
|
DEFAULT: '#000000',
|
||||||
|
ACTIVE: '#EA10AC',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useRoofLinePropertySetting(id, roof) {
|
export function useRoofLinePropertySetting(id, roof) {
|
||||||
@ -23,9 +24,9 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentObject) {
|
if (currentObject && currentObject.name === 'roofLine') {
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
stroke: '#EA10AC',
|
stroke: LINE_COLOR.ACTIVE,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -35,17 +36,18 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
roof.lines.forEach((line) => {
|
roof.lines.forEach((line) => {
|
||||||
canvas.add(line)
|
canvas.add(line)
|
||||||
line.set({
|
line.set({
|
||||||
stroke: '#000000',
|
stroke: LINE_COLOR.DEFAULT,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
visible: true,
|
visible: true,
|
||||||
|
name: 'roofLine',
|
||||||
})
|
})
|
||||||
line.bringToFront()
|
line.bringToFront()
|
||||||
// line.setViewLengthText(false)
|
|
||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetEaves = () => {
|
const handleSetEaves = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -60,6 +62,7 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSetGable = () => {
|
const handleSetGable = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -74,6 +77,7 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSetRidge = () => {
|
const handleSetRidge = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -93,7 +97,11 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
const lastLine = history.current.pop()
|
const lastLine = history.current.pop()
|
||||||
|
|
||||||
delete lastLine.attributes
|
// delete lastLine.attributes
|
||||||
|
lastLine.attributes = {
|
||||||
|
...lastLine.attributes,
|
||||||
|
type: null,
|
||||||
|
}
|
||||||
lastLine.set({
|
lastLine.set({
|
||||||
stroke: LINE_COLOR.DEFAULT,
|
stroke: LINE_COLOR.DEFAULT,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user