mirror of https://gitee.com/cf-fz/WebCAD.git
parent
75a9270fb2
commit
455ccb49a7
@ -0,0 +1,96 @@
|
||||
import { Command } from "../Editor/CommandMachine";
|
||||
import { app } from "../ApplicationServices/Application";
|
||||
import { ModalPosition } from "../UI/Components/Modal/ModalsManage";
|
||||
import { LookOverBoardInfosModal } from "../UI/Components/Board/LookOverBoardInfos";
|
||||
import { LookOverBoardInfosStore } from "../UI/Store/LookOverBoardInfosStore";
|
||||
import { Board } from "../DatabaseServices/Entity/Board";
|
||||
import { PromptStatus } from "../Editor/PromptResult";
|
||||
import { EFindType } from "../UI/Store/BoardFindInterface";
|
||||
import { EBoardKeyList } from "../Common/BoardKeyList";
|
||||
|
||||
export class LookOverBoardInfos implements Command
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
let enRes = await app.Editor.GetSelection({
|
||||
Msg: "选择板件",
|
||||
Filter: {
|
||||
filterTypes: [Board]
|
||||
}
|
||||
});
|
||||
if (enRes.Status === PromptStatus.Cancel)
|
||||
return;
|
||||
|
||||
let brs = enRes.SelectSet.SelectEntityList as Board[];
|
||||
|
||||
const store = LookOverBoardInfosStore.GetInstance() as LookOverBoardInfosStore;
|
||||
app.Editor.ModalManage.RenderModal(LookOverBoardInfosModal, ModalPosition.Center, { store, boardList: brs }, true);//改成modaless
|
||||
app.Editor.SelectCtrl.Cancel();
|
||||
|
||||
app.Editor.ModalManage.Callback = async (res) =>
|
||||
{
|
||||
switch (res.type)
|
||||
{
|
||||
case EFindType.Modify:
|
||||
await this.modify(store);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
app.Editor.ModalManage.ToggleShow();
|
||||
|
||||
if (store.isClose)
|
||||
{
|
||||
app.Editor.ModalManage.Clear();
|
||||
app.Editor.ModalManage.EndCmd();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.Editor.MaskManage.ShowMask();
|
||||
}
|
||||
}
|
||||
}
|
||||
modify(store: LookOverBoardInfosStore)
|
||||
{
|
||||
let map = store.boardInfos;
|
||||
for (let [br, opts] of map)
|
||||
{
|
||||
for (let i in opts)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case EBoardKeyList.Height:
|
||||
br.Height = parseFloat(opts[i]);
|
||||
break;
|
||||
case EBoardKeyList.Width:
|
||||
br.Width = parseFloat(opts[i]);
|
||||
break;
|
||||
case EBoardKeyList.Thick:
|
||||
br.Thickness = parseFloat(opts[i]);
|
||||
break;
|
||||
case "brName":
|
||||
br.Name = opts.brName;
|
||||
break;
|
||||
case "boardName":
|
||||
br.BoardProcessOption.boardName = opts.boardName;
|
||||
break;
|
||||
case EBoardKeyList.Lines:
|
||||
case EBoardKeyList.UpSealed:
|
||||
case EBoardKeyList.DownSealed:
|
||||
case EBoardKeyList.LeftSealed:
|
||||
case EBoardKeyList.RightSealed:
|
||||
case EBoardKeyList.Mat:
|
||||
case EBoardKeyList.Color:
|
||||
case EBoardKeyList.RoomName:
|
||||
case EBoardKeyList.CabinetName:
|
||||
br.BoardProcessOption[i] = opts[i] as never;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//重置修改数据
|
||||
store.boardInfos = new Map();
|
||||
}
|
||||
}
|
@ -0,0 +1,289 @@
|
||||
import React = require("react");
|
||||
import { Board } from "../../../DatabaseServices/Entity/Board";
|
||||
import { LookOverBoardInfosStore } from "../../Store/LookOverBoardInfosStore";
|
||||
import { HTMLSelect, Icon } from "@blueprintjs/core";
|
||||
import { LinesType, ComposingType, FaceDirection } from "../../Store/BoardInterface";
|
||||
import { observer } from "mobx-react";
|
||||
import { EBoardKeyList } from "../../../Common/BoardKeyList";
|
||||
import { CheckObjectType } from "../../../Common/CheckoutVaildValue";
|
||||
import { ToasterInput } from "../Toaster";
|
||||
|
||||
export interface IBoardInfoListProps
|
||||
{
|
||||
dataList?: Board[];
|
||||
store?: LookOverBoardInfosStore;
|
||||
br: Board;
|
||||
}
|
||||
export interface IBoardInfoOptions
|
||||
{
|
||||
[EBoardKeyList.Height]?: string;
|
||||
[EBoardKeyList.Width]?: string;
|
||||
[EBoardKeyList.Thick]?: string;
|
||||
"brName"?: string;
|
||||
"boardName"?: string;
|
||||
[EBoardKeyList.Mat]?: string;
|
||||
[EBoardKeyList.Color]?: string;
|
||||
[EBoardKeyList.RoomName]?: string;
|
||||
[EBoardKeyList.CabinetName]?: string;
|
||||
[EBoardKeyList.Lines]?: LinesType;
|
||||
[EBoardKeyList.UpSealed]?: string;
|
||||
[EBoardKeyList.DownSealed]?: string;
|
||||
[EBoardKeyList.LeftSealed]?: string;
|
||||
[EBoardKeyList.RightSealed]?: string;
|
||||
|
||||
}
|
||||
@observer
|
||||
export class BoardInfoList extends React.Component<IBoardInfoListProps, IBoardInfoOptions>
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.initState(this.props.br);
|
||||
}
|
||||
componentWillReceiveProps(nextProps)
|
||||
{
|
||||
this.initState(nextProps.br);
|
||||
}
|
||||
initState = (board: Board) =>
|
||||
{
|
||||
let br = board;
|
||||
this.state = {
|
||||
cabinetName: br.BoardProcessOption[EBoardKeyList.CabinetName],
|
||||
roomName: br.BoardProcessOption[EBoardKeyList.RoomName],
|
||||
brName: br.Name,
|
||||
height: br.Height.toString(),
|
||||
width: br.Width.toString(),
|
||||
thickness: br.Thickness.toString(),
|
||||
boardName: br.BoardProcessOption.boardName,
|
||||
material: br.BoardProcessOption[EBoardKeyList.Mat],
|
||||
color: br.BoardProcessOption[EBoardKeyList.Color],
|
||||
lines: br.BoardProcessOption[EBoardKeyList.Lines],
|
||||
sealedUp: br.BoardProcessOption[EBoardKeyList.UpSealed],
|
||||
sealedDown: br.BoardProcessOption[EBoardKeyList.DownSealed],
|
||||
sealedRight: br.BoardProcessOption[EBoardKeyList.RightSealed],
|
||||
sealedLeft: br.BoardProcessOption[EBoardKeyList.LeftSealed],
|
||||
}
|
||||
}
|
||||
//记录被修改的数据
|
||||
modifyDataMap = (br: Board, modifyKey: string, value: string | LinesType | FaceDirection | ComposingType) =>
|
||||
{
|
||||
let dataMap = this.props.store.boardInfos;
|
||||
if (dataMap.has(br))
|
||||
{
|
||||
let d = dataMap.get(br);
|
||||
d[modifyKey] = value;
|
||||
dataMap.set(br, d);
|
||||
}
|
||||
else
|
||||
{
|
||||
let opts: IBoardInfoOptions = {};
|
||||
opts[modifyKey] = value;
|
||||
dataMap.set(br, opts);
|
||||
}
|
||||
}
|
||||
public render()
|
||||
{
|
||||
const store = this.props.store;
|
||||
let br = this.props.br;
|
||||
return (
|
||||
<tr>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.RoomName}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.RoomName]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.RoomName }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.RoomName, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.CabinetName}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.CabinetName]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.CabinetName }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.CabinetName, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={"brName"}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ brName: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = "brName" }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, "brName", e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.Height}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.Height]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Height }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.Height, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.Width}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.Width]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Width }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.Width, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.Thick}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.Thick]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Thick }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.Thick, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<HTMLSelect
|
||||
value={this.state.lines}
|
||||
options={
|
||||
[
|
||||
{
|
||||
label: "正纹",
|
||||
value: LinesType.Positive.toString()
|
||||
},
|
||||
{
|
||||
label: "反纹",
|
||||
value: LinesType.Reverse.toString()
|
||||
},
|
||||
{
|
||||
label: "可翻转",
|
||||
value: LinesType.CanReversal.toString()
|
||||
},
|
||||
]
|
||||
}
|
||||
onChange={e =>
|
||||
{
|
||||
this.setState({ [EBoardKeyList.Lines]: parseFloat(e.target.value) });
|
||||
this.modifyDataMap(br, EBoardKeyList.Lines, parseFloat(e.target.value));
|
||||
}}
|
||||
onClick={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Lines }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
className="bp3-input"//加工
|
||||
onFocus={() => { store.selectedBr = br }}
|
||||
/>
|
||||
</td>
|
||||
{
|
||||
br.IsSpecialShape ?
|
||||
<td colSpan={4}>
|
||||
<input className="bp3-input bp3-minimal" style={{ width: "100%", textAlign: "center" }} value="异型板件请查看高级封边" contentEditable={false}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.UpSealed }}
|
||||
/>
|
||||
</td>
|
||||
:
|
||||
<>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.UpSealed}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.UpSealed]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.UpSealed }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.UpSealed, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.DownSealed}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.DownSealed]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.DownSealed }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.DownSealed, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.LeftSealed}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.LeftSealed]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.LeftSealed }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.LeftSealed, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.RightSealed}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.RightSealed]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.RightSealed }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.RightSealed, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
</>
|
||||
}
|
||||
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={"boardName"}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ boardName: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = "boardName" }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, "boardName", e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.Mat}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.Mat]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Mat }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.Mat, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<ToasterInput
|
||||
type={CheckObjectType.BBS}
|
||||
optKey={EBoardKeyList.Color}
|
||||
option={this.state}
|
||||
uiOption={this.state}
|
||||
onChange={(e) => { this.setState({ [EBoardKeyList.Color]: e.target.value }) }}
|
||||
onFocus={() => { store.selectedBr = br; store.findSameTypeBrDataKey = EBoardKeyList.Color }}
|
||||
onBlur={(e) => { this.modifyDataMap(br, EBoardKeyList.Color, e.target.value) }}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<Icon icon={br.IsSpecialShape ? "tick" : "blank"} />
|
||||
</td>
|
||||
<td>
|
||||
<Icon icon={br.BoardModeling.length > 0 ? "tick" : "blank"} />
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
}
|
@ -0,0 +1,242 @@
|
||||
import React = require("react");
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Classes, Icon, Button, Card, InputGroup } from "@blueprintjs/core";
|
||||
import { LookOverBoardInfosStore } from "../../Store/LookOverBoardInfosStore";
|
||||
import { ModalState } from "../Modal/ModalsManage";
|
||||
import { BoardInfoList } from "./BoardInfosList";
|
||||
import { Board } from "../../../DatabaseServices/Entity/Board";
|
||||
import { SelectSetBase } from "../../../Editor/SelectBase";
|
||||
import { app } from "../../../ApplicationServices/Application";
|
||||
import { EBoardKeyList } from "../../../Common/BoardKeyList";
|
||||
import { EFindType } from "../../Store/BoardFindInterface";
|
||||
import { observable } from "mobx";
|
||||
import { LinesType } from "../../Store/BoardInterface";
|
||||
import { equaln } from "../../../Geometry/GeUtils";
|
||||
|
||||
@inject('store')
|
||||
@observer
|
||||
export class LookOverBoardInfosModal extends React.Component<{ store?: LookOverBoardInfosStore, boardList: Board[] }, {}>
|
||||
{
|
||||
dataList = this.props.boardList;
|
||||
@observable searchRes: Board[] = this.props.boardList;
|
||||
@observable searchingStr = "";
|
||||
@observable private regexp: RegExp = new RegExp('^.*$', "i");
|
||||
//查看选中板件
|
||||
checkOutChosenBr = () =>
|
||||
{
|
||||
this.clearSelect();
|
||||
let selectData = new SelectSetBase(app.Viewer);
|
||||
selectData.m_SelectList.push(this.props.store.selectedBr.DrawObject);
|
||||
app.Editor.SelectCtrl.SelectSet.AddSelect(selectData);
|
||||
app.Editor.SelectCtrl.UpdateView();
|
||||
}
|
||||
//查看同类型板件
|
||||
checkOutSameTypeBr = () =>
|
||||
{
|
||||
this.clearSelect();
|
||||
|
||||
let selectData = new SelectSetBase(app.Viewer);
|
||||
let brs = this.filterBr();
|
||||
selectData.m_SelectList.push(...brs.map((b) => { return b.DrawObject }))
|
||||
app.Editor.SelectCtrl.SelectSet.AddSelect(selectData);
|
||||
app.Editor.SelectCtrl.UpdateView();
|
||||
}
|
||||
//清楚当前选中
|
||||
clearSelect = () =>
|
||||
{
|
||||
app.Editor.SelectCtrl.SelectSet.Clear();
|
||||
app.Viewer.GripScene.Clear();
|
||||
app.Editor.SelectCtrl.UpdateView();
|
||||
}
|
||||
//筛选同类型板件
|
||||
filterBr = () =>
|
||||
{
|
||||
let key = this.props.store.findSameTypeBrDataKey;
|
||||
let br = this.props.store.selectedBr;
|
||||
let brRes: Board[] = [];
|
||||
switch (key)
|
||||
{
|
||||
case EBoardKeyList.Height:
|
||||
brRes = this.props.boardList.filter((b) => equaln(b.Height, br.Height));
|
||||
break;
|
||||
case EBoardKeyList.Width:
|
||||
brRes = this.props.boardList.filter((b) => equaln(b.Width, br.Width));
|
||||
break;
|
||||
case EBoardKeyList.Thick:
|
||||
brRes = this.props.boardList.filter((b) => equaln(b.Thickness, br.Thickness));
|
||||
break;
|
||||
case "brName":
|
||||
brRes = this.props.boardList.filter((b) => b.Name === br.Name)
|
||||
break;
|
||||
case "boardName":
|
||||
brRes = this.props.boardList.filter((b) => b.BoardProcessOption.boardName === br.BoardProcessOption.boardName);
|
||||
break;
|
||||
case EBoardKeyList.Mat:
|
||||
case EBoardKeyList.Color:
|
||||
case EBoardKeyList.RoomName:
|
||||
case EBoardKeyList.CabinetName:
|
||||
case EBoardKeyList.Lines:
|
||||
brRes = this.props.boardList.filter((b) => b.BoardProcessOption[key] === br.BoardProcessOption[key]);
|
||||
break;
|
||||
case EBoardKeyList.UpSealed:
|
||||
case EBoardKeyList.DownSealed:
|
||||
case EBoardKeyList.LeftSealed:
|
||||
case EBoardKeyList.RightSealed:
|
||||
if (br.IsSpecialShape)
|
||||
brRes = this.props.boardList.filter((b) => b.IsSpecialShape);
|
||||
else
|
||||
brRes = this.props.boardList.filter((b) => !b.IsSpecialShape && b.BoardProcessOption[key] === br.BoardProcessOption[key]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return brRes;
|
||||
}
|
||||
//处理数据并用正则筛选
|
||||
regxpTest = (b: Board) =>
|
||||
{
|
||||
let arr = [];
|
||||
arr.push(
|
||||
b.Name,
|
||||
b.BoardProcessOption.boardName,
|
||||
b.Height.toString(),
|
||||
b.Width.toString(),
|
||||
b.Thickness.toString(),
|
||||
b.BoardProcessOption[EBoardKeyList.Lines] === LinesType.Positive ? "正纹" : "反纹",
|
||||
...[
|
||||
EBoardKeyList.Mat, EBoardKeyList.Color,
|
||||
EBoardKeyList.RoomName, EBoardKeyList.CabinetName,
|
||||
]
|
||||
.map((key) => { return b.BoardProcessOption[key]; })
|
||||
);
|
||||
if (b.IsSpecialShape)
|
||||
for (let i = 0; i < 4; i++)
|
||||
{
|
||||
arr.push("异型板件请查看高级封边");
|
||||
}
|
||||
else
|
||||
arr.push(
|
||||
...[
|
||||
EBoardKeyList.UpSealed, EBoardKeyList.DownSealed,
|
||||
EBoardKeyList.LeftSealed, EBoardKeyList.RightSealed
|
||||
]
|
||||
.map((key) => { return b.BoardProcessOption[key]; })
|
||||
)
|
||||
return this.regexp.test(arr.join(''))
|
||||
}
|
||||
//查找
|
||||
searchData = () =>
|
||||
{
|
||||
if (this.searchingStr === "")
|
||||
{
|
||||
this.searchRes = this.dataList;
|
||||
return;
|
||||
}
|
||||
//构造搜索的正则
|
||||
let m_comTmp = this.searchingStr.split('').join('.*') + '.*$';
|
||||
this.regexp = new RegExp(m_comTmp, 'i');
|
||||
this.searchRes = this.dataList.filter((b) => this.regxpTest(b));
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const store = this.props.store;
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={Classes.DIALOG_CONTAINER}
|
||||
style={{ width: "100%", height: "100%" }}
|
||||
>
|
||||
<div className={Classes.DIALOG + " br-lookover"}>
|
||||
<div className={Classes.DIALOG_HEADER}
|
||||
data-id="dragArea"
|
||||
>
|
||||
<Icon icon="bold" iconSize={18} />
|
||||
<h4 className="bp3-heading">板件属性</h4>
|
||||
<Button
|
||||
aria-lable="Close"
|
||||
minimal
|
||||
icon="cross"
|
||||
className={Classes.DIALOG_CLOSE_BUTTON}
|
||||
onClick={() => { store.OnOk(ModalState.Cancel) }}
|
||||
/>
|
||||
</div>
|
||||
<div className={Classes.DIALOG_BODY + " flex " + Classes.CARD}>
|
||||
<Card className={"title"}>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>房名</th>
|
||||
<th>柜名</th>
|
||||
<th>板名</th>
|
||||
<th>高</th>
|
||||
<th>宽</th>
|
||||
<th>厚</th>
|
||||
<th>纹路</th>
|
||||
<th>加工</th>
|
||||
<th>上封边</th>
|
||||
<th>下封边</th>
|
||||
<th>左封边</th>
|
||||
<th>右封边</th>
|
||||
<th>板材名</th>
|
||||
<th>材料</th>
|
||||
<th>颜色</th>
|
||||
<th>异形</th>
|
||||
<th>造型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</Card>
|
||||
<Card>
|
||||
<table>
|
||||
<tbody>
|
||||
{
|
||||
this.searchRes.map((br) =>
|
||||
{
|
||||
return (
|
||||
<BoardInfoList
|
||||
store={this.props.store}
|
||||
dataList={this.searchRes}
|
||||
br={br}
|
||||
/>
|
||||
)
|
||||
})
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</Card>
|
||||
</div>
|
||||
<div className={Classes.DIALOG_FOOTER}>
|
||||
<label className={Classes.LABEL + " " + Classes.INLINE}>
|
||||
<label>{`总计 ${this.props.boardList.length} 块板`}</label>
|
||||
</label>
|
||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||
<InputGroup className={"search"} type="search" placeholder="关键字查找..." dir="auto"
|
||||
onChange={(e) => { this.searchingStr = e.target.value; this.searchData() }}
|
||||
value={this.searchingStr} />
|
||||
|
||||
<Button
|
||||
text="查看选中板件"
|
||||
onClick={this.checkOutChosenBr}
|
||||
/>
|
||||
<Button
|
||||
text="显示同属性板件"
|
||||
onClick={this.checkOutSameTypeBr}
|
||||
/>
|
||||
<Button
|
||||
text="应用数据修改"
|
||||
onClick={() =>
|
||||
{
|
||||
store.OnOk(ModalState.Ok, { type: EFindType.Modify, cname: "_modify" })
|
||||
}} />
|
||||
<Button
|
||||
// 待补充
|
||||
text="修改选择板件的板材" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
#modal .br-lookover{
|
||||
height: 100%;
|
||||
max-height: 600px;
|
||||
width: 100%;
|
||||
.bp3-dialog-body {
|
||||
flex-direction: column;
|
||||
.bp3-input{
|
||||
width: 60px;
|
||||
}
|
||||
}
|
||||
.bp3-input.seal{
|
||||
width: 40px;
|
||||
}
|
||||
.flex{
|
||||
overflow: auto;
|
||||
.bp3-card:not(.title){
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding-top: 5px;
|
||||
height: 100%;
|
||||
}
|
||||
.title{
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
table {
|
||||
th{
|
||||
width:62px;//fixed width
|
||||
}
|
||||
th:nth-child(7){
|
||||
width: 71px;
|
||||
}
|
||||
th:nth-child(16),th:nth-child(17){
|
||||
width: 32px;
|
||||
}
|
||||
.bp3-dialog-body{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
import { BoardStore } from "./BoardStore";
|
||||
import { ModalState } from "../Components/Modal/ModalsManage";
|
||||
import { app } from "../../ApplicationServices/Application";
|
||||
import { observable } from "mobx";
|
||||
import { Board } from "../../DatabaseServices/Entity/Board";
|
||||
import { IBoardInfoOptions } from "../Components/Board/BoardInfosList";
|
||||
import { CheckObjectType, CheckoutValid } from "../../Common/CheckoutVaildValue";
|
||||
import { AppToaster } from "../Components/Toaster";
|
||||
export class LookOverBoardInfosStore extends BoardStore
|
||||
{
|
||||
@observable isClose: boolean = false;
|
||||
boardInfos: Map<Board, IBoardInfoOptions> = new Map();
|
||||
selectedBr: Board;
|
||||
@observable findSameTypeBrDataKey: string;
|
||||
async OnOk<T>(state: number, data?: T)
|
||||
{
|
||||
if (state === ModalState.Cancel)
|
||||
{
|
||||
app.Editor.ModalManage.Clear();
|
||||
app.Editor.ModalManage.EndCmd();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (let [br, opts] of this.boardInfos)
|
||||
{
|
||||
if (CheckoutValid.HasInvailValue(opts, CheckObjectType.BBS))
|
||||
{
|
||||
AppToaster.show({ message: "存在无效数值,请修正", timeout: 1000 });
|
||||
return;
|
||||
}
|
||||
}
|
||||
app.Editor.MaskManage.Clear();
|
||||
app.Editor.ModalManage.ToggleShow();
|
||||
await app.Editor.ModalManage.ExecCmd(data);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue