From 9e0a0749233c15711fd3259afa1f19867d214df7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 22 六月 2020 16:07:35 +0800
Subject: [PATCH] 2020-06-22

---
 src/views/mobdesign/index.jsx |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index b98baf9..d7bc86b 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -4,7 +4,7 @@
 import { fromJS } from 'immutable'
 import HTML5Backend from 'react-dnd-html5-backend'
 import { SketchPicker } from 'react-color'
-import { Icon, Tabs, notification } from 'antd'
+import { Icon, Tabs, notification, Modal } from 'antd'
 
 import Api from '@/api'
 import zhCN from '@/locales/zh-CN/mob.js'
@@ -14,6 +14,7 @@
 import './index.scss'
 
 const { TabPane } = Tabs
+const { confirm } = Modal
 
 const Header = asyncComponent(() => import('@/mob/header'))
 const MobShell = asyncComponent(() => import('@/mob/mobshell'))
@@ -97,7 +98,29 @@
     })
   }
 
-  
+  deleteCard = (id) => {
+    let _this = this
+    let config = fromJS(this.state.config).toJS()
+
+    confirm({
+      title: '纭畾鍒犻櫎鍏冪礌鍚楋紵',
+      content: '',
+      okText: this.state.dict['mob.confirm'],
+      cancelText: this.state.dict['mob.cancel'],
+      onOk() {
+        config.components = config.components.filter(item => item.uuid !== id)
+
+        _this.setState({
+          config: config
+        })
+      },
+      onCancel() {}
+    })
+  }
+
+  editCard = (element) => {
+    console.log(element)
+  }
 
   updateConfig = (config) => {
     this.setState({
@@ -126,7 +149,7 @@
             </div>
             {appType === 'mob' && config ?
               <div className="mob-shell">
-                <MobShell config={config} handleList={this.updateConfig} />
+                <MobShell config={config} deleteCard={this.deleteCard} editCard={this.editCard} handleList={this.updateConfig} />
               </div> : null
             }
             <div className="mob-setting">

--
Gitblit v1.8.0