!560 优化商品选择

pull/560/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 279c7369ee
commit a0630d10af

@ -49,7 +49,7 @@ Array [
3, 3,
1, 1,
"材质1", "材质1",
2, 3,
"#ffffff", "#ffffff",
false, false,
0.2, 0.2,
@ -64,6 +64,8 @@ Array [
true, true,
true, true,
"", "",
"",
"",
1, 1,
-1, -1,
0, 0,
@ -156,7 +158,7 @@ Array [
3, 3,
1, 1,
"材质1", "材质1",
2, 3,
"#ffffff", "#ffffff",
false, false,
0.2, 0.2,
@ -171,6 +173,8 @@ Array [
true, true,
true, true,
"", "",
"",
"",
"PhysicalMaterialRecord", "PhysicalMaterialRecord",
2, 2,
103, 103,
@ -178,7 +182,7 @@ Array [
3, 3,
1, 1,
"材质1(1)", "材质1(1)",
2, 3,
"#ffffff", "#ffffff",
false, false,
0.2, 0.2,
@ -193,6 +197,8 @@ Array [
true, true,
true, true,
"", "",
"",
"",
1, 1,
-1, -1,
0, 0,
@ -271,7 +277,7 @@ Array [
3, 3,
1, 1,
"材质1", "材质1",
2, 3,
"#ffffff", "#ffffff",
false, false,
0, 0,
@ -286,6 +292,8 @@ Array [
true, true,
true, true,
"", "",
"",
"",
1, 1,
-1, -1,
0, 0,

@ -269,7 +269,7 @@ export class BoardFindModify implements Command
break; break;
case EBoardKeyList.Mat: case EBoardKeyList.Mat:
br.BoardProcessOption[EBoardKeyList.Mat] = option[EBoardKeyList.Mat]; br.BoardProcessOption[EBoardKeyList.Mat] = option[EBoardKeyList.Mat];
br.BoardProcessOption[EBoardKeyList.BrMat] = option.brMat; br.BoardProcessOption[EBoardKeyList.BrMat] = option[EBoardKeyList.BrMat];
br.BoardProcessOption[EBoardKeyList.Color] = option[EBoardKeyList.Color]; br.BoardProcessOption[EBoardKeyList.Color] = option[EBoardKeyList.Color];
break; break;
case EBoardKeyList.DrillType: case EBoardKeyList.DrillType:
@ -365,7 +365,7 @@ export class BoardFindModify implements Command
option.brName = br.Name; option.brName = br.Name;
break; break;
case EBoardKeyList.Mat: case EBoardKeyList.Mat:
option.brMat = br.BoardProcessOption[EBoardKeyList.BrMat]; option[EBoardKeyList.BrMat] = br.BoardProcessOption[EBoardKeyList.BrMat];
option[EBoardKeyList.Mat] = br.BoardProcessOption[EBoardKeyList.Mat]; option[EBoardKeyList.Mat] = br.BoardProcessOption[EBoardKeyList.Mat];
option[EBoardKeyList.Color] = br.BoardProcessOption[EBoardKeyList.Color]; option[EBoardKeyList.Color] = br.BoardProcessOption[EBoardKeyList.Color];
break; break;

@ -10,4 +10,5 @@ export enum StoreageKeys
RoomName = "roomName", RoomName = "roomName",
LastOpenFileId = "lastfid", LastOpenFileId = "lastfid",
Uid = "uid", Uid = "uid",
Goods = "Goods_",
} }

@ -5,6 +5,14 @@ import { MaterialTableRecord } from "./MaterialTableRecord";
import { ObjectId } from "./ObjectId"; import { ObjectId } from "./ObjectId";
import { TextureTableRecord } from "./Texture"; import { TextureTableRecord } from "./Texture";
export interface IGoodProps
{
name: string;
material: string;
color: string;
}
@Factory @Factory
export class PhysicalMaterialRecord extends MaterialTableRecord export class PhysicalMaterialRecord extends MaterialTableRecord
{ {
@ -21,8 +29,11 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
useMap = true; useMap = true;
useBumpMap = true; useBumpMap = true;
useRoughnessMap = true; useRoughnessMap = true;
shopId = ""; private _goodsInfo: IGoodProps = {
name: "",
color: "",
material: "",
};
private material = new MeshPhysicalMaterial({}); private material = new MeshPhysicalMaterial({});
async Update() async Update()
{ {
@ -71,8 +82,15 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
{ {
return this.material; return this.material;
} }
get GoodsInfo()
{
return this._goodsInfo;
}
set GoodsInfo(info: IGoodProps)
{
this.WriteAllObjectRecord();
Object.assign(this._goodsInfo, info);
}
//#region -------------------------File------------------------- //#region -------------------------File-------------------------
ReadFile(file: CADFiler) ReadFile(file: CADFiler)
{ {
@ -93,14 +111,21 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
this.useMap = file.Read(); this.useMap = file.Read();
this.useBumpMap = file.Read(); this.useBumpMap = file.Read();
this.useRoughnessMap = file.Read(); this.useRoughnessMap = file.Read();
this.shopId = file.Read(); if (ver <= 2)
file.Read();
else
{
this._goodsInfo.name = file.Read();
this._goodsInfo.material = file.Read();
this._goodsInfo.color = file.Read();
}
this.Update(); this.Update();
} }
//对象将自身数据写入到文件. //对象将自身数据写入到文件.
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(2); file.Write(3);
file.Write(this.color); file.Write(this.color);
file.Write(this.transparent); file.Write(this.transparent);
file.Write(this.matalness); file.Write(this.matalness);
@ -114,7 +139,9 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
file.Write(this.useMap); file.Write(this.useMap);
file.Write(this.useBumpMap); file.Write(this.useBumpMap);
file.Write(this.useRoughnessMap); file.Write(this.useRoughnessMap);
file.Write(this.shopId); file.Write(this._goodsInfo.name);
file.Write(this._goodsInfo.material);
file.Write(this._goodsInfo.color);
} }
//#endregion //#endregion
} }

@ -5,6 +5,7 @@ import { IBoardFindOption, ECompareType } from "../UI/Store/BoardFindInterface";
import { ILatticeOption, ELatticeArrayType } from "../UI/Store/LatticeInterface"; import { ILatticeOption, ELatticeArrayType } from "../UI/Store/LatticeInterface";
import { HandleVePos, DoorPosType, HandleHorPos, IDrawerConfigOption } from "../UI/Store/DoorInterface"; import { HandleVePos, DoorPosType, HandleHorPos, IDrawerConfigOption } from "../UI/Store/DoorInterface";
import { CurtailType, IBoardBatchCurtailOption } from "../UI/Components/BoardBatchCurtailModal"; import { CurtailType, IBoardBatchCurtailOption } from "../UI/Components/BoardBatchCurtailModal";
import { EBoardKeyList } from "../Common/BoardKeyList";
export const DefaultLayerBoardConfig: LayerBoardOption = { export const DefaultLayerBoardConfig: LayerBoardOption = {
version: 1, version: 1,
@ -238,7 +239,7 @@ export const DefaultBoardFindOption: IBoardFindOption = {
roomName: "", roomName: "",
cabinetName: "", cabinetName: "",
brName: "", brName: "",
brMat: "", [EBoardKeyList.BrMat]: "",
material: "", material: "",
color: "", color: "",
lines: LinesType.Positive, lines: LinesType.Positive,
@ -389,5 +390,5 @@ export const DefaultLatticeConfig: ILatticeOption = {
isOpenCut: false, isOpenCut: false,
upCut: 0, upCut: 0,
downCut: 4, downCut: 4,
} };
Object.freeze(DefaultLatticeConfig); Object.freeze(DefaultLatticeConfig);

@ -4,7 +4,7 @@ import * as React from 'react';
import { CSSProperties } from 'react'; import { CSSProperties } from 'react';
import * as xaop from 'xaop'; import * as xaop from 'xaop';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { ImgsUrl, MaterialUrls } from '../../Common/HostUrl'; import { ImgsUrl, MaterialUrls, ShopUrls } from '../../Common/HostUrl';
import { Post, PostJson, RequestStatus } from '../../Common/Request'; import { Post, PostJson, RequestStatus } from '../../Common/Request';
import { deflate, MaterialOut } from '../../Common/SerializeMaterial'; import { deflate, MaterialOut } from '../../Common/SerializeMaterial';
import { PhysicalMaterialRecord } from '../../DatabaseServices/PhysicalMaterialRecord'; import { PhysicalMaterialRecord } from '../../DatabaseServices/PhysicalMaterialRecord';
@ -13,6 +13,10 @@ import { commandMachine } from '../../Editor/CommandMachine';
import { MaterialRendererSingle } from '../Editor/Asset/MaterialRenderer'; import { MaterialRendererSingle } from '../Editor/Asset/MaterialRenderer';
import { appUi } from '../Layout/ApplicationLayout'; import { appUi } from '../Layout/ApplicationLayout';
import { AppToaster } from './Toaster'; import { AppToaster } from './Toaster';
import { appCache } from '../../Common/AppCache';
import { StoreageKeys } from '../../Common/StoreageKeys';
import { Board } from '../../DatabaseServices/Entity/Board';
import { EBoardKeyList } from '../../Common/BoardKeyList';
//蓝图. //蓝图.
const RootStyle: CSSProperties = { const RootStyle: CSSProperties = {
@ -112,7 +116,11 @@ export class Asset extends React.Component<{ material: PhysicalMaterialRecord; }
let material = this.props.material as PhysicalMaterialRecord; let material = this.props.material as PhysicalMaterialRecord;
for (let en of app.Editor.SelectCtrl.SelectSet.SelectEntityList) for (let en of app.Editor.SelectCtrl.SelectSet.SelectEntityList)
{ {
en.Material = material.Id; if (en instanceof Board)
{
en.Material = material.Id;
ApplyGoodInfo(en, material);
}
} }
app.Viewer.UpdateRender(); app.Viewer.UpdateRender();
@ -197,3 +205,10 @@ export class Asset extends React.Component<{ material: PhysicalMaterialRecord; }
); );
} }
} }
export function ApplyGoodInfo(en: Board, material: PhysicalMaterialRecord)
{
en.BoardProcessOption[EBoardKeyList.BrMat] = material.GoodsInfo.name;
en.BoardProcessOption[EBoardKeyList.Color] = material.GoodsInfo.color;
en.BoardProcessOption[EBoardKeyList.Mat] = material.GoodsInfo.material;
}

@ -13,6 +13,7 @@ import { observable } from 'mobx';
import { LinesType, FaceDirection, ComposingType, DrillType } from '../../Store/BoardInterface'; import { LinesType, FaceDirection, ComposingType, DrillType } from '../../Store/BoardInterface';
import { userConfig } from '../../../Editor/UserConfig'; import { userConfig } from '../../../Editor/UserConfig';
import { BoardDirectionIcon } from './BoardCommon'; import { BoardDirectionIcon } from './BoardCommon';
import { GoodsList, IGoodInfo } from '../../MaterialEditor/GoodsList';
interface IBoardFindState interface IBoardFindState
{ {
@ -26,6 +27,7 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
["左侧板", false], ["右侧板", false], ["顶板", false], ["底板", false], ["左侧板", false], ["右侧板", false], ["顶板", false], ["底板", false],
["层板", false], ["背板", false], ["地脚线", false], ["层板", false], ["背板", false], ["地脚线", false],
]; ];
private showShops = observable.box(false);
constructor(props) constructor(props)
{ {
super(props); super(props);
@ -93,6 +95,14 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
}); });
this.setState({ userInputName: name }); this.setState({ userInputName: name });
}; };
private handleSelectGoods = (good: IGoodInfo) =>
{
const option = this.props.store.m_Option;
option[EBoardKeyList.BrMat] = good.name;
option[EBoardKeyList.Mat] = good.material;
option[EBoardKeyList.Color] = good.color;
this.showShops.set(false);
};
render() render()
{ {
const store = this.props.store; const store = this.props.store;
@ -114,6 +124,10 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
["房名", EBoardKeyList.RoomName], ["柜名", EBoardKeyList.CabinetName], ["房名", EBoardKeyList.RoomName], ["柜名", EBoardKeyList.CabinetName],
]; ];
const selectOptions = userConfig.DrillConfigs.size > 0 ? [...userConfig.DrillConfigs.keys(), "不排"] : []; const selectOptions = userConfig.DrillConfigs.size > 0 ? [...userConfig.DrillConfigs.keys(), "不排"] : [];
if (option.highDrill.length !== 4)
option.highDrill.push(...Array(4).fill(selectOptions[0]));
return ( return (
<div <div
className={Classes.DIALOG_CONTAINER} className={Classes.DIALOG_CONTAINER}
@ -474,7 +488,7 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
<HTMLSelect <HTMLSelect
options={["=", "!="]} options={["=", "!="]}
/> />
<input className={Classes.INPUT} value={option.brMat} /> <input className={Classes.INPUT} value={option[EBoardKeyList.BrMat]} onChange={e => option[EBoardKeyList.BrMat] = e.target.value} />
</div> </div>
<div> <div>
<Checkbox <Checkbox
@ -490,23 +504,27 @@ export default class BoardFindModifyModal extends React.Component<{ store?: Boar
<HTMLSelect <HTMLSelect
options={["=", "!="]} options={["=", "!="]}
/> />
<input className={Classes.INPUT} value={option[EBoardKeyList.Mat]} /> <input className={Classes.INPUT} value={option[EBoardKeyList.Mat]} onChange={e => option[EBoardKeyList.Mat] = e.target.value} />
</div> </div>
<div> <div>
<span></span> <span></span>
<HTMLSelect <HTMLSelect
options={["=", "!="]} options={["=", "!="]}
/> />
<input className={Classes.INPUT} value={option[EBoardKeyList.Color]} /> <input className={Classes.INPUT} value={option[EBoardKeyList.Color]} onChange={e => option[EBoardKeyList.Color] = e.target.value} />
</div> </div>
</div> </div>
<div className="flex"> <div className="flex">
<Button intent={Intent.PRIMARY}></Button> <Button intent={Intent.PRIMARY} onClick={() => this.showShops.set(true)}></Button>
<Button <Button
intent={Intent.PRIMARY} intent={Intent.PRIMARY}
onClick={() => this.getBoardOption(EBoardKeyList.Mat, "选择板件获取板材信息")} onClick={() => this.getBoardOption(EBoardKeyList.Mat, "选择板件获取板材信息")}
></Button> ></Button>
</div> </div>
<GoodsList
open={this.showShops}
select={this.handleSelectGoods}
/>
</div> </div>
<BoardFindSelectItem <BoardFindSelectItem
useKey="lines" useKey="lines"

@ -14,6 +14,8 @@ import { DrillingOption } from '../../Store/drillInterface';
import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore'; import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore';
import { RightTabId } from '../RightPanel/RightPanel'; import { RightTabId } from '../RightPanel/RightPanel';
import { DrillTypeSelectCom, Input5Or4Component, SetBoardDataBlock, SetBoardDataItem } from './BoardCommon'; import { DrillTypeSelectCom, Input5Or4Component, SetBoardDataBlock, SetBoardDataItem } from './BoardCommon';
import { GoodsList, IGoodInfo } from '../../MaterialEditor/GoodsList';
import { PhysicalMaterialRecord } from '../../../DatabaseServices/PhysicalMaterialRecord';
interface BoardProcessProps interface BoardProcessProps
{ {
@ -23,6 +25,8 @@ interface BoardProcessProps
} }
@observer @observer
export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
private showShops = observable.box(false);
private container: HTMLDivElement;
private matPars = [ private matPars = [
["boardName", "板材名"], ["material", "材料"], ["color", "颜色"] ["boardName", "板材名"], ["material", "材料"], ["color", "颜色"]
]; ];
@ -85,15 +89,35 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
} }
app.Editor.ModalManage.ToggleShow(); app.Editor.ModalManage.ToggleShow();
}; };
private selectGoods = (good: IGoodInfo) =>
{
this.props.opt[EBoardKeyList.BrMat] = good.name;
this.props.opt[EBoardKeyList.Mat] = good.material;
this.props.opt[EBoardKeyList.Color] = good.color;
if (this.props.br && this.props.br.Material)
{
let mat = this.props.br.Material.Object as PhysicalMaterialRecord;
mat.GoodsInfo = {
name: good.name,
material: good.material,
color: good.color,
};
}
this.showShops.set(false);
};
async UNSAFE_componentWillMount() async UNSAFE_componentWillMount()
{ {
this.drillConfigs = userConfig.DrillConfigs; this.drillConfigs = userConfig.DrillConfigs;
} }
componentDidMount()
{
this.container.addEventListener('keydown', e => e.stopPropagation());
}
render() render()
{ {
let isShowHighEditor = Boolean(this.props.br); let isShowHighEditor = Boolean(this.props.br);
return ( return (
<div className="board-info"> <div className="board-info" ref={el => this.container = el}>
{ {
this.renderEl() this.renderEl()
} }
@ -104,7 +128,14 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
option={this.props.opt} option={this.props.opt}
isInline={true} isInline={true}
/> />
<button className="bp3-button bp3-intent-success"></button> <button
className="bp3-button bp3-intent-success"
onClick={() => this.showShops.set(true)}
></button>
<GoodsList
open={this.showShops}
select={this.selectGoods}
/>
</div> </div>
<div> <div>
<label className="bp3-label bp3-inline .modifier"> <label className="bp3-label bp3-inline .modifier">

@ -150,7 +150,6 @@ export class DoorModal extends React.Component<{ store?: DoorDrawerStore, type:
private startSelectTemplate = () => private startSelectTemplate = () =>
{ {
this.startSelect.set(true); this.startSelect.set(true);
document.getElementById("modal").style.overflow = "visible";
} }
private changeTemplateProps = (parName: string, val: string) => private changeTemplateProps = (parName: string, val: string) =>
{ {

@ -90,7 +90,6 @@ export class MaterialContainer extends React.Component<MaterialContainerProps, {
logo: logoPath, logo: logoPath,
file: deflate(materialJson), file: deflate(materialJson),
zip_type: "gzip", zip_type: "gzip",
goods_id: material.shopId,
}); });
if (data.err_code === RequestStatus.Ok) if (data.err_code === RequestStatus.Ok)
{ {

@ -1,7 +1,7 @@
import { ContextMenu, Menu, MenuItem, Icon } from '@blueprintjs/core'; import { ContextMenu, Menu, MenuItem, Icon } from '@blueprintjs/core';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
import { Asset } from './Asset'; import { Asset, ApplyGoodInfo } from './Asset';
import { MaterialTable } from '../../DatabaseServices/MaterialTable'; import { MaterialTable } from '../../DatabaseServices/MaterialTable';
import { PhysicalMaterialRecord } from '../../DatabaseServices/PhysicalMaterialRecord'; import { PhysicalMaterialRecord } from '../../DatabaseServices/PhysicalMaterialRecord';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
@ -64,7 +64,10 @@ export class MaterialExplorer extends React.Component<{ materialTable: MaterialT
{ {
let en = GetEntity(o); let en = GetEntity(o);
if (en && en instanceof Board) if (en && en instanceof Board)
{
en.Material = material.Id; en.Material = material.Id;
ApplyGoodInfo(en, material);
}
} }
app.Editor.UpdateScreen(); app.Editor.UpdateScreen();
commandMachine.CommandEnd(); commandMachine.CommandEnd();

@ -1,59 +1,74 @@
#modal .br-find{ #modal .br-find {
@selectWidth:50px; @selectWidth: 50px;
@width:70px; @width: 70px;
@inputWidth:75px; @inputWidth: 75px;
@buttonWidth:90px; @buttonWidth: 90px;
.bp3-dialog-body{
&>div:first-child{ .bp3-dialog-body {
&>div:first-child {
width: 390px; width: 390px;
padding-right: 10px; padding-right: 10px;
} }
&>div:last-child{
&>div:last-child {
width: 300px; width: 300px;
} }
.br-find-item{
.br-find-item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
&>label{
&>label {
width: 60px; width: 60px;
margin: 0; margin: 0;
} }
&>input,&>div{
&>input,
&>div {
margin: 0 5px; margin: 0 5px;
width: 20%; width: 20%;
} }
&>.bp3-html-select:nth-child(2){
&>.bp3-html-select:nth-child(2) {
width: @selectWidth; width: @selectWidth;
margin: 0 5px; margin: 0 5px;
} }
&>button{
&>button {
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
min-height: 20px; min-height: 20px;
padding: 0 10px; padding: 0 10px;
} }
} }
.br-find-item.small{
&>label{ .br-find-item.small {
&>label {
width: @width; width: @width;
} }
&>input{
&>input {
width: @inputWidth; width: @inputWidth;
} }
&>button{
flex:1; &>button {
} flex: 1;
&>.select-name{ }
flex:1;
&>.select-name {
flex: 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 0; margin: 0;
&>span{
&>span {
height: 20px; height: 20px;
width: 40px; width: 40px;
} }
&>button,& .bp3-popover-target>button{
&>button,
& .bp3-popover-target>button {
width: 40px; width: 40px;
white-space: nowrap; white-space: nowrap;
height: 20px; height: 20px;
@ -61,87 +76,122 @@
min-height: 20px; min-height: 20px;
padding: 0 10px; padding: 0 10px;
} }
& .bp3-popover-content input{
& .bp3-popover-content input {
display: block; display: block;
width: 100%; width: 100%;
height: 30px; height: 30px;
margin: 10px 0; margin: 10px 0;
} }
} }
} }
.mat-color{
&>div:first-child{ .mat-color {
&>div{ position: relative;
.search-shop {
position: absolute;
right: 0;
top: 10px;
input {
width: 100%;
}
}
&>div:first-child {
&>div {
display: flex; display: flex;
&>label{
&>label {
margin: 0; margin: 0;
width: @width; width: @width;
} }
&>span{
&>span {
padding-left: 26px; padding-left: 26px;
width: @width; width: @width;
} }
&>input{
&>input {
width: @inputWidth; width: @inputWidth;
margin: 0 5px; margin: 0 5px;
} }
&>.bp3-html-select{
&>.bp3-html-select {
width: @selectWidth; width: @selectWidth;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
} }
} }
} }
&>button{
&>button {
flex: 1; flex: 1;
} }
} }
} }
.select-ent{
.select-ent {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
&>label{
&>label {
width: 20%; width: 20%;
margin: 0; margin: 0;
} }
} }
.find-select-item{
.find-select-item {
display: flex; display: flex;
&>label{
&>label {
width: 25%; width: 25%;
} }
&>div:nth-child(2){
&>div:nth-child(2) {
width: @selectWidth; width: @selectWidth;
} }
&>div:last-child{
&>div:last-child {
flex: 1; flex: 1;
margin-left: 10px; margin-left: 10px;
} }
} }
.find-sealed{
.find-sealed {
text-align: center; text-align: center;
&>div label{
&>div label {
margin-right: 0; margin-right: 0;
margin-left:10px; margin-left: 10px;
position: relative; position: relative;
} }
&>div:first-child,&>div:nth-child(2),&>div:nth-child(3){
label{ &>div:first-child,
&>div:nth-child(2),
&>div:nth-child(3) {
label {
top: 1px; top: 1px;
} }
} }
&>div>input,&>div>div>input{
&>div>input,
&>div>div>input {
width: 30px; width: 30px;
padding: 0 2px; padding: 0 2px;
margin-right: 5px; margin-right: 5px;
} }
.all-sealed{
.all-sealed {
position: absolute; position: absolute;
} }
.select-drillType{
.select-drillType {
vertical-align: baseline; vertical-align: baseline;
} }
&>.flex-center{
&>.flex-center {
align-items: center; align-items: center;
} }
} }

@ -1,37 +1,46 @@
#commonModal .bp3-dialog-body{ #commonModal .bp3-dialog-body {
.bp3-select>select{ .bp3-select>select {
width: @inputWidth; width: @inputWidth;
} }
.long-select>.bp3-select>select{
width: @infoSelectWidth .long-select>.bp3-select>select {
} width: @infoSelectWidth
.board-info>.bp3-label input{ }
.board-info>.bp3-label input {
width: @infoSelectWidth; width: @infoSelectWidth;
} }
.board-info{
select,.br-set input{ .board-info {
select,
.br-set input {
width: @infoSelectWidth; width: @infoSelectWidth;
} }
.br-set input{
.br-set input {
margin-left: 5px; margin-left: 5px;
} }
} }
} }
#commonModal .notes { #commonModal .notes {
.bp3-input{ .bp3-input {
height: @noteInputHeight; height: @noteInputHeight;
} }
.bp3-label{
.bp3-label {
line-height: @noteInputHeight; line-height: @noteInputHeight;
} }
} }
//背板延伸数据 //背板延伸数据
#commonModal .process-data .br-set input{ #commonModal .process-data .br-set input {
display: block; display: block;
} }
/* 板件模型设置 */ /* 板件模型设置 */
#commonModal .boardModel{ #commonModal .boardModel {
display: inline-block; display: inline-block;
width: 35px; width: 35px;
height: 50px; height: 50px;
@ -39,137 +48,181 @@
vertical-align: middle; vertical-align: middle;
margin: 10px; margin: 10px;
} }
#commonModal .boardSize .bp3-label,#commonModal .behind-board .board-info .boardSize .bp3-input{
#commonModal .boardSize .bp3-label,
#commonModal .behind-board .board-info .boardSize .bp3-input {
display: inline-block; display: inline-block;
margin: 0 5px; margin: 0 5px;
} }
#commonModal{
.boardSize{ #commonModal {
.boardSize {
min-width: 151px; min-width: 151px;
} }
.select-drillType{
.select-drillType {
flex: 1; flex: 1;
} }
} }
#commonModal .board-info .boardSize .bp3-input{
#commonModal .board-info .boardSize .bp3-input {
width: 30px; width: 30px;
} }
#commonModal .boardSize .bp3-inline{
#commonModal .boardSize .bp3-inline {
line-height: 15px; line-height: 15px;
} }
#commonModal .boardSize .bp3-label>.bp3-input{
#commonModal .boardSize .bp3-label>.bp3-input {
display: block; display: block;
padding: 0; padding: 0;
padding-left: 5px; padding-left: 5px;
line-height: 15px; line-height: 15px;
} }
#commonModal .input-select>input, #commonModal .input-select span {
#commonModal .input-select>input,
#commonModal .input-select span {
margin: 0; margin: 0;
} }
#commonModal .behind-board{
#commonModal .behind-board {
display: flex; display: flex;
} }
/* 板材信息 */ /* 板材信息 */
#commonModal{ #commonModal {
.bp3-input,.lr-br .bp3-input{
.bp3-input,
.lr-br .bp3-input {
width: @inputWidth; width: @inputWidth;
} }
.boardSize .bp3-input{
.boardSize .bp3-input {
width: 3rem; width: 3rem;
} }
} }
//板名称输入框大小 //板名称输入框大小
#modal #commonModal .bp3-dialog-body .br-name{ #modal #commonModal .bp3-dialog-body .br-name {
width: @nameInput; width: @nameInput;
} }
/* 排孔选项 */ /* 排孔选项 */
#commonModal .hole{ #commonModal .hole {
margin-left: 0.5rem; margin-left: 0.5rem;
} }
#commonModal .hole>label{
#commonModal .hole>label {
display: inline-block; display: inline-block;
margin-right: 1rem; margin-right: 1rem;
} }
/* 备注信息 */ /* 备注信息 */
#commonModal .notes{ #commonModal .notes {
width: 20vmin; width: 20vmin;
} }
#commonModal .notes>div{
#commonModal .notes>div {
display: flex; display: flex;
} }
#commonModal .notes>div>label{
#commonModal .notes>div>label {
height: @noteInputHeight; height: @noteInputHeight;
line-height: @noteInputHeight; line-height: @noteInputHeight;
} }
#commonModal .notes>div>label:first-child ,#commonModal .notes>div>input:first-child{
#commonModal .notes>div>label:first-child,
#commonModal .notes>div>input:first-child {
width: 30%; width: 30%;
} }
#commonModal .notes>div>label:last-child ,#commonModal .notes>div>input:last-child{
#commonModal .notes>div>label:last-child,
#commonModal .notes>div>input:last-child {
width: 70%; width: 70%;
} }
#commonModal .notes>div input:hover{
#commonModal .notes>div input:hover {
background: #ccc; background: #ccc;
} }
//选择材质 //选择材质
#commonModal .bp3-dialog-body .board-info{ #commonModal .bp3-dialog-body .board-info {
.br-mat{ .br-mat {
margin-bottom:0.5rem; position: relative;
margin-bottom: 0.5rem;
// justify-content: space-between; // justify-content: space-between;
button{ button {
width: 2rem; width: 2rem;
} }
input{
input {
width: 6.5rem; width: 6.5rem;
} }
.search-shop {
position: absolute;
right: 0;
top: 20px;
input {
width: 100%;
}
}
} }
.br-mat>div>div:last-child{ .br-mat>div>div:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
#commonModal > .board-config .bp3-dialog-footer { #commonModal>.board-config .bp3-dialog-footer {
justify-content: flex-end; justify-content: flex-end;
} }
#commonModal > .board-config{ #commonModal>.board-config {
.bp3-input,.bp3-select>select{
.bp3-input,
.bp3-select>select {
width: 5.5rem; width: 5.5rem;
} }
} }
#commonModal .edge-sealing span>button{ #commonModal .edge-sealing span>button {
height: 14px; height: 14px;
font-size: 7px; font-size: 7px;
width: 6rem; width: 6rem;
padding-top: 0px; padding-top: 0px;
padding-bottom: 0px; padding-bottom: 0px;
min-height: 14px; min-height: 14px;
} }
#commonModal .edge-sealing{
#commonModal .edge-sealing {
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
align-items: center; align-items: center;
ul{
ul {
padding: 10px; padding: 10px;
} }
.bp3-input{
.bp3-input {
width: 10rem; width: 10rem;
} }
} }
#commonModal .bp3-dialog-body .option-header{
#commonModal .bp3-dialog-body .option-header {
width: 15rem; width: 15rem;
&>select{
&>select {
height: 2rem; height: 2rem;
} }
.bp3-icon{
.bp3-icon {
top: 4px; top: 4px;
} }
} }
#commonModal .tb-check-input input{ #commonModal .tb-check-input input {
width: 45px; width: 45px;
} }

@ -47,7 +47,7 @@ export class ModalManage
private m_IsModal: boolean = false; private m_IsModal: boolean = false;
private m_IsMinimize: boolean = true; private m_IsMinimize: boolean = true;
events: Function[] = []; events: Function[] = [];
private m_ModalOldPosition: { left: string, top: string } = { left: "0", top: "0" }; private m_ModalOldPosition: { left: string, top: string; } = { left: "0", top: "0" };
private minimizeEl: HTMLElement = null; private minimizeEl: HTMLElement = null;
private originDialogDisplayVal: string = "flex"; private originDialogDisplayVal: string = "flex";
@ -159,7 +159,7 @@ export class ModalManage
RenderModeless(Component: any, pos: ModalPosition, props?: any, resizable = false, isMinimize = true) RenderModeless(Component: any, pos: ModalPosition, props?: any, resizable = false, isMinimize = true)
{ {
this.m_IsMinimize = isMinimize; this.m_IsMinimize = isMinimize;
this.m_ModalContainer.style.overflow = resizable ? "unset" : "hidden"; // this.m_ModalContainer.style.overflow = resizable ? "unset" : "hidden";
app.Editor.MaskManage.ShowMask(); app.Editor.MaskManage.ShowMask();
this.m_ModalContainer.focus(); this.m_ModalContainer.focus();
ReactDOM.render( ReactDOM.render(

@ -13,23 +13,10 @@ export class DisplayConfigPanel extends React.Component<{ store: ConfigStore }>
{ {
@observable private _OpenColorPick = false; @observable private _OpenColorPick = false;
@observable _AAType = "性能"; @observable _AAType = "性能";
private _observerOpenColor: Function;
UNSAFE_componentWillMount() UNSAFE_componentWillMount()
{ {
this._AAType = app.Viewer.AAType === AAType.FXAA ? "性能" : "质量"; this._AAType = app.Viewer.AAType === AAType.FXAA ? "性能" : "质量";
} }
componentDidMount()
{
let modal = document.getElementById('modal');
this._observerOpenColor = autorun(() =>
{
modal.style.overflow = this._OpenColorPick ? "visible" : "hidden";
})
}
componentWillUnmount()
{
this._observerOpenColor();
}
handleChangeColor = (color: ColorResult) => handleChangeColor = (color: ColorResult) =>
{ {
this.props.store.bgColor = color.hex; this.props.store.bgColor = color.hex;

@ -0,0 +1,144 @@
import * as React from 'react';
import { observable, IObservableValue } from 'mobx';
import { InputGroup, Icon, Classes } from '@blueprintjs/core';
import { RequestStatus, PostJson } from '../../Common/Request';
import { ShopUrls } from '../../Common/HostUrl';
import { appCache } from '../../Common/AppCache';
import { StoreageKeys } from '../../Common/StoreageKeys';
import { Pagination } from '../Components/SourceManage/Pagination';
import { observer } from 'mobx-react';
import { KeyBoard } from '../../Common/KeyEnum';
export interface IGoodInfo
{
goods_id: string;
name: string;
color: string,
material: string,
}
interface IGoodsListProps
{
select: (good: IGoodInfo) => void;
open: IObservableValue<boolean>;
}
@observer
export class GoodsList extends React.Component<IGoodsListProps> {
private timeId: NodeJS.Timeout;
@observable searchStr = "";
@observable goods = [];
@observable info = {
count: 0,
currentPage: 1,
pageCount: 20
}
UNSAFE_componentWillMount()
{
this.handleSearch();
}
public render()
{
return (
this.props.open.get() &&
<>
<div className="search-shop"
tabIndex={-1}
onKeyUp={this.handleKeyDown}
>
<InputGroup
placeholder="搜索要关联的商品"
value={this.searchStr}
onChange={this.handleChange}
autoFocus
rightElement={<Icon icon="double-caret-vertical" />} />
<div className="title">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<ul className={Classes.LIST_UNSTYLED}>
{
this.goods.map(v =>
{
let mat = v.goods_param.find(p => p.name === "材料");
let color = v.goods_param.find(p => p.name === "颜色");
let thick = v.goods_param.find(p => p.name === "厚");
let matName = mat ? mat.value : "";
let colorName = color ? color.value : "";
let info = {
goods_id: v.goods_id,
name: v.goods_name,
color: colorName,
material: matName,
}
appCache.set(StoreageKeys.Goods + v.goods_id, info);
return <li
value={v.goods_id}
onClick={() => this.props.select(info)}
>
<span>{v.goods_sn}</span>
<span>{v.goods_name}</span>
<span>{thick ? thick.value : ""}</span>
<span>{matName}</span>
<span>{colorName}</span>
<span>{v.goods_stock}</span>
</li>
})
}
</ul>
{
this.info.count > 20 &&
<Pagination
pageData={this.info}
getImgListFun={this.handleSearch}
/>
}
</div>
<div className="masking" onClick={this.handleHideSelect}></div>
</>
);
}
handleChange = (e: React.ChangeEvent<HTMLInputElement>) =>
{
this.searchStr = e.target.value;
if (this.timeId)
clearTimeout(this.timeId);
this.timeId = setTimeout(async () =>
{
await this.handleSearch();
}, 500);
};
handleSearch = async (opt: { curr_page: number } = { curr_page: 1 }) =>
{
this.info.currentPage = opt.curr_page;
let data = await PostJson(ShopUrls.get, {
...opt,
goods_name: this.searchStr,
bind_type: 1,
goods_type: 1,
});
if (data.err_code === RequestStatus.Ok)
{
this.info.count = data.count;
observable(this.goods).replace(data.goods);
}
};
private handleKeyDown = (e: React.KeyboardEvent) =>
{
if (e.keyCode === KeyBoard.Escape)
{
this.handleHideSelect();
}
}
private handleHideSelect = () =>
{
this.props.open.set(false);
}
}

@ -1,83 +1,99 @@
//材质球编辑器 样式文件. //材质球编辑器 样式文件.
#modal{ #modal {
.texture-list{ .texture-list {
height: calc(~"100% - 50px"); height: calc(~"100% - 50px");
display: flex; display: flex;
padding: 0; padding: 0;
&>div:first-child{
&>div:first-child {
width: 160px; width: 160px;
} }
&>div:last-child{
flex:1; &>div:last-child {
flex: 1;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-content: flex-start; align-content: flex-start;
overflow: auto; overflow: auto;
h5{
h5 {
width: 100%; width: 100%;
} }
} }
&>div>div{
text-align: center; &>div>div {
margin-right: 10px; text-align: center;
margin-bottom: 10px; margin-right: 10px;
height: 150px; margin-bottom: 10px;
position: relative; height: 150px;
box-shadow: none; position: relative;
padding: 0; box-shadow: none;
.editor-content{ padding: 0;
&>label{
.editor-content {
&>label {
display: flex;
&>span {
text-align: left;
margin-right: 20px;
}
&>div {
display: flex; display: flex;
&>span{ margin: 0;
text-align: left; justify-content: space-between;
margin-right: 20px;
} &>label {
&>div{
display: flex; display: flex;
margin: 0;
justify-content: space-between; span {
&>label{ width: 20px;
display: flex; }
span{
width: 20px; input {
} width: 60px;
input{
width:60px;
}
} }
} }
} }
} }
.delete-btn{ }
position: absolute;
top: 0; .delete-btn {
right: 0; position: absolute;
svg{ top: 0;
color: #000; right: 0;
}
svg {
color: #000;
} }
} }
}
} }
.select-img{
.select-img {
z-index: 60; z-index: 60;
} }
//不需要拖拽大小 //不需要拖拽大小
.lm_splitter{ .lm_splitter {
display: none; display: none;
} }
} }
.img-select-hint{ .img-select-hint {
position: relative; position: relative;
user-select: none; user-select: none;
overflow: hidden; overflow: hidden;
} }
.img-select-hint:hover{
.img-select-hint:hover {
cursor: pointer; cursor: pointer;
} }
.img-select-hint:hover:before{
.img-select-hint:hover:before {
content: "双击选择图片"; content: "双击选择图片";
position: absolute; position: absolute;
left: 0; left: 0;
@ -91,20 +107,26 @@
z-index: 33; z-index: 33;
} }
.select-shop{ .select-shop {
margin: 3px; margin: 3px;
display:flex; display: flex;
align-items: center; align-items: center;
&>span{
&>span {
width: 60px; width: 60px;
} }
&>div{
button{ & .br-set {
height: 22px; margin-bottom: 0 !important;
min-height: 22px; }
padding: 0 10px;
} & .br-set>span:first-child {
input{ display: inline-block;
width: 60px !important;
}
&>div {
input {
vertical-align: middle; vertical-align: middle;
background: #fff; background: #fff;
border: none; border: none;
@ -112,22 +134,56 @@
height: 22px; height: 22px;
} }
} }
.search-shop{
position: absolute;
top: 60px; }
right: 30px;
z-index: 35; .search-shop {
padding: 10px; position: fixed;
background: rgb(48, 64, 77); top: 112px;
font-size: 16px; right: 30px;
input{ z-index: 35;
height: 2.5rem !important; padding: 10px;
} background: #fff;
.bp3-input-action{ font-size: 16px;
top:5px !important; width: 740px;
outline: 1px solid #ccc;
.title {
display: flex;
span {
width: 25%;
background: #ccc;
padding: 5px 5px;
} }
li:hover{ }
background: rgb(26, 128, 191)
ul>li {
display: flex;
span {
width: 25%;
overflow: hidden;
text-overflow: ellipsis;
outline: 1px solid #ccc;
white-space: nowrap;
} }
} }
input {
height: 2.5rem !important;
}
.bp3-input-action {
top: 5px !important;
}
li:hover {
background: rgb(26, 128, 191)
}
.pagination li {
padding-left: 11px;
}
} }

@ -1,91 +1,60 @@
import { Button, Classes, Icon, InputGroup, Intent } from "@blueprintjs/core"; import { Button, Intent } from "@blueprintjs/core";
import { observable } from "mobx"; import { observable } from "mobx";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { PostJson, RequestStatus } from "../../Common/Request";
import { MaterialStore } from "../Store/MaterialStore"; import { MaterialStore } from "../Store/MaterialStore";
import { ShopUrls } from "../../Common/HostUrl"; import { GoodsList, IGoodInfo } from "./GoodsList";
interface ICreateMaterialState import { SetBoardDataBlock } from "../Components/Board/BoardCommon";
{ import { CheckObjectType } from "../../Common/CheckoutVaildValue";
showShops: boolean; import { AppToaster } from "../Components/Toaster";
searchStr: string;
}
@inject('store') @inject('store')
@observer @observer
export class MaterialLinkShopId extends React.Component<{ store?: MaterialStore; }, ICreateMaterialState> export class MaterialLinkShopId extends React.Component<{ store?: MaterialStore; }, {}>
{ {
@observable goods = []; private showShops = observable.box(false);
private timeId = null; private container: HTMLElement;
private closeTimeId = null; private matPars = [
["name", "板材名"], ["material", "材料"], ["color", "颜色"]
];
constructor(props) constructor(props)
{ {
super(props); super(props);
this.state = {
showShops: false,
searchStr: "",
};
} }
handleOpenShopList = async () => handleOpenShopList = async () =>
{ {
this.setState({ showShops: true }); this.showShops.set(true);
await this.handleSearch();
}; };
handleChange = (e: React.ChangeEvent<HTMLInputElement>) => handleSelectGood = (good: IGoodInfo) =>
{ {
this.setState({ searchStr: e.target.value });
if (this.timeId)
clearTimeout(this.timeId);
this.timeId = setTimeout(async () =>
{
await this.handleSearch();
}, 500);
};
handleSearch = async () =>
{
let data = await PostJson(ShopUrls.get, {
goods_name: this.state.searchStr,
bind_type: 1
});
if (data.err_code === RequestStatus.Ok)
{
observable(this.goods).replace(data.goods);
}
};
handleSelectGood = (good) =>
{
if (this.closeTimeId)
clearTimeout(this.closeTimeId);
const store = this.props.store; const store = this.props.store;
store.shopInfo.name = good.goods_name; store.goodsInfo.name = good.name;
store.shopInfo.id = good.goods_id; store.goodsInfo.color = good.color;
this.setState({ showShops: false, searchStr: "" }); store.goodsInfo.material = good.material;
this.showShops.set(false);
AppToaster.show({
message: "如果你将这个材质赋予到板件,我们会把材质的板材信息拷贝到板件中",
timeout: 2500,
});
}; };
handleHideSelect = () => componentDidMount()
{ {
if (this.closeTimeId) this.container.addEventListener('keydown', e => e.stopPropagation());
clearTimeout(this.closeTimeId); }
this.closeTimeId = setTimeout(() =>
{
this.setState({ showShops: false });
}, 300);
};
render() render()
{ {
return ( return (
<label <label
className="select-shop" className="select-shop"
ref={el => this.container = el}
onKeyDown={e => e.stopPropagation()} onKeyDown={e => e.stopPropagation()}
> >
<span style={{ width: 60 }}></span> <div className="flex">
<div> <SetBoardDataBlock
<input type={CheckObjectType.BR}
disabled pars={this.matPars}
placeholder="点击选择商品" option={this.props.store.goodsInfo as any}
value={this.props.store.shopInfo.name} isInline={true}
/> />
<Button <Button
text="选择" text="选择"
@ -93,31 +62,10 @@ export class MaterialLinkShopId extends React.Component<{ store?: MaterialStore;
onClick={this.handleOpenShopList} onClick={this.handleOpenShopList}
/> />
</div> </div>
{ <GoodsList
this.state.showShops && open={this.showShops}
<div className="search-shop" select={this.handleSelectGood}
tabIndex={-1} />
>
<InputGroup
placeholder="搜索要关联的商品"
value={this.state.searchStr}
onChange={this.handleChange}
autoFocus
onBlur={this.handleHideSelect}
rightElement={<Icon icon="double-caret-vertical" />} />
<ul className={Classes.LIST_UNSTYLED}>
{
this.goods.map(v =>
<li
value={v.goods_id}
onClick={() => this.handleSelectGood(v)}
>
{v.goods_name}
</li>)
}
</ul>
</div>
}
</label> </label>
); );
} }

@ -15,7 +15,7 @@ export interface IBoardFindOption extends IBaseOption
[EBoardKeyList.RoomName]: string; [EBoardKeyList.RoomName]: string;
[EBoardKeyList.CabinetName]: string; [EBoardKeyList.CabinetName]: string;
brName: string; //板名 brName: string; //板名
brMat: string; //板材 [EBoardKeyList.BrMat]: string; //板材
[EBoardKeyList.Mat]: string; [EBoardKeyList.Mat]: string;
[EBoardKeyList.Color]: string; [EBoardKeyList.Color]: string;
[EBoardKeyList.Lines]: LinesType; [EBoardKeyList.Lines]: LinesType;

@ -69,7 +69,7 @@ export class BoardFindStore extends BoardStore
roomName: "", roomName: "",
cabinetName: "", cabinetName: "",
brName: "", brName: "",
brMat: "", [EBoardKeyList.BrMat]: "",
material: "", material: "",
color: "", color: "",
lines: LinesType.Positive, lines: LinesType.Positive,

@ -1,11 +1,9 @@
import { Intent } from "@blueprintjs/core"; import { Intent } from "@blueprintjs/core";
import { action, autorun, observable } from "mobx"; import { action, autorun, observable, toJS } from "mobx";
import { end } from "xaop"; import { end } from "xaop";
import { app } from "../../ApplicationServices/Application"; import { app } from "../../ApplicationServices/Application";
import { ShopUrls } from "../../Common/HostUrl";
import { PostJson, RequestStatus } from "../../Common/Request";
import { Singleton } from "../../Common/Singleton"; import { Singleton } from "../../Common/Singleton";
import { PhysicalMaterialRecord } from "../../DatabaseServices/PhysicalMaterialRecord"; import { IGoodProps, PhysicalMaterialRecord } from "../../DatabaseServices/PhysicalMaterialRecord";
import { TextureTableRecord } from "../../DatabaseServices/Texture"; import { TextureTableRecord } from "../../DatabaseServices/Texture";
import { MaterialEditor } from "../../Editor/MaterialEditor"; import { MaterialEditor } from "../../Editor/MaterialEditor";
import { IDirectoryProps } from "../Components/SourceManage/CommonPanel"; import { IDirectoryProps } from "../Components/SourceManage/CommonPanel";
@ -30,9 +28,10 @@ export class MaterialStore extends Singleton
protected reactionDestroy; protected reactionDestroy;
@observable isOpenTexture = false; @observable isOpenTexture = false;
@observable isOpenImgList = false; @observable isOpenImgList = false;
@observable shopInfo = { @observable goodsInfo: IGoodProps = {
name: "", name: "",
id: "", color: "",
material: "",
}; };
currentEditorStore: TextureStore; currentEditorStore: TextureStore;
@ -133,8 +132,7 @@ export class MaterialStore extends Singleton
this.Material.useBumpMap = this.bumpMaping.use.get(); this.Material.useBumpMap = this.bumpMaping.use.get();
this.Material.useRoughnessMap = this.roughnessMaping.use.get(); this.Material.useRoughnessMap = this.roughnessMaping.use.get();
if (this.shopInfo.id) this.Material.GoodsInfo = toJS(this.goodsInfo);
this.Material.shopId = this.shopInfo.id;
this.textureMaping.UpdateStore(this.textureMaping.textureId); this.textureMaping.UpdateStore(this.textureMaping.textureId);
this.bumpMaping.UpdateStore(this.bumpMaping.textureId); this.bumpMaping.UpdateStore(this.bumpMaping.textureId);
@ -157,18 +155,7 @@ export class MaterialStore extends Singleton
this.bumpScale.set(this.Material.bumpScale); this.bumpScale.set(this.Material.bumpScale);
this.roughness.set(this.Material.roughness); this.roughness.set(this.Material.roughness);
this.shopInfo.id = this.Material.shopId; Object.assign(this.goodsInfo, this.Material.GoodsInfo);
this.shopInfo.name = "";
if (this.shopInfo.id)
{
let data = await PostJson(ShopUrls.get, {
goods_id: [this.shopInfo.id]
});
if (data.err_code === RequestStatus.Ok && data.goods.length > 0)
{
this.shopInfo.name = data.goods[0].goods_name;
}
}
} }
} }
InitTextureStore() InitTextureStore()

Loading…
Cancel
Save