Merge branch 'dev' into dev-yj
This commit is contained in:
commit
22a9b97085
@ -49,7 +49,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentRoof.roofMatlCd.length > 0) {
|
|
||||||
setBasicSettings({
|
setBasicSettings({
|
||||||
...basicSetting,
|
...basicSetting,
|
||||||
roofsData: {
|
roofsData: {
|
||||||
@ -63,7 +62,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
roofLayout: currentRoof.layout,
|
roofLayout: currentRoof.layout,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}, [basicSetting.roofSizeSet, basicSetting.roofAngleSet, currentRoof])
|
}, [basicSetting.roofSizeSet, basicSetting.roofAngleSet, currentRoof])
|
||||||
|
|
||||||
// Function to update the roofType and corresponding values
|
// Function to update the roofType and corresponding values
|
||||||
@ -245,13 +243,11 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
|||||||
options={roofMaterials.map((roof, index) => {
|
options={roofMaterials.map((roof, index) => {
|
||||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||||
})}
|
})}
|
||||||
//value={roofMaterials.find((r) => r.roofMatlCd === basicSetting.roofs[0]?.roofMatlCd)}
|
|
||||||
//title={basicSetting.roofs[0]?.roofMatlNm}
|
|
||||||
value={basicSetting.roofSizeSet == 3 ? null : currentRoof.roofMatlCd}
|
value={basicSetting.roofSizeSet == 3 ? null : currentRoof.roofMatlCd}
|
||||||
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
||||||
//sourceKey="id"
|
sourceKey="id"
|
||||||
//targetKey="id"
|
targetKey="id"
|
||||||
//showKey="name"
|
showKey="name"
|
||||||
disabled={basicSetting.roofSizeSet == 3}
|
disabled={basicSetting.roofSizeSet == 3}
|
||||||
/>
|
/>
|
||||||
{/* <select
|
{/* <select
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import QPagination from '../common/pagination/QPagination'
|
|||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
import { e } from 'mathjs'
|
||||||
|
|
||||||
export default function Stuff() {
|
export default function Stuff() {
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
@ -41,11 +42,45 @@ export default function Stuff() {
|
|||||||
|
|
||||||
//그리드 내부 복사버튼
|
//그리드 내부 복사버튼
|
||||||
const copyNo = async (value) => {
|
const copyNo = async (value) => {
|
||||||
try {
|
// try {
|
||||||
await navigator.clipboard.writeText(value)
|
// await navigator.clipboard.writeText(value)
|
||||||
alert(getMessage('stuff.detail.header.successCopy'))
|
// alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
alert(getMessage('stuff.detail.header.failCopy'))
|
// alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
// }
|
||||||
|
// Navigator clipboard api needs a secure context (https)
|
||||||
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
|
console.log('확인11', value)
|
||||||
|
await navigator.clipboard
|
||||||
|
.writeText(value)
|
||||||
|
.then(() => {
|
||||||
|
alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('확인22', value)
|
||||||
|
// Use the 'out of viewport hidden text area' trick
|
||||||
|
const textArea = document.createElement('textArea')
|
||||||
|
textArea.value = value
|
||||||
|
|
||||||
|
// Move textarea out of the viewport so it's not visible
|
||||||
|
textArea.style.position = 'absolute'
|
||||||
|
textArea.style.left = '-999999px'
|
||||||
|
|
||||||
|
document.body.prepend(textArea)
|
||||||
|
textArea.select()
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log('deprecated::document.execCommand(`copy`)', document.execCommand('copy'))
|
||||||
|
document.execCommand('copy')
|
||||||
|
alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
|
} catch (err) {
|
||||||
|
alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
} finally {
|
||||||
|
textArea.remove()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,12 +11,48 @@ export default function StuffHeader() {
|
|||||||
const { managementState } = useContext(GlobalDataContext)
|
const { managementState } = useContext(GlobalDataContext)
|
||||||
|
|
||||||
//물건번호 복사
|
//물건번호 복사
|
||||||
|
// const copyObjectNo = async (objectNo) => {
|
||||||
|
// await navigator.clipboard.writeText(objectNo)
|
||||||
|
// alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
|
// try {
|
||||||
|
// } catch (error) {
|
||||||
|
// alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
const copyObjectNo = async (objectNo) => {
|
const copyObjectNo = async (objectNo) => {
|
||||||
await navigator.clipboard.writeText(objectNo)
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
alert(getMessage('stuff.detail.header.successCopy'))
|
console.log('확인11', objectNo)
|
||||||
try {
|
await navigator.clipboard
|
||||||
} catch (error) {
|
.writeText(objectNo)
|
||||||
alert(getMessage('stuff.detail.header.failCopy'))
|
.then(() => {
|
||||||
|
alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('확인22', objectNo)
|
||||||
|
// Use the 'out of viewport hidden text area' trick
|
||||||
|
const textArea = document.createElement('textArea')
|
||||||
|
textArea.value = objectNo
|
||||||
|
|
||||||
|
// Move textarea out of the viewport so it's not visible
|
||||||
|
textArea.style.position = 'absolute'
|
||||||
|
textArea.style.left = '-999999px'
|
||||||
|
|
||||||
|
document.body.prepend(textArea)
|
||||||
|
textArea.select()
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log('deprecated::document.execCommand(`copy`)', document.execCommand('copy'))
|
||||||
|
document.execCommand('copy')
|
||||||
|
alert(getMessage('stuff.detail.header.successCopy'))
|
||||||
|
} catch (err) {
|
||||||
|
alert(getMessage('stuff.detail.header.failCopy'))
|
||||||
|
} finally {
|
||||||
|
textArea.remove()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState, useRef } from 'react'
|
||||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import {
|
import {
|
||||||
adsorptionPointModeState,
|
adsorptionPointModeState,
|
||||||
@ -145,11 +145,20 @@ export function useCanvasSetting() {
|
|||||||
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
const previousRoofMaterialsRef = useRef(null);
|
||||||
if (roofMaterials) {
|
|
||||||
fetchBasicSettings()
|
useEffect(() => { // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행
|
||||||
|
if (JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) {
|
||||||
|
|
||||||
|
// 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음
|
||||||
|
if (roofMaterials) {
|
||||||
|
fetchBasicSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 이전 값을 업데이트
|
||||||
|
previousRoofMaterialsRef.current = roofMaterials;
|
||||||
}
|
}
|
||||||
}, [roofMaterials])
|
}, [roofMaterials]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user