dev #572

Merged
ysCha merged 6 commits from dev into dev-deploy 2026-01-12 11:09:54 +09:00
4 changed files with 18 additions and 11 deletions

View File

@ -8,7 +8,7 @@ import { usePathname, useSearchParams } from 'next/navigation'
import { QcastContext } from '@/app/QcastProvider'
import { sessionStore } from '@/store/commonAtom'
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg, createStoreId = '' }) {
const { setIsGlobalLoading } = useContext(QcastContext)
const { getMessage } = useMessage()
@ -70,6 +70,8 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
pwrGnrSimType: 'D', //default
userId: sessionState.userId ? sessionState.userId : "",
saleStoreId: sessionState.storeId ? sessionState.storeId : "",
storeLvl: sessionState.storeLvl,
createStoreId: createStoreId ? createStoreId : '',
}
const options = { responseType: 'blob' }

View File

@ -88,9 +88,12 @@ export const QLine = fabric.util.createClass(fabric.Line, {
addLengthText() {
const thisText = this.canvas.getObjects().find((obj) => obj.name === 'lengthText' && obj.parentId === this.id)
if (this.textMode === 'none') {
if (thisText) {
this.canvas.remove(thisText)
if (thisText) {
if (this.attributes?.actualSize) {
thisText.set({ actualSize: this.attributes.actualSize })
}
if (this.attributes?.planeSize) {
thisText.set({ planeSize: this.attributes.planeSize })
}
} else {
this.setLength()
@ -101,11 +104,6 @@ export const QLine = fabric.util.createClass(fabric.Line, {
const x2 = this.left + this.width * scaleX
const y2 = this.top + this.height * scaleY
if (thisText) {
thisText.set({ text: this.getLength().toString(), left: (x1 + x2) / 2, top: (y1 + y2) / 2 })
this.text = thisText
return
}
let left, top
if (this.direction === 'left' || this.direction === 'right') {
left = (x1 + x2) / 2
@ -122,6 +120,8 @@ export const QLine = fabric.util.createClass(fabric.Line, {
const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI
const text = new fabric.Textbox(this.getLength().toString(), {
actualSize: this.attributes?.actualSize,
planeSize: this.attributes?.planeSize,
left: left,
top: top,
fontSize: this.fontSize,

View File

@ -54,6 +54,8 @@ export default function StuffDetail() {
const globalLocaleState = useRecoilValue(globalLocaleStore)
const ref = useRef()
const { get, promiseGet, del, promisePost, promisePut } = useAxios(globalLocaleState)
const [createSaleStoreId, setCreateSaleStoreId] = useState('')
//form
const formInitValue = {
// T...() S...()
@ -350,6 +352,9 @@ export default function StuffDetail() {
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
setIsGlobalLoading(false)
if (res.status === 200) {
setCreateSaleStoreId(res?.data?.createSaleStoreId);
if (res?.data?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') {
setShowButton('none')
@ -2936,7 +2941,7 @@ export default function StuffDetail() {
<WindSelectPop setShowWindSpeedButtonValid={setShowWindSpeedButtonValid} prefName={form.watch('prefName')} windSpeedInfo={setWindSppedInfo} />
)}
{estimatePopupOpen && <DocDownOptionPop planNo={popPlanNo} setEstimatePopupOpen={setEstimatePopupOpen} />}
{estimatePopupOpen && <DocDownOptionPop planNo={popPlanNo} setEstimatePopupOpen={setEstimatePopupOpen} createStoreId={createSaleStoreId}/>}
</>
)
}

View File

@ -1982,7 +1982,7 @@ export const usePolygon = () => {
const line1 = allRoofLines[i]
const line2 = allRoofLines[j]
const diff = Math.abs(line1.length - line2.length)
if (diff > 0 && diff <= 1) {
if (diff > 0 && diff <= 2) {
const minLength = Math.min(line1.length, line2.length)
line1.setLengthByValue(minLength * 10)
line2.setLengthByValue(minLength * 10)