From f22bb55c4ff50a8a63c795487b057c0cebdae649 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 12 十二月 2019 09:19:58 +0800
Subject: [PATCH] 2019-12-12

---
 src/components/sidemenu/editthdmenu/index.jsx |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index a93e485..e889af4 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/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}/>
         {/* 瑙e喕鑿滃崟妯℃�佹 */}
         <Modal
           title={this.state.dict['header.thawmenu']}

--
Gitblit v1.8.0