From 78893aac37ff8bdc2ef339d91f383e40aa530300 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 05 十一月 2019 17:36:54 +0800 Subject: [PATCH] update-header --- src/components/sidemenu/index.jsx | 83 ++++++++++++++++++++++++++++++----------- 1 files changed, 61 insertions(+), 22 deletions(-) diff --git a/src/components/sidemenu/index.jsx b/src/components/sidemenu/index.jsx index 138a695..505c024 100644 --- a/src/components/sidemenu/index.jsx +++ b/src/components/sidemenu/index.jsx @@ -3,18 +3,20 @@ import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' -import { Menu, Icon, Button, notification, Modal, Spin, Tabs, Radio, Card, Row, Col} from 'antd' +// import { Menu, Icon, Button, notification, Modal, Spin, Tabs, Card, Row, Col} from 'antd' +import { Menu, Icon, Button, notification, Modal, Spin, Tabs} from 'antd' import HTML5Backend from 'react-dnd-html5-backend' import { DndProvider } from 'react-dnd' import {modifyTabview, resetEditLevel} from '@/store/action' import TransferForm from '@/components/transferform' +import Preview from '@/components/preview' import DragElement from './dragelement' import MenuForm from './menuform' import zhCN from '@/locales/zh-CN/header.js' import enUS from '@/locales/en-US/header.js' import Api from '@/api' import './index.scss' -import nortable from '@/assets/img/normaltable.jpg' +// import nortable from '@/assets/img/normaltable.jpg' const { SubMenu } = Menu const { confirm } = Modal @@ -48,7 +50,8 @@ thawmenulist: null, createThirdMenu: false, dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, - openKeys: null + openKeys: null, + preview: null } async loadsubmenu (menu) { @@ -586,6 +589,18 @@ }) } + previewPicture = (url) => { + this.setState({ + preview: url + }) + } + + cancelPrePicture = () => { + this.setState({ + preview: null + }) + } + render () { const editShow = (this.props.editState && !this.props.editLevel) || false return ( @@ -687,10 +702,11 @@ {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawmenulist}/>} </Modal> - {this.props.editLevel === 'level3' && this.state.createThirdMenu && <div className="editboard"> + {/* {this.props.editLevel === 'level3' && this.state.createThirdMenu && + <div className="editboard"> <div className="workplace"> <Tabs defaultActiveKey="1" onChange={this.callback}> - <TabPane tab="鏂板缓鑿滃崟" key="1"> + <TabPane tab="绯荤粺妯℃澘" key="1"> <Row> <Col span={8}> <Card @@ -699,7 +715,7 @@ }> <img src={nortable} alt=""/> <div className="card-operation"> - <Button type="primary">棰勮</Button> + <Button type="primary" onClick={() => {this.previewPicture(nortable)}}>棰勮</Button> <Button type="primary" onClick={() => {this.createThMenu()}}>浣跨敤妯℃澘</Button> </div> </Card> @@ -711,31 +727,54 @@ }> <img src={nortable} alt=""/> <div className="card-operation"> - <Button type="primary">棰勮</Button> + <Button type="primary" onClick={() => {this.previewPicture(nortable)}}>棰勮</Button> <Button type="primary" onClick={() => {this.createThMenu()}}>浣跨敤妯℃澘</Button> </div> </Card> </Col> </Row> </TabPane> - {/* <TabPane tab="涓夌骇鑿滃崟" key="2"> - <Card - // className="level2-left" - title={ - <div> - <Radio.Group name="radiogroup" defaultValue={1}> - <Radio value={1}>鎺掑簭</Radio> - <Radio value={2}>缂栬緫</Radio> - </Radio.Group> - <Icon onClick={this.enterEdit} className="edit-check" type="plus" /> - </div> - }> - <img src={nortable} alt=""/> - </Card> - </TabPane> */} + <TabPane tab="鑷畾涔夋ā鏉�" key="2"> + <Row> + <Col span={8}> + <Card + title={ + '鍩虹琛ㄦ牸' + }> + <img src={nortable} alt=""/> + <div className="card-operation"> + <Button type="primary" onClick={() => {this.previewPicture(nortable)}}>棰勮</Button> + <Button type="primary" onClick={() => {this.createThMenu()}}>浣跨敤妯℃澘</Button> + </div> + </Card> + </Col> + <Col span={8}> + <Card + title={ + '鏁版嵁琛ㄦ牸' + }> + <img src={nortable} alt=""/> + <div className="card-operation"> + <Button type="primary" onClick={() => {this.previewPicture(nortable)}}>棰勮</Button> + <Button type="primary" onClick={() => {this.createThMenu()}}>浣跨敤妯℃澘</Button> + </div> + </Card> + </Col> + </Row> + </TabPane> + </Tabs> + </div> + </div>} */} + {<div className="editboard"> + <div className="workplace"> + <Tabs defaultActiveKey="1"> + <TabPane tab="缂栬緫妯℃澘" key="1"> + + </TabPane> </Tabs> </div> </div>} + <Preview cancel={this.cancelPrePicture} preview={this.state.preview}/> </aside> ) } -- Gitblit v1.8.0