| | |
| | | const { confirm } = Modal |
| | | const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config, dict } = this.state |
| | | refreshConfig = () => { |
| | | const { editAction } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: editAction.uuid |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _config = '' |
| | | if (res.LongParam) { |
| | | try { |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _config = '' |
| | | } |
| | | } |
| | | |
| | | if (!_config) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到配置信息!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 版本兼容 |
| | | _config = updateForm(_config) |
| | | |
| | | this.setState({ |
| | | config: null |
| | | }, () => { |
| | | this.setState({ |
| | | config: _config, |
| | | openEdition: res.open_edition || '', |
| | | originConfig: fromJS(_config).toJS() |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { editAction } = this.props |
| | | const { config, dict, openEdition } = this.state |
| | | |
| | | if (!config) return null |
| | | |
| | | return ( |
| | | <div className="modal-form-board"> |
| | | <DndProvider backend={HTML5Backend}> |
| | |
| | | <div className="setting"> |
| | | <Card title={dict['header.menu.form.configurable']} bordered={false} extra={ |
| | | <div> |
| | | <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> |
| | | <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={dict} options={['form']} config={this.state.config} refresh={this.updateEditConfig}/> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['model.save']}</Button> |