From bbe52230e61c5b911da9e22e6a11c332b52baf7c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 三月 2020 16:37:54 +0800 Subject: [PATCH] 2020-03-18 --- src/components/sidemenu/editthdmenu/index.jsx | 103 ++++++++++++++++++++++++++------------------------- 1 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx index 9cf82a0..79c7c8e 100644 --- a/src/components/sidemenu/editthdmenu/index.jsx +++ b/src/components/sidemenu/editthdmenu/index.jsx @@ -766,68 +766,69 @@ <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} @@ -840,9 +841,9 @@ 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} @@ -853,16 +854,16 @@ 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}/> -- Gitblit v1.8.0