!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} type={BoardModalType.Dr}
helpUrl="https://cfcad.cn/help/#/DrillingFunction/DrillingInterface" helpUrl="https://cfcad.cn/help/#/DrillingFunction/DrillingInterface"
isImpExp isImpExp
configurationType="排钻配置"
footerChildren={ footerChildren={
<> <>
<Button <Button

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

@ -45,6 +45,7 @@ interface IConfigProps
isUpdate?: boolean; isUpdate?: boolean;
isExpImp?: boolean; isExpImp?: boolean;
otherConfig?: () => AnyObject; otherConfig?: () => AnyObject;
configurationType?: string;
} }
/** /**
@ -206,7 +207,7 @@ export class UserConfig extends React.Component<IConfigProps, {}>{
this.props.isExpImp && <> this.props.isExpImp && <>
<PopoverInput <PopoverInput
title="导入" title="导入"
placeholder="输入配置名称(选填)" placeholder="输入导入后配置名称(选填)"
confirm={this.handleImport} confirm={this.handleImport}
/> />
<PopoverCheckBoxes <PopoverCheckBoxes
@ -252,6 +253,6 @@ export class UserConfig extends React.Component<IConfigProps, {}>{
if (this.props.store.GetOtherConfig) if (this.props.store.GetOtherConfig)
data.other = await this.props.store.GetOtherConfig(configs); 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={ content={
<Card> <Card>
<input type="text" <input type="text"
style={{ height: 30 }} style={{ height: 30, width: 200 }}
className={Classes.INPUT} className={Classes.INPUT}
value={this.state.value} value={this.state.value}
onChange={this.handleChange} onChange={this.handleChange}

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

Loading…
Cancel
Save