Compare commits

..

No commits in common. "0d3dc8857ce32b15ba04b61b5d50770872735edf" and "265e4c3daf71562b01300f1564fc78885dd77bc3" have entirely different histories.

6 changed files with 7 additions and 46 deletions

View File

@ -13,7 +13,6 @@ 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)
@ -27,7 +26,6 @@ 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()
@ -53,12 +51,6 @@ 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 })
} }
}) })

View File

@ -132,7 +132,7 @@ export default function PowerConditionalSelect(props) {
mixMatlNo: item.mixMatlNo, mixMatlNo: item.mixMatlNo,
} }
}) })
getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList, storeId: sessionState.oneTwoStoreId }).then((res) => { getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList, storeId: sessionState.storeId }).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,7 +201,6 @@ 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) => {

View File

@ -45,7 +45,6 @@ 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))
}) })
@ -135,15 +134,7 @@ 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
} }
@ -350,7 +341,6 @@ 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([])
@ -377,7 +367,6 @@ 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)

View File

@ -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.oneTwoStoreId}` }).then((res) => { return await get({ url: `/api/v1/master/getModuleTypeItemList${paramString}&storeId=${sessionState.storeId}` }).then((res) => {
// console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res) // console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
return res return res
}) })

View File

@ -21,9 +21,7 @@ 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({

View File

@ -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,8 +890,6 @@ 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) {
@ -921,7 +919,6 @@ 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)
@ -980,7 +977,6 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
} }
} }
} }
getAddLine(newPStart, newPEnd, 'red')
} }
if (isStartEnd.end) { if (isStartEnd.end) {
@ -1041,7 +1037,6 @@ 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) {
@ -1070,7 +1065,6 @@ 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) {
@ -1100,7 +1094,6 @@ 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)
@ -1160,7 +1153,6 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
} }
} }
} }
getAddLine(newPStart, newPEnd, 'red')
} }
if (isStartEnd.end) { if (isStartEnd.end) {
@ -1216,7 +1208,6 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
} }
} }
} }
getAddLine(newPStart, newPEnd, 'red')
} }
} }
} }
@ -1267,7 +1258,6 @@ 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) {
@ -1296,7 +1286,6 @@ 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)
@ -1355,7 +1344,6 @@ 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()
@ -1412,7 +1400,6 @@ 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) {
@ -1440,7 +1427,6 @@ 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) {
@ -1469,7 +1455,6 @@ 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)
@ -1528,7 +1513,6 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
} }
} }
} }
getAddLine(newPStart, newPEnd, 'red')
} }
if (isStartEnd.end) { if (isStartEnd.end) {
@ -1586,13 +1570,12 @@ 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)