|
|
@@ -10,7 +10,8 @@ class DataConnectBox extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- password: ''
|
|
|
+ password: '',
|
|
|
+ passwordEditing: false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -43,7 +44,7 @@ class DataConnectBox extends React.Component {
|
|
|
|
|
|
render() {
|
|
|
const { dispatch, dataConnect } = this.props;
|
|
|
- const { password } = this.state;
|
|
|
+ const { password, passwordEditing } = this.state;
|
|
|
const operation = dataConnect.newOne.boxOperation;
|
|
|
const disabled = operation === 'view';
|
|
|
|
|
|
@@ -209,19 +210,27 @@ class DataConnectBox extends React.Component {
|
|
|
wrapperCol: { span: 16 }
|
|
|
}}
|
|
|
validateStatus={operation === 'create' ? ((dataConnect.newOne.password === undefined || dataConnect.newOne.password) ? 'success' : 'error') : 'success'}
|
|
|
- help={operation === 'create' ? ((dataConnect.newOne.password === undefined || dataConnect.newOne.password) ? '' : '密码不能为空') : ''}
|
|
|
+ help={operation === 'create' ? ((passwordEditing || dataConnect.newOne.password === undefined || dataConnect.newOne.password) ? '' : '密码不能为空') : ''}
|
|
|
>
|
|
|
<Input
|
|
|
disabled={disabled}
|
|
|
className='password'
|
|
|
type='password'
|
|
|
value={password}
|
|
|
+ onFocus={e => {
|
|
|
+ this.setState({
|
|
|
+ passwordEditing: true
|
|
|
+ });
|
|
|
+ }}
|
|
|
onChange={(e) => {
|
|
|
this.setState({
|
|
|
password: e.target.value
|
|
|
});
|
|
|
}}
|
|
|
onBlur={(e) => {
|
|
|
+ this.setState({
|
|
|
+ passwordEditing: false
|
|
|
+ });
|
|
|
dispatch({ type: 'dataConnect/setNewModelField', name: 'password', value: e.target.value });
|
|
|
}}
|
|
|
/>
|