mirror of https://gitee.com/cf-fz/WebCAD.git
!2721 新增:圆弧板圆弧槽通用默认配置
parent
f4c0c2a74c
commit
9de55c8344
@ -0,0 +1,107 @@
|
|||||||
|
import { Button, Checkbox, Classes } from "@blueprintjs/core";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import React from "react";
|
||||||
|
import { CheckObjectType } from "../../../Common/CheckoutVaildValue";
|
||||||
|
import { SetBoardDataItem } from "../../../UI/Components/Board/BoardCommon";
|
||||||
|
import { BoardModalType } from "../../../UI/Components/Board/BoardModalType";
|
||||||
|
import { Config_ModalType } from "../../../UI/Components/Board/UserConfigComponent";
|
||||||
|
import { CommonModal } from "../../../UI/Components/Modal/ModalContainer";
|
||||||
|
import { ModalState } from "../../../UI/Components/Modal/ModalInterface";
|
||||||
|
import { ArcBoardGrooveStore } from "./ArcBoardGrooveStore";
|
||||||
|
|
||||||
|
@observer
|
||||||
|
export class ArcBoardGroove extends React.Component<{ store: ArcBoardGrooveStore, type: BoardModalType; }, {}>
|
||||||
|
{
|
||||||
|
curveBoardPars = [
|
||||||
|
["retainedThickness", "留底厚度"],
|
||||||
|
["knifeRadius", "刀半径"],
|
||||||
|
["grooveAddLength", "槽加长"],
|
||||||
|
["grooveAddWidth", "槽加宽"],
|
||||||
|
["grooveAddDepth", "槽加深"],
|
||||||
|
];
|
||||||
|
|
||||||
|
render()
|
||||||
|
{
|
||||||
|
const { store, type } = this.props;
|
||||||
|
return (
|
||||||
|
<CommonModal
|
||||||
|
title={store.title}
|
||||||
|
icon="bold"
|
||||||
|
modalId="arcBoardGeoove"
|
||||||
|
close={async () => store.OnOk(ModalState.Cancel)}
|
||||||
|
configType={Config_ModalType.ConfigListModal}
|
||||||
|
store={store}
|
||||||
|
type={type}
|
||||||
|
footerChildren={
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
className={Classes.INTENT_SUCCESS}
|
||||||
|
text="确定"
|
||||||
|
onClick={() =>
|
||||||
|
{
|
||||||
|
store.OnOk(ModalState.Ok, true, { isOk: true });
|
||||||
|
}} />
|
||||||
|
<Button
|
||||||
|
className={Classes.INTENT_DANGER}
|
||||||
|
text="取消"
|
||||||
|
onClick={() =>
|
||||||
|
{
|
||||||
|
store.OnOk(ModalState.Cancel);
|
||||||
|
}} />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={Classes.DIALOG_BODY}
|
||||||
|
style={{ padding: 10 }}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<Checkbox
|
||||||
|
style={{ marginRight: 7, width: 70 }}
|
||||||
|
checked={!store.m_Option.isDrawArcGroove}
|
||||||
|
label="不开槽"
|
||||||
|
onChange={() =>
|
||||||
|
{
|
||||||
|
store.m_Option.isDrawArcGroove = !store.m_Option.isDrawArcGroove;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
maxWidth: 1000,
|
||||||
|
overflow: "scroll"
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
<div style={{ marginRight: 3 }}>
|
||||||
|
<span>{"通用转角槽配置"}</span>
|
||||||
|
<div
|
||||||
|
className="curveBoardOption"
|
||||||
|
style={{
|
||||||
|
padding: 5,
|
||||||
|
border: "1px solid #ccc",
|
||||||
|
width: 160
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
this.curveBoardPars.map(([optKey, title], index) =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<SetBoardDataItem
|
||||||
|
key={optKey}
|
||||||
|
type={CheckObjectType.BR}
|
||||||
|
titleStyle={{ width: 60 }}
|
||||||
|
option={store.m_Option}
|
||||||
|
optKey={optKey}
|
||||||
|
title={title}
|
||||||
|
/>);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CommonModal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import { observable, toJS } from "mobx";
|
||||||
|
import { DefaultArcBoardGrooveOption } from "../../../Editor/DefaultConfig";
|
||||||
|
import { IConfigOption } from "../../../UI/Components/Board/UserConfigComponent";
|
||||||
|
import { BoardStore } from "../../../UI/Store/BoardStore";
|
||||||
|
import { IArcBoardGrooveOption } from "../../../UI/Store/OptionInterface/IOptionInterface";
|
||||||
|
|
||||||
|
export class ArcBoardGrooveStore extends BoardStore<IArcBoardGrooveOption>
|
||||||
|
{
|
||||||
|
title = "圆弧板通用配置";
|
||||||
|
@observable m_Option: IArcBoardGrooveOption = { ...DefaultArcBoardGrooveOption, };
|
||||||
|
|
||||||
|
InitOption()
|
||||||
|
{
|
||||||
|
Object.assign(this.m_Option, DefaultArcBoardGrooveOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateOption(cof: IConfigOption<IArcBoardGrooveOption>): void
|
||||||
|
{
|
||||||
|
Object.assign(this.m_Option, cof.option);
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveConfig()
|
||||||
|
{
|
||||||
|
let newConfig: IConfigOption = {};
|
||||||
|
newConfig.option = toJS(this.m_Option);
|
||||||
|
return newConfig;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue