!1939 优化:设置见光面封边,扩增10行编辑框

pull/1929/MERGE
黄诗津 2 years ago committed by ChenX
parent 7d9e1976c8
commit 866a17c98b

@ -47,7 +47,7 @@ class SetSmoothEdgeModal extends React.Component<{ brs: Board[]; store: SmoothEd
};
for (let key in store.option)
{
if (key !== "filterArr")
if (key !== "filterArr" && key !== "version")
els.push(
<SetBoardDataItem
key={key}
@ -135,7 +135,7 @@ class SetSmoothEdgeModal extends React.Component<{ brs: Board[]; store: SmoothEd
</H5>
<UL className={Classes.LIST_UNSTYLED}>
{
store.option.filterArr.map((s, i) => <li key={s + i}>
store.option.filterArr.map((s, i) => <li key={i}>
<input type="text" value={store.option.filterArr[i]} onChange={e => store.option.filterArr[i] = e.target.value} />
</li>)
}
@ -203,9 +203,8 @@ class SetSmoothEdgeModal extends React.Component<{ brs: Board[]; store: SmoothEd
for (let i = 0; i < option.filterArr.length; i++)
{
if (!option.filterArr[i])
option.filterArr[i] = ns.shift();
option.filterArr[i] = ns.shift() ?? "";
}
option.filterArr.push(...ns);
}, "拾取板件名");
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.ShowMask();

@ -1,16 +1,17 @@
import { IConfigStore } from "../../UI/Store/BoardStore";
import { observable, toJS } from "mobx";
import { ISmoothEdgeOption, IUiOption } from "../../UI/Store/BoardInterface";
import { IConfigOption } from "../../UI/Components/Board/UserConfig";
import { DataAdapter } from "../../Common/DataAdapter";
import { IConfigOption } from "../../UI/Components/Board/UserConfig";
import { ISmoothEdgeOption, IUiOption } from "../../UI/Store/BoardInterface";
import { IConfigStore } from "../../UI/Store/BoardStore";
export class SmoothEdgeStore implements IConfigStore
{
@observable option: ISmoothEdgeOption = {
version: 1,
smoothEdge: 0,
edge: 0,
scale: 5,
filterArr: new Array(10).fill(""),
filterArr: new Array(20).fill(""),
};
@observable uiOption: IUiOption<ISmoothEdgeOption>;
configName = "default";
@ -18,10 +19,11 @@ export class SmoothEdgeStore implements IConfigStore
InitOption()
{
Object.assign(this.option, {
version: 1,
smoothEdge: 0,
edge: 0,
scale: 5,
filterArr: new Array(10).fill(""),
filterArr: new Array(20).fill(""),
});
}
get UiOption()
@ -39,6 +41,11 @@ export class SmoothEdgeStore implements IConfigStore
}
UpdateOption(cof: IConfigOption<ISmoothEdgeOption>)
{
if (!cof.option.version)
{
cof.option.version = 1;
cof.option.filterArr.push(...(new Array(10).fill("")));
}
Object.assign(this.option, cof.option);
if (this.uiOption)
Object.assign(this.uiOption, DataAdapter.ConvertUIData(cof.option));

@ -1,6 +1,7 @@
#commonModal {
.smooth-edge {
padding-left: 30px;
margin: 10px 20px 0 20px;
padding-left: 10px;
.br-set {
span {
@ -9,7 +10,7 @@
}
&>ul {
height : 100px;
height : 120px;
overflow: auto;
li {

Loading…
Cancel
Save