| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const LoginForm = asyncComponent(() => import('./loginform')) |
| | |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let ismob = sessionStorage.getItem('appType') === 'mob' |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | |
| | | width: card.width || 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd', 'sms_vcode'] }, |
| | | wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] }, |
| | | style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw' }, |
| | | loginWays: [ |
| | | {type: 'uname_pwd', label: '账号密码', remember: 'true', labelStyle: {}, submitStyle: {}, submitLabel: '登录'}, |
| | | {type: 'sms_vcode', label: '短信验证码', labelStyle: {}, submitStyle: {}, submitLabel: '登录'} |
| | | ] |
| | | } |
| | | |
| | | if (ismob) { |
| | | delete _card.style.width |
| | | delete _card.style.borderRadius |
| | | delete _card.style.marginLeft |
| | | |
| | | _card.style.paddingTop = '20px' |
| | | } |
| | | |
| | | if (card.config) { |
| | |
| | | |
| | | render() { |
| | | const { card, dict } = this.state |
| | | let style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="login-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <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} /> |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <LoginForm loginWays={card.loginWays} wrap={card.wrap} dict={dict} /> |
| | | <LoginForm loginWays={card.loginWays} wrap={card.wrap} menuId={card.uuid} dict={dict} /> |
| | | </div> |
| | | ) |
| | | } |