From d24ee3478006e4b8afbee27e99a4b02fbd43cf48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Wed, 8 Nov 2023 08:03:37 +0000 Subject: [PATCH] =?UTF-8?q?!2453=20=E6=96=B0=E5=A2=9E:=E5=95=86=E5=93=81?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=B1=85=E4=B8=AD,=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=93=81=E7=89=8C=E5=B1=9E=E6=80=A7=20Merge=20pull=20request?= =?UTF-8?q?=20!2453=20from=20=E6=9E=97=E4=B8=89/goods=5Fbrand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/twoD2threeD/Modals/Rec2Br.less | 5 -- .../twoD2threeD/R2BProcessComponent.tsx | 5 +- src/UI/Components/Board/BoardFindCommon.tsx | 7 +- src/UI/Components/Board/BoardProcessModal.tsx | 5 +- .../Modal/ModalStyle/BoardFind.less | 9 -- .../Modal/ModalStyle/BoardModal.less | 23 ----- .../Modal/ModalStyle/UpdateBoardInfo.less | 11 --- src/UI/Components/Modal/ModalsManage.ts | 5 ++ src/UI/Css/style.less | 49 +++++++++++ src/UI/MaterialEditor/GoodsList.tsx | 31 +++++-- src/UI/MaterialEditor/GoodsListDiv.tsx | 86 +++++++++++++++++++ src/UI/MaterialEditor/Material.less | 39 +-------- src/UI/MaterialEditor/MaterialLinkShop.tsx | 11 +-- 13 files changed, 180 insertions(+), 106 deletions(-) create mode 100644 src/UI/MaterialEditor/GoodsListDiv.tsx diff --git a/src/Add-on/twoD2threeD/Modals/Rec2Br.less b/src/Add-on/twoD2threeD/Modals/Rec2Br.less index 1ebb75b21..205d539cd 100644 --- a/src/Add-on/twoD2threeD/Modals/Rec2Br.less +++ b/src/Add-on/twoD2threeD/Modals/Rec2Br.less @@ -56,11 +56,6 @@ margin: 10px; } - .search-shop { - position: fixed; - transform: translate(-55%, 10%); - } - .roomName{ display: flex; diff --git a/src/Add-on/twoD2threeD/R2BProcessComponent.tsx b/src/Add-on/twoD2threeD/R2BProcessComponent.tsx index cbadc0e18..a6931af25 100644 --- a/src/Add-on/twoD2threeD/R2BProcessComponent.tsx +++ b/src/Add-on/twoD2threeD/R2BProcessComponent.tsx @@ -5,7 +5,8 @@ import * as React from 'react'; import { CheckObjectType } from "../../Common/CheckoutVaildValue"; import { userConfig } from '../../Editor/UserConfig'; import { Input5Or4Component, Notes, SetBoardDataBlock } from "../../UI/Components/Board/BoardCommon"; -import { GoodsList, IGoodInfo } from '../../UI/MaterialEditor/GoodsList'; +import { IGoodInfo } from '../../UI/MaterialEditor/GoodsList'; +import { GoodsListDiv } from "../../UI/MaterialEditor/GoodsListDiv"; import { SelectBrConfigName } from './R2BCommon'; import { GetOptionState } from './R2bConfigComponent'; import { Rec2BrStore } from './Rec2BrStore'; @@ -45,7 +46,7 @@ export class R2BProcessComponent extends React.Component this.showShops.set(true)} >选择 { - this.showShops.get() && diff --git a/src/UI/Components/Board/BoardFindCommon.tsx b/src/UI/Components/Board/BoardFindCommon.tsx index 1da22c262..db7e4bda9 100644 --- a/src/UI/Components/Board/BoardFindCommon.tsx +++ b/src/UI/Components/Board/BoardFindCommon.tsx @@ -5,7 +5,8 @@ import * as React from 'react'; import { EBoardKeyList } from '../../../Common/BoardKeyList'; import { CheckObjectType } from '../../../Common/CheckoutVaildValue'; import { safeEval } from '../../../Common/eval'; -import { GoodsList, IGoodInfo } from '../../MaterialEditor/GoodsList'; +import { IGoodInfo } from '../../MaterialEditor/GoodsList'; +import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv'; import { DRILL_KEYS, ECompareType, IBoardFindOption } from '../../Store/BoardFindInterface'; import { BoardFindStore } from '../../Store/BoardFindModifyStore'; import { AnyObject, IUiOption } from "../../Store/OptionInterface/IOptionInterface"; @@ -227,14 +228,14 @@ export class MatColorCom extends React.Component
- +
{ - this.showShops.get() && diff --git a/src/UI/Components/Board/BoardProcessModal.tsx b/src/UI/Components/Board/BoardProcessModal.tsx index 046a97b1b..85aa8449d 100644 --- a/src/UI/Components/Board/BoardProcessModal.tsx +++ b/src/UI/Components/Board/BoardProcessModal.tsx @@ -18,7 +18,8 @@ import { TemplateWineRackRecord } from '../../../DatabaseServices/Template/Progr import { CommandWrap } from '../../../Editor/CommandMachine'; import { PromptStatus } from '../../../Editor/PromptResult'; import { TempEditor } from '../../../Editor/TempEditor'; -import { GoodsList, IGoodInfo } from '../../MaterialEditor/GoodsList'; +import { IGoodInfo } from '../../MaterialEditor/GoodsList'; +import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv'; import { BoardProcessOption } from "../../Store/OptionInterface/BoardProcessOption"; import { IHightDrillOption, IUiOption } from "../../Store/OptionInterface/IOptionInterface"; import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore'; @@ -252,7 +253,7 @@ export class BoardProcessModal extends React.Component{ onClick={() => this.showShops.set(true)} >选择 { - this.showShops.get() && diff --git a/src/UI/Components/Modal/ModalStyle/BoardFind.less b/src/UI/Components/Modal/ModalStyle/BoardFind.less index 3615941cd..3b31290bc 100644 --- a/src/UI/Components/Modal/ModalStyle/BoardFind.less +++ b/src/UI/Components/Modal/ModalStyle/BoardFind.less @@ -94,15 +94,6 @@ .mat-color { position: relative; - .search-shop { - position: fixed; - transform: translate(-55%, -10%); - - input { - width: 100%; - } - } - &>div:first-child { &>div { display: flex; diff --git a/src/UI/Components/Modal/ModalStyle/BoardModal.less b/src/UI/Components/Modal/ModalStyle/BoardModal.less index 2d8d35f03..0ab74221a 100644 --- a/src/UI/Components/Modal/ModalStyle/BoardModal.less +++ b/src/UI/Components/Modal/ModalStyle/BoardModal.less @@ -254,29 +254,6 @@ input { width: 6.5rem; } - - .search-shop { - position : fixed; - transform: translate(-45%, -6%); - - input { - width: 100%; - } - - th{ - padding : auto; - text-align : center; - min-width : 55px; - vertical-align: middle; - - .th_goods_thick{ - display: flex; - align-items: center; - width : 44px; - margin: auto; - } - } - } } .br-mat>div>div:last-child { diff --git a/src/UI/Components/Modal/ModalStyle/UpdateBoardInfo.less b/src/UI/Components/Modal/ModalStyle/UpdateBoardInfo.less index bc7325c21..a250b2212 100644 --- a/src/UI/Components/Modal/ModalStyle/UpdateBoardInfo.less +++ b/src/UI/Components/Modal/ModalStyle/UpdateBoardInfo.less @@ -112,16 +112,5 @@ padding : 0; text-align: center; } - - .search-shop { - position: absolute; - left : 0; - top : 0; - right : auto; - - input { - width: 100%; - } - } } } diff --git a/src/UI/Components/Modal/ModalsManage.ts b/src/UI/Components/Modal/ModalsManage.ts index 26b5ab0f7..54dc58be3 100644 --- a/src/UI/Components/Modal/ModalsManage.ts +++ b/src/UI/Components/Modal/ModalsManage.ts @@ -75,6 +75,11 @@ export class ModalManage { return this._List.get(this._currentFocusKey); } + set CurrentModalKey(key: string) + { + if (key !== this._currentFocusKey) + this._currentFocusKey = key; + } get CurrentModalKey() { return this._currentFocusKey; diff --git a/src/UI/Css/style.less b/src/UI/Css/style.less index 535f4284b..738898e18 100644 --- a/src/UI/Css/style.less +++ b/src/UI/Css/style.less @@ -1526,3 +1526,52 @@ img { } } } + +#GoodsListDiv{ + .search-shop { + position : absolute; + z-index : 35; + padding : 10px; + font-size: 16px; + min-width: 1100px; + outline : 1px solid #ccc; + + input { + width: 100%; + } + + th{ + padding : auto; + text-align : center; + min-width : 55px; + vertical-align: middle; + + .th_goods_thick{ + display: flex; + align-items: center; + width : 44px; + margin: auto; + } + } + + .bp3-html-table.bp3-html-table-condensed td { + padding-top : 1.5px; + padding-bottom: 1.5px; + padding-right : 1.5px; + } + table { + margin-top: 5px; + width : 100%; + border : 1px #dbdcdd solid; + } + + .bp3-input-action { + top: 3px !important; + right: 3px; + } + + .pagination li { + padding-left: 11px; + } + } +} \ No newline at end of file diff --git a/src/UI/MaterialEditor/GoodsList.tsx b/src/UI/MaterialEditor/GoodsList.tsx index 8dd0c4752..e3a5a216d 100644 --- a/src/UI/MaterialEditor/GoodsList.tsx +++ b/src/UI/MaterialEditor/GoodsList.tsx @@ -1,4 +1,4 @@ -import { Card, HTMLTable, Icon, InputGroup } from '@blueprintjs/core'; +import { Button, Card, HTMLTable, Icon, InputGroup } from '@blueprintjs/core'; import { IObservableValue, observable } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; @@ -35,27 +35,38 @@ export class GoodsList extends React.Component { { this.handleSearch(); } + public render() { return ( - this.props.open.get() && <> - } /> +
+
+ } + /> +
+
编码 + 品牌 名称 规格 { specification: goods_spec, }; + //品牌 + let brand = v.goods_param.find(p => p.name === "品牌").value; + return this.props.select(info)} style={{ lineHeight: "normal" }} > {v.goods_sn} + {thick ? thick.value : ""} diff --git a/src/UI/MaterialEditor/GoodsListDiv.tsx b/src/UI/MaterialEditor/GoodsListDiv.tsx new file mode 100644 index 000000000..a5b3bbc85 --- /dev/null +++ b/src/UI/MaterialEditor/GoodsListDiv.tsx @@ -0,0 +1,86 @@ +import { IObservableValue } from 'mobx'; +import { observer } from 'mobx-react'; +import * as React from 'react'; +import ReactDOM from 'react-dom'; +import { begin } from 'xaop'; +import { app } from '../../ApplicationServices/Application'; +import { KeyBoard } from '../../Common/KeyEnum'; +import { GoodsList, IGoodInfo } from './GoodsList'; + +const GOODS_LIST_DIV_ID = "GoodsListDiv"; + +interface IGoodsListProps +{ + select: (good: IGoodInfo) => void; + open: IObservableValue; +} + +@observer +export class GoodsListDiv extends React.Component { + _Event: Function; + _StateContainer: HTMLElement; + _CurrentModalKey = ""; + + constructor(props) + { + super(props); + this._StateContainer = document.createElement('div'); + this._StateContainer.id = GOODS_LIST_DIV_ID; + this._StateContainer.style.zIndex = "36"; + document.getElementById('modal').appendChild(this._StateContainer); + + this._StateContainer.style.position = "absolute"; + + if (window.screen.width <= 1100) + this._StateContainer.style.left = '0px'; + else + this._StateContainer.style.left = `calc(50vw - 550px)`; + + if (window.screen.height <= 620) + this._StateContainer.style.top = `0px`; + else + this._StateContainer.style.top = `calc(50vh - 300px)`; + + + ReactDOM.render(, this._StateContainer); + } + + componentDidMount() + { + this._CurrentModalKey = app.Editor.ModalManage.CurrentModalKey; + app.Editor.ModalManage.CurrentModalKey = GOODS_LIST_DIV_ID; + + this._Event = begin(app.Editor.ModalManage, app.Editor.ModalManage.OnKeyDown, (e: KeyboardEvent) => + { + if (e.keyCode === KeyBoard.Escape) + { + app.Editor.ModalManage.stopKeyDownEvent = true; + e.stopPropagation(); + } + }); + } + + componentWillUnmount() + { + app.Editor.ModalManage.CurrentModalKey = this._CurrentModalKey; + document.getElementById('modal').removeChild(this._StateContainer); + this._StateContainer = undefined; + this._CurrentModalKey = ""; + if (this._Event) + { + this._Event(); + this._Event = null; + } + } + + public render() + { + return ( + <> + + ); + } +} diff --git a/src/UI/MaterialEditor/Material.less b/src/UI/MaterialEditor/Material.less index 31d0895bc..2af175429 100644 --- a/src/UI/MaterialEditor/Material.less +++ b/src/UI/MaterialEditor/Material.less @@ -134,41 +134,4 @@ height : 22px; } } - .search-shop { - position: fixed; - transform: translate(-70%, 55%); - } - -} - -.search-shop { - z-index : 35; - padding : 10px; - font-size: 16px; - width : 1000px; - outline : 1px solid #ccc; - - .bp3-html-table.bp3-html-table-condensed td { - padding-top : 1.5px; - padding-bottom: 1.5px; - padding-right : 1.5px; - } - - table { - margin-top: 5px; - width : 100%; - border : 1px #dbdcdd solid; - } - - input { - height: 2.5rem !important; - } - - .bp3-input-action { - top: 5px !important; - } - - .pagination li { - padding-left: 11px; - } -} +} \ No newline at end of file diff --git a/src/UI/MaterialEditor/MaterialLinkShop.tsx b/src/UI/MaterialEditor/MaterialLinkShop.tsx index de05ba730..c1240ac82 100644 --- a/src/UI/MaterialEditor/MaterialLinkShop.tsx +++ b/src/UI/MaterialEditor/MaterialLinkShop.tsx @@ -2,11 +2,12 @@ import { Button, Intent } from "@blueprintjs/core"; import { observable } from "mobx"; import { inject, observer } from "mobx-react"; import * as React from "react"; -import { MaterialStore } from "../Store/MaterialStore"; -import { GoodsList, IGoodInfo } from "./GoodsList"; -import { SetBoardDataBlock } from "../Components/Board/BoardCommon"; import { CheckObjectType } from "../../Common/CheckoutVaildValue"; +import { SetBoardDataBlock } from "../Components/Board/BoardCommon"; import { AppToaster } from "../Components/Toaster"; +import { MaterialStore } from "../Store/MaterialStore"; +import { IGoodInfo } from "./GoodsList"; +import { GoodsListDiv } from "./GoodsListDiv"; @inject('store') @observer @@ -35,7 +36,7 @@ export class MaterialLinkShopId extends React.Component<{ store?: MaterialStore; AppToaster.show({ message: "如果你将这个材质赋予到板件,我们会把材质的板材信息拷贝到板件中", timeout: 2500, - }); + }, "MaterialShopSelect"); }; componentDidMount() { @@ -64,7 +65,7 @@ export class MaterialLinkShopId extends React.Component<{ store?: MaterialStore; /> { - this.showShops.get() &&