diff --git a/src/Add-on/HideSelected.ts b/src/Add-on/HideSelected.ts index eab92891c..f19385a8b 100644 --- a/src/Add-on/HideSelected.ts +++ b/src/Add-on/HideSelected.ts @@ -88,6 +88,7 @@ export class Command_SwitchDoor implements Command const ToggleObject = (temp: TemplateRecord) => { + if (!temp) return; for (let id2 of temp.Objects) { if (id2 && !id2.IsErase && id2.Object && !DoorCache.has(id2.Index)) diff --git a/src/Add-on/KJLImport.ts b/src/Add-on/KJLImport.ts index ade8356c5..746a1e8d1 100644 --- a/src/Add-on/KJLImport.ts +++ b/src/Add-on/KJLImport.ts @@ -1,3 +1,4 @@ +import { Intent } from "@blueprintjs/core"; import { Euler, Matrix4, Vector2, Vector3 } from "three"; import { app } from "../ApplicationServices/Application"; import { arrayLast } from "../Common/ArrayExt"; @@ -20,6 +21,7 @@ import { Vec3 } from "../Geometry/IVec3"; import { HandleRectBoardSealingData, ParagraphSealinglist } from "../GraphicsSystem/CalcEdgeSealing"; import { HotCMD } from "../Hot/HotCommand"; import { AppConfirm } from "../UI/Components/Common/Confirm"; +import { AppToaster } from "../UI/Components/Toaster"; import { FaceDirection, IHighSealedItem, LinesType, BoardType } from "../UI/Store/BoardInterface"; import { TopPanelStore } from "../UI/Store/TopPanelStore"; import { EZengZhiBaoId } from "../UI/Store/UserConfigStore"; @@ -149,6 +151,15 @@ export class Command_KJLImport implements Command { let f = files.item(0); let fstr = await FileSystem.ReadFileAsText(f); + if (!fstr) + { + AppToaster.show({ + message: "数据有误", + timeout: 3000, + intent: Intent.DANGER + }); + return; + } let fileData = JSON.parse(fstr) as KJL_JsonFile; let roomMap = ParseRoomNameMap(fileData.designData); diff --git a/src/Add-on/Save.ts b/src/Add-on/Save.ts index 95194ea82..98bae5bae 100644 --- a/src/Add-on/Save.ts +++ b/src/Add-on/Save.ts @@ -120,7 +120,7 @@ export class Save implements Command { let data = await fileServer.UpdateFile({ file_id: fileServer.m_CurFileId, file, logo }); - if (data.err_code !== RequestStatus.Ok) + if (data.err_code !== RequestStatus.Ok || !data.files) { app.Editor.Prompt("更新失败!"); return; diff --git a/src/Add-on/Viewport/OneKeyPrint.ts b/src/Add-on/Viewport/OneKeyPrint.ts index fe938dbfe..f023b4076 100644 --- a/src/Add-on/Viewport/OneKeyPrint.ts +++ b/src/Add-on/Viewport/OneKeyPrint.ts @@ -7,6 +7,8 @@ import { Box3 } from "three"; import { GetPrintWindow, GetImgElement } from "../Print"; import { CADFiler } from "../../DatabaseServices/CADFiler"; import { ViewportEntity } from "../../DatabaseServices/ViewportEntity"; +import { AppToaster } from "../../UI/Components/Toaster"; +import { Intent } from "@blueprintjs/core"; export class OneKeyPrint implements Command { @@ -78,6 +80,15 @@ export class OneKeyPrint implements Command } const win = GetPrintWindow(); + if (!win) + { + AppToaster.show({ + message: "检测是否有窗口被浏览器拦截", + timeout: 3000, + intent: Intent.DANGER + }); + return; + } win.document.body.innerText = "正在生成图纸,请稍等..."; const frag = document.createDocumentFragment(); diff --git a/src/DatabaseServices/FileServer.ts b/src/DatabaseServices/FileServer.ts index a7c780b4c..9e7d06f80 100644 --- a/src/DatabaseServices/FileServer.ts +++ b/src/DatabaseServices/FileServer.ts @@ -226,7 +226,7 @@ export class FileServer extends Singleton { this.SaveCurrentFileInfo(fileInfo); let data = await PostJson(FileUrls.update, fileInfo); - if (data.err_code === RequestStatus.Ok) + if (data.err_code === RequestStatus.Ok && data.files) { let finfo: IFileInfo = { name: data.files.name, diff --git a/src/Editor/DbClick/DbClick.ts b/src/Editor/DbClick/DbClick.ts index 90558ca5b..b384fe08b 100644 --- a/src/Editor/DbClick/DbClick.ts +++ b/src/Editor/DbClick/DbClick.ts @@ -55,7 +55,8 @@ export class DbClickManager extends Singleton app.Viewer.CurrentViewport = oldVP; return; } - oldVP.ViewportMaterial.opacity = 1; + if (oldVP.ViewportMaterial) + oldVP.ViewportMaterial.opacity = 1; oldVP.NeedUpdateTexture = true; if (!pickEnt) { diff --git a/src/Geometry/DrillParse/Face.ts b/src/Geometry/DrillParse/Face.ts index 2f72a09f0..67e4a2a3c 100644 --- a/src/Geometry/DrillParse/Face.ts +++ b/src/Geometry/DrillParse/Face.ts @@ -86,7 +86,7 @@ export class Face //如果不是矩形,用布尔运算,如果 if (!noSideFace.IsRect || !canUseBoxCalc) { - let sideReg = sideFace.Region.Clone(); + let sideReg = sideFace.Region?.Clone(); if (!sideReg || !noSideFace.Region) return []; let toReg = noSideFace.Region.Clone().ApplyMatrix(diffMtx); diff --git a/src/UI/Components/BBS/BoardInfosList.tsx b/src/UI/Components/BBS/BoardInfosList.tsx index 29a88f124..a534490fe 100644 --- a/src/UI/Components/BBS/BoardInfosList.tsx +++ b/src/UI/Components/BBS/BoardInfosList.tsx @@ -119,122 +119,123 @@ export class BoardInfoList extends React.Component bbsEditorStore.tabbarIndexs.map(i => { const key = TotalTabbarTitlesInfos[i][1]; - switch (key) - { - case "IsSpecialShape": - case "IsChaiDan": - case "hasModeling": - case "frontDrill": - case "backDrill": - return ( -
- -
- ); - case "sealing": - return ; - case "highDrill": - return ; - case EBoardKeyList.ProcessGroup: - return ( - + + + ); + case "sealing": + return - ); - case EBoardKeyList.ComposingFace: - return ; - case EBoardKeyList.Lines: - return ; - case EBoardKeyList.DrillType: - - return ; - case EBoardKeyList.BigHole: - return ; - case "remarks": - return ; - default: - return ( -
- ; + case "highDrill": + return ; + case EBoardKeyList.ProcessGroup: + return ( + { this.HandleOnClick(key); }} - onBlur={(e) => { ModifyDataRecord(index, dataBr, key, e.target.value); }} + ModifyDataRecord={ModifyDataRecord} + index={index} + realBr={this.props.realBr} + processGroupData={this.props.processGroupData} /> -
- ); - } + ); + case EBoardKeyList.ComposingFace: + return ; + case EBoardKeyList.Lines: + return ; + case EBoardKeyList.DrillType: + + return ; + case EBoardKeyList.BigHole: + return ; + case "remarks": + return ; + default: + return ( +
+ { this.HandleOnClick(key); }} + onBlur={(e) => { ModifyDataRecord(index, dataBr, key, e.target.value); }} + /> +
+ ); + } }) } diff --git a/src/UI/Components/Board/BoardCommon.tsx b/src/UI/Components/Board/BoardCommon.tsx index 73acf7f8d..f41a73219 100644 --- a/src/UI/Components/Board/BoardCommon.tsx +++ b/src/UI/Components/Board/BoardCommon.tsx @@ -209,8 +209,11 @@ export class BoardRePosBlock extends React.Component { { if (value !== BrRelativePos.Div) { - this.spaceSizeInputEl.focus(); - this.spaceSizeInputEl.setSelectionRange(0, this.spaceSizeInputEl.value.length); + if (this.spaceSizeInputEl) + { + this.spaceSizeInputEl.focus(); + this.spaceSizeInputEl.setSelectionRange(0, this.spaceSizeInputEl.value.length); + } this.props.option.count = 1; this.props.uiOption.count = "1"; } diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index da46734c9..12e282f55 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -516,6 +516,16 @@ export const CommandList: ICommand[] = [ chName: "批量查看", chDes: "批量查看板件属性", }, + { + icon: IconEnum.EditorBBS, + typeId: "bjbj", + link: "#", + defaultCustom: "EDBBS", + command: CommandNames.EditorBBS, + type: "板件编辑", + chName: "配置批量查看", + chDes: "配置批量查看", + }, { icon: IconEnum.ClearRelatedGroove, typeId: "bjbj", diff --git a/src/UI/Components/SourceManage/CommonPanel.tsx b/src/UI/Components/SourceManage/CommonPanel.tsx index 1a9fa9fbf..7b27ee9f8 100644 --- a/src/UI/Components/SourceManage/CommonPanel.tsx +++ b/src/UI/Components/SourceManage/CommonPanel.tsx @@ -761,7 +761,7 @@ export class CommonPanel extends React.Component + handleGetData = async (queryData?: { dir_id?: string, name?: string, curr_page?: number; }) => { this.loading = true; diff --git a/src/UI/Components/SourceManage/FilePanel.tsx b/src/UI/Components/SourceManage/FilePanel.tsx index 60cb5eb1f..83d6263e1 100644 --- a/src/UI/Components/SourceManage/FilePanel.tsx +++ b/src/UI/Components/SourceManage/FilePanel.tsx @@ -64,7 +64,7 @@ export class FilePanel extends React.Component<{ store?: TopPanelStore; }, {}> file: deflate(fileData) }); - await this.commonPanel['handleGetData'](); + await this.commonPanel.handleGetData(); } else { @@ -120,7 +120,7 @@ export class FilePanel extends React.Component<{ store?: TopPanelStore; }, {}> file_id: this.currentFileInfo.fid, name }); - await this.commonPanel['handleGetData'](); + await this.commonPanel.handleGetData(); } Object.assign(this.currentFileInfo, { fid: null, name: null }); this.canCreateFile.set(false); diff --git a/src/UI/Components/Template/Template.less b/src/UI/Components/Template/Template.less index 3c26b1512..2481419a3 100644 --- a/src/UI/Components/Template/Template.less +++ b/src/UI/Components/Template/Template.less @@ -14,6 +14,7 @@ width: 60vw; height: 80vh; min-height: 750px; + max-height: 1000px; .bp3-dialog-body { height: calc(100% - 120px); diff --git a/src/UI/Components/TopToolBar/TopToolBar.tsx b/src/UI/Components/TopToolBar/TopToolBar.tsx index 12b8da56b..1f1cbdd90 100644 --- a/src/UI/Components/TopToolBar/TopToolBar.tsx +++ b/src/UI/Components/TopToolBar/TopToolBar.tsx @@ -92,6 +92,7 @@ export class TopToolBar extends React.Component<{}, {}> { svg: IconEnum.ClearRelatedGroove, title: "清除关联切割", command: CommandNames.ClearRef }, { svg: IconEnum.SunnySideSealing, title: "见光面封边", command: CommandNames.SetSmoothEdge }, { svg: IconEnum.ModifyHoleFace, title: "翻转排孔面", command: CommandNames.ReverseDrillFace }, + { svg: IconEnum.EditorBBS, title: "编辑批量查看项", command: CommandNames.EditorBBS }, ]; store.iconList.dim = [ { svg: IconEnum.DAL, title: "对齐标注", command: CommandNames.AlignDim }, diff --git a/src/UI/IconEnum.ts b/src/UI/IconEnum.ts index bd10f02f2..98af8f28f 100644 --- a/src/UI/IconEnum.ts +++ b/src/UI/IconEnum.ts @@ -181,4 +181,5 @@ export enum IconEnum OneKeyPrint = "ONEKEYPRINT.svg", CheckNoHoleBoard = "CHECKNOHOLEBOARD.svg", CheckDrawHole = "CHECKDRAWHOLE.svg", + EditorBBS = "EDITORBBS.svg", }