A web fix

pull/22/head
雷二猛 2019-11-29 19:43:53 +08:00
parent fb686d64fa
commit 9c4a9bf24c
1 changed files with 7 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import moment from 'moment';
class ComForm extends React.Component { class ComForm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.isFirstRender = true;
this.state = { this.state = {
loading: false, loading: false,
type: null, type: null,
@ -85,9 +86,13 @@ class ComForm extends React.Component {
verifyButtonStatus = () => { verifyButtonStatus = () => {
const data = this.props.form.getFieldsValue(); const data = this.props.form.getFieldsValue();
const b1 = data['type'] && data['name'] && this.state.command; let b1 = data['type'] && data['name'] && this.state.command;
const b2 = store.targets.filter(x => x).length > 0; const b2 = store.targets.filter(x => x).length > 0;
const b3 = this.state.args[data['trigger']]; const b3 = this.state.args[data['trigger']];
if (!b1 && this.isFirstRender && store.record.id) {
this.isFirstRender = false;
b1 = true
}
return [b1, b2, b3]; return [b1, b2, b3];
}; };