From 4edbada2e6e263d1f88abdfcb46d613bdabeb1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Fri, 10 May 2024 02:54:11 +0000 Subject: [PATCH] =?UTF-8?q?!2606=20=E4=BF=AE=E5=A4=8D:=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E9=80=A0=E5=9E=8B=E9=85=8D=E7=BD=AE,?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=8B=86=E5=8D=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/Store/RightPanelStore/ModelingStore.ts | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/UI/Store/RightPanelStore/ModelingStore.ts b/src/UI/Store/RightPanelStore/ModelingStore.ts index 7b73a0e9c..a1ca68729 100644 --- a/src/UI/Store/RightPanelStore/ModelingStore.ts +++ b/src/UI/Store/RightPanelStore/ModelingStore.ts @@ -83,11 +83,29 @@ export class ModelingStore implements IConfigStore observable(this.modelingItems).replace(cof.option as IModelingItem[]); for (let i = 0; i < this.modelingItems.length; i++) { - this.UIModelingItems[i].height = this.modelingItems[i].height.toString(); - this.UIModelingItems[i].knifeRad = this.modelingItems[i].knifeRad.toString(); - this.UIModelingItems[i].addLen = this.modelingItems[i].addLen.toString(); - this.UIModelingItems[i].addWidth = this.modelingItems[i].addWidth?.toString() || "0"; - this.UIModelingItems[i].addDepth = this.modelingItems[i].addDepth?.toString() || "0"; + const Item = this.modelingItems[i]; + const Item_UI = this.UIModelingItems[i]; + Item_UI.height = Item.height.toString(); + Item_UI.knifeRad = Item.knifeRad.toString(); + Item_UI.addLen = Item.addLen.toString(); + + //旧版本addWidth/addDepth = undefined 保存配置时未能正确保存 + //undefined会导致拆单时含有槽加长的造型的板件报错 + if (!Item.addWidth) + { + Item.addWidth = 0; + Item_UI.addWidth = "0"; + } + else + Item_UI.addWidth = Item.addWidth.toString(); + + if (!Item.addDepth) + { + Item.addDepth = 0; + Item_UI.addDepth = "0"; + } + else + Item_UI.addDepth = Item.addDepth.toString(); } } }