!2880 优化:右侧工具栏板件属性加工组信息更新

pull/2882/MERGE
黄诗津 3 months ago
parent c7edadbcc6
commit f540be520e

@ -138,6 +138,7 @@ class BoardOptionCom extends React.Component<ICommonOptionProps, {}>
isSpecial={this.props._IsSpecialBoard}
drillOption={this.props.drillsOption}
otherBoardData={this.props.otherBoardData}
ProcessingGroupList={this.props.ProcessingGroupList}
isEdgeRemarks={true}
/>
</div>

@ -1,5 +1,5 @@
import { Alert, Button, Checkbox, Classes, HTMLSelect, Intent, Tag } from '@blueprintjs/core';
import { IObservableValue, observable } from 'mobx';
import { IObservableArray, IObservableValue, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { FaceDirection } from "../../../Add-on/DrawDrilling/DrillType";
@ -40,6 +40,7 @@ interface BoardProcessProps
topBottomOption?: TBBoardOption;
otherBoardData?: { [key: string]: any; };
isEdgeRemarks?: boolean;
ProcessingGroupList?: IObservableArray<any>;
}
@observer
export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
@ -229,31 +230,40 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
if (!temp) return false;
return ((temp instanceof TemplateWineRackRecord && !(br.Name === "层板" || br.Name === "立板")) || temp instanceof TemplateLatticeRecord);
};
private updateTags = () =>
getTags()
{
let newTags: string[] = [];
const br = this.props.br;
if (!br) return;
this.tags = [];
if (!br) return newTags;
if (br.Template)
{
if (br.Template.Object instanceof TemplateWineRackRecord)
{
if (!(br.Name === "层板" || br.Name === "立板"))
{
this.tags = ["酒格"];
newTags = ["酒格"];
}
}
else if (br.Template.Object instanceof TemplateLatticeRecord)
{
this.tags = ["格子抽"];
newTags = ["格子抽"];
}
}
for (let process of br.ProcessingGroupList)
for (let process of this.props.ProcessingGroupList)
{
let obj = process?.Object;
if (obj)
this.tags.push((obj as ProcessingGroupRecord).Name);
newTags.push((obj as ProcessingGroupRecord).Name);
}
return newTags;
}
private updateTags = () =>
{
let newTags = this.getTags();
if (JSON.stringify(this.tags) !== JSON.stringify(newTags))
this.tags = newTags;
};
private isSplit()
{
@ -316,10 +326,17 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
{
this.container.addEventListener('keydown', e => e.stopPropagation());
}
componentDidUpdate(prevProps: Readonly<BoardProcessProps>, prevState: Readonly<{}>, snapshot?: any): void
{
if (this.showAlert.get()) return;
this.updateTags();
}
render()
{
const { isEdgeRemarks = true } = this.props;
let isShowHighEditor = Boolean(this.props.br);
let tagValue = this.getTags().join(',');
const CheckBoxStyle: React.CSSProperties = { marginBottom: 3 };
return (
@ -361,7 +378,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}>
<span>:</span>
<div className="flex" style={{ display: "inline-flex", width: "83%" }}>
<input className="bp3-input br-process-input" title="双击查看详细内容" value={this.tags.length > 0 ? this.tags.join(", ") : ""} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<input className="bp3-input br-process-input" title="双击查看详细内容" value={tagValue} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<Button
text="更多"
intent="success"

@ -1,5 +1,5 @@
import { Intent } from '@blueprintjs/core';
import { action, IObservableValue, observable, toJS } from 'mobx';
import { action, IObservableArray, IObservableValue, observable, toJS } from 'mobx';
import * as React from 'react';
import { MathUtils } from 'three';
import { ArcBoardOptions } from '../../../Add-on/ArcBoard/ArcBoardFeeding';
@ -42,6 +42,7 @@ export interface ICommonOptionProps
remarks?: [string, string][];
arcBoardOptions: Map<number, ArcBoardOptions>;
arcBoardConfig: { sweepVisibleFace: FaceDirection; sweepAngle: number; isDrawArcGroove: boolean; };
ProcessingGroupList?: IObservableArray<any>;
}
export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>)
@ -80,6 +81,8 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
name: "", type: "0", rotateX: "0", rotateY: "0", rotateZ: "0", sweepAngle: "0",
});
public arcBoardConfig = observable({ sweepVisibleFace: FaceDirection.Back, sweepAngle: 0, isDrawArcGroove: true });
ProcessingGroupList = observable([]);
constructor(props)
{
super(props);
@ -117,6 +120,7 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
remarks={this.remarks}
arcBoardOptions={this.arcBoardOptions}
arcBoardConfig={this.arcBoardConfig}
ProcessingGroupList={this.ProcessingGroupList}
/>
}
</>;
@ -160,6 +164,12 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
Object.assign(this._GrooveOption, newGrooveOpt);
this.ProcessingGroupList.length = 0;
for (const p of this.CurrentBoard.ProcessingGroupList)
{
this.ProcessingGroupList.push(p);
}
const boardProcessOption = this.CurrentBoard.BoardProcessOption;
if (!this._IsSpecialBoard.get())

@ -136,7 +136,8 @@ export class ProcessingGroupModalStore extends Singleton implements IConfigStore
type SelectEntityTypes = (Board | HardwareCompositeEntity | HardwareTopline)[];
@observer
export class ProcessingGroupModal extends React.Component<{ store: ProcessingGroupModalStore; }, ProcessingGroupModalState>{
export class ProcessingGroupModal extends React.Component<{ store: ProcessingGroupModalStore; }, ProcessingGroupModalState>
{
private canCreateGroup = observable.box(false);
private pgCategoryMap: Map<string, number> = new Map();//储存组类别和其id
private getNodeID: NodeIDGenerator = new NodeIDGenerator();//树节点id生成器
@ -192,7 +193,7 @@ export class ProcessingGroupModal extends React.Component<{ store: ProcessingGro
for (let f of this.removeFuncs)
f();
this.removeFuncs.length = 0;
userConfigStore.SaveConfig(BoardModalType.ProcessGroupCategory, ProcessingGroupModalStore.GetInstance(), { toaster: false });
userConfigStore.SaveConfig(BoardModalType.ProcessGroupCategory, ProcessingGroupModalStore.GetInstance(), { toaster: false, isUploadUserConfigNames: false });
}
private parseNodes = () =>

@ -100,6 +100,7 @@ class BoardPropsCom extends React.Component<ICommonOptionProps, {}>
br={this.props._CurrentBoard.get()}
isSpecial={this.props._IsSpecialBoard}
otherBoardData={this.props.otherBoardData}
ProcessingGroupList={this.props.ProcessingGroupList}
isEdgeRemarks={true}
/>
</div>

Loading…
Cancel
Save