| | |
| | | |
| | | const MkIcon = asyncComponent(() => import('@/components/mk-icon')) |
| | | const TableComponent = asyncComponent(() => import('./tablecomponent')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms')) |
| | | const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork')) |
| | |
| | | }) |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | submitConfig = (type) => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({originConfig: fromJS(config).toJS(), saving: true}) |
| | | this.props.handleSave(config) |
| | | if (type === 'cache') { |
| | | this.setState({originConfig: fromJS(config).toJS()}) |
| | | this.props.handleSave(config) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerMenuSave') |
| | | }, 100) |
| | | message.success(<span>表单配置已保存至本地(<span style={{color: 'red'}}>尚未提交至云端</span>)。</span>) |
| | | } else { |
| | | this.setState({originConfig: fromJS(config).toJS(), saving: true}) |
| | | this.props.handleSave(config) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerMenuSave') |
| | | }, 100) |
| | | } |
| | | } |
| | | |
| | | clearConfig = () => { |
| | |
| | | <Collapse accordion defaultActiveKey="1" bordered={false}> |
| | | <Panel header="基本信息" key="0"> |
| | | <TableComponent /> |
| | | <NormalCopy /> |
| | | </Panel> |
| | | <Panel header="表单" key="1"> |
| | | <div className="search-element"> |
| | |
| | | <div className="setting"> |
| | | <Card title="表单配置" bordered={false} extra={ |
| | | <div> |
| | | <Button className="mk-border-green" onClick={() => this.submitConfig('cache')}>存草稿</Button> |
| | | <PasteForms type="toolbar" config={config} update={this.pasteFields}/> |
| | | <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>保存</Button> |
| | | <Button type="primary" id="save-modal-config" loading={saving} onClick={() => this.submitConfig()}>保存</Button> |
| | | <Button disabled={saving} onClick={this.cancelConfig}>返回</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |