Compare commits
5 Commits
265e4c3daf
...
0d3dc8857c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d3dc8857c | |||
| 418e24e080 | |||
| 2c7dcbc57d | |||
| 9cdb7ebd0f | |||
| 008a1230cc |
@ -13,6 +13,7 @@ import { currentMenuState } from '@/store/canvasAtom'
|
|||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
|
|
||||||
export default function FloorPlan({ children }) {
|
export default function FloorPlan({ children }) {
|
||||||
const [correntObjectNo, setCurrentObjectNo] = useRecoilState(correntObjectNoState)
|
const [correntObjectNo, setCurrentObjectNo] = useRecoilState(correntObjectNoState)
|
||||||
@ -26,6 +27,7 @@ export default function FloorPlan({ children }) {
|
|||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet } = useAxios(globalLocaleState)
|
const { promiseGet } = useAxios(globalLocaleState)
|
||||||
const { setManagementState } = useContext(GlobalDataContext)
|
const { setManagementState } = useContext(GlobalDataContext)
|
||||||
|
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getStuffDetailInfo()
|
getStuffDetailInfo()
|
||||||
@ -51,6 +53,12 @@ export default function FloorPlan({ children }) {
|
|||||||
if (res.data.installHeight === '0') {
|
if (res.data.installHeight === '0') {
|
||||||
res.data.installHeight = ''
|
res.data.installHeight = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSessionState((prev) => ({
|
||||||
|
...prev,
|
||||||
|
oneTwoStoreId: res.data.saleStoreId
|
||||||
|
}));
|
||||||
|
|
||||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -132,7 +132,7 @@ export default function PowerConditionalSelect(props) {
|
|||||||
mixMatlNo: item.mixMatlNo,
|
mixMatlNo: item.mixMatlNo,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList, storeId: sessionState.storeId }).then((res) => {
|
getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList, storeId: sessionState.oneTwoStoreId }).then((res) => {
|
||||||
if (res?.result.code === 200 && res?.data) {
|
if (res?.result.code === 200 && res?.data) {
|
||||||
setModels(
|
setModels(
|
||||||
res.data.map((model) => {
|
res.data.map((model) => {
|
||||||
@ -201,6 +201,7 @@ export default function PowerConditionalSelect(props) {
|
|||||||
pcsMkrCd: option.pcsMkrCd,
|
pcsMkrCd: option.pcsMkrCd,
|
||||||
mixMatlNo: moduleSelectionData.module.mixMatlNo,
|
mixMatlNo: moduleSelectionData.module.mixMatlNo,
|
||||||
moduleMatlCds: moduleSelectionData.module.itemList.map((item) => item.itemId).join(','),
|
moduleMatlCds: moduleSelectionData.module.itemList.map((item) => item.itemId).join(','),
|
||||||
|
storeId: sessionState.oneTwoStoreId,
|
||||||
}
|
}
|
||||||
|
|
||||||
getPcsMakerList(param).then((res) => {
|
getPcsMakerList(param).then((res) => {
|
||||||
|
|||||||
@ -45,6 +45,7 @@ export default function PassivityCircuitAllocation(props) {
|
|||||||
.getObjects()
|
.getObjects()
|
||||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
.filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||||
.forEach((obj) => {
|
.forEach((obj) => {
|
||||||
|
obj.set({ pcs: null })
|
||||||
obj.on('mousedown', (e) => handleTargetModules(obj))
|
obj.on('mousedown', (e) => handleTargetModules(obj))
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -134,7 +135,15 @@ export default function PassivityCircuitAllocation(props) {
|
|||||||
originSurfaceList.concat(originSurfaceList).forEach((surface) => {
|
originSurfaceList.concat(originSurfaceList).forEach((surface) => {
|
||||||
surfaceType[`${surface.direction}-${surface.roofMaterial.pitch}`] = surface
|
surfaceType[`${surface.direction}-${surface.roofMaterial.pitch}`] = surface
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (Object.keys(surfaceType).length > 1) {
|
||||||
|
swalFire({
|
||||||
|
text: getMessage('module.circuit.fix.not.same.roof.error'),
|
||||||
|
type: 'alert',
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -341,6 +350,7 @@ export default function PassivityCircuitAllocation(props) {
|
|||||||
obj.circuit = null
|
obj.circuit = null
|
||||||
obj.circuitNumber = null
|
obj.circuitNumber = null
|
||||||
obj.pcsItemId = null
|
obj.pcsItemId = null
|
||||||
|
obj.pcs = null
|
||||||
})
|
})
|
||||||
setCircuitNumber(minCircuitNumber)
|
setCircuitNumber(minCircuitNumber)
|
||||||
setTargetModules([])
|
setTargetModules([])
|
||||||
@ -367,6 +377,7 @@ export default function PassivityCircuitAllocation(props) {
|
|||||||
obj.circuit = null
|
obj.circuit = null
|
||||||
obj.circuitNumber = null
|
obj.circuitNumber = null
|
||||||
obj.pcsItemId = null
|
obj.pcsItemId = null
|
||||||
|
obj.pcs = null
|
||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
setCircuitNumber(1)
|
setCircuitNumber(1)
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export function useMasterController() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const paramString = `?${paramArr.map((item) => `arrRoofMatlCd=${item}`).join('&')}`
|
const paramString = `?${paramArr.map((item) => `arrRoofMatlCd=${item}`).join('&')}`
|
||||||
return await get({ url: `/api/v1/master/getModuleTypeItemList${paramString}&storeId=${sessionState.storeId}` }).then((res) => {
|
return await get({ url: `/api/v1/master/getModuleTypeItemList${paramString}&storeId=${sessionState.oneTwoStoreId}` }).then((res) => {
|
||||||
// console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
|
// console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
|
|||||||
@ -21,7 +21,9 @@ export const dimmedStore = atom({
|
|||||||
|
|
||||||
export const sessionStore = atom({
|
export const sessionStore = atom({
|
||||||
key: 'sessionState',
|
key: 'sessionState',
|
||||||
default: {},
|
default: {
|
||||||
|
oneTwoStoreId: '',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const slopeSelector = selectorFamily({
|
export const slopeSelector = selectorFamily({
|
||||||
|
|||||||
@ -785,8 +785,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
if (isSameLine2(wallBaseLine, wallLine)) {
|
if (isSameLine2(wallBaseLine, wallLine)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const movedStart = Math.abs(wallBaseLine.x1 - wallLine.x1) > EPSILON || Math.abs(wallBaseLine.y1 - wallLine.y1) > EPSILON
|
const movedStart = Math.abs(wallBaseLine.x1 - wallLine.x1) > EPSILON || Math.abs(wallBaseLine.y1 - wallLine.y1) > EPSILON
|
||||||
const movedEnd = Math.abs(wallBaseLine.x2 - wallLine.x2) > EPSILON || Math.abs(wallBaseLine.y2 - wallLine.y2) > EPSILON
|
const movedEnd = Math.abs(wallBaseLine.x2 - wallLine.x2) > EPSILON || Math.abs(wallBaseLine.y2 - wallLine.y2) > EPSILON
|
||||||
@ -890,6 +890,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -919,6 +921,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'left_out') {
|
} else if (condition === 'left_out') {
|
||||||
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
||||||
@ -977,6 +980,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1037,6 +1041,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
findPoints.push({ y: newPStart.y, x: newPEnd.x, position: 'left_out_end' })
|
findPoints.push({ y: newPStart.y, x: newPEnd.x, position: 'left_out_end' })
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'right_in') {
|
} else if (condition === 'right_in') {
|
||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
@ -1065,6 +1070,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1094,6 +1100,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'right_out') {
|
} else if (condition === 'right_out') {
|
||||||
console.log('right_out::::isStartEnd:::::', isStartEnd)
|
console.log('right_out::::isStartEnd:::::', isStartEnd)
|
||||||
@ -1153,6 +1160,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1208,6 +1216,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1258,6 +1267,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1286,6 +1296,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'top_out') {
|
} else if (condition === 'top_out') {
|
||||||
console.log('top_out isStartEnd:::::::', isStartEnd)
|
console.log('top_out isStartEnd:::::::', isStartEnd)
|
||||||
@ -1344,6 +1355,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
const moveDist = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
const moveDist = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
||||||
@ -1400,6 +1412,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'bottom_in') {
|
} else if (condition === 'bottom_in') {
|
||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
@ -1427,6 +1440,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1455,6 +1469,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
}
|
}
|
||||||
getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
} else if (condition === 'bottom_out') {
|
} else if (condition === 'bottom_out') {
|
||||||
console.log('bottom_out isStartEnd:::::::', isStartEnd)
|
console.log('bottom_out isStartEnd:::::::', isStartEnd)
|
||||||
@ -1513,6 +1528,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
@ -1570,12 +1586,13 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
//getAddLine(newPStart, newPEnd, 'red')
|
||||||
//canvas.remove(roofLine)
|
//canvas.remove(roofLine)
|
||||||
} else {
|
} else {
|
||||||
getAddLine(roofLine.startPoint, roofLine.endPoint)
|
getAddLine(roofLine.startPoint, roofLine.endPoint)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user