From 6d775aa374250d4c63a6822d69ff9c78b6ebed6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E8=AF=97=E9=9B=85?= Date: Wed, 11 Dec 2019 14:33:15 +0800 Subject: [PATCH] =?UTF-8?q?!656=20F1=E9=9D=A2=E6=9D=BF=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/Components/CommandPanel/CmdPanel.tsx | 2 +- src/UI/Components/CommandPanel/CommandList.ts | 407 +++++++----------- .../Modal/ModalStyle/CommandModal.less | 189 ++++---- 3 files changed, 244 insertions(+), 354 deletions(-) diff --git a/src/UI/Components/CommandPanel/CmdPanel.tsx b/src/UI/Components/CommandPanel/CmdPanel.tsx index d5cf51c06..186ae55cd 100644 --- a/src/UI/Components/CommandPanel/CmdPanel.tsx +++ b/src/UI/Components/CommandPanel/CmdPanel.tsx @@ -36,10 +36,10 @@ export class CommandPanel extends React.Component<{}, CommandPanelState> ["灯光", "dg", 0], ["排钻", "pz", 0], ["视图", "view", 0], - ["实体", "czst", 0], ["标注", "dim", 0], ["视觉样式", "VisualStyle", 0], ["工具", "util", 0], + ["文件", "file", 0], ] }; } diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index bc8e4081d..8c4acb138 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -91,16 +91,16 @@ export const CommandList: ICommand[] = observable([ // enName: "Rectangle", chDes: "画一个矩形", }, - { - typeId: "i2d", - link: "#", - defaultCustom: "EL", - command: "EL", - type: "二维", - chName: "椭圆", - // enName: "Ellipse", - chDes: "画一个椭圆", - }, + // { + // typeId: "i2d", + // link: "#", + // defaultCustom: "EL", + // command: "EL", + // type: "二维", + // chName: "椭圆", + // // enName: "Ellipse", + // chDes: "画一个椭圆", + // }, { icon: IconEnum.Text, typeId: "i2d", @@ -112,28 +112,17 @@ export const CommandList: ICommand[] = observable([ // enName: "Text", chDes: "创建单行文字对象", }, - { - icon: IconEnum.SpLine, - typeId: "i2d", - link: "#", - defaultCustom: "SPL", - command: "SPL", - type: "二维", - chName: "样条曲线", - // enName: "SPLine", - chDes: "创建经过或靠近一组拟合点或由控制框的顶点定义的平滑曲线", - }, - { - icon: IconEnum.Box, - typeId: "i2d", - link: "#", - defaultCustom: "B", - command: "B", - type: "二维", - chName: "盒子", - // enName: "Box", - chDes: "创建三维实体长方体", - }, + // { + // icon: IconEnum.SpLine, + // typeId: "i2d", + // link: "#", + // defaultCustom: "SPL", + // command: "SPL", + // type: "二维", + // chName: "样条曲线", + // // enName: "SPLine", + // chDes: "创建经过或靠近一组拟合点或由控制框的顶点定义的平滑曲线", + // }, { icon: IconEnum.Region, typeId: "i2d", @@ -145,63 +134,8 @@ export const CommandList: ICommand[] = observable([ // enName: "Draw Region", chDes: "绘制面域", }, - { - icon: IconEnum.Tangen, - typeId: "i2d", - link: "#", - defaultCustom: "TAN", - command: "TAN", - type: "二维", - chName: "切线", - // enName: "Draw Tangent Line", - chDes: "画切线", - }, - { - icon: IconEnum.Circle, - typeId: "i2d", - link: "#", - defaultCustom: "C0", - command: "C0", - type: "二维", - chName: "单位圆", - // enName: "Unit circle", - chDes: "画单位圆", - }, //三维命令 - { - icon: IconEnum.Ball, - typeId: "i3d", - link: "#", - defaultCustom: "SP", - command: "SP", - type: "三维", - chName: "球体", - // enName: "Sphere", - chDes: "创建三维实体球体", - }, - { - icon: IconEnum.SkyBox, - typeId: "i3d", - link: "#", - defaultCustom: "SKY", - command: "SKY", - type: "三维", - chName: "天空盒", - // enName: "SkyBox", - chDes: "天空盒", - }, - { - icon: IconEnum.Cuboid, - typeId: "i3d", - link: "#", - defaultCustom: "BOX", - command: "BOX", - type: "三维", - chName: "长方体", - // enName: "Box", - chDes: "绘制三维长方体实体", - }, { icon: IconEnum.UCS, typeId: "i3d", @@ -214,18 +148,7 @@ export const CommandList: ICommand[] = observable([ chDes: "设置当前用户坐标系 (UCS) 的原点和方向", }, { - icon: IconEnum.Cylinder, - typeId: "i3d", - link: "#", - defaultCustom: "CYL", - command: "CYL", - type: "三维", - chName: "圆柱体", - // enName: "Cylineder", - chDes: "创建三维实体圆柱体", - }, - { - icon: IconEnum.Cylinder, + icon: IconEnum.ExtrudeEntity, typeId: "i3d", link: "#", defaultCustom: "EXTRUDE", @@ -233,18 +156,7 @@ export const CommandList: ICommand[] = observable([ type: "三维", chName: "拉伸实体", // enName: "Cylineder", - chDes: "创建三维实体圆柱体", - }, - { - icon: IconEnum.DrawAxis, - typeId: "i3d", - link: "#", - defaultCustom: "AXIS", - command: "AXIS", - type: "三维", - chName: "绘制轴", - // enName: "Draw Axis", - chDes: "绘制轴", + chDes: "创建三维拉伸实体", }, //画板命令 @@ -314,17 +226,17 @@ export const CommandList: ICommand[] = observable([ // enName: "VertivalBoard", chDes: "画立板", }, - { - icon: IconEnum.Floor, - typeId: "hb", - link: "#", - defaultCustom: "FL", - command: "FL", - type: "画板", - chName: "地板", - // enName: "SingleBoard", - chDes: "画地板", - }, + // { + // icon: IconEnum.Floor, + // typeId: "hb", + // link: "#", + // defaultCustom: "FL", + // command: "FL", + // type: "画板", + // chName: "地板", + // // enName: "SingleBoard", + // chDes: "画地板", + // }, { icon: IconEnum.Door, typeId: "hb", @@ -651,33 +563,9 @@ export const CommandList: ICommand[] = observable([ chDes: "切换相机", }, - //操作实体 - { - icon: IconEnum.CSGunion, - typeId: "czst", - link: "#", - defaultCustom: "CSGUNION", - command: "CSGUNION", - type: "实体", - chName: "实体并集", - // enName: "CSGunion", - chDes: "实体并集", - }, - { - icon: IconEnum.CSGintersect, - typeId: "czst", - link: "#", - defaultCustom: "CSGSUB", - command: "CSGSUB", - type: "实体", - chName: "实体差集", - // enName: "CSGsub", - chDes: "实体差集", - }, - //尺寸标注命令 { - icon: IconEnum.DimALigned, + icon: IconEnum.DAL, typeId: "dim", link: "#", defaultCustom: "DAL", @@ -688,13 +576,13 @@ export const CommandList: ICommand[] = observable([ chDes: "创建与尺寸界线的原点对齐的线性标注", }, { - icon: IconEnum.DimLinear, + icon: IconEnum.DimContinued, typeId: "dim", link: "#", defaultCustom: "DLI", command: "DLI", type: "标注", - chName: "基线标注",//正确性待验证 + chName: "线性标注", // enName: "Linear Dimension", chDes: "从上一个标注或选定标注的基线处创建线性标注、角度标注或坐标标注", }, @@ -710,7 +598,7 @@ export const CommandList: ICommand[] = observable([ chDes: "测量选定的几何对象或 3 个点之间的角度", }, { - icon: IconEnum.DimContinued, + icon: IconEnum.DimLinear, typeId: "dim", link: "#", defaultCustom: "DCO", @@ -854,28 +742,6 @@ export const CommandList: ICommand[] = observable([ // enName: "Delete", chDes: "删除已经绘制的图元", }, - { - icon: IconEnum.Cancel, - typeId: "util", - link: "#", - defaultCustom: "U", - command: "U", - type: "工具", - chName: "撤销", - // enName: "Redo", - chDes: "撤销上一步操作", - }, - { - icon: IconEnum.Undo, - typeId: "util", - link: "#", - defaultCustom: "REDO", - command: "REDO", - type: "工具", - chName: "重做", - // enName: "Undo", - chDes: "重做上一步操作", - }, { icon: IconEnum.Move, typeId: "util", @@ -998,14 +864,13 @@ export const CommandList: ICommand[] = observable([ chDes: "拉伸与选择窗口或多边形交叉的对象.", }, { - icon: IconEnum.Stretch, typeId: "util", link: "#", defaultCustom: "SS", command: "SELECTSTRETCH", type: "工具", chName: "选择拉伸", - // enName: "Stretch", + // enName: "SelectedStretch", chDes: "先选择要拉伸的对象,在选择拉伸范围拉伸.", }, { @@ -1063,50 +928,17 @@ export const CommandList: ICommand[] = observable([ // enName: "Join", chDes: "合并线性和弯曲对象的端点,以便创建单个对象", }, - { - icon: IconEnum.FBX, - typeId: "util", - link: "#", - defaultCustom: "FBX", - command: "FBX", - type: "工具", - chName: "FBX", - // enName: "Import FBX", - chDes: "导入FBX", - }, - { - icon: IconEnum.DXF, - typeId: "util", - link: "#", - defaultCustom: "DXF", - command: "DXF", - type: "工具", - chName: "DXF", - // enName: "Import DXF", - chDes: "导入DXF", - }, - { - icon: IconEnum.Save, - typeId: "util", - link: "#", - defaultCustom: "SAVE", - command: "SAVE", - type: "工具", - chName: "保存", - // enName: "Save", - chDes: "保存当前图纸", - }, - { - icon: IconEnum.Open, - typeId: "util", - link: "#", - defaultCustom: "OPEN", - command: "OPEN", - type: "工具", - chName: "打开", - // enName: "Open", - chDes: "打开图纸", - }, + // { + // icon: IconEnum.FBX, + // typeId: "util", + // link: "#", + // defaultCustom: "FBX", + // command: "FBX", + // type: "工具", + // chName: "FBX", + // // enName: "Import FBX", + // chDes: "导入FBX", + // }, { icon: IconEnum.Entsel, typeId: "util", @@ -1162,17 +994,17 @@ export const CommandList: ICommand[] = observable([ // enName: "Region Sub", chDes: "差集", }, - { - icon: IconEnum.Sweep, - typeId: "util", - link: "#", - defaultCustom: "SW", - command: "SW", - type: "工具", - chName: "扫掠", - // enName: "Sweep", - chDes: "通过沿开放或闭合路径扫掠二维对象或子对象来创建三维实体或三维曲面", - }, + // { + // icon: IconEnum.Sweep, + // typeId: "util", + // link: "#", + // defaultCustom: "SW", + // command: "SW", + // type: "工具", + // chName: "扫掠", + // // enName: "Sweep", + // chDes: "通过沿开放或闭合路径扫掠二维对象或子对象来创建三维实体或三维曲面", + // }, { icon: IconEnum.Mirror, typeId: "util", @@ -1184,28 +1016,28 @@ export const CommandList: ICommand[] = observable([ // enName: "Mirror", chDes: "创建所选对象的镜像副本", }, - { - icon: IconEnum.Explode, - typeId: "util", - link: "#", - defaultCustom: "X", - command: "X", - type: "工具", - chName: "爆炸", - // enName: "Explode", - chDes: "将对象炸开", - }, - { - icon: IconEnum.ClosestPoint, - typeId: "util", - link: "#", - defaultCustom: "CLOSE", - command: "CLOSE", - type: "工具", - chName: "最近点", - // enName: "Recent Point", - chDes: "最近点", - }, + // { + // icon: IconEnum.Explode, + // typeId: "util", + // link: "#", + // defaultCustom: "X", + // command: "X", + // type: "工具", + // chName: "爆炸", + // // enName: "Explode", + // chDes: "将对象炸开", + // }, + // { + // icon: IconEnum.ClosestPoint, + // typeId: "util", + // link: "#", + // defaultCustom: "CLOSE", + // command: "CLOSE", + // type: "工具", + // chName: "最近点", + // // enName: "Recent Point", + // chDes: "最近点", + // }, { typeId: "util", link: "#", @@ -1216,6 +1048,79 @@ export const CommandList: ICommand[] = observable([ // enName: "Delete Curve", chDes: "批量删除线条", }, + //#endregion + //#region 文件命令 + { + icon: IconEnum.New, + typeId: "file", + link: "#", + defaultCustom: "NEW", + command: "NEW", + type: "文件", + chName: "新建文件", + chDes: "新建文件", + }, + { + icon: IconEnum.Save, + typeId: "file", + link: "#", + defaultCustom: "SAVE", + command: "SAVE", + type: "文件", + chName: "保存文件", + chDes: "保存当前文件", + }, + { + icon: IconEnum.SaveAs, + typeId: "file", + link: "#", + defaultCustom: "SAVEAS", + command: "SAVEAS", + type: "文件", + chName: "另存为", + chDes: "将当前文件另存为", + }, + { + icon: IconEnum.Cancel, + typeId: "file", + link: "#", + defaultCustom: "U", + command: "U", + type: "文件", + chName: "撤销", + chDes: "撤销上一步操作", + }, + { + icon: IconEnum.Undo, + typeId: "file", + link: "#", + defaultCustom: "REDO", + command: "REDO", + type: "文件", + chName: "重做", + chDes: "重做被撤销的操作", + }, + { + icon: IconEnum.Open, + typeId: "file", + link: "#", + defaultCustom: "OPEN", + command: "OPEN", + type: "文件", + chName: "打开", + chDes: "打开文件", + }, + { + icon: IconEnum.DXF, + typeId: "file", + link: "#", + defaultCustom: "DXF", + command: "DXF", + type: "文件", + chName: "DXF", + // enName: "Import DXF", + chDes: "导入DXF", + }, //#endregion ]); diff --git a/src/UI/Components/Modal/ModalStyle/CommandModal.less b/src/UI/Components/Modal/ModalStyle/CommandModal.less index a5e5268df..47702772f 100644 --- a/src/UI/Components/Modal/ModalStyle/CommandModal.less +++ b/src/UI/Components/Modal/ModalStyle/CommandModal.less @@ -1,103 +1,88 @@ -#commandPanel .bp3-dialog -{ - margin-bottom: 0; -} -#commandPanel .bp3-dialog-body -{ - display: flex; - width: 50vw; - min-width: 651px; -} -#commandPanel .bp3-tabs -{ - min-width: 86px; - justify-content: center; -} -#commanPanel .bp3-tab -{ - margin: 0px; - padding-left: 10px; -} -//命令面板输入框样式 -#commandPanel .bp3-input { - border-radius: unset; - margin: 10px; - font-size: initial; - width:-webkit-fill-available; -} -#commandPanel .bp3-tab-list -{ - text-align: center; -} -#commandPanel .bp3-card -{ - width: 100%; - height: 50vh; - min-height: 300px; - overflow: auto; - padding: 0 10px 10px 10px; - margin: 10px; -} -#commandPanel .bp3-card>ul>ul>div>h1 -{ - font-size: 2.5rem !important; - padding-left: 30px; - margin: 25px 0px; -} -#commandPanel .bp3-card>ul>li,#commandPanel .bp3-card>ul>ul>li -{ - border-bottom: 1px solid #5C7080; - padding: 5px; - display: flex; - flex-direction:row; - outline: none; - align-items: center; - justify-content: space-around; -} -#commandPanel .bp3-card>ul>li>li,#commandPanel .bp3-card>ul>ul>li>li -{ - height: 36px; - margin-right: 12px; - font-size: large; - display: flex; - align-items: center; -} -#commandPanel .bp3-card>ul>li>li:first-child,#commandPanel .bp3-card>ul>ul>li>li:first-child -{ - width:4%; -} -#commandPanel .bp3-card>ul>li>li:nth-child(2),#commandPanel .bp3-card>ul>ul>li>li:nth-child(2) -{ - width:17%; -} -#commandPanel .bp3-card>ul>li>ul,#commandPanel .bp3-card>ul>ul>li>ul -{ - width:25%; - font-size: smaller; -} -#commandPanel .bp3-card>ul>li>li:nth-child(4),#commandPanel .bp3-card>ul>ul>li>li:nth-child(4) -{ - width:20%; -} -#commandPanel .bp3-card>ul>li>li:nth-child(5),#commandPanel .bp3-card>ul>ul>li>li:nth-child(5) -{ - width:10%; -} -#commandPanel .bp3-card>ul>li>ul,#commandPanel .bp3-card>ul>ul>li>ul -{ - margin-right: 12px; -} -#commandPanel .bp3-card>ul>li>li>a,#commandPanel .bp3-card>ul>ul>li>li>a -{ - text-align: center; -} -#commandPanel .bp3-card>ul>li>ul>li:nth-child(2),#commandPanel .bp3-card>ul>ul>li>ul>li:nth-child(2) -{ - color: #8A9BA8; -} -#commandPanel .bp3-card>ul>li>li>span>span>input,#commandPanel .bp3-card>ul>ul>li>li>span>span>input -{ - height: 2.0rem !important; - width: 100%; - border-radius: 3px; +#commandPanel +{ + .bp3-input{ + margin: 10px; + font-size: initial; + } + .bp3-dialog{ + margin-bottom: 0; + >div >.bp3-input{ + border-radius: unset; + width:-webkit-fill-available; + } + .bp3-dialog-body{ + display: flex; + width: 50vw; + min-width: 651px; + .bp3-tabs{ + min-width: 86px; + justify-content: center; + > .bp3-tab-list + { + text-align: center; + margin-left: 10px; + } + } + .bp3-card{ + width: 100%; + height: 50vh; + min-height: 300px; + overflow: auto; + padding: 0 10px 10px 10px; + margin: 10px; + >ul{ + >ul>div>h1 + { + font-size: 2.5rem !important; + padding-left: 30px; + margin: 25px 0px; + } + >li,>ul>li{ + border-bottom: 1px solid #5C7080; + padding: 5px; + display: flex; + flex-direction:row; + outline: none; + align-items: center; + justify-content: space-around; + >li{ + height: 36px; + margin-right: 12px; + font-size: large; + display: flex; + align-items: center; + &:first-child{ + width:4%; + } + &:nth-child(2){ + width:17%; + } + &:nth-child(4){ + width:20%; + } + &:nth-child(5){ + width:10%; + } + >a{ + text-align: center; + } + >span>span>input{ + height: 2.0rem !important; + width: 100%; + border-radius: 3px; + } + } + >ul{ + margin-right: 12px; + width:25%; + font-size: smaller; + >li:nth-child(2){ + color: #8A9BA8; + } + } + } + } + } + } + } }