mirror of https://github.com/openspug/spug
A web fix
parent
fb686d64fa
commit
9c4a9bf24c
|
@ -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];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue