Merge pull request 'dev' (#572) from dev into dev-deploy

Reviewed-on: #572
This commit is contained in:
ysCha 2026-01-12 11:09:53 +09:00
commit 0930c9e7cb
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 { QcastContext } from '@/app/QcastProvider'
import { sessionStore } from '@/store/commonAtom' 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 { setIsGlobalLoading } = useContext(QcastContext)
const { getMessage } = useMessage() const { getMessage } = useMessage()
@ -70,6 +70,8 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
pwrGnrSimType: 'D', //default pwrGnrSimType: 'D', //default
userId: sessionState.userId ? sessionState.userId : "", userId: sessionState.userId ? sessionState.userId : "",
saleStoreId: sessionState.storeId ? sessionState.storeId : "", saleStoreId: sessionState.storeId ? sessionState.storeId : "",
storeLvl: sessionState.storeLvl,
createStoreId: createStoreId ? createStoreId : '',
} }
const options = { responseType: 'blob' } const options = { responseType: 'blob' }

View File

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

View File

@ -54,6 +54,8 @@ export default function StuffDetail() {
const globalLocaleState = useRecoilValue(globalLocaleStore) const globalLocaleState = useRecoilValue(globalLocaleStore)
const ref = useRef() const ref = useRef()
const { get, promiseGet, del, promisePost, promisePut } = useAxios(globalLocaleState) const { get, promiseGet, del, promisePost, promisePut } = useAxios(globalLocaleState)
const [createSaleStoreId, setCreateSaleStoreId] = useState('')
//form //form
const formInitValue = { const formInitValue = {
// T...() S...() // T...() S...()
@ -350,6 +352,9 @@ export default function StuffDetail() {
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => { promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
setIsGlobalLoading(false) setIsGlobalLoading(false)
if (res.status === 200) { if (res.status === 200) {
setCreateSaleStoreId(res?.data?.createSaleStoreId);
if (res?.data?.createSaleStoreId === 'T01') { if (res?.data?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') { if (session?.storeId !== 'T01') {
setShowButton('none') setShowButton('none')
@ -2936,7 +2941,7 @@ export default function StuffDetail() {
<WindSelectPop setShowWindSpeedButtonValid={setShowWindSpeedButtonValid} prefName={form.watch('prefName')} windSpeedInfo={setWindSppedInfo} /> <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 line1 = allRoofLines[i]
const line2 = allRoofLines[j] const line2 = allRoofLines[j]
const diff = Math.abs(line1.length - line2.length) 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) const minLength = Math.min(line1.length, line2.length)
line1.setLengthByValue(minLength * 10) line1.setLengthByValue(minLength * 10)
line2.setLengthByValue(minLength * 10) line2.setLengthByValue(minLength * 10)