|
@@ -38,7 +38,7 @@ class Add extends React.PureComponent {
|
|
|
if (!err) {
|
|
|
update({
|
|
|
...values,
|
|
|
- content:this.state.content,
|
|
|
+ content: this.state.content,
|
|
|
createUser: this.state.createUser || this.props.currentUser.name, // 创建人
|
|
|
updateUser: this.props.currentUser.name // 最后修改人
|
|
|
}).then(res => {
|
|
@@ -54,7 +54,7 @@ class Add extends React.PureComponent {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- test =() => {
|
|
|
+ test =(id) => {
|
|
|
if (!this.state.name) {
|
|
|
message.warn('请先提交策略内容!')
|
|
|
return false
|
|
@@ -91,11 +91,11 @@ class Add extends React.PureComponent {
|
|
|
</Form.Item>
|
|
|
<Form.Item label="是否启用">
|
|
|
{getFieldDecorator('enabled', {
|
|
|
- initialValue: false
|
|
|
- })(<Switch onChange={
|
|
|
- (checked) => this.setState({ enabled: checked })} />)}
|
|
|
+ initialValue: enabled
|
|
|
+ })(<Switch checked={enabled} onChange={checked => this.setState({ enabled: checked })} />)}
|
|
|
</Form.Item>
|
|
|
<Form.Item label="策略逻辑开发">
|
|
|
+
|
|
|
<AceEditor
|
|
|
style={{ width: this.state.showTest ? '100%' : '200%' }}
|
|
|
mode="java"
|