Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
0b425daa79
@ -157,27 +157,26 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
}
|
||||
|
||||
const getRoofSurfaceList = () => {
|
||||
return canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
.map((obj) => {
|
||||
return {
|
||||
roofSurfaceId: obj.id,
|
||||
roofSurface: canvas
|
||||
.getObjects()
|
||||
.filter((o) => o.id === obj.parentId)[0]
|
||||
.directionText.replace(/[0-9]/g, ''),
|
||||
roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch,
|
||||
moduleList: getModuleList(obj).map((module) => {
|
||||
return {
|
||||
itemId: module.moduleInfo.itemId,
|
||||
circuit: module.circuitNumber ? module.circuitNumber : null,
|
||||
pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
|
||||
uniqueId: module.id ? module.id : null,
|
||||
}
|
||||
}),
|
||||
}
|
||||
})
|
||||
const roofSurfaceList = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
roofSurfaceList.sort((a, b) => a.left - b.left || b.top - a.top)
|
||||
return roofSurfaceList.map((obj) => {
|
||||
return {
|
||||
roofSurfaceId: obj.id,
|
||||
roofSurface: canvas
|
||||
.getObjects()
|
||||
.filter((o) => o.id === obj.parentId)[0]
|
||||
.directionText.replace(/[0-9]/g, ''),
|
||||
roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch,
|
||||
moduleList: getModuleList(obj).map((module) => {
|
||||
return {
|
||||
itemId: module.moduleInfo.itemId,
|
||||
circuit: module.circuitNumber ? module.circuitNumber : null,
|
||||
pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
|
||||
uniqueId: module.id ? module.id : null,
|
||||
}
|
||||
}),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getModuleList = (surface) => {
|
||||
@ -366,6 +365,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
})
|
||||
|
||||
console.log(canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE))
|
||||
apply()
|
||||
}
|
||||
|
||||
const onClickPrev = () => {
|
||||
@ -443,11 +443,14 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
pcsMkrCd: item.pcsMkrCd,
|
||||
pcsSerCd: item.pcsSerCd,
|
||||
pcsItemId: item.itemId,
|
||||
pcsOptCd: seletedOption.code,
|
||||
pscOptCd: seletedOption.code,
|
||||
// pcsOptCd: 'CLC_RMC',
|
||||
paralQty: serQty.paralQty,
|
||||
connections: {
|
||||
connItemId: item.connList[0].itemId,
|
||||
},
|
||||
connections: [
|
||||
{
|
||||
connItemId: item.connList[0].itemId,
|
||||
},
|
||||
],
|
||||
}
|
||||
})[0]
|
||||
})
|
||||
|
||||
@ -65,7 +65,7 @@ export default function StepUp(props) {
|
||||
// PCS 옵션 조회
|
||||
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
setOptCodes(formattedOptCodes)
|
||||
setSeletedOption(formattedOptCodes[0].code)
|
||||
setSeletedOption(formattedOptCodes[0])
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching step up data:', error)
|
||||
|
||||
@ -206,6 +206,9 @@ export default function PassivityCircuitAllocation(props) {
|
||||
.getObjects()
|
||||
.filter((obj) => targetModules.includes(obj.id))
|
||||
.forEach((obj) => {
|
||||
if (obj.circuit) {
|
||||
canvas.remove(obj.circuit)
|
||||
}
|
||||
const moduleCircuitText = new fabric.Text(getCircuitNumber(), {
|
||||
left: obj.left + obj.width / 2,
|
||||
top: obj.top + obj.height / 2,
|
||||
|
||||
@ -283,15 +283,19 @@ export default function StuffDetail() {
|
||||
cellStyle: { justifyContent: 'center' },
|
||||
cellRenderer: (params) => {
|
||||
let buttonStyle
|
||||
let buttonStyle2
|
||||
if (params.value == null) {
|
||||
buttonStyle = {
|
||||
display: 'none',
|
||||
}
|
||||
}
|
||||
if (managementState?.createUser === 'T01') {
|
||||
if (session.userId !== 'T01') {
|
||||
// #474
|
||||
buttonStyle = { display: 'none' }
|
||||
buttonStyle2 = {
|
||||
display: 'none',
|
||||
}
|
||||
} else {
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
buttonStyle = { display: 'none' }
|
||||
}
|
||||
}
|
||||
}
|
||||
return (
|
||||
@ -312,7 +316,7 @@ export default function StuffDetail() {
|
||||
{getMessage('stuff.detail.planGrid.btn1')}
|
||||
</button>
|
||||
<button
|
||||
style={buttonStyle}
|
||||
style={buttonStyle2}
|
||||
type="button"
|
||||
className="grid-btn"
|
||||
onClick={() => {
|
||||
@ -347,15 +351,10 @@ export default function StuffDetail() {
|
||||
}
|
||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
// if (res?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
|
||||
// setShowButton('none')
|
||||
// } else {
|
||||
// if (session.storeId !== res?.data?.createSaleStoreId) {
|
||||
// setShowButton('none')
|
||||
// }
|
||||
// }
|
||||
if (res?.data?.createSaleStoreId !== session?.storeId) {
|
||||
setShowButton('none')
|
||||
if (res?.data?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
setShowButton('none')
|
||||
}
|
||||
}
|
||||
if (isObjectNotEmpty(res.data)) {
|
||||
let surfaceTypeValue
|
||||
@ -366,6 +365,7 @@ export default function StuffDetail() {
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
} else {
|
||||
setIsGlobalLoading(false)
|
||||
setManagementState({})
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
@ -381,9 +381,9 @@ export default function StuffDetail() {
|
||||
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
||||
}
|
||||
} else {
|
||||
setIsGlobalLoading(false)
|
||||
setManagementState({})
|
||||
setPlanGridProps({ ...planGridProps, planGridData: [] })
|
||||
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.notExistObjectNo'),
|
||||
type: 'alert',
|
||||
@ -1395,7 +1395,7 @@ export default function StuffDetail() {
|
||||
//상세화면으로 전환
|
||||
if (res.status === 201) {
|
||||
setIsGlobalLoading(false)
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: res?.data?.objectNo })
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.save'),
|
||||
type: 'alert',
|
||||
@ -1423,7 +1423,7 @@ export default function StuffDetail() {
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
setManagementState(res?.data)
|
||||
// callDetailApi(objectNo)
|
||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -1435,30 +1435,6 @@ export default function StuffDetail() {
|
||||
}
|
||||
}
|
||||
|
||||
const callDetailApi = async (objectNo) => {
|
||||
await promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
// if (res?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
|
||||
// setShowButton('none')
|
||||
// } else {
|
||||
// if (session.storeId !== res?.data?.createSaleStoreId) {
|
||||
// setShowButton('none')
|
||||
// }
|
||||
// }
|
||||
|
||||
if (res?.data?.createSaleStoreId !== session?.storeId) {
|
||||
setShowButton('none')
|
||||
}
|
||||
|
||||
let surfaceTypeValue
|
||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||
surfaceTypeValue = '3'
|
||||
} else {
|
||||
surfaceTypeValue = '2'
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
})
|
||||
}
|
||||
|
||||
// 임시저장
|
||||
const onTempSave = async () => {
|
||||
const formData = form.getValues()
|
||||
@ -1570,6 +1546,7 @@ export default function StuffDetail() {
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
|
||||
.then(() => {
|
||||
console.log('트루555')
|
||||
setIsGlobalLoading(true)
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||
if (session.storeId === 'T01') {
|
||||
@ -1645,15 +1622,10 @@ export default function StuffDetail() {
|
||||
|
||||
// 그리드 더블 클릭 해당플랜의 도면작성 화면으로 이동
|
||||
const getCellDoubleClicked = (params) => {
|
||||
//#474정책
|
||||
// if (managementState.createUser === 'T01') {
|
||||
// if (session.userId !== 'T01') {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
if (managementState?.createSaleStoreId !== session?.storeId) {
|
||||
return false
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (params?.column?.colId !== 'estimateDate') {
|
||||
|
||||
@ -68,7 +68,7 @@ export default function StuffHeader() {
|
||||
<div className="sub-table-box">
|
||||
<div className="info-title">{getMessage('stuff.detail.header.specificationConfirmDate')}</div>
|
||||
<div className="info-inner">
|
||||
{managementState?.specificationConfirmDate ? `${dayjs(managementState.specificationConfirmDate).format('YYYY.MM.DD HH:mm:ss')}` : ''}
|
||||
{managementState?.specificationConfirmDate ? `${dayjs(managementState.specificationConfirmDate).format('YYYY.MM.DD')}` : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div className="sub-table-box">
|
||||
|
||||
@ -38,14 +38,10 @@ export default function StuffSubHeader({ type }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(managementState)) {
|
||||
// if (managementState.createUser === 'T01') {
|
||||
// if (session.userId !== 'T01') {
|
||||
// //도면 작성은 이동 할 수 있도록 변경 #457 다시 못하도록 변경#474
|
||||
// setButtonStyle('none')
|
||||
// }
|
||||
// }
|
||||
if (managementState.createSaleStoreId !== session?.storeId) {
|
||||
setButtonStyle('none')
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
setButtonStyle('none')
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [managementState])
|
||||
|
||||
@ -194,7 +194,6 @@ export const useTrestle = () => {
|
||||
height = Math.floor(height)
|
||||
let { x: startX, y: startY } = { ...module.getCenterPoint() }
|
||||
let { x, y } = { ...module.getCenterPoint() }
|
||||
//TODO : 방향별로 가대 설치해야함
|
||||
|
||||
let leftRows = 1
|
||||
let rightRows = 1
|
||||
@ -446,9 +445,9 @@ export const useTrestle = () => {
|
||||
|
||||
const getQuoationItems = () => {
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses: [] }
|
||||
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses: surfaces[0].pcses ?? [] }
|
||||
getQuotationItem(params).then((res) => {
|
||||
console.log(res)
|
||||
console.log('res', res)
|
||||
})
|
||||
}
|
||||
|
||||
@ -1884,7 +1883,7 @@ export const useTrestle = () => {
|
||||
|
||||
const clear = () => {
|
||||
canvas.getObjects().forEach((obj) => {
|
||||
if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack') {
|
||||
if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack' || obj.name === 'bracket') {
|
||||
canvas.remove(obj)
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user