|
|
|
@ -2,9 +2,13 @@ import { Card, Checkbox, Classes, H5, Label } from '@blueprintjs/core';
|
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import { app } from '../../../../ApplicationServices/Application';
|
|
|
|
|
import { UserConfig } from '../../../../Editor/UserConfig';
|
|
|
|
|
import { safeEval } from '../../../../Common/eval';
|
|
|
|
|
import { UserConfig, IMaxSizeProps } from '../../../../Editor/UserConfig';
|
|
|
|
|
import { StoreageKeys } from '../../../../Common/StoreageKeys';
|
|
|
|
|
import { observable, has } from 'mobx';
|
|
|
|
|
import { DataAdapter } from './../../../../Common/DataAdapter';
|
|
|
|
|
import { ToasterInput } from '../../Toaster';
|
|
|
|
|
import { CheckObjectType } from '../../../../Common/CheckoutVaildValue';
|
|
|
|
|
import { IUiOption } from '../../../Store/BoardInterface';
|
|
|
|
|
|
|
|
|
|
interface IConfigProps
|
|
|
|
|
{
|
|
|
|
@ -13,6 +17,7 @@ interface IConfigProps
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
|
export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
@observable maxSizeConfig: IUiOption<IMaxSizeProps>;
|
|
|
|
|
private toggleDrillingReactor = () =>
|
|
|
|
|
{
|
|
|
|
|
const userConfig = this.props.store;
|
|
|
|
@ -26,10 +31,15 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
userConfig.openAutoCuttingReactor = !userConfig.openAutoCuttingReactor;
|
|
|
|
|
app._autoCuttingReactor.Enable = userConfig.openAutoCuttingReactor;
|
|
|
|
|
};
|
|
|
|
|
UNSAFE_componentWillMount()
|
|
|
|
|
{
|
|
|
|
|
const cof = this.props.store;
|
|
|
|
|
this.maxSizeConfig = DataAdapter.ConvertUIData(cof.maxSize);
|
|
|
|
|
}
|
|
|
|
|
public render()
|
|
|
|
|
{
|
|
|
|
|
const userConfig = this.props.store;
|
|
|
|
|
|
|
|
|
|
const { kjlConfig } = userConfig;
|
|
|
|
|
return (
|
|
|
|
|
<Card>
|
|
|
|
|
<H5>排钻配置</H5>
|
|
|
|
@ -45,24 +55,44 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
onChange={this.toggleAutoCuttingReactor}
|
|
|
|
|
/>
|
|
|
|
|
<H5>板件超长</H5>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>板长</span>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={userConfig.maxHeight}
|
|
|
|
|
onChange={e => userConfig.maxHeight = safeEval(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>板宽</span>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={userConfig.maxWidth}
|
|
|
|
|
onChange={e => userConfig.maxWidth = safeEval(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
{
|
|
|
|
|
[["板长", "height"], ["板宽", "width"]].map(([t, k]) =>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<ToasterInput
|
|
|
|
|
type={CheckObjectType.OnlyNumber}
|
|
|
|
|
option={userConfig.maxSize}
|
|
|
|
|
uiOption={this.maxSizeConfig}
|
|
|
|
|
optKey={k}
|
|
|
|
|
onBlur={(e, hasError) =>
|
|
|
|
|
{
|
|
|
|
|
if (hasError)
|
|
|
|
|
this.maxSizeConfig[k] = userConfig.maxSize[k].toString()
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
<H5>酷家乐导入配置</H5>
|
|
|
|
|
<div className="flex-wrap kjl-config">
|
|
|
|
|
{
|
|
|
|
|
[["槽加长", "grooveAddLength"], ["槽加宽", "grooveAddWidth"], ["槽加深", "grooveAddDepth"]].map(([t, k]) =>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<ToasterInput
|
|
|
|
|
type={CheckObjectType.OnlyNumber}
|
|
|
|
|
option={kjlConfig}
|
|
|
|
|
optKey={k}
|
|
|
|
|
onBlur={(e, hasErr) =>
|
|
|
|
|
{
|
|
|
|
|
if (hasErr)
|
|
|
|
|
kjlConfig[k] = "0"
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|