!1492 功能:<根据板件名改属性>增加配置导入导出.

pull/1492/MERGE
林三 3 years ago committed by ChenX
parent 38ef5c3845
commit 2a6b45556a

@ -104,6 +104,7 @@ export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> {
type={BoardModalType.Dr}
helpUrl="https://cfcad.cn/help/#/DrillingFunction/DrillingInterface"
isImpExp
configurationType="排钻配置"
footerChildren={
<>
<Button

@ -58,6 +58,8 @@ export class UpdateBoardInfoModal extends React.Component<IUpdateBoardInfoModalP
close={() => { app.Editor.ModalManage.Destory(); }}
store={store}
type={BoardModalType.UpdateBoardInfo}
isImpExp
configurationType="板件名配置"
footerChildren={
<>

@ -45,6 +45,7 @@ interface IConfigProps
isUpdate?: boolean;
isExpImp?: boolean;
otherConfig?: () => AnyObject;
configurationType?: string;
}
/**
@ -206,7 +207,7 @@ export class UserConfig extends React.Component<IConfigProps, {}>{
this.props.isExpImp && <>
<PopoverInput
title="导入"
placeholder="输入配置名称(选填)"
placeholder="输入导入后配置名称(选填)"
confirm={this.handleImport}
/>
<PopoverCheckBoxes
@ -252,6 +253,6 @@ export class UserConfig extends React.Component<IConfigProps, {}>{
if (this.props.store.GetOtherConfig)
data.other = await this.props.store.GetOtherConfig(configs);
FileSystem.WriteFile("排钻配置.json", JSON.stringify(data));
FileSystem.WriteFile(this.props.configurationType + ".json", JSON.stringify(data));
};
}

@ -31,7 +31,7 @@ export class PopoverInput extends Component<IPopoverInputProps, { value: string;
content={
<Card>
<input type="text"
style={{ height: 30 }}
style={{ height: 30, width: 200 }}
className={Classes.INPUT}
value={this.state.value}
onChange={this.handleChange}

@ -28,6 +28,7 @@ interface IModalProps
logo?: boolean;
helpUrl?: string;
isImpExp?: boolean;
configurationType?: string;
}
export class CommonModal extends Component<IModalProps>{
@ -53,7 +54,8 @@ export class CommonModal extends Component<IModalProps>{
store={this.props.store}
style={this.props.footerStyle}
rootStyle={this.props.footerRootStyle}
type={this.props.type} >
type={this.props.type}
configurationType={this.props.configurationType}>
{
this.props.footerChildren
}
@ -224,6 +226,7 @@ interface IModalFooterProps
type?: BoardModalType,
isImpExp?: boolean;
rootStyle?: React.CSSProperties,
configurationType: string;
}
export class ModalFooter extends Component<IModalFooterProps>
@ -239,7 +242,7 @@ export class ModalFooter extends Component<IModalFooterProps>
<div className={Classes.DIALOG_FOOTER} style={this.props.rootStyle} >
{
this.props.hasConfig &&
<UserConfig isExpImp={this.props.isImpExp} store={this.props.store} type={this.props.type} />
<UserConfig isExpImp={this.props.isImpExp} store={this.props.store} type={this.props.type} configurationType={this.props.configurationType} />
}
<div className={Classes.DIALOG_FOOTER_ACTIONS} style={this.props.style}>
{this.props.children}

Loading…
Cancel
Save