|
|
|
@ -9,10 +9,12 @@ import { EBoardKeyList } from '../../../Common/BoardKeyList';
|
|
|
|
|
import { CheckObjectType } from '../../../Common/CheckoutVaildValue';
|
|
|
|
|
import { CommandNames } from '../../../Common/CommandNames';
|
|
|
|
|
import { FixedNotZero } from '../../../Common/Utils';
|
|
|
|
|
import { Board } from '../../../DatabaseServices/Entity/Board';
|
|
|
|
|
import { Entity } from '../../../DatabaseServices/Entity/Entity';
|
|
|
|
|
import { HardwareTopline } from '../../../DatabaseServices/Hardware/HardwareTopline';
|
|
|
|
|
import { ProcessingGroupRecord } from '../../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord';
|
|
|
|
|
import { CommandWrap } from '../../../Editor/CommandMachine';
|
|
|
|
|
import { PromptStatus } from '../../../Editor/PromptResult';
|
|
|
|
|
import { BaseHardwareStore } from '../../Store/RightPanelStore/HardwareStore';
|
|
|
|
|
import { ToasterInput } from '../Toaster';
|
|
|
|
|
|
|
|
|
@ -25,10 +27,6 @@ export interface ICommonMetalPanelProps
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
|
export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
private par = [["房间名:", EBoardKeyList.RoomName], ["柜名:", EBoardKeyList.CabinetName], ["单位:", "unit"]];
|
|
|
|
|
private pars1 = [["价格表达式:", "actualExpr"]];
|
|
|
|
|
private pars2 = [["型号:", "model"], ["厂家:", "factory"], ["品牌:", "brand"], ["规格:", "spec"]];
|
|
|
|
|
private pars3 = [["材质:", EBoardKeyList.Mat], ["颜色:", "color"]];
|
|
|
|
|
private size = new Vector3();
|
|
|
|
|
private length: string;
|
|
|
|
|
|
|
|
|
@ -72,43 +70,67 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
}, CommandNames.删除加工组);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private getOption = async () =>
|
|
|
|
|
{
|
|
|
|
|
app.Editor.ModalManage.ToggleShow();
|
|
|
|
|
app.Editor.MaskManage.Clear();
|
|
|
|
|
|
|
|
|
|
await CommandWrap(async () =>
|
|
|
|
|
{
|
|
|
|
|
let enRes = await app.Editor.GetEntity({
|
|
|
|
|
Msg: "选择板件",
|
|
|
|
|
Filter: { filterTypes: [Board] }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (enRes.Status === PromptStatus.OK)
|
|
|
|
|
{
|
|
|
|
|
const { store } = this.props;
|
|
|
|
|
const data = (enRes.Entity as Board).BoardProcessOption;
|
|
|
|
|
store.option[EBoardKeyList.RoomName] = data[EBoardKeyList.RoomName];
|
|
|
|
|
store.option[EBoardKeyList.CabinetName] = data[EBoardKeyList.CabinetName];
|
|
|
|
|
}
|
|
|
|
|
}, "选择板件属性");
|
|
|
|
|
|
|
|
|
|
if (this.props.store.Entity)
|
|
|
|
|
{
|
|
|
|
|
app.Editor.MaskManage.ShowMask();
|
|
|
|
|
}
|
|
|
|
|
app.Editor.ModalManage.ToggleShow();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
componentDidMount(): void
|
|
|
|
|
{
|
|
|
|
|
this.updateTags();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UNSAFE_componentWillMount()
|
|
|
|
|
constructor(props)
|
|
|
|
|
{
|
|
|
|
|
if (this.props.store.Entity)
|
|
|
|
|
super(props);
|
|
|
|
|
const { store, isTopline } = this.props;
|
|
|
|
|
if (store.Entity)
|
|
|
|
|
{
|
|
|
|
|
this.par.push(["实体名:", "name"], ["备注", "comments"]);
|
|
|
|
|
let box = this.props.store.Entity.BoundingBoxInOCS;
|
|
|
|
|
let box = store.Entity.BoundingBoxInOCS;
|
|
|
|
|
box.getSize(this.size);
|
|
|
|
|
}
|
|
|
|
|
if (this.props.isTopline)
|
|
|
|
|
if (isTopline)
|
|
|
|
|
{
|
|
|
|
|
this.pars1[0][0] = "每米单价";
|
|
|
|
|
this.length = FixedNotZero((this.props.store.Entity as HardwareTopline).MaxLength, 2);
|
|
|
|
|
this.length = FixedNotZero((store.Entity as HardwareTopline).MaxLength, 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public render()
|
|
|
|
|
|
|
|
|
|
private RoomAndCabinetName = () =>
|
|
|
|
|
{
|
|
|
|
|
const { otherOptions, option } = this.props.store;
|
|
|
|
|
const { option } = this.props.store;
|
|
|
|
|
const roomAndCabinetName = [["房间名:", EBoardKeyList.RoomName], ["柜名:", EBoardKeyList.CabinetName]];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="common-matal">
|
|
|
|
|
{
|
|
|
|
|
!this.props.store.Entity &&
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>实体名:</span>
|
|
|
|
|
<input tabIndex={1} type="text" className={Classes.INPUT} value={option.name} onChange={e => option.name = e.target.value} />
|
|
|
|
|
</Label>
|
|
|
|
|
}
|
|
|
|
|
<div className="metal-type">
|
|
|
|
|
<div className="room-cabinet-name" style={{ display: "flex" }}>
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
this.par.map(([t, k]) =>
|
|
|
|
|
roomAndCabinetName.map(([t, k]) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<Label className={Classes.INLINE} key={k}>
|
|
|
|
|
<Label className={`${Classes.INLINE}`} key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input tabIndex={1} type="text" className={Classes.INPUT} value={option[k]} onChange={e => option[k] = e.target.value} />
|
|
|
|
|
</Label>
|
|
|
|
@ -116,6 +138,22 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<button
|
|
|
|
|
className="bp3-button bp3-intent-success"
|
|
|
|
|
onClick={this.getOption}
|
|
|
|
|
>拾取</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private ProcessingGroupAndPrice = () =>
|
|
|
|
|
{
|
|
|
|
|
const { isTopline } = this.props;
|
|
|
|
|
const { option } = this.props.store;
|
|
|
|
|
const price = isTopline ? [["每米单价:", "actualExpr"]] : [["价格表达式:", "actualExpr"]];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}>
|
|
|
|
|
<span style={{ width: 65 }}>加工组:</span>
|
|
|
|
|
<div style={{ display: "inline-flex", flex: 1, minWidth: 120 }}>
|
|
|
|
@ -160,40 +198,10 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
{/* todo添加加工组 */}
|
|
|
|
|
</Alert>
|
|
|
|
|
</label>
|
|
|
|
|
{
|
|
|
|
|
this.props.isTopline &&
|
|
|
|
|
<div className="metal-type">
|
|
|
|
|
<Label>
|
|
|
|
|
<span>旋转轮廓角度:</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
style={{ width: "50%", marginTop: 0 }}
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={this.props.store.rotation}
|
|
|
|
|
onChange={e => this.props.store.rotation = e.target.value}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
{
|
|
|
|
|
[["每段加长:", "addLen"]].map(([t, k]) =>
|
|
|
|
|
<Label key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
style={{ width: "50%", marginTop: 0 }}
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={option[k]}
|
|
|
|
|
onChange={e => option[k] = e.target.value}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
this.pars1.map(([t, k]) =>
|
|
|
|
|
price.map(([t, k]) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<Label className={Classes.INLINE} style={{ display: "inline-flex", width: "100%" }} key={k}>
|
|
|
|
@ -203,38 +211,22 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
<div className="metal-type">
|
|
|
|
|
{
|
|
|
|
|
this.pars2.map(([t, k]) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<Label className={Classes.INLINE} key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input tabIndex={1} type="text" className={Classes.INPUT} value={option[k]} onChange={e => option[k] = e.target.value} />
|
|
|
|
|
</Label>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
!this.props.isTopline &&
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>数量</span>
|
|
|
|
|
<ToasterInput
|
|
|
|
|
type={CheckObjectType.None}
|
|
|
|
|
option={option}
|
|
|
|
|
optKey="count"
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private MetalParam = () =>
|
|
|
|
|
{
|
|
|
|
|
this.props.store.Entity && !this.props.isTopline &&
|
|
|
|
|
<div className="metal-type">
|
|
|
|
|
const { option } = this.props.store;
|
|
|
|
|
const pars2 = [["型号:", "model"], ["厂家:", "factory"], ["品牌:", "brand"], ["规格:", "spec"]];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="metal-param">
|
|
|
|
|
{
|
|
|
|
|
this.pars3.map(([t, k]) =>
|
|
|
|
|
pars2.map(([t, k]) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<Label className={Classes.INLINE} key={k}>
|
|
|
|
|
<Label className={`metal-label ${Classes.INLINE}`} key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input tabIndex={1} type="text" className={Classes.INPUT} value={option[k]} onChange={e => option[k] = e.target.value} />
|
|
|
|
|
</Label>
|
|
|
|
@ -242,9 +234,16 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private EntityInfo = () =>
|
|
|
|
|
{
|
|
|
|
|
this.props.store.Entity &&
|
|
|
|
|
const { otherOptions, Entity } = this.props.store;
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{
|
|
|
|
|
Entity &&
|
|
|
|
|
<div className="center">
|
|
|
|
|
<span>实体长:{this.size.x.toFixed(2)}</span>
|
|
|
|
|
<span>实体宽:{this.size.y.toFixed(2)}</span>
|
|
|
|
@ -270,6 +269,90 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps> {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render()
|
|
|
|
|
{
|
|
|
|
|
const { store, isTopline } = this.props;
|
|
|
|
|
const { option, Entity } = store;
|
|
|
|
|
const isRightMetalPanel = !Entity;
|
|
|
|
|
const metalTypeFields = isRightMetalPanel ? [["实体名:", "name"], ["单位:", "unit"]] : [["单位:", "unit"], ["实体名:", "name"], ["备注:", "comments"]];
|
|
|
|
|
const materialAndColor = [["材质:", EBoardKeyList.Mat], ["颜色:", "color"]];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={`common-matal_${isTopline ? 1 : isRightMetalPanel ? 2 : 3}`}>
|
|
|
|
|
{this.RoomAndCabinetName()}
|
|
|
|
|
<div className="metal-param_name">
|
|
|
|
|
{
|
|
|
|
|
metalTypeFields.map(([t, k]) => (
|
|
|
|
|
<Label className={`metal-label ${Classes.INLINE}`} key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={option[k]}
|
|
|
|
|
onChange={(e) => (option[k] = e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
isTopline && (
|
|
|
|
|
<div className="metal-param">
|
|
|
|
|
<Label className="metal-label">
|
|
|
|
|
<span>旋转轮廓角度:</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
style={{ width: "50%", marginTop: 0 }}
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={store.rotation}
|
|
|
|
|
onChange={(e) => (store.rotation = e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
{[["每段加长:", "addLen"]].map(([t, k]) => (
|
|
|
|
|
<Label className="metal-label" key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
style={{ width: "50%", marginTop: 0 }}
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={option[k]}
|
|
|
|
|
onChange={(e) => (option[k] = e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
{this.ProcessingGroupAndPrice()}
|
|
|
|
|
{this.MetalParam()}
|
|
|
|
|
{!isTopline && <Label className={`metal-label_count ${Classes.INLINE}`}>
|
|
|
|
|
<span>数量:</span>
|
|
|
|
|
<ToasterInput type={CheckObjectType.None} option={option} optKey="count" />
|
|
|
|
|
</Label>}
|
|
|
|
|
{!isTopline && !isRightMetalPanel && (
|
|
|
|
|
<div className="metal-param">
|
|
|
|
|
{
|
|
|
|
|
materialAndColor.map(([t, k]) => (
|
|
|
|
|
<Label className={`metal-label ${Classes.INLINE}`} key={k}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<input
|
|
|
|
|
tabIndex={1}
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={option[k]}
|
|
|
|
|
onChange={(e) => (option[k] = e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{this.EntityInfo()}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|