!397 写入排钻规则时修改本地用户当前配置 以及 #IZ088

pull/397/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent d81a8de16a
commit 236137e1d2

@ -67,9 +67,9 @@ export function MatrixToPreViewMat(mat: Matrix4, view: Viewer, obj: Object3D, di
else
obj.position.set(-view.Width / 2 + 180, -view.Height / 2 + 130, 0);
obj.updateMatrix();
let tempMat = mat.clone();
tempMat.multiplyMatrices(view.Camera.matrixWorldInverse, tempMat);
tempMat.multiplyMatrices(view.PreViewer.Camera.matrixWorld, tempMat);
obj.quaternion.setFromRotationMatrix(tempMat);
obj.updateMatrix();
}

@ -48,7 +48,7 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
}
private saveAndDrilling = () =>
{
userConfigStore.SaveConfig(BoardModalType.Dr, this.props.store);
userConfigStore.SaveConfig(BoardModalType.Dr, this.props.store, false, false);
app.Editor.ModalManage.Clear();
commandMachine.ExecCommand('PZ');
}

@ -4,6 +4,7 @@ import { DataAdapter } from "../../Common/DataAdapter";
import { IConfigOption } from "../Components/Board/UserConfig";
import { BoardStore } from "./BoardStore";
import { DrillingOption, SpacingType } from "./drillInterface";
import { userConfig } from "../../Editor/UserConfig";
export class DrillStore extends BoardStore
{
@ -144,6 +145,8 @@ export class DrillStore extends BoardStore
{
Object.assign(this.rules[this.m_CurrentRuleIndex], this.m_Option);
}
//写入时修改用户当前配置
userConfig.DrillConfigs.set(this.type, toJS(this.rules));
}
SaveConfig()
{

@ -129,7 +129,7 @@ export class UserConfigStore extends Singleton
}
return null;
}
async SaveConfig(type: BoardModalType, store: IConfigStore, isInit: boolean = false)
async SaveConfig(type: BoardModalType, store: IConfigStore, isInit: boolean = false, isCheckName = false)
{
let name = this.configName;
if (name === "")
@ -144,7 +144,7 @@ export class UserConfigStore extends Singleton
let configs = (await this.GetAllConfigs(type)) || {};
let isContinue = true;
if (configs.hasOwnProperty(name) && !isInit)
if (configs.hasOwnProperty(name) && !isInit && isCheckName)
isContinue = confirm("配置名称已存在,是否覆盖");
if (!isContinue) return;

Loading…
Cancel
Save