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 { useAxios } from '@/hooks/useAxios'
|
||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
import { sessionStore } from '@/store/commonAtom'
|
||||
|
||||
export default function FloorPlan({ children }) {
|
||||
const [correntObjectNo, setCurrentObjectNo] = useRecoilState(correntObjectNoState)
|
||||
@ -26,6 +27,7 @@ export default function FloorPlan({ children }) {
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
const { promiseGet } = useAxios(globalLocaleState)
|
||||
const { setManagementState } = useContext(GlobalDataContext)
|
||||
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
||||
|
||||
useEffect(() => {
|
||||
getStuffDetailInfo()
|
||||
@ -51,6 +53,12 @@ export default function FloorPlan({ children }) {
|
||||
if (res.data.installHeight === '0') {
|
||||
res.data.installHeight = ''
|
||||
}
|
||||
|
||||
setSessionState((prev) => ({
|
||||
...prev,
|
||||
oneTwoStoreId: res.data.saleStoreId
|
||||
}));
|
||||
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
}
|
||||
})
|
||||
|
||||
@ -132,7 +132,7 @@ export default function PowerConditionalSelect(props) {
|
||||
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) {
|
||||
setModels(
|
||||
res.data.map((model) => {
|
||||
@ -201,6 +201,7 @@ export default function PowerConditionalSelect(props) {
|
||||
pcsMkrCd: option.pcsMkrCd,
|
||||
mixMatlNo: moduleSelectionData.module.mixMatlNo,
|
||||
moduleMatlCds: moduleSelectionData.module.itemList.map((item) => item.itemId).join(','),
|
||||
storeId: sessionState.oneTwoStoreId,
|
||||
}
|
||||
|
||||
getPcsMakerList(param).then((res) => {
|
||||
|
||||
@ -45,6 +45,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
.forEach((obj) => {
|
||||
obj.set({ pcs: null })
|
||||
obj.on('mousedown', (e) => handleTargetModules(obj))
|
||||
})
|
||||
|
||||
@ -135,6 +136,14 @@ export default function PassivityCircuitAllocation(props) {
|
||||
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
|
||||
}
|
||||
@ -341,6 +350,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
obj.circuit = null
|
||||
obj.circuitNumber = null
|
||||
obj.pcsItemId = null
|
||||
obj.pcs = null
|
||||
})
|
||||
setCircuitNumber(minCircuitNumber)
|
||||
setTargetModules([])
|
||||
@ -367,6 +377,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
obj.circuit = null
|
||||
obj.circuitNumber = null
|
||||
obj.pcsItemId = null
|
||||
obj.pcs = null
|
||||
})
|
||||
canvas.renderAll()
|
||||
setCircuitNumber(1)
|
||||
|
||||
@ -37,7 +37,7 @@ export function useMasterController() {
|
||||
return null
|
||||
}
|
||||
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)
|
||||
return res
|
||||
})
|
||||
|
||||
@ -21,7 +21,9 @@ export const dimmedStore = atom({
|
||||
|
||||
export const sessionStore = atom({
|
||||
key: 'sessionState',
|
||||
default: {},
|
||||
default: {
|
||||
oneTwoStoreId: '',
|
||||
},
|
||||
})
|
||||
|
||||
export const slopeSelector = selectorFamily({
|
||||
|
||||
@ -890,6 +890,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||
}
|
||||
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
} else if (condition === 'left_out') {
|
||||
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
||||
@ -977,6 +980,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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' })
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
} else if (condition === 'right_in') {
|
||||
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: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||
}
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
} else if (condition === 'right_out') {
|
||||
console.log('right_out::::isStartEnd:::::', isStartEnd)
|
||||
@ -1153,6 +1160,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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(newPStart, newPEnd, 'red')
|
||||
}
|
||||
} else if (condition === 'top_out') {
|
||||
console.log('top_out isStartEnd:::::::', isStartEnd)
|
||||
@ -1344,6 +1355,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
if (isStartEnd.end) {
|
||||
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') {
|
||||
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: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
} else if (condition === 'bottom_out') {
|
||||
console.log('bottom_out isStartEnd:::::::', isStartEnd)
|
||||
@ -1513,6 +1528,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
getAddLine(newPStart, newPEnd, 'red')
|
||||
}
|
||||
|
||||
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)
|
||||
} else {
|
||||
getAddLine(roofLine.startPoint, roofLine.endPoint)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user