|
|
|
@ -4,13 +4,12 @@ import { observer } from 'mobx-react';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import { FaceDirection } from "../../../Add-on/DrawDrilling/DrillType";
|
|
|
|
|
import { app } from '../../../ApplicationServices/Application';
|
|
|
|
|
import { arrayRemove } from '../../../Common/ArrayExt';
|
|
|
|
|
import { arrayRemove, arrayRemoveIf } from '../../../Common/ArrayExt';
|
|
|
|
|
import { EBoardKeyList } from '../../../Common/BoardKeyList';
|
|
|
|
|
import { CheckObjectType } from '../../../Common/CheckoutVaildValue';
|
|
|
|
|
import { CommandNames } from '../../../Common/CommandNames';
|
|
|
|
|
import { ComposingFaceSelectOption, LineTypeSelectOption } from '../../../Common/CommonSelectOption';
|
|
|
|
|
import { safeEval } from '../../../Common/eval';
|
|
|
|
|
import { CADObject } from '../../../DatabaseServices/CADObject';
|
|
|
|
|
import { Board } from '../../../DatabaseServices/Entity/Board';
|
|
|
|
|
import { ProcessingGroupRecord } from '../../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord';
|
|
|
|
|
import { TemplateLatticeRecord } from '../../../DatabaseServices/Template/ProgramTempate/TemplateLatticeRecord';
|
|
|
|
@ -189,16 +188,31 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
{
|
|
|
|
|
this.showAlert.set(true);
|
|
|
|
|
};
|
|
|
|
|
private onAlertConfirm = () =>
|
|
|
|
|
private onAlertConfirm = async () =>
|
|
|
|
|
{
|
|
|
|
|
if (!(this.props.br) || this.props.br.ProcessingGroupList.length === this.tags.length || this.IsWineRackORLattice())
|
|
|
|
|
if (!this.props.br)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
let processingGroupLength = this.props.br.ProcessingGroupList.length;
|
|
|
|
|
|
|
|
|
|
//酒格 格子抽ProcessingGroupList实际少一个固定加工组
|
|
|
|
|
if (this.IsWineRackORLattice())
|
|
|
|
|
{
|
|
|
|
|
processingGroupLength += 1;
|
|
|
|
|
//减去酒格或格子抽一个固定加工组
|
|
|
|
|
this.tags.splice(0, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (processingGroupLength === this.tags.length)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
let needDelGroupID = [...this.props.br.ProcessingGroupList].filter((g) =>
|
|
|
|
|
{
|
|
|
|
|
return !(this.tags.includes((g?.Object as ProcessingGroupRecord)?.Name));
|
|
|
|
|
});
|
|
|
|
|
let pgs = app.Database.ProcessingGroupTable.Objects.filter((g) => { return needDelGroupID.includes(g.Id); });
|
|
|
|
|
CommandWrap(() =>
|
|
|
|
|
|
|
|
|
|
await CommandWrap(() =>
|
|
|
|
|
{
|
|
|
|
|
for (let pg of pgs)
|
|
|
|
|
{
|
|
|
|
@ -211,8 +225,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
{
|
|
|
|
|
let br = this.props?.br;
|
|
|
|
|
if (!br) return false;
|
|
|
|
|
let temp: CADObject;
|
|
|
|
|
temp = br.Template?.Object;
|
|
|
|
|
let temp = br.Template?.Object;
|
|
|
|
|
if (!temp) return false;
|
|
|
|
|
return ((temp instanceof TemplateWineRackRecord && !(br.Name === "层板" || br.Name === "立板")) || temp instanceof TemplateLatticeRecord);
|
|
|
|
|
};
|
|
|
|
@ -220,6 +233,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
{
|
|
|
|
|
const br = this.props.br;
|
|
|
|
|
if (!br) return;
|
|
|
|
|
this.tags = [];
|
|
|
|
|
if (br.Template)
|
|
|
|
|
{
|
|
|
|
|
if (br.Template.Object instanceof TemplateWineRackRecord)
|
|
|
|
@ -227,21 +241,19 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
if (!(br.Name === "层板" || br.Name === "立板"))
|
|
|
|
|
{
|
|
|
|
|
this.tags = ["酒格"];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (br.Template.Object instanceof TemplateLatticeRecord)
|
|
|
|
|
else if (br.Template.Object instanceof TemplateLatticeRecord)
|
|
|
|
|
{
|
|
|
|
|
this.tags = ["格子抽"];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.tags = [...br.ProcessingGroupList].map((g) =>
|
|
|
|
|
for (let process of br.ProcessingGroupList)
|
|
|
|
|
{
|
|
|
|
|
let obj = g?.Object;
|
|
|
|
|
let obj = process?.Object;
|
|
|
|
|
if (obj)
|
|
|
|
|
return (obj as ProcessingGroupRecord).Name;
|
|
|
|
|
});
|
|
|
|
|
this.tags.push((obj as ProcessingGroupRecord).Name);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
private isSplit()
|
|
|
|
|
{
|
|
|
|
@ -287,7 +299,8 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
{
|
|
|
|
|
label: "反(两面朝下)",
|
|
|
|
|
value: FaceDirection.Back.toString()
|
|
|
|
|
}, {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "朝向柜内",
|
|
|
|
|
value: FaceDirection.Inside.toString()
|
|
|
|
|
}];
|
|
|
|
@ -369,24 +382,41 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
onClose={() => this.showAlert.set(false)}
|
|
|
|
|
canEscapeKeyCancel={true}
|
|
|
|
|
canOutsideClickCancel={true}
|
|
|
|
|
onCancel={() => { this.setState({ canAlertOpen1: false }); this.updateTags(); }}
|
|
|
|
|
onConfirm={() => { this.onAlertConfirm(); }}
|
|
|
|
|
onCancel={() =>
|
|
|
|
|
{
|
|
|
|
|
this.setState({ canAlertOpen1: false });
|
|
|
|
|
this.updateTags();
|
|
|
|
|
}}
|
|
|
|
|
onConfirm={async () =>
|
|
|
|
|
{
|
|
|
|
|
await this.onAlertConfirm();
|
|
|
|
|
this.updateTags();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
this.tags.length > 0 ?
|
|
|
|
|
this.tags.map((tag) =>
|
|
|
|
|
this.tags.map((tag, i) =>
|
|
|
|
|
{
|
|
|
|
|
const onRemove = () => this.tags = this.tags.filter((t) => t !== tag);
|
|
|
|
|
const onRemove = () =>
|
|
|
|
|
{
|
|
|
|
|
if (this.IsWineRackORLattice())
|
|
|
|
|
{
|
|
|
|
|
let firstTag = this.tags.shift();
|
|
|
|
|
arrayRemoveIf(this.tags, (t) => t === tag);
|
|
|
|
|
this.tags.unshift(firstTag);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
arrayRemoveIf(this.tags, (t) => t === tag);
|
|
|
|
|
};
|
|
|
|
|
return <Tag
|
|
|
|
|
className={"br-process-modal-alert-tags"}
|
|
|
|
|
key={tag}
|
|
|
|
|
onRemove={!this.IsWineRackORLattice() && onRemove}
|
|
|
|
|
onRemove={!(this.IsWineRackORLattice() && i === 0) && onRemove}
|
|
|
|
|
>
|
|
|
|
|
{tag}
|
|
|
|
|
</Tag>;
|
|
|
|
|
}) :
|
|
|
|
|
""
|
|
|
|
|
}) : ""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
{/* todo添加加工组 */}
|
|
|
|
@ -494,7 +524,8 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
|
|
|
|
|
const islock = this.props.otherBoardData.isAssociationDrillLock;
|
|
|
|
|
this.props.otherBoardData.isAssociationDrillLock = !islock;
|
|
|
|
|
}}
|
|
|
|
|
/>}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|