!2446 功能:设置模块插入时变方框的个数

pull/2445/MERGE
黄诗津 11 months ago committed by ChenX
parent 3f9c1eeeae
commit 17d158585c

@ -690,6 +690,15 @@ export namespace CheckoutValid
}
return "";
}
case "templateDisplayCount":
{
let val = safeEval(v);
if (val < 1 || val > 10000)
{
return "最大显示个数区间为1-10000";
}
return "";
}
default:
return "";
}

@ -44,7 +44,7 @@ export interface IChat
export class UserConfig implements IConfigStore
{
private readonly _version = 36; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
private readonly _version = 37; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
@observable designer = ""; //一键布局的设计师
_renderType: RenderType = RenderType.Wireframe;
@observable maxSize: IMaxSizeProps = {
@ -172,7 +172,7 @@ export class UserConfig implements IConfigStore
pageFooterName: "", //页脚名称
printResolution: 1450,
};
@observable templateDisplayCount: number = 100; //插入模板时显示的最大个数
constructor()
{
this.Init();
@ -272,6 +272,7 @@ export class UserConfig implements IConfigStore
pageFooterName: "",
printResolution: 1450,
});
this.templateDisplayCount = 100;
}
SaveConfig()
{
@ -326,6 +327,7 @@ export class UserConfig implements IConfigStore
printOption: toJS(this.printOption),
show2DPathLine: this.show2DPathLine,
show2DPathObject: this.show2DPathObject,
templateDisplayCount: this.templateDisplayCount,
}
};
}
@ -488,6 +490,10 @@ export class UserConfig implements IConfigStore
this.show2DPathLine = config.option.show2DPathLine;
this.show2DPathObject = config.option.show2DPathObject;
}
if (config.option.version > 36)
{
this.templateDisplayCount = config.option.templateDisplayCount;
}
}
}

@ -51,6 +51,9 @@ export const ColorList: [string, number][] = [
@observer
export class DisplayConfigPanel extends React.Component<{ store: ConfigStore; }>
{
private currentOpt = {
templateDisplayCount: userConfig.templateDisplayCount,
};
@observable private _OpenColorPick = false;
@observable _AAType = "性能";
@observable _ZoomSpeed: number = userConfig.viewSize.zoomSpeed;
@ -423,6 +426,34 @@ export class DisplayConfigPanel extends React.Component<{ store: ConfigStore; }>
</div>
</div>
</div>
<div>
<Tooltip content={"在插入模板时,如果实体个数达到该数量,则只显示长方体"}>
<Label className={Classes.INLINE} >
<span style={{ width: "10rem" }}></span>
<ToasterInput
type={CheckObjectType.CONF}
option={userConfig}
optKey={"templateDisplayCount"}
onChange={(e) => { userConfig.templateDisplayCount = Number(e.target.value); }}
onKeyDown={(e, errorMsg) =>
{
if ([KeyBoard.Escape, KeyBoard.Enter, KeyBoard.Space].includes(e.keyCode) && errorMsg)
{
userConfig.templateDisplayCount = this.currentOpt.templateDisplayCount;
app.Editor.Prompt(errorMsg, LogType.Error);
}
}}
onBlur={(e, hasErr) =>
{
if (hasErr)
userConfig.templateDisplayCount = this.currentOpt.templateDisplayCount;
else
this.currentOpt.templateDisplayCount = userConfig.templateDisplayCount;
}}
/>
</Label>
</Tooltip>
</div>
</Card >
);
}

@ -18,6 +18,7 @@ import { JigUtils } from "../../../Editor/JigUtils";
import { PromptStatus } from "../../../Editor/PromptResult";
import { ParsePlaceEntitys } from "../../../Editor/TranstrolControl/ParsePlaceEntitys";
import { ParsePlacePos, ParsePlacePosWithTemplate, ParsePlacePosWithTemplate2 } from "../../../Editor/TranstrolControl/ParsePlacePos";
import { userConfig } from "../../../Editor/UserConfig";
import { ZeroVec, equaln, equalv3 } from "../../../Geometry/GeUtils";
import { DownPanelStore } from "../../Store/DownPanelStore";
import { IGetRoomInfo } from "./GetRoomCabName";
@ -30,7 +31,7 @@ export async function InsertTemplateByBasePoint(template: TemplateRecord, roomIn
ens = ens.concat(template.Db.Lights.Entitys.filter(l => l.Id.Index > 99));
let nens: Entity[] = [];
let updateTemplate = ens.length < 100;
let updateTemplate = ens.length <= userConfig.templateDisplayCount;
if (updateTemplate)//不再绘制模块
for (let i = 0; i < ens.length; i++)

@ -49,6 +49,7 @@ interface IToasterInputProps extends ISetItemOption
inputClassName?: string;
onBlur?(e?, hasError?: boolean);
onClick?(e?);
onKeyDown?: (e?, errorMsg?: string) => void;
callback?: Function;
selectAll?: boolean;
}
@ -60,7 +61,7 @@ interface IToasterInputProps extends ISetItemOption
export class ToasterInput extends React.Component<IToasterInputProps, {}>
{
private showData: Object;
@observable private errorMsg = "";
@observable errorMsg = "";
@observable private hideErrorMsg = true;
static defaultProps = {
isUpper: false
@ -197,6 +198,7 @@ export class ToasterInput extends React.Component<IToasterInputProps, {}>
placeholder={props.placeHolder}
onChange={this.handleChange}
onClick={this.handleClick}
onKeyDown={(e) => this.props.onKeyDown(e, this.errorMsg)}
onBlur={this.handleBlur}
maxLength={props.maxLength}
onFocus={this.handleFocus}

Loading…
Cancel
Save