!2334 功能:增加板边备注

pull/2604/MERGE
黄诗津 7 months ago committed by ChenX
parent 77be29f30b
commit a8050622ad

@ -169,6 +169,11 @@ Array [
true, true,
true, true,
0, 0,
"",
"",
"",
"",
0,
0, 0,
0, 0,
0, 0,
@ -382,6 +387,11 @@ Array [
true, true,
false, false,
0, 0,
"",
"",
"",
"",
0,
0, 0,
0, 0,
0, 0,

@ -41,8 +41,8 @@ export class BatchModify implements Command
if (!brs) return; if (!brs) return;
let keyRes = await app.Editor.GetKeyWords({ let keyRes = await app.Editor.GetKeyWords({
Msg: "编辑封边还是排钻?", Msg: "编辑项目",
KeyWordList: [{ msg: "封边", key: "S" }, { msg: "排钻", key: "D" }] KeyWordList: [{ msg: "封边", key: "S" }, { msg: "排钻", key: "D" }, { msg: "板边备注", key: "R" }]
}); });
if (keyRes.Status !== PromptStatus.Keyword) return; if (keyRes.Status !== PromptStatus.Keyword) return;
@ -62,7 +62,7 @@ export class BatchModify implements Command
store.sealingStore.isNotUpdateStore = false; store.sealingStore.isNotUpdateStore = false;
}, 0); }, 0);
} }
else else if (keyRes.StringResult === "D")
{ {
store.m_TabId = RightTabId.Drill; store.m_TabId = RightTabId.Drill;
setTimeout(() => //当前命令结束后在进入编辑 setTimeout(() => //当前命令结束后在进入编辑
@ -70,6 +70,21 @@ export class BatchModify implements Command
store.drillingStore.StartEditor(brs); store.drillingStore.StartEditor(brs);
}, 0); }, 0);
} }
else if (keyRes.StringResult === "R")
{
const boardEdgeRemarksStore = store.boardEdgeRemarksStore;
boardEdgeRemarksStore.isNotUpdateStore = true;
let config = new DialogUserConfig(boardEdgeRemarksStore, BoardModalType.BoardEdgeRemarks);
await config.LoadAndInitConfig();
store.m_TabId = RightTabId.BoardEgdeRemark;
setTimeout(async () =>//当前命令结束后在进入编辑
{
await boardEdgeRemarksStore.StartEditor(brs);
boardEdgeRemarksStore.isNotUpdateStore = false;
}, 0);
}
} }
} }

@ -136,6 +136,10 @@ export class UpdateBoardInfos implements Command
case EBoardKeyList.DownSealed: case EBoardKeyList.DownSealed:
case EBoardKeyList.LeftSealed: case EBoardKeyList.LeftSealed:
case EBoardKeyList.RightSealed: case EBoardKeyList.RightSealed:
case "edgeRemarkUp":
case "edgeRemarkDown":
case "edgeRemarkLeft":
case "edgeRemarkRight":
if (option[i]) if (option[i])
br.BoardProcessOption[i] = option[i]; br.BoardProcessOption[i] = option[i];
break; break;

@ -247,6 +247,10 @@ export class BoardFindModify implements Command
case EBoardKeyList.DownSealed: case EBoardKeyList.DownSealed:
case EBoardKeyList.LeftSealed: case EBoardKeyList.LeftSealed:
case EBoardKeyList.RightSealed: case EBoardKeyList.RightSealed:
case "edgeRemarkUp":
case "edgeRemarkDown":
case "edgeRemarkLeft":
case "edgeRemarkRight":
brValue = br.BoardProcessOption[i]; brValue = br.BoardProcessOption[i];
value = option[i]; value = option[i];
isVail = CompareIsEqual(brValue, value, ECompareType.Equal); isVail = CompareIsEqual(brValue, value, ECompareType.Equal);
@ -394,6 +398,12 @@ export class BoardFindModify implements Command
break; break;
case EBoardKeyList.OpenDir: case EBoardKeyList.OpenDir:
br.OpenDir = option[i]; br.OpenDir = option[i];
case "edgeRemarkUp":
case "edgeRemarkDown":
case "edgeRemarkLeft":
case "edgeRemarkRight":
if (option[i])
br.BoardProcessOption[i] = option[i];
break; break;
case EBoardKeyList.UpSealed: case EBoardKeyList.UpSealed:
case EBoardKeyList.DownSealed: case EBoardKeyList.DownSealed:

@ -331,6 +331,7 @@ export enum CommandNames
PackageGroupMove0 = "PACKAGEGROUPMOVE0", PackageGroupMove0 = "PACKAGEGROUPMOVE0",
ApplyMtl = "APPLYMTL",//应用材质 ApplyMtl = "APPLYMTL",//应用材质
= "封边属性编辑", = "封边属性编辑",
= "板边备注编辑",
= "排钻属性编辑", = "排钻属性编辑",
SwitchServers = "SWITCHSERVERS", SwitchServers = "SWITCHSERVERS",

@ -174,6 +174,11 @@ export class Board extends ExtrudeSolid
backDrill: true, backDrill: true,
drillType: "", drillType: "",
remarks: this.CreateArray(), remarks: this.CreateArray(),
edgeRemarkUp: "",
edgeRemarkDown: "",
edgeRemarkLeft: "",
edgeRemarkRight: "",
highBoardEdgeRemark: this.CreateArray(),
}; };
this._BoardProcessOption = new Proxy(defaultData, { this._BoardProcessOption = new Proxy(defaultData, {
@ -2046,12 +2051,23 @@ export class Board extends ExtrudeSolid
this.RelativeHandle.push(objId); this.RelativeHandle.push(objId);
} }
} }
const processData = this._BoardProcessOption;
if (ver > 13)
{
processData.edgeRemarkUp = file.Read();
processData.edgeRemarkDown = file.Read();
processData.edgeRemarkLeft = file.Read();
processData.edgeRemarkRight = file.Read();
let count = file.Read();
processData.highBoardEdgeRemark = file.ReadArray(count);
}
} }
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(13); file.Write(14);
// file.Write(this._SpaceOCS.toArray()); ver < 6 // file.Write(this._SpaceOCS.toArray()); ver < 6
file.Write(this._BoardType); file.Write(this._BoardType);
file.Write(this._Name); file.Write(this._Name);
@ -2100,6 +2116,17 @@ export class Board extends ExtrudeSolid
file.Write(this.RelativeHandle.length); file.Write(this.RelativeHandle.length);
for (let id of this.RelativeHandle) for (let id of this.RelativeHandle)
file.WriteObjectId(id); file.WriteObjectId(id);
const processData = this._BoardProcessOption;
file.Write(processData.edgeRemarkUp);
file.Write(processData.edgeRemarkDown);
file.Write(processData.edgeRemarkLeft);
file.Write(processData.edgeRemarkRight);
file.Write(processData.highBoardEdgeRemark.length);
for (let r of processData.highBoardEdgeRemark)
{
file.Write(r);
}
} }
} }

@ -309,7 +309,7 @@ export const DefaultClosingStripOption: ClosingStripOption = {
Object.freeze(DefaultClosingStripOption); Object.freeze(DefaultClosingStripOption);
export const DefaultBoardFindOption: IBoardFindOption = { export const DefaultBoardFindOption: IBoardFindOption = {
version: 8, version: 9,
condition: { condition: {
// layer: false, //这个KEY看起来没用了 // layer: false, //这个KEY看起来没用了
height: false, height: false,
@ -345,6 +345,10 @@ export const DefaultBoardFindOption: IBoardFindOption = {
useZhengFanDrill: false, useZhengFanDrill: false,
useChaidan: false, useChaidan: false,
[EBoardKeyList.KnifeRad]: false, [EBoardKeyList.KnifeRad]: false,
edgeRemarkUp: false,
edgeRemarkDown: false,
edgeRemarkLeft: false,
edgeRemarkRight: false,
}, },
compareType: { compareType: {
height: ECompareType.Equal, height: ECompareType.Equal,
@ -399,6 +403,10 @@ export const DefaultBoardFindOption: IBoardFindOption = {
extraRemarks: Array.from({ length: 10 }, () => ["", ""]), extraRemarks: Array.from({ length: 10 }, () => ["", ""]),
isChaidan: false, isChaidan: false,
[EBoardKeyList.KnifeRad]: "", [EBoardKeyList.KnifeRad]: "",
edgeRemarkUp: "",
edgeRemarkDown: "",
edgeRemarkLeft: "",
edgeRemarkRight: "",
}; };
Object.freeze(DefaultBoardFindOption); Object.freeze(DefaultBoardFindOption);
@ -721,7 +729,7 @@ export const DefaultCurve2RecOption: Curve2RecOption = {
Object.freeze(DefaultCurve2RecOption); Object.freeze(DefaultCurve2RecOption);
export const DefaultUpdateInfoOption: IUpdateBoardInfosOption = { export const DefaultUpdateInfoOption: IUpdateBoardInfosOption = {
version: 2, version: 3,
[EBoardKeyList.BrName]: "", [EBoardKeyList.BrName]: "",
[EBoardKeyList.RoomName]: "", [EBoardKeyList.RoomName]: "",
[EBoardKeyList.CabinetName]: "", [EBoardKeyList.CabinetName]: "",
@ -744,6 +752,10 @@ export const DefaultUpdateInfoOption: IUpdateBoardInfosOption = {
grooveAddWidth: "0", grooveAddWidth: "0",
highDrill: [], highDrill: [],
isChaiDan: true, isChaiDan: true,
edgeRemarkUp: "",
edgeRemarkDown: "",
edgeRemarkLeft: "",
edgeRemarkRight: "",
condition: { condition: {
[EBoardKeyList.BrName]: false, [EBoardKeyList.BrName]: false,
[EBoardKeyList.RoomName]: false, [EBoardKeyList.RoomName]: false,
@ -768,7 +780,11 @@ export const DefaultUpdateInfoOption: IUpdateBoardInfosOption = {
leftDrill: true, leftDrill: true,
rightDrill: true, rightDrill: true,
isChaiDan: true, isChaiDan: true,
autoCutOption: { isAutoCut: false, isRelevance: false } autoCutOption: { isAutoCut: false, isRelevance: false },
edgeRemarkUp: true,
edgeRemarkDown: true,
edgeRemarkLeft: true,
edgeRemarkRight: true,
} }
}; };
@ -909,7 +925,7 @@ export const DefaultHSOption: IHSOption = {
hwComposity: false, hwComposity: false,
lattice: false, lattice: false,
dim: false, dim: false,
visual:false, visual: false,
curve: false, curve: false,
line: false, line: false,
polyline: false, polyline: false,

@ -16,7 +16,7 @@ import { CreateContour2 } from "../Geometry/CreateContour2";
import { IdentityMtx4, XAxis, equaln, equalv3, isParallelTo } from "../Geometry/GeUtils"; import { IdentityMtx4, XAxis, equaln, equalv3, isParallelTo } from "../Geometry/GeUtils";
import { Max } from "../Nest/Common/Util"; import { Max } from "../Nest/Common/Util";
import { Production } from "../Production/Product"; import { Production } from "../Production/Product";
import { IHighSealedItem } from "../UI/Store/OptionInterface/IHighSealedItem"; import { IHighEdgeRemarkItem, IHighSealedItem } from "../UI/Store/OptionInterface/IHighSealedItem";
import { OffsetPolyline } from "./OffsetPolyline"; import { OffsetPolyline } from "./OffsetPolyline";
import { ParseEdgeSealDir } from "./ParseEdgeSealDir"; import { ParseEdgeSealDir } from "./ParseEdgeSealDir";
@ -200,6 +200,63 @@ export function GetBoardHighSeal(br: Board, sealcus: Curve[]): IHighSealedItem[]
return highSeals; return highSeals;
} }
export function GetHighBoardEdgeRemark(br: Board, sealcus: Curve[]): IHighEdgeRemarkItem[]
{
const opt = br.BoardProcessOption;
//顺序和封边一样
if (opt[EBoardKeyList.SpliteHeight]
&& opt[EBoardKeyList.SpliteWidth]
&& opt[EBoardKeyList.SpliteThickness]
)
{
return [
{ description: opt.edgeRemarkDown },
{ description: opt.edgeRemarkRight },
{ description: opt.edgeRemarkUp },
{ description: opt.edgeRemarkLeft },
];
}
const highBoardEdgeRemark: IHighEdgeRemarkItem[] = [];
for (const d of opt.highBoardEdgeRemark)
if (d.description != null)
highBoardEdgeRemark.push({ ...d });
//若未设置高级板边备注,把上下左右板边备注存入高级板边备注
if (sealcus.length !== highBoardEdgeRemark.length || !br.IsSpecialShape)
{
const edgeRemarkDown = opt.edgeRemarkDown;
const edgeRemarkRight = opt.edgeRemarkRight;
const edgeRemarkUp = opt.edgeRemarkUp;
const edgeRemarkLeft = opt.edgeRemarkLeft;
highBoardEdgeRemark.length = 0;
const dir = Math.sign(br.ContourCurve.Area2);
for (const c of sealcus)
{
const derv = c.GetFirstDeriv(0).multiplyScalar(dir);
if (Math.abs(derv.x) > Math.abs(derv.y))
{
if (derv.x > 0)
highBoardEdgeRemark.push({ description: edgeRemarkDown });
else
highBoardEdgeRemark.push({ description: edgeRemarkUp });
}
else
{
if (derv.y > 0)
highBoardEdgeRemark.push({ description: edgeRemarkRight });
else
highBoardEdgeRemark.push({ description: edgeRemarkLeft });
}
}
}
return highBoardEdgeRemark;
}
/**偏移前后曲线起点没改变 */ /**偏移前后曲线起点没改变 */
export function OffsetOutlineSpNotChange(oldcu: Curve, newCu: Curve) export function OffsetOutlineSpNotChange(oldcu: Curve, newCu: Curve)
{ {
@ -548,3 +605,40 @@ export function SetBoardTopDownLeftRightSealData(br: Board, sealDatas: IHighSeal
br.BoardProcessOption[EBoardKeyList.DownSealed] = sealDatas[bottom].size.toString(); br.BoardProcessOption[EBoardKeyList.DownSealed] = sealDatas[bottom].size.toString();
} }
} }
export function SetBoardEdgeRemarkData(br: Board, remarkDatas: IHighEdgeRemarkItem[], sealCurves?: Curve[], brContourCurve?: ExtrudeContourCurve)
{
let dir = Math.sign((brContourCurve ?? br.ContourCurve).Area2);
sealCurves = sealCurves ?? GetBoardSealingCurves(br);
const opt = br.BoardProcessOption;
if (br.IsRect && sealCurves.length === 4)
{
for (let i = 0; i < 4; i++)
{
let derv = sealCurves[i].GetFirstDeriv(0).normalize();
if (isParallelTo(derv, XAxis, 1e-4))
{
if (derv.x * dir > 0)
opt.edgeRemarkDown = remarkDatas[i].description;
else
opt.edgeRemarkUp = remarkDatas[i].description;
}
else
{
if (derv.y * dir > 0)
opt.edgeRemarkRight = remarkDatas[i].description;
else
opt.edgeRemarkLeft = remarkDatas[i].description;
}
}
}
else
{
let [left, right, top, bottom] = ParseEdgeSealDir(sealCurves);
opt.edgeRemarkLeft = remarkDatas[left].description;
opt.edgeRemarkRight = remarkDatas[right].description;
opt.edgeRemarkUp = remarkDatas[top].description;
opt.edgeRemarkDown = remarkDatas[bottom].description;
}
}

@ -113,6 +113,35 @@ export class TitleBanner extends React.Component<ITitleBannerProps>
}; };
render() render()
{ {
const boardEdgeEditor = (index: number, arr: string[], key: string) =>
{
const minWidth = {
"sealing": 62,
"highDrill": 73,
"boardEdgeRemark": 82
};
const style: React.CSSProperties = {
minWidth: minWidth[key]
};
return (
<div key={index} className="flex">
{
arr.map(text =>
<div
className="bbs-list-th bbs-td"
key={text}
style={{ display: "flex", ...style }}
>
<div style={{ width: "100%" }}>
{text}
</div>
<div className='title-resize' />
</div>
)
}
</div>
);
};
return ( return (
<div className="bbs-list-tr title" style={{ ...this.props.style, width: "fit-content", position: "relative" }} ref={this.titleRef}> <div className="bbs-list-tr title" style={{ ...this.props.style, width: "fit-content", position: "relative" }} ref={this.titleRef}>
<div className="bbs-list-th bbs-td" style={{ marginRight: 3 }}></div> <div className="bbs-list-th bbs-td" style={{ marginRight: 3 }}></div>
@ -120,47 +149,15 @@ export class TitleBanner extends React.Component<ITitleBannerProps>
bbsEditorStore.tabbarIndexs.map((index) => bbsEditorStore.tabbarIndexs.map((index) =>
{ {
let key = TotalTabbarTitlesInfos[index][1]; let key = TotalTabbarTitlesInfos[index][1];
if (key === "sealing") const boardEdgeMap = {
{ sealing: ["上封边", "下封边", "左封边", "右封边"],
return ( highDrill: ["上排钻", "下排钻", "左排钻", "右排钻"],
<div key={index} className="flex"> boardEdgeRemark: ["上边备注信息", "下边备注信息", "左边备注信息", "右边备注信息"],
{ };
["上封边", "下封边", "左封边", "右封边"].map(text =>
<div if (["sealing", "highDrill", "boardEdgeRemark"].includes(key))
className="bbs-list-th bbs-td"
key={text}
style={{ minWidth: 62, display: "flex" }}
>
<div style={{ width: "100%" }}>
{text}
</div>
<div className='title-resize' />
</div>
)
}
</div>
);
}
else if (key === "highDrill")
{ {
return ( return boardEdgeEditor(index, boardEdgeMap[key], key);
<div key={index} className="flex">
{
["上排钻", "下排钻", "左排钻", "右排钻"].map(text =>
<div
className="bbs-list-th bbs-td"
key={text}
style={{ minWidth: 73, display: "flex" }}
>
<div style={{ width: "100%" }}>
{text}
</div>
<div className='title-resize' />
</div>
)
}
</div>
);
} }
else else
return ( return (
@ -326,7 +323,7 @@ export class PartsTable extends React.Component<IPartsTableProps, {}>
} }
interface IBBSSealingComponentProps interface IBBSComponentProps
{ {
click: (v: string) => void; click: (v: string) => void;
board: Board; board: Board;
@ -335,59 +332,80 @@ interface IBBSSealingComponentProps
index: number; index: number;
} }
interface IBBSSealingComponentProps extends IBBSComponentProps
{
keyName: string;
}
@observer @observer
export class BBSSealingComponent extends React.Component<IBBSSealingComponentProps> export class BBSSealingComponent extends React.Component<IBBSSealingComponentProps>
{ {
render() render()
{ {
const { board, option, index } = this.props; const { board, option, index, keyName } = this.props;
const boardEdgeInfoMap = {
sealing: {
title: "异形板件请查看高级封边",
up: EBoardKeyList.UpSealed,
down: EBoardKeyList.DownSealed,
left: EBoardKeyList.LeftSealed,
right: EBoardKeyList.RightSealed
},
boardEdgeRemark: {
title: "异形板件请查看板边编辑",
up: "edgeRemarkUp",
down: "edgeRemarkDown",
left: "edgeRemarkLeft",
right: "edgeRemarkRight",
},
};
const boardInfo: { title: string, up: string, down: string, left: string, right: string; } = boardEdgeInfoMap[keyName];
const minWidth = keyName === "boardEdgeRemark" ? 82 : 62;
return ( return (
<> <>
{ {
board.IsSpecialShape ? board.IsSpecialShape ?
<div className="bbs-list-td bbs-td" style={{ minWidth: 248 }}> <div className="bbs-list-td bbs-td" style={{ minWidth: minWidth * 4 }}>
<input className="bp3-input bp3-minimal" style={{ width: "calc(100% - 2px)", textAlign: "center" }} value="异形板件请查看高级封边" contentEditable={false} <input className="bp3-input bp3-minimal" style={{ width: "calc(100% - 2px)", textAlign: "center" }} defaultValue={boardInfo.title} readOnly={true}
onClick={() => { this.props.click(EBoardKeyList.UpSealed); }} onClick={() => { this.props.click(boardInfo.up); }}
/> />
</div> </div>
: :
<> <>
<div className="bbs-list-td bbs-td"> <div className="bbs-list-td bbs-td" style={{ minWidth: minWidth }}>
<ToasterInput <ToasterInput
type={CheckObjectType.BBS} type={CheckObjectType.BBS}
optKey={EBoardKeyList.UpSealed} optKey={boardInfo.up}
option={option} option={option}
onClick={() => { this.props.click(EBoardKeyList.UpSealed); }} onClick={() => { this.props.click(boardInfo.up); }}
onBlur={(e) => this.props.ModifyDataRecord(index, board, EBoardKeyList.UpSealed, e.target.value)} onBlur={(e) => this.props.ModifyDataRecord(index, board, boardInfo.up, e.target.value)}
/> />
</div> </div>
<div className="bbs-list-td bbs-td"> <div className="bbs-list-td bbs-td" style={{ minWidth: minWidth }}>
<ToasterInput <ToasterInput
type={CheckObjectType.BBS} type={CheckObjectType.BBS}
optKey={EBoardKeyList.DownSealed} optKey={boardInfo.down}
option={option} option={option}
onClick={() => { this.props.click(EBoardKeyList.DownSealed); }} onClick={() => { this.props.click(boardInfo.down); }}
onBlur={(e) => this.props.ModifyDataRecord(index, board, EBoardKeyList.DownSealed, e.target.value)} onBlur={(e) => this.props.ModifyDataRecord(index, board, boardInfo.down, e.target.value)}
/> />
</div> </div>
<div className="bbs-list-td bbs-td"> <div className="bbs-list-td bbs-td" style={{ minWidth: minWidth }}>
<ToasterInput <ToasterInput
type={CheckObjectType.BBS} type={CheckObjectType.BBS}
optKey={EBoardKeyList.LeftSealed} optKey={boardInfo.left}
option={option} option={option}
onClick={() => { this.props.click(EBoardKeyList.LeftSealed); }} onClick={() => { this.props.click(boardInfo.left); }}
onBlur={(e) => this.props.ModifyDataRecord(index, board, EBoardKeyList.LeftSealed, e.target.value)} onBlur={(e) => this.props.ModifyDataRecord(index, board, boardInfo.left, e.target.value)}
/> />
</div> </div>
<div className="bbs-list-td bbs-td"> <div className="bbs-list-td bbs-td" style={{ minWidth: minWidth }}>
<ToasterInput <ToasterInput
type={CheckObjectType.BBS} type={CheckObjectType.BBS}
optKey={EBoardKeyList.RightSealed} optKey={boardInfo.right}
option={option} option={option}
onClick={() => { this.props.click(EBoardKeyList.RightSealed); }} onClick={() => { this.props.click(boardInfo.right); }}
onBlur={(e) => this.props.ModifyDataRecord(index, board, EBoardKeyList.RightSealed, e.target.value)} onBlur={(e) => this.props.ModifyDataRecord(index, board, boardInfo.right, e.target.value)}
/> />
</div> </div>
</> </>
@ -397,7 +415,7 @@ export class BBSSealingComponent extends React.Component<IBBSSealingComponentPro
} }
} }
interface IBBSDrillingComponentProps extends IBBSSealingComponentProps interface IBBSDrillingComponentProps extends IBBSComponentProps
{ {
selectOption: string[]; selectOption: string[];
ToggleBgColor: () => void; ToggleBgColor: () => void;
@ -675,7 +693,7 @@ export class BBSProcessGroupItem extends React.Component<IBBSProcessGroupItemPro
} }
@observer @observer
export class BBSRemarksComponent extends React.Component<IBBSSealingComponentProps> export class BBSRemarksComponent extends React.Component<IBBSComponentProps>
{ {
render() render()
{ {

@ -115,6 +115,11 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
return this.option.hasOwnProperty(EBoardKeyList.UpSealed); return this.option.hasOwnProperty(EBoardKeyList.UpSealed);
} }
if (key === "boardEdgeRemark")
{
return this.option.hasOwnProperty("edgeRemarkUp");
}
return this.option.hasOwnProperty(key); return this.option.hasOwnProperty(key);
} }
public render() public render()
@ -144,13 +149,15 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
case "frontDrill": case "frontDrill":
case "backDrill": case "backDrill":
return ( return (
<div className="bbs-list-td bbs-td" key={i}> <div className="bbs-list-td bbs-td" key={key}>
<Icon icon={this.option[key] ? "tick" : "blank"} /> <Icon icon={this.option[key] ? "tick" : "blank"} />
</div> </div>
); );
case "sealing": case "sealing":
case "boardEdgeRemark":
return <BBSSealingComponent return <BBSSealingComponent
key={i} key={key}
keyName={key}
click={this.HandleOnClick} click={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -159,7 +166,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
/>; />;
case "highDrill": case "highDrill":
return <BBSHighDrillingComponent return <BBSHighDrillingComponent
key={i} key={key}
click={this.HandleOnClick} click={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -171,7 +178,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
case EBoardKeyList.ProcessGroup: case EBoardKeyList.ProcessGroup:
return ( return (
<BBSProcessGroupItem <BBSProcessGroupItem
key={i} key={key}
HandleOnClick={this.HandleOnClick} HandleOnClick={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -183,7 +190,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
); );
case EBoardKeyList.ComposingFace: case EBoardKeyList.ComposingFace:
return <BBSSelectComponent return <BBSSelectComponent
key={i} key={key}
HandleOnClick={this.HandleOnClick} HandleOnClick={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -195,7 +202,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
/>; />;
case EBoardKeyList.Lines: case EBoardKeyList.Lines:
return <BBSSelectComponent return <BBSSelectComponent
key={i} key={key}
HandleOnClick={this.HandleOnClick} HandleOnClick={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -208,7 +215,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
case EBoardKeyList.DrillType: case EBoardKeyList.DrillType:
return <BBSSelectComponent return <BBSSelectComponent
key={i} key={key}
HandleOnClick={this.HandleOnClick} HandleOnClick={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -220,7 +227,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
/>; />;
case EBoardKeyList.BigHole: case EBoardKeyList.BigHole:
return <BBSSelectComponent return <BBSSelectComponent
key={i} key={key}
HandleOnClick={this.HandleOnClick} HandleOnClick={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -232,7 +239,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
/>; />;
case "remarks": case "remarks":
return <BBSRemarksComponent return <BBSRemarksComponent
key={i} key={key}
click={this.HandleOnClick} click={this.HandleOnClick}
board={dataBr} board={dataBr}
option={this.option} option={this.option}
@ -243,7 +250,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
return ( return (
<div <div
className={`bbs-list-td bbs-td ${key}`} className={`bbs-list-td bbs-td ${key}`}
key={i} key={key}
style={{ style={{
padding: "0 1px", padding: "0 1px",
width: userConfig.titleWidthMap.get(key) width: userConfig.titleWidthMap.get(key)
@ -327,6 +334,12 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
opt[key] = FixedNotZero(safeEval(br.BoardProcessOption[key], Params, "H"), 3); opt[key] = FixedNotZero(safeEval(br.BoardProcessOption[key], Params, "H"), 3);
} }
break; break;
case "boardEdgeRemark":
opt.edgeRemarkUp = br.BoardProcessOption.edgeRemarkUp;
opt.edgeRemarkDown = br.BoardProcessOption.edgeRemarkDown;
opt.edgeRemarkLeft = br.BoardProcessOption.edgeRemarkLeft;
opt.edgeRemarkRight = br.BoardProcessOption.edgeRemarkRight;
break;
default: default:
opt[key] = br.BoardProcessOption[key]; opt[key] = br.BoardProcessOption[key];
} }

@ -446,23 +446,28 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
arr.push(`"${b.BoardProcessOption.remarks.reduce((s, r) => s += ` ${r[0]}:${r[1]} `, "")}"`); arr.push(`"${b.BoardProcessOption.remarks.reduce((s, r) => s += ` ${r[0]}:${r[1]} `, "")}"`);
break; break;
case "spliteHeight": case "spliteHeight":
if (b.BoardProcessOption[key]) arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "L"), 3));
{ break;
arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "L"), 3));
break;
}
case "spliteWidth": case "spliteWidth":
if (b.BoardProcessOption[key]) arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "W"), 3));
{ break;
arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "W"), 3));
break;
}
case "spliteThickness": case "spliteThickness":
if (b.BoardProcessOption[key]) arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "H"), 3));
{ break;
arr.push(FixedNotZero(safeEval(b.BoardProcessOption[key], Params, "H"), 3)); case "boardEdgeRemark":
break; if (b.IsSpecialShape)
} for (let i = 0; i < 4; i++)
{
arr.push("异形板件请查看板边编辑");
}
else
arr.push(
b.BoardProcessOption.edgeRemarkUp,
b.BoardProcessOption.edgeRemarkDown,
b.BoardProcessOption.edgeRemarkLeft,
b.BoardProcessOption.edgeRemarkRight,
);
break;
default: default:
arr.push(`"${b.BoardProcessOption[key]}"`); arr.push(`"${b.BoardProcessOption[key]}"`);
} }
@ -476,6 +481,8 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
titles.push("上封边", "下封边", "左封边", "右封边"); titles.push("上封边", "下封边", "左封边", "右封边");
else if (TotalTabbarTitlesInfos[i][0] === "高级排钻") else if (TotalTabbarTitlesInfos[i][0] === "高级排钻")
titles.push("上排钻", "下排钻", "左排钻", "右排钻"); titles.push("上排钻", "下排钻", "左排钻", "右排钻");
else if (TotalTabbarTitlesInfos[i][0] === "板边备注信息")
titles.push("上边备注信息", "下边备注信息", "左边备注信息", "右边备注信息");
else else
titles.push(TotalTabbarTitlesInfos[i][0]); titles.push(TotalTabbarTitlesInfos[i][0]);
} }

@ -1,4 +1,4 @@
import { Button, Checkbox, Classes, HTMLSelect, Label, Radio, RadioGroup } from '@blueprintjs/core'; import { Button, Checkbox, Classes, HTMLSelect, Label, Position, Radio, RadioGroup, Tooltip } from '@blueprintjs/core';
import { observable } from 'mobx'; import { observable } from 'mobx';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
@ -482,10 +482,12 @@ interface I5InputComponent extends ISetItemOption
centerKey?: string; centerKey?: string;
isShowEditor?: boolean; isShowEditor?: boolean;
highDrillOption?: IHightDrillOption; highDrillOption?: IHightDrillOption;
isRemarks?: boolean;
edgeRemarks?: string[];
} }
/** /**
* * +?+?
*/ */
@observer @observer
export class Input5Or4Component extends React.Component<I5InputComponent, {}> export class Input5Or4Component extends React.Component<I5InputComponent, {}>
@ -493,7 +495,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
render() render()
{ {
const options = [...userConfig.DrillConfigs.keys(), "不排"]; const options = [...userConfig.DrillConfigs.keys(), "不排"];
const { highDrillOption, isShowEditor, type, const { isRemarks, highDrillOption, isShowEditor, type,
upKey, leftKey, downKey, rightKey, centerKey, upKey, leftKey, downKey, rightKey, centerKey,
option, uiOption, showDirectionIcon, hasCenter, option, uiOption, showDirectionIcon, hasCenter,
onChange } = this.props; onChange } = this.props;
@ -513,19 +515,36 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
isShow && <HTMLSelect isShow && <HTMLSelect
className="select-drillType" className="select-drillType"
options={options} options={options}
style={{ marginLeft: 3, width: 60, height: 20, padding: "0 19px 0 5px" }} style={{ margin: "0 3px", width: 60, height: 20, padding: "0 19px 0 5px" }}
value={highDrillOption.up} value={this.props.highDrillOption.up}
onChange={e => onChange={e =>
{ {
highDrillOption.up = e.currentTarget.value; highDrillOption.up = e.currentTarget.value;
}} }}
/> />
} }
{
isRemarks &&
<Tooltip
content={`${option.edgeRemarkUp}`}
position={Position.TOP}
>
<ToasterInput
inputClassName='remark-input'
type={this.props.type}
optKey={"edgeRemarkUp"}
option={option}
uiOption={this.props.uiOption}
onChange={this.props.onChange}
/>
</Tooltip>
}
</div> </div>
<div style={{ <div style={{
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
justifyContent: "center", justifyContent: "center",
margin: 3
}}> }}>
<div className="flexCol"> <div className="flexCol">
<ToasterInput <ToasterInput
@ -547,6 +566,22 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
}} }}
/> />
} }
{
isRemarks &&
<Tooltip
content={`${option.edgeRemarkLeft}`}
position={Position.TOP}
>
<ToasterInput
inputClassName='remark-input'
type={this.props.type}
optKey={"edgeRemarkLeft"}
option={option}
uiOption={this.props.uiOption}
onChange={this.props.onChange}
/>
</Tooltip>
}
</div> </div>
{ {
showDirectionIcon && <BoardDirectionIcon /> showDirectionIcon && <BoardDirectionIcon />
@ -580,6 +615,22 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
}} }}
/> />
} }
{
isRemarks &&
<Tooltip
content={`${option.edgeRemarkRight}`}
position={Position.TOP}
>
<ToasterInput
inputClassName='remark-input'
type={this.props.type}
optKey={"edgeRemarkRight"}
option={option}
uiOption={this.props.uiOption}
onChange={this.props.onChange}
/>
</Tooltip>
}
</div> </div>
</div> </div>
<div> <div>
@ -594,14 +645,30 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
isShow && <HTMLSelect isShow && <HTMLSelect
className="select-drillType" className="select-drillType"
options={options} options={options}
style={{ marginLeft: 3, width: 60, height: 20, padding: "0 19px 0 5px" }} style={{ margin: "0 3px", width: 60, height: 20, padding: "0 19px 0 5px" }}
value={highDrillOption.down} value={this.props.highDrillOption.down}
onChange={e => onChange={e =>
{ {
highDrillOption.down = e.currentTarget.value; highDrillOption.down = e.currentTarget.value;
}} }}
/> />
} }
{
isRemarks &&
<Tooltip
content={`${option.edgeRemarkDown}`}
position={Position.TOP}
>
<ToasterInput
inputClassName='remark-input'
type={this.props.type}
optKey={"edgeRemarkDown"}
option={option}
uiOption={this.props.uiOption}
onChange={this.props.onChange}
/>
</Tooltip>
}
</div> </div>
</div> </div>

@ -1,4 +1,4 @@
import { Button, Checkbox, Classes, HTMLSelect, Intent } from '@blueprintjs/core'; import { Button, Checkbox, Classes, HTMLSelect, Intent, Tooltip } from '@blueprintjs/core';
import { observable } from 'mobx'; import { observable } from 'mobx';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
@ -7,7 +7,7 @@ import { CheckObjectType } from '../../../Common/CheckoutVaildValue';
import { safeEval } from '../../../Common/eval'; import { safeEval } from '../../../Common/eval';
import { IGoodInfo } from '../../MaterialEditor/GoodsList'; import { IGoodInfo } from '../../MaterialEditor/GoodsList';
import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv'; import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv';
import { DRILL_KEYS, ECompareType, IBoardFindOption } from '../../Store/BoardFindInterface'; import { DRILL_KEYS, ECompareType, EDGEREMARK_KEYS, IBoardFindOption, SEAL_KEYS } from '../../Store/BoardFindInterface';
import { BoardFindStore } from '../../Store/BoardFindModifyStore'; import { BoardFindStore } from '../../Store/BoardFindModifyStore';
import { AnyObject, IUiOption } from "../../Store/OptionInterface/IOptionInterface"; import { AnyObject, IUiOption } from "../../Store/OptionInterface/IOptionInterface";
import { UpdateBoardInfosStore } from '../../Store/UpdateBoardInfoStore'; import { UpdateBoardInfosStore } from '../../Store/UpdateBoardInfoStore';
@ -266,155 +266,124 @@ export class SealDrillCom extends React.Component<ISealDrillProps>
{ {
render() render()
{ {
const SealAndDrillComponent = (opt) =>
{
const { sealKey, drillCheck, highDrillIndex, edgeRemarkKey } = opt;
return (
<div style={{ width: 162 }}>
<div style={{ display: "inline-flex" }}>
<div className='center-box' style={{ paddingLeft: 2 }}>
<Checkbox
checked={option.condition[sealKey]}
inline
style={{ margin: 0 }}
onChange={() =>
{
option.condition[sealKey] = !option.condition[sealKey];
if (this.props.onChange)
this.props.onChange();
}}
/>
<ToasterInput
inputClassName={'sealInput'}
type={CheckObjectType.BF}
optKey={sealKey}
option={option}
uiOption={store.UIOption}
/>
</div>
<div className='center-box' style={{ paddingLeft: 2 }}>
<HTMLSelect
className="select-drillType"
options={selectOptions}
style={{ width: 60, padding: "0 5px" }}
value={option.highDrill[highDrillIndex]}
onChange={e => option.highDrill[highDrillIndex] = e.currentTarget.value}
/>
<Checkbox
checked={option.condition[drillCheck]}
inline
style={{ margin: "0 0 0 7px" }}
onChange={() =>
{
option.condition[drillCheck] = !option.condition[drillCheck];
if (this.props.onChange)
this.props.onChange();
}}
/>
</div>
</div>
<div>
<div className='remark-box'>
<Checkbox
checked={option.condition[edgeRemarkKey]}
inline
style={{ margin: "0 0 0 2px" }}
onChange={() =>
{
option.condition[edgeRemarkKey] = !option.condition[edgeRemarkKey];
if (this.props.onChange)
this.props.onChange();
}}
/>
<Tooltip content={option[edgeRemarkKey]} disabled={option[edgeRemarkKey].length < 10}>
<ToasterInput
inputClassName={"remarkInput"}
type={CheckObjectType.BF}
optKey={edgeRemarkKey}
option={option}
uiOption={store.UIOption}
/>
</Tooltip>
</div>
</div>
</div>
);
};
const { store, selectOptions } = this.props; const { store, selectOptions } = this.props;
const option = store.m_Option; const option = store.m_Option;
if (option.highDrill.length !== 4) if (option.highDrill.length !== 4)
option.highDrill.push(...Array(4).fill(selectOptions[0])); option.highDrill.push(...Array(4).fill(selectOptions[0]));
const sealAndDrillOpts = {
up: {
sealKey: EBoardKeyList.UpSealed,
drillCheck: "upDrill",
highDrillIndex: 2,
edgeRemarkKey: "edgeRemarkUp",
},
left: {
sealKey: EBoardKeyList.LeftSealed,
drillCheck: "leftDrill",
highDrillIndex: 3,
edgeRemarkKey: "edgeRemarkLeft",
},
right: {
sealKey: EBoardKeyList.RightSealed,
drillCheck: "rightDrill",
highDrillIndex: 1,
edgeRemarkKey: "edgeRemarkRight",
},
down: {
sealKey: EBoardKeyList.DownSealed,
drillCheck: "downDrill",
highDrillIndex: 0,
edgeRemarkKey: "edgeRemarkDown",
},
};
return ( return (
<div className="find-sealed"> <div className="find-sealed">
<div> <div className='seal-center'>
<Checkbox {SealAndDrillComponent(sealAndDrillOpts.up)}
checked={option.condition.sealedUp}
inline
onChange={() =>
{
option.condition.sealedUp = !option.condition.sealedUp;
if (this.props.onChange)
this.props.onChange();
}}
/>
<ToasterInput
type={CheckObjectType.BF}
optKey={EBoardKeyList.UpSealed}
option={option}
uiOption={store.UIOption}
/>
<HTMLSelect
className="select-drillType"
options={selectOptions}
style={{ width: 60, padding: "0 5px" }}
value={option.highDrill[2]}
onChange={e => option.highDrill[2] = e.currentTarget.value}
/>
<Checkbox
checked={option.condition.upDrill}
inline
onChange={() =>
{
option.condition.upDrill = !option.condition.upDrill;
if (this.props.onChange)
this.props.onChange();
}}
/>
</div> </div>
<div className="flex-center"> <div className="seal-center">
<div> {SealAndDrillComponent(sealAndDrillOpts.left)}
<Checkbox
checked={option.condition.sealedLeft}
inline
onChange={() =>
{
option.condition.sealedLeft = !option.condition.sealedLeft;
if (this.props.onChange)
this.props.onChange();
}}
/>
<ToasterInput
type={CheckObjectType.BF}
optKey={EBoardKeyList.LeftSealed}
option={option}
uiOption={store.UIOption}
/>
<HTMLSelect
className="select-drillType"
options={selectOptions}
style={{ width: 60, padding: "0 5px" }}
value={option.highDrill[3]}
onChange={e => option.highDrill[3] = e.currentTarget.value}
/>
<Checkbox
checked={option.condition.leftDrill}
inline
onChange={() =>
{
option.condition.leftDrill = !option.condition.leftDrill;
if (this.props.onChange)
this.props.onChange();
}}
/>
</div>
<BoardDirectionIcon /> <BoardDirectionIcon />
<div> {SealAndDrillComponent(sealAndDrillOpts.right)}
<Checkbox
checked={option.condition.sealedRight}
inline
onChange={() =>
{
option.condition.sealedRight = !option.condition.sealedRight;
if (this.props.onChange)
this.props.onChange();
}}
/>
<ToasterInput
type={CheckObjectType.BF}
optKey={EBoardKeyList.RightSealed}
option={option}
uiOption={store.UIOption}
/>
<HTMLSelect
className="select-drillType"
options={selectOptions}
style={{ width: 60, padding: "0 5px" }}
value={option.highDrill[1]}
onChange={e => option.highDrill[1] = e.currentTarget.value}
/>
<Checkbox
checked={option.condition.rightDrill}
inline
onChange={() =>
{
option.condition.rightDrill = !option.condition.rightDrill;
if (this.props.onChange)
this.props.onChange();
}}
/>
</div>
</div> </div>
<div> <div className='seal-center'>
<Checkbox {SealAndDrillComponent(sealAndDrillOpts.down)}
checked={option.condition.sealedDown}
inline
onChange={() =>
{
option.condition.sealedDown = !option.condition.sealedDown;
if (this.props.onChange)
this.props.onChange();
}}
/>
<ToasterInput
type={CheckObjectType.BF}
optKey={EBoardKeyList.DownSealed}
option={option}
uiOption={store.UIOption}
/>
<HTMLSelect
className="select-drillType"
options={selectOptions}
style={{ width: 60, padding: "0 5px" }}
value={option.highDrill[0]}
onChange={e => option.highDrill[0] = e.currentTarget.value}
/>
<Checkbox
checked={option.condition.downDrill}
inline
onChange={() =>
{
option.condition.downDrill = !option.condition.downDrill;
if (this.props.onChange)
this.props.onChange();
}}
/>
</div> </div>
<div> <div>
<Checkbox <Checkbox
@ -446,49 +415,38 @@ export class SealDrillCom extends React.Component<ISealDrillProps>
</div> </div>
<div> <div>
<Checkbox <Checkbox
datatype="seal"
checked={store.isSelectAllSealed} checked={store.isSelectAllSealed}
inline inline
label="全选封边" label="全选封边"
onChange={this.handleSelectAllDrillOrSeal} onChange={(e) => (this.handleSelectAllDrillOrSeal(e, SEAL_KEYS, !store.isSelectAllSealed))}
/> />
<Checkbox <Checkbox
datatype="drill"
checked={store.isSelectAllDrill} checked={store.isSelectAllDrill}
inline inline
label="全选排钻" label="全选排钻"
onChange={this.handleSelectAllDrillOrSeal} onChange={(e) => (this.handleSelectAllDrillOrSeal(e, DRILL_KEYS, !store.isSelectAllDrill))}
/>
<Checkbox
checked={store.isSelectAllEgdeRemark}
inline
label="全选板边备注"
onChange={(e) => (this.handleSelectAllDrillOrSeal(e, EDGEREMARK_KEYS, !store.isSelectAllEgdeRemark))}
/> />
</div> </div>
</div> </div>
); );
} }
private handleSelectAllDrillOrSeal = (e: React.FormEvent) => private handleSelectAllDrillOrSeal = (e: React.FormEvent, keys: string[], isSelectAll: boolean) =>
{ {
const store = this.props.store; const { store } = this.props;
const option = this.props.store.m_Option; const option = this.props.store.m_Option;
let isDrill = e.currentTarget.getAttribute("datatype") === "drill";
let keys = isDrill ? DRILL_KEYS :
[EBoardKeyList.UpSealed, EBoardKeyList.DownSealed, EBoardKeyList.RightSealed, EBoardKeyList.LeftSealed];
for (let i in option.condition) for (let i in option.condition)
{ {
if (keys.includes(i)) if (keys.includes(i))
option.condition[i] = isDrill ? !store.isSelectAllDrill : !store.isSelectAllSealed; option.condition[i] = isSelectAll;
}
if (this.props.onChange)
this.props.onChange();
else
{
if (isDrill)
{
store.isSelectAllDrill = !store.isSelectAllDrill;
}
else
{
store.isSelectAllSealed = !store.isSelectAllSealed;
}
} }
//检查并更新store的全选状态
store.CheckIsSelectAll();
}; };
private handleChange = (e: React.ChangeEvent<HTMLInputElement>, key: string) => private handleChange = (e: React.ChangeEvent<HTMLInputElement>, key: string) =>
{ {

@ -77,8 +77,7 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
{ {
option.condition[i] = !store.isSelectAll; option.condition[i] = !store.isSelectAll;
} }
store.isSelectAllSealed = !store.isSelectAll; store.CheckIsSelectAll();
store.isSelectAll = !store.isSelectAll;
}; };
private handleReverseSelect = () => private handleReverseSelect = () =>
{ {

@ -52,6 +52,7 @@ export enum BoardModalType
BatchCurtail = "curtail", //批量内缩 BatchCurtail = "curtail", //批量内缩
BatchModifyPanel = "BatchModifyPanel", //批量修改板件 BatchModifyPanel = "BatchModifyPanel", //批量修改板件
Sealing = "Sealing", //封边 Sealing = "Sealing", //封边
BoardEdgeRemarks = "boardEdgeRemarks", //板边备注
DimStyleConfig = "DimStyleConfig",//标注配置 DimStyleConfig = "DimStyleConfig",//标注配置
BulkheadCeiling = "BulkheadCeiling",//吊顶轮廓 BulkheadCeiling = "BulkheadCeiling",//吊顶轮廓
BulkheadCeilingContour = "BulkheadCeilingContour",//吊顶轮廓 BulkheadCeilingContour = "BulkheadCeilingContour",//吊顶轮廓

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

@ -39,6 +39,7 @@ interface BoardProcessProps
br?: Board; br?: Board;
drillOption?: IHightDrillOption; drillOption?: IHightDrillOption;
otherBoardData?: { [key: string]: any; }; otherBoardData?: { [key: string]: any; };
isEdgeRemarks?: boolean;
} }
@observer @observer
export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
@ -75,6 +76,31 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
store.sealingStore.isNotUpdateStore = false; store.sealingStore.isNotUpdateStore = false;
}, 0); }, 0);
} }
private async editorEdgeRemarks(br: Board)
{
if (TempEditor.EditorIng)
{
AppToaster.show({
message: "当前正处于编辑模式下",
timeout: 3000,
intent: Intent.WARNING,
});
return;
}
app.Editor.ModalManage.Destory();
let store = RightPanelStore.GetInstance();
store.boardEdgeRemarksStore.isNotUpdateStore = true;//禁止UI再次更新配置
let config = new DialogUserConfig(store.boardEdgeRemarksStore, BoardModalType.BoardEdgeRemarks);
await config.LoadAndInitConfig();//载入或者初始化
store.m_IsShow = true;
store.m_TabId = RightTabId.BoardEgdeRemark;
setTimeout(() =>
{
store.boardEdgeRemarksStore.StartEditor([br]);
store.boardEdgeRemarksStore.isNotUpdateStore = false;
}, 0);
}
private renderEl = () => private renderEl = () =>
{ {
const el = const el =
@ -274,6 +300,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
} }
render() render()
{ {
const { isEdgeRemarks = false } = this.props;
let isShowHighEditor = Boolean(this.props.br); let isShowHighEditor = Boolean(this.props.br);
const CheckBoxStyle: React.CSSProperties = { marginBottom: 0 }; const CheckBoxStyle: React.CSSProperties = { marginBottom: 0 };
@ -435,39 +462,61 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
/> />
} }
</div> </div>
<h6 className={"edge-sealing " + Classes.HEADING}>
{
isShowHighEditor && this.props.isSpecial.get() && !this.isSplit() &&
<Button
text="高级编辑"
style={{
marginLeft: 20,
minHeight: 18,
height: 18,
padding: "0 10px",
fontSize: 12
}}
intent="success"
onClick={() => this.editorEdgeSealing(this.props.br)}
/>
}
</h6>
{ {
(!this.props.br || (!this.props.isSpecial.get() || this.isSplit())) && <Input5Or4Component isShowHighEditor && this.props.isSpecial.get() && !this.isSplit() &&
type={CheckObjectType.BR} <>
showDirectionIcon={true} <h6 className={"edge-sealing " + Classes.HEADING}>
hasCenter={false}
optKey="" <Button
upKey="sealedUp" text="高级编辑"
downKey="sealedDown" style={{
leftKey="sealedLeft" marginLeft: 20,
rightKey="sealedRight" minHeight: 18,
option={this.props.opt} height: 18,
uiOption={this.props.uiOpt} padding: "0 10px",
isShowEditor={true} fontSize: 12
highDrillOption={this.props.drillOption} }}
/> intent="success"
onClick={() => this.editorEdgeSealing(this.props.br)}
/>
</h6>
<h6 className={"edge-sealing " + Classes.HEADING}>
<Button
text="高级编辑"
style={{
marginLeft: 20,
minHeight: 12,
height: 18,
padding: "0 10px",
fontSize: 12
}}
intent="success"
onClick={() => this.editorEdgeRemarks(this.props.br)}
/>
</h6>
</>
}
{
(!this.props.br || (!this.props.isSpecial.get() || this.isSplit())) &&
<>
<h6 className={"edge-sealing " + Classes.HEADING}></h6>
<Input5Or4Component
type={CheckObjectType.BR}
showDirectionIcon={true}
hasCenter={false}
optKey=""
upKey="sealedUp"
downKey="sealedDown"
leftKey="sealedLeft"
rightKey="sealedRight"
option={this.props.opt}
uiOption={this.props.uiOpt}
isShowEditor={true}
isRemarks={isEdgeRemarks}
highDrillOption={this.props.drillOption}
/>
</>
} }
</div> </div>
); );

@ -28,6 +28,10 @@ export interface IUpdateBoardInfosOption extends IBaseOption
grooveAddDepth: string; grooveAddDepth: string;
highDrill: string[]; highDrill: string[];
isChaiDan: boolean; isChaiDan: boolean;
edgeRemarkUp: string; //板边备注上下左右
edgeRemarkDown: string;
edgeRemarkLeft: string;
edgeRemarkRight: string;
} }
export interface IUpdateInfoCondition export interface IUpdateInfoCondition
@ -56,4 +60,8 @@ export interface IUpdateInfoCondition
rightDrill: boolean; rightDrill: boolean;
isChaiDan: boolean; isChaiDan: boolean;
autoCutOption: IDrawBoardAutoCutOption; autoCutOption: IDrawBoardAutoCutOption;
edgeRemarkUp: boolean;
edgeRemarkDown: boolean;
edgeRemarkLeft: boolean;
edgeRemarkRight: boolean;
} }

@ -203,26 +203,43 @@
#modal .find-sealed { #modal .find-sealed {
text-align: center; text-align: center;
&>div label { .bp3-checkbox {
margin-right: 0; margin: 0;
margin-left : 10px; margin-left: 7px;
position : relative; top: 1px;
} }
&>div:first-child, .remark-box {
&>div:nth-child(2), height: 30px;
&>div:nth-child(3) { border: 1px solid #ccc;
label { display: flex;
top: 1px; align-items: center;
.remarkInput {
width: 125px;
} }
};
.center-box{
height: 30px;
border: 1px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
} }
input { .sealInput {
width : 30px; width : 30px;
padding : 0 2px; padding : 0 2px;
margin-right: 5px; margin-right: 5px;
} }
.seal-center {
display: flex;
justify-content: center;
align-items: center;
}
.all-sealed { .all-sealed {
position: absolute; position: absolute;
} }
@ -230,8 +247,4 @@
.select-drillType { .select-drillType {
vertical-align: baseline; vertical-align: baseline;
} }
&>.flex-center {
align-items: center;
}
} }

@ -95,8 +95,14 @@
} }
} }
#commonModal .board-info .boardSize .bp3-input { #commonModal .board-info .boardSize {
width: 30px; .bp3-input {
width: 30px;
}
.remark-input {
width: 40px;
}
} }
#commonModal .boardSize .bp3-inline { #commonModal .boardSize .bp3-inline {

@ -0,0 +1,85 @@
import { Button, Classes, Intent, Label } from '@blueprintjs/core';
import { inject, observer } from 'mobx-react';
import * as React from 'react';
import { ColorMaterial } from '../../../Common/ColorPalette';
import { BoardEdgeRemarksStore } from '../../Store/RightPanelStore/BoardEdgeRemarksStore';
import { Board_Editor_Key } from '../../Store/RightPanelStore/BoardEdgesEditor';
import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore';
import { BoardModalType } from '../Board/BoardModalType';
import { UserConfigComponent } from '../Board/UserConfigComponent';
import { AppToaster } from '../Toaster';
@inject("store")
@observer
export class BoardEdgeRemarksComponent extends React.Component<{ store?: RightPanelStore; }>
{
render()
{
const boardEdgeRemarksStore = BoardEdgeRemarksStore.GetInstance();
return (
<div className='rightTab'>
<div className='tabBody'>
<ul className={"modeling dataList " + Classes.LIST_UNSTYLED}>
<li>
<Label></Label>
<Label></Label>
</li>
{
boardEdgeRemarksStore.option.boardEdgeRemarks.map((v, i) =>
{
return (
<li key={i}>
<span
className={Classes.INPUT}
style={{
background: ColorMaterial.GetColor(i + 1).getStyle(),
width: "50%",
color: i >= 10 ? "white" : "black"
}}
>{i + 1}</span>
<input
style={{ width: "50%" }}
tabIndex={1}
value={v}
onFocus={e =>
{
e.target.setSelectionRange(0, e.target.value.length);
}}
className={Classes.INPUT}
onChange={(e) =>
{
boardEdgeRemarksStore.option.boardEdgeRemarks[i] = e.target.value;
}}
/>
</li>
);
})
}
</ul>
<div className="flex-arround">
<Button text="写入" intent={Intent.SUCCESS}
onClick={this.ok} />
<Button text="退出" intent={Intent.DANGER}
onClick={this.exit} />
</div>
</div>
<UserConfigComponent
className="modeing-config"
store={boardEdgeRemarksStore}
type={BoardModalType.BoardEdgeRemarks}
isNotUpdateStore={boardEdgeRemarksStore.isNotUpdateStore}
/>
</div>
);
}
private ok = () =>
{
this.props.store.boardEdgeRemarksStore.IsApplyData = true;
this.exit();
};
private exit()
{
AppToaster.dismiss(Board_Editor_Key);
}
}

@ -89,8 +89,14 @@
} }
} }
#boardPropsCom .board-info .boardSize .bp3-input { #boardPropsCom .board-info .boardSize {
width: 30px; .bp3-input {
width: 30px;
}
.remark-input {
width: 40px;
}
} }
#boardPropsCom .boardSize .bp3-inline { #boardPropsCom .boardSize .bp3-inline {

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

@ -6,6 +6,7 @@ import { app } from '../../../ApplicationServices/Application';
import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore'; import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore';
import { MaterialExplorer } from '../MaterialExplorer'; import { MaterialExplorer } from '../MaterialExplorer';
import ModifyModelPanel from '../ToolBar/ModifyModel/ModifyModelPanel'; import ModifyModelPanel from '../ToolBar/ModifyModel/ModifyModelPanel';
import { BoardEdgeRemarksComponent } from './BoardEdgeRemarksComponent';
import './BoardProps.less'; import './BoardProps.less';
import { BoardPropsComponent } from './BoardPropsComponent'; import { BoardPropsComponent } from './BoardPropsComponent';
import { DrillingComponent } from './DrillComponent'; import { DrillingComponent } from './DrillComponent';
@ -32,6 +33,7 @@ export enum RightTabId
Model2 = "modeing2", Model2 = "modeing2",
Model3 = "modeing3", Model3 = "modeing3",
ModuelParams = 'moduleparams', ModuelParams = 'moduleparams',
BoardEgdeRemark = 'boardedgeremark',
} }
@inject('store') @inject('store')
@ -89,6 +91,7 @@ export class RightPanel extends React.Component<{ store?: RightPanelStore; }>
<Tab className="tab-unstyle" id={RightTabId.Model3} title="三维刀路" panel={< ModelingComponent2 store={store.modeling3Store} is3D={true} />} /> <Tab className="tab-unstyle" id={RightTabId.Model3} title="三维刀路" panel={< ModelingComponent2 store={store.modeling3Store} is3D={true} />} />
<Tab className="tab-unstyle" id={RightTabId.Seal} title="封 边" panel={<SealingComponent />} /> <Tab className="tab-unstyle" id={RightTabId.Seal} title="封 边" panel={<SealingComponent />} />
<Tab className="tab-unstyle" id={RightTabId.Drill} title="排 钻" panel={<DrillingComponent />} /> <Tab className="tab-unstyle" id={RightTabId.Drill} title="排 钻" panel={<DrillingComponent />} />
<Tab className="tab-unstyle" id={RightTabId.BoardEgdeRemark} title="板边备注" panel={<BoardEdgeRemarksComponent />} />
<Tab className="tab-unstyle" id={RightTabId.Scene} title="场 景" panel={<ScenePanel />} /> <Tab className="tab-unstyle" id={RightTabId.Scene} title="场 景" panel={<ScenePanel />} />
<Tab className="tab-unstyle" id={RightTabId.Material} title="材 质" panel={<MaterialExplorer materialTable={app.Database.MaterialTable}></MaterialExplorer>} /> <Tab className="tab-unstyle" id={RightTabId.Material} title="材 质" panel={<MaterialExplorer materialTable={app.Database.MaterialTable}></MaterialExplorer>} />
<Tab className="tab-unstyle" id={RightTabId.TemplateParam} title="模板参数" panel={<TemplateParamPanel />} /> <Tab className="tab-unstyle" id={RightTabId.TemplateParam} title="模板参数" panel={<TemplateParamPanel />} />

@ -18,6 +18,7 @@ export const TotalTabbarTitlesInfos: [string, string][] = [
["排钻", EBoardKeyList.DrillType], ["正面排钻", "frontDrill"], ["反面排钻", "backDrill"], ["高级排钻", "highDrill"], //23,24,25,26 ["排钻", EBoardKeyList.DrillType], ["正面排钻", "frontDrill"], ["反面排钻", "backDrill"], ["高级排钻", "highDrill"], //23,24,25,26
["大孔面", EBoardKeyList.BigHole],//27 ["大孔面", EBoardKeyList.BigHole],//27
["是否拆单", "IsChaiDan"],//28 ["是否拆单", "IsChaiDan"],//28
['板边备注信息', "boardEdgeRemark"],//29
]; ];
export class BBSEditorStore implements IConfigStore export class BBSEditorStore implements IConfigStore
@ -25,15 +26,15 @@ export class BBSEditorStore implements IConfigStore
private readonly _version = 3; private readonly _version = 3;
@observable configName = "默认"; @observable configName = "默认";
@observable configsNames = []; @observable configsNames = [];
noResize = [6, 7, 8, 19, 20, 22, 23, 24, 25, 26, 27, 28]; //用于字段列宽度调整,但是有一些特殊框就不做调整了 noResize = [6, 7, 8, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29]; //用于字段列宽度调整,但是有一些特殊框就不做调整了
@observable tabbarIndexs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20]; @observable tabbarIndexs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 29];
@observable IsBbsCountChaidan = true; //是否统计非拆单板 @observable IsBbsCountChaidan = true; //是否统计非拆单板
InitOption() InitOption()
{ {
this.tabbarIndexs.length = 0; this.tabbarIndexs.length = 0;
this.tabbarIndexs.push(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20); this.tabbarIndexs.push(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 29);
this.IsBbsCountChaidan = true; this.IsBbsCountChaidan = true;
} }
SaveConfig() SaveConfig()

@ -3,7 +3,10 @@ import { EBoardKeyList } from "../../Common/BoardKeyList";
import { BoardOpenDir, ComposingType, LinesType } from "../../DatabaseServices/Entity/BoardInterface"; import { BoardOpenDir, ComposingType, LinesType } from "../../DatabaseServices/Entity/BoardInterface";
import { IBaseOption } from "./OptionInterface/IOptionInterface"; import { IBaseOption } from "./OptionInterface/IOptionInterface";
export const DRILL_KEYS = ["downDrill", "rightDrill", "upDrill", "leftDrill"]; export const DRILL_KEYS = ["downDrill", "rightDrill", "upDrill", "leftDrill"]; //这个顺序不能变
export const SEAL_KEYS = [EBoardKeyList.UpSealed, EBoardKeyList.DownSealed, EBoardKeyList.RightSealed, EBoardKeyList.LeftSealed];
export const EDGEREMARK_KEYS = ["edgeRemarkUp", "edgeRemarkDown", "edgeRemarkLeft", "edgeRemarkRight"];
export interface IBoardFindOption extends IBaseOption export interface IBoardFindOption extends IBaseOption
{ {
@ -38,6 +41,11 @@ export interface IBoardFindOption extends IBaseOption
extraRemarks: [string, string][]; extraRemarks: [string, string][];
isChaidan: boolean; isChaidan: boolean;
[EBoardKeyList.KnifeRad]: string; [EBoardKeyList.KnifeRad]: string;
edgeRemarkUp: string; //板边备注上下左右
edgeRemarkDown: string;
edgeRemarkLeft: string;
edgeRemarkRight: string;
} }
export interface IFindCondition export interface IFindCondition
{ {
@ -75,6 +83,11 @@ export interface IFindCondition
useZhengFanDrill: boolean; useZhengFanDrill: boolean;
useChaidan: boolean; useChaidan: boolean;
[EBoardKeyList.KnifeRad]: boolean; [EBoardKeyList.KnifeRad]: boolean;
edgeRemarkUp: boolean;
edgeRemarkDown: boolean;
edgeRemarkLeft: boolean;
edgeRemarkRight: boolean;
} }
export interface ICompareType export interface ICompareType

@ -9,7 +9,7 @@ import { userConfig } from "../../Editor/UserConfig";
import { IConfigOption } from "../Components/Board/UserConfigComponent"; import { IConfigOption } from "../Components/Board/UserConfigComponent";
import { ModalState } from "../Components/Modal/ModalInterface"; import { ModalState } from "../Components/Modal/ModalInterface";
import { ToasterValueError } from "../Components/Toaster"; import { ToasterValueError } from "../Components/Toaster";
import { DRILL_KEYS, ECompareType, IBoardFindOption } from "./BoardFindInterface"; import { DRILL_KEYS, ECompareType, EDGEREMARK_KEYS, IBoardFindOption, SEAL_KEYS } from "./BoardFindInterface";
import { BoardStore } from "./BoardStore"; import { BoardStore } from "./BoardStore";
export class BoardFindStore extends BoardStore export class BoardFindStore extends BoardStore
@ -17,6 +17,7 @@ export class BoardFindStore extends BoardStore
@observable m_Option: IBoardFindOption = JSON.parse(JSON.stringify(DefaultBoardFindOption)); @observable m_Option: IBoardFindOption = JSON.parse(JSON.stringify(DefaultBoardFindOption));
@observable isSelectAllSealed = false; @observable isSelectAllSealed = false;
@observable isSelectAllDrill = false; @observable isSelectAllDrill = false;
@observable isSelectAllEgdeRemark = false;
@observable isSelectAll = false; @observable isSelectAll = false;
@observable isRevSelect = false; @observable isRevSelect = false;
@ -71,6 +72,7 @@ export class BoardFindStore extends BoardStore
this.isSelectAllDrill = false; this.isSelectAllDrill = false;
this.isRevSelect = false; this.isRevSelect = false;
this.isSelectAllSealed = false; this.isSelectAllSealed = false;
this.isSelectAllEgdeRemark = false;
} }
SaveConfig() SaveConfig()
{ {
@ -123,7 +125,19 @@ export class BoardFindStore extends BoardStore
cof.option.compareType[EBoardKeyList.OpenDir] = ECompareType.Equal; cof.option.compareType[EBoardKeyList.OpenDir] = ECompareType.Equal;
cof.option.condition[EBoardKeyList.OpenDir] = false; cof.option.condition[EBoardKeyList.OpenDir] = false;
cof.option[EBoardKeyList.OpenDir] = BoardOpenDir.None; cof.option[EBoardKeyList.OpenDir] = BoardOpenDir.None;
}
if (cof.option.version < 9)
{
cof.option.version = 9;
cof.option.hardwareDoorName = ""; cof.option.hardwareDoorName = "";
cof.option.edgeRemarkUp = "";
cof.option.edgeRemarkDown = "";
cof.option.edgeRemarkLeft = "";
cof.option.edgeRemarkRight = "";
cof.option.condition.edgeRemarkUp = false;
cof.option.condition.edgeRemarkDown = false;
cof.option.condition.edgeRemarkLeft = false;
cof.option.condition.edgeRemarkRight = false;
} }
Object.assign(this.m_Option, cof.option); Object.assign(this.m_Option, cof.option);
@ -136,9 +150,9 @@ export class BoardFindStore extends BoardStore
CheckIsSelectAll() CheckIsSelectAll()
{ {
this.isSelectAll = Object.values(this.m_Option.condition).every(v => v); this.isSelectAll = Object.values(this.m_Option.condition).every(v => v);
this.isSelectAllSealed = [EBoardKeyList.UpSealed, EBoardKeyList.DownSealed, this.isSelectAllSealed = SEAL_KEYS.every(k => this.m_Option.condition[k]);
EBoardKeyList.RightSealed, EBoardKeyList.LeftSealed].every(k => this.m_Option.condition[k]);
this.isSelectAllDrill = DRILL_KEYS.every(k => this.m_Option.condition[k]); this.isSelectAllDrill = DRILL_KEYS.every(k => this.m_Option.condition[k]);
this.isSelectAllEgdeRemark = EDGEREMARK_KEYS.every(k => this.m_Option.condition[k]);
} }
HasInvailValue() HasInvailValue()
{ {

@ -2,7 +2,7 @@ import { FaceDirection } from "../../../Add-on/DrawDrilling/DrillType";
import { EBoardKeyList } from "../../../Common/BoardKeyList"; import { EBoardKeyList } from "../../../Common/BoardKeyList";
import { ComposingType, LinesType } from "../../../DatabaseServices/Entity/BoardInterface"; import { ComposingType, LinesType } from "../../../DatabaseServices/Entity/BoardInterface";
import { ObjectId } from "../../../DatabaseServices/ObjectId"; import { ObjectId } from "../../../DatabaseServices/ObjectId";
import { IHighSealedItem } from "./IHighSealedItem"; import { IHighEdgeRemarkItem, IHighSealedItem } from "./IHighSealedItem";
import { IBaseOption } from "./IOptionInterface"; import { IBaseOption } from "./IOptionInterface";
export interface BoardProcessOption extends IBaseOption export interface BoardProcessOption extends IBaseOption
@ -31,4 +31,10 @@ export interface BoardProcessOption extends IBaseOption
backDrill: boolean; backDrill: boolean;
remarks: [string, string][]; remarks: [string, string][];
useBoardProcessOption?: boolean; //使用周围板 useBoardProcessOption?: boolean; //使用周围板
edgeRemarkUp?: string; //板边备注上下左右
edgeRemarkDown?: string;
edgeRemarkLeft?: string;
edgeRemarkRight?: string;
highBoardEdgeRemark?: IHighEdgeRemarkItem[]; //高级板边备注
} }

@ -9,3 +9,8 @@ export interface ISealingData extends IHighSealedItem
type?: string; type?: string;
shop?: string; shop?: string;
} }
export interface IHighEdgeRemarkItem
{
description: string;
}

@ -0,0 +1,173 @@
import { observable, toJS } from "mobx";
import { CommandNames } from "../../../Common/CommandNames";
import { Log, LogType } from "../../../Common/Log";
import { Intent } from "../../../Common/Toaster";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { CommandWrap } from "../../../Editor/CommandMachine";
import { GetBoardSealingCurves, GetHighBoardEdgeRemark, SetBoardEdgeRemarkData } from "../../../GraphicsSystem/CalcEdgeSealing";
import { IConfigOption } from "../../Components/Board/UserConfigComponent";
import { ShowLinesToaster } from "../../Components/Toaster";
import { IConfigStore } from "../BoardStore";
import { IHighEdgeRemarkItem } from "../OptionInterface/IHighSealedItem";
import { BoardEdgesEditor, Board_Editor_Key } from "./BoardEdgesEditor";
export class BoardEdgeRemarksStore extends BoardEdgesEditor implements IConfigStore
{
isNotUpdateStore = false;
@observable boardEdgeRemarks: string[] = Array(20).fill("");
private static _SingleInstance: BoardEdgeRemarksStore;
static GetInstance(): BoardEdgeRemarksStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new BoardEdgeRemarksStore;
return this._SingleInstance;
}
@observable option = { boardEdgeRemarks: this.boardEdgeRemarks };
async InitData()
{
}
@observable configName: string = "默认";
@observable configsNames: string[] = [];
InitOption()
{
const initBoardEdgeRemarks = Array(20).fill("");
//禁止再次初始化,避免用户没有配置的时候,使用板边备注编辑,导致面板属性被还原
Object.assign(this.option, { boardEdgeRemarks: initBoardEdgeRemarks });
}
SaveConfig()
{
return { option: toJS(this.option) };
}
UpdateOption(cof: IConfigOption)
{
Object.assign(this.option, cof.option);
}
protected InitCurve()
{
const dataColorMap = new Map<string, number>();//data->color
const canUseColor: number[] = [];//可使用的颜色
const boardEdgeRemarks = this.option.boardEdgeRemarks;
for (let i = 0; i < boardEdgeRemarks.length; i++)
{
if (dataColorMap.has(boardEdgeRemarks[i]) || boardEdgeRemarks[i] === "")
canUseColor.push(i);//可以被覆盖
else
dataColorMap.set(boardEdgeRemarks[i], i);//记录颜色
}
for (const br of this._boardList)
{
const curves = GetBoardSealingCurves(br, true);
const highBoardEdgeRemark = GetHighBoardEdgeRemark(br, curves);
if (highBoardEdgeRemark.length === curves.length)
{
for (let i = 0; i < highBoardEdgeRemark.length; i++)
{
const remark = highBoardEdgeRemark[i];
if (!dataColorMap.has(remark.description))
{
if (canUseColor.length)
{
dataColorMap.set(remark.description, canUseColor[0]);
boardEdgeRemarks[canUseColor[0]] = remark.description;
canUseColor.shift();
}
else
{
boardEdgeRemarks.push(remark.description);
dataColorMap.set(remark.description, boardEdgeRemarks.length - 1);
}
}
const color = dataColorMap.get(remark.description) + 1;
curves[i].ColorIndex = color;
}
}
else
{
if (!dataColorMap.has(""))
{
if (canUseColor.length)
{
dataColorMap.set("", canUseColor[0]);
boardEdgeRemarks[canUseColor[0]] = "";
canUseColor.shift();
}
else
{
boardEdgeRemarks.push("");
dataColorMap.set("", boardEdgeRemarks.length - 1);
}
}
const color = dataColorMap.get("") + 1;
curves.forEach(cu => cu.ColorIndex = color);
}
this._brMap.set(br, curves);
}
}
protected ShowToaster()
{
ShowLinesToaster(
["正在编辑板边备注...", "点击<写入>写入板边备注数据到板件,", "点击<退出>或者关闭退出编辑状态"],
{
intent: Intent.PRIMARY,
timeout: 0,
onDismiss: () =>
{
this.EndEditor();
}
}, Board_Editor_Key);
}
#dataMap: Map<Board, IHighEdgeRemarkItem[]> = new Map();
protected ParseData()
{
const boardEdgeRemarks = this.option.boardEdgeRemarks;
for (const [br, cus] of this._brMap)
{
const data: IHighEdgeRemarkItem[] = [];
for (const cu of cus)
{
//检查不存在配置的colorIndex
const color = cu.ColorIndex;
if (color > boardEdgeRemarks.length)
{
Log(color + "号色未设置数据,默认为空", LogType.Warning);
data.push({ description: "" });
}
else
{
let remark = boardEdgeRemarks[color - 1];
if (color === 0)
{
remark = "";
Log(color + "不支持号色为 0 ,默认为空", LogType.Warning);
}
data.push({ description: remark });
}
}
this.#dataMap.set(br, data);
}
}
protected async WriteData()
{
await CommandWrap(() =>
{
for (let [b, cus] of this._brMap)
{
let data = this.#dataMap.get(b);
let ocsInv = b.OCSInv;
SetBoardEdgeRemarkData(b, data, cus.map(c => c.ApplyMatrix(ocsInv)));
b.BoardProcessOption.highBoardEdgeRemark = data;
}
this.#dataMap.clear();
}, CommandNames.);
}
}

@ -6,6 +6,7 @@ import { Board } from "../../../DatabaseServices/Entity/Board";
import { SelectSetBase } from "../../../Editor/SelectBase"; import { SelectSetBase } from "../../../Editor/SelectBase";
import { RightTabId } from "../../Components/RightPanel/RightPanel"; import { RightTabId } from "../../Components/RightPanel/RightPanel";
import { IKnifeProps } from "../OptionInterface/IOptionInterface"; import { IKnifeProps } from "../OptionInterface/IOptionInterface";
import { BoardEdgeRemarksStore } from "./BoardEdgeRemarksStore";
import { DrillingStore } from "./DrillingStore"; import { DrillingStore } from "./DrillingStore";
import { LightStore } from "./LightStore"; import { LightStore } from "./LightStore";
import { Modeling2Store } from "./Modeling2Store"; import { Modeling2Store } from "./Modeling2Store";
@ -23,6 +24,7 @@ export class RightPanelStore
modelingStore = new ModelingStore(); modelingStore = new ModelingStore();
lightStore = LightStore.GetInstance(); lightStore = LightStore.GetInstance();
sealingStore = SealingStore.GetInstance(); sealingStore = SealingStore.GetInstance();
boardEdgeRemarksStore = BoardEdgeRemarksStore.GetInstance();
drillingStore = new DrillingStore(); drillingStore = new DrillingStore();
modeling2Store = new Modeling2Store(); modeling2Store = new Modeling2Store();
modeling3Store = new Modeling2Store(); modeling3Store = new Modeling2Store();

@ -1,13 +1,12 @@
import { action, observable, toJS } from "mobx"; import { action, observable, toJS } from "mobx";
import { DrillType, FaceDirection } from "../../Add-on/DrawDrilling/DrillType"; import { DrillType, FaceDirection } from "../../Add-on/DrawDrilling/DrillType";
import { EBoardKeyList } from "../../Common/BoardKeyList";
import { CheckObjectType, CheckoutValid } from "../../Common/CheckoutVaildValue"; import { CheckObjectType, CheckoutValid } from "../../Common/CheckoutVaildValue";
import { LinesType } from "../../DatabaseServices/Entity/BoardInterface"; import { LinesType } from "../../DatabaseServices/Entity/BoardInterface";
import { DefaultUpdateInfoOption } from "../../Editor/DefaultConfig"; import { DefaultUpdateInfoOption } from "../../Editor/DefaultConfig";
import { userConfig } from "../../Editor/UserConfig"; import { userConfig } from "../../Editor/UserConfig";
import { IUpdateBoardInfosOption } from "../Components/Board/UpdateBoardInfointerface"; import { IUpdateBoardInfosOption } from "../Components/Board/UpdateBoardInfointerface";
import { IConfigOption } from "../Components/Board/UserConfigComponent"; import { IConfigOption } from "../Components/Board/UserConfigComponent";
import { DRILL_KEYS } from "./BoardFindInterface"; import { DRILL_KEYS, EDGEREMARK_KEYS, SEAL_KEYS } from "./BoardFindInterface";
import { BoardStore } from "./BoardStore"; import { BoardStore } from "./BoardStore";
export class UpdateBoardInfosStore extends BoardStore export class UpdateBoardInfosStore extends BoardStore
@ -17,6 +16,7 @@ export class UpdateBoardInfosStore extends BoardStore
@observable currentBoardName = ""; @observable currentBoardName = "";
@observable isSelectAllDrill = true; @observable isSelectAllDrill = true;
@observable isSelectAllSealed = true; @observable isSelectAllSealed = true;
@observable isSelectAllEgdeRemark = false;
constructor() constructor()
{ {
@ -124,6 +124,7 @@ export class UpdateBoardInfosStore extends BoardStore
} }
if (option[name].version < 2 || !option[name].condition.autoCutOption)//fuck if (option[name].version < 2 || !option[name].condition.autoCutOption)//fuck
{ {
option[name].version = 2;
option[name].condition.autoCutOption = { isAutoCut: false, isRelevance: false }; option[name].condition.autoCutOption = { isAutoCut: false, isRelevance: false };
} }
if (!option[name].brName) if (!option[name].brName)
@ -131,7 +132,18 @@ export class UpdateBoardInfosStore extends BoardStore
if (!option[name].highDrill || option[name].highDrill.length === 0) if (!option[name].highDrill || option[name].highDrill.length === 0)
option[name].highDrill = Array(4).fill(option[name].drillType); option[name].highDrill = Array(4).fill(option[name].drillType);
option[name].version = 2; if (option[name].version < 3)
{
option[name].version = 3;
option[name].edgeRemarkUp = "";
option[name].edgeRemarkDown = "";
option[name].edgeRemarkLeft = "";
option[name].edgeRemarkRight = "";
option[name].condition.edgeRemarkUp = true;
option[name].condition.edgeRemarkDown = true;
option[name].condition.edgeRemarkLeft = true;
option[name].condition.edgeRemarkRight = true;
}
this.nameOptionMap.set(name, option[name]); this.nameOptionMap.set(name, option[name]);
} }
} }
@ -143,9 +155,9 @@ export class UpdateBoardInfosStore extends BoardStore
} }
CheckIsSelectAll() CheckIsSelectAll()
{ {
this.isSelectAllSealed = [EBoardKeyList.UpSealed, EBoardKeyList.DownSealed, this.isSelectAllSealed = SEAL_KEYS.every(k => this.m_Option.condition[k]);
EBoardKeyList.RightSealed, EBoardKeyList.LeftSealed].every(k => this.m_Option.condition[k]);
this.isSelectAllDrill = DRILL_KEYS.every(k => this.m_Option.condition[k]); this.isSelectAllDrill = DRILL_KEYS.every(k => this.m_Option.condition[k]);
this.isSelectAllEgdeRemark = EDGEREMARK_KEYS.every(k => this.m_Option.condition[k]);
} }
} }

Loading…
Cancel
Save