| | |
| | | components: null, // 组件集合 |
| | | revertLoading: false, // 恢复默认设置 |
| | | confirmLoading: false, // 自定义设置模态框加载中 |
| | | dict: window.GLOB.dict, |
| | | lang: sessionStorage.getItem('lang') |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { components, visible } = this.state |
| | | const { components, visible, dict, lang } = this.state |
| | | |
| | | if (window.GLOB.mkHS || window.GLOB.sysType !== 'local') return null |
| | | |
| | | return ( |
| | | <div className="tool-wrap"> |
| | | <Tooltip placement="left" title="自定义设置"> |
| | | <Tooltip placement="left" title={dict['custom_settings'] || '自定义设置'}> |
| | | <Button icon="setting" shape="circle" onClick={this.trigger}/> |
| | | </Tooltip> |
| | | <Modal |
| | | wrapClassName="custom-setting-modal" |
| | | title="自定义设置" |
| | | title={dict['custom_settings'] || '自定义设置'} |
| | | maskClosable={false} |
| | | width={950} |
| | | visible={visible} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | footer={[ |
| | | <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>恢复默认设置</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>取消</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>提交</Button> |
| | | <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{dict['restore_default'] || '恢复默认设置'}</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{dict['cancel'] || '取消'}</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{dict['submit'] || '提交'}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <div className="tip">注:行级按钮快捷键设置无效。</div> |
| | | {lang !== 'en-US' ? <div className="tip">注:行级按钮快捷键设置无效。</div> : null} |
| | | {components && components.length > 0 ? components.map(item => ( |
| | | <div key={item.uuid}> |
| | | <p className="component-title">{item.title}</p> |