From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 十月 2021 23:17:08 +0800
Subject: [PATCH] 2021-10-21

---
 src/pc/components/login/normal-login/index.jsx |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/pc/components/login/normal-login/index.jsx b/src/pc/components/login/normal-login/index.jsx
index 9f0d75e..1ffb207 100644
--- a/src/pc/components/login/normal-login/index.jsx
+++ b/src/pc/components/login/normal-login/index.jsx
@@ -10,10 +10,11 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import { resetStyle } from '@/utils/utils-custom.js'
+import getWrapForm from './options'
 import './index.scss'
 
 const LoginForm = asyncComponent(() => import('./loginform'))
-const WrapComponent = asyncIconComponent(() => import('../wrapsetting'))
+const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
 
 class PropCardEditComponent extends Component {
   static propTpyes = {
@@ -43,11 +44,11 @@
         width: card.width || 24,
         name: card.name,
         subtype: card.subtype,
-        wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] },
+        wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'], shortcut: 'remember' },
         style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw'},
         loginWays: [
-          {type: 'uname_pwd', label: '璐﹀彿瀵嗙爜', remember: 'true'},
-          {type: 'sms_vcode', label: '鐭俊楠岃瘉鐮�'},
+          {type: 'uname_pwd', label: '璐﹀彿鐧诲綍', shortcut: 'remember'},
+          {type: 'sms_vcode', label: '鐭俊鐧诲綍'},
           {type: 'app_scan', label: '鎵爜鐧诲綍'},
         ]
       }
@@ -141,6 +142,24 @@
     }
   }
 
+  getWrapForms = () => {
+    const { wrap } = this.state.card
+
+    return getWrapForm(wrap)
+  }
+
+  updateWrap = (res) => {
+    let card = fromJS(this.state.card).toJS()
+
+    card.wrap = res
+
+    if (res.shortcut) {
+      card.loginWays[0].shortcut = res.shortcut
+    }
+
+    this.updateComponent(card)
+  }
+
   render() {
     const { card, dict } = this.state
     let style = resetStyle(card.style)
@@ -159,7 +178,9 @@
       <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
-            <WrapComponent config={card} updateConfig={this.updateComponent} />
+            <NormalForm title="鐧诲綍璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
+              <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/>
+            </NormalForm>
             <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />
             <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
           </div>

--
Gitblit v1.8.0