Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev

This commit is contained in:
yoosangwook 2025-02-04 09:53:42 +09:00
commit 0b425daa79
7 changed files with 63 additions and 90 deletions

View File

@ -157,27 +157,26 @@ export default function CircuitTrestleSetting({ id }) {
} }
const getRoofSurfaceList = () => { const getRoofSurfaceList = () => {
return canvas const roofSurfaceList = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
.getObjects() roofSurfaceList.sort((a, b) => a.left - b.left || b.top - a.top)
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) return roofSurfaceList.map((obj) => {
.map((obj) => { return {
return { roofSurfaceId: obj.id,
roofSurfaceId: obj.id, roofSurface: canvas
roofSurface: canvas .getObjects()
.getObjects() .filter((o) => o.id === obj.parentId)[0]
.filter((o) => o.id === obj.parentId)[0] .directionText.replace(/[0-9]/g, ''),
.directionText.replace(/[0-9]/g, ''), roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch,
roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch, moduleList: getModuleList(obj).map((module) => {
moduleList: getModuleList(obj).map((module) => { return {
return { itemId: module.moduleInfo.itemId,
itemId: module.moduleInfo.itemId, circuit: module.circuitNumber ? module.circuitNumber : null,
circuit: module.circuitNumber ? module.circuitNumber : null, pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
pcsItemId: module.circuit ? module.circuit?.pcsItemId : null, uniqueId: module.id ? module.id : null,
uniqueId: module.id ? module.id : null, }
} }),
}), }
} })
})
} }
const getModuleList = (surface) => { 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)) console.log(canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE))
apply()
} }
const onClickPrev = () => { const onClickPrev = () => {
@ -443,11 +443,14 @@ export default function CircuitTrestleSetting({ id }) {
pcsMkrCd: item.pcsMkrCd, pcsMkrCd: item.pcsMkrCd,
pcsSerCd: item.pcsSerCd, pcsSerCd: item.pcsSerCd,
pcsItemId: item.itemId, pcsItemId: item.itemId,
pcsOptCd: seletedOption.code, pscOptCd: seletedOption.code,
// pcsOptCd: 'CLC_RMC',
paralQty: serQty.paralQty, paralQty: serQty.paralQty,
connections: { connections: [
connItemId: item.connList[0].itemId, {
}, connItemId: item.connList[0].itemId,
},
],
} }
})[0] })[0]
}) })

View File

@ -65,7 +65,7 @@ export default function StepUp(props) {
// PCS // PCS
const formattedOptCodes = formatOptionCodes(res.data.optionList) const formattedOptCodes = formatOptionCodes(res.data.optionList)
setOptCodes(formattedOptCodes) setOptCodes(formattedOptCodes)
setSeletedOption(formattedOptCodes[0].code) setSeletedOption(formattedOptCodes[0])
} }
} catch (error) { } catch (error) {
console.error('Error fetching step up data:', error) console.error('Error fetching step up data:', error)

View File

@ -206,6 +206,9 @@ export default function PassivityCircuitAllocation(props) {
.getObjects() .getObjects()
.filter((obj) => targetModules.includes(obj.id)) .filter((obj) => targetModules.includes(obj.id))
.forEach((obj) => { .forEach((obj) => {
if (obj.circuit) {
canvas.remove(obj.circuit)
}
const moduleCircuitText = new fabric.Text(getCircuitNumber(), { const moduleCircuitText = new fabric.Text(getCircuitNumber(), {
left: obj.left + obj.width / 2, left: obj.left + obj.width / 2,
top: obj.top + obj.height / 2, top: obj.top + obj.height / 2,

View File

@ -283,15 +283,19 @@ export default function StuffDetail() {
cellStyle: { justifyContent: 'center' }, cellStyle: { justifyContent: 'center' },
cellRenderer: (params) => { cellRenderer: (params) => {
let buttonStyle let buttonStyle
let buttonStyle2
if (params.value == null) { if (params.value == null) {
buttonStyle = { buttonStyle = {
display: 'none', display: 'none',
} }
} buttonStyle2 = {
if (managementState?.createUser === 'T01') { display: 'none',
if (session.userId !== 'T01') { }
// #474 } else {
buttonStyle = { display: 'none' } if (managementState?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') {
buttonStyle = { display: 'none' }
}
} }
} }
return ( return (
@ -312,7 +316,7 @@ export default function StuffDetail() {
{getMessage('stuff.detail.planGrid.btn1')} {getMessage('stuff.detail.planGrid.btn1')}
</button> </button>
<button <button
style={buttonStyle} style={buttonStyle2}
type="button" type="button"
className="grid-btn" className="grid-btn"
onClick={() => { onClick={() => {
@ -347,15 +351,10 @@ export default function StuffDetail() {
} }
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => { promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
if (res.status === 200) { if (res.status === 200) {
// if (res?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') { if (res?.data?.createSaleStoreId === 'T01') {
// setShowButton('none') if (session?.storeId !== 'T01') {
// } else { setShowButton('none')
// if (session.storeId !== res?.data?.createSaleStoreId) { }
// setShowButton('none')
// }
// }
if (res?.data?.createSaleStoreId !== session?.storeId) {
setShowButton('none')
} }
if (isObjectNotEmpty(res.data)) { if (isObjectNotEmpty(res.data)) {
let surfaceTypeValue let surfaceTypeValue
@ -366,6 +365,7 @@ export default function StuffDetail() {
} }
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue }) setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
} else { } else {
setIsGlobalLoading(false)
setManagementState({}) setManagementState({})
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
@ -381,9 +381,9 @@ export default function StuffDetail() {
setPlanGridProps({ ...planGridProps, planGridData: [] }) setPlanGridProps({ ...planGridProps, planGridData: [] })
} }
} else { } else {
setIsGlobalLoading(false)
setManagementState({}) setManagementState({})
setPlanGridProps({ ...planGridProps, planGridData: [] }) setPlanGridProps({ ...planGridProps, planGridData: [] })
swalFire({ swalFire({
text: getMessage('stuff.detail.header.notExistObjectNo'), text: getMessage('stuff.detail.header.notExistObjectNo'),
type: 'alert', type: 'alert',
@ -1395,7 +1395,7 @@ export default function StuffDetail() {
// //
if (res.status === 201) { if (res.status === 201) {
setIsGlobalLoading(false) setIsGlobalLoading(false)
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) setFloorPlanObjectNo({ floorPlanObjectNo: res?.data?.objectNo })
swalFire({ swalFire({
text: getMessage('stuff.detail.save'), text: getMessage('stuff.detail.save'),
type: 'alert', type: 'alert',
@ -1423,7 +1423,7 @@ export default function StuffDetail() {
type: 'alert', type: 'alert',
confirmFn: () => { confirmFn: () => {
setManagementState(res?.data) 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 onTempSave = async () => {
const formData = form.getValues() const formData = form.getValues()
@ -1570,6 +1546,7 @@ export default function StuffDetail() {
setFloorPlanObjectNo({ floorPlanObjectNo: '' }) setFloorPlanObjectNo({ floorPlanObjectNo: '' })
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` }) del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
.then(() => { .then(() => {
console.log('트루555')
setIsGlobalLoading(true) setIsGlobalLoading(true)
setFloorPlanObjectNo({ floorPlanObjectNo: '' }) setFloorPlanObjectNo({ floorPlanObjectNo: '' })
if (session.storeId === 'T01') { if (session.storeId === 'T01') {
@ -1645,15 +1622,10 @@ export default function StuffDetail() {
// //
const getCellDoubleClicked = (params) => { const getCellDoubleClicked = (params) => {
//#474 if (managementState?.createSaleStoreId === 'T01') {
// if (managementState.createUser === 'T01') { if (session?.storeId !== 'T01') {
// if (session.userId !== 'T01') { return false
// return false }
// }
// }
if (managementState?.createSaleStoreId !== session?.storeId) {
return false
} }
if (params?.column?.colId !== 'estimateDate') { if (params?.column?.colId !== 'estimateDate') {

View File

@ -68,7 +68,7 @@ export default function StuffHeader() {
<div className="sub-table-box"> <div className="sub-table-box">
<div className="info-title">{getMessage('stuff.detail.header.specificationConfirmDate')}</div> <div className="info-title">{getMessage('stuff.detail.header.specificationConfirmDate')}</div>
<div className="info-inner"> <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> </div>
<div className="sub-table-box"> <div className="sub-table-box">

View File

@ -38,14 +38,10 @@ export default function StuffSubHeader({ type }) {
useEffect(() => { useEffect(() => {
if (isObjectNotEmpty(managementState)) { if (isObjectNotEmpty(managementState)) {
// if (managementState.createUser === 'T01') { if (managementState?.createSaleStoreId === 'T01') {
// if (session.userId !== 'T01') { if (session?.storeId !== 'T01') {
// // #457 #474 setButtonStyle('none')
// setButtonStyle('none') }
// }
// }
if (managementState.createSaleStoreId !== session?.storeId) {
setButtonStyle('none')
} }
} }
}, [managementState]) }, [managementState])

View File

@ -194,7 +194,6 @@ export const useTrestle = () => {
height = Math.floor(height) height = Math.floor(height)
let { x: startX, y: startY } = { ...module.getCenterPoint() } let { x: startX, y: startY } = { ...module.getCenterPoint() }
let { x, y } = { ...module.getCenterPoint() } let { x, y } = { ...module.getCenterPoint() }
//TODO : 방향별로 가대 설치해야함
let leftRows = 1 let leftRows = 1
let rightRows = 1 let rightRows = 1
@ -446,9 +445,9 @@ export const useTrestle = () => {
const getQuoationItems = () => { const getQuoationItems = () => {
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) 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) => { getQuotationItem(params).then((res) => {
console.log(res) console.log('res', res)
}) })
} }
@ -1884,7 +1883,7 @@ export const useTrestle = () => {
const clear = () => { const clear = () => {
canvas.getObjects().forEach((obj) => { 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) canvas.remove(obj)
} }
}) })