| | |
| | | <Button type="primary" onClick={() => {this.handleSubBtn('confirm')}}>{this.state.dict['header.confirm']}</Button> |
| | | <Button onClick={() => {this.handleSubBtn('close')}}>{this.state.dict['header.close']}</Button> |
| | | </div> |
| | | {this.state.tabview === 'template' && |
| | | <div className="editboard"> |
| | | <div className="workplace"> |
| | | <Button className="top-btn" onClick={this.exittabview}>{this.state.dict['header.cancel']}</Button> |
| | | {this.state.tabview === 'template' && <Tabs defaultActiveKey="1"> |
| | | <TabPane tab="系统模板" key="1"> |
| | | <Row> |
| | | {this.state.sysTemplates.map((template, index) => { |
| | | if (template.hidden) return '' |
| | | {this.state.tabview === 'template' ? |
| | | <div className="editboard"> |
| | | <div className="workplace"> |
| | | <Button className="top-btn mk-yellow" onClick={this.exittabview}>{this.state.dict['header.cancel']}</Button> |
| | | {this.state.tabview === 'template' && <Tabs defaultActiveKey="1"> |
| | | <TabPane tab="系统模板" key="1"> |
| | | <Row> |
| | | {this.state.sysTemplates.map((template, index) => { |
| | | if (template.hidden) return '' |
| | | |
| | | return ( |
| | | <Col key={`${index}`} span={8}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'sys')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | })} |
| | | </Row> |
| | | </TabPane> |
| | | <TabPane tab="已使用模板" key="2"> |
| | | <Row> |
| | | <Col span={8}> |
| | | <Search placeholder="请输入菜单名称" defaultValue={this.state.tempSearchKey} onSearch={value => {this.setState({tempSearchKey: value})}} enterButton /> |
| | | </Col> |
| | | </Row> |
| | | <Row> |
| | | {this.state.usedTemplates && this.state.usedTemplates.map((template, index) => { |
| | | if (template.title.toLowerCase().indexOf(this.state.tempSearchKey.toLowerCase()) >= 0) { |
| | | return ( |
| | | <Col key={template.type + index} span={8}> |
| | | <Col key={`${index}`} span={8}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'user')}}>使用模板</Button> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'sys')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return '' |
| | | } |
| | | })} |
| | | </Row> |
| | | </TabPane> |
| | | </Tabs>} |
| | | </div> |
| | | </div>} |
| | | {this.state.tabview === 'CommonTable' && |
| | | })} |
| | | </Row> |
| | | </TabPane> |
| | | <TabPane tab="已使用模板" key="2"> |
| | | <Row> |
| | | <Col span={8}> |
| | | <Search placeholder="请输入菜单名称" defaultValue={this.state.tempSearchKey} onSearch={value => {this.setState({tempSearchKey: value})}} enterButton /> |
| | | </Col> |
| | | </Row> |
| | | <Row> |
| | | {this.state.usedTemplates && this.state.usedTemplates.map((template, index) => { |
| | | if (template.title.toLowerCase().indexOf(this.state.tempSearchKey.toLowerCase()) >= 0) { |
| | | return ( |
| | | <Col key={template.type + index} span={8}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'user')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return '' |
| | | } |
| | | })} |
| | | </Row> |
| | | </TabPane> |
| | | </Tabs>} |
| | | </div> |
| | | </div> : null |
| | | } |
| | | {this.state.tabview === 'CommonTable' ? |
| | | <ComTableConfig |
| | | menu={this.state.editMenu} |
| | | optionLibs={this.state.optionLibs} |
| | | reloadmenu={() => {this.props.reload()}} |
| | | handleView={this.handleView} |
| | | /> |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'Modal' && |
| | | {this.state.tabview === 'Modal' ? |
| | | <ModalConfig |
| | | menu={this.state.editMenu} |
| | | optionLibs={this.state.optionLibs} |
| | |
| | | editAction={this.state.editAction} |
| | | subConfig={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'SubTable' && |
| | | {this.state.tabview === 'SubTable' ? |
| | | <SubTable |
| | | menu={this.state.editMenu} |
| | | optionLibs={this.state.optionLibs} |
| | |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' && |
| | | {this.state.tabview === 'FormTab' ? |
| | | <FormTabConfig |
| | | menu={this.state.editMenu} |
| | | optionLibs={this.state.optionLibs} |
| | | btnTab={this.state.btnTab} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> |
| | | /> : null |
| | | } |
| | | {/* 图片预览 */} |
| | | <Preview cancel={this.cancelPrePicture} preview={this.state.preview} template={this.state.pretemplate} confirm={this.useTemplate}/> |