king
2019-12-12 f22bb55c4ff50a8a63c795487b057c0cebdae649
src/components/sidemenu/editthdmenu/index.jsx
@@ -5,7 +5,7 @@
import HTML5Backend from 'react-dnd-html5-backend'
import { notification, Modal, Button, Spin, Icon, Col, Card, Tabs, Row, Input } from 'antd'
import moment from 'moment'
import Preview from '@/components/preview'
import Preview from './preview'
import TransferForm from '@/components/transferform'
import Utils from '@/utils/utils.js'
import DragElement from '../menuelement'
@@ -53,6 +53,8 @@
    menuConfig: '',
    tempSearchKey: '',
    loading: false,
    preview: null,
    pretemplate: null,
    baseTemplates: [{
      title: '基础表格',
      type: 'CommonTable',
@@ -300,10 +302,11 @@
    })
  }
  previewPicture = (url) => {
  previewPicture = (template) => {
    // 图片预览
    this.setState({
      preview: url
      preview: template.url,
      pretemplate: template
    })
  }
@@ -444,9 +447,8 @@
                      <Col key={template.type} span={8}>
                        <Card
                          title={template.title}>
                          <img onClick={() => {this.previewPicture(template.url)}} src={template.url} alt=""/>
                          <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/>
                          <div className="card-operation">
                            {/* <Button type="primary" onClick={() => {this.previewPicture(template.url)}}>预览</Button> */}
                            <Button type="primary" onClick={() => {this.useTemplate(template)}}>使用模板</Button>
                          </div>
                        </Card>
@@ -468,9 +470,8 @@
                        <Col key={template.type + index} span={8}>
                          <Card
                            title={template.title}>
                            <img onClick={() => {this.previewPicture(template.url)}} src={template.url} alt=""/>
                            <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/>
                            <div className="card-operation">
                              {/* <Button type="primary" onClick={() => {this.previewPicture(template.url)}}>预览</Button> */}
                              <Button type="primary" onClick={() => {this.useTemplate(template)}}>使用模板</Button>
                            </div>
                          </Card>
@@ -502,7 +503,7 @@
          />
        }
        {/* 图片预览 */}
        <Preview cancel={this.cancelPrePicture} preview={this.state.preview}/>
        <Preview cancel={this.cancelPrePicture} preview={this.state.preview} template={this.state.pretemplate} confirm={this.useTemplate}/>
        {/* 解冻菜单模态框 */}
        <Modal
          title={this.state.dict['header.thawmenu']}