| | |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | if (config.enabled && this.verifyConfig()) { |
| | | let _pass = this.verifyConfig(config) |
| | | |
| | | if (config.enabled && !_pass) { |
| | | config.enabled = false |
| | | config.force = true |
| | | } else if (!config.enabled && config.force && _pass) { |
| | | config.enabled = true |
| | | delete config.force |
| | | } |
| | | |
| | | if (config.cacheUseful !== 'true') { |
| | |
| | | onEnabledChange = () => { |
| | | const { config } = this.state |
| | | |
| | | if (!config || (!config.enabled && this.verifyConfig(true))) { |
| | | return |
| | | } |
| | | let _config = {...config, enabled: !config.enabled} |
| | | |
| | | this.setState({ |
| | | config: {...config, enabled: !config.enabled} |
| | | }) |
| | | delete _config.force |
| | | |
| | | if (!_config.enabled) { |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } else if (this.verifyConfig(_config)) { |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } |
| | | } |
| | | |
| | | verifyConfig = (show) => { |
| | | const { config } = this.state |
| | | verifyConfig = (config) => { |
| | | let error = '' |
| | | let searchSum = 0 |
| | | let swipes = [] |
| | |
| | | } |
| | | } |
| | | |
| | | if (show && error) { |
| | | if (config.enabled && error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error, |
| | |
| | | }) |
| | | } |
| | | |
| | | return error |
| | | return error === '' |
| | | } |
| | | |
| | | // 更新配置信息 |
| | |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |